From c2018ad3deb97f77b8a3949e6e0642b5a99a7442 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Sun, 10 Nov 2019 14:40:50 +0000 Subject: [PATCH] Upgrade to Assimp 5.0 --- .../assimp/code/{ => 3DS}/3DSConverter.cpp | 4 +- .../lib/assimp/code/{ => 3DS}/3DSExporter.cpp | 10 +- .../lib/assimp/code/{ => 3DS}/3DSExporter.h | 0 Engine/lib/assimp/code/{ => 3DS}/3DSHelper.h | 0 .../lib/assimp/code/{ => 3DS}/3DSLoader.cpp | 2 - Engine/lib/assimp/code/{ => 3DS}/3DSLoader.h | 0 Engine/lib/assimp/code/{ => 3MF}/3MFXmlTags.h | 0 .../assimp/code/{ => 3MF}/D3MFExporter.cpp | 6 +- .../lib/assimp/code/{ => 3MF}/D3MFExporter.h | 0 .../assimp/code/{ => 3MF}/D3MFImporter.cpp | 4 +- .../lib/assimp/code/{ => 3MF}/D3MFImporter.h | 0 Engine/lib/assimp/code/3MF/D3MFOpcPackage.cpp | 207 + .../assimp/code/{ => 3MF}/D3MFOpcPackage.h | 7 +- Engine/lib/assimp/code/{ => AC}/ACLoader.cpp | 2 +- Engine/lib/assimp/code/{ => AC}/ACLoader.h | 0 .../lib/assimp/code/{ => AMF}/AMFImporter.cpp | 2 +- .../lib/assimp/code/{ => AMF}/AMFImporter.hpp | 0 .../code/{ => AMF}/AMFImporter_Geometry.cpp | 0 .../code/{ => AMF}/AMFImporter_Macro.hpp | 0 .../code/{ => AMF}/AMFImporter_Material.cpp | 0 .../code/{ => AMF}/AMFImporter_Node.hpp | 0 .../{ => AMF}/AMFImporter_Postprocess.cpp | 26 +- .../lib/assimp/code/{ => ASE}/ASELoader.cpp | 32 +- Engine/lib/assimp/code/{ => ASE}/ASELoader.h | 1 - .../lib/assimp/code/{ => ASE}/ASEParser.cpp | 5 +- Engine/lib/assimp/code/{ => ASE}/ASEParser.h | 12 +- .../code/{ => Assbin}/AssbinExporter.cpp | 5 +- .../assimp/code/{ => Assbin}/AssbinExporter.h | 0 .../assimp/code/{ => Assbin}/AssbinLoader.cpp | 8 +- .../assimp/code/{ => Assbin}/AssbinLoader.h | 0 Engine/lib/assimp/code/Assjson/cencode.c | 109 + Engine/lib/assimp/code/Assjson/cencode.h | 31 + .../lib/assimp/code/Assjson/json_exporter.cpp | 809 ++ .../lib/assimp/code/Assjson/mesh_splitter.cpp | 320 + .../lib/assimp/code/Assjson/mesh_splitter.h | 61 + .../code/{ => Assxml}/AssxmlExporter.cpp | 8 +- .../assimp/code/{ => Assxml}/AssxmlExporter.h | 0 .../lib/assimp/code/{ => B3D}/B3DImporter.cpp | 10 +- .../lib/assimp/code/{ => B3D}/B3DImporter.h | 0 .../lib/assimp/code/{ => BVH}/BVHLoader.cpp | 0 Engine/lib/assimp/code/{ => BVH}/BVHLoader.h | 0 Engine/lib/assimp/code/BaseImporter.h | 361 - Engine/lib/assimp/code/Bitmap.h | 123 - .../code/{ => Blender}/BlenderBMesh.cpp | 0 .../assimp/code/{ => Blender}/BlenderBMesh.h | 0 .../code/{ => Blender}/BlenderCustomData.cpp | 0 .../code/{ => Blender}/BlenderCustomData.h | 0 .../assimp/code/{ => Blender}/BlenderDNA.cpp | 0 .../assimp/code/{ => Blender}/BlenderDNA.h | 2 +- .../assimp/code/{ => Blender}/BlenderDNA.inl | 0 .../code/{ => Blender}/BlenderIntermediate.h | 0 .../code/{ => Blender}/BlenderLoader.cpp | 27 + .../assimp/code/{ => Blender}/BlenderLoader.h | 0 .../code/{ => Blender}/BlenderModifier.cpp | 0 .../code/{ => Blender}/BlenderModifier.h | 0 .../code/{ => Blender}/BlenderScene.cpp | 5 +- .../assimp/code/{ => Blender}/BlenderScene.h | 4 + .../code/{ => Blender}/BlenderSceneGen.h | 0 .../code/{ => Blender}/BlenderTessellator.cpp | 0 .../code/{ => Blender}/BlenderTessellator.h | 6 +- Engine/lib/assimp/code/BlobIOSystem.h | 337 - Engine/lib/assimp/code/ByteSwapper.h | 287 - .../lib/assimp/code/{ => C4D}/C4DImporter.cpp | 155 +- .../lib/assimp/code/{ => C4D}/C4DImporter.h | 18 +- .../assimp/code/{ => CApi}/AssimpCExport.cpp | 2 +- .../code/{ => CApi}/CInterfaceIOWrapper.cpp | 0 .../code/{ => CApi}/CInterfaceIOWrapper.h | 0 Engine/lib/assimp/code/CMakeLists.txt | 1237 +-- .../lib/assimp/code/{ => COB}/COBLoader.cpp | 29 +- Engine/lib/assimp/code/{ => COB}/COBLoader.h | 0 Engine/lib/assimp/code/{ => COB}/COBScene.h | 0 .../lib/assimp/code/{ => CSM}/CSMLoader.cpp | 0 Engine/lib/assimp/code/{ => CSM}/CSMLoader.h | 0 .../code/{ => Collada}/ColladaExporter.cpp | 273 +- .../code/{ => Collada}/ColladaExporter.h | 3 +- .../assimp/code/{ => Collada}/ColladaHelper.h | 8 +- .../code/{ => Collada}/ColladaLoader.cpp | 1337 ++- .../assimp/code/{ => Collada}/ColladaLoader.h | 13 +- .../lib/assimp/code/Collada/ColladaParser.cpp | 3473 ++++++++ .../assimp/code/{ => Collada}/ColladaParser.h | 27 +- Engine/lib/assimp/code/ColladaParser.cpp | 3215 -------- .../lib/assimp/code/{ => Common}/Assimp.cpp | 2 +- .../assimp/code/{ => Common}/BaseImporter.cpp | 48 +- .../assimp/code/{ => Common}/BaseProcess.cpp | 2 +- .../assimp/code/{ => Common}/BaseProcess.h | 0 .../lib/assimp/code/{ => Common}/Bitmap.cpp | 0 .../code/{ => Common}/CreateAnimMesh.cpp | 4 - .../code/{ => Common}/DefaultIOStream.cpp | 33 +- .../code/{ => Common}/DefaultIOSystem.cpp | 161 +- .../code/{ => Common}/DefaultLogger.cpp | 0 .../{ => Common}/DefaultProgressHandler.h | 0 .../lib/assimp/code/{ => Common}/Exporter.cpp | 187 +- .../assimp/code/{ => Common}/FileLogStream.h | 0 .../code/{ => Common}/FileSystemFilter.h | 0 Engine/lib/assimp/code/{ => Common}/IFF.h | 0 .../lib/assimp/code/{ => Common}/Importer.cpp | 19 +- .../lib/assimp/code/{ => Common}/Importer.h | 0 .../code/{ => Common}/ImporterRegistry.cpp | 102 +- .../lib/assimp/code/{ => Common}/PolyTools.h | 0 .../code/{ => Common}/PostStepRegistry.cpp | 76 +- .../code/{ => Common}/RemoveComments.cpp | 0 .../code/{ => Common}/SGSpatialSort.cpp | 0 .../code/{ => Common}/SceneCombiner.cpp | 50 + .../code/{ => Common}/ScenePreprocessor.cpp | 0 .../code/{ => Common}/ScenePreprocessor.h | 0 .../assimp/code/{ => Common}/ScenePrivate.h | 0 .../code/{ => Common}/SkeletonMeshBuilder.cpp | 0 .../assimp/code/{ => Common}/SpatialSort.cpp | 0 .../{ => Common}/SplitByBoneCountProcess.cpp | 0 .../{ => Common}/SplitByBoneCountProcess.h | 0 .../code/{ => Common}/StandardShapes.cpp | 40 +- .../code/{ => Common}/StdOStreamLogStream.h | 0 .../assimp/code/{ => Common}/Subdivision.cpp | 7 +- .../code/{ => Common}/TargetAnimation.cpp | 0 .../code/{ => Common}/TargetAnimation.h | 0 .../lib/assimp/code/{ => Common}/Version.cpp | 14 +- .../{ => Common}/VertexTriangleAdjacency.cpp | 0 .../{ => Common}/VertexTriangleAdjacency.h | 0 .../code/{ => Common}/Win32DebugLogStream.h | 0 .../assimp/code/Common/ZipArchiveIOSystem.cpp | 539 ++ .../assimp/code/{ => Common}/assbin_chunks.h | 0 Engine/lib/assimp/code/{ => Common}/scene.cpp | 18 +- Engine/lib/assimp/code/{ => Common}/simd.cpp | 0 Engine/lib/assimp/code/{ => Common}/simd.h | 0 Engine/lib/assimp/code/D3MFOpcPackage.cpp | 531 -- Engine/lib/assimp/code/{ => DXF}/DXFHelper.h | 0 .../lib/assimp/code/{ => DXF}/DXFLoader.cpp | 10 +- Engine/lib/assimp/code/{ => DXF}/DXFLoader.h | 0 Engine/lib/assimp/code/Exceptional.h | 125 - .../assimp/code/{ => FBX}/FBXAnimation.cpp | 0 .../code/{ => FBX}/FBXBinaryTokenizer.cpp | 12 +- Engine/lib/assimp/code/{ => FBX}/FBXCommon.h | 11 +- .../assimp/code/{ => FBX}/FBXCompileConfig.h | 8 + .../assimp/code/{ => FBX}/FBXConverter.cpp | 634 +- .../lib/assimp/code/{ => FBX}/FBXConverter.h | 106 +- .../lib/assimp/code/{ => FBX}/FBXDeformer.cpp | 0 .../lib/assimp/code/{ => FBX}/FBXDocument.cpp | 8 - .../lib/assimp/code/{ => FBX}/FBXDocument.h | 43 +- .../assimp/code/{ => FBX}/FBXDocumentUtil.cpp | 0 .../assimp/code/{ => FBX}/FBXDocumentUtil.h | 0 .../assimp/code/{ => FBX}/FBXExportNode.cpp | 29 +- .../lib/assimp/code/{ => FBX}/FBXExportNode.h | 12 +- .../code/{ => FBX}/FBXExportProperty.cpp | 255 +- .../assimp/code/{ => FBX}/FBXExportProperty.h | 48 +- .../lib/assimp/code/{ => FBX}/FBXExporter.cpp | 272 +- .../lib/assimp/code/{ => FBX}/FBXExporter.h | 2 +- .../assimp/code/{ => FBX}/FBXImportSettings.h | 39 +- Engine/lib/assimp/code/FBX/FBXImporter.cpp | 198 + .../lib/assimp/code/{ => FBX}/FBXImporter.h | 0 .../lib/assimp/code/{ => FBX}/FBXMaterial.cpp | 63 +- .../assimp/code/{ => FBX}/FBXMeshGeometry.cpp | 36 +- .../assimp/code/{ => FBX}/FBXMeshGeometry.h | 0 Engine/lib/assimp/code/{ => FBX}/FBXModel.cpp | 0 .../code/{ => FBX}/FBXNodeAttribute.cpp | 0 .../lib/assimp/code/{ => FBX}/FBXParser.cpp | 12 +- Engine/lib/assimp/code/{ => FBX}/FBXParser.h | 0 .../assimp/code/{ => FBX}/FBXProperties.cpp | 0 .../lib/assimp/code/{ => FBX}/FBXProperties.h | 0 .../assimp/code/{ => FBX}/FBXTokenizer.cpp | 0 .../lib/assimp/code/{ => FBX}/FBXTokenizer.h | 12 +- Engine/lib/assimp/code/FBX/FBXUtil.cpp | 243 + Engine/lib/assimp/code/{ => FBX}/FBXUtil.h | 34 +- Engine/lib/assimp/code/FBXImporter.cpp | 197 - Engine/lib/assimp/code/FBXUtil.cpp | 120 - Engine/lib/assimp/code/GenericProperty.h | 126 - .../lib/assimp/code/{ => HMP}/HMPFileData.h | 0 .../lib/assimp/code/{ => HMP}/HMPLoader.cpp | 8 +- Engine/lib/assimp/code/{ => HMP}/HMPLoader.h | 5 +- .../assimp/code/{ => HMP}/HalfLifeFileData.h | 0 Engine/lib/assimp/code/Hash.h | 117 - Engine/lib/assimp/code/IOStreamBuffer.h | 350 - .../assimp/code/Importer/IFC/IFCBoolean.cpp | 829 ++ .../lib/assimp/code/Importer/IFC/IFCCurve.cpp | 616 ++ .../assimp/code/Importer/IFC/IFCGeometry.cpp | 888 ++ .../assimp/code/Importer/IFC/IFCLoader.cpp | 988 +++ .../lib/assimp/code/Importer/IFC/IFCLoader.h | 134 + .../assimp/code/Importer/IFC/IFCMaterial.cpp | 202 + .../assimp/code/Importer/IFC/IFCOpenings.cpp | 1704 ++++ .../assimp/code/Importer/IFC/IFCProfile.cpp | 190 + .../code/Importer/IFC/IFCReaderGen1_2x3.cpp | 3168 +++++++ .../code/Importer/IFC/IFCReaderGen2_2x3.cpp | 1918 +++++ .../code/Importer/IFC/IFCReaderGen_2x3.h | 4371 ++++++++++ .../code/Importer/IFC/IFCReaderGen_4.cpp | 6207 ++++++++++++++ .../assimp/code/Importer/IFC/IFCReaderGen_4.h | 5452 ++++++++++++ .../lib/assimp/code/Importer/IFC/IFCUtil.cpp | 703 ++ Engine/lib/assimp/code/Importer/IFC/IFCUtil.h | 413 + .../Importer/STEPParser/STEPFileEncoding.cpp | 432 + .../STEPParser/STEPFileEncoding.h} | 32 +- .../Importer/STEPParser/STEPFileReader.cpp | 559 ++ .../STEPParser/STEPFileReader.h} | 61 +- .../code/Importer/StepFile/StepFileGen1.cpp | 2195 +++++ .../code/Importer/StepFile/StepFileGen2.cpp | 3067 +++++++ .../code/Importer/StepFile/StepFileGen3.cpp | 5746 +++++++++++++ .../Importer/StepFile/StepFileImporter.cpp | 114 + .../Importer/StepFile/StepFileImporter.h} | 34 +- .../code/Importer/StepFile/StepReaderGen.h | 7288 +++++++++++++++++ Engine/lib/assimp/code/Irr/IRRLoader.cpp | 1488 ++++ Engine/lib/assimp/code/Irr/IRRLoader.h | 296 + Engine/lib/assimp/code/Irr/IRRMeshLoader.cpp | 535 ++ .../code/{Profiler.h => Irr/IRRMeshLoader.h} | 83 +- Engine/lib/assimp/code/Irr/IRRShared.cpp | 501 ++ Engine/lib/assimp/code/Irr/IRRShared.h | 118 + .../assimp/code/{ => LWO}/LWOAnimation.cpp | 0 .../lib/assimp/code/{ => LWO}/LWOAnimation.h | 0 .../lib/assimp/code/{ => LWO}/LWOBLoader.cpp | 0 .../lib/assimp/code/{ => LWO}/LWOFileData.h | 4 +- .../lib/assimp/code/{ => LWO}/LWOLoader.cpp | 10 +- Engine/lib/assimp/code/{ => LWO}/LWOLoader.h | 0 .../lib/assimp/code/{ => LWO}/LWOMaterial.cpp | 5 +- .../lib/assimp/code/{ => LWS}/LWSLoader.cpp | 9 +- Engine/lib/assimp/code/{ => LWS}/LWSLoader.h | 3 +- Engine/lib/assimp/code/LineSplitter.h | 243 - Engine/lib/assimp/code/LogAux.h | 133 - Engine/lib/assimp/code/M3D/M3DExporter.cpp | 395 + .../{ScaleProcess.cpp => M3D/M3DExporter.h} | 107 +- Engine/lib/assimp/code/M3D/M3DImporter.cpp | 737 ++ Engine/lib/assimp/code/M3D/M3DImporter.h | 106 + Engine/lib/assimp/code/M3D/M3DMaterials.h | 106 + Engine/lib/assimp/code/M3D/m3d.h | 4565 +++++++++++ .../lib/assimp/code/{ => MD2}/MD2FileData.h | 0 .../lib/assimp/code/{ => MD2}/MD2Loader.cpp | 2 +- Engine/lib/assimp/code/{ => MD2}/MD2Loader.h | 0 .../assimp/code/{ => MD2}/MD2NormalTable.h | 0 .../lib/assimp/code/{ => MD3}/MD3FileData.h | 10 +- .../lib/assimp/code/{ => MD3}/MD3Loader.cpp | 60 +- Engine/lib/assimp/code/{ => MD3}/MD3Loader.h | 0 .../lib/assimp/code/{ => MD4}/MD4FileData.h | 0 .../lib/assimp/code/{ => MD5}/MD5Loader.cpp | 21 +- Engine/lib/assimp/code/{ => MD5}/MD5Loader.h | 0 .../lib/assimp/code/{ => MD5}/MD5Parser.cpp | 9 +- Engine/lib/assimp/code/{ => MD5}/MD5Parser.h | 0 .../lib/assimp/code/{ => MDC}/MDCFileData.h | 0 .../lib/assimp/code/{ => MDC}/MDCLoader.cpp | 9 +- Engine/lib/assimp/code/{ => MDC}/MDCLoader.h | 0 .../assimp/code/{ => MDC}/MDCNormalTable.h | 0 .../code/{ => MDL}/MDLDefaultColorMap.h | 0 .../lib/assimp/code/{ => MDL}/MDLFileData.h | 0 .../lib/assimp/code/{ => MDL}/MDLLoader.cpp | 49 +- Engine/lib/assimp/code/{ => MDL}/MDLLoader.h | 20 +- .../code/{ => MDL}/MDLMaterialLoader.cpp | 0 Engine/lib/assimp/code/{ => MMD}/MMDCpp14.h | 0 .../lib/assimp/code/{ => MMD}/MMDImporter.cpp | 12 +- .../lib/assimp/code/{ => MMD}/MMDImporter.h | 0 .../lib/assimp/code/{ => MMD}/MMDPmdParser.h | 0 .../assimp/code/{ => MMD}/MMDPmxParser.cpp | 6 +- .../lib/assimp/code/{ => MMD}/MMDPmxParser.h | 0 .../lib/assimp/code/{ => MMD}/MMDVmdParser.h | 0 .../lib/assimp/code/{ => MS3D}/MS3DLoader.cpp | 0 .../lib/assimp/code/{ => MS3D}/MS3DLoader.h | 0 .../code/{ => Material}/MaterialSystem.cpp | 31 +- .../code/{ => Material}/MaterialSystem.h | 0 Engine/lib/assimp/code/MemoryIOWrapper.h | 198 - .../lib/assimp/code/{ => NDO}/NDOLoader.cpp | 0 Engine/lib/assimp/code/{ => NDO}/NDOLoader.h | 0 .../lib/assimp/code/{ => NFF}/NFFLoader.cpp | 0 Engine/lib/assimp/code/{ => NFF}/NFFLoader.h | 0 .../lib/assimp/code/{ => OFF}/OFFLoader.cpp | 0 Engine/lib/assimp/code/{ => OFF}/OFFLoader.h | 0 Engine/lib/assimp/code/ObjExporter.cpp | 414 - Engine/lib/assimp/code/ObjExporter.h | 190 - Engine/lib/assimp/code/ObjFileData.h | 336 - Engine/lib/assimp/code/ObjFileImporter.cpp | 787 -- Engine/lib/assimp/code/ObjFileImporter.h | 123 - Engine/lib/assimp/code/ObjFileMtlImporter.cpp | 494 -- Engine/lib/assimp/code/ObjFileMtlImporter.h | 117 - Engine/lib/assimp/code/ObjFileParser.cpp | 860 -- Engine/lib/assimp/code/ObjFileParser.h | 165 - Engine/lib/assimp/code/ObjTools.h | 308 - .../code/{ => Ogre}/OgreBinarySerializer.cpp | 2 + .../code/{ => Ogre}/OgreBinarySerializer.h | 0 .../assimp/code/{ => Ogre}/OgreImporter.cpp | 0 .../lib/assimp/code/{ => Ogre}/OgreImporter.h | 0 .../assimp/code/{ => Ogre}/OgreMaterial.cpp | 0 .../assimp/code/{ => Ogre}/OgreParsingUtils.h | 0 .../assimp/code/{ => Ogre}/OgreStructs.cpp | 0 .../lib/assimp/code/{ => Ogre}/OgreStructs.h | 0 .../code/{ => Ogre}/OgreXmlSerializer.cpp | 0 .../code/{ => Ogre}/OgreXmlSerializer.h | 0 .../code/{ => OpenGEX}/OpenGEXExporter.cpp | 0 .../code/{ => OpenGEX}/OpenGEXExporter.h | 0 .../code/{ => OpenGEX}/OpenGEXImporter.cpp | 17 +- .../code/{ => OpenGEX}/OpenGEXImporter.h | 0 .../code/{ => OpenGEX}/OpenGEXStructs.h | 0 Engine/lib/assimp/code/ParsingUtils.h | 251 - .../lib/assimp/code/{ => Ply}/PlyExporter.cpp | 2 +- .../lib/assimp/code/{ => Ply}/PlyExporter.h | 0 .../lib/assimp/code/{ => Ply}/PlyLoader.cpp | 1 - Engine/lib/assimp/code/{ => Ply}/PlyLoader.h | 0 .../lib/assimp/code/{ => Ply}/PlyParser.cpp | 0 Engine/lib/assimp/code/{ => Ply}/PlyParser.h | 0 .../code/PostProcessing/ArmaturePopulate.cpp | 268 + .../code/PostProcessing/ArmaturePopulate.h | 112 + .../CalcTangentsProcess.cpp | 6 +- .../CalcTangentsProcess.h | 4 +- .../ComputeUVMappingProcess.cpp | 6 +- .../ComputeUVMappingProcess.h | 3 +- .../ConvertToLHProcess.cpp | 0 .../{ => PostProcessing}/ConvertToLHProcess.h | 3 +- .../{ => PostProcessing}/DeboneProcess.cpp | 0 .../code/{ => PostProcessing}/DeboneProcess.h | 17 +- .../DropFaceNormalsProcess.cpp | 0 .../DropFaceNormalsProcess.h | 11 +- .../EmbedTexturesProcess.cpp | 0 .../EmbedTexturesProcess.h | 2 +- .../{ => PostProcessing}/FindDegenerates.cpp | 1 + .../{ => PostProcessing}/FindDegenerates.h | 3 +- .../FindInstancesProcess.cpp | 32 +- .../FindInstancesProcess.h | 4 +- .../FindInvalidDataProcess.cpp | 1 - .../FindInvalidDataProcess.h | 3 +- .../{ => PostProcessing}/FixNormalsStep.cpp | 0 .../{ => PostProcessing}/FixNormalsStep.h | 2 +- .../GenBoundingBoxesProcess.cpp | 115 + .../GenBoundingBoxesProcess.h} | 59 +- .../GenFaceNormalsProcess.cpp | 0 .../GenFaceNormalsProcess.h | 2 +- .../GenVertexNormalsProcess.cpp | 0 .../GenVertexNormalsProcess.h | 18 +- .../ImproveCacheLocality.cpp | 69 +- .../ImproveCacheLocality.h | 7 +- .../JoinVerticesProcess.cpp | 25 - .../JoinVerticesProcess.h | 10 +- .../LimitBoneWeightsProcess.cpp | 0 .../LimitBoneWeightsProcess.h | 34 +- .../MakeVerboseFormat.cpp | 29 + .../{ => PostProcessing}/MakeVerboseFormat.h | 10 +- .../{ => PostProcessing}/OptimizeGraph.cpp | 2 - .../code/{ => PostProcessing}/OptimizeGraph.h | 27 +- .../{ => PostProcessing}/OptimizeMeshes.cpp | 0 .../{ => PostProcessing}/OptimizeMeshes.h | 10 +- .../PretransformVertices.cpp | 0 .../PretransformVertices.h | 15 +- .../{ => PostProcessing}/ProcessHelper.cpp | 0 .../code/{ => PostProcessing}/ProcessHelper.h | 2 +- .../RemoveRedundantMaterials.cpp | 10 +- .../RemoveRedundantMaterials.h | 18 +- .../{ => PostProcessing}/RemoveVCProcess.cpp | 0 .../{ => PostProcessing}/RemoveVCProcess.h | 3 +- .../code/PostProcessing/ScaleProcess.cpp | 208 + .../code/{ => PostProcessing}/ScaleProcess.h | 15 +- .../SortByPTypeProcess.cpp | 55 +- .../{ => PostProcessing}/SortByPTypeProcess.h | 11 +- .../{ => PostProcessing}/SplitLargeMeshes.cpp | 0 .../{ => PostProcessing}/SplitLargeMeshes.h | 9 +- .../{ => PostProcessing}/TextureTransform.cpp | 0 .../{ => PostProcessing}/TextureTransform.h | 2 +- .../TriangulateProcess.cpp | 10 +- .../{ => PostProcessing}/TriangulateProcess.h | 8 +- .../ValidateDataStructure.cpp | 172 +- .../ValidateDataStructure.h | 11 +- .../assimp/code/{ => Q3BSP}/Q3BSPFileData.h | 0 .../code/{ => Q3BSP}/Q3BSPFileImporter.cpp | 16 +- .../code/{ => Q3BSP}/Q3BSPFileImporter.h | 12 +- .../code/{ => Q3BSP}/Q3BSPFileParser.cpp | 5 +- .../assimp/code/{ => Q3BSP}/Q3BSPFileParser.h | 13 +- Engine/lib/assimp/code/Q3BSPZipArchive.cpp | 315 - Engine/lib/assimp/code/Q3BSPZipArchive.h | 131 - .../lib/assimp/code/{ => Q3D}/Q3DLoader.cpp | 0 Engine/lib/assimp/code/{ => Q3D}/Q3DLoader.h | 0 .../lib/assimp/code/{ => Raw}/RawLoader.cpp | 0 Engine/lib/assimp/code/{ => Raw}/RawLoader.h | 0 Engine/lib/assimp/code/RemoveComments.h | 90 - Engine/lib/assimp/code/SGSpatialSort.h | 141 - .../lib/assimp/code/{ => SIB}/SIBImporter.cpp | 8 +- .../lib/assimp/code/{ => SIB}/SIBImporter.h | 0 .../lib/assimp/code/{ => SMD}/SMDLoader.cpp | 4 +- Engine/lib/assimp/code/{ => SMD}/SMDLoader.h | 0 .../lib/assimp/code/{ => STL}/STLExporter.cpp | 4 +- .../lib/assimp/code/{ => STL}/STLExporter.h | 0 .../lib/assimp/code/{ => STL}/STLLoader.cpp | 3 +- Engine/lib/assimp/code/{ => STL}/STLLoader.h | 0 Engine/lib/assimp/code/SkeletonMeshBuilder.h | 124 - Engine/lib/assimp/code/SmoothingGroups.h | 109 - Engine/lib/assimp/code/SmoothingGroups.inl | 138 - Engine/lib/assimp/code/SpatialSort.h | 171 - Engine/lib/assimp/code/StandardShapes.h | 199 - Engine/lib/assimp/code/Step/STEPFile.h | 1016 +++ Engine/lib/assimp/code/Step/StepExporter.cpp | 375 + Engine/lib/assimp/code/Step/StepExporter.h | 111 + Engine/lib/assimp/code/StreamReader.h | 347 - Engine/lib/assimp/code/StreamWriter.h | 240 - Engine/lib/assimp/code/StringComparison.h | 225 - Engine/lib/assimp/code/StringUtils.h | 110 - Engine/lib/assimp/code/Subdivision.h | 130 - .../code/{ => Terragen}/TerragenLoader.cpp | 0 .../code/{ => Terragen}/TerragenLoader.h | 0 Engine/lib/assimp/code/TinyFormatter.h | 165 - .../assimp/code/{ => Unreal}/UnrealLoader.cpp | 6 +- .../assimp/code/{ => Unreal}/UnrealLoader.h | 3 +- Engine/lib/assimp/code/Vertex.h | 323 - .../lib/assimp/code/{ => X}/XFileExporter.cpp | 16 +- .../lib/assimp/code/{ => X}/XFileExporter.h | 0 Engine/lib/assimp/code/{ => X}/XFileHelper.h | 0 .../lib/assimp/code/{ => X}/XFileImporter.cpp | 14 +- .../lib/assimp/code/{ => X}/XFileImporter.h | 6 +- .../lib/assimp/code/{ => X}/XFileParser.cpp | 28 +- Engine/lib/assimp/code/{ => X}/XFileParser.h | 0 Engine/lib/assimp/code/{ => X3D}/FIReader.cpp | 6 +- Engine/lib/assimp/code/{ => X3D}/FIReader.hpp | 6 +- .../lib/assimp/code/{ => X3D}/X3DExporter.cpp | 2 +- .../lib/assimp/code/{ => X3D}/X3DExporter.hpp | 0 .../lib/assimp/code/{ => X3D}/X3DImporter.cpp | 68 +- .../lib/assimp/code/{ => X3D}/X3DImporter.hpp | 0 .../code/{ => X3D}/X3DImporter_Geometry2D.cpp | 6 +- .../code/{ => X3D}/X3DImporter_Geometry3D.cpp | 14 +- .../code/{ => X3D}/X3DImporter_Group.cpp | 0 .../code/{ => X3D}/X3DImporter_Light.cpp | 0 .../code/{ => X3D}/X3DImporter_Macro.hpp | 0 .../code/{ => X3D}/X3DImporter_Metadata.cpp | 0 .../code/{ => X3D}/X3DImporter_Networking.cpp | 2 +- .../code/{ => X3D}/X3DImporter_Node.hpp | 0 .../{ => X3D}/X3DImporter_Postprocess.cpp | 80 +- .../code/{ => X3D}/X3DImporter_Rendering.cpp | 12 +- .../code/{ => X3D}/X3DImporter_Shape.cpp | 0 .../code/{ => X3D}/X3DImporter_Texturing.cpp | 2 +- .../assimp/code/{ => X3D}/X3DVocabulary.cpp | 0 .../lib/assimp/code/{ => XGL}/XGLLoader.cpp | 0 Engine/lib/assimp/code/{ => XGL}/XGLLoader.h | 0 Engine/lib/assimp/code/fast_atof.h | 387 - Engine/lib/assimp/code/{ => glTF}/glTFAsset.h | 71 +- .../lib/assimp/code/{ => glTF}/glTFAsset.inl | 206 +- .../assimp/code/{ => glTF}/glTFAssetWriter.h | 0 .../code/{ => glTF}/glTFAssetWriter.inl | 16 +- Engine/lib/assimp/code/glTF/glTFCommon.cpp | 193 + Engine/lib/assimp/code/glTF/glTFCommon.h | 248 + .../assimp/code/{ => glTF}/glTFExporter.cpp | 14 +- .../lib/assimp/code/{ => glTF}/glTFExporter.h | 0 .../assimp/code/{ => glTF}/glTFImporter.cpp | 120 +- .../lib/assimp/code/{ => glTF}/glTFImporter.h | 0 .../lib/assimp/code/{ => glTF2}/glTF2Asset.h | 110 +- .../assimp/code/{ => glTF2}/glTF2Asset.inl | 263 +- .../code/{ => glTF2}/glTF2AssetWriter.h | 0 .../code/{ => glTF2}/glTF2AssetWriter.inl | 9 +- .../assimp/code/{ => glTF2}/glTF2Exporter.cpp | 13 +- .../assimp/code/{ => glTF2}/glTF2Exporter.h | 0 .../assimp/code/{ => glTF2}/glTF2Importer.cpp | 402 +- .../assimp/code/{ => glTF2}/glTF2Importer.h | 0 Engine/lib/assimp/code/irrXMLWrapper.h | 143 - Engine/lib/assimp/code/makefile.mingw | 105 - Engine/lib/assimp/code/qnan.h | 156 - Engine/lib/assimp/code/res/assimp.rc | 14 +- Engine/lib/assimp/code/res/resource.h | 4 +- Engine/lib/assimp/code/revision.h | 7 - .../contrib/android-cmake/AndroidNdkGdb.cmake | 96 + .../android-cmake/AndroidNdkModules.cmake | 58 + .../assimp/contrib/android-cmake/README.md | 240 + .../android-cmake/android.toolchain.cmake | 1693 ++++ .../assimp/contrib/android-cmake/ndk_links.md | 211 + Engine/lib/assimp/contrib/gtest/.gitignore | 2 + .../gtest/test/gtest-param-test_test.cc | 8 +- .../lib/assimp/contrib/irrXML/CMakeLists.txt | 9 +- .../assimp/contrib/irrXML/CXMLReaderImpl.h | 19 +- Engine/lib/assimp/contrib/irrXML/irrString.h | 2 +- Engine/lib/assimp/contrib/irrXML/irrXML.cpp | 4 +- Engine/lib/assimp/contrib/irrXML/irrXML.h | 26 +- Engine/lib/assimp/contrib/poly2tri/AUTHORS | 2 +- Engine/lib/assimp/contrib/zip/.gitignore | 56 + Engine/lib/assimp/contrib/zip/.travis.sh | 18 + Engine/lib/assimp/contrib/zip/.travis.yml | 18 +- Engine/lib/assimp/contrib/zip/CMakeLists.txt | 43 +- Engine/lib/assimp/contrib/zip/README.md | 340 +- Engine/lib/assimp/contrib/zip/appveyor.yml | 14 + .../lib/assimp/contrib/zip/cmake/asan-wrapper | 55 + .../zip/cmake/cmake_uninstall.cmake.in | 23 + Engine/lib/assimp/contrib/zip/src/miniz.h | 6010 +++++++++----- Engine/lib/assimp/contrib/zip/src/zip.c | 1252 +-- Engine/lib/assimp/contrib/zip/src/zip.h | 147 +- .../assimp/contrib/zip/test/CMakeLists.txt | 12 + Engine/lib/assimp/contrib/zip/test/test.c | 472 +- .../lib/assimp/contrib/zip/test/test_miniz.c | 104 + Engine/lib/assimp/contrib/zlib/CMakeLists.txt | 9 +- .../contrib/zlib/contrib/README.contrib | 78 + .../contrib/zlib/contrib/ada/buffer_demo.adb | 106 + .../assimp/contrib/zlib/contrib/ada/mtest.adb | 156 + .../assimp/contrib/zlib/contrib/ada/read.adb | 156 + .../contrib/zlib/contrib/ada/readme.txt | 65 + .../assimp/contrib/zlib/contrib/ada/test.adb | 463 ++ .../contrib/zlib/contrib/ada/zlib-streams.adb | 225 + .../contrib/zlib/contrib/ada/zlib-streams.ads | 114 + .../contrib/zlib/contrib/ada/zlib-thin.adb | 141 + .../contrib/zlib/contrib/ada/zlib-thin.ads | 450 + .../assimp/contrib/zlib/contrib/ada/zlib.adb | 701 ++ .../assimp/contrib/zlib/contrib/ada/zlib.ads | 328 + .../assimp/contrib/zlib/contrib/ada/zlib.gpr | 20 + .../contrib/zlib/contrib/amd64/amd64-match.S | 452 + .../contrib/zlib/contrib/asm686/README.686 | 51 + .../contrib/zlib/contrib/asm686/match.S | 357 + .../assimp/contrib/zlib/contrib/blast/README | 4 + .../assimp/contrib/zlib/contrib/blast/blast.c | 466 ++ .../assimp/contrib/zlib/contrib/blast/blast.h | 83 + .../assimp/contrib/zlib/contrib/blast/test.pk | Bin 0 -> 8 bytes .../contrib/zlib/contrib/blast/test.txt | 1 + .../contrib/zlib/contrib/delphi/ZLib.pas | 557 ++ .../contrib/zlib/contrib/delphi/ZLibConst.pas | 11 + .../contrib/zlib/contrib/delphi/readme.txt | 76 + .../contrib/zlib/contrib/delphi/zlibd32.mak | 99 + .../zlib/contrib/dotzlib/DotZLib.build | 33 + .../contrib/zlib/contrib/dotzlib/DotZLib.chm | Bin 0 -> 72726 bytes .../contrib/dotzlib/DotZLib/AssemblyInfo.cs | 58 + .../contrib/dotzlib/DotZLib/ChecksumImpl.cs | 202 + .../contrib/dotzlib/DotZLib/CircularBuffer.cs | 83 + .../zlib/contrib/dotzlib/DotZLib/CodecBase.cs | 198 + .../zlib/contrib/dotzlib/DotZLib/Deflater.cs | 106 + .../zlib/contrib/dotzlib/DotZLib/DotZLib.cs | 288 + .../contrib/dotzlib/DotZLib/DotZLib.csproj | 141 + .../contrib/dotzlib/DotZLib/GZipStream.cs | 301 + .../zlib/contrib/dotzlib/DotZLib/Inflater.cs | 105 + .../zlib/contrib/dotzlib/DotZLib/UnitTests.cs | 274 + .../zlib/contrib/dotzlib/LICENSE_1_0.txt | 23 + .../contrib/zlib/contrib/dotzlib/readme.txt | 58 + .../zlib/contrib/gcc_gvmat64/gvmat64.S | 574 ++ .../contrib/zlib/contrib/infback9/README | 1 + .../contrib/zlib/contrib/infback9/infback9.c | 615 ++ .../contrib/zlib/contrib/infback9/infback9.h | 37 + .../contrib/zlib/contrib/infback9/inffix9.h | 107 + .../contrib/zlib/contrib/infback9/inflate9.h | 47 + .../contrib/zlib/contrib/infback9/inftree9.c | 324 + .../contrib/zlib/contrib/infback9/inftree9.h | 61 + .../contrib/zlib/contrib/inflate86/inffas86.c | 1157 +++ .../contrib/zlib/contrib/inflate86/inffast.S | 1368 ++++ .../contrib/zlib/contrib/iostream/test.cpp | 24 + .../zlib/contrib/iostream/zfstream.cpp | 329 + .../contrib/zlib/contrib/iostream/zfstream.h | 128 + .../contrib/zlib/contrib/iostream2/zstream.h | 307 + .../zlib/contrib/iostream2/zstream_test.cpp | 25 + .../contrib/zlib/contrib/iostream3/README | 35 + .../contrib/zlib/contrib/iostream3/TODO | 17 + .../contrib/zlib/contrib/iostream3/test.cc | 50 + .../zlib/contrib/iostream3/zfstream.cc | 479 ++ .../contrib/zlib/contrib/iostream3/zfstream.h | 466 ++ .../contrib/zlib/contrib/masmx64/bld_ml64.bat | 2 + .../contrib/zlib/contrib/masmx64/gvmat64.asm | 553 ++ .../contrib/zlib/contrib/masmx64/inffas8664.c | 186 + .../zlib/contrib/masmx64/inffasx64.asm | 396 + .../contrib/zlib/contrib/masmx64/readme.txt | 31 + .../contrib/zlib/contrib/masmx86/bld_ml32.bat | 2 + .../contrib/zlib/contrib/masmx86/inffas32.asm | 1080 +++ .../contrib/zlib/contrib/masmx86/match686.asm | 479 ++ .../contrib/zlib/contrib/masmx86/readme.txt | 27 + .../contrib/zlib/contrib/minizip/Makefile.am | 45 + .../contrib/minizip/MiniZip64_Changes.txt | 6 + .../zlib/contrib/minizip/MiniZip64_info.txt | 74 + .../contrib/zlib/contrib/minizip/configure.ac | 32 + .../contrib/zlib/contrib/minizip/crypt.h | 131 + .../contrib/zlib/contrib/minizip/ioapi.c | 247 + .../contrib/zlib/contrib/minizip/ioapi.h | 208 + .../contrib/zlib/contrib/minizip/iowin32.c | 462 ++ .../contrib/zlib/contrib/minizip/iowin32.h | 28 + .../contrib/zlib/contrib/minizip/make_vms.com | 25 + .../contrib/zlib/contrib/minizip/miniunz.c | 660 ++ .../contrib/zlib/contrib/minizip/miniunzip.1 | 63 + .../contrib/zlib/contrib/minizip/minizip.1 | 46 + .../contrib/zlib/contrib/minizip/minizip.c | 520 ++ .../zlib/contrib/minizip/minizip.pc.in | 12 + .../contrib/zlib/contrib/minizip/mztools.c | 291 + .../contrib/zlib/contrib/minizip/mztools.h | 37 + .../contrib/zlib/contrib/minizip/unzip.c | 2125 +++++ .../contrib/zlib/contrib/minizip/unzip.h | 437 + .../assimp/contrib/zlib/contrib/minizip/zip.c | 2007 +++++ .../assimp/contrib/zlib/contrib/minizip/zip.h | 362 + .../contrib/zlib/contrib/pascal/example.pas | 599 ++ .../contrib/zlib/contrib/pascal/readme.txt | 76 + .../contrib/zlib/contrib/pascal/zlibd32.mak | 99 + .../contrib/zlib/contrib/pascal/zlibpas.pas | 276 + .../assimp/contrib/zlib/contrib/puff/README | 63 + .../assimp/contrib/zlib/contrib/puff/puff.c | 840 ++ .../assimp/contrib/zlib/contrib/puff/puff.h | 35 + .../contrib/zlib/contrib/puff/pufftest.c | 165 + .../contrib/zlib/contrib/puff/zeros.raw | Bin 0 -> 2517 bytes .../contrib/zlib/contrib/testzlib/testzlib.c | 275 + .../zlib/contrib/testzlib/testzlib.txt | 10 + .../contrib/zlib/contrib/untgz/Makefile.msc | 17 + .../assimp/contrib/zlib/contrib/untgz/untgz.c | 674 ++ .../contrib/zlib/contrib/vstudio/readme.txt | 78 + .../contrib/zlib/contrib/vstudio/vc10/zlib.rc | 32 + .../zlib/contrib/vstudio/vc10/zlibvc.def | 153 + .../contrib/zlib/contrib/vstudio/vc11/zlib.rc | 32 + .../zlib/contrib/vstudio/vc11/zlibvc.def | 153 + .../contrib/zlib/contrib/vstudio/vc12/zlib.rc | 32 + .../zlib/contrib/vstudio/vc12/zlibvc.def | 153 + .../contrib/zlib/contrib/vstudio/vc14/zlib.rc | 32 + .../zlib/contrib/vstudio/vc14/zlibvc.def | 153 + .../contrib/zlib/contrib/vstudio/vc9/zlib.rc | 32 + .../zlib/contrib/vstudio/vc9/zlibvc.def | 153 + Engine/lib/assimp/contrib/zlib/zlib.h | 4 + .../lib/assimp/include/assimp/BaseImporter.h | 63 +- Engine/lib/assimp/include/assimp/Bitmap.h | 6 +- .../lib/assimp/include/assimp/ByteSwapper.h | 5 + .../assimp/include/assimp/CreateAnimMesh.h | 14 +- .../assimp/include/assimp/DefaultIOStream.h | 19 +- .../assimp/include/assimp/DefaultIOSystem.h | 5 + Engine/lib/assimp/include/assimp/Defines.h | 9 + .../lib/assimp/include/assimp/Exceptional.h | 23 +- Engine/lib/assimp/include/assimp/Exporter.hpp | 8 +- .../assimp/include/assimp/GenericProperty.h | 7 +- Engine/lib/assimp/include/assimp/Hash.h | 6 +- Engine/lib/assimp/include/assimp/IOStream.hpp | 12 +- .../assimp/include/assimp/IOStreamBuffer.h | 43 +- Engine/lib/assimp/include/assimp/IOSystem.hpp | 4 + Engine/lib/assimp/include/assimp/Importer.hpp | 4 + .../lib/assimp/include/assimp/LineSplitter.h | 36 +- Engine/lib/assimp/include/assimp/LogAux.h | 5 + .../lib/assimp/include/assimp/MathFunctions.h | 33 +- .../assimp/include/assimp/MemoryIOWrapper.h | 6 + .../lib/assimp/include/assimp/ParsingUtils.h | 12 +- Engine/lib/assimp/include/assimp/Profiler.h | 14 +- .../assimp/include/assimp/ProgressHandler.hpp | 8 +- .../assimp/include/assimp/RemoveComments.h | 8 +- .../lib/assimp/include/assimp/SGSpatialSort.h | 5 + .../lib/assimp/include/assimp/SceneCombiner.h | 11 +- .../include/assimp/SkeletonMeshBuilder.h | 5 + .../assimp/include/assimp/SmoothingGroups.h | 6 + .../assimp/include/assimp/SmoothingGroups.inl | 7 +- .../lib/assimp/include/assimp/SpatialSort.h | 5 + .../assimp/include/assimp/StandardShapes.h | 7 +- .../lib/assimp/include/assimp/StreamReader.h | 10 +- .../lib/assimp/include/assimp/StreamWriter.h | 8 +- .../assimp/include/assimp/StringComparison.h | 7 +- .../lib/assimp/include/assimp/StringUtils.h | 5 + .../lib/assimp/include/assimp/Subdivision.h | 5 +- .../lib/assimp/include/assimp/TinyFormatter.h | 32 +- Engine/lib/assimp/include/assimp/Vertex.h | 67 +- Engine/lib/assimp/include/assimp/XMLTools.h | 5 + .../include/assimp/ZipArchiveIOSystem.h | 94 + .../{code/Macros.h => include/assimp/aabb.h} | 60 +- Engine/lib/assimp/include/assimp/ai_assert.h | 4 + Engine/lib/assimp/include/assimp/anim.h | 4 + Engine/lib/assimp/include/assimp/camera.h | 11 +- Engine/lib/assimp/include/assimp/cexport.h | 6 +- Engine/lib/assimp/include/assimp/cfileio.h | 6 + Engine/lib/assimp/include/assimp/cimport.h | 6 +- Engine/lib/assimp/include/assimp/color4.h | 13 +- Engine/lib/assimp/include/assimp/color4.inl | 98 +- Engine/lib/assimp/include/assimp/config.h | 42 +- Engine/lib/assimp/include/assimp/config.h.in | 40 +- Engine/lib/assimp/include/assimp/defs.h | 62 +- Engine/lib/assimp/include/assimp/fast_atof.h | 6 +- .../lib/assimp/include/assimp/importerdesc.h | 10 +- .../lib/assimp/include/assimp/irrXMLWrapper.h | 21 +- Engine/lib/assimp/include/assimp/light.h | 6 +- Engine/lib/assimp/include/assimp/material.h | 66 +- Engine/lib/assimp/include/assimp/material.inl | 265 +- Engine/lib/assimp/include/assimp/matrix3x3.h | 15 +- .../lib/assimp/include/assimp/matrix3x3.inl | 72 +- Engine/lib/assimp/include/assimp/matrix4x4.h | 18 +- .../lib/assimp/include/assimp/matrix4x4.inl | 175 +- Engine/lib/assimp/include/assimp/mesh.h | 51 +- Engine/lib/assimp/include/assimp/metadata.h | 4 + .../lib/assimp/include/assimp/pbrmaterial.h | 7 +- .../lib/assimp/include/assimp/postprocess.h | 34 +- Engine/lib/assimp/include/assimp/qnan.h | 31 +- Engine/lib/assimp/include/assimp/quaternion.h | 6 +- .../lib/assimp/include/assimp/quaternion.inl | 6 +- Engine/lib/assimp/include/assimp/revision.h | 28 + Engine/lib/assimp/include/assimp/scene.h | 51 +- Engine/lib/assimp/include/assimp/texture.h | 13 +- Engine/lib/assimp/include/assimp/types.h | 49 +- Engine/lib/assimp/include/assimp/vector2.h | 4 + Engine/lib/assimp/include/assimp/vector2.inl | 6 +- Engine/lib/assimp/include/assimp/vector3.h | 12 +- Engine/lib/assimp/include/assimp/vector3.inl | 2 +- Engine/lib/assimp/include/assimp/version.h | 2 +- 662 files changed, 106518 insertions(+), 21818 deletions(-) rename Engine/lib/assimp/code/{ => 3DS}/3DSConverter.cpp (99%) rename Engine/lib/assimp/code/{ => 3DS}/3DSExporter.cpp (99%) rename Engine/lib/assimp/code/{ => 3DS}/3DSExporter.h (100%) rename Engine/lib/assimp/code/{ => 3DS}/3DSHelper.h (100%) rename Engine/lib/assimp/code/{ => 3DS}/3DSLoader.cpp (99%) rename Engine/lib/assimp/code/{ => 3DS}/3DSLoader.h (100%) rename Engine/lib/assimp/code/{ => 3MF}/3MFXmlTags.h (100%) rename Engine/lib/assimp/code/{ => 3MF}/D3MFExporter.cpp (99%) rename Engine/lib/assimp/code/{ => 3MF}/D3MFExporter.h (100%) rename Engine/lib/assimp/code/{ => 3MF}/D3MFImporter.cpp (99%) rename Engine/lib/assimp/code/{ => 3MF}/D3MFImporter.h (100%) create mode 100644 Engine/lib/assimp/code/3MF/D3MFOpcPackage.cpp rename Engine/lib/assimp/code/{ => 3MF}/D3MFOpcPackage.h (94%) rename Engine/lib/assimp/code/{ => AC}/ACLoader.cpp (99%) rename Engine/lib/assimp/code/{ => AC}/ACLoader.h (100%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter.cpp (99%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter.hpp (100%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter_Geometry.cpp (100%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter_Macro.hpp (100%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter_Material.cpp (100%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter_Node.hpp (100%) rename Engine/lib/assimp/code/{ => AMF}/AMFImporter_Postprocess.cpp (98%) rename Engine/lib/assimp/code/{ => ASE}/ASELoader.cpp (99%) rename Engine/lib/assimp/code/{ => ASE}/ASELoader.h (99%) rename Engine/lib/assimp/code/{ => ASE}/ASEParser.cpp (99%) rename Engine/lib/assimp/code/{ => ASE}/ASEParser.h (99%) rename Engine/lib/assimp/code/{ => Assbin}/AssbinExporter.cpp (99%) rename Engine/lib/assimp/code/{ => Assbin}/AssbinExporter.h (100%) rename Engine/lib/assimp/code/{ => Assbin}/AssbinLoader.cpp (99%) rename Engine/lib/assimp/code/{ => Assbin}/AssbinLoader.h (100%) create mode 100644 Engine/lib/assimp/code/Assjson/cencode.c create mode 100644 Engine/lib/assimp/code/Assjson/cencode.h create mode 100644 Engine/lib/assimp/code/Assjson/json_exporter.cpp create mode 100644 Engine/lib/assimp/code/Assjson/mesh_splitter.cpp create mode 100644 Engine/lib/assimp/code/Assjson/mesh_splitter.h rename Engine/lib/assimp/code/{ => Assxml}/AssxmlExporter.cpp (99%) rename Engine/lib/assimp/code/{ => Assxml}/AssxmlExporter.h (100%) rename Engine/lib/assimp/code/{ => B3D}/B3DImporter.cpp (99%) rename Engine/lib/assimp/code/{ => B3D}/B3DImporter.h (100%) rename Engine/lib/assimp/code/{ => BVH}/BVHLoader.cpp (100%) rename Engine/lib/assimp/code/{ => BVH}/BVHLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/BaseImporter.h delete mode 100644 Engine/lib/assimp/code/Bitmap.h rename Engine/lib/assimp/code/{ => Blender}/BlenderBMesh.cpp (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderBMesh.h (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderCustomData.cpp (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderCustomData.h (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderDNA.cpp (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderDNA.h (99%) rename Engine/lib/assimp/code/{ => Blender}/BlenderDNA.inl (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderIntermediate.h (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderLoader.cpp (97%) rename Engine/lib/assimp/code/{ => Blender}/BlenderLoader.h (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderModifier.cpp (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderModifier.h (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderScene.cpp (99%) rename Engine/lib/assimp/code/{ => Blender}/BlenderScene.h (99%) rename Engine/lib/assimp/code/{ => Blender}/BlenderSceneGen.h (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderTessellator.cpp (100%) rename Engine/lib/assimp/code/{ => Blender}/BlenderTessellator.h (98%) delete mode 100644 Engine/lib/assimp/code/BlobIOSystem.h delete mode 100644 Engine/lib/assimp/code/ByteSwapper.h rename Engine/lib/assimp/code/{ => C4D}/C4DImporter.cpp (89%) rename Engine/lib/assimp/code/{ => C4D}/C4DImporter.h (97%) rename Engine/lib/assimp/code/{ => CApi}/AssimpCExport.cpp (99%) rename Engine/lib/assimp/code/{ => CApi}/CInterfaceIOWrapper.cpp (100%) rename Engine/lib/assimp/code/{ => CApi}/CInterfaceIOWrapper.h (100%) rename Engine/lib/assimp/code/{ => COB}/COBLoader.cpp (99%) rename Engine/lib/assimp/code/{ => COB}/COBLoader.h (100%) rename Engine/lib/assimp/code/{ => COB}/COBScene.h (100%) rename Engine/lib/assimp/code/{ => CSM}/CSMLoader.cpp (100%) rename Engine/lib/assimp/code/{ => CSM}/CSMLoader.h (100%) rename Engine/lib/assimp/code/{ => Collada}/ColladaExporter.cpp (85%) rename Engine/lib/assimp/code/{ => Collada}/ColladaExporter.h (99%) rename Engine/lib/assimp/code/{ => Collada}/ColladaHelper.h (99%) rename Engine/lib/assimp/code/{ => Collada}/ColladaLoader.cpp (60%) rename Engine/lib/assimp/code/{ => Collada}/ColladaLoader.h (96%) create mode 100644 Engine/lib/assimp/code/Collada/ColladaParser.cpp rename Engine/lib/assimp/code/{ => Collada}/ColladaParser.h (93%) delete mode 100644 Engine/lib/assimp/code/ColladaParser.cpp rename Engine/lib/assimp/code/{ => Common}/Assimp.cpp (99%) rename Engine/lib/assimp/code/{ => Common}/BaseImporter.cpp (93%) rename Engine/lib/assimp/code/{ => Common}/BaseProcess.cpp (98%) rename Engine/lib/assimp/code/{ => Common}/BaseProcess.h (100%) rename Engine/lib/assimp/code/{ => Common}/Bitmap.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/CreateAnimMesh.cpp (96%) rename Engine/lib/assimp/code/{ => Common}/DefaultIOStream.cpp (87%) rename Engine/lib/assimp/code/{ => Common}/DefaultIOSystem.cpp (57%) rename Engine/lib/assimp/code/{ => Common}/DefaultLogger.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/DefaultProgressHandler.h (100%) rename Engine/lib/assimp/code/{ => Common}/Exporter.cpp (79%) rename Engine/lib/assimp/code/{ => Common}/FileLogStream.h (100%) rename Engine/lib/assimp/code/{ => Common}/FileSystemFilter.h (100%) rename Engine/lib/assimp/code/{ => Common}/IFF.h (100%) rename Engine/lib/assimp/code/{ => Common}/Importer.cpp (98%) rename Engine/lib/assimp/code/{ => Common}/Importer.h (100%) rename Engine/lib/assimp/code/{ => Common}/ImporterRegistry.cpp (85%) rename Engine/lib/assimp/code/{ => Common}/PolyTools.h (100%) rename Engine/lib/assimp/code/{ => Common}/PostStepRegistry.cpp (81%) rename Engine/lib/assimp/code/{ => Common}/RemoveComments.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/SGSpatialSort.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/SceneCombiner.cpp (96%) rename Engine/lib/assimp/code/{ => Common}/ScenePreprocessor.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/ScenePreprocessor.h (100%) rename Engine/lib/assimp/code/{ => Common}/ScenePrivate.h (100%) rename Engine/lib/assimp/code/{ => Common}/SkeletonMeshBuilder.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/SpatialSort.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/SplitByBoneCountProcess.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/SplitByBoneCountProcess.h (100%) rename Engine/lib/assimp/code/{ => Common}/StandardShapes.cpp (96%) rename Engine/lib/assimp/code/{ => Common}/StdOStreamLogStream.h (100%) rename Engine/lib/assimp/code/{ => Common}/Subdivision.cpp (99%) rename Engine/lib/assimp/code/{ => Common}/TargetAnimation.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/TargetAnimation.h (100%) rename Engine/lib/assimp/code/{ => Common}/Version.cpp (95%) rename Engine/lib/assimp/code/{ => Common}/VertexTriangleAdjacency.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/VertexTriangleAdjacency.h (100%) rename Engine/lib/assimp/code/{ => Common}/Win32DebugLogStream.h (100%) create mode 100644 Engine/lib/assimp/code/Common/ZipArchiveIOSystem.cpp rename Engine/lib/assimp/code/{ => Common}/assbin_chunks.h (100%) rename Engine/lib/assimp/code/{ => Common}/scene.cpp (95%) rename Engine/lib/assimp/code/{ => Common}/simd.cpp (100%) rename Engine/lib/assimp/code/{ => Common}/simd.h (100%) delete mode 100644 Engine/lib/assimp/code/D3MFOpcPackage.cpp rename Engine/lib/assimp/code/{ => DXF}/DXFHelper.h (100%) rename Engine/lib/assimp/code/{ => DXF}/DXFLoader.cpp (99%) rename Engine/lib/assimp/code/{ => DXF}/DXFLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/Exceptional.h rename Engine/lib/assimp/code/{ => FBX}/FBXAnimation.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXBinaryTokenizer.cpp (97%) rename Engine/lib/assimp/code/{ => FBX}/FBXCommon.h (89%) rename Engine/lib/assimp/code/{ => FBX}/FBXCompileConfig.h (87%) rename Engine/lib/assimp/code/{ => FBX}/FBXConverter.cpp (85%) rename Engine/lib/assimp/code/{ => FBX}/FBXConverter.h (81%) rename Engine/lib/assimp/code/{ => FBX}/FBXDeformer.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXDocument.cpp (98%) rename Engine/lib/assimp/code/{ => FBX}/FBXDocument.h (96%) rename Engine/lib/assimp/code/{ => FBX}/FBXDocumentUtil.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXDocumentUtil.h (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXExportNode.cpp (96%) rename Engine/lib/assimp/code/{ => FBX}/FBXExportNode.h (98%) rename Engine/lib/assimp/code/{ => FBX}/FBXExportProperty.cpp (60%) rename Engine/lib/assimp/code/{ => FBX}/FBXExportProperty.h (77%) rename Engine/lib/assimp/code/{ => FBX}/FBXExporter.cpp (91%) rename Engine/lib/assimp/code/{ => FBX}/FBXExporter.h (99%) rename Engine/lib/assimp/code/{ => FBX}/FBXImportSettings.h (88%) create mode 100644 Engine/lib/assimp/code/FBX/FBXImporter.cpp rename Engine/lib/assimp/code/{ => FBX}/FBXImporter.h (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXMaterial.cpp (78%) rename Engine/lib/assimp/code/{ => FBX}/FBXMeshGeometry.cpp (97%) rename Engine/lib/assimp/code/{ => FBX}/FBXMeshGeometry.h (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXModel.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXNodeAttribute.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXParser.cpp (99%) rename Engine/lib/assimp/code/{ => FBX}/FBXParser.h (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXProperties.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXProperties.h (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXTokenizer.cpp (100%) rename Engine/lib/assimp/code/{ => FBX}/FBXTokenizer.h (96%) create mode 100644 Engine/lib/assimp/code/FBX/FBXUtil.cpp rename Engine/lib/assimp/code/{ => FBX}/FBXUtil.h (76%) delete mode 100644 Engine/lib/assimp/code/FBXImporter.cpp delete mode 100644 Engine/lib/assimp/code/FBXUtil.cpp delete mode 100644 Engine/lib/assimp/code/GenericProperty.h rename Engine/lib/assimp/code/{ => HMP}/HMPFileData.h (100%) rename Engine/lib/assimp/code/{ => HMP}/HMPLoader.cpp (99%) rename Engine/lib/assimp/code/{ => HMP}/HMPLoader.h (98%) rename Engine/lib/assimp/code/{ => HMP}/HalfLifeFileData.h (100%) delete mode 100644 Engine/lib/assimp/code/Hash.h delete mode 100644 Engine/lib/assimp/code/IOStreamBuffer.h create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCBoolean.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCCurve.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCGeometry.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCLoader.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCLoader.h create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCMaterial.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCOpenings.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCProfile.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCReaderGen1_2x3.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCReaderGen2_2x3.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_2x3.h create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.h create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCUtil.cpp create mode 100644 Engine/lib/assimp/code/Importer/IFC/IFCUtil.h create mode 100644 Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.cpp rename Engine/lib/assimp/code/{CreateAnimMesh.h => Importer/STEPParser/STEPFileEncoding.h} (72%) create mode 100644 Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.cpp rename Engine/lib/assimp/code/{XMLTools.h => Importer/STEPParser/STEPFileReader.h} (58%) create mode 100644 Engine/lib/assimp/code/Importer/StepFile/StepFileGen1.cpp create mode 100644 Engine/lib/assimp/code/Importer/StepFile/StepFileGen2.cpp create mode 100644 Engine/lib/assimp/code/Importer/StepFile/StepFileGen3.cpp create mode 100644 Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.cpp rename Engine/lib/assimp/{include/assimp/Macros.h => code/Importer/StepFile/StepFileImporter.h} (75%) create mode 100644 Engine/lib/assimp/code/Importer/StepFile/StepReaderGen.h create mode 100644 Engine/lib/assimp/code/Irr/IRRLoader.cpp create mode 100644 Engine/lib/assimp/code/Irr/IRRLoader.h create mode 100644 Engine/lib/assimp/code/Irr/IRRMeshLoader.cpp rename Engine/lib/assimp/code/{Profiler.h => Irr/IRRMeshLoader.h} (51%) create mode 100644 Engine/lib/assimp/code/Irr/IRRShared.cpp create mode 100644 Engine/lib/assimp/code/Irr/IRRShared.h rename Engine/lib/assimp/code/{ => LWO}/LWOAnimation.cpp (100%) rename Engine/lib/assimp/code/{ => LWO}/LWOAnimation.h (100%) rename Engine/lib/assimp/code/{ => LWO}/LWOBLoader.cpp (100%) rename Engine/lib/assimp/code/{ => LWO}/LWOFileData.h (99%) rename Engine/lib/assimp/code/{ => LWO}/LWOLoader.cpp (99%) rename Engine/lib/assimp/code/{ => LWO}/LWOLoader.h (100%) rename Engine/lib/assimp/code/{ => LWO}/LWOMaterial.cpp (99%) rename Engine/lib/assimp/code/{ => LWS}/LWSLoader.cpp (99%) rename Engine/lib/assimp/code/{ => LWS}/LWSLoader.h (99%) delete mode 100644 Engine/lib/assimp/code/LineSplitter.h delete mode 100644 Engine/lib/assimp/code/LogAux.h create mode 100644 Engine/lib/assimp/code/M3D/M3DExporter.cpp rename Engine/lib/assimp/code/{ScaleProcess.cpp => M3D/M3DExporter.h} (50%) create mode 100644 Engine/lib/assimp/code/M3D/M3DImporter.cpp create mode 100644 Engine/lib/assimp/code/M3D/M3DImporter.h create mode 100644 Engine/lib/assimp/code/M3D/M3DMaterials.h create mode 100644 Engine/lib/assimp/code/M3D/m3d.h rename Engine/lib/assimp/code/{ => MD2}/MD2FileData.h (100%) rename Engine/lib/assimp/code/{ => MD2}/MD2Loader.cpp (99%) rename Engine/lib/assimp/code/{ => MD2}/MD2Loader.h (100%) rename Engine/lib/assimp/code/{ => MD2}/MD2NormalTable.h (100%) rename Engine/lib/assimp/code/{ => MD3}/MD3FileData.h (97%) rename Engine/lib/assimp/code/{ => MD3}/MD3Loader.cpp (97%) rename Engine/lib/assimp/code/{ => MD3}/MD3Loader.h (100%) rename Engine/lib/assimp/code/{ => MD4}/MD4FileData.h (100%) rename Engine/lib/assimp/code/{ => MD5}/MD5Loader.cpp (97%) rename Engine/lib/assimp/code/{ => MD5}/MD5Loader.h (100%) rename Engine/lib/assimp/code/{ => MD5}/MD5Parser.cpp (99%) rename Engine/lib/assimp/code/{ => MD5}/MD5Parser.h (100%) rename Engine/lib/assimp/code/{ => MDC}/MDCFileData.h (100%) rename Engine/lib/assimp/code/{ => MDC}/MDCLoader.cpp (99%) rename Engine/lib/assimp/code/{ => MDC}/MDCLoader.h (100%) rename Engine/lib/assimp/code/{ => MDC}/MDCNormalTable.h (100%) rename Engine/lib/assimp/code/{ => MDL}/MDLDefaultColorMap.h (100%) rename Engine/lib/assimp/code/{ => MDL}/MDLFileData.h (100%) rename Engine/lib/assimp/code/{ => MDL}/MDLLoader.cpp (99%) rename Engine/lib/assimp/code/{ => MDL}/MDLLoader.h (99%) rename Engine/lib/assimp/code/{ => MDL}/MDLMaterialLoader.cpp (100%) rename Engine/lib/assimp/code/{ => MMD}/MMDCpp14.h (100%) rename Engine/lib/assimp/code/{ => MMD}/MMDImporter.cpp (98%) rename Engine/lib/assimp/code/{ => MMD}/MMDImporter.h (100%) rename Engine/lib/assimp/code/{ => MMD}/MMDPmdParser.h (100%) rename Engine/lib/assimp/code/{ => MMD}/MMDPmxParser.cpp (99%) rename Engine/lib/assimp/code/{ => MMD}/MMDPmxParser.h (100%) rename Engine/lib/assimp/code/{ => MMD}/MMDVmdParser.h (100%) rename Engine/lib/assimp/code/{ => MS3D}/MS3DLoader.cpp (100%) rename Engine/lib/assimp/code/{ => MS3D}/MS3DLoader.h (100%) rename Engine/lib/assimp/code/{ => Material}/MaterialSystem.cpp (95%) rename Engine/lib/assimp/code/{ => Material}/MaterialSystem.h (100%) delete mode 100644 Engine/lib/assimp/code/MemoryIOWrapper.h rename Engine/lib/assimp/code/{ => NDO}/NDOLoader.cpp (100%) rename Engine/lib/assimp/code/{ => NDO}/NDOLoader.h (100%) rename Engine/lib/assimp/code/{ => NFF}/NFFLoader.cpp (100%) rename Engine/lib/assimp/code/{ => NFF}/NFFLoader.h (100%) rename Engine/lib/assimp/code/{ => OFF}/OFFLoader.cpp (100%) rename Engine/lib/assimp/code/{ => OFF}/OFFLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/ObjExporter.cpp delete mode 100644 Engine/lib/assimp/code/ObjExporter.h delete mode 100644 Engine/lib/assimp/code/ObjFileData.h delete mode 100644 Engine/lib/assimp/code/ObjFileImporter.cpp delete mode 100644 Engine/lib/assimp/code/ObjFileImporter.h delete mode 100644 Engine/lib/assimp/code/ObjFileMtlImporter.cpp delete mode 100644 Engine/lib/assimp/code/ObjFileMtlImporter.h delete mode 100644 Engine/lib/assimp/code/ObjFileParser.cpp delete mode 100644 Engine/lib/assimp/code/ObjFileParser.h delete mode 100644 Engine/lib/assimp/code/ObjTools.h rename Engine/lib/assimp/code/{ => Ogre}/OgreBinarySerializer.cpp (99%) rename Engine/lib/assimp/code/{ => Ogre}/OgreBinarySerializer.h (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreImporter.cpp (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreImporter.h (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreMaterial.cpp (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreParsingUtils.h (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreStructs.cpp (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreStructs.h (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreXmlSerializer.cpp (100%) rename Engine/lib/assimp/code/{ => Ogre}/OgreXmlSerializer.h (100%) rename Engine/lib/assimp/code/{ => OpenGEX}/OpenGEXExporter.cpp (100%) rename Engine/lib/assimp/code/{ => OpenGEX}/OpenGEXExporter.h (100%) rename Engine/lib/assimp/code/{ => OpenGEX}/OpenGEXImporter.cpp (99%) rename Engine/lib/assimp/code/{ => OpenGEX}/OpenGEXImporter.h (100%) rename Engine/lib/assimp/code/{ => OpenGEX}/OpenGEXStructs.h (100%) delete mode 100644 Engine/lib/assimp/code/ParsingUtils.h rename Engine/lib/assimp/code/{ => Ply}/PlyExporter.cpp (99%) rename Engine/lib/assimp/code/{ => Ply}/PlyExporter.h (100%) rename Engine/lib/assimp/code/{ => Ply}/PlyLoader.cpp (99%) rename Engine/lib/assimp/code/{ => Ply}/PlyLoader.h (100%) rename Engine/lib/assimp/code/{ => Ply}/PlyParser.cpp (100%) rename Engine/lib/assimp/code/{ => Ply}/PlyParser.h (100%) create mode 100644 Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.cpp create mode 100644 Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.h rename Engine/lib/assimp/code/{ => PostProcessing}/CalcTangentsProcess.cpp (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/CalcTangentsProcess.h (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/ComputeUVMappingProcess.cpp (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/ComputeUVMappingProcess.h (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/ConvertToLHProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/ConvertToLHProcess.h (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/DeboneProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/DeboneProcess.h (97%) rename Engine/lib/assimp/code/{ => PostProcessing}/DropFaceNormalsProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/DropFaceNormalsProcess.h (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/EmbedTexturesProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/EmbedTexturesProcess.h (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/FindDegenerates.cpp (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/FindDegenerates.h (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/FindInstancesProcess.cpp (92%) rename Engine/lib/assimp/code/{ => PostProcessing}/FindInstancesProcess.h (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/FindInvalidDataProcess.cpp (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/FindInvalidDataProcess.h (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/FixNormalsStep.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/FixNormalsStep.h (99%) create mode 100644 Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp rename Engine/lib/assimp/code/{MathFunctions.h => PostProcessing/GenBoundingBoxesProcess.h} (65%) rename Engine/lib/assimp/code/{ => PostProcessing}/GenFaceNormalsProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/GenFaceNormalsProcess.h (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/GenVertexNormalsProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/GenVertexNormalsProcess.h (94%) rename Engine/lib/assimp/code/{ => PostProcessing}/ImproveCacheLocality.cpp (89%) rename Engine/lib/assimp/code/{ => PostProcessing}/ImproveCacheLocality.h (96%) rename Engine/lib/assimp/code/{ => PostProcessing}/JoinVerticesProcess.cpp (93%) rename Engine/lib/assimp/code/{ => PostProcessing}/JoinVerticesProcess.h (97%) rename Engine/lib/assimp/code/{ => PostProcessing}/LimitBoneWeightsProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/LimitBoneWeightsProcess.h (93%) rename Engine/lib/assimp/code/{ => PostProcessing}/MakeVerboseFormat.cpp (89%) rename Engine/lib/assimp/code/{ => PostProcessing}/MakeVerboseFormat.h (92%) rename Engine/lib/assimp/code/{ => PostProcessing}/OptimizeGraph.cpp (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/OptimizeGraph.h (93%) rename Engine/lib/assimp/code/{ => PostProcessing}/OptimizeMeshes.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/OptimizeMeshes.h (97%) rename Engine/lib/assimp/code/{ => PostProcessing}/PretransformVertices.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/PretransformVertices.h (97%) rename Engine/lib/assimp/code/{ => PostProcessing}/ProcessHelper.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/ProcessHelper.h (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/RemoveRedundantMaterials.cpp (97%) rename Engine/lib/assimp/code/{ => PostProcessing}/RemoveRedundantMaterials.h (92%) rename Engine/lib/assimp/code/{ => PostProcessing}/RemoveVCProcess.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/RemoveVCProcess.h (99%) create mode 100644 Engine/lib/assimp/code/PostProcessing/ScaleProcess.cpp rename Engine/lib/assimp/code/{ => PostProcessing}/ScaleProcess.h (84%) rename Engine/lib/assimp/code/{ => PostProcessing}/SortByPTypeProcess.cpp (89%) rename Engine/lib/assimp/code/{ => PostProcessing}/SortByPTypeProcess.h (95%) rename Engine/lib/assimp/code/{ => PostProcessing}/SplitLargeMeshes.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/SplitLargeMeshes.h (98%) rename Engine/lib/assimp/code/{ => PostProcessing}/TextureTransform.cpp (100%) rename Engine/lib/assimp/code/{ => PostProcessing}/TextureTransform.h (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/TriangulateProcess.cpp (99%) rename Engine/lib/assimp/code/{ => PostProcessing}/TriangulateProcess.h (97%) rename Engine/lib/assimp/code/{ => PostProcessing}/ValidateDataStructure.cpp (87%) rename Engine/lib/assimp/code/{ => PostProcessing}/ValidateDataStructure.h (95%) rename Engine/lib/assimp/code/{ => Q3BSP}/Q3BSPFileData.h (100%) rename Engine/lib/assimp/code/{ => Q3BSP}/Q3BSPFileImporter.cpp (97%) rename Engine/lib/assimp/code/{ => Q3BSP}/Q3BSPFileImporter.h (92%) rename Engine/lib/assimp/code/{ => Q3BSP}/Q3BSPFileParser.cpp (98%) rename Engine/lib/assimp/code/{ => Q3BSP}/Q3BSPFileParser.h (92%) delete mode 100644 Engine/lib/assimp/code/Q3BSPZipArchive.cpp delete mode 100644 Engine/lib/assimp/code/Q3BSPZipArchive.h rename Engine/lib/assimp/code/{ => Q3D}/Q3DLoader.cpp (100%) rename Engine/lib/assimp/code/{ => Q3D}/Q3DLoader.h (100%) rename Engine/lib/assimp/code/{ => Raw}/RawLoader.cpp (100%) rename Engine/lib/assimp/code/{ => Raw}/RawLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/RemoveComments.h delete mode 100644 Engine/lib/assimp/code/SGSpatialSort.h rename Engine/lib/assimp/code/{ => SIB}/SIBImporter.cpp (99%) rename Engine/lib/assimp/code/{ => SIB}/SIBImporter.h (100%) rename Engine/lib/assimp/code/{ => SMD}/SMDLoader.cpp (99%) rename Engine/lib/assimp/code/{ => SMD}/SMDLoader.h (100%) rename Engine/lib/assimp/code/{ => STL}/STLExporter.cpp (98%) rename Engine/lib/assimp/code/{ => STL}/STLExporter.h (100%) rename Engine/lib/assimp/code/{ => STL}/STLLoader.cpp (99%) rename Engine/lib/assimp/code/{ => STL}/STLLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/SkeletonMeshBuilder.h delete mode 100644 Engine/lib/assimp/code/SmoothingGroups.h delete mode 100644 Engine/lib/assimp/code/SmoothingGroups.inl delete mode 100644 Engine/lib/assimp/code/SpatialSort.h delete mode 100644 Engine/lib/assimp/code/StandardShapes.h create mode 100644 Engine/lib/assimp/code/Step/STEPFile.h create mode 100644 Engine/lib/assimp/code/Step/StepExporter.cpp create mode 100644 Engine/lib/assimp/code/Step/StepExporter.h delete mode 100644 Engine/lib/assimp/code/StreamReader.h delete mode 100644 Engine/lib/assimp/code/StreamWriter.h delete mode 100644 Engine/lib/assimp/code/StringComparison.h delete mode 100644 Engine/lib/assimp/code/StringUtils.h delete mode 100644 Engine/lib/assimp/code/Subdivision.h rename Engine/lib/assimp/code/{ => Terragen}/TerragenLoader.cpp (100%) rename Engine/lib/assimp/code/{ => Terragen}/TerragenLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/TinyFormatter.h rename Engine/lib/assimp/code/{ => Unreal}/UnrealLoader.cpp (99%) rename Engine/lib/assimp/code/{ => Unreal}/UnrealLoader.h (98%) delete mode 100644 Engine/lib/assimp/code/Vertex.h rename Engine/lib/assimp/code/{ => X}/XFileExporter.cpp (98%) rename Engine/lib/assimp/code/{ => X}/XFileExporter.h (100%) rename Engine/lib/assimp/code/{ => X}/XFileHelper.h (100%) rename Engine/lib/assimp/code/{ => X}/XFileImporter.cpp (98%) rename Engine/lib/assimp/code/{ => X}/XFileImporter.h (98%) rename Engine/lib/assimp/code/{ => X}/XFileParser.cpp (98%) rename Engine/lib/assimp/code/{ => X}/XFileParser.h (100%) rename Engine/lib/assimp/code/{ => X3D}/FIReader.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/FIReader.hpp (98%) rename Engine/lib/assimp/code/{ => X3D}/X3DExporter.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/X3DExporter.hpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter.cpp (98%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter.hpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Geometry2D.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Geometry3D.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Group.cpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Light.cpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Macro.hpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Metadata.cpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Networking.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Node.hpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Postprocess.cpp (94%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Rendering.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Shape.cpp (100%) rename Engine/lib/assimp/code/{ => X3D}/X3DImporter_Texturing.cpp (99%) rename Engine/lib/assimp/code/{ => X3D}/X3DVocabulary.cpp (100%) rename Engine/lib/assimp/code/{ => XGL}/XGLLoader.cpp (100%) rename Engine/lib/assimp/code/{ => XGL}/XGLLoader.h (100%) delete mode 100644 Engine/lib/assimp/code/fast_atof.h rename Engine/lib/assimp/code/{ => glTF}/glTFAsset.h (95%) rename Engine/lib/assimp/code/{ => glTF}/glTFAsset.inl (88%) rename Engine/lib/assimp/code/{ => glTF}/glTFAssetWriter.h (100%) rename Engine/lib/assimp/code/{ => glTF}/glTFAssetWriter.inl (96%) create mode 100644 Engine/lib/assimp/code/glTF/glTFCommon.cpp create mode 100644 Engine/lib/assimp/code/glTF/glTFCommon.h rename Engine/lib/assimp/code/{ => glTF}/glTFExporter.cpp (99%) rename Engine/lib/assimp/code/{ => glTF}/glTFExporter.h (100%) rename Engine/lib/assimp/code/{ => glTF}/glTFImporter.cpp (90%) rename Engine/lib/assimp/code/{ => glTF}/glTFImporter.h (100%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2Asset.h (94%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2Asset.inl (87%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2AssetWriter.h (100%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2AssetWriter.inl (98%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2Exporter.cpp (99%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2Exporter.h (100%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2Importer.cpp (78%) rename Engine/lib/assimp/code/{ => glTF2}/glTF2Importer.h (100%) delete mode 100644 Engine/lib/assimp/code/irrXMLWrapper.h delete mode 100644 Engine/lib/assimp/code/makefile.mingw delete mode 100644 Engine/lib/assimp/code/qnan.h delete mode 100644 Engine/lib/assimp/code/revision.h create mode 100644 Engine/lib/assimp/contrib/android-cmake/AndroidNdkGdb.cmake create mode 100644 Engine/lib/assimp/contrib/android-cmake/AndroidNdkModules.cmake create mode 100644 Engine/lib/assimp/contrib/android-cmake/README.md create mode 100644 Engine/lib/assimp/contrib/android-cmake/android.toolchain.cmake create mode 100644 Engine/lib/assimp/contrib/android-cmake/ndk_links.md create mode 100644 Engine/lib/assimp/contrib/gtest/.gitignore create mode 100644 Engine/lib/assimp/contrib/zip/.gitignore create mode 100644 Engine/lib/assimp/contrib/zip/.travis.sh create mode 100644 Engine/lib/assimp/contrib/zip/appveyor.yml create mode 100644 Engine/lib/assimp/contrib/zip/cmake/asan-wrapper create mode 100644 Engine/lib/assimp/contrib/zip/cmake/cmake_uninstall.cmake.in create mode 100644 Engine/lib/assimp/contrib/zip/test/test_miniz.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/README.contrib create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/buffer_demo.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/mtest.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/read.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/test.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib-streams.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib-streams.ads create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib-thin.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib-thin.ads create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib.adb create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib.ads create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/ada/zlib.gpr create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/amd64/amd64-match.S create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/asm686/README.686 create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/asm686/match.S create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/blast/README create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/blast/blast.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/blast/blast.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/blast/test.pk create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/blast/test.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/delphi/ZLib.pas create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/delphi/ZLibConst.pas create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/delphi/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/delphi/zlibd32.mak create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib.build create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib.chm create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/CodecBase.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/Deflater.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/DotZLib.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/GZipStream.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/Inflater.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/DotZLib/UnitTests.cs create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/LICENSE_1_0.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/dotzlib/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/gcc_gvmat64/gvmat64.S create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/README create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/infback9.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/infback9.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/inffix9.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/inflate9.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/inftree9.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/infback9/inftree9.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/inflate86/inffas86.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/inflate86/inffast.S create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream/test.cpp create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream/zfstream.cpp create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream/zfstream.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream2/zstream.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream2/zstream_test.cpp create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream3/README create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream3/TODO create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream3/test.cc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream3/zfstream.cc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/iostream3/zfstream.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx64/bld_ml64.bat create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx64/gvmat64.asm create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx64/inffas8664.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx64/inffasx64.asm create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx64/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx86/bld_ml32.bat create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx86/inffas32.asm create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx86/match686.asm create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/masmx86/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/Makefile.am create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/MiniZip64_Changes.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/MiniZip64_info.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/configure.ac create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/crypt.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/ioapi.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/ioapi.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/iowin32.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/iowin32.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/make_vms.com create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/miniunz.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/miniunzip.1 create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/minizip.1 create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/minizip.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/minizip.pc.in create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/mztools.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/mztools.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/unzip.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/unzip.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/zip.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/minizip/zip.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/pascal/example.pas create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/pascal/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/pascal/zlibd32.mak create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/pascal/zlibpas.pas create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/puff/README create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/puff/puff.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/puff/puff.h create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/puff/pufftest.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/puff/zeros.raw create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/testzlib/testzlib.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/testzlib/testzlib.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/untgz/Makefile.msc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/untgz/untgz.c create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/readme.txt create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc10/zlib.rc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc10/zlibvc.def create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc11/zlib.rc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc11/zlibvc.def create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc12/zlib.rc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc12/zlibvc.def create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc14/zlib.rc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc14/zlibvc.def create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc9/zlib.rc create mode 100644 Engine/lib/assimp/contrib/zlib/contrib/vstudio/vc9/zlibvc.def create mode 100644 Engine/lib/assimp/include/assimp/ZipArchiveIOSystem.h rename Engine/lib/assimp/{code/Macros.h => include/assimp/aabb.h} (60%) create mode 100644 Engine/lib/assimp/include/assimp/revision.h diff --git a/Engine/lib/assimp/code/3DSConverter.cpp b/Engine/lib/assimp/code/3DS/3DSConverter.cpp similarity index 99% rename from Engine/lib/assimp/code/3DSConverter.cpp rename to Engine/lib/assimp/code/3DS/3DSConverter.cpp index e6865a809..3c3da36a3 100644 --- a/Engine/lib/assimp/code/3DSConverter.cpp +++ b/Engine/lib/assimp/code/3DS/3DSConverter.cpp @@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "3DSLoader.h" -#include "TargetAnimation.h" +#include "Common/TargetAnimation.h" #include #include #include @@ -72,7 +72,7 @@ void Discreet3DSImporter::ReplaceDefaultMaterial() unsigned int idx( NotSet ); for (unsigned int i = 0; i < mScene->mMaterials.size();++i) { - std::string &s = mScene->mMaterials[i].mName; + std::string s = mScene->mMaterials[i].mName; for ( std::string::iterator it = s.begin(); it != s.end(); ++it ) { *it = static_cast< char >( ::tolower( *it ) ); } diff --git a/Engine/lib/assimp/code/3DSExporter.cpp b/Engine/lib/assimp/code/3DS/3DSExporter.cpp similarity index 99% rename from Engine/lib/assimp/code/3DSExporter.cpp rename to Engine/lib/assimp/code/3DS/3DSExporter.cpp index 2501d4049..1117a52ef 100644 --- a/Engine/lib/assimp/code/3DSExporter.cpp +++ b/Engine/lib/assimp/code/3DS/3DSExporter.cpp @@ -43,15 +43,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_3DS_EXPORTER -#include "3DSExporter.h" -#include "3DSLoader.h" -#include "3DSHelper.h" +#include "3DS/3DSExporter.h" +#include "3DS/3DSLoader.h" +#include "3DS/3DSHelper.h" +#include "PostProcessing/SplitLargeMeshes.h" + #include -#include "SplitLargeMeshes.h" #include #include #include #include + #include using namespace Assimp; diff --git a/Engine/lib/assimp/code/3DSExporter.h b/Engine/lib/assimp/code/3DS/3DSExporter.h similarity index 100% rename from Engine/lib/assimp/code/3DSExporter.h rename to Engine/lib/assimp/code/3DS/3DSExporter.h diff --git a/Engine/lib/assimp/code/3DSHelper.h b/Engine/lib/assimp/code/3DS/3DSHelper.h similarity index 100% rename from Engine/lib/assimp/code/3DSHelper.h rename to Engine/lib/assimp/code/3DS/3DSHelper.h diff --git a/Engine/lib/assimp/code/3DSLoader.cpp b/Engine/lib/assimp/code/3DS/3DSLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/3DSLoader.cpp rename to Engine/lib/assimp/code/3DS/3DSLoader.cpp index 96b80c962..3c659d0b0 100644 --- a/Engine/lib/assimp/code/3DSLoader.cpp +++ b/Engine/lib/assimp/code/3DS/3DSLoader.cpp @@ -50,9 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER -// internal headers #include "3DSLoader.h" -#include #include #include #include diff --git a/Engine/lib/assimp/code/3DSLoader.h b/Engine/lib/assimp/code/3DS/3DSLoader.h similarity index 100% rename from Engine/lib/assimp/code/3DSLoader.h rename to Engine/lib/assimp/code/3DS/3DSLoader.h diff --git a/Engine/lib/assimp/code/3MFXmlTags.h b/Engine/lib/assimp/code/3MF/3MFXmlTags.h similarity index 100% rename from Engine/lib/assimp/code/3MFXmlTags.h rename to Engine/lib/assimp/code/3MF/3MFXmlTags.h diff --git a/Engine/lib/assimp/code/D3MFExporter.cpp b/Engine/lib/assimp/code/3MF/D3MFExporter.cpp similarity index 99% rename from Engine/lib/assimp/code/D3MFExporter.cpp rename to Engine/lib/assimp/code/3MF/D3MFExporter.cpp index e8da91ba9..1f388ad3e 100644 --- a/Engine/lib/assimp/code/D3MFExporter.cpp +++ b/Engine/lib/assimp/code/3MF/D3MFExporter.cpp @@ -55,7 +55,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "3MFXmlTags.h" #include "D3MFOpcPackage.h" -#include +#ifdef ASSIMP_USE_HUNTER +# include +#else +# include +#endif namespace Assimp { diff --git a/Engine/lib/assimp/code/D3MFExporter.h b/Engine/lib/assimp/code/3MF/D3MFExporter.h similarity index 100% rename from Engine/lib/assimp/code/D3MFExporter.h rename to Engine/lib/assimp/code/3MF/D3MFExporter.h diff --git a/Engine/lib/assimp/code/D3MFImporter.cpp b/Engine/lib/assimp/code/3MF/D3MFImporter.cpp similarity index 99% rename from Engine/lib/assimp/code/D3MFImporter.cpp rename to Engine/lib/assimp/code/3MF/D3MFImporter.cpp index c218f4005..682de684a 100644 --- a/Engine/lib/assimp/code/D3MFImporter.cpp +++ b/Engine/lib/assimp/code/3MF/D3MFImporter.cpp @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include @@ -58,7 +59,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "D3MFOpcPackage.h" -#include #include #include "3MFXmlTags.h" #include @@ -449,7 +449,7 @@ bool D3MFImporter::CanRead(const std::string &filename, IOSystem *pIOHandler, bo if ( nullptr == pIOHandler ) { return false; } - if ( !D3MF::D3MFOpcPackage::isZipArchive( pIOHandler, filename ) ) { + if ( !ZipArchiveIOSystem::isZipArchive( pIOHandler, filename ) ) { return false; } D3MF::D3MFOpcPackage opcPackage( pIOHandler, filename ); diff --git a/Engine/lib/assimp/code/D3MFImporter.h b/Engine/lib/assimp/code/3MF/D3MFImporter.h similarity index 100% rename from Engine/lib/assimp/code/D3MFImporter.h rename to Engine/lib/assimp/code/3MF/D3MFImporter.h diff --git a/Engine/lib/assimp/code/3MF/D3MFOpcPackage.cpp b/Engine/lib/assimp/code/3MF/D3MFOpcPackage.cpp new file mode 100644 index 000000000..873ba8ee8 --- /dev/null +++ b/Engine/lib/assimp/code/3MF/D3MFOpcPackage.cpp @@ -0,0 +1,207 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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_3MF_IMPORTER + +#include "D3MFOpcPackage.h" +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "3MFXmlTags.h" + +namespace Assimp { + +namespace D3MF { +// ------------------------------------------------------------------------------------------------ + +typedef std::shared_ptr OpcPackageRelationshipPtr; + +class OpcPackageRelationshipReader { +public: + OpcPackageRelationshipReader(XmlReader* xmlReader) { + while(xmlReader->read()) { + if(xmlReader->getNodeType() == irr::io::EXN_ELEMENT && + xmlReader->getNodeName() == XmlTag::RELS_RELATIONSHIP_CONTAINER) + { + ParseRootNode(xmlReader); + } + } + } + + void ParseRootNode(XmlReader* xmlReader) + { + ParseAttributes(xmlReader); + + while(xmlReader->read()) + { + if(xmlReader->getNodeType() == irr::io::EXN_ELEMENT && + xmlReader->getNodeName() == XmlTag::RELS_RELATIONSHIP_NODE) + { + ParseChildNode(xmlReader); + } + } + } + + void ParseAttributes(XmlReader*) { + // empty + } + + bool validateRels( OpcPackageRelationshipPtr &relPtr ) { + if ( relPtr->id.empty() || relPtr->type.empty() || relPtr->target.empty() ) { + return false; + } + return true; + } + + void ParseChildNode(XmlReader* xmlReader) { + OpcPackageRelationshipPtr relPtr(new OpcPackageRelationship()); + + relPtr->id = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_ID.c_str()); + relPtr->type = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_TYPE.c_str()); + relPtr->target = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_TARGET.c_str()); + if ( validateRels( relPtr ) ) { + m_relationShips.push_back( relPtr ); + } + } + + std::vector m_relationShips; +}; + +// ------------------------------------------------------------------------------------------------ +D3MFOpcPackage::D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile) +: mRootStream(nullptr) +, mZipArchive() { + mZipArchive.reset( new ZipArchiveIOSystem( pIOHandler, rFile ) ); + if(!mZipArchive->isOpen()) { + throw DeadlyImportError("Failed to open file " + rFile+ "."); + } + + std::vector fileList; + mZipArchive->getFileList(fileList); + + for (auto& file: fileList) { + if(file == D3MF::XmlTag::ROOT_RELATIONSHIPS_ARCHIVE) { + //PkgRelationshipReader pkgRelReader(file, archive); + ai_assert(mZipArchive->Exists(file.c_str())); + + IOStream *fileStream = mZipArchive->Open(file.c_str()); + + ai_assert(fileStream != nullptr); + + std::string rootFile = ReadPackageRootRelationship(fileStream); + if ( rootFile.size() > 0 && rootFile[ 0 ] == '/' ) { + rootFile = rootFile.substr( 1 ); + if ( rootFile[ 0 ] == '/' ) { + // deal with zip-bug + rootFile = rootFile.substr( 1 ); + } + } + + ASSIMP_LOG_DEBUG(rootFile); + + mZipArchive->Close(fileStream); + + mRootStream = mZipArchive->Open(rootFile.c_str()); + ai_assert( mRootStream != nullptr ); + if ( nullptr == mRootStream ) { + throw DeadlyExportError( "Cannot open root-file in archive : " + rootFile ); + } + + } else if( file == D3MF::XmlTag::CONTENT_TYPES_ARCHIVE) { + ASSIMP_LOG_WARN_F("Ignored file of unsupported type CONTENT_TYPES_ARCHIVES",file); + } else { + ASSIMP_LOG_WARN_F("Ignored file of unknown type: ",file); + } + + } +} + +D3MFOpcPackage::~D3MFOpcPackage() { + mZipArchive->Close(mRootStream); +} + +IOStream* D3MFOpcPackage::RootStream() const { + return mRootStream; +} + +static const std::string ModelRef = "3D/3dmodel.model"; + +bool D3MFOpcPackage::validate() { + if ( nullptr == mRootStream || nullptr == mZipArchive ) { + return false; + } + + return mZipArchive->Exists( ModelRef.c_str() ); +} + +std::string D3MFOpcPackage::ReadPackageRootRelationship(IOStream* stream) { + std::unique_ptr xmlStream(new CIrrXML_IOStreamReader(stream)); + std::unique_ptr xml(irr::io::createIrrXMLReader(xmlStream.get())); + + OpcPackageRelationshipReader reader(xml.get()); + + auto itr = std::find_if(reader.m_relationShips.begin(), reader.m_relationShips.end(), [](const OpcPackageRelationshipPtr& rel){ + return rel->type == XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE; + }); + + if ( itr == reader.m_relationShips.end() ) { + throw DeadlyImportError( "Cannot find " + XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE ); + } + + return (*itr)->target; +} + +} // Namespace D3MF +} // Namespace Assimp + +#endif //ASSIMP_BUILD_NO_3MF_IMPORTER diff --git a/Engine/lib/assimp/code/D3MFOpcPackage.h b/Engine/lib/assimp/code/3MF/D3MFOpcPackage.h similarity index 94% rename from Engine/lib/assimp/code/D3MFOpcPackage.h rename to Engine/lib/assimp/code/3MF/D3MFOpcPackage.h index 47c67f45f..87d172116 100644 --- a/Engine/lib/assimp/code/D3MFOpcPackage.h +++ b/Engine/lib/assimp/code/3MF/D3MFOpcPackage.h @@ -49,6 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include namespace Assimp { + class ZipArchiveIOSystem; + namespace D3MF { using XmlReader = irr::io::IrrXMLReader ; @@ -60,22 +62,19 @@ struct OpcPackageRelationship { std::string target; }; -class D3MFZipArchive; - class D3MFOpcPackage { public: D3MFOpcPackage( IOSystem* pIOHandler, const std::string& rFile ); ~D3MFOpcPackage(); IOStream* RootStream() const; bool validate(); - static bool isZipArchive( IOSystem* pIOHandler, const std::string& rFile ); protected: std::string ReadPackageRootRelationship(IOStream* stream); private: IOStream* mRootStream; - std::unique_ptr mZipArchive; + std::unique_ptr mZipArchive; }; } // Namespace D3MF diff --git a/Engine/lib/assimp/code/ACLoader.cpp b/Engine/lib/assimp/code/AC/ACLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/ACLoader.cpp rename to Engine/lib/assimp/code/AC/ACLoader.cpp index 2eb839553..d4c4bd1a6 100644 --- a/Engine/lib/assimp/code/ACLoader.cpp +++ b/Engine/lib/assimp/code/AC/ACLoader.cpp @@ -53,7 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "Importer.h" +#include "Common/Importer.h" #include #include #include diff --git a/Engine/lib/assimp/code/ACLoader.h b/Engine/lib/assimp/code/AC/ACLoader.h similarity index 100% rename from Engine/lib/assimp/code/ACLoader.h rename to Engine/lib/assimp/code/AC/ACLoader.h diff --git a/Engine/lib/assimp/code/AMFImporter.cpp b/Engine/lib/assimp/code/AMF/AMFImporter.cpp similarity index 99% rename from Engine/lib/assimp/code/AMFImporter.cpp rename to Engine/lib/assimp/code/AMF/AMFImporter.cpp index d173bd0f5..dedb6dcdd 100644 --- a/Engine/lib/assimp/code/AMFImporter.cpp +++ b/Engine/lib/assimp/code/AMF/AMFImporter.cpp @@ -83,7 +83,7 @@ void AMFImporter::Clear() mMaterial_Converted.clear(); mTexture_Converted.clear(); // Delete all elements - if(mNodeElement_List.size()) + if(!mNodeElement_List.empty()) { for(CAMFImporter_NodeElement* ne: mNodeElement_List) { delete ne; } diff --git a/Engine/lib/assimp/code/AMFImporter.hpp b/Engine/lib/assimp/code/AMF/AMFImporter.hpp similarity index 100% rename from Engine/lib/assimp/code/AMFImporter.hpp rename to Engine/lib/assimp/code/AMF/AMFImporter.hpp diff --git a/Engine/lib/assimp/code/AMFImporter_Geometry.cpp b/Engine/lib/assimp/code/AMF/AMFImporter_Geometry.cpp similarity index 100% rename from Engine/lib/assimp/code/AMFImporter_Geometry.cpp rename to Engine/lib/assimp/code/AMF/AMFImporter_Geometry.cpp diff --git a/Engine/lib/assimp/code/AMFImporter_Macro.hpp b/Engine/lib/assimp/code/AMF/AMFImporter_Macro.hpp similarity index 100% rename from Engine/lib/assimp/code/AMFImporter_Macro.hpp rename to Engine/lib/assimp/code/AMF/AMFImporter_Macro.hpp diff --git a/Engine/lib/assimp/code/AMFImporter_Material.cpp b/Engine/lib/assimp/code/AMF/AMFImporter_Material.cpp similarity index 100% rename from Engine/lib/assimp/code/AMFImporter_Material.cpp rename to Engine/lib/assimp/code/AMF/AMFImporter_Material.cpp diff --git a/Engine/lib/assimp/code/AMFImporter_Node.hpp b/Engine/lib/assimp/code/AMF/AMFImporter_Node.hpp similarity index 100% rename from Engine/lib/assimp/code/AMFImporter_Node.hpp rename to Engine/lib/assimp/code/AMF/AMFImporter_Node.hpp diff --git a/Engine/lib/assimp/code/AMFImporter_Postprocess.cpp b/Engine/lib/assimp/code/AMF/AMFImporter_Postprocess.cpp similarity index 98% rename from Engine/lib/assimp/code/AMFImporter_Postprocess.cpp rename to Engine/lib/assimp/code/AMF/AMFImporter_Postprocess.cpp index 2bfe3f78c..79b5e15e2 100644 --- a/Engine/lib/assimp/code/AMFImporter_Postprocess.cpp +++ b/Engine/lib/assimp/code/AMF/AMFImporter_Postprocess.cpp @@ -66,7 +66,7 @@ aiColor4D AMFImporter::SPP_Material::GetColor(const float /*pX*/, const float /* aiColor4D tcol; // Check if stored data are supported. - if(Composition.size() != 0) + if(!Composition.empty()) { throw DeadlyImportError("IME. GetColor for composition"); } @@ -321,7 +321,7 @@ void AMFImporter::PostprocessHelper_SplitFacesByTextureID(std::list 0) pOutputList_Separated.push_back(face_list_cur); + if(!face_list_cur.empty()) pOutputList_Separated.push_back(face_list_cur); - } while(pInputList.size() > 0); + } while(!pInputList.empty()); } void AMFImporter::Postprocess_AddMetadata(const std::list& metadataList, aiNode& sceneNode) const @@ -712,7 +712,7 @@ std::list mesh_idx; }// for(const CAMFImporter_NodeElement* ne_child: pNodeElement.Child) // if meshes was created then assign new indices with current aiNode - if(mesh_idx.size() > 0) + if(!mesh_idx.empty()) { std::list::const_iterator mit = mesh_idx.begin(); @@ -787,7 +787,7 @@ std::list ch_node; }// for(const CAMFImporter_NodeElement* ne: pConstellation.Child) // copy found aiNode's as children - if(ch_node.size() == 0) throw DeadlyImportError(" must have at least one ."); + if(ch_node.empty()) throw DeadlyImportError(" must have at least one ."); size_t ch_idx = 0; @@ -883,13 +883,13 @@ nl_clean_loop: if(node_list.size() > 1) { // walk through all nodes - for(std::list::iterator nl_it = node_list.begin(); nl_it != node_list.end(); nl_it++) + for(std::list::iterator nl_it = node_list.begin(); nl_it != node_list.end(); ++nl_it) { // and try to find them in another top nodes. std::list::const_iterator next_it = nl_it; - next_it++; - for(; next_it != node_list.end(); next_it++) + ++next_it; + for(; next_it != node_list.end(); ++next_it) { if((*next_it)->FindNode((*nl_it)->mName) != nullptr) { @@ -907,7 +907,7 @@ nl_clean_loop: // // // Nodes - if(node_list.size() > 0) + if(!node_list.empty()) { std::list::const_iterator nl_it = node_list.begin(); @@ -924,7 +924,7 @@ nl_clean_loop: // // Meshes - if(mesh_list.size() > 0) + if(!mesh_list.empty()) { std::list::const_iterator ml_it = mesh_list.begin(); diff --git a/Engine/lib/assimp/code/ASELoader.cpp b/Engine/lib/assimp/code/ASE/ASELoader.cpp similarity index 99% rename from Engine/lib/assimp/code/ASELoader.cpp rename to Engine/lib/assimp/code/ASE/ASELoader.cpp index 321e8548a..8e99214a8 100644 --- a/Engine/lib/assimp/code/ASELoader.cpp +++ b/Engine/lib/assimp/code/ASE/ASELoader.cpp @@ -53,7 +53,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ASELoader.h" #include #include -#include "TargetAnimation.h" +#include "Common/TargetAnimation.h" + #include #include #include @@ -88,23 +89,25 @@ ASEImporter::ASEImporter() , mBuffer() , pcScene() , configRecomputeNormals() -, noSkeletonMesh() -{} +, noSkeletonMesh() { + // empty +} // ------------------------------------------------------------------------------------------------ // Destructor, private as well -ASEImporter::~ASEImporter() -{} +ASEImporter::~ASEImporter() { + // empty +} // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. -bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const -{ +bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const { // check file extension const std::string extension = GetExtension(pFile); - if( extension == "ase" || extension == "ask") + if (extension == "ase" || extension == "ask") { return true; + } if ((!extension.length() || cs) && pIOHandler) { const char* tokens[] = {"*3dsmax_asciiexport"}; @@ -115,15 +118,13 @@ bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool // ------------------------------------------------------------------------------------------------ // Loader meta information -const aiImporterDesc* ASEImporter::GetInfo () const -{ +const aiImporterDesc* ASEImporter::GetInfo () const { return &desc; } // ------------------------------------------------------------------------------------------------ // Setup configuration options -void ASEImporter::SetupProperties(const Importer* pImp) -{ +void ASEImporter::SetupProperties(const Importer* pImp) { configRecomputeNormals = (pImp->GetPropertyInteger( AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS,1) ? true : false); @@ -133,12 +134,11 @@ void ASEImporter::SetupProperties(const Importer* pImp) // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. void ASEImporter::InternReadFile( const std::string& pFile, - aiScene* pScene, IOSystem* pIOHandler) -{ + aiScene* pScene, IOSystem* pIOHandler) { 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 ASE file " + pFile + "."); } @@ -1299,7 +1299,7 @@ void ASEImporter::BuildMaterialIndices() } } - // Dekete our temporary array + // Delete our temporary array delete[] pcIntMaterials; } diff --git a/Engine/lib/assimp/code/ASELoader.h b/Engine/lib/assimp/code/ASE/ASELoader.h similarity index 99% rename from Engine/lib/assimp/code/ASELoader.h rename to Engine/lib/assimp/code/ASE/ASELoader.h index 33406e3e5..b497aa48b 100644 --- a/Engine/lib/assimp/code/ASELoader.h +++ b/Engine/lib/assimp/code/ASE/ASELoader.h @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/Engine/lib/assimp/code/ASEParser.cpp b/Engine/lib/assimp/code/ASE/ASEParser.cpp similarity index 99% rename from Engine/lib/assimp/code/ASEParser.cpp rename to Engine/lib/assimp/code/ASE/ASEParser.cpp index e8d6febc2..913e7b118 100644 --- a/Engine/lib/assimp/code/ASEParser.cpp +++ b/Engine/lib/assimp/code/ASE/ASEParser.cpp @@ -45,20 +45,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * @brief Implementation of the ASE parser class */ - #ifndef ASSIMP_BUILD_NO_ASE_IMPORTER #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER // internal headers -#include "TextureTransform.h" +#include "PostProcessing/TextureTransform.h" #include "ASELoader.h" + #include #include using namespace Assimp; using namespace Assimp::ASE; - // ------------------------------------------------------------------------------------------------ // Begin an ASE parsing function diff --git a/Engine/lib/assimp/code/ASEParser.h b/Engine/lib/assimp/code/ASE/ASEParser.h similarity index 99% rename from Engine/lib/assimp/code/ASEParser.h rename to Engine/lib/assimp/code/ASE/ASEParser.h index b8c820632..988cbda8d 100644 --- a/Engine/lib/assimp/code/ASEParser.h +++ b/Engine/lib/assimp/code/ASE/ASEParser.h @@ -57,7 +57,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include // ASE is quite similar to 3ds. We can reuse some structures -#include "3DSLoader.h" +#include "3DS/3DSLoader.h" namespace Assimp { namespace ASE { @@ -188,10 +188,11 @@ struct Animation { } mRotationType, mScalingType, mPositionType; Animation() AI_NO_EXCEPT - : mRotationType (TRACK) - , mScalingType (TRACK) - , mPositionType (TRACK) - {} + : mRotationType (TRACK) + , mScalingType (TRACK) + , mPositionType (TRACK) { + // empty + } //! List of track rotation keyframes std::vector< aiQuatKey > akeyRotations; @@ -243,7 +244,6 @@ struct BaseNode { mTargetPosition.x = qnan; } - //! Name of the mesh std::string mName; diff --git a/Engine/lib/assimp/code/AssbinExporter.cpp b/Engine/lib/assimp/code/Assbin/AssbinExporter.cpp similarity index 99% rename from Engine/lib/assimp/code/AssbinExporter.cpp rename to Engine/lib/assimp/code/Assbin/AssbinExporter.cpp index 03b0368ce..76c823f82 100644 --- a/Engine/lib/assimp/code/AssbinExporter.cpp +++ b/Engine/lib/assimp/code/Assbin/AssbinExporter.cpp @@ -46,12 +46,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER -#include "assbin_chunks.h" +#include "Common/assbin_chunks.h" +#include "PostProcessing/ProcessHelper.h" + #include #include #include #include -#include "ProcessHelper.h" #include #ifdef ASSIMP_BUILD_NO_OWN_ZLIB diff --git a/Engine/lib/assimp/code/AssbinExporter.h b/Engine/lib/assimp/code/Assbin/AssbinExporter.h similarity index 100% rename from Engine/lib/assimp/code/AssbinExporter.h rename to Engine/lib/assimp/code/Assbin/AssbinExporter.h diff --git a/Engine/lib/assimp/code/AssbinLoader.cpp b/Engine/lib/assimp/code/Assbin/AssbinLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/AssbinLoader.cpp rename to Engine/lib/assimp/code/Assbin/AssbinLoader.cpp index 7adb8db6f..becc3f8fc 100644 --- a/Engine/lib/assimp/code/AssbinLoader.cpp +++ b/Engine/lib/assimp/code/Assbin/AssbinLoader.cpp @@ -50,8 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER // internal headers -#include "AssbinLoader.h" -#include "assbin_chunks.h" +#include "Assbin/AssbinLoader.h" +#include "Common/assbin_chunks.h" #include #include #include @@ -68,7 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; static const aiImporterDesc desc = { - ".assbin Importer", + "Assimp Binary Importer", "Gargaj / Conspiracy", "", "", @@ -708,7 +708,7 @@ void AssbinImporter::InternReadFile( const std::string& pFile, aiScene* pScene, unsigned char * uncompressedData = new unsigned char[ uncompressedSize ]; - int res = uncompress( uncompressedData, &uncompressedSize, compressedData, len ); + int res = uncompress( uncompressedData, &uncompressedSize, compressedData, (uLong) len ); if(res != Z_OK) { delete [] uncompressedData; diff --git a/Engine/lib/assimp/code/AssbinLoader.h b/Engine/lib/assimp/code/Assbin/AssbinLoader.h similarity index 100% rename from Engine/lib/assimp/code/AssbinLoader.h rename to Engine/lib/assimp/code/Assbin/AssbinLoader.h diff --git a/Engine/lib/assimp/code/Assjson/cencode.c b/Engine/lib/assimp/code/Assjson/cencode.c new file mode 100644 index 000000000..db99e7efa --- /dev/null +++ b/Engine/lib/assimp/code/Assjson/cencode.c @@ -0,0 +1,109 @@ +/* +cencoder.c - c source to a base64 encoding algorithm implementation + +This is part of the libb64 project, and has been placed in the public domain. +For details, see http://sourceforge.net/projects/libb64 +*/ + +#include "cencode.h" // changed from + +const int CHARS_PER_LINE = 72; + +void base64_init_encodestate(base64_encodestate* state_in) +{ + state_in->step = step_A; + state_in->result = 0; + state_in->stepcount = 0; +} + +char base64_encode_value(char value_in) +{ + static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + if (value_in > 63) return '='; + return encoding[(int)value_in]; +} + +int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in) +{ + const char* plainchar = plaintext_in; + const char* const plaintextend = plaintext_in + length_in; + char* codechar = code_out; + char result; + char fragment; + + result = state_in->result; + + switch (state_in->step) + { + while (1) + { + case step_A: + if (plainchar == plaintextend) + { + state_in->result = result; + state_in->step = step_A; + return codechar - code_out; + } + fragment = *plainchar++; + result = (fragment & 0x0fc) >> 2; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x003) << 4; + case step_B: + if (plainchar == plaintextend) + { + state_in->result = result; + state_in->step = step_B; + return codechar - code_out; + } + fragment = *plainchar++; + result |= (fragment & 0x0f0) >> 4; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x00f) << 2; + case step_C: + if (plainchar == plaintextend) + { + state_in->result = result; + state_in->step = step_C; + return codechar - code_out; + } + fragment = *plainchar++; + result |= (fragment & 0x0c0) >> 6; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x03f) >> 0; + *codechar++ = base64_encode_value(result); + + ++(state_in->stepcount); + if (state_in->stepcount == CHARS_PER_LINE/4) + { + *codechar++ = '\n'; + state_in->stepcount = 0; + } + } + } + /* control should not reach here */ + return codechar - code_out; +} + +int base64_encode_blockend(char* code_out, base64_encodestate* state_in) +{ + char* codechar = code_out; + + switch (state_in->step) + { + case step_B: + *codechar++ = base64_encode_value(state_in->result); + *codechar++ = '='; + *codechar++ = '='; + break; + case step_C: + *codechar++ = base64_encode_value(state_in->result); + *codechar++ = '='; + break; + case step_A: + break; + } + *codechar++ = '\n'; + + return codechar - code_out; +} + diff --git a/Engine/lib/assimp/code/Assjson/cencode.h b/Engine/lib/assimp/code/Assjson/cencode.h new file mode 100644 index 000000000..c1e3464af --- /dev/null +++ b/Engine/lib/assimp/code/Assjson/cencode.h @@ -0,0 +1,31 @@ +/* +cencode.h - c header for a base64 encoding algorithm + +This is part of the libb64 project, and has been placed in the public domain. +For details, see http://sourceforge.net/projects/libb64 +*/ + +#ifndef BASE64_CENCODE_H +#define BASE64_CENCODE_H + +typedef enum +{ + step_A, step_B, step_C +} base64_encodestep; + +typedef struct +{ + base64_encodestep step; + char result; + int stepcount; +} base64_encodestate; + +void base64_init_encodestate(base64_encodestate* state_in); + +char base64_encode_value(char value_in); + +int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); + +int base64_encode_blockend(char* code_out, base64_encodestate* state_in); + +#endif /* BASE64_CENCODE_H */ diff --git a/Engine/lib/assimp/code/Assjson/json_exporter.cpp b/Engine/lib/assimp/code/Assjson/json_exporter.cpp new file mode 100644 index 000000000..e9fa72496 --- /dev/null +++ b/Engine/lib/assimp/code/Assjson/json_exporter.cpp @@ -0,0 +1,809 @@ +/* +Assimp2Json +Copyright (c) 2011, Alexander C. Gessler + +Licensed under a 3-clause BSD license. See the LICENSE file for more information. + +*/ + +#ifndef ASSIMP_BUILD_NO_EXPORT +#ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define CURRENT_FORMAT_VERSION 100 + +// grab scoped_ptr from assimp to avoid a dependency on boost. +//#include + +#include "mesh_splitter.h" + +extern "C" { + #include "cencode.h" +} +namespace Assimp { + +void ExportAssimp2Json(const char*, Assimp::IOSystem*, const aiScene*, const Assimp::ExportProperties*); + +// small utility class to simplify serializing the aiScene to Json +class JSONWriter { +public: + enum { + Flag_DoNotIndent = 0x1, + Flag_WriteSpecialFloats = 0x2, + }; + + JSONWriter(Assimp::IOStream& out, unsigned int flags = 0u) + : out(out) + , first() + , flags(flags) { + // make sure that all formatting happens using the standard, C locale and not the user's current locale + buff.imbue(std::locale("C")); + } + + ~JSONWriter() { + Flush(); + } + + void Flush() { + const std::string s = buff.str(); + out.Write(s.c_str(), s.length(), 1); + buff.clear(); + } + + void PushIndent() { + indent += '\t'; + } + + void PopIndent() { + indent.erase(indent.end() - 1); + } + + void Key(const std::string& name) { + AddIndentation(); + Delimit(); + buff << '\"' + name + "\": "; + } + + template + void Element(const Literal& name) { + AddIndentation(); + Delimit(); + + LiteralToString(buff, name) << '\n'; + } + + template + void SimpleValue(const Literal& s) { + LiteralToString(buff, s) << '\n'; + } + + void SimpleValue(const void* buffer, size_t len) { + base64_encodestate s; + base64_init_encodestate(&s); + + char* const out = new char[std::max(len * 2, static_cast(16u))]; + const int n = base64_encode_block(reinterpret_cast(buffer), static_cast(len), out, &s); + out[n + base64_encode_blockend(out + n, &s)] = '\0'; + + // base64 encoding may add newlines, but JSON strings may not contain 'real' newlines + // (only escaped ones). Remove any newlines in out. + for (char* cur = out; *cur; ++cur) { + if (*cur == '\n') { + *cur = ' '; + } + } + + buff << '\"' << out << "\"\n"; + delete[] out; + } + + void StartObj(bool is_element = false) { + // if this appears as a plain array element, we need to insert a delimiter and we should also indent it + if (is_element) { + AddIndentation(); + if (!first) { + buff << ','; + } + } + first = true; + buff << "{\n"; + PushIndent(); + } + + void EndObj() { + PopIndent(); + AddIndentation(); + first = false; + buff << "}\n"; + } + + void StartArray(bool is_element = false) { + // if this appears as a plain array element, we need to insert a delimiter and we should also indent it + if (is_element) { + AddIndentation(); + if (!first) { + buff << ','; + } + } + first = true; + buff << "[\n"; + PushIndent(); + } + + void EndArray() { + PopIndent(); + AddIndentation(); + buff << "]\n"; + first = false; + } + + void AddIndentation() { + if (!(flags & Flag_DoNotIndent)) { + buff << indent; + } + } + + void Delimit() { + if (!first) { + buff << ','; + } + else { + buff << ' '; + first = false; + } + } + +private: + template + std::stringstream& LiteralToString(std::stringstream& stream, const Literal& s) { + stream << s; + return stream; + } + + std::stringstream& LiteralToString(std::stringstream& stream, const aiString& s) { + std::string t; + + // escape backslashes and single quotes, both would render the JSON invalid if left as is + t.reserve(s.length); + for (size_t i = 0; i < s.length; ++i) { + + if (s.data[i] == '\\' || s.data[i] == '\'' || s.data[i] == '\"') { + t.push_back('\\'); + } + + t.push_back(s.data[i]); + } + stream << "\""; + stream << t; + stream << "\""; + return stream; + } + + std::stringstream& LiteralToString(std::stringstream& stream, float f) { + if (!std::numeric_limits::is_iec559) { + // on a non IEEE-754 platform, we make no assumptions about the representation or existence + // of special floating-point numbers. + stream << f; + return stream; + } + + // JSON does not support writing Inf/Nan + // [RFC 4672: "Numeric values that cannot be represented as sequences of digits + // (such as Infinity and NaN) are not permitted."] + // Nevertheless, many parsers will accept the special keywords Infinity, -Infinity and NaN + if (std::numeric_limits::infinity() == fabs(f)) { + if (flags & Flag_WriteSpecialFloats) { + stream << (f < 0 ? "\"-" : "\"") + std::string("Infinity\""); + return stream; + } + // we should print this warning, but we can't - this is called from within a generic assimp exporter, we cannot use cerr + // std::cerr << "warning: cannot represent infinite number literal, substituting 0 instead (use -i flag to enforce Infinity/NaN)" << std::endl; + stream << "0.0"; + return stream; + } + // f!=f is the most reliable test for NaNs that I know of + else if (f != f) { + if (flags & Flag_WriteSpecialFloats) { + stream << "\"NaN\""; + return stream; + } + // we should print this warning, but we can't - this is called from within a generic assimp exporter, we cannot use cerr + // std::cerr << "warning: cannot represent infinite number literal, substituting 0 instead (use -i flag to enforce Infinity/NaN)" << std::endl; + stream << "0.0"; + return stream; + } + + stream << f; + return stream; + } + +private: + Assimp::IOStream& out; + std::string indent, newline; + std::stringstream buff; + bool first; + + unsigned int flags; +}; + +void Write(JSONWriter& out, const aiVector3D& ai, bool is_elem = true) { + out.StartArray(is_elem); + out.Element(ai.x); + out.Element(ai.y); + out.Element(ai.z); + out.EndArray(); +} + +void Write(JSONWriter& out, const aiQuaternion& ai, bool is_elem = true) { + out.StartArray(is_elem); + out.Element(ai.w); + out.Element(ai.x); + out.Element(ai.y); + out.Element(ai.z); + out.EndArray(); +} + +void Write(JSONWriter& out, const aiColor3D& ai, bool is_elem = true) { + out.StartArray(is_elem); + out.Element(ai.r); + out.Element(ai.g); + out.Element(ai.b); + out.EndArray(); +} + +void Write(JSONWriter& out, const aiMatrix4x4& ai, bool is_elem = true) { + out.StartArray(is_elem); + for (unsigned int x = 0; x < 4; ++x) { + for (unsigned int y = 0; y < 4; ++y) { + out.Element(ai[x][y]); + } + } + out.EndArray(); +} + +void Write(JSONWriter& out, const aiBone& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mName); + + out.Key("offsetmatrix"); + Write(out, ai.mOffsetMatrix, false); + + out.Key("weights"); + out.StartArray(); + for (unsigned int i = 0; i < ai.mNumWeights; ++i) { + out.StartArray(true); + out.Element(ai.mWeights[i].mVertexId); + out.Element(ai.mWeights[i].mWeight); + out.EndArray(); + } + out.EndArray(); + out.EndObj(); +} + +void Write(JSONWriter& out, const aiFace& ai, bool is_elem = true) { + out.StartArray(is_elem); + for (unsigned int i = 0; i < ai.mNumIndices; ++i) { + out.Element(ai.mIndices[i]); + } + out.EndArray(); +} + +void Write(JSONWriter& out, const aiMesh& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mName); + + out.Key("materialindex"); + out.SimpleValue(ai.mMaterialIndex); + + out.Key("primitivetypes"); + out.SimpleValue(ai.mPrimitiveTypes); + + out.Key("vertices"); + out.StartArray(); + for (unsigned int i = 0; i < ai.mNumVertices; ++i) { + out.Element(ai.mVertices[i].x); + out.Element(ai.mVertices[i].y); + out.Element(ai.mVertices[i].z); + } + out.EndArray(); + + if (ai.HasNormals()) { + out.Key("normals"); + out.StartArray(); + for (unsigned int i = 0; i < ai.mNumVertices; ++i) { + out.Element(ai.mNormals[i].x); + out.Element(ai.mNormals[i].y); + out.Element(ai.mNormals[i].z); + } + out.EndArray(); + } + + if (ai.HasTangentsAndBitangents()) { + out.Key("tangents"); + out.StartArray(); + for (unsigned int i = 0; i < ai.mNumVertices; ++i) { + out.Element(ai.mTangents[i].x); + out.Element(ai.mTangents[i].y); + out.Element(ai.mTangents[i].z); + } + out.EndArray(); + + out.Key("bitangents"); + out.StartArray(); + for (unsigned int i = 0; i < ai.mNumVertices; ++i) { + out.Element(ai.mBitangents[i].x); + out.Element(ai.mBitangents[i].y); + out.Element(ai.mBitangents[i].z); + } + out.EndArray(); + } + + if (ai.GetNumUVChannels()) { + out.Key("numuvcomponents"); + out.StartArray(); + for (unsigned int n = 0; n < ai.GetNumUVChannels(); ++n) { + out.Element(ai.mNumUVComponents[n]); + } + out.EndArray(); + + out.Key("texturecoords"); + out.StartArray(); + for (unsigned int n = 0; n < ai.GetNumUVChannels(); ++n) { + const unsigned int numc = ai.mNumUVComponents[n] ? ai.mNumUVComponents[n] : 2; + + out.StartArray(true); + for (unsigned int i = 0; i < ai.mNumVertices; ++i) { + for (unsigned int c = 0; c < numc; ++c) { + out.Element(ai.mTextureCoords[n][i][c]); + } + } + out.EndArray(); + } + out.EndArray(); + } + + if (ai.GetNumColorChannels()) { + out.Key("colors"); + out.StartArray(); + for (unsigned int n = 0; n < ai.GetNumColorChannels(); ++n) { + out.StartArray(true); + for (unsigned int i = 0; i < ai.mNumVertices; ++i) { + out.Element(ai.mColors[n][i].r); + out.Element(ai.mColors[n][i].g); + out.Element(ai.mColors[n][i].b); + out.Element(ai.mColors[n][i].a); + } + out.EndArray(); + } + out.EndArray(); + } + + if (ai.mNumBones) { + out.Key("bones"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumBones; ++n) { + Write(out, *ai.mBones[n]); + } + out.EndArray(); + } + + out.Key("faces"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumFaces; ++n) { + Write(out, ai.mFaces[n]); + } + out.EndArray(); + + out.EndObj(); +} + +void Write(JSONWriter& out, const aiNode& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mName); + + out.Key("transformation"); + Write(out, ai.mTransformation, false); + + if (ai.mNumMeshes) { + out.Key("meshes"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumMeshes; ++n) { + out.Element(ai.mMeshes[n]); + } + out.EndArray(); + } + + if (ai.mNumChildren) { + out.Key("children"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumChildren; ++n) { + Write(out, *ai.mChildren[n]); + } + out.EndArray(); + } + + out.EndObj(); +} + +void Write(JSONWriter& out, const aiMaterial& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("properties"); + out.StartArray(); + for (unsigned int i = 0; i < ai.mNumProperties; ++i) { + const aiMaterialProperty* const prop = ai.mProperties[i]; + out.StartObj(true); + out.Key("key"); + out.SimpleValue(prop->mKey); + out.Key("semantic"); + out.SimpleValue(prop->mSemantic); + out.Key("index"); + out.SimpleValue(prop->mIndex); + + out.Key("type"); + out.SimpleValue(prop->mType); + + out.Key("value"); + switch (prop->mType) { + case aiPTI_Float: + if (prop->mDataLength / sizeof(float) > 1) { + out.StartArray(); + for (unsigned int i = 0; i < prop->mDataLength / sizeof(float); ++i) { + out.Element(reinterpret_cast(prop->mData)[i]); + } + out.EndArray(); + } + else { + out.SimpleValue(*reinterpret_cast(prop->mData)); + } + break; + + case aiPTI_Integer: + if (prop->mDataLength / sizeof(int) > 1) { + out.StartArray(); + for (unsigned int i = 0; i < prop->mDataLength / sizeof(int); ++i) { + out.Element(reinterpret_cast(prop->mData)[i]); + } + out.EndArray(); + } else { + out.SimpleValue(*reinterpret_cast(prop->mData)); + } + break; + + case aiPTI_String: + { + aiString s; + aiGetMaterialString(&ai, prop->mKey.data, prop->mSemantic, prop->mIndex, &s); + out.SimpleValue(s); + } + break; + case aiPTI_Buffer: + { + // binary data is written as series of hex-encoded octets + out.SimpleValue(prop->mData, prop->mDataLength); + } + break; + default: + assert(false); + } + + out.EndObj(); + } + + out.EndArray(); + out.EndObj(); +} + +void Write(JSONWriter& out, const aiTexture& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("width"); + out.SimpleValue(ai.mWidth); + + out.Key("height"); + out.SimpleValue(ai.mHeight); + + out.Key("formathint"); + out.SimpleValue(aiString(ai.achFormatHint)); + + out.Key("data"); + if (!ai.mHeight) { + out.SimpleValue(ai.pcData, ai.mWidth); + } + else { + out.StartArray(); + for (unsigned int y = 0; y < ai.mHeight; ++y) { + out.StartArray(true); + for (unsigned int x = 0; x < ai.mWidth; ++x) { + const aiTexel& tx = ai.pcData[y*ai.mWidth + x]; + out.StartArray(true); + out.Element(static_cast(tx.r)); + out.Element(static_cast(tx.g)); + out.Element(static_cast(tx.b)); + out.Element(static_cast(tx.a)); + out.EndArray(); + } + out.EndArray(); + } + out.EndArray(); + } + + out.EndObj(); +} + +void Write(JSONWriter& out, const aiLight& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mName); + + out.Key("type"); + out.SimpleValue(ai.mType); + + if (ai.mType == aiLightSource_SPOT || ai.mType == aiLightSource_UNDEFINED) { + out.Key("angleinnercone"); + out.SimpleValue(ai.mAngleInnerCone); + + out.Key("angleoutercone"); + out.SimpleValue(ai.mAngleOuterCone); + } + + out.Key("attenuationconstant"); + out.SimpleValue(ai.mAttenuationConstant); + + out.Key("attenuationlinear"); + out.SimpleValue(ai.mAttenuationLinear); + + out.Key("attenuationquadratic"); + out.SimpleValue(ai.mAttenuationQuadratic); + + out.Key("diffusecolor"); + Write(out, ai.mColorDiffuse, false); + + out.Key("specularcolor"); + Write(out, ai.mColorSpecular, false); + + out.Key("ambientcolor"); + Write(out, ai.mColorAmbient, false); + + if (ai.mType != aiLightSource_POINT) { + out.Key("direction"); + Write(out, ai.mDirection, false); + + } + + if (ai.mType != aiLightSource_DIRECTIONAL) { + out.Key("position"); + Write(out, ai.mPosition, false); + } + + out.EndObj(); +} + +void Write(JSONWriter& out, const aiNodeAnim& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mNodeName); + + out.Key("prestate"); + out.SimpleValue(ai.mPreState); + + out.Key("poststate"); + out.SimpleValue(ai.mPostState); + + if (ai.mNumPositionKeys) { + out.Key("positionkeys"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumPositionKeys; ++n) { + const aiVectorKey& pos = ai.mPositionKeys[n]; + out.StartArray(true); + out.Element(pos.mTime); + Write(out, pos.mValue); + out.EndArray(); + } + out.EndArray(); + } + + if (ai.mNumRotationKeys) { + out.Key("rotationkeys"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumRotationKeys; ++n) { + const aiQuatKey& rot = ai.mRotationKeys[n]; + out.StartArray(true); + out.Element(rot.mTime); + Write(out, rot.mValue); + out.EndArray(); + } + out.EndArray(); + } + + if (ai.mNumScalingKeys) { + out.Key("scalingkeys"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumScalingKeys; ++n) { + const aiVectorKey& scl = ai.mScalingKeys[n]; + out.StartArray(true); + out.Element(scl.mTime); + Write(out, scl.mValue); + out.EndArray(); + } + out.EndArray(); + } + out.EndObj(); +} + +void Write(JSONWriter& out, const aiAnimation& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mName); + + out.Key("tickspersecond"); + out.SimpleValue(ai.mTicksPerSecond); + + out.Key("duration"); + out.SimpleValue(ai.mDuration); + + out.Key("channels"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumChannels; ++n) { + Write(out, *ai.mChannels[n]); + } + out.EndArray(); + out.EndObj(); +} + +void Write(JSONWriter& out, const aiCamera& ai, bool is_elem = true) { + out.StartObj(is_elem); + + out.Key("name"); + out.SimpleValue(ai.mName); + + out.Key("aspect"); + out.SimpleValue(ai.mAspect); + + out.Key("clipplanefar"); + out.SimpleValue(ai.mClipPlaneFar); + + out.Key("clipplanenear"); + out.SimpleValue(ai.mClipPlaneNear); + + out.Key("horizontalfov"); + out.SimpleValue(ai.mHorizontalFOV); + + out.Key("up"); + Write(out, ai.mUp, false); + + out.Key("lookat"); + Write(out, ai.mLookAt, false); + + out.EndObj(); +} + +void WriteFormatInfo(JSONWriter& out) { + out.StartObj(); + out.Key("format"); + out.SimpleValue("\"assimp2json\""); + out.Key("version"); + out.SimpleValue(CURRENT_FORMAT_VERSION); + out.EndObj(); +} + +void Write(JSONWriter& out, const aiScene& ai) { + out.StartObj(); + + out.Key("__metadata__"); + WriteFormatInfo(out); + + out.Key("rootnode"); + Write(out, *ai.mRootNode, false); + + out.Key("flags"); + out.SimpleValue(ai.mFlags); + + if (ai.HasMeshes()) { + out.Key("meshes"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumMeshes; ++n) { + Write(out, *ai.mMeshes[n]); + } + out.EndArray(); + } + + if (ai.HasMaterials()) { + out.Key("materials"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumMaterials; ++n) { + Write(out, *ai.mMaterials[n]); + } + out.EndArray(); + } + + if (ai.HasAnimations()) { + out.Key("animations"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumAnimations; ++n) { + Write(out, *ai.mAnimations[n]); + } + out.EndArray(); + } + + if (ai.HasLights()) { + out.Key("lights"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumLights; ++n) { + Write(out, *ai.mLights[n]); + } + out.EndArray(); + } + + if (ai.HasCameras()) { + out.Key("cameras"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumCameras; ++n) { + Write(out, *ai.mCameras[n]); + } + out.EndArray(); + } + + if (ai.HasTextures()) { + out.Key("textures"); + out.StartArray(); + for (unsigned int n = 0; n < ai.mNumTextures; ++n) { + Write(out, *ai.mTextures[n]); + } + out.EndArray(); + } + out.EndObj(); +} + + +void ExportAssimp2Json(const char* file, Assimp::IOSystem* io, const aiScene* scene, const Assimp::ExportProperties*) { + std::unique_ptr str(io->Open(file, "wt")); + if (!str) { + //throw Assimp::DeadlyExportError("could not open output file"); + } + + // get a copy of the scene so we can modify it + aiScene* scenecopy_tmp; + aiCopyScene(scene, &scenecopy_tmp); + + try { + // split meshes so they fit into a 16 bit index buffer + MeshSplitter splitter; + splitter.SetLimit(1 << 16); + splitter.Execute(scenecopy_tmp); + + // XXX Flag_WriteSpecialFloats is turned on by default, right now we don't have a configuration interface for exporters + JSONWriter s(*str, JSONWriter::Flag_WriteSpecialFloats); + Write(s, *scenecopy_tmp); + + } + catch (...) { + aiFreeScene(scenecopy_tmp); + throw; + } + aiFreeScene(scenecopy_tmp); +} + +} + +#endif // ASSIMP_BUILD_NO_ASSJSON_EXPORTER +#endif // ASSIMP_BUILD_NO_EXPORT diff --git a/Engine/lib/assimp/code/Assjson/mesh_splitter.cpp b/Engine/lib/assimp/code/Assjson/mesh_splitter.cpp new file mode 100644 index 000000000..24385f9a0 --- /dev/null +++ b/Engine/lib/assimp/code/Assjson/mesh_splitter.cpp @@ -0,0 +1,320 @@ +/* +Assimp2Json +Copyright (c) 2011, Alexander C. Gessler + +Licensed under a 3-clause BSD license. See the LICENSE file for more information. + +*/ + +#include "mesh_splitter.h" + +#include + +// ---------------------------------------------------------------------------- +// Note: this is largely based on assimp's SplitLargeMeshes_Vertex process. +// it is refactored and the coding style is slightly improved, though. +// ---------------------------------------------------------------------------- + +// ------------------------------------------------------------------------------------------------ +// Executes the post processing step on the given imported data. +void MeshSplitter::Execute( aiScene* pScene) { + std::vector > source_mesh_map; + + for( unsigned int a = 0; a < pScene->mNumMeshes; a++) { + SplitMesh(a, pScene->mMeshes[a],source_mesh_map); + } + + const unsigned int size = static_cast(source_mesh_map.size()); + if (size != pScene->mNumMeshes) { + // it seems something has been split. rebuild the mesh list + delete[] pScene->mMeshes; + pScene->mNumMeshes = size; + pScene->mMeshes = new aiMesh*[size](); + + for (unsigned int i = 0; i < size;++i) { + pScene->mMeshes[i] = source_mesh_map[i].first; + } + + // now we need to update all nodes + UpdateNode(pScene->mRootNode,source_mesh_map); + } +} + + +// ------------------------------------------------------------------------------------------------ +void MeshSplitter::UpdateNode(aiNode* pcNode, const std::vector >& source_mesh_map) { + // TODO: should better use std::(multi)set for source_mesh_map. + + // for every index in out list build a new entry + std::vector aiEntries; + aiEntries.reserve(pcNode->mNumMeshes + 1); + for (unsigned int i = 0; i < pcNode->mNumMeshes;++i) { + for (unsigned int a = 0, end = static_cast(source_mesh_map.size()); a < end;++a) { + if (source_mesh_map[a].second == pcNode->mMeshes[i]) { + aiEntries.push_back(a); + } + } + } + + // now build the new list + delete pcNode->mMeshes; + pcNode->mNumMeshes = static_cast(aiEntries.size()); + pcNode->mMeshes = new unsigned int[pcNode->mNumMeshes]; + + for (unsigned int b = 0; b < pcNode->mNumMeshes;++b) { + pcNode->mMeshes[b] = aiEntries[b]; + } + + // recursively update children + for (unsigned int i = 0, end = pcNode->mNumChildren; i < end;++i) { + UpdateNode ( pcNode->mChildren[i], source_mesh_map ); + } + return; +} + +#define WAS_NOT_COPIED 0xffffffff + +typedef std::pair PerVertexWeight; +typedef std::vector VertexWeightTable; + +// ------------------------------------------------------------------------------------------------ +VertexWeightTable* ComputeVertexBoneWeightTable(const aiMesh* pMesh) { + if (!pMesh || !pMesh->mNumVertices || !pMesh->mNumBones) { + return nullptr; + } + + VertexWeightTable* const avPerVertexWeights = new VertexWeightTable[pMesh->mNumVertices]; + for (unsigned int i = 0; i < pMesh->mNumBones;++i) { + + aiBone* bone = pMesh->mBones[i]; + for (unsigned int a = 0; a < bone->mNumWeights;++a) { + const aiVertexWeight& weight = bone->mWeights[a]; + avPerVertexWeights[weight.mVertexId].push_back( std::make_pair(i,weight.mWeight) ); + } + } + return avPerVertexWeights; +} + +// ------------------------------------------------------------------------------------------------ +void MeshSplitter :: SplitMesh(unsigned int a, aiMesh* in_mesh, std::vector >& source_mesh_map) { + // TODO: should better use std::(multi)set for source_mesh_map. + + if (in_mesh->mNumVertices <= LIMIT) { + source_mesh_map.push_back(std::make_pair(in_mesh,a)); + return; + } + + // build a per-vertex weight list if necessary + VertexWeightTable* avPerVertexWeights = ComputeVertexBoneWeightTable(in_mesh); + + // we need to split this mesh into sub meshes. Estimate submesh size + const unsigned int sub_meshes = (in_mesh->mNumVertices / LIMIT) + 1; + + // create a std::vector to remember which vertices have already + // been copied and to which position (i.e. output index) + std::vector was_copied_to; + was_copied_to.resize(in_mesh->mNumVertices,WAS_NOT_COPIED); + + // Try to find a good estimate for the number of output faces + // per mesh. Add 12.5% as buffer + unsigned int size_estimated = in_mesh->mNumFaces / sub_meshes; + size_estimated += size_estimated / 8; + + // now generate all submeshes + unsigned int base = 0; + while (true) { + const unsigned int out_vertex_index = LIMIT; + + aiMesh* out_mesh = new aiMesh(); + out_mesh->mNumVertices = 0; + out_mesh->mMaterialIndex = in_mesh->mMaterialIndex; + + // the name carries the adjacency information between the meshes + out_mesh->mName = in_mesh->mName; + + typedef std::vector BoneWeightList; + if (in_mesh->HasBones()) { + out_mesh->mBones = new aiBone*[in_mesh->mNumBones](); + } + + // clear the temporary helper array + if (base) { + std::fill(was_copied_to.begin(), was_copied_to.end(), WAS_NOT_COPIED); + } + + std::vector vFaces; + + // reserve enough storage for most cases + if (in_mesh->HasPositions()) { + out_mesh->mVertices = new aiVector3D[out_vertex_index]; + } + + if (in_mesh->HasNormals()) { + out_mesh->mNormals = new aiVector3D[out_vertex_index]; + } + + if (in_mesh->HasTangentsAndBitangents()) { + out_mesh->mTangents = new aiVector3D[out_vertex_index]; + out_mesh->mBitangents = new aiVector3D[out_vertex_index]; + } + + for (unsigned int c = 0; in_mesh->HasVertexColors(c);++c) { + out_mesh->mColors[c] = new aiColor4D[out_vertex_index]; + } + + for (unsigned int c = 0; in_mesh->HasTextureCoords(c);++c) { + out_mesh->mNumUVComponents[c] = in_mesh->mNumUVComponents[c]; + out_mesh->mTextureCoords[c] = new aiVector3D[out_vertex_index]; + } + vFaces.reserve(size_estimated); + + // (we will also need to copy the array of indices) + while (base < in_mesh->mNumFaces) { + const unsigned int iNumIndices = in_mesh->mFaces[base].mNumIndices; + + // doesn't catch degenerates but is quite fast + unsigned int iNeed = 0; + for (unsigned int v = 0; v < iNumIndices;++v) { + unsigned int index = in_mesh->mFaces[base].mIndices[v]; + + // check whether we do already have this vertex + if (WAS_NOT_COPIED == was_copied_to[index]) { + iNeed++; + } + } + if (out_mesh->mNumVertices + iNeed > out_vertex_index) { + // don't use this face + break; + } + + vFaces.push_back(aiFace()); + aiFace& rFace = vFaces.back(); + + // setup face type and number of indices + rFace.mNumIndices = iNumIndices; + rFace.mIndices = new unsigned int[iNumIndices]; + + // need to update the output primitive types + switch (rFace.mNumIndices) + { + case 1: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_POINT; + break; + case 2: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; + break; + case 3: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; + break; + default: + out_mesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; + } + + // and copy the contents of the old array, offset them by current base + for (unsigned int v = 0; v < iNumIndices;++v) { + const unsigned int index = in_mesh->mFaces[base].mIndices[v]; + + // check whether we do already have this vertex + if (WAS_NOT_COPIED != was_copied_to[index]) { + rFace.mIndices[v] = was_copied_to[index]; + continue; + } + + // copy positions + out_mesh->mVertices[out_mesh->mNumVertices] = (in_mesh->mVertices[index]); + + // copy normals + if (in_mesh->HasNormals()) { + out_mesh->mNormals[out_mesh->mNumVertices] = (in_mesh->mNormals[index]); + } + + // copy tangents/bi-tangents + if (in_mesh->HasTangentsAndBitangents()) { + out_mesh->mTangents[out_mesh->mNumVertices] = (in_mesh->mTangents[index]); + out_mesh->mBitangents[out_mesh->mNumVertices] = (in_mesh->mBitangents[index]); + } + + // texture coordinates + for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_TEXTURECOORDS;++c) { + if (in_mesh->HasTextureCoords( c)) { + out_mesh->mTextureCoords[c][out_mesh->mNumVertices] = in_mesh->mTextureCoords[c][index]; + } + } + // vertex colors + for (unsigned int c = 0; c < AI_MAX_NUMBER_OF_COLOR_SETS;++c) { + if (in_mesh->HasVertexColors( c)) { + out_mesh->mColors[c][out_mesh->mNumVertices] = in_mesh->mColors[c][index]; + } + } + // check whether we have bone weights assigned to this vertex + rFace.mIndices[v] = out_mesh->mNumVertices; + if (avPerVertexWeights) { + VertexWeightTable& table = avPerVertexWeights[ out_mesh->mNumVertices ]; + for (VertexWeightTable::const_iterator iter = table.begin(), end = table.end(); iter != end;++iter) { + // allocate the bone weight array if necessary and store it in the mBones field (HACK!) + BoneWeightList* weight_list = reinterpret_cast(out_mesh->mBones[(*iter).first]); + if (!weight_list) { + weight_list = new BoneWeightList(); + out_mesh->mBones[(*iter).first] = reinterpret_cast(weight_list); + } + weight_list->push_back(aiVertexWeight(out_mesh->mNumVertices,(*iter).second)); + } + } + + was_copied_to[index] = out_mesh->mNumVertices; + out_mesh->mNumVertices++; + } + base++; + if(out_mesh->mNumVertices == out_vertex_index) { + // break here. The face is only added if it was complete + break; + } + } + + // check which bones we'll need to create for this submesh + if (in_mesh->HasBones()) { + aiBone** ppCurrent = out_mesh->mBones; + for (unsigned int k = 0; k < in_mesh->mNumBones;++k) { + // check whether the bone exists + BoneWeightList* const weight_list = reinterpret_cast(out_mesh->mBones[k]); + + if (weight_list) { + const aiBone* const bone_in = in_mesh->mBones[k]; + aiBone* const bone_out = new aiBone(); + *ppCurrent++ = bone_out; + bone_out->mName = aiString(bone_in->mName); + bone_out->mOffsetMatrix =bone_in->mOffsetMatrix; + bone_out->mNumWeights = (unsigned int)weight_list->size(); + bone_out->mWeights = new aiVertexWeight[bone_out->mNumWeights]; + + // copy the vertex weights + ::memcpy(bone_out->mWeights, &(*weight_list)[0],bone_out->mNumWeights * sizeof(aiVertexWeight)); + + delete weight_list; + out_mesh->mNumBones++; + } + } + } + + // copy the face list to the mesh + out_mesh->mFaces = new aiFace[vFaces.size()]; + out_mesh->mNumFaces = (unsigned int)vFaces.size(); + + for (unsigned int p = 0; p < out_mesh->mNumFaces;++p) { + out_mesh->mFaces[p] = vFaces[p]; + } + + // add the newly created mesh to the list + source_mesh_map.push_back(std::make_pair(out_mesh,a)); + + if (base == in_mesh->mNumFaces) { + break; + } + } + + // delete the per-vertex weight list again + delete[] avPerVertexWeights; + + // now delete the old mesh data + delete in_mesh; +} diff --git a/Engine/lib/assimp/code/Assjson/mesh_splitter.h b/Engine/lib/assimp/code/Assjson/mesh_splitter.h new file mode 100644 index 000000000..326f73b41 --- /dev/null +++ b/Engine/lib/assimp/code/Assjson/mesh_splitter.h @@ -0,0 +1,61 @@ +/* +Assimp2Json +Copyright (c) 2011, Alexander C. Gessler + +Licensed under a 3-clause BSD license. See the LICENSE file for more information. + +*/ + +#ifndef INCLUDED_MESH_SPLITTER +#define INCLUDED_MESH_SPLITTER + +// ---------------------------------------------------------------------------- +// Note: this is largely based on assimp's SplitLargeMeshes_Vertex process. +// it is refactored and the coding style is slightly improved, though. +// ---------------------------------------------------------------------------- + +#include + +struct aiScene; +struct aiMesh; +struct aiNode; + +// --------------------------------------------------------------------------- +/** Splits meshes of unique vertices into meshes with no more vertices than + * a given, configurable threshold value. + */ +class MeshSplitter +{ + +public: + + void SetLimit(unsigned int l) { + LIMIT = l; + } + + unsigned int GetLimit() const { + return LIMIT; + } + +public: + + // ------------------------------------------------------------------- + /** Executes the post processing step on the given imported data. + * At the moment a process is not supposed to fail. + * @param pScene The imported data to work at. + */ + void Execute( aiScene* pScene); + + +private: + + void UpdateNode(aiNode* pcNode, const std::vector >& source_mesh_map); + void SplitMesh (unsigned int index, aiMesh* mesh, std::vector >& source_mesh_map); + +public: + + unsigned int LIMIT; +}; + +#endif // INCLUDED_MESH_SPLITTER + diff --git a/Engine/lib/assimp/code/AssxmlExporter.cpp b/Engine/lib/assimp/code/Assxml/AssxmlExporter.cpp similarity index 99% rename from Engine/lib/assimp/code/AssxmlExporter.cpp rename to Engine/lib/assimp/code/Assxml/AssxmlExporter.cpp index fc9a6bae5..afdecbaf6 100644 --- a/Engine/lib/assimp/code/AssxmlExporter.cpp +++ b/Engine/lib/assimp/code/Assxml/AssxmlExporter.cpp @@ -46,13 +46,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_EXPORT #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER -#include +#include "PostProcessing/ProcessHelper.h" + #include -#include "ProcessHelper.h" #include #include #include +#include + #ifdef ASSIMP_BUILD_NO_OWN_ZLIB # include #else @@ -555,8 +557,6 @@ void WriteDump(const aiScene* scene, IOStream* io, bool shortened) { mesh->mNormals[n].z); } } - else { - } ioprintf(io,"\t\t\n"); } diff --git a/Engine/lib/assimp/code/AssxmlExporter.h b/Engine/lib/assimp/code/Assxml/AssxmlExporter.h similarity index 100% rename from Engine/lib/assimp/code/AssxmlExporter.h rename to Engine/lib/assimp/code/Assxml/AssxmlExporter.h diff --git a/Engine/lib/assimp/code/B3DImporter.cpp b/Engine/lib/assimp/code/B3D/B3DImporter.cpp similarity index 99% rename from Engine/lib/assimp/code/B3DImporter.cpp rename to Engine/lib/assimp/code/B3D/B3DImporter.cpp index e48646de9..ba484ca00 100644 --- a/Engine/lib/assimp/code/B3DImporter.cpp +++ b/Engine/lib/assimp/code/B3D/B3DImporter.cpp @@ -49,17 +49,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_B3D_IMPORTER // internal headers -#include "B3DImporter.h" -#include "TextureTransform.h" -#include "ConvertToLHProcess.h" +#include "B3D/B3DImporter.h" +#include "PostProcessing/TextureTransform.h" +#include "PostProcessing/ConvertToLHProcess.h" + #include -#include #include #include #include #include #include +#include + using namespace Assimp; using namespace std; diff --git a/Engine/lib/assimp/code/B3DImporter.h b/Engine/lib/assimp/code/B3D/B3DImporter.h similarity index 100% rename from Engine/lib/assimp/code/B3DImporter.h rename to Engine/lib/assimp/code/B3D/B3DImporter.h diff --git a/Engine/lib/assimp/code/BVHLoader.cpp b/Engine/lib/assimp/code/BVH/BVHLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/BVHLoader.cpp rename to Engine/lib/assimp/code/BVH/BVHLoader.cpp diff --git a/Engine/lib/assimp/code/BVHLoader.h b/Engine/lib/assimp/code/BVH/BVHLoader.h similarity index 100% rename from Engine/lib/assimp/code/BVHLoader.h rename to Engine/lib/assimp/code/BVH/BVHLoader.h diff --git a/Engine/lib/assimp/code/BaseImporter.h b/Engine/lib/assimp/code/BaseImporter.h deleted file mode 100644 index b424d2f83..000000000 --- a/Engine/lib/assimp/code/BaseImporter.h +++ /dev/null @@ -1,361 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Definition of the base class for all importer worker classes. */ -#ifndef INCLUDED_AI_BASEIMPORTER_H -#define INCLUDED_AI_BASEIMPORTER_H - -#include "Exceptional.h" - -#include -#include -#include -#include - -struct aiScene; -struct aiImporterDesc; - -namespace Assimp { - -class Importer; -class IOSystem; -class BaseProcess; -class SharedPostProcessInfo; -class IOStream; - -// utility to do char4 to uint32 in a portable manner -#define AI_MAKE_MAGIC(string) ((uint32_t)((string[0] << 24) + \ - (string[1] << 16) + (string[2] << 8) + string[3])) - - -// --------------------------------------------------------------------------- -/** FOR IMPORTER PLUGINS ONLY: The BaseImporter defines a common interface - * for all importer worker classes. - * - * The interface defines two functions: CanRead() is used to check if the - * importer can handle the format of the given file. If an implementation of - * this function returns true, the importer then calls ReadFile() which - * imports the given file. ReadFile is not overridable, it just calls - * InternReadFile() and catches any ImportErrorException that might occur. - */ -class ASSIMP_API BaseImporter -{ - friend class Importer; - -public: - - /** Constructor to be privately used by #Importer */ - BaseImporter(); - - /** Destructor, private as well */ - virtual ~BaseImporter(); - -public: - // ------------------------------------------------------------------- - /** Returns whether the class can handle the format of the given file. - * - * The implementation should be as quick as possible. A check for - * the file extension is enough. If no suitable loader is found with - * this strategy, CanRead() is called again, the 'checkSig' parameter - * set to true this time. Now the implementation is expected to - * perform a full check of the file structure, possibly searching the - * first bytes of the file for magic identifiers or keywords. - * - * @param pFile Path and file name of the file to be examined. - * @param pIOHandler The IO handler to use for accessing any file. - * @param checkSig Set to true if this method is called a second time. - * This time, the implementation may take more time to examine the - * contents of the file to be loaded for magic bytes, keywords, etc - * to be able to load files with unknown/not existent file extensions. - * @return true if the class can read this file, false if not. - */ - virtual bool CanRead( - const std::string& pFile, - IOSystem* pIOHandler, - bool checkSig - ) const = 0; - - // ------------------------------------------------------------------- - /** Imports the given file and returns the imported data. - * If the import succeeds, ownership of the data is transferred to - * the caller. If the import fails, NULL is returned. The function - * takes care that any partially constructed data is destroyed - * beforehand. - * - * @param pImp #Importer object hosting this loader. - * @param pFile Path of the file to be imported. - * @param pIOHandler IO-Handler used to open this and possible other files. - * @return The imported data or NULL if failed. If it failed a - * human-readable error description can be retrieved by calling - * GetErrorText() - * - * @note This function is not intended to be overridden. Implement - * InternReadFile() to do the import. If an exception is thrown somewhere - * in InternReadFile(), this function will catch it and transform it into - * a suitable response to the caller. - */ - aiScene* ReadFile( - const Importer* pImp, - const std::string& pFile, - IOSystem* pIOHandler - ); - - // ------------------------------------------------------------------- - /** Returns the error description of the last error that occurred. - * @return A description of the last error that occurred. An empty - * string if there was no error. - */ - const std::string& GetErrorText() const { - return m_ErrorText; - } - - // ------------------------------------------------------------------- - /** Called prior to ReadFile(). - * The function is a request to the importer to update its configuration - * basing on the Importer's configuration property list. - * @param pImp Importer instance - */ - virtual void SetupProperties( - const Importer* pImp - ); - - // ------------------------------------------------------------------- - /** Called by #Importer::GetImporterInfo to get a description of - * some loader features. Importers must provide this information. */ - virtual const aiImporterDesc* GetInfo() const = 0; - - // ------------------------------------------------------------------- - /** Called by #Importer::GetExtensionList for each loaded importer. - * Take the extension list contained in the structure returned by - * #GetInfo and insert all file extensions into the given set. - * @param extension set to collect file extensions in*/ - void GetExtensionList(std::set& extensions); - -protected: - - // ------------------------------------------------------------------- - /** Imports the given file into the given scene structure. The - * function is expected to throw an ImportErrorException if there is - * an error. If it terminates normally, the data in aiScene is - * expected to be correct. Override this function to implement the - * actual importing. - *
- * The output scene must meet the following requirements:
- *
    - *
  • At least a root node must be there, even if its only purpose - * is to reference one mesh.
  • - *
  • aiMesh::mPrimitiveTypes may be 0. The types of primitives - * in the mesh are determined automatically in this case.
  • - *
  • the vertex data is stored in a pseudo-indexed "verbose" format. - * In fact this means that every vertex that is referenced by - * a face is unique. Or the other way round: a vertex index may - * not occur twice in a single aiMesh.
  • - *
  • aiAnimation::mDuration may be -1. Assimp determines the length - * of the animation automatically in this case as the length of - * the longest animation channel.
  • - *
  • aiMesh::mBitangents may be NULL if tangents and normals are - * given. In this case bitangents are computed as the cross product - * between normal and tangent.
  • - *
  • There needn't be a material. If none is there a default material - * is generated. However, it is recommended practice for loaders - * to generate a default material for yourself that matches the - * default material setting for the file format better than Assimp's - * generic default material. Note that default materials *should* - * be named AI_DEFAULT_MATERIAL_NAME if they're just color-shaded - * or AI_DEFAULT_TEXTURED_MATERIAL_NAME if they define a (dummy) - * texture.
  • - *
- * If the AI_SCENE_FLAGS_INCOMPLETE-Flag is not set:
    - *
  • at least one mesh must be there
  • - *
  • there may be no meshes with 0 vertices or faces
  • - *
- * This won't be checked (except by the validation step): Assimp will - * crash if one of the conditions is not met! - * - * @param pFile Path of the file to be imported. - * @param pScene The scene object to hold the imported data. - * NULL is not a valid parameter. - * @param pIOHandler The IO handler to use for any file access. - * NULL is not a valid parameter. */ - virtual void InternReadFile( - const std::string& pFile, - aiScene* pScene, - IOSystem* pIOHandler - ) = 0; - -public: // static utilities - - // ------------------------------------------------------------------- - /** A utility for CanRead(). - * - * The function searches the header of a file for a specific token - * and returns true if this token is found. This works for text - * files only. There is a rudimentary handling of UNICODE files. - * The comparison is case independent. - * - * @param pIOSystem IO System to work with - * @param file File name of the file - * @param tokens List of tokens to search for - * @param numTokens Size of the token array - * @param searchBytes Number of bytes to be searched for the tokens. - */ - static bool SearchFileHeaderForToken( - IOSystem* pIOSystem, - const std::string& file, - const char** tokens, - unsigned int numTokens, - unsigned int searchBytes = 200, - bool tokensSol = false); - - // ------------------------------------------------------------------- - /** @brief Check whether a file has a specific file extension - * @param pFile Input file - * @param ext0 Extension to check for. Lowercase characters only, no dot! - * @param ext1 Optional second extension - * @param ext2 Optional third extension - * @note Case-insensitive - */ - static bool SimpleExtensionCheck ( - const std::string& pFile, - const char* ext0, - const char* ext1 = NULL, - const char* ext2 = NULL); - - // ------------------------------------------------------------------- - /** @brief Extract file extension from a string - * @param pFile Input file - * @return Extension without trailing dot, all lowercase - */ - static std::string GetExtension ( - const std::string& pFile); - - // ------------------------------------------------------------------- - /** @brief Check whether a file starts with one or more magic tokens - * @param pFile Input file - * @param pIOHandler IO system to be used - * @param magic n magic tokens - * @params num Size of magic - * @param offset Offset from file start where tokens are located - * @param Size of one token, in bytes. Maximally 16 bytes. - * @return true if one of the given tokens was found - * - * @note For convenience, the check is also performed for the - * byte-swapped variant of all tokens (big endian). Only for - * tokens of size 2,4. - */ - static bool CheckMagicToken( - IOSystem* pIOHandler, - const std::string& pFile, - const void* magic, - unsigned int num, - unsigned int offset = 0, - unsigned int size = 4); - - // ------------------------------------------------------------------- - /** An utility for all text file loaders. It converts a file to our - * UTF8 character set. Errors are reported, but ignored. - * - * @param data File buffer to be converted to UTF8 data. The buffer - * is resized as appropriate. */ - static void ConvertToUTF8( - std::vector& data); - - // ------------------------------------------------------------------- - /** An utility for all text file loaders. It converts a file from our - * UTF8 character set back to ISO-8859-1. Errors are reported, but ignored. - * - * @param data File buffer to be converted from UTF8 to ISO-8859-1. The buffer - * is resized as appropriate. */ - static void ConvertUTF8toISO8859_1( - std::string& data); - - // ------------------------------------------------------------------- - /// @brief Enum to define, if empty files are ok or not. - enum TextFileMode { - ALLOW_EMPTY, - FORBID_EMPTY - }; - - // ------------------------------------------------------------------- - /** Utility for text file loaders which copies the contents of the - * file into a memory buffer and converts it to our UTF8 - * representation. - * @param stream Stream to read from. - * @param data Output buffer to be resized and filled with the - * converted text file data. The buffer is terminated with - * a binary 0. - * @param mode Whether it is OK to load empty text files. */ - static void TextFileToBuffer( - IOStream* stream, - std::vector& data, - TextFileMode mode = FORBID_EMPTY); - - // ------------------------------------------------------------------- - /** Utility function to move a std::vector into a aiScene array - * @param vec The vector to be moved - * @param out The output pointer to the allocated array. - * @param numOut The output count of elements copied. */ - template - AI_FORCE_INLINE - static void CopyVector( - std::vector& vec, - T*& out, - unsigned int& outLength) - { - outLength = unsigned(vec.size()); - if (outLength) { - out = new T[outLength]; - std::swap_ranges(vec.begin(), vec.end(), out); - } - } - -protected: - /// Error description in case there was one. - std::string m_ErrorText; - /// Currently set progress handler. - ProgressHandler* m_progress; -}; - - - -} // end of namespace Assimp - -#endif // AI_BASEIMPORTER_H_INC diff --git a/Engine/lib/assimp/code/Bitmap.h b/Engine/lib/assimp/code/Bitmap.h deleted file mode 100644 index 96c994dbe..000000000 --- a/Engine/lib/assimp/code/Bitmap.h +++ /dev/null @@ -1,123 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -/** @file Bitmap.h - * @brief Defines bitmap format helper for textures - * - * Used for file formats which embed their textures into the model file. - */ - -#ifndef AI_BITMAP_H_INC -#define AI_BITMAP_H_INC - -#include -#include - -struct aiTexture; - -namespace Assimp { - -class IOStream; - -class Bitmap { -protected: - - struct Header { - uint16_t type; - uint32_t size; - uint16_t reserved1; - uint16_t reserved2; - uint32_t offset; - - // We define the struct size because sizeof(Header) might return a wrong result because of structure padding. - // Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). - static const std::size_t header_size = - sizeof(uint16_t) + // type - sizeof(uint32_t) + // size - sizeof(uint16_t) + // reserved1 - sizeof(uint16_t) + // reserved2 - sizeof(uint32_t); // offset - }; - - struct DIB { - uint32_t size; - int32_t width; - int32_t height; - uint16_t planes; - uint16_t bits_per_pixel; - uint32_t compression; - uint32_t image_size; - int32_t x_resolution; - int32_t y_resolution; - uint32_t nb_colors; - uint32_t nb_important_colors; - - // We define the struct size because sizeof(DIB) might return a wrong result because of structure padding. - // Moreover, we must use this ugly and error prone syntax because Visual Studio neither support constexpr or sizeof(name_of_field). - static const std::size_t dib_size = - sizeof(uint32_t) + // size - sizeof(int32_t) + // width - sizeof(int32_t) + // height - sizeof(uint16_t) + // planes - sizeof(uint16_t) + // bits_per_pixel - sizeof(uint32_t) + // compression - sizeof(uint32_t) + // image_size - sizeof(int32_t) + // x_resolution - sizeof(int32_t) + // y_resolution - sizeof(uint32_t) + // nb_colors - sizeof(uint32_t); // nb_important_colors - }; - - static const std::size_t mBytesPerPixel = 4; - -public: - static void Save(aiTexture* texture, IOStream* file); - -protected: - static void WriteHeader(Header& header, IOStream* file); - static void WriteDIB(DIB& dib, IOStream* file); - static void WriteData(aiTexture* texture, IOStream* file); -}; - -} - -#endif // AI_BITMAP_H_INC diff --git a/Engine/lib/assimp/code/BlenderBMesh.cpp b/Engine/lib/assimp/code/Blender/BlenderBMesh.cpp similarity index 100% rename from Engine/lib/assimp/code/BlenderBMesh.cpp rename to Engine/lib/assimp/code/Blender/BlenderBMesh.cpp diff --git a/Engine/lib/assimp/code/BlenderBMesh.h b/Engine/lib/assimp/code/Blender/BlenderBMesh.h similarity index 100% rename from Engine/lib/assimp/code/BlenderBMesh.h rename to Engine/lib/assimp/code/Blender/BlenderBMesh.h diff --git a/Engine/lib/assimp/code/BlenderCustomData.cpp b/Engine/lib/assimp/code/Blender/BlenderCustomData.cpp similarity index 100% rename from Engine/lib/assimp/code/BlenderCustomData.cpp rename to Engine/lib/assimp/code/Blender/BlenderCustomData.cpp diff --git a/Engine/lib/assimp/code/BlenderCustomData.h b/Engine/lib/assimp/code/Blender/BlenderCustomData.h similarity index 100% rename from Engine/lib/assimp/code/BlenderCustomData.h rename to Engine/lib/assimp/code/Blender/BlenderCustomData.h diff --git a/Engine/lib/assimp/code/BlenderDNA.cpp b/Engine/lib/assimp/code/Blender/BlenderDNA.cpp similarity index 100% rename from Engine/lib/assimp/code/BlenderDNA.cpp rename to Engine/lib/assimp/code/Blender/BlenderDNA.cpp diff --git a/Engine/lib/assimp/code/BlenderDNA.h b/Engine/lib/assimp/code/Blender/BlenderDNA.h similarity index 99% rename from Engine/lib/assimp/code/BlenderDNA.h rename to Engine/lib/assimp/code/Blender/BlenderDNA.h index 5d3a4f6ea..375d0c4bf 100644 --- a/Engine/lib/assimp/code/BlenderDNA.h +++ b/Engine/lib/assimp/code/Blender/BlenderDNA.h @@ -416,7 +416,7 @@ template <> struct Structure :: _defaultInitializer { void operator ()(T& /*out*/,const char* = "") { // obviously, it is crucial that _DefaultInitializer is used // only from within a catch clause. - throw; + throw DeadlyImportError("Constructing BlenderDNA Structure encountered an error"); } }; diff --git a/Engine/lib/assimp/code/BlenderDNA.inl b/Engine/lib/assimp/code/Blender/BlenderDNA.inl similarity index 100% rename from Engine/lib/assimp/code/BlenderDNA.inl rename to Engine/lib/assimp/code/Blender/BlenderDNA.inl diff --git a/Engine/lib/assimp/code/BlenderIntermediate.h b/Engine/lib/assimp/code/Blender/BlenderIntermediate.h similarity index 100% rename from Engine/lib/assimp/code/BlenderIntermediate.h rename to Engine/lib/assimp/code/Blender/BlenderIntermediate.h diff --git a/Engine/lib/assimp/code/BlenderLoader.cpp b/Engine/lib/assimp/code/Blender/BlenderLoader.cpp similarity index 97% rename from Engine/lib/assimp/code/BlenderLoader.cpp rename to Engine/lib/assimp/code/Blender/BlenderLoader.cpp index 90065ceee..d39cb9699 100644 --- a/Engine/lib/assimp/code/BlenderLoader.cpp +++ b/Engine/lib/assimp/code/Blender/BlenderLoader.cpp @@ -1225,6 +1225,16 @@ aiLight* BlenderImporter::ConvertLight(const Scene& /*in*/, const Object* obj, c case Lamp::Type_Local: out->mType = aiLightSource_POINT; break; + case Lamp::Type_Spot: + out->mType = aiLightSource_SPOT; + + // blender orients directional lights as facing toward -z + out->mDirection = aiVector3D(0.f, 0.f, -1.f); + out->mUp = aiVector3D(0.f, 1.f, 0.f); + + out->mAngleInnerCone = lamp->spotsize * (1.0f - lamp->spotblend); + out->mAngleOuterCone = lamp->spotsize; + break; case Lamp::Type_Sun: out->mType = aiLightSource_DIRECTIONAL; @@ -1255,6 +1265,23 @@ aiLight* BlenderImporter::ConvertLight(const Scene& /*in*/, const Object* obj, c out->mColorAmbient = aiColor3D(lamp->r, lamp->g, lamp->b) * lamp->energy; out->mColorSpecular = aiColor3D(lamp->r, lamp->g, lamp->b) * lamp->energy; out->mColorDiffuse = aiColor3D(lamp->r, lamp->g, lamp->b) * lamp->energy; + + // If default values are supplied, compute the coefficients from light's max distance + // Read this: https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/ + // + if (lamp->constant_coefficient == 1.0f && lamp->linear_coefficient == 0.0f && lamp->quadratic_coefficient == 0.0f && lamp->dist > 0.0f) + { + out->mAttenuationConstant = 1.0f; + out->mAttenuationLinear = 2.0f / lamp->dist; + out->mAttenuationQuadratic = 1.0f / (lamp->dist * lamp->dist); + } + else + { + out->mAttenuationConstant = lamp->constant_coefficient; + out->mAttenuationLinear = lamp->linear_coefficient; + out->mAttenuationQuadratic = lamp->quadratic_coefficient; + } + return out.release(); } diff --git a/Engine/lib/assimp/code/BlenderLoader.h b/Engine/lib/assimp/code/Blender/BlenderLoader.h similarity index 100% rename from Engine/lib/assimp/code/BlenderLoader.h rename to Engine/lib/assimp/code/Blender/BlenderLoader.h diff --git a/Engine/lib/assimp/code/BlenderModifier.cpp b/Engine/lib/assimp/code/Blender/BlenderModifier.cpp similarity index 100% rename from Engine/lib/assimp/code/BlenderModifier.cpp rename to Engine/lib/assimp/code/Blender/BlenderModifier.cpp diff --git a/Engine/lib/assimp/code/BlenderModifier.h b/Engine/lib/assimp/code/Blender/BlenderModifier.h similarity index 100% rename from Engine/lib/assimp/code/BlenderModifier.h rename to Engine/lib/assimp/code/Blender/BlenderModifier.h diff --git a/Engine/lib/assimp/code/BlenderScene.cpp b/Engine/lib/assimp/code/Blender/BlenderScene.cpp similarity index 99% rename from Engine/lib/assimp/code/BlenderScene.cpp rename to Engine/lib/assimp/code/Blender/BlenderScene.cpp index 4fc353b15..39c2793d5 100644 --- a/Engine/lib/assimp/code/BlenderScene.cpp +++ b/Engine/lib/assimp/code/Blender/BlenderScene.cpp @@ -211,9 +211,12 @@ template <> void Structure :: Convert ( ReadField(dest.b,"b",db); ReadField(dest.k,"k",db); ReadField(dest.energy,"energy",db); - ReadField(dest.dist,"dist",db); + ReadField(dest.dist,"dist",db); ReadField(dest.spotsize,"spotsize",db); ReadField(dest.spotblend,"spotblend",db); + ReadField(dest.constant_coefficient, "coeff_const", db); + ReadField(dest.linear_coefficient, "coeff_lin", db); + ReadField(dest.quadratic_coefficient, "coeff_quad", db); ReadField(dest.att1,"att1",db); ReadField(dest.att2,"att2",db); ReadField(temp,"falloff_type",db); diff --git a/Engine/lib/assimp/code/BlenderScene.h b/Engine/lib/assimp/code/Blender/BlenderScene.h similarity index 99% rename from Engine/lib/assimp/code/BlenderScene.h rename to Engine/lib/assimp/code/Blender/BlenderScene.h index 8e4223eb1..dd3f1444c 100644 --- a/Engine/lib/assimp/code/BlenderScene.h +++ b/Engine/lib/assimp/code/Blender/BlenderScene.h @@ -538,6 +538,10 @@ struct Lamp : ElemBase { float energy, dist, spotsize, spotblend; //float haint; + float constant_coefficient; + float linear_coefficient; + float quadratic_coefficient; + float att1, att2; //struct CurveMapping *curfalloff; FalloffType falloff_type; diff --git a/Engine/lib/assimp/code/BlenderSceneGen.h b/Engine/lib/assimp/code/Blender/BlenderSceneGen.h similarity index 100% rename from Engine/lib/assimp/code/BlenderSceneGen.h rename to Engine/lib/assimp/code/Blender/BlenderSceneGen.h diff --git a/Engine/lib/assimp/code/BlenderTessellator.cpp b/Engine/lib/assimp/code/Blender/BlenderTessellator.cpp similarity index 100% rename from Engine/lib/assimp/code/BlenderTessellator.cpp rename to Engine/lib/assimp/code/Blender/BlenderTessellator.cpp diff --git a/Engine/lib/assimp/code/BlenderTessellator.h b/Engine/lib/assimp/code/Blender/BlenderTessellator.h similarity index 98% rename from Engine/lib/assimp/code/BlenderTessellator.h rename to Engine/lib/assimp/code/Blender/BlenderTessellator.h index 8675b4e57..518e56c72 100644 --- a/Engine/lib/assimp/code/BlenderTessellator.h +++ b/Engine/lib/assimp/code/Blender/BlenderTessellator.h @@ -144,7 +144,11 @@ namespace Assimp #if ASSIMP_BLEND_WITH_POLY_2_TRI -#include "../contrib/poly2tri/poly2tri/poly2tri.h" +#ifdef ASSIMP_USE_HUNTER +# include +#else +# include "../contrib/poly2tri/poly2tri/poly2tri.h" +#endif namespace Assimp { diff --git a/Engine/lib/assimp/code/BlobIOSystem.h b/Engine/lib/assimp/code/BlobIOSystem.h deleted file mode 100644 index f406ea0fe..000000000 --- a/Engine/lib/assimp/code/BlobIOSystem.h +++ /dev/null @@ -1,337 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -/** @file Provides cheat implementations for IOSystem and IOStream to - * redirect exporter output to a blob chain.*/ - -#ifndef AI_BLOBIOSYSTEM_H_INCLUDED -#define AI_BLOBIOSYSTEM_H_INCLUDED - -#include -#include -#include -#include -#include -#include -#include - -namespace Assimp { - class BlobIOSystem; - -// -------------------------------------------------------------------------------------------- -/** Redirect IOStream to a blob */ -// -------------------------------------------------------------------------------------------- -class BlobIOStream : public IOStream -{ -public: - - BlobIOStream(BlobIOSystem* creator, const std::string& file, size_t initial = 4096) - : buffer() - , cur_size() - , file_size() - , cursor() - , initial(initial) - , file(file) - , creator(creator) - { - } - - - virtual ~BlobIOStream(); - -public: - - // ------------------------------------------------------------------- - aiExportDataBlob* GetBlob() - { - aiExportDataBlob* blob = new aiExportDataBlob(); - blob->size = file_size; - blob->data = buffer; - - buffer = NULL; - - return blob; - } - - -public: - - - // ------------------------------------------------------------------- - virtual size_t Read( void *, - size_t, - size_t ) - { - return 0; - } - - // ------------------------------------------------------------------- - virtual size_t Write(const void* pvBuffer, - size_t pSize, - size_t pCount) - { - pSize *= pCount; - if (cursor + pSize > cur_size) { - Grow(cursor + pSize); - } - - memcpy(buffer+cursor, pvBuffer, pSize); - cursor += pSize; - - file_size = std::max(file_size,cursor); - return pCount; - } - - // ------------------------------------------------------------------- - virtual aiReturn Seek(size_t pOffset, - aiOrigin pOrigin) - { - switch(pOrigin) - { - case aiOrigin_CUR: - cursor += pOffset; - break; - - case aiOrigin_END: - cursor = file_size - pOffset; - break; - - case aiOrigin_SET: - cursor = pOffset; - break; - - default: - return AI_FAILURE; - } - - if (cursor > file_size) { - Grow(cursor); - } - - file_size = std::max(cursor,file_size); - return AI_SUCCESS; - } - - // ------------------------------------------------------------------- - virtual size_t Tell() const - { - return cursor; - } - - // ------------------------------------------------------------------- - virtual size_t FileSize() const - { - return file_size; - } - - // ------------------------------------------------------------------- - virtual void Flush() - { - // ignore - } - - - -private: - - // ------------------------------------------------------------------- - void Grow(size_t need = 0) - { - // 1.5 and phi are very heap-friendly growth factors (the first - // allows for frequent re-use of heap blocks, the second - // forms a fibonacci sequence with similar characteristics - - // since this heavily depends on the heap implementation - // and other factors as well, i'll just go with 1.5 since - // it is quicker to compute). - size_t new_size = std::max(initial, std::max( need, cur_size+(cur_size>>1) )); - - const uint8_t* const old = buffer; - buffer = new uint8_t[new_size]; - - if (old) { - memcpy(buffer,old,cur_size); - delete[] old; - } - - cur_size = new_size; - } - -private: - - uint8_t* buffer; - size_t cur_size,file_size, cursor, initial; - - const std::string file; - BlobIOSystem* const creator; -}; - - -#define AI_BLOBIO_MAGIC "$blobfile" - -// -------------------------------------------------------------------------------------------- -/** Redirect IOSystem to a blob */ -// -------------------------------------------------------------------------------------------- -class BlobIOSystem : public IOSystem -{ - - friend class BlobIOStream; - typedef std::pair BlobEntry; - -public: - - BlobIOSystem() - { - } - - virtual ~BlobIOSystem() - { - for(BlobEntry& blobby : blobs) { - delete blobby.second; - } - } - -public: - - // ------------------------------------------------------------------- - const char* GetMagicFileName() const - { - return AI_BLOBIO_MAGIC; - } - - - // ------------------------------------------------------------------- - aiExportDataBlob* GetBlobChain() - { - // one must be the master - aiExportDataBlob* master = NULL, *cur; - for(const BlobEntry& blobby : blobs) { - if (blobby.first == AI_BLOBIO_MAGIC) { - master = blobby.second; - break; - } - } - if (!master) { - DefaultLogger::get()->error("BlobIOSystem: no data written or master file was not closed properly."); - return NULL; - } - - master->name.Set(""); - - cur = master; - for(const BlobEntry& blobby : blobs) { - if (blobby.second == master) { - continue; - } - - cur->next = blobby.second; - cur = cur->next; - - // extract the file extension from the file written - const std::string::size_type s = blobby.first.find_first_of('.'); - cur->name.Set(s == std::string::npos ? blobby.first : blobby.first.substr(s+1)); - } - - // give up blob ownership - blobs.clear(); - return master; - } - -public: - - // ------------------------------------------------------------------- - virtual bool Exists( const char* pFile) const { - return created.find(std::string(pFile)) != created.end(); - } - - - // ------------------------------------------------------------------- - virtual char getOsSeparator() const { - return '/'; - } - - - // ------------------------------------------------------------------- - virtual IOStream* Open(const char* pFile, - const char* pMode) - { - if (pMode[0] != 'w') { - return NULL; - } - - created.insert(std::string(pFile)); - return new BlobIOStream(this,std::string(pFile)); - } - - // ------------------------------------------------------------------- - virtual void Close( IOStream* pFile) - { - delete pFile; - } - -private: - - // ------------------------------------------------------------------- - void OnDestruct(const std::string& filename, BlobIOStream* child) - { - // we don't know in which the files are closed, so we - // can't reliably say that the first must be the master - // file ... - blobs.push_back( BlobEntry(filename,child->GetBlob()) ); - } - -private: - std::set created; - std::vector< BlobEntry > blobs; -}; - - -// -------------------------------------------------------------------------------------------- -BlobIOStream :: ~BlobIOStream() -{ - creator->OnDestruct(file,this); - delete[] buffer; -} - - -} // end Assimp - -#endif diff --git a/Engine/lib/assimp/code/ByteSwapper.h b/Engine/lib/assimp/code/ByteSwapper.h deleted file mode 100644 index e5c7569f1..000000000 --- a/Engine/lib/assimp/code/ByteSwapper.h +++ /dev/null @@ -1,287 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Helper class tp perform various byte oder swappings - (e.g. little to big endian) */ -#ifndef AI_BYTESWAPPER_H_INC -#define AI_BYTESWAPPER_H_INC - -#include -#include -#include - -#if _MSC_VER >= 1400 -#include -#endif - -namespace Assimp { -// -------------------------------------------------------------------------------------- -/** Defines some useful byte order swap routines. - * - * This is required to read big-endian model formats on little-endian machines, - * and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */ -// -------------------------------------------------------------------------------------- -class ByteSwap -{ - ByteSwap() {} - -public: - - // ---------------------------------------------------------------------- - /** Swap two bytes of data - * @param[inout] _szOut A void* to save the reintcasts for the caller. */ - static inline void Swap2(void* _szOut) - { - ai_assert(_szOut); - -#if _MSC_VER >= 1400 - uint16_t* const szOut = reinterpret_cast(_szOut); - *szOut = _byteswap_ushort(*szOut); -#else - uint8_t* const szOut = reinterpret_cast(_szOut); - std::swap(szOut[0],szOut[1]); -#endif - } - - // ---------------------------------------------------------------------- - /** Swap four bytes of data - * @param[inout] _szOut A void* to save the reintcasts for the caller. */ - static inline void Swap4(void* _szOut) - { - ai_assert(_szOut); - -#if _MSC_VER >= 1400 - uint32_t* const szOut = reinterpret_cast(_szOut); - *szOut = _byteswap_ulong(*szOut); -#else - uint8_t* const szOut = reinterpret_cast(_szOut); - std::swap(szOut[0],szOut[3]); - std::swap(szOut[1],szOut[2]); -#endif - } - - // ---------------------------------------------------------------------- - /** Swap eight bytes of data - * @param[inout] _szOut A void* to save the reintcasts for the caller. */ - static inline void Swap8(void* _szOut) - { - ai_assert(_szOut); - -#if _MSC_VER >= 1400 - uint64_t* const szOut = reinterpret_cast(_szOut); - *szOut = _byteswap_uint64(*szOut); -#else - uint8_t* const szOut = reinterpret_cast(_szOut); - std::swap(szOut[0],szOut[7]); - std::swap(szOut[1],szOut[6]); - std::swap(szOut[2],szOut[5]); - std::swap(szOut[3],szOut[4]); -#endif - } - - // ---------------------------------------------------------------------- - /** ByteSwap a float. Not a joke. - * @param[inout] fOut ehm. .. */ - static inline void Swap(float* fOut) { - Swap4(fOut); - } - - // ---------------------------------------------------------------------- - /** ByteSwap a double. Not a joke. - * @param[inout] fOut ehm. .. */ - static inline void Swap(double* fOut) { - Swap8(fOut); - } - - - // ---------------------------------------------------------------------- - /** ByteSwap an int16t. Not a joke. - * @param[inout] fOut ehm. .. */ - static inline void Swap(int16_t* fOut) { - Swap2(fOut); - } - - static inline void Swap(uint16_t* fOut) { - Swap2(fOut); - } - - // ---------------------------------------------------------------------- - /** ByteSwap an int32t. Not a joke. - * @param[inout] fOut ehm. .. */ - static inline void Swap(int32_t* fOut){ - Swap4(fOut); - } - - static inline void Swap(uint32_t* fOut){ - Swap4(fOut); - } - - // ---------------------------------------------------------------------- - /** ByteSwap an int64t. Not a joke. - * @param[inout] fOut ehm. .. */ - static inline void Swap(int64_t* fOut) { - Swap8(fOut); - } - - static inline void Swap(uint64_t* fOut) { - Swap8(fOut); - } - - // ---------------------------------------------------------------------- - //! Templatized ByteSwap - //! \returns param tOut as swapped - template - static inline Type Swapped(Type tOut) - { - return _swapper()(tOut); - } - -private: - - template struct _swapper; -}; - -template struct ByteSwap::_swapper { - T operator() (T tOut) { - Swap2(&tOut); - return tOut; - } -}; - -template struct ByteSwap::_swapper { - T operator() (T tOut) { - Swap4(&tOut); - return tOut; - } -}; - -template struct ByteSwap::_swapper { - T operator() (T tOut) { - Swap8(&tOut); - return tOut; - } -}; - - -// -------------------------------------------------------------------------------------- -// ByteSwap macros for BigEndian/LittleEndian support -// -------------------------------------------------------------------------------------- -#if (defined AI_BUILD_BIG_ENDIAN) -# define AI_LE(t) (t) -# define AI_BE(t) ByteSwap::Swapped(t) -# define AI_LSWAP2(p) -# define AI_LSWAP4(p) -# define AI_LSWAP8(p) -# define AI_LSWAP2P(p) -# define AI_LSWAP4P(p) -# define AI_LSWAP8P(p) -# define LE_NCONST const -# define AI_SWAP2(p) ByteSwap::Swap2(&(p)) -# define AI_SWAP4(p) ByteSwap::Swap4(&(p)) -# define AI_SWAP8(p) ByteSwap::Swap8(&(p)) -# define AI_SWAP2P(p) ByteSwap::Swap2((p)) -# define AI_SWAP4P(p) ByteSwap::Swap4((p)) -# define AI_SWAP8P(p) ByteSwap::Swap8((p)) -# define BE_NCONST -#else -# define AI_BE(t) (t) -# define AI_LE(t) ByteSwap::Swapped(t) -# define AI_SWAP2(p) -# define AI_SWAP4(p) -# define AI_SWAP8(p) -# define AI_SWAP2P(p) -# define AI_SWAP4P(p) -# define AI_SWAP8P(p) -# define BE_NCONST const -# define AI_LSWAP2(p) ByteSwap::Swap2(&(p)) -# define AI_LSWAP4(p) ByteSwap::Swap4(&(p)) -# define AI_LSWAP8(p) ByteSwap::Swap8(&(p)) -# define AI_LSWAP2P(p) ByteSwap::Swap2((p)) -# define AI_LSWAP4P(p) ByteSwap::Swap4((p)) -# define AI_LSWAP8P(p) ByteSwap::Swap8((p)) -# define LE_NCONST -#endif - - -namespace Intern { - -// -------------------------------------------------------------------------------------------- -template -struct ByteSwapper { - void operator() (T* inout) { - ByteSwap::Swap(inout); - } -}; - -template -struct ByteSwapper { - void operator() (T*) { - } -}; - -// -------------------------------------------------------------------------------------------- -template -struct Getter { - void operator() (T* inout, bool le) { -#ifdef AI_BUILD_BIG_ENDIAN - le = le; -#else - le = !le; -#endif - if (le) { - ByteSwapper1?true:false)> () (inout); - } - else ByteSwapper () (inout); - } -}; - -template -struct Getter { - - void operator() (T* inout, bool /*le*/) { - // static branch - ByteSwapper1)> () (inout); - } -}; -} // end Intern -} // end Assimp - -#endif //!! AI_BYTESWAPPER_H_INC diff --git a/Engine/lib/assimp/code/C4DImporter.cpp b/Engine/lib/assimp/code/C4D/C4DImporter.cpp similarity index 89% rename from Engine/lib/assimp/code/C4DImporter.cpp rename to Engine/lib/assimp/code/C4D/C4DImporter.cpp index 665d74633..6e5b7d39b 100644 --- a/Engine/lib/assimp/code/C4DImporter.cpp +++ b/Engine/lib/assimp/code/C4D/C4DImporter.cpp @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -68,8 +68,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace melange; // overload this function and fill in your own unique data -void GetWriterInfo(int &id, String &appname) -{ +void GetWriterInfo(int &id, String &appname) { id = 2424226; appname = "Open Asset Import Library"; } @@ -78,7 +77,10 @@ using namespace Assimp; using namespace Assimp::Formatter; namespace Assimp { - template<> const std::string LogFunctions::log_prefix = "C4D: "; + template<> const char* LogFunctions::Prefix() { + static auto prefix = "C4D: "; + return prefix; + } } static const aiImporterDesc desc = { @@ -97,47 +99,44 @@ static const aiImporterDesc desc = { // ------------------------------------------------------------------------------------------------ C4DImporter::C4DImporter() -{} +: BaseImporter() { + // empty +} // ------------------------------------------------------------------------------------------------ -C4DImporter::~C4DImporter() -{} +C4DImporter::~C4DImporter() { + // empty +} // ------------------------------------------------------------------------------------------------ -bool C4DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const -{ +bool C4DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const { const std::string& extension = GetExtension(pFile); if (extension == "c4d") { return true; - } - - else if ((!extension.length() || checkSig) && pIOHandler) { + } else if ((!extension.length() || checkSig) && pIOHandler) { // TODO } + return false; } // ------------------------------------------------------------------------------------------------ -const aiImporterDesc* C4DImporter::GetInfo () const -{ +const aiImporterDesc* C4DImporter::GetInfo () const { return &desc; } // ------------------------------------------------------------------------------------------------ -void C4DImporter::SetupProperties(const Importer* /*pImp*/) -{ +void C4DImporter::SetupProperties(const Importer* /*pImp*/) { // nothing to be done for the moment } // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void C4DImporter::InternReadFile( const std::string& pFile, - aiScene* pScene, IOSystem* pIOHandler) -{ +void C4DImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { std::unique_ptr file( pIOHandler->Open( pFile)); - if( file.get() == NULL) { + if( file.get() == nullptr ) { ThrowException("failed to open file " + pFile); } @@ -151,7 +150,7 @@ void C4DImporter::InternReadFile( const std::string& pFile, // open document first BaseDocument* doc = LoadDocument(f, SCENEFILTER_OBJECTS | SCENEFILTER_MATERIALS); - if(doc == NULL) { + if(doc == nullptr ) { ThrowException("failed to read document " + pFile); } @@ -160,11 +159,10 @@ void C4DImporter::InternReadFile( const std::string& pFile, // first convert all materials ReadMaterials(doc->GetFirstMaterial()); - // process C4D scenegraph recursively + // process C4D scene-graph recursively try { RecurseHierarchy(doc->GetFirstObject(), pScene->mRootNode); - } - catch(...) { + } catch(...) { for(aiMesh* mesh : meshes) { delete mesh; } @@ -201,8 +199,7 @@ void C4DImporter::InternReadFile( const std::string& pFile, // ------------------------------------------------------------------------------------------------ -bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader) -{ +bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader) { // based on Melange sample code (C4DImportExport.cpp) while(shader) { if(shader->GetType() == Xlayer) { @@ -220,15 +217,12 @@ bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader) // Ignore the actual layer blending - models for real-time rendering should not // use them in a non-trivial way. Just try to find textures that we can apply // to the model. - while (lsl) - { - if (lsl->GetType() == TypeFolder) - { + while (lsl) { + if (lsl->GetType() == TypeFolder) { BlendFolder* const folder = dynamic_cast(lsl); LayerShaderLayer *subLsl = dynamic_cast(folder->m_Children.GetObject(0)); - while (subLsl) - { + while (subLsl) { if (subLsl->GetType() == TypeShader) { BlendShader* const shader = dynamic_cast(subLsl); if(ReadShader(out, static_cast(shader->m_pLink->GetLink()))) { @@ -238,8 +232,7 @@ bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader) subLsl = subLsl->GetNext(); } - } - else if (lsl->GetType() == TypeShader) { + } else if (lsl->GetType() == TypeShader) { BlendShader* const shader = dynamic_cast(lsl); if(ReadShader(out, static_cast(shader->m_pLink->GetLink()))) { return true; @@ -248,33 +241,27 @@ bool C4DImporter::ReadShader(aiMaterial* out, melange::BaseShader* shader) lsl = lsl->GetNext(); } - } - else if ( shader->GetType() == Xbitmap ) - { + } else if ( shader->GetType() == Xbitmap ) { aiString path; shader->GetFileName().GetString().GetCString(path.data, MAXLEN-1); path.length = ::strlen(path.data); out->AddProperty(&path, AI_MATKEY_TEXTURE_DIFFUSE(0)); return true; - } - else { + } else { LogWarn("ignoring shader type: " + std::string(GetObjectTypeName(shader->GetType()))); } shader = shader->GetNext(); } + return false; } - // ------------------------------------------------------------------------------------------------ -void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) -{ +void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) { // based on Melange sample code - while (mat) - { + while (mat) { const String& name = mat->GetName(); - if (mat->GetType() == Mmaterial) - { + if (mat->GetType() == Mmaterial) { aiMaterial* out = new aiMaterial(); material_mapping[mat] = static_cast(materials.size()); materials.push_back(out); @@ -286,8 +273,7 @@ void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) Material& m = dynamic_cast(*mat); - if (m.GetChannelState(CHANNEL_COLOR)) - { + if (m.GetChannelState(CHANNEL_COLOR)) { GeData data; mat->GetParameter(MATERIAL_COLOR_COLOR, data); Vector color = data.GetVector(); @@ -307,9 +293,7 @@ void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) if(shader) { ReadShader(out, shader); } - } - else - { + } else { LogWarn("ignoring plugin material: " + std::string(GetObjectTypeName(mat->GetType()))); } mat = mat->GetNext(); @@ -317,14 +301,12 @@ void C4DImporter::ReadMaterials(melange::BaseMaterial* mat) } // ------------------------------------------------------------------------------------------------ -void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent) -{ - ai_assert(parent != NULL); +void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent) { + ai_assert(parent != nullptr ); std::vector nodes; // based on Melange sample code - while (object) - { + while (object) { const String& name = object->GetName(); const LONG type = object->GetType(); const Matrix& ml = object->GetMl(); @@ -356,26 +338,20 @@ void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent) nodes.push_back(nd); GeData data; - if (type == Ocamera) - { + if (type == Ocamera) { object->GetParameter(CAMERAOBJECT_FOV, data); // TODO: read camera - } - else if (type == Olight) - { + } else if (type == Olight) { // TODO: read light - } - else if (type == Opolygon) - { + } else if (type == Opolygon) { aiMesh* const mesh = ReadMesh(object); - if(mesh != NULL) { + if(mesh != nullptr) { nd->mNumMeshes = 1; nd->mMeshes = new unsigned int[1]; nd->mMeshes[0] = static_cast(meshes.size()); meshes.push_back(mesh); } - } - else { + } else { LogWarn("ignoring object: " + std::string(GetObjectTypeName(type))); } @@ -389,28 +365,27 @@ void C4DImporter::RecurseHierarchy(BaseObject* object, aiNode* parent) std::copy(nodes.begin(), nodes.end(), parent->mChildren); } - // ------------------------------------------------------------------------------------------------ -aiMesh* C4DImporter::ReadMesh(BaseObject* object) -{ - ai_assert(object != NULL && object->GetType() == Opolygon); +aiMesh* C4DImporter::ReadMesh(BaseObject* object) { + ai_assert(object != nullptr); + ai_assert( object->GetType() == Opolygon ); // based on Melange sample code PolygonObject* const polyObject = dynamic_cast(object); - ai_assert(polyObject != NULL); + ai_assert(polyObject != nullptr); const LONG pointCount = polyObject->GetPointCount(); const LONG polyCount = polyObject->GetPolygonCount(); if(!polyObject || !pointCount) { LogWarn("ignoring mesh with zero vertices or faces"); - return NULL; + return nullptr; } const Vector* points = polyObject->GetPointR(); - ai_assert(points != NULL); + ai_assert(points != nullptr); const CPolygon* polys = polyObject->GetPolygonR(); - ai_assert(polys != NULL); + ai_assert(polys != nullptr); std::unique_ptr mesh(new aiMesh()); mesh->mNumFaces = static_cast(polyCount); @@ -443,14 +418,14 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) // check if there are normals, tangents or UVW coordinates BaseTag* tag = object->GetTag(Tnormal); - NormalTag* normals_src = NULL; + NormalTag* normals_src = nullptr; if(tag) { normals_src = dynamic_cast(tag); normals = mesh->mNormals = new aiVector3D[mesh->mNumVertices](); } tag = object->GetTag(Ttangent); - TangentTag* tangents_src = NULL; + TangentTag* tangents_src = nullptr; if(tag) { tangents_src = dynamic_cast(tag); tangents = mesh->mTangents = new aiVector3D[mesh->mNumVertices](); @@ -458,15 +433,14 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) } tag = object->GetTag(Tuvw); - UVWTag* uvs_src = NULL; + UVWTag* uvs_src = nullptr; if(tag) { uvs_src = dynamic_cast(tag); uvs = mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices](); } // copy vertices and extra channels over and populate faces - for (LONG i = 0; i < polyCount; ++i, ++face) - { + for (LONG i = 0; i < polyCount; ++i, ++face) { ai_assert(polys[i].a < pointCount && polys[i].a >= 0); const Vector& pointA = points[polys[i].a]; verts->x = pointA.x; @@ -489,8 +463,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) ++verts; // TODO: do we also need to handle lines or points with similar checks? - if (polys[i].c != polys[i].d) - { + if (polys[i].c != polys[i].d) { ai_assert(polys[i].d < pointCount && polys[i].d >= 0); face->mNumIndices = 4; @@ -500,8 +473,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) verts->y = pointD.y; verts->z = pointD.z; ++verts; - } - else { + } else { face->mNumIndices = 3; } face->mIndices = new unsigned int[face->mNumIndices]; @@ -513,8 +485,7 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) if (normals_src) { if(i >= normals_src->GetDataCount()) { LogError("unexpected number of normals, ignoring"); - } - else { + } else { ConstNormalHandle normal_handle = normals_src->GetDataAddressR(); NormalStruct nor; NormalTag::Get(normal_handle, i, nor); @@ -616,26 +587,25 @@ aiMesh* C4DImporter::ReadMesh(BaseObject* object) } mesh->mMaterialIndex = ResolveMaterial(polyObject); + return mesh.release(); } - // ------------------------------------------------------------------------------------------------ -unsigned int C4DImporter::ResolveMaterial(PolygonObject* obj) -{ - ai_assert(obj != NULL); +unsigned int C4DImporter::ResolveMaterial(PolygonObject* obj) { + ai_assert(obj != nullptr); const unsigned int mat_count = static_cast(materials.size()); BaseTag* tag = obj->GetTag(Ttexture); - if(tag == NULL) { + if(tag == nullptr) { return mat_count; } TextureTag& ttag = dynamic_cast(*tag); BaseMaterial* const mat = ttag.GetMaterial(); - ai_assert(mat != NULL); + ai_assert(mat != nullptr); const MaterialMap::const_iterator it = material_mapping.find(mat); if(it == material_mapping.end()) { @@ -643,6 +613,7 @@ unsigned int C4DImporter::ResolveMaterial(PolygonObject* obj) } ai_assert((*it).second < mat_count); + return (*it).second; } diff --git a/Engine/lib/assimp/code/C4DImporter.h b/Engine/lib/assimp/code/C4D/C4DImporter.h similarity index 97% rename from Engine/lib/assimp/code/C4DImporter.h rename to Engine/lib/assimp/code/C4D/C4DImporter.h index 2f67d90f3..f3b1351f6 100644 --- a/Engine/lib/assimp/code/C4DImporter.h +++ b/Engine/lib/assimp/code/C4D/C4DImporter.h @@ -2,7 +2,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2012, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, @@ -48,6 +48,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + +// Forward declarations struct aiNode; struct aiMesh; struct aiMaterial; @@ -61,8 +63,7 @@ namespace melange { class BaseShader; } -namespace Assimp { - +namespace Assimp { // TinyFormatter.h namespace Formatter { template class basic_formatter; @@ -75,17 +76,10 @@ namespace Assimp { * * Note that Melange is not free software. */ // ------------------------------------------------------------------------------------------- -class C4DImporter : public BaseImporter, public LogFunctions -{ +class C4DImporter : public BaseImporter, public LogFunctions { public: - C4DImporter(); ~C4DImporter(); - - -public: - - // -------------------- bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const; @@ -119,5 +113,5 @@ private: }; // !class C4DImporter } // end of namespace Assimp -#endif // INCLUDED_AI_CINEMA_4D_LOADER_H +#endif // INCLUDED_AI_CINEMA_4D_LOADER_H diff --git a/Engine/lib/assimp/code/AssimpCExport.cpp b/Engine/lib/assimp/code/CApi/AssimpCExport.cpp similarity index 99% rename from Engine/lib/assimp/code/AssimpCExport.cpp rename to Engine/lib/assimp/code/CApi/AssimpCExport.cpp index beb3ec3c5..7557edcfc 100644 --- a/Engine/lib/assimp/code/AssimpCExport.cpp +++ b/Engine/lib/assimp/code/CApi/AssimpCExport.cpp @@ -49,7 +49,7 @@ Assimp C export interface. See Exporter.cpp for some notes. #include "CInterfaceIOWrapper.h" #include -#include "ScenePrivate.h" +#include "Common/ScenePrivate.h" #include using namespace Assimp; diff --git a/Engine/lib/assimp/code/CInterfaceIOWrapper.cpp b/Engine/lib/assimp/code/CApi/CInterfaceIOWrapper.cpp similarity index 100% rename from Engine/lib/assimp/code/CInterfaceIOWrapper.cpp rename to Engine/lib/assimp/code/CApi/CInterfaceIOWrapper.cpp diff --git a/Engine/lib/assimp/code/CInterfaceIOWrapper.h b/Engine/lib/assimp/code/CApi/CInterfaceIOWrapper.h similarity index 100% rename from Engine/lib/assimp/code/CInterfaceIOWrapper.h rename to Engine/lib/assimp/code/CApi/CInterfaceIOWrapper.h diff --git a/Engine/lib/assimp/code/CMakeLists.txt b/Engine/lib/assimp/code/CMakeLists.txt index 37ad34b85..827f43333 100644 --- a/Engine/lib/assimp/code/CMakeLists.txt +++ b/Engine/lib/assimp/code/CMakeLists.txt @@ -2,8 +2,7 @@ # ---------------------------------------------------------------------- # # Copyright (c) 2006-2019, assimp team - - +# # All rights reserved. # # Redistribution and use of this software in source and binary forms, @@ -44,7 +43,7 @@ # 3) Add libassimp using the file lists (eliminates duplication of file names between # source groups and library command) # -cmake_minimum_required( VERSION 2.6 ) +cmake_minimum_required( VERSION 3.0 ) SET( HEADER_PATH ../include/assimp ) if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) @@ -61,6 +60,7 @@ SOURCE_GROUP( Compiler FILES ${COMPILER_HEADERS}) SET( PUBLIC_HEADERS ${HEADER_PATH}/anim.h + ${HEADER_PATH}/aabb.h ${HEADER_PATH}/ai_assert.h ${HEADER_PATH}/camera.h ${HEADER_PATH}/color4.h @@ -104,6 +104,7 @@ SET( PUBLIC_HEADERS ${HEADER_PATH}/Exporter.hpp ${HEADER_PATH}/DefaultIOStream.h ${HEADER_PATH}/DefaultIOSystem.h + ${HEADER_PATH}/ZipArchiveIOSystem.h ${HEADER_PATH}/SceneCombiner.h ${HEADER_PATH}/fast_atof.h ${HEADER_PATH}/qnan.h @@ -136,66 +137,75 @@ SET( PUBLIC_HEADERS ${HEADER_PATH}/irrXMLWrapper.h ${HEADER_PATH}/BlobIOSystem.h ${HEADER_PATH}/MathFunctions.h - ${HEADER_PATH}/Macros.h ${HEADER_PATH}/Exceptional.h ${HEADER_PATH}/ByteSwapper.h ) SET( Core_SRCS - Assimp.cpp + Common/Assimp.cpp ) +IF(MSVC) + list(APPEND Core_SRCS "res/assimp.rc") +ENDIF(MSVC) + SET( Logging_SRCS ${HEADER_PATH}/DefaultLogger.hpp ${HEADER_PATH}/LogStream.hpp ${HEADER_PATH}/Logger.hpp ${HEADER_PATH}/NullLogger.hpp - Win32DebugLogStream.h - DefaultLogger.cpp - FileLogStream.h - StdOStreamLogStream.h + Common/Win32DebugLogStream.h + Common/DefaultLogger.cpp + Common/FileLogStream.h + Common/StdOStreamLogStream.h ) SOURCE_GROUP(Logging FILES ${Logging_SRCS}) SET( Common_SRCS - BaseImporter.cpp - BaseProcess.cpp - BaseProcess.h - Importer.h - ScenePrivate.h - PostStepRegistry.cpp - ImporterRegistry.cpp - DefaultProgressHandler.h - DefaultIOStream.cpp - DefaultIOSystem.cpp - CInterfaceIOWrapper.cpp - CInterfaceIOWrapper.h - Importer.cpp - IFF.h - SGSpatialSort.cpp - VertexTriangleAdjacency.cpp - VertexTriangleAdjacency.h - SpatialSort.cpp - SceneCombiner.cpp - ScenePreprocessor.cpp - ScenePreprocessor.h - SkeletonMeshBuilder.cpp - SplitByBoneCountProcess.cpp - SplitByBoneCountProcess.h - StandardShapes.cpp - TargetAnimation.cpp - TargetAnimation.h - RemoveComments.cpp - Subdivision.cpp - scene.cpp - Bitmap.cpp - Version.cpp - CreateAnimMesh.cpp - simd.h - simd.cpp + Common/BaseImporter.cpp + Common/BaseProcess.cpp + Common/BaseProcess.h + Common/Importer.h + Common/ScenePrivate.h + Common/PostStepRegistry.cpp + Common/ImporterRegistry.cpp + Common/DefaultProgressHandler.h + Common/DefaultIOStream.cpp + Common/DefaultIOSystem.cpp + Common/ZipArchiveIOSystem.cpp + Common/PolyTools.h + Common/Importer.cpp + Common/IFF.h + Common/SGSpatialSort.cpp + Common/VertexTriangleAdjacency.cpp + Common/VertexTriangleAdjacency.h + Common/SpatialSort.cpp + Common/SceneCombiner.cpp + Common/ScenePreprocessor.cpp + Common/ScenePreprocessor.h + Common/SkeletonMeshBuilder.cpp + Common/SplitByBoneCountProcess.cpp + Common/SplitByBoneCountProcess.h + Common/StandardShapes.cpp + Common/TargetAnimation.cpp + Common/TargetAnimation.h + Common/RemoveComments.cpp + Common/Subdivision.cpp + Common/scene.cpp + Common/Bitmap.cpp + Common/Version.cpp + Common/CreateAnimMesh.cpp + Common/simd.h + Common/simd.cpp ) SOURCE_GROUP(Common FILES ${Common_SRCS}) +SET( CApi_SRCS + CApi/CInterfaceIOWrapper.cpp + CApi/CInterfaceIOWrapper.h +) +SOURCE_GROUP(CApi FILES ${CApi_SRCS}) + SET( STEPParser_SRCS Importer/STEPParser/STEPFileReader.h Importer/STEPParser/STEPFileReader.cpp @@ -206,8 +216,8 @@ SOURCE_GROUP(STEPParser FILES ${STEPParser_SRCS}) IF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER ) SET( C4D_SRCS - C4DImporter.cpp - C4DImporter.h + C4D/C4DImporter.cpp + C4D/C4DImporter.h ) SOURCE_GROUP( C4D FILES ${C4D_SRCS}) ENDIF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER ) @@ -216,7 +226,7 @@ ENDIF ( ASSIMP_BUILD_NONFREE_C4D_IMPORTER ) # ASSIMP_BUILD_XXX_IMPORTER to FALSE for each importer # if this variable is set to FALSE, the user can manually enable importers by setting # ASSIMP_BUILD_XXX_IMPORTER to TRUE for each importer -OPTION(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT "default value of all ASSIMP_BUILD_XXX_IMPORTER value" TRUE) +OPTION(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT "default value of all ASSIMP_BUILD_XXX_IMPORTER values" TRUE) # macro to add the CMake Option ADD_ASSIMP_IMPORTER_ which enables compile of loader # this way selective loaders can be compiled (reduces filesize + compile time) @@ -232,258 +242,320 @@ MACRO(ADD_ASSIMP_IMPORTER name) IF (ASSIMP_IMPORTER_ENABLED) LIST(APPEND ASSIMP_LOADER_SRCS ${ARGN}) SET(ASSIMP_IMPORTERS_ENABLED "${ASSIMP_IMPORTERS_ENABLED} ${name}") - SET(${name}_SRCS ${ARGN}) SOURCE_GROUP(${name} FILES ${ARGN}) ELSE() SET(${name}_SRC "") SET(ASSIMP_IMPORTERS_DISABLED "${ASSIMP_IMPORTERS_DISABLED} ${name}") add_definitions(-DASSIMP_BUILD_NO_${name}_IMPORTER) + ENDIF() +ENDMACRO() + +# if this variable is set to TRUE, the user can manually disable exporters by setting +# ASSIMP_BUILD_XXX_EXPORTER to FALSE for each exporter +# if this variable is set to FALSE, the user can manually enable exporters by setting +# ASSIMP_BUILD_XXX_EXPORTER to TRUE for each exporter +OPTION(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT "default value of all ASSIMP_BUILD_XXX_EXPORTER values" TRUE) + +# macro to add the CMake Option ADD_ASSIMP_IMPORTER_ which enables compile of loader +# this way selective loaders can be compiled (reduces filesize + compile time) +MACRO(ADD_ASSIMP_EXPORTER name) + IF (ASSIMP_NO_EXPORT) + set(ASSIMP_EXPORTER_ENABLED FALSE) + ELSEIF (ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT) + set(ASSIMP_EXPORTER_ENABLED TRUE) + IF (DEFINED ASSIMP_BUILD_${name}_EXPORTER AND NOT ASSIMP_BUILD_${name}_EXPORTER) + set(ASSIMP_EXPORTER_ENABLED FALSE) + ENDIF () + ELSE () + set(ASSIMP_EXPORTER_ENABLED ${ASSIMP_BUILD_${name}_EXPORTER}) + ENDIF () + + IF (ASSIMP_EXPORTER_ENABLED) + SET(ASSIMP_EXPORTERS_ENABLED "${ASSIMP_EXPORTERS_ENABLED} ${name}") + LIST(APPEND ASSIMP_EXPORTER_SRCS ${ARGN}) + SOURCE_GROUP(${name}_EXPORTER FILES ${ARGN}) + ELSE() + SET(ASSIMP_EXPORTERS_DISABLED "${ASSIMP_EXPORTERS_DISABLED} ${name}") add_definitions(-DASSIMP_BUILD_NO_${name}_EXPORTER) ENDIF() ENDMACRO() SET(ASSIMP_LOADER_SRCS "") SET(ASSIMP_IMPORTERS_ENABLED "") # list of enabled importers -SET(ASSIMP_IMPORTERS_DISABLED "") # disabled list (used to print) +SET(ASSIMP_IMPORTERS_DISABLED "") # disabled importers list (used to print) + +SET(ASSIMP_EXPORTER_SRCS "") +SET(ASSIMP_EXPORTERS_ENABLED "") # list of enabled exporters +SET(ASSIMP_EXPORTERS_DISABLED "") # disabled exporters list (used to print) ADD_ASSIMP_IMPORTER( AMF - AMFImporter.hpp - AMFImporter_Macro.hpp - AMFImporter_Node.hpp - AMFImporter.cpp - AMFImporter_Geometry.cpp - AMFImporter_Material.cpp - AMFImporter_Postprocess.cpp + AMF/AMFImporter.hpp + AMF/AMFImporter_Macro.hpp + AMF/AMFImporter_Node.hpp + AMF/AMFImporter.cpp + AMF/AMFImporter_Geometry.cpp + AMF/AMFImporter_Material.cpp + AMF/AMFImporter_Postprocess.cpp ) ADD_ASSIMP_IMPORTER( 3DS - 3DSConverter.cpp - 3DSHelper.h - 3DSLoader.cpp - 3DSLoader.h - 3DSExporter.h - 3DSExporter.cpp + 3DS/3DSConverter.cpp + 3DS/3DSHelper.h + 3DS/3DSLoader.cpp + 3DS/3DSLoader.h +) + +ADD_ASSIMP_EXPORTER( 3DS + 3DS/3DSExporter.h + 3DS/3DSExporter.cpp ) ADD_ASSIMP_IMPORTER( AC - ACLoader.cpp - ACLoader.h + AC/ACLoader.cpp + AC/ACLoader.h ) ADD_ASSIMP_IMPORTER( ASE - ASELoader.cpp - ASELoader.h - ASEParser.cpp - ASEParser.h + ASE/ASELoader.cpp + ASE/ASELoader.h + ASE/ASEParser.cpp + ASE/ASEParser.h ) ADD_ASSIMP_IMPORTER( ASSBIN - AssbinExporter.h - AssbinExporter.cpp - AssbinLoader.h - AssbinLoader.cpp + Assbin/AssbinLoader.h + Assbin/AssbinLoader.cpp ) -ADD_ASSIMP_IMPORTER( ASSXML - AssxmlExporter.h - AssxmlExporter.cpp +ADD_ASSIMP_EXPORTER( ASSBIN + Assbin/AssbinExporter.h + Assbin/AssbinExporter.cpp +) + +ADD_ASSIMP_EXPORTER( ASSXML + Assxml/AssxmlExporter.h + Assxml/AssxmlExporter.cpp ) ADD_ASSIMP_IMPORTER( B3D - B3DImporter.cpp - B3DImporter.h + B3D/B3DImporter.cpp + B3D/B3DImporter.h ) ADD_ASSIMP_IMPORTER( BVH - BVHLoader.cpp - BVHLoader.h + BVH/BVHLoader.cpp + BVH/BVHLoader.h ) ADD_ASSIMP_IMPORTER( COLLADA - ColladaHelper.h - ColladaLoader.cpp - ColladaLoader.h - ColladaParser.cpp - ColladaParser.h - ColladaExporter.h - ColladaExporter.cpp + Collada/ColladaHelper.h + Collada/ColladaLoader.cpp + Collada/ColladaLoader.h + Collada/ColladaParser.cpp + Collada/ColladaParser.h +) + +ADD_ASSIMP_EXPORTER( COLLADA + Collada/ColladaExporter.h + Collada/ColladaExporter.cpp ) ADD_ASSIMP_IMPORTER( DXF - DXFLoader.cpp - DXFLoader.h - DXFHelper.h + DXF/DXFLoader.cpp + DXF/DXFLoader.h + DXF/DXFHelper.h ) ADD_ASSIMP_IMPORTER( CSM - CSMLoader.cpp - CSMLoader.h + CSM/CSMLoader.cpp + CSM/CSMLoader.h ) ADD_ASSIMP_IMPORTER( HMP - HMPFileData.h - HMPLoader.cpp - HMPLoader.h - HalfLifeFileData.h + HMP/HMPFileData.h + HMP/HMPLoader.cpp + HMP/HMPLoader.h + HMP/HalfLifeFileData.h ) ADD_ASSIMP_IMPORTER( IRRMESH - IRRMeshLoader.cpp - IRRMeshLoader.h - IRRShared.cpp - IRRShared.h + Irr/IRRMeshLoader.cpp + Irr/IRRMeshLoader.h + Irr/IRRShared.cpp + Irr/IRRShared.h ) ADD_ASSIMP_IMPORTER( IRR - IRRLoader.cpp - IRRLoader.h - IRRShared.cpp - IRRShared.h + Irr/IRRLoader.cpp + Irr/IRRLoader.h + Irr/IRRShared.cpp + Irr/IRRShared.h ) ADD_ASSIMP_IMPORTER( LWO - LWOAnimation.cpp - LWOAnimation.h - LWOBLoader.cpp - LWOFileData.h - LWOLoader.cpp - LWOLoader.h - LWOMaterial.cpp + LWO/LWOAnimation.cpp + LWO/LWOAnimation.h + LWO/LWOBLoader.cpp + LWO/LWOFileData.h + LWO/LWOLoader.cpp + LWO/LWOLoader.h + LWO/LWOMaterial.cpp ) ADD_ASSIMP_IMPORTER( LWS - LWSLoader.cpp - LWSLoader.h + LWS/LWSLoader.cpp + LWS/LWSLoader.h +) + +ADD_ASSIMP_IMPORTER( M3D + M3D/M3DMaterials.h + M3D/M3DImporter.h + M3D/M3DImporter.cpp + M3D/m3d.h +) + +ADD_ASSIMP_EXPORTER( M3D + M3D/M3DExporter.h + M3D/M3DExporter.cpp ) ADD_ASSIMP_IMPORTER( MD2 - MD2FileData.h - MD2Loader.cpp - MD2Loader.h - MD2NormalTable.h + MD2/MD2FileData.h + MD2/MD2Loader.cpp + MD2/MD2Loader.h + MD2/MD2NormalTable.h ) ADD_ASSIMP_IMPORTER( MD3 - MD3FileData.h - MD3Loader.cpp - MD3Loader.h + MD3/MD3FileData.h + MD3/MD3Loader.cpp + MD3/MD3Loader.h ) ADD_ASSIMP_IMPORTER( MD5 - MD5Loader.cpp - MD5Loader.h - MD5Parser.cpp - MD5Parser.h + MD5/MD5Loader.cpp + MD5/MD5Loader.h + MD5/MD5Parser.cpp + MD5/MD5Parser.h ) ADD_ASSIMP_IMPORTER( MDC - MDCFileData.h - MDCLoader.cpp - MDCLoader.h - MDCNormalTable.h + MDC/MDCFileData.h + MDC/MDCLoader.cpp + MDC/MDCLoader.h + MDC/MDCNormalTable.h ) ADD_ASSIMP_IMPORTER( MDL - MDLDefaultColorMap.h - MDLFileData.h - MDLLoader.cpp - MDLLoader.h - MDLMaterialLoader.cpp + MDL/MDLDefaultColorMap.h + MDL/MDLFileData.h + MDL/MDLLoader.cpp + MDL/MDLLoader.h + MDL/MDLMaterialLoader.cpp ) SET( MaterialSystem_SRCS - MaterialSystem.cpp - MaterialSystem.h + Material/MaterialSystem.cpp + Material/MaterialSystem.h ) SOURCE_GROUP( MaterialSystem FILES ${MaterialSystem_SRCS}) ADD_ASSIMP_IMPORTER( NFF - NFFLoader.cpp - NFFLoader.h + NFF/NFFLoader.cpp + NFF/NFFLoader.h ) ADD_ASSIMP_IMPORTER( NDO - NDOLoader.cpp - NDOLoader.h + NDO/NDOLoader.cpp + NDO/NDOLoader.h ) ADD_ASSIMP_IMPORTER( OFF - OFFLoader.cpp - OFFLoader.h + OFF/OFFLoader.cpp + OFF/OFFLoader.h ) ADD_ASSIMP_IMPORTER( OBJ - ObjFileData.h - ObjFileImporter.cpp - ObjFileImporter.h - ObjFileMtlImporter.cpp - ObjFileMtlImporter.h - ObjFileParser.cpp - ObjFileParser.h - ObjTools.h - ObjExporter.h - ObjExporter.cpp + Obj/ObjFileData.h + Obj/ObjFileImporter.cpp + Obj/ObjFileImporter.h + Obj/ObjFileMtlImporter.cpp + Obj/ObjFileMtlImporter.h + Obj/ObjFileParser.cpp + Obj/ObjFileParser.h + Obj/ObjTools.h +) + +ADD_ASSIMP_EXPORTER( OBJ + Obj/ObjExporter.h + Obj/ObjExporter.cpp ) ADD_ASSIMP_IMPORTER( OGRE - OgreImporter.h - OgreStructs.h - OgreParsingUtils.h - OgreBinarySerializer.h - OgreXmlSerializer.h - OgreImporter.cpp - OgreStructs.cpp - OgreBinarySerializer.cpp - OgreXmlSerializer.cpp - OgreMaterial.cpp + Ogre/OgreImporter.h + Ogre/OgreStructs.h + Ogre/OgreParsingUtils.h + Ogre/OgreBinarySerializer.h + Ogre/OgreXmlSerializer.h + Ogre/OgreImporter.cpp + Ogre/OgreStructs.cpp + Ogre/OgreBinarySerializer.cpp + Ogre/OgreXmlSerializer.cpp + Ogre/OgreMaterial.cpp ) ADD_ASSIMP_IMPORTER( OPENGEX - OpenGEXExporter.cpp - OpenGEXExporter.h - OpenGEXImporter.cpp - OpenGEXImporter.h - OpenGEXStructs.h + OpenGEX/OpenGEXImporter.cpp + OpenGEX/OpenGEXImporter.h + OpenGEX/OpenGEXStructs.h +) + +ADD_ASSIMP_EXPORTER( OPENGEX + OpenGEX/OpenGEXExporter.cpp + OpenGEX/OpenGEXExporter.h ) ADD_ASSIMP_IMPORTER( PLY - PlyLoader.cpp - PlyLoader.h - PlyParser.cpp - PlyParser.h - PlyExporter.cpp - PlyExporter.h + Ply/PlyLoader.cpp + Ply/PlyLoader.h + Ply/PlyParser.cpp + Ply/PlyParser.h +) + +ADD_ASSIMP_EXPORTER( PLY + Ply/PlyExporter.cpp + Ply/PlyExporter.h ) ADD_ASSIMP_IMPORTER( MS3D - MS3DLoader.cpp - MS3DLoader.h + MS3D/MS3DLoader.cpp + MS3D/MS3DLoader.h ) ADD_ASSIMP_IMPORTER( COB - COBLoader.cpp - COBLoader.h - COBScene.h + COB/COBLoader.cpp + COB/COBLoader.h + COB/COBScene.h ) ADD_ASSIMP_IMPORTER( BLEND - BlenderLoader.cpp - BlenderLoader.h - BlenderDNA.cpp - BlenderDNA.h - BlenderDNA.inl - BlenderScene.cpp - BlenderScene.h - BlenderSceneGen.h - BlenderIntermediate.h - BlenderModifier.h - BlenderModifier.cpp - BlenderBMesh.h - BlenderBMesh.cpp - BlenderTessellator.h - BlenderTessellator.cpp - BlenderCustomData.h - BlenderCustomData.cpp + Blender/BlenderLoader.cpp + Blender/BlenderLoader.h + Blender/BlenderDNA.cpp + Blender/BlenderDNA.h + Blender/BlenderDNA.inl + Blender/BlenderScene.cpp + Blender/BlenderScene.h + Blender/BlenderSceneGen.h + Blender/BlenderIntermediate.h + Blender/BlenderModifier.h + Blender/BlenderModifier.cpp + Blender/BlenderBMesh.h + Blender/BlenderBMesh.cpp + Blender/BlenderTessellator.h + Blender/BlenderTessellator.cpp + Blender/BlenderCustomData.h + Blender/BlenderCustomData.cpp ) ADD_ASSIMP_IMPORTER( IFC @@ -511,103 +583,109 @@ if (ASSIMP_BUILD_IFC_IMPORTER) endif (ASSIMP_BUILD_IFC_IMPORTER) ADD_ASSIMP_IMPORTER( XGL - XGLLoader.cpp - XGLLoader.h + XGL/XGLLoader.cpp + XGL/XGLLoader.h ) ADD_ASSIMP_IMPORTER( FBX - FBXImporter.cpp - FBXCompileConfig.h - FBXImporter.h - FBXParser.cpp - FBXParser.h - FBXTokenizer.cpp - FBXTokenizer.h - FBXImportSettings.h - FBXConverter.h - FBXConverter.cpp - FBXUtil.h - FBXUtil.cpp - FBXDocument.h - FBXDocument.cpp - FBXProperties.h - FBXProperties.cpp - FBXMeshGeometry.h - FBXMeshGeometry.cpp - FBXMaterial.cpp - FBXModel.cpp - FBXAnimation.cpp - FBXNodeAttribute.cpp - FBXDeformer.cpp - FBXBinaryTokenizer.cpp - FBXDocumentUtil.cpp - FBXExporter.h - FBXExporter.cpp - FBXExportNode.h - FBXExportNode.cpp - FBXExportProperty.h - FBXExportProperty.cpp - FBXCommon.h + FBX/FBXImporter.cpp + FBX/FBXCompileConfig.h + FBX/FBXImporter.h + FBX/FBXParser.cpp + FBX/FBXParser.h + FBX/FBXTokenizer.cpp + FBX/FBXTokenizer.h + FBX/FBXImportSettings.h + FBX/FBXConverter.h + FBX/FBXConverter.cpp + FBX/FBXUtil.h + FBX/FBXUtil.cpp + FBX/FBXDocument.h + FBX/FBXDocument.cpp + FBX/FBXProperties.h + FBX/FBXProperties.cpp + FBX/FBXMeshGeometry.h + FBX/FBXMeshGeometry.cpp + FBX/FBXMaterial.cpp + FBX/FBXModel.cpp + FBX/FBXAnimation.cpp + FBX/FBXNodeAttribute.cpp + FBX/FBXDeformer.cpp + FBX/FBXBinaryTokenizer.cpp + FBX/FBXDocumentUtil.cpp + FBX/FBXCommon.h +) + +ADD_ASSIMP_EXPORTER( FBX + FBX/FBXExporter.h + FBX/FBXExporter.cpp + FBX/FBXExportNode.h + FBX/FBXExportNode.cpp + FBX/FBXExportProperty.h + FBX/FBXExportProperty.cpp ) SET( PostProcessing_SRCS - CalcTangentsProcess.cpp - CalcTangentsProcess.h - ComputeUVMappingProcess.cpp - ComputeUVMappingProcess.h - ConvertToLHProcess.cpp - ConvertToLHProcess.h - EmbedTexturesProcess.cpp - EmbedTexturesProcess.h - FindDegenerates.cpp - FindDegenerates.h - FindInstancesProcess.cpp - FindInstancesProcess.h - FindInvalidDataProcess.cpp - FindInvalidDataProcess.h - FixNormalsStep.cpp - FixNormalsStep.h - DropFaceNormalsProcess.cpp - DropFaceNormalsProcess.h - GenFaceNormalsProcess.cpp - GenFaceNormalsProcess.h - GenVertexNormalsProcess.cpp - GenVertexNormalsProcess.h - PretransformVertices.cpp - PretransformVertices.h - ImproveCacheLocality.cpp - ImproveCacheLocality.h - JoinVerticesProcess.cpp - JoinVerticesProcess.h - LimitBoneWeightsProcess.cpp - LimitBoneWeightsProcess.h - RemoveRedundantMaterials.cpp - RemoveRedundantMaterials.h - RemoveVCProcess.cpp - RemoveVCProcess.h - SortByPTypeProcess.cpp - SortByPTypeProcess.h - SplitLargeMeshes.cpp - SplitLargeMeshes.h - TextureTransform.cpp - TextureTransform.h - TriangulateProcess.cpp - TriangulateProcess.h - ValidateDataStructure.cpp - ValidateDataStructure.h - OptimizeGraph.cpp - OptimizeGraph.h - OptimizeMeshes.cpp - OptimizeMeshes.h - DeboneProcess.cpp - DeboneProcess.h - ProcessHelper.h - ProcessHelper.cpp - PolyTools.h - MakeVerboseFormat.cpp - MakeVerboseFormat.h - ScaleProcess.cpp - ScaleProcess.h + PostProcessing/CalcTangentsProcess.cpp + PostProcessing/CalcTangentsProcess.h + PostProcessing/ComputeUVMappingProcess.cpp + PostProcessing/ComputeUVMappingProcess.h + PostProcessing/ConvertToLHProcess.cpp + PostProcessing/ConvertToLHProcess.h + PostProcessing/EmbedTexturesProcess.cpp + PostProcessing/EmbedTexturesProcess.h + PostProcessing/FindDegenerates.cpp + PostProcessing/FindDegenerates.h + PostProcessing/FindInstancesProcess.cpp + PostProcessing/FindInstancesProcess.h + PostProcessing/FindInvalidDataProcess.cpp + PostProcessing/FindInvalidDataProcess.h + PostProcessing/FixNormalsStep.cpp + PostProcessing/FixNormalsStep.h + PostProcessing/DropFaceNormalsProcess.cpp + PostProcessing/DropFaceNormalsProcess.h + PostProcessing/GenFaceNormalsProcess.cpp + PostProcessing/GenFaceNormalsProcess.h + PostProcessing/GenVertexNormalsProcess.cpp + PostProcessing/GenVertexNormalsProcess.h + PostProcessing/PretransformVertices.cpp + PostProcessing/PretransformVertices.h + PostProcessing/ImproveCacheLocality.cpp + PostProcessing/ImproveCacheLocality.h + PostProcessing/JoinVerticesProcess.cpp + PostProcessing/JoinVerticesProcess.h + PostProcessing/LimitBoneWeightsProcess.cpp + PostProcessing/LimitBoneWeightsProcess.h + PostProcessing/RemoveRedundantMaterials.cpp + PostProcessing/RemoveRedundantMaterials.h + PostProcessing/RemoveVCProcess.cpp + PostProcessing/RemoveVCProcess.h + PostProcessing/SortByPTypeProcess.cpp + PostProcessing/SortByPTypeProcess.h + PostProcessing/SplitLargeMeshes.cpp + PostProcessing/SplitLargeMeshes.h + PostProcessing/TextureTransform.cpp + PostProcessing/TextureTransform.h + PostProcessing/TriangulateProcess.cpp + PostProcessing/TriangulateProcess.h + PostProcessing/ValidateDataStructure.cpp + PostProcessing/ValidateDataStructure.h + PostProcessing/OptimizeGraph.cpp + PostProcessing/OptimizeGraph.h + PostProcessing/OptimizeMeshes.cpp + PostProcessing/OptimizeMeshes.h + PostProcessing/DeboneProcess.cpp + PostProcessing/DeboneProcess.h + PostProcessing/ProcessHelper.h + PostProcessing/ProcessHelper.cpp + PostProcessing/MakeVerboseFormat.cpp + PostProcessing/MakeVerboseFormat.h + PostProcessing/ScaleProcess.cpp + PostProcessing/ScaleProcess.h + PostProcessing/ArmaturePopulate.cpp + PostProcessing/ArmaturePopulate.h + PostProcessing/GenBoundingBoxesProcess.cpp + PostProcessing/GenBoundingBoxesProcess.h ) SOURCE_GROUP( PostProcessing FILES ${PostProcessing_SRCS}) @@ -615,251 +693,354 @@ SET( IrrXML_SRCS ${HEADER_PATH}/irrXMLWrapper.h ) SOURCE_GROUP( IrrXML FILES ${IrrXML_SRCS}) ADD_ASSIMP_IMPORTER( Q3D - Q3DLoader.cpp - Q3DLoader.h + Q3D/Q3DLoader.cpp + Q3D/Q3DLoader.h ) ADD_ASSIMP_IMPORTER( Q3BSP - Q3BSPFileData.h - Q3BSPFileParser.h - Q3BSPFileParser.cpp - Q3BSPFileImporter.h - Q3BSPFileImporter.cpp - Q3BSPZipArchive.h - Q3BSPZipArchive.cpp + Q3BSP/Q3BSPFileData.h + Q3BSP/Q3BSPFileParser.h + Q3BSP/Q3BSPFileParser.cpp + Q3BSP/Q3BSPFileImporter.h + Q3BSP/Q3BSPFileImporter.cpp ) ADD_ASSIMP_IMPORTER( RAW - RawLoader.cpp - RawLoader.h + Raw/RawLoader.cpp + Raw/RawLoader.h ) ADD_ASSIMP_IMPORTER( SIB - SIBImporter.cpp - SIBImporter.h + SIB/SIBImporter.cpp + SIB/SIBImporter.h ) ADD_ASSIMP_IMPORTER( SMD - SMDLoader.cpp - SMDLoader.h + SMD/SMDLoader.cpp + SMD/SMDLoader.h ) ADD_ASSIMP_IMPORTER( STL - STLLoader.cpp - STLLoader.h - STLExporter.h - STLExporter.cpp + STL/STLLoader.cpp + STL/STLLoader.h +) + +ADD_ASSIMP_EXPORTER( STL + STL/STLExporter.h + STL/STLExporter.cpp ) ADD_ASSIMP_IMPORTER( TERRAGEN - TerragenLoader.cpp - TerragenLoader.h + Terragen/TerragenLoader.cpp + Terragen/TerragenLoader.h ) ADD_ASSIMP_IMPORTER( 3D - UnrealLoader.cpp - UnrealLoader.h + Unreal/UnrealLoader.cpp + Unreal/UnrealLoader.h ) ADD_ASSIMP_IMPORTER( X - XFileHelper.h - XFileImporter.cpp - XFileImporter.h - XFileParser.cpp - XFileParser.h - XFileExporter.h - XFileExporter.cpp + X/XFileHelper.h + X/XFileImporter.cpp + X/XFileImporter.h + X/XFileParser.cpp + X/XFileParser.h +) + +ADD_ASSIMP_EXPORTER( X + X/XFileExporter.h + X/XFileExporter.cpp ) ADD_ASSIMP_IMPORTER( X3D - X3DExporter.cpp - X3DExporter.hpp - X3DImporter.cpp - X3DImporter.hpp - X3DImporter_Geometry2D.cpp - X3DImporter_Geometry3D.cpp - X3DImporter_Group.cpp - X3DImporter_Light.cpp - X3DImporter_Macro.hpp - X3DImporter_Metadata.cpp - X3DImporter_Networking.cpp - X3DImporter_Node.hpp - X3DImporter_Postprocess.cpp - X3DImporter_Rendering.cpp - X3DImporter_Shape.cpp - X3DImporter_Texturing.cpp - FIReader.hpp - FIReader.cpp - X3DVocabulary.cpp + X3D/X3DImporter.cpp + X3D/X3DImporter.hpp + X3D/X3DImporter_Geometry2D.cpp + X3D/X3DImporter_Geometry3D.cpp + X3D/X3DImporter_Group.cpp + X3D/X3DImporter_Light.cpp + X3D/X3DImporter_Macro.hpp + X3D/X3DImporter_Metadata.cpp + X3D/X3DImporter_Networking.cpp + X3D/X3DImporter_Node.hpp + X3D/X3DImporter_Postprocess.cpp + X3D/X3DImporter_Rendering.cpp + X3D/X3DImporter_Shape.cpp + X3D/X3DImporter_Texturing.cpp + X3D/FIReader.hpp + X3D/FIReader.cpp + X3D/X3DVocabulary.cpp +) + +ADD_ASSIMP_EXPORTER( X3D + X3D/X3DExporter.cpp + X3D/X3DExporter.hpp ) ADD_ASSIMP_IMPORTER( GLTF - glTFAsset.h - glTFAsset.inl - glTFAssetWriter.h - glTFAssetWriter.inl - glTFImporter.cpp - glTFImporter.h - glTFExporter.h - glTFExporter.cpp - glTF2Asset.h - glTF2Asset.inl - glTF2AssetWriter.h - glTF2AssetWriter.inl - glTF2Importer.cpp - glTF2Importer.h - glTF2Exporter.h - glTF2Exporter.cpp + glTF/glTFCommon.h + glTF/glTFCommon.cpp + glTF/glTFAsset.h + glTF/glTFAsset.inl + glTF/glTFAssetWriter.h + glTF/glTFAssetWriter.inl + glTF/glTFImporter.cpp + glTF/glTFImporter.h + glTF2/glTF2Asset.h + glTF2/glTF2Asset.inl + glTF2/glTF2AssetWriter.h + glTF2/glTF2AssetWriter.inl + glTF2/glTF2Importer.cpp + glTF2/glTF2Importer.h +) + +ADD_ASSIMP_EXPORTER( GLTF + glTF/glTFExporter.h + glTF/glTFExporter.cpp + glTF2/glTF2Exporter.h + glTF2/glTF2Exporter.cpp ) ADD_ASSIMP_IMPORTER( 3MF - D3MFImporter.h - D3MFImporter.cpp - D3MFExporter.h - D3MFExporter.cpp - D3MFOpcPackage.h - D3MFOpcPackage.cpp - 3MFXmlTags.h + 3MF/D3MFImporter.h + 3MF/D3MFImporter.cpp + 3MF/D3MFOpcPackage.h + 3MF/D3MFOpcPackage.cpp + 3MF/3MFXmlTags.h +) + +ADD_ASSIMP_EXPORTER( 3MF + 3MF/D3MFExporter.h + 3MF/D3MFExporter.cpp ) ADD_ASSIMP_IMPORTER( MMD - MMDCpp14.h - MMDImporter.cpp - MMDImporter.h - MMDPmdParser.h - MMDPmxParser.h - MMDPmxParser.cpp - MMDVmdParser.h + MMD/MMDCpp14.h + MMD/MMDImporter.cpp + MMD/MMDImporter.h + MMD/MMDPmdParser.h + MMD/MMDPmxParser.h + MMD/MMDPmxParser.cpp + MMD/MMDVmdParser.h ) +ADD_ASSIMP_EXPORTER( ASSJSON + Assjson/cencode.c + Assjson/cencode.h + Assjson/json_exporter.cpp + Assjson/mesh_splitter.cpp + Assjson/mesh_splitter.h +) + +# Workaround for issue #2406 - force problematic large file to be optimized to prevent string table overflow error +# Used -Os instead of -O2 as previous issues had mentioned, since -Os is roughly speaking -O2, excluding any +# optimizations that take up extra space. Given that the issue is a string table overflowing, -Os seemed appropriate +# Also, I'm not positive if both link & compile flags are needed, but this hopefully ensures that the issue should not +# recur for edge cases such as static builds. +if ((CMAKE_COMPILER_IS_MINGW) AND (CMAKE_BUILD_TYPE MATCHES Debug)) + message("-- Applying MinGW StepFileGen1.cpp Debug Workaround") + SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES COMPILE_FLAGS -Os ) + SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES LINK_FLAGS -Os ) + SET_SOURCE_FILES_PROPERTIES(Importer/StepFile/StepFileGen1.cpp PROPERTIES STATIC_LIBRARY_FLAGS -Os ) +endif() + ADD_ASSIMP_IMPORTER( STEP - STEPFile.h + Step/STEPFile.h Importer/StepFile/StepFileImporter.h Importer/StepFile/StepFileImporter.cpp Importer/StepFile/StepFileGen1.cpp Importer/StepFile/StepFileGen2.cpp Importer/StepFile/StepFileGen3.cpp Importer/StepFile/StepReaderGen.h - StepExporter.h - StepExporter.cpp ) -SET( Exporter_SRCS - Exporter.cpp - AssimpCExport.cpp - ${HEADER_PATH}/BlobIOSystem.h +ADD_ASSIMP_EXPORTER( STEP + Step/StepExporter.h + Step/StepExporter.cpp ) -SOURCE_GROUP( Exporter FILES ${Exporter_SRCS}) + +if ((NOT ASSIMP_NO_EXPORT) OR (NOT ASSIMP_EXPORTERS_ENABLED STREQUAL "")) + SET( Exporter_SRCS + Common/Exporter.cpp + CApi/AssimpCExport.cpp + ${HEADER_PATH}/BlobIOSystem.h + ) + SOURCE_GROUP( Exporter FILES ${Exporter_SRCS}) +endif() SET( Extra_SRCS MD4FileData.h ) SOURCE_GROUP( Extra FILES ${Extra_SRCS}) +# irrXML +IF(HUNTER_ENABLED) + hunter_add_package(irrXML) + find_package(irrXML CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + # irrXML already included in contrib directory by parent CMakeLists.txt. +ENDIF(HUNTER_ENABLED) -SET( Clipper_SRCS - ../contrib/clipper/clipper.hpp - ../contrib/clipper/clipper.cpp -) -SOURCE_GROUP( Clipper FILES ${Clipper_SRCS}) +# utf8 +IF(HUNTER_ENABLED) + hunter_add_package(utf8) + find_package(utf8 CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + # utf8 is header-only, so Assimp doesn't need to do anything. +ENDIF(HUNTER_ENABLED) -SET( Poly2Tri_SRCS - ../contrib/poly2tri/poly2tri/common/shapes.cc - ../contrib/poly2tri/poly2tri/common/shapes.h - ../contrib/poly2tri/poly2tri/common/utils.h - ../contrib/poly2tri/poly2tri/sweep/advancing_front.h - ../contrib/poly2tri/poly2tri/sweep/advancing_front.cc - ../contrib/poly2tri/poly2tri/sweep/cdt.cc - ../contrib/poly2tri/poly2tri/sweep/cdt.h - ../contrib/poly2tri/poly2tri/sweep/sweep.cc - ../contrib/poly2tri/poly2tri/sweep/sweep.h - ../contrib/poly2tri/poly2tri/sweep/sweep_context.cc - ../contrib/poly2tri/poly2tri/sweep/sweep_context.h -) -SOURCE_GROUP( Poly2Tri FILES ${Poly2Tri_SRCS}) +# polyclipping +IF(HUNTER_ENABLED) + hunter_add_package(polyclipping) + find_package(polyclipping CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + SET( Clipper_SRCS + ../contrib/clipper/clipper.hpp + ../contrib/clipper/clipper.cpp + ) + SOURCE_GROUP( Contrib\\Clipper FILES ${Clipper_SRCS}) +ENDIF(HUNTER_ENABLED) -SET( unzip_SRCS - ../contrib/unzip/crypt.h - ../contrib/unzip/ioapi.c - ../contrib/unzip/ioapi.h - ../contrib/unzip/unzip.c - ../contrib/unzip/unzip.h -) -SOURCE_GROUP( unzip FILES ${unzip_SRCS}) +# poly2tri +IF(HUNTER_ENABLED) + hunter_add_package(poly2tri) + find_package(poly2tri CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + SET( Poly2Tri_SRCS + ../contrib/poly2tri/poly2tri/common/shapes.cc + ../contrib/poly2tri/poly2tri/common/shapes.h + ../contrib/poly2tri/poly2tri/common/utils.h + ../contrib/poly2tri/poly2tri/sweep/advancing_front.h + ../contrib/poly2tri/poly2tri/sweep/advancing_front.cc + ../contrib/poly2tri/poly2tri/sweep/cdt.cc + ../contrib/poly2tri/poly2tri/sweep/cdt.h + ../contrib/poly2tri/poly2tri/sweep/sweep.cc + ../contrib/poly2tri/poly2tri/sweep/sweep.h + ../contrib/poly2tri/poly2tri/sweep/sweep_context.cc + ../contrib/poly2tri/poly2tri/sweep/sweep_context.h + ) + SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS}) +ENDIF(HUNTER_ENABLED) -SET( ziplib_SRCS - ../contrib/zip/src/miniz.h - ../contrib/zip/src/zip.c - ../contrib/zip/src/zip.h -) +# minizip/unzip +IF(HUNTER_ENABLED) + hunter_add_package(minizip) + find_package(minizip CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + SET( unzip_SRCS + ../contrib/unzip/crypt.h + ../contrib/unzip/ioapi.c + ../contrib/unzip/ioapi.h + ../contrib/unzip/unzip.c + ../contrib/unzip/unzip.h + ) + SOURCE_GROUP(Contrib\\unzip FILES ${unzip_SRCS}) +ENDIF(HUNTER_ENABLED) -SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} ) +# zip (https://github.com/kuba--/zip) +IF(HUNTER_ENABLED) + hunter_add_package(zip) + find_package(zip CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + SET( ziplib_SRCS + ../contrib/zip/src/miniz.h + ../contrib/zip/src/zip.c + ../contrib/zip/src/zip.h + ) -SET ( openddl_parser_SRCS - ../contrib/openddlparser/code/OpenDDLParser.cpp - ../contrib/openddlparser/code/DDLNode.cpp - ../contrib/openddlparser/code/OpenDDLCommon.cpp - ../contrib/openddlparser/code/OpenDDLExport.cpp - ../contrib/openddlparser/code/Value.cpp - ../contrib/openddlparser/code/OpenDDLStream.cpp - ../contrib/openddlparser/include/openddlparser/OpenDDLParser.h - ../contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h - ../contrib/openddlparser/include/openddlparser/OpenDDLCommon.h - ../contrib/openddlparser/include/openddlparser/OpenDDLExport.h - ../contrib/openddlparser/include/openddlparser/OpenDDLStream.h - ../contrib/openddlparser/include/openddlparser/DDLNode.h - ../contrib/openddlparser/include/openddlparser/Value.h -) -SOURCE_GROUP( openddl_parser FILES ${openddl_parser_SRCS}) + # TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only + if(${CMAKE_VERSION} VERSION_LESS "3.12.0") + add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0) + else() + add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0) + endif() -SET ( open3dgc_SRCS - ../contrib/Open3DGC/o3dgcAdjacencyInfo.h - ../contrib/Open3DGC/o3dgcArithmeticCodec.cpp - ../contrib/Open3DGC/o3dgcArithmeticCodec.h - ../contrib/Open3DGC/o3dgcBinaryStream.h - ../contrib/Open3DGC/o3dgcCommon.h - ../contrib/Open3DGC/o3dgcDVEncodeParams.h - ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp - ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.h - ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp - ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.h - ../contrib/Open3DGC/o3dgcDynamicVector.h - ../contrib/Open3DGC/o3dgcFIFO.h - ../contrib/Open3DGC/o3dgcIndexedFaceSet.h - ../contrib/Open3DGC/o3dgcIndexedFaceSet.inl - ../contrib/Open3DGC/o3dgcSC3DMCDecoder.h - ../contrib/Open3DGC/o3dgcSC3DMCDecoder.inl - ../contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h - ../contrib/Open3DGC/o3dgcSC3DMCEncoder.h - ../contrib/Open3DGC/o3dgcSC3DMCEncoder.inl - ../contrib/Open3DGC/o3dgcTimer.h - ../contrib/Open3DGC/o3dgcTools.cpp - ../contrib/Open3DGC/o3dgcTriangleFans.cpp - ../contrib/Open3DGC/o3dgcTriangleFans.h - ../contrib/Open3DGC/o3dgcTriangleListDecoder.h - ../contrib/Open3DGC/o3dgcTriangleListDecoder.inl - ../contrib/Open3DGC/o3dgcTriangleListEncoder.h - ../contrib/Open3DGC/o3dgcTriangleListEncoder.inl - ../contrib/Open3DGC/o3dgcVector.h - ../contrib/Open3DGC/o3dgcVector.inl -) -SOURCE_GROUP( open3dgc FILES ${open3dgc_SRCS}) + SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} ) +ENDIF(HUNTER_ENABLED) + +# openddlparser +IF(HUNTER_ENABLED) + hunter_add_package(openddlparser) + find_package(openddlparser CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + SET ( openddl_parser_SRCS + ../contrib/openddlparser/code/OpenDDLParser.cpp + ../contrib/openddlparser/code/DDLNode.cpp + ../contrib/openddlparser/code/OpenDDLCommon.cpp + ../contrib/openddlparser/code/OpenDDLExport.cpp + ../contrib/openddlparser/code/Value.cpp + ../contrib/openddlparser/code/OpenDDLStream.cpp + ../contrib/openddlparser/include/openddlparser/OpenDDLParser.h + ../contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h + ../contrib/openddlparser/include/openddlparser/OpenDDLCommon.h + ../contrib/openddlparser/include/openddlparser/OpenDDLExport.h + ../contrib/openddlparser/include/openddlparser/OpenDDLStream.h + ../contrib/openddlparser/include/openddlparser/DDLNode.h + ../contrib/openddlparser/include/openddlparser/Value.h + ) + SOURCE_GROUP( Contrib\\openddl_parser FILES ${openddl_parser_SRCS}) +ENDIF(HUNTER_ENABLED) + +# Open3DGC +IF(HUNTER_ENABLED) + # Nothing to do, not available in Hunter yet. +ELSE(HUNTER_ENABLED) + SET ( open3dgc_SRCS + ../contrib/Open3DGC/o3dgcAdjacencyInfo.h + ../contrib/Open3DGC/o3dgcArithmeticCodec.cpp + ../contrib/Open3DGC/o3dgcArithmeticCodec.h + ../contrib/Open3DGC/o3dgcBinaryStream.h + ../contrib/Open3DGC/o3dgcCommon.h + ../contrib/Open3DGC/o3dgcDVEncodeParams.h + ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp + ../contrib/Open3DGC/o3dgcDynamicVectorDecoder.h + ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp + ../contrib/Open3DGC/o3dgcDynamicVectorEncoder.h + ../contrib/Open3DGC/o3dgcDynamicVector.h + ../contrib/Open3DGC/o3dgcFIFO.h + ../contrib/Open3DGC/o3dgcIndexedFaceSet.h + ../contrib/Open3DGC/o3dgcIndexedFaceSet.inl + ../contrib/Open3DGC/o3dgcSC3DMCDecoder.h + ../contrib/Open3DGC/o3dgcSC3DMCDecoder.inl + ../contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h + ../contrib/Open3DGC/o3dgcSC3DMCEncoder.h + ../contrib/Open3DGC/o3dgcSC3DMCEncoder.inl + ../contrib/Open3DGC/o3dgcTimer.h + ../contrib/Open3DGC/o3dgcTools.cpp + ../contrib/Open3DGC/o3dgcTriangleFans.cpp + ../contrib/Open3DGC/o3dgcTriangleFans.h + ../contrib/Open3DGC/o3dgcTriangleListDecoder.h + ../contrib/Open3DGC/o3dgcTriangleListDecoder.inl + ../contrib/Open3DGC/o3dgcTriangleListEncoder.h + ../contrib/Open3DGC/o3dgcTriangleListEncoder.inl + ../contrib/Open3DGC/o3dgcVector.h + ../contrib/Open3DGC/o3dgcVector.inl + ) + SOURCE_GROUP( Contrib\\open3dgc FILES ${open3dgc_SRCS}) +ENDIF(HUNTER_ENABLED) # Check dependencies for glTF importer with Open3DGC-compression. # RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file # has implementation for different platforms: WIN32, __MACH__ and other ("else" block). FIND_PACKAGE(RT QUIET) -IF (RT_FOUND OR MSVC) +IF (NOT HUNTER_ENABLED AND (RT_FOUND OR MSVC)) SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 ) ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 ) ELSE () SET (open3dgc_SRCS "") - MESSAGE (INFO " RT-extension not found. glTF import/export will be built without Open3DGC-compression.") + MESSAGE (INFO " Hunter enabled or RT-extension not found. glTF import/export will be built without Open3DGC-compression.") #!TODO: off course is better to remove statistics timers from o3dgc codec. Or propose to choose what to use. ENDIF () -INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) -INCLUDE_DIRECTORIES( "../contrib" ) +# RapidJSON +IF(HUNTER_ENABLED) + hunter_add_package(RapidJSON) + find_package(RapidJSON CONFIG REQUIRED) +ELSE(HUNTER_ENABLED) + INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) + INCLUDE_DIRECTORIES( "../contrib" ) +ENDIF(HUNTER_ENABLED) # VC2010 fixes if(MSVC10) @@ -876,19 +1057,27 @@ if ( MSVC ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) endif ( MSVC ) -if (UNZIP_FOUND) - SET (unzip_compile_SRCS "") -else (UNZIP_FOUND) - SET (unzip_compile_SRCS ${unzip_SRCS}) - INCLUDE_DIRECTORIES( "../contrib/unzip/" ) -endif (UNZIP_FOUND) +IF(NOT HUNTER_ENABLED) + if (UNZIP_FOUND) + SET (unzip_compile_SRCS "") + else (UNZIP_FOUND) + SET (unzip_compile_SRCS ${unzip_SRCS}) + INCLUDE_DIRECTORIES( "../contrib/unzip/" ) + endif (UNZIP_FOUND) +ENDIF(NOT HUNTER_ENABLED) -MESSAGE(STATUS "Enabled formats:${ASSIMP_IMPORTERS_ENABLED}") -MESSAGE(STATUS "Disabled formats:${ASSIMP_IMPORTERS_DISABLED}") +MESSAGE(STATUS "Enabled importer formats:${ASSIMP_IMPORTERS_ENABLED}") +MESSAGE(STATUS "Disabled importer formats:${ASSIMP_IMPORTERS_DISABLED}") + +MESSAGE(STATUS "Enabled exporter formats:${ASSIMP_EXPORTERS_ENABLED}") +MESSAGE(STATUS "Disabled exporter formats:${ASSIMP_EXPORTERS_DISABLED}") + +SOURCE_GROUP( include\\assimp FILES ${PUBLIC_HEADERS} ) SET( assimp_src # Assimp Files ${Core_SRCS} + ${CApi_SRCS} ${Common_SRCS} ${Logging_SRCS} ${Exporter_SRCS} @@ -899,6 +1088,7 @@ SET( assimp_src # Model Support ${ASSIMP_LOADER_SRCS} + ${ASSIMP_EXPORTER_SRCS} # Third-party libraries ${IrrXML_SRCS} @@ -912,14 +1102,15 @@ SET( assimp_src ${PUBLIC_HEADERS} ${COMPILER_HEADERS} - ) ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) -INCLUDE_DIRECTORIES( - ${IRRXML_INCLUDE_DIR} - ../contrib/openddlparser/include -) +IF(NOT HUNTER_ENABLED) + INCLUDE_DIRECTORIES( + ${IRRXML_INCLUDE_DIR} + ../contrib/openddlparser/include + ) +ENDIF(NOT HUNTER_ENABLED) IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) SET( assimp_src ${assimp_src} ${C4D_SRCS}) @@ -932,10 +1123,25 @@ ADD_LIBRARY(assimp::assimp ALIAS assimp) TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC $ $ - $ + $ ) -TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} ) +IF(HUNTER_ENABLED) + TARGET_LINK_LIBRARIES(assimp + PUBLIC + polyclipping::polyclipping + irrXML::irrXML + openddlparser::openddl_parser + poly2tri::poly2tri + minizip::minizip + ZLIB::zlib + RapidJSON::rapidjson + utf8::utf8 + zip::zip + ) +ELSE(HUNTER_ENABLED) + TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} ) +ENDIF(HUNTER_ENABLED) if(ASSIMP_ANDROID_JNIIOSYSTEM) set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI) @@ -951,28 +1157,40 @@ ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) if( MSVC ) # in order to prevent DLL hell, each of the DLLs have to be suffixed with the major version and msvc prefix - if( MSVC70 OR MSVC71 ) - set(MSVC_PREFIX "vc70") - elseif( MSVC80 ) - set(MSVC_PREFIX "vc80") - elseif( MSVC90 ) - set(MSVC_PREFIX "vc90") - elseif( MSVC10 ) - set(MSVC_PREFIX "vc100") - elseif( MSVC11 ) - set(MSVC_PREFIX "vc110") - elseif( MSVC12 ) - set(MSVC_PREFIX "vc120") - elseif( MSVC14 ) - set(MSVC_PREFIX "vc140") + # CMake 3.12 added a variable for this + if(MSVC_TOOLSET_VERSION) + set(MSVC_PREFIX "vc${MSVC_TOOLSET_VERSION}") else() - set(MSVC_PREFIX "vc150") + if( MSVC70 OR MSVC71 ) + set(MSVC_PREFIX "vc70") + elseif( MSVC80 ) + set(MSVC_PREFIX "vc80") + elseif( MSVC90 ) + set(MSVC_PREFIX "vc90") + elseif( MSVC10 ) + set(MSVC_PREFIX "vc100") + elseif( MSVC11 ) + set(MSVC_PREFIX "vc110") + elseif( MSVC12 ) + set(MSVC_PREFIX "vc120") + elseif( MSVC_VERSION LESS 1910) + set(MSVC_PREFIX "vc140") + elseif( MSVC_VERSION LESS 1920) + set(MSVC_PREFIX "vc141") + elseif( MSVC_VERSION LESS 1930) + set(MSVC_PREFIX "vc142") + else() + MESSAGE(WARNING "unknown msvc version ${MSVC_VERSION}") + set(MSVC_PREFIX "vc150") + endif() endif() set(LIBRARY_SUFFIX "${ASSIMP_LIBRARY_SUFFIX}-${MSVC_PREFIX}-mt" CACHE STRING "the suffix for the assimp windows library") endif() if (${CMAKE_SYSTEM_NAME} MATCHES "WindowsStore") - set(WindowsStore TRUE) + target_compile_definitions(assimp PUBLIC WindowsStore) + TARGET_LINK_LIBRARIES(assimp advapi32) + #set(WindowsStore TRUE) endif() SET_TARGET_PROPERTIES( assimp PROPERTIES VERSION ${ASSIMP_VERSION} @@ -1005,24 +1223,37 @@ ENDIF(APPLE) # Build against external unzip, or add ../contrib/unzip so # assimp can #include "unzip.h" -if (UNZIP_FOUND) - INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) - TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) -else (UNZIP_FOUND) - INCLUDE_DIRECTORIES("../") -endif (UNZIP_FOUND) +IF(NOT HUNTER_ENABLED) + if (UNZIP_FOUND) + INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) + TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) + else (UNZIP_FOUND) + INCLUDE_DIRECTORIES("../") + endif (UNZIP_FOUND) +ENDIF(NOT HUNTER_ENABLED) # Add RT-extension library for glTF importer with Open3DGC-compression. IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC) TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY}) ENDIF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC) +IF(HUNTER_ENABLED) + INSTALL( TARGETS assimp + EXPORT "${TARGETS_EXPORT_NAME}" + LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} + FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + COMPONENT ${LIBASSIMP_COMPONENT} + INCLUDES DESTINATION "include") +ELSE(HUNTER_ENABLED) INSTALL( TARGETS assimp - LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} - ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} - RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} - FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR} - COMPONENT ${LIBASSIMP_COMPONENT}) + LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} + FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR} + COMPONENT ${LIBASSIMP_COMPONENT}) +ENDIF(HUNTER_ENABLED) INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev) INSTALL( FILES ${COMPILER_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp/Compiler COMPONENT assimp-dev) @@ -1033,6 +1264,16 @@ if (ASSIMP_ANDROID_JNIIOSYSTEM) ENDIF(ASSIMP_ANDROID_JNIIOSYSTEM) if(MSVC AND ASSIMP_INSTALL_PDB) + # When only the static library is built, these properties must + # be set to ensure the static lib .pdb is staged for installation. + IF(NOT BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES( assimp PROPERTIES + COMPILE_PDB_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMPILE_PDB_NAME assimp${LIBRARY_SUFFIX} + COMPILE_PDB_NAME_DEBUG assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX} + ) + ENDIF() + IF(CMAKE_GENERATOR MATCHES "^Visual Studio") install(FILES ${Assimp_BINARY_DIR}/code/Debug/assimp${LIBRARY_SUFFIX}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${ASSIMP_LIB_INSTALL_DIR} diff --git a/Engine/lib/assimp/code/COBLoader.cpp b/Engine/lib/assimp/code/COB/COBLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/COBLoader.cpp rename to Engine/lib/assimp/code/COB/COBLoader.cpp index efb22e08b..19e3cd59e 100644 --- a/Engine/lib/assimp/code/COBLoader.cpp +++ b/Engine/lib/assimp/code/COB/COBLoader.cpp @@ -45,20 +45,22 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_COB_IMPORTER -#include "COBLoader.h" -#include "COBScene.h" -#include "ConvertToLHProcess.h" +#include "COB/COBLoader.h" +#include "COB/COBScene.h" +#include "PostProcessing/ConvertToLHProcess.h" + #include #include #include #include #include -#include #include #include #include #include +#include + using namespace Assimp; using namespace Assimp::COB; using namespace Assimp::Formatter; @@ -144,7 +146,7 @@ void COBImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS // check header char head[32]; stream->CopyAndAdvance(head,32); - if (strncmp(head,"Caligari ",9)) { + if (strncmp(head,"Caligari ",9) != 0) { ThrowException("Could not found magic id: `Caligari`"); } @@ -656,14 +658,14 @@ void COBImporter::ReadLght_Ascii(Scene& out, LineSplitter& splitter, const Chunk ReadFloat3Tuple_Ascii(msh.color ,&rgb); SkipSpaces(&rgb); - if (strncmp(rgb,"cone angle",10)) { + if (strncmp(rgb,"cone angle",10) != 0) { ASSIMP_LOG_WARN_F( "Expected `cone angle` entity in `color` line in `Lght` chunk ", nfo.id ); } SkipSpaces(rgb+10,&rgb); msh.angle = fast_atof(&rgb); SkipSpaces(&rgb); - if (strncmp(rgb,"inner angle",11)) { + if (strncmp(rgb,"inner angle",11) != 0) { ASSIMP_LOG_WARN_F( "Expected `inner angle` entity in `color` line in `Lght` chunk ", nfo.id); } SkipSpaces(rgb+11,&rgb); @@ -896,6 +898,7 @@ public: : nfo(nfo) , reader(reader) , cur(reader.GetCurrentPos()) { + // empty } ~chunk_guard() { @@ -903,7 +906,7 @@ public: if(nfo.size != static_cast(-1)) { try { reader.IncPtr( static_cast< int >( nfo.size ) - reader.GetCurrentPos() + cur ); - } catch ( DeadlyImportError e ) { + } catch (const DeadlyImportError& ) { // out of limit so correct the value reader.IncPtr( reader.GetReadLimit() ); } @@ -911,15 +914,17 @@ public: } private: - const COB::ChunkInfo& nfo; StreamReaderLE& reader; long cur; }; // ------------------------------------------------------------------------------------------------ -void COBImporter::ReadBinaryFile(Scene& out, StreamReaderLE* reader) -{ +void COBImporter::ReadBinaryFile(Scene& out, StreamReaderLE* reader) { + if (nullptr == reader) { + return; + } + while(1) { std::string type; type += reader -> GetI1() @@ -1214,7 +1219,7 @@ void COBImporter::ReadGrou_Binary(COB::Scene& out, StreamReaderLE& reader, const const chunk_guard cn(nfo,reader); - out.nodes.push_back(std::shared_ptr(new Group())); + out.nodes.push_back(std::make_shared()); Group& msh = (Group&)(*out.nodes.back().get()); msh = nfo; diff --git a/Engine/lib/assimp/code/COBLoader.h b/Engine/lib/assimp/code/COB/COBLoader.h similarity index 100% rename from Engine/lib/assimp/code/COBLoader.h rename to Engine/lib/assimp/code/COB/COBLoader.h diff --git a/Engine/lib/assimp/code/COBScene.h b/Engine/lib/assimp/code/COB/COBScene.h similarity index 100% rename from Engine/lib/assimp/code/COBScene.h rename to Engine/lib/assimp/code/COB/COBScene.h diff --git a/Engine/lib/assimp/code/CSMLoader.cpp b/Engine/lib/assimp/code/CSM/CSMLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/CSMLoader.cpp rename to Engine/lib/assimp/code/CSM/CSMLoader.cpp diff --git a/Engine/lib/assimp/code/CSMLoader.h b/Engine/lib/assimp/code/CSM/CSMLoader.h similarity index 100% rename from Engine/lib/assimp/code/CSMLoader.h rename to Engine/lib/assimp/code/CSM/CSMLoader.h diff --git a/Engine/lib/assimp/code/ColladaExporter.cpp b/Engine/lib/assimp/code/Collada/ColladaExporter.cpp similarity index 85% rename from Engine/lib/assimp/code/ColladaExporter.cpp rename to Engine/lib/assimp/code/Collada/ColladaExporter.cpp index 37a6ba4e0..a93dfa59a 100644 --- a/Engine/lib/assimp/code/ColladaExporter.cpp +++ b/Engine/lib/assimp/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 @@ -64,13 +65,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; -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*/) -{ +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)); @@ -93,15 +92,45 @@ void ExportSceneCollada(const char* pFile, IOSystem* pIOSystem, const aiScene* p } // 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) -{ +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(16); + mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); mScene = pScene; mSceneOwned = false; @@ -115,17 +144,15 @@ ColladaExporter::ColladaExporter( const aiScene* pScene, IOSystem* pIOSystem, co // ------------------------------------------------------------------------------------------------ // Destructor -ColladaExporter::~ColladaExporter() -{ - if(mSceneOwned) { +ColladaExporter::~ColladaExporter() { + if ( mSceneOwned ) { delete mScene; } } // ------------------------------------------------------------------------------------------------ // Starts writing the contents -void ColladaExporter::WriteFile() -{ +void ColladaExporter::WriteFile() { // write the DTD mOutput << "" << endstr; // COLLADA element start @@ -149,7 +176,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->mName.C_Str()) + "\" />" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -158,9 +185,8 @@ void ColladaExporter::WriteFile() // ------------------------------------------------------------------------------------------------ // Writes the asset header -void ColladaExporter::WriteHeader() -{ - static const ai_real epsilon = ai_real( 0.00001 ); +void ColladaExporter::WriteHeader() { + static const ai_real epsilon = Math::getEpsilon(); static const aiQuaternion x_rot(aiMatrix3x3( 0, -1, 0, 1, 0, 0, @@ -238,25 +264,64 @@ void ColladaExporter::WriteHeader() mOutput << startstr << "" << endstr; PushTag(); - aiMetadata* meta = mScene->mRootNode->mMetaData; + // 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)) + if (!meta || !meta->Get("Author", value)) { mOutput << startstr << "" << "Assimp" << "" << endstr; - else + } else { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + } - if (!meta || !meta->Get("AuthoringTool", value)) + if (nullptr == meta || !meta->Get("AuthoringTool", value)) { mOutput << startstr << "" << "Assimp Exporter" << "" << endstr; - else + } else { mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + } - //mOutput << startstr << "" << mScene->author.C_Str() << "" << endstr; - //mOutput << startstr << "" << mScene->authoringTool.C_Str() << "" << endstr; + if (meta) { + if (meta->Get("Comments", value)) { + mOutput << startstr << "" << XMLEscape(value.C_Str()) << "" << endstr; + } + if (meta->Get("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; - mOutput << startstr << "" << date_str << "" << 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(); @@ -269,18 +334,21 @@ void ColladaExporter::WriteTextures() { static const unsigned int buffer_size = 1024; char str[buffer_size]; - if(mScene->HasTextures()) { + 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 + name, "wb")); + std::unique_ptr outfile(mIOSystem->Open(mPath + mIOSystem->getOsSeparator() + name, "wb")); if(outfile == NULL) { throw DeadlyExportError("could not open output texture file: " + mPath + name); } @@ -318,9 +386,10 @@ void ColladaExporter::WriteCamerasLibrary() { void ColladaExporter::WriteCamera(size_t pIndex){ const aiCamera *cam = mScene->mCameras[pIndex]; - const std::string idstrEscaped = XMLEscape(cam->mName.C_Str()); + const std::string cameraName = XMLEscape(cam->mName.C_Str()); + const std::string cameraId = XMLIDEncode(cam->mName.C_Str()); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); @@ -374,10 +443,11 @@ void ColladaExporter::WriteLightsLibrary() { void ColladaExporter::WriteLight(size_t pIndex){ const aiLight *light = mScene->mLights[pIndex]; - const std::string idstrEscaped = XMLEscape(light->mName.C_Str()); + const std::string lightName = XMLEscape(light->mName.C_Str()); + const std::string lightId = XMLIDEncode(light->mName.C_Str()); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); @@ -428,6 +498,7 @@ void ColladaExporter::WritePointLight(const aiLight *const light){ mOutput << startstr << "" << endstr; } + void ColladaExporter::WriteDirectionalLight(const aiLight *const light){ const aiColor3D &color= light->mColorDiffuse; mOutput << startstr << "" << endstr; @@ -440,6 +511,7 @@ void ColladaExporter::WriteDirectionalLight(const aiLight *const light){ mOutput << startstr << "" << endstr; } + void ColladaExporter::WriteSpotLight(const aiLight *const light){ const aiColor3D &color= light->mColorDiffuse; @@ -496,18 +568,16 @@ 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 ) - { +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] == '*') - { + if(index_str.size() != 0 && index_str[0] == '*') { unsigned int index; index_str = index_str.substr(1, std::string::npos); @@ -525,15 +595,13 @@ void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* } else { throw DeadlyExportError("could not find embedded texture at index " + index_str); } - } else - { + } else { poSurface.texture = texfile.C_Str(); } poSurface.channel = uvChannel; poSurface.exist = true; - } else - { + } else { if( pKey ) poSurface.exist = pSrcMat->Get( pKey, static_cast(pType), static_cast(pIndex), poSurface.color) == aiReturn_SUCCESS; } @@ -541,18 +609,16 @@ void ColladaExporter::ReadMaterialSurface( Surface& poSurface, const aiMaterial* // ------------------------------------------------------------------------------------------------ // Reimplementation of isalnum(,C locale), because AppVeyor does not see standard version. -static bool isalnum_C(char c) -{ +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) -{ +void ColladaExporter::WriteImageEntry( const Surface& pSurface, const std::string& pNameAdd) { if( !pSurface.texture.empty() ) { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << ""; @@ -585,7 +651,7 @@ void ColladaExporter::WriteTextureColorEntry( const Surface& pSurface, const std } else { - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; } PopTag(); mOutput << startstr << "" << endstr; @@ -599,21 +665,21 @@ void ColladaExporter::WriteTextureParamEntry( const Surface& pSurface, const std // 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 << "" << XMLEscape(pMatName) << "-" << pTypeName << "-image" << endstr; + mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-image" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << XMLEscape(pMatName) << "-" << pTypeName << "-surface" << endstr; + mOutput << startstr << "" << XMLIDEncode(pMatName) << "-" << pTypeName << "-surface" << endstr; PopTag(); mOutput << startstr << "" << endstr; PopTag(); @@ -665,11 +731,6 @@ void ColladaExporter::WriteMaterials() materials[a].name = std::string(name.C_Str()) + to_string(materialCountWithThisName); } } - for( std::string::iterator it = materials[a].name.begin(); it != materials[a].name.end(); ++it ) { - if( !isalnum_C( *it ) ) { - *it = '_'; - } - } aiShadingMode shading = aiShadingMode_Flat; materials[a].shading_model = "phong"; @@ -734,7 +795,7 @@ void ColladaExporter::WriteMaterials() { const Material& mat = *it; // this is so ridiculous it must be right - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; PushTag(); @@ -785,9 +846,9 @@ void ColladaExporter::WriteMaterials() 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; } @@ -803,8 +864,9 @@ void ColladaExporter::WriteControllerLibrary() mOutput << startstr << "" << endstr; PushTag(); - for( size_t a = 0; a < mScene->mNumMeshes; ++a) + for( size_t a = 0; a < mScene->mNumMeshes; ++a) { WriteController( a); + } PopTag(); mOutput << startstr << "" << endstr; @@ -815,8 +877,8 @@ void ColladaExporter::WriteControllerLibrary() void ColladaExporter::WriteController( size_t pIndex) { const aiMesh* mesh = mScene->mMeshes[pIndex]; - const std::string idstr = GetMeshId( pIndex); - const std::string idstrEscaped = XMLEscape(idstr); + 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; @@ -851,7 +913,7 @@ void ColladaExporter::WriteController( size_t pIndex) mOutput << startstr << "mNumBones << "\">"; for( size_t i = 0; i < mesh->mNumBones; ++i ) - mOutput << XMLEscape(mesh->mBones[i]->mName.C_Str()) << " "; + mOutput << XMLIDEncode(mesh->mBones[i]->mName.C_Str()) << " "; mOutput << "" << endstr; @@ -986,14 +1048,15 @@ void ColladaExporter::WriteGeometryLibrary() void ColladaExporter::WriteGeometry( size_t pIndex) { const aiMesh* mesh = mScene->mMeshes[pIndex]; - const std::string idstr = GetMeshId( pIndex); - const std::string idstrEscaped = XMLEscape(idstr); + 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; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; @@ -1024,9 +1087,9 @@ void ColladaExporter::WriteGeometry( size_t pIndex) // 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; + mOutput << startstr << "" << endstr; PopTag(); mOutput << startstr << "" << endstr; @@ -1044,18 +1107,18 @@ void ColladaExporter::WriteGeometry( size_t pIndex) { mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; if( mesh->HasNormals() ) - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) { if( mesh->HasTextureCoords(static_cast(a)) ) - mOutput << startstr << "" << endstr; + 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 << "" << endstr; } mOutput << startstr << "

"; @@ -1078,18 +1141,18 @@ void ColladaExporter::WriteGeometry( size_t pIndex) { mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; if( mesh->HasNormals() ) - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) { if( mesh->HasTextureCoords(static_cast(a)) ) - mOutput << startstr << "" << endstr; + 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 << "" << endstr; } mOutput << startstr << ""; @@ -1138,13 +1201,13 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy return; } - std::string arrayId = pIdString + "-array"; + std::string arrayId = XMLIDEncode(pIdString) + "-array"; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); // source array - mOutput << startstr << " "; + mOutput << startstr << " "; PushTag(); if( pType == FloatType_TexCoord2 ) @@ -1230,11 +1293,12 @@ void ColladaExporter::WriteFloatArray( const std::string& pIdString, FloatDataTy // Writes the scene library void ColladaExporter::WriteSceneLibrary() { - const std::string scene_name_escaped = XMLEscape(mScene->mRootNode->mName.C_Str()); + 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; + mOutput << startstr << "" << endstr; PushTag(); // start recursive write at the root node @@ -1265,7 +1329,7 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) idstr = idstr + ending; } - const std::string idstrEscaped = XMLEscape(idstr); + const std::string idstrEscaped = XMLIDEncode(idstr); mOutput << startstr << "" << endstr; PushTag(); @@ -1337,13 +1401,13 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) } const std::string node_idstr = nodeAnim->mNodeName.data + std::string("_matrix-interpolation"); - std::string arrayId = node_idstr + "-array"; + std::string arrayId = XMLIDEncode(node_idstr) + "-array"; - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); // source array - mOutput << startstr << " "; + mOutput << startstr << " "; for( size_t a = 0; a < names.size(); ++a ) { mOutput << names[a] << " "; } @@ -1352,7 +1416,7 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "" << endstr; + mOutput << startstr << "" << endstr; PushTag(); mOutput << startstr << "" << endstr; @@ -1374,12 +1438,12 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) { // samplers const std::string node_idstr = nodeAnim->mNodeName.data + std::string("_matrix-sampler"); - mOutput << startstr << "" << endstr; + 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; + 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; @@ -1391,7 +1455,7 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) { // channels - mOutput << startstr << "mNodeName.data + std::string("_matrix-sampler") ) << "\" target=\"" << XMLEscape(nodeAnim->mNodeName.data) << "/matrix\"/>" << endstr; + mOutput << startstr << "mNodeName.data + std::string("_matrix-sampler") ) << "\" target=\"" << XMLIDEncode(nodeAnim->mNodeName.data) << "/matrix\"/>" << endstr; } } @@ -1402,8 +1466,6 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex) // ------------------------------------------------------------------------------------------------ void ColladaExporter::WriteAnimationsLibrary() { - const std::string scene_name_escaped = XMLEscape(mScene->mRootNode->mName.C_Str()); - if ( mScene->mNumAnimations > 0 ) { mOutput << startstr << "" << endstr; PushTag(); @@ -1511,16 +1573,17 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) } } - const std::string node_name_escaped = XMLEscape(pNode->mName.data); + const std::string node_id = XMLIDEncode(pNode->mName.data); + const std::string node_name = XMLEscape(pNode->mName.data); mOutput << startstr << "" << endstr; PushTag(); @@ -1559,14 +1622,14 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) //check if it is a camera node for(size_t i=0; imNumCameras; 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; imNumLights; i++){ if(mScene->mLights[i]->mName == pNode->mName){ - mOutput << startstr <<"" << endstr; + mOutput << startstr <<"" << endstr; break; } } @@ -1580,15 +1643,17 @@ 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(); + if( mesh->mNumBones == 0 ) { - mOutput << startstr << "mMeshes[a])) << "\">" << endstr; + mOutput << startstr << "" << endstr; PushTag(); } else { mOutput << startstr - << "mMeshes[a])) << "-skin\">" + << "" << endstr; PushTag(); @@ -1596,7 +1661,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) // use the first bone to find skeleton root const aiNode * skeletonRootBoneNode = findSkeletonRootNode( pScene, mesh ); if ( skeletonRootBoneNode ) { - mFoundSkeletonRootNodeID = XMLEscape( skeletonRootBoneNode->mName.C_Str() ); + mFoundSkeletonRootNodeID = XMLIDEncode( skeletonRootBoneNode->mName.C_Str() ); } mOutput << startstr << "#" << mFoundSkeletonRootNodeID << "" << endstr; } @@ -1604,7 +1669,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) PushTag(); mOutput << startstr << "" << endstr; PushTag(); - mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; + mOutput << startstr << "mMaterialIndex].name) << "\">" << endstr; PushTag(); for( size_t a = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a ) { diff --git a/Engine/lib/assimp/code/ColladaExporter.h b/Engine/lib/assimp/code/Collada/ColladaExporter.h similarity index 99% rename from Engine/lib/assimp/code/ColladaExporter.h rename to Engine/lib/assimp/code/Collada/ColladaExporter.h index 8244b61aa..0b4fa59a3 100644 --- a/Engine/lib/assimp/code/ColladaExporter.h +++ b/Engine/lib/assimp/code/Collada/ColladaExporter.h @@ -150,7 +150,6 @@ public: /// Stringstream to write all output into std::stringstream mOutput; -protected: /// The IOSystem for output IOSystem* mIOSystem; @@ -204,7 +203,7 @@ protected: std::map textures; -protected: +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); diff --git a/Engine/lib/assimp/code/ColladaHelper.h b/Engine/lib/assimp/code/Collada/ColladaHelper.h similarity index 99% rename from Engine/lib/assimp/code/ColladaHelper.h rename to Engine/lib/assimp/code/Collada/ColladaHelper.h index ffab6226d..b7d47da15 100644 --- a/Engine/lib/assimp/code/ColladaHelper.h +++ b/Engine/lib/assimp/code/Collada/ColladaHelper.h @@ -580,15 +580,11 @@ struct Image { std::string mFileName; - /** If image file name is zero, embedded image data - */ + /** Embedded image data */ std::vector mImageData; - /** If image file name is zero, file format of - * embedded image data. - */ + /** File format hint of embedded image data */ std::string mEmbeddedFormat; - }; /** An animation channel. */ diff --git a/Engine/lib/assimp/code/ColladaLoader.cpp b/Engine/lib/assimp/code/Collada/ColladaLoader.cpp similarity index 60% rename from Engine/lib/assimp/code/ColladaLoader.cpp rename to Engine/lib/assimp/code/Collada/ColladaLoader.cpp index 6837dca4a..37529bc98 100644 --- a/Engine/lib/assimp/code/ColladaLoader.cpp +++ b/Engine/lib/assimp/code/Collada/ColladaLoader.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -43,7 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Implementation of the Collada loader */ - #ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER #include "ColladaLoader.h" @@ -60,13 +57,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include "time.h" #include "math.h" #include #include +#include -using namespace Assimp; +namespace Assimp { + using namespace Assimp::Formatter; static const aiImporterDesc desc = { @@ -74,30 +74,30 @@ static const aiImporterDesc desc = { "", "", "http://collada.org", - aiImporterFlags_SupportTextFlavour, + aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportCompressedFlavour, 1, 3, 1, 5, - "dae" + "dae zae" }; // ------------------------------------------------------------------------------------------------ // 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 ) { + : mFileName() + , mMeshIndexByID() + , mMaterialIndexByName() + , mMeshes() + , newMats() + , mCameras() + , mLights() + , mTextures() + , mAnims() + , noSkeletonMesh(false) + , ignoreUpDirection(false) + , useColladaName(false) + , mNodeNameCounter(0) { // empty } @@ -109,16 +109,27 @@ 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 - std::string extension = GetExtension(pFile); + const std::string extension = GetExtension(pFile); - if (extension == "dae") { - return true; + bool readSig = checkSig && (pIOHandler != nullptr); + + if (!readSig) { + if (extension == "dae" || extension == "zae") { + return true; + } + } + + if (readSig) { + // Look for a DAE file inside, but don't extract it + ZipArchiveIOSystem zip_archive(pIOHandler, pFile); + if (zip_archive.isOpen()) + return !ColladaParser::ReadZaeManifest(zip_archive).empty(); } // XML - too generic, we need to open the file and search for typical keywords - if( extension == "xml" || !extension.length() || checkSig) { + if (extension == "xml" || !extension.length() || checkSig) { /* If CanRead() is called in order to check whether we * support a specific file extension in general pIOHandler * might be NULL and it's our duty to return true here. @@ -126,31 +137,29 @@ bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, boo if (!pIOHandler) { return true; } - 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; +void ColladaLoader::SetupProperties(const Importer* pImp) { + noSkeletonMesh = pImp->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; } // ------------------------------------------------------------------------------------------------ // 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 @@ -165,66 +174,82 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I mAnims.clear(); // parse the input file - ColladaParser parser( pIOHandler, pFile); + ColladaParser parser(pIOHandler, pFile); - if( !parser.mRootNode) + + 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()*2); - mMeshes.reserve(parser.mMeshLibrary.size()*2); + newMats.reserve(parser.mMaterialLibrary.size()*2u); + mMeshes.reserve(parser.mMeshLibrary.size()*2u); mCameras.reserve(parser.mCameraLibrary.size()); mLights.reserve(parser.mLightLibrary.size()); // create the materials first, for the meshes to find - BuildMaterials( parser, pScene); + BuildMaterials(parser, pScene); // build the node hierarchy from it - pScene->mRootNode = BuildHierarchy( parser, parser.mRootNode); + pScene->mRootNode = BuildHierarchy(parser, parser.mRootNode); // ... then fill the materials with the now adjusted settings FillMaterials(parser, pScene); // 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 ) { - // Convert to Y_UP, if different orientation - 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) - pScene->mRootNode->mTransformation *= aiMatrix4x4( - 1, 0, 0, 0, - 0, 0, 1, 0, - 0, -1, 0, 0, - 0, 0, 0, 1); + // Convert to Y_UP, if different orientation + 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) { + pScene->mRootNode->mTransformation *= aiMatrix4x4( + 1, 0, 0, 0, + 0, 0, 1, 0, + 0, -1, 0, 0, + 0, 0, 0, 1); + } + } + + // Store scene metadata + if (!parser.mAssetMetaData.empty()) { + const size_t numMeta(parser.mAssetMetaData.size()); + pScene->mMetaData = aiMetadata::Alloc(static_cast(numMeta)); + size_t i = 0; + for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it, ++i) { + pScene->mMetaData->Set(static_cast(i), (*it).first, (*it).second); + } } // store all meshes - StoreSceneMeshes( pScene); + StoreSceneMeshes(pScene); // store all materials - StoreSceneMaterials( pScene); + StoreSceneMaterials(pScene); + + // store all textures + StoreSceneTextures(pScene); // store all lights - StoreSceneLights( pScene); + StoreSceneLights(pScene); // store all cameras - StoreSceneCameras( pScene); + StoreSceneCameras(pScene); // store all animations - StoreAnimations( pScene, parser); - + StoreAnimations(pScene, parser); // If no meshes have been loaded, it's probably just an animated skeleton. - if (!pScene->mNumMeshes) { + if ( 0u == pScene->mNumMeshes) { if (!noSkeletonMesh) { SkeletonMeshBuilder hero(pScene); @@ -235,60 +260,56 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I // ------------------------------------------------------------------------------------------------ // 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(); // find a name for the new node. It's more complicated than you might think - node->mName.Set( FindNameForNode( pNode)); + node->mName.Set(FindNameForNode(pNode)); // calculate the transformation matrix for it - node->mTransformation = pParser.CalculateResultTransform( pNode->mTransforms); + node->mTransformation = pParser.CalculateResultTransform(pNode->mTransforms); // now resolve node instances std::vector instances; - ResolveNodeInstances(pParser,pNode,instances); + ResolveNodeInstances(pParser, pNode, instances); // add children. first the *real* ones - node->mNumChildren = static_cast(pNode->mChildren.size()+instances.size()); + node->mNumChildren = static_cast(pNode->mChildren.size() + instances.size()); node->mChildren = new aiNode*[node->mNumChildren]; - for( size_t a = 0; a < pNode->mChildren.size(); a++) - { - node->mChildren[a] = BuildHierarchy( pParser, pNode->mChildren[a]); + for (size_t a = 0; a < pNode->mChildren.size(); ++a) { + node->mChildren[a] = BuildHierarchy(pParser, pNode->mChildren[a]); node->mChildren[a]->mParent = node; } // ... and finally the resolved node instances - for( size_t a = 0; a < instances.size(); a++) - { - node->mChildren[pNode->mChildren.size() + a] = BuildHierarchy( pParser, instances[a]); + for (size_t a = 0; a < instances.size(); ++a) { + node->mChildren[pNode->mChildren.size() + a] = BuildHierarchy(pParser, instances[a]); node->mChildren[pNode->mChildren.size() + a]->mParent = node; } // construct meshes - BuildMeshesForNode( pParser, pNode, node); + BuildMeshesForNode(pParser, pNode, node); // construct cameras BuildCamerasForNode(pParser, pNode, node); // construct lights BuildLightsForNode(pParser, pNode, node); + return node; } // ------------------------------------------------------------------------------------------------ // 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()); // ... and iterate through all nodes to be instanced as children of pNode - for (const auto &nodeInst: pNode->mNodeInstances) - { + 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; @@ -296,13 +317,12 @@ void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Co // 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, // the workaround is only enabled when the first attempt to resolve the node has failed. - if (!nd) { + if (nullptr == nd) { nd = FindNode(pParser.mRootNode, nodeInst.mNode); } - if (!nd) + if (nullptr == nd) { ASSIMP_LOG_ERROR_F("Collada: Unable to resolve reference to instanced node ", nodeInst.mNode); - - else { + } else { // attach this node to the list of children resolved.push_back(nd); } @@ -312,12 +332,13 @@ void ColladaLoader::ResolveNodeInstances( const ColladaParser& pParser, const Co // ------------------------------------------------------------------------------------------------ // Resolve UV channels 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) + if (it->second.mType != Collada::IT_Texcoord) { ASSIMP_LOG_ERROR("Collada: Unexpected effect input mapping"); + } sampler.mUVId = it->second.mSet; } @@ -325,15 +346,12 @@ 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."); + 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; @@ -344,7 +362,7 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll out->mType = (aiLightSourceType)srcLight->mType; // collada lights point in -Z by default, rest is specified in node transform - out->mDirection = aiVector3D(0.f,0.f,-1.f); + out->mDirection = aiVector3D(0.f, 0.f, -1.f); out->mAttenuationConstant = srcLight->mAttConstant; out->mAttenuationLinear = srcLight->mAttLinear; @@ -363,27 +381,26 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll // convert falloff angle and falloff exponent in our representation, if given if (out->mType == aiLightSource_SPOT) { - - out->mAngleInnerCone = AI_DEG_TO_RAD( srcLight->mFalloffAngle ); + out->mAngleInnerCone = AI_DEG_TO_RAD(srcLight->mFalloffAngle); // ... some extension magic. - if (srcLight->mOuterAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f)) - { + if (srcLight->mOuterAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET * (1 - 1e-6f)) { // ... some deprecation magic. - if (srcLight->mPenumbraAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET*(1-1e-6f)) - { + if (srcLight->mPenumbraAngle >= ASSIMP_COLLADA_LIGHT_ANGLE_NOT_SET * (1 - 1e-6f)) { // 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; + out->mAngleOuterCone = std::acos(std::pow(0.1f, 1.f / srcLight->mFalloffExponent)) + + out->mAngleInnerCone; } else { - out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD( srcLight->mPenumbraAngle ); + out->mAngleOuterCone = out->mAngleInnerCone + AI_DEG_TO_RAD(srcLight->mPenumbraAngle); if (out->mAngleOuterCone < out->mAngleInnerCone) - std::swap(out->mAngleInnerCone,out->mAngleOuterCone); + std::swap(out->mAngleInnerCone, out->mAngleOuterCone); } } - else out->mAngleOuterCone = AI_DEG_TO_RAD( srcLight->mOuterAngle ); + else { + out->mAngleOuterCone = AI_DEG_TO_RAD(srcLight->mOuterAngle); + } } // add to light list @@ -393,15 +410,12 @@ void ColladaLoader::BuildLightsForNode( const ColladaParser& pParser, const Coll // ------------------------------------------------------------------------------------------------ // 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."); + 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; @@ -416,7 +430,7 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col out->mName = pTarget->mName; // collada cameras point in -Z by default, rest is specified in node transform - out->mLookAt = aiVector3D(0.f,0.f,-1.f); + out->mLookAt = aiVector3D(0.f, 0.f, -1.f); // near/far z is already ok out->mClipPlaneFar = srcCamera->mZFar; @@ -424,8 +438,9 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col // ... but for the rest some values are optional // and we need to compute the others in any combination. - if (srcCamera->mAspect != 10e10f) + if (srcCamera->mAspect != 10e10f) { out->mAspect = srcCamera->mAspect; + } if (srcCamera->mHorFov != 10e10f) { out->mHorizontalFOV = srcCamera->mHorFov; @@ -434,8 +449,8 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col out->mAspect = std::tan(AI_DEG_TO_RAD(srcCamera->mHorFov)) / 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))); } @@ -450,206 +465,194 @@ void ColladaLoader::BuildCamerasForNode( const ColladaParser& pParser, const Col // ------------------------------------------------------------------------------------------------ // 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 = NULL; - const Collada::Controller* srcController = NULL; + 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); - if( srcMeshIt == pParser.mMeshLibrary.end()) - { + ColladaParser::MeshLibrary::const_iterator srcMeshIt = pParser.mMeshLibrary.find(mid.mMeshOrController); + if (srcMeshIt == pParser.mMeshLibrary.end()) { // if not found in the mesh-library, it might also be a controller referring to a mesh - ColladaParser::ControllerLibrary::const_iterator srcContrIt = pParser.mControllerLibrary.find( mid.mMeshOrController); - if( srcContrIt != pParser.mControllerLibrary.end()) - { + ColladaParser::ControllerLibrary::const_iterator srcContrIt = pParser.mControllerLibrary.find(mid.mMeshOrController); + if (srcContrIt != pParser.mControllerLibrary.end()) { srcController = &srcContrIt->second; - srcMeshIt = pParser.mMeshLibrary.find( srcController->mMeshId); - if( srcMeshIt != pParser.mMeshLibrary.end()) + srcMeshIt = pParser.mMeshLibrary.find(srcController->mMeshId); + if (srcMeshIt != pParser.mMeshLibrary.end()) { srcMesh = srcMeshIt->second; + } } - if( !srcMesh) - { + + 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; } // build a mesh for each of its subgroups size_t vertexStart = 0, faceStart = 0; - for( size_t sm = 0; sm < srcMesh->mSubMeshes.size(); ++sm) - { + for (size_t sm = 0; sm < srcMesh->mSubMeshes.size(); ++sm) { const Collada::SubMesh& submesh = srcMesh->mSubMeshes[sm]; - if( submesh.mNumFaces == 0) + 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 = NULL; - if( meshMatIt != mid.mMaterials.end()) - { + const Collada::SemanticMappingTable* table = nullptr; + if (meshMatIt != mid.mMaterials.end()) { table = &meshMatIt->second; meshMaterial = table->mMatName; } - else - { - ASSIMP_LOG_WARN_F( "Collada: No material specified for subgroup <", submesh.mMaterial, "> in geometry <", - mid.mMeshOrController, ">." ); - if( !mid.mMaterials.empty() ) + else { + ASSIMP_LOG_WARN_F("Collada: No material specified for subgroup <", submesh.mMaterial, "> in geometry <", + mid.mMeshOrController, ">."); + if (!mid.mMaterials.empty()) { meshMaterial = mid.mMaterials.begin()->second.mMatName; + } } // OK ... here the *real* fun starts ... we have the vertex-input-to-effect-semantic-table // given. The only mapping stuff which we do actually support is the UV channel. - std::map::const_iterator matIt = mMaterialIndexByName.find( meshMaterial); - unsigned int matIdx; - if( matIt != mMaterialIndexByName.end()) + std::map::const_iterator matIt = mMaterialIndexByName.find(meshMaterial); + unsigned int matIdx = 0; + if (matIt != mMaterialIndexByName.end()) { matIdx = static_cast(matIt->second); - else - matIdx = 0; + } - if (table && !table->mMap.empty() ) { + if (table && !table->mMap.empty()) { std::pair& mat = newMats[matIdx]; // Iterate through all texture channels assigned to the effect and // check whether we have mapping information for it. - ApplyVertexToEffectSemanticMapping(mat.first->mTexDiffuse, *table); - ApplyVertexToEffectSemanticMapping(mat.first->mTexAmbient, *table); - ApplyVertexToEffectSemanticMapping(mat.first->mTexSpecular, *table); - ApplyVertexToEffectSemanticMapping(mat.first->mTexEmissive, *table); - ApplyVertexToEffectSemanticMapping(mat.first->mTexTransparent,*table); - ApplyVertexToEffectSemanticMapping(mat.first->mTexBump, *table); + ApplyVertexToEffectSemanticMapping(mat.first->mTexDiffuse, *table); + ApplyVertexToEffectSemanticMapping(mat.first->mTexAmbient, *table); + ApplyVertexToEffectSemanticMapping(mat.first->mTexSpecular, *table); + ApplyVertexToEffectSemanticMapping(mat.first->mTexEmissive, *table); + ApplyVertexToEffectSemanticMapping(mat.first->mTexTransparent, *table); + ApplyVertexToEffectSemanticMapping(mat.first->mTexBump, *table); } // built lookup index of the Mesh-Submesh-Material combination - ColladaMeshIndex index( mid.mMeshOrController, sm, meshMaterial); + ColladaMeshIndex index(mid.mMeshOrController, sm, meshMaterial); // if we already have the mesh at the library, just add its index to the node's array - std::map::const_iterator dstMeshIt = mMeshIndexByID.find( index); - if( dstMeshIt != mMeshIndexByID.end()) { - newMeshRefs.push_back( dstMeshIt->second); + 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()); + newMeshRefs.push_back(mMeshes.size()); mMeshIndexByID[index] = mMeshes.size(); - mMeshes.push_back( dstMesh); + mMeshes.push_back(dstMesh); vertexStart += dstMesh->mNumVertices; faceStart += submesh.mNumFaces; // assign the material index dstMesh->mMaterialIndex = matIdx; - if(dstMesh->mName.length == 0) - { + if (dstMesh->mName.length == 0) { dstMesh->mName = mid.mMeshOrController; } - } + } } } // now place all mesh references we gathered in the target node pTarget->mNumMeshes = static_cast(newMeshRefs.size()); - if( newMeshRefs.size()) - { - struct UIntTypeConverter - { - unsigned int operator()(const size_t& v) const - { + if (newMeshRefs.size()) { + struct UIntTypeConverter { + unsigned int operator()(const size_t& v) const { return static_cast(v); } }; pTarget->mMeshes = new unsigned int[pTarget->mNumMeshes]; - std::transform( newMeshRefs.begin(), newMeshRefs.end(), pTarget->mMeshes, UIntTypeConverter()); + std::transform(newMeshRefs.begin(), newMeshRefs.end(), pTarget->mMeshes, UIntTypeConverter()); } } // ------------------------------------------------------------------------------------------------ // Find mesh from either meshes or morph target meshes -aiMesh *ColladaLoader::findMesh(std::string meshid) -{ - for (unsigned int i = 0; i < mMeshes.size(); i++) - if (std::string(mMeshes[i]->mName.data) == 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]; + } + } - for (unsigned int i = 0; i < mTargetMeshes.size(); i++) - if (std::string(mTargetMeshes[i]->mName.data) == meshid) + for (unsigned int i = 0; i < mTargetMeshes.size(); ++i) { + if (std::string(mTargetMeshes[i]->mName.data) == meshid) { return mTargetMeshes[i]; + } + } - return NULL; + return nullptr; } // ------------------------------------------------------------------------------------------------ // 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* dstMesh = new aiMesh; +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, + const size_t numVertices = std::accumulate(pSrcMesh->mFaceSize.begin() + pStartFace, 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() + + 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) - { + if (pSrcMesh->mNormals.size() >= pStartVertex + numVertices) { dstMesh->mNormals = new aiVector3D[numVertices]; - std::copy( pSrcMesh->mNormals.begin() + pStartVertex, pSrcMesh->mNormals.begin() + + std::copy(pSrcMesh->mNormals.begin() + pStartVertex, pSrcMesh->mNormals.begin() + pStartVertex + numVertices, dstMesh->mNormals); } // tangents, if given. - if( pSrcMesh->mTangents.size() >= pStartVertex + numVertices) - { + if (pSrcMesh->mTangents.size() >= pStartVertex + numVertices) { dstMesh->mTangents = new aiVector3D[numVertices]; - std::copy( pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() + + std::copy(pSrcMesh->mTangents.begin() + pStartVertex, pSrcMesh->mTangents.begin() + pStartVertex + numVertices, dstMesh->mTangents); } // bitangents, if given. - if( pSrcMesh->mBitangents.size() >= pStartVertex + numVertices) - { + if (pSrcMesh->mBitangents.size() >= pStartVertex + numVertices) { dstMesh->mBitangents = new aiVector3D[numVertices]; - std::copy( pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() + + std::copy(pSrcMesh->mBitangents.begin() + pStartVertex, pSrcMesh->mBitangents.begin() + pStartVertex + numVertices, dstMesh->mBitangents); } // same for texturecoords, as many as we have // empty slots are not allowed, need to pack and adjust UV indexes accordingly - for( size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; a++) - { - if( pSrcMesh->mTexCoords[a].size() >= pStartVertex + numVertices) - { + for (size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++a) { + if (pSrcMesh->mTexCoords[a].size() >= pStartVertex + numVertices) { dstMesh->mTextureCoords[real] = new aiVector3D[numVertices]; - for( size_t b = 0; b < numVertices; ++b) - dstMesh->mTextureCoords[real][b] = pSrcMesh->mTexCoords[a][pStartVertex+b]; + for (size_t b = 0; b < numVertices; ++b) { + dstMesh->mTextureCoords[real][b] = pSrcMesh->mTexCoords[a][pStartVertex + b]; + } dstMesh->mNumUVComponents[real] = pSrcMesh->mNumUVComponents[a]; ++real; @@ -657,12 +660,10 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: } // same for vertex colors, as many as we have. again the same packing to avoid empty slots - for( size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; a++) - { - if( pSrcMesh->mColors[a].size() >= pStartVertex + numVertices) - { + for (size_t a = 0, real = 0; a < AI_MAX_NUMBER_OF_COLOR_SETS; ++a) { + if (pSrcMesh->mColors[a].size() >= pStartVertex + numVertices) { dstMesh->mColors[real] = new aiColor4D[numVertices]; - std::copy( pSrcMesh->mColors[a].begin() + pStartVertex, pSrcMesh->mColors[a].begin() + pStartVertex + numVertices,dstMesh->mColors[real]); + std::copy(pSrcMesh->mColors[a].begin() + pStartVertex, pSrcMesh->mColors[a].begin() + pStartVertex + numVertices, dstMesh->mColors[real]); ++real; } } @@ -671,14 +672,14 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: size_t vertex = 0; dstMesh->mNumFaces = static_cast(pSubMesh.mNumFaces); dstMesh->mFaces = new aiFace[dstMesh->mNumFaces]; - for( size_t a = 0; a < dstMesh->mNumFaces; ++a) - { - size_t s = pSrcMesh->mFaceSize[ pStartFace + a]; + for (size_t a = 0; a < dstMesh->mNumFaces; ++a) { + size_t s = pSrcMesh->mFaceSize[pStartFace + 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) + for (size_t b = 0; b < s; ++b) { face.mIndices[b] = static_cast(vertex++); + } } // create morph target meshes if any @@ -686,50 +687,48 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: std::vector targetWeights; Collada::MorphMethod method = Collada::Normalized; - for(std::map::const_iterator it = pParser.mControllerLibrary.begin(); - it != pParser.mControllerLibrary.end(); it++) - { + for (std::map::const_iterator it = pParser.mControllerLibrary.begin(); + 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); + 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); // take method method = c.mMethod; - if (!targetData.mIsStringArray) - throw DeadlyImportError( "target data must contain id. "); - if (weightData.mIsStringArray) - throw DeadlyImportError( "target weight data must not be textual "); + if (!targetData.mIsStringArray) { + throw DeadlyImportError("target data must contain id. "); + } + if (weightData.mIsStringArray) { + throw DeadlyImportError("target weight data must not be textual "); + } - for (unsigned int i = 0; i < targetData.mStrings.size(); ++i) - { + 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); - if (!aimesh) - { - if (targetMesh->mSubMeshes.size() > 1) - throw DeadlyImportError( "Morhing target mesh must be a single"); + if (!aimesh) { + if (targetMesh->mSubMeshes.size() > 1) { + throw DeadlyImportError("Morhing target mesh must be a single"); + } aimesh = CreateMesh(pParser, targetMesh, targetMesh->mSubMeshes.at(0), NULL, 0, 0); mTargetMeshes.push_back(aimesh); } targetMeshes.push_back(aimesh); } - for (unsigned int i = 0; i < weightData.mValues.size(); ++i) + for (unsigned int i = 0; i < weightData.mValues.size(); ++i) { targetWeights.push_back(weightData.mValues.at(i)); + } } } - if (targetMeshes.size() > 0 && targetWeights.size() == targetMeshes.size()) - { + if (targetMeshes.size() > 0 && targetWeights.size() == targetMeshes.size()) { std::vector animMeshes; - for (unsigned int i = 0; i < targetMeshes.size(); i++) - { + for (unsigned int i = 0; i < targetMeshes.size(); ++i) { aiMesh* targetMesh = targetMeshes.at(i); aiAnimMesh *animMesh = aiCreateAnimMesh(targetMesh); float weight = targetWeights[i]; @@ -738,56 +737,54 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: animMeshes.push_back(animMesh); } dstMesh->mMethod = (method == Collada::Relative) - ? aiMorphingMethod_MORPH_RELATIVE - : aiMorphingMethod_MORPH_NORMALIZED; + ? 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++) + for (unsigned int i = 0; i < animMeshes.size(); ++i) { dstMesh->mAnimMeshes[i] = animMeshes.at(i); + } } // create bones if given - if( pSrcController && pSrcController->mType == Collada::Skin) - { + 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); - if( &weightNamesAcc != &jointNamesAcc) - throw DeadlyImportError( "Temporary implementational laziness. If you read this, please report to the author."); + 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"); + if (!jointNames.mIsStringArray || jointMatrices.mIsStringArray || weights.mIsStringArray) + throw DeadlyImportError("Data type mismatch while resolving mesh joints"); // sanity check: we rely on the vertex weights always coming as pairs of BoneIndex-WeightIndex - if( pSrcController->mWeightInputJoints.mOffset != 0 || pSrcController->mWeightInputWeights.mOffset != 1) - throw DeadlyImportError( "Unsupported vertex_weight addressing scheme. "); + if (pSrcController->mWeightInputJoints.mOffset != 0 || pSrcController->mWeightInputWeights.mOffset != 1) + throw DeadlyImportError("Unsupported vertex_weight addressing scheme. "); // 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; std::vector weightStartPerVertex; - weightStartPerVertex.resize(pSrcController->mWeightCounts.size(),pSrcController->mWeights.end()); + weightStartPerVertex.resize(pSrcController->mWeightCounts.size(), pSrcController->mWeights.end()); IndexPairVector::const_iterator pit = pSrcController->mWeights.begin(); - for( size_t a = 0; a < pSrcController->mWeightCounts.size(); ++a) - { + for (size_t a = 0; a < pSrcController->mWeightCounts.size(); ++a) { weightStartPerVertex[a] = pit; pit += pSrcController->mWeightCounts[a]; } // now for each vertex put the corresponding vertex weights into each bone's weight collection - for( size_t a = pStartVertex; a < pStartVertex + numVertices; ++a) - { + for (size_t a = pStartVertex; a < pStartVertex + numVertices; ++a) { // which position index was responsible for this vertex? that's also the index by which // the controller assigns the vertex weights size_t orgIndex = pSrcMesh->mFacePosIndices[a]; @@ -795,58 +792,62 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: IndexPairVector::const_iterator iit = weightStartPerVertex[orgIndex]; size_t pairCount = pSrcController->mWeightCounts[orgIndex]; - for( size_t b = 0; b < pairCount; ++b, ++iit) - { - size_t jointIndex = iit->first; - size_t vertexIndex = iit->second; - ai_real weight = ReadFloat( weightsAcc, weights, vertexIndex, 0); + for( size_t b = 0; b < pairCount; ++b, ++iit) { + const size_t jointIndex = iit->first; + 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; - dstBones[jointIndex].push_back( w); + dstBones[jointIndex].push_back(w); } } } // 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) - numRemainingBones++; + 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]; 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].size() == 0) + if( dstBones[a].empty() ) { continue; + } // create bone with its weights 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); - bone->mOffsetMatrix.a3 = ReadFloat( jointMatrixAcc, jointMatrices, a, 2); - bone->mOffsetMatrix.a4 = ReadFloat( jointMatrixAcc, jointMatrices, a, 3); - bone->mOffsetMatrix.b1 = ReadFloat( jointMatrixAcc, jointMatrices, a, 4); - bone->mOffsetMatrix.b2 = ReadFloat( jointMatrixAcc, jointMatrices, a, 5); - bone->mOffsetMatrix.b3 = ReadFloat( jointMatrixAcc, jointMatrices, a, 6); - bone->mOffsetMatrix.b4 = ReadFloat( jointMatrixAcc, jointMatrices, a, 7); - bone->mOffsetMatrix.c1 = ReadFloat( jointMatrixAcc, jointMatrices, a, 8); - bone->mOffsetMatrix.c2 = ReadFloat( jointMatrixAcc, jointMatrices, a, 9); - bone->mOffsetMatrix.c3 = ReadFloat( jointMatrixAcc, jointMatrices, a, 10); - bone->mOffsetMatrix.c4 = ReadFloat( jointMatrixAcc, jointMatrices, a, 11); + bone->mName = ReadString(jointNamesAcc, jointNames, a); + bone->mOffsetMatrix.a1 = ReadFloat(jointMatrixAcc, jointMatrices, a, 0); + bone->mOffsetMatrix.a2 = ReadFloat(jointMatrixAcc, jointMatrices, a, 1); + bone->mOffsetMatrix.a3 = ReadFloat(jointMatrixAcc, jointMatrices, a, 2); + bone->mOffsetMatrix.a4 = ReadFloat(jointMatrixAcc, jointMatrices, a, 3); + bone->mOffsetMatrix.b1 = ReadFloat(jointMatrixAcc, jointMatrices, a, 4); + bone->mOffsetMatrix.b2 = ReadFloat(jointMatrixAcc, jointMatrices, a, 5); + bone->mOffsetMatrix.b3 = ReadFloat(jointMatrixAcc, jointMatrices, a, 6); + bone->mOffsetMatrix.b4 = ReadFloat(jointMatrixAcc, jointMatrices, a, 7); + bone->mOffsetMatrix.c1 = ReadFloat(jointMatrixAcc, jointMatrices, a, 8); + bone->mOffsetMatrix.c2 = ReadFloat(jointMatrixAcc, jointMatrices, a, 9); + bone->mOffsetMatrix.c3 = ReadFloat(jointMatrixAcc, jointMatrices, a, 10); + bone->mOffsetMatrix.c4 = ReadFloat(jointMatrixAcc, jointMatrices, a, 11); bone->mNumWeights = static_cast(dstBones[a].size()); bone->mWeights = new aiVertexWeight[bone->mNumWeights]; - std::copy( dstBones[a].begin(), dstBones[a].end(), bone->mWeights); + std::copy(dstBones[a].begin(), dstBones[a].end(), bone->mWeights); // apply bind shape matrix to offset matrix aiMatrix4x4 bindShapeMatrix; @@ -873,119 +874,112 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada:: // 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) + if( !bnode) { bnode = FindNodeBySID( pParser.mRootNode, bone->mName.data); + } // assign the name that we would have assigned for the source node - if( bnode) + if( bnode) { bone->mName.Set( FindNameForNode( bnode)); - else + } else { ASSIMP_LOG_WARN_F( "ColladaLoader::CreateMesh(): could not find corresponding node for joint \"", bone->mName.data, "\"." ); + } // and insert bone dstMesh->mBones[boneCount++] = bone; } } - return dstMesh; + return dstMesh.release(); } // ------------------------------------------------------------------------------------------------ // 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.size() > 0) - { - pScene->mMeshes = new aiMesh*[mMeshes.size()]; - std::copy( mMeshes.begin(), mMeshes.end(), pScene->mMeshes); - mMeshes.clear(); + if( mMeshes.empty() ) { + return; } + 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.size() > 0) - { - pScene->mCameras = new aiCamera*[mCameras.size()]; - std::copy( mCameras.begin(), mCameras.end(), pScene->mCameras); - mCameras.clear(); + if( mCameras.empty() ) { + return; } + 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.size() > 0) - { - pScene->mLights = new aiLight*[mLights.size()]; - std::copy( mLights.begin(), mLights.end(), pScene->mLights); - mLights.clear(); + if( mLights.empty() ) { + return; } + 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.size() > 0) - { - pScene->mTextures = new aiTexture*[mTextures.size()]; - std::copy( mTextures.begin(), mTextures.end(), pScene->mTextures); - mTextures.clear(); + if( mTextures.empty() ) { + return; } + 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.size() > 0) { - pScene->mMaterials = new aiMaterial*[newMats.size()]; - for (unsigned int i = 0; i < newMats.size();++i) - pScene->mMaterials[i] = newMats[i].second; - - newMats.clear(); + if (newMats.empty() ) { + return; } + pScene->mMaterials = new aiMaterial*[newMats.size()]; + for (unsigned int i = 0; i < newMats.size();++i) { + pScene->mMaterials[i] = newMats[i].second; + } + newMats.clear(); } // ------------------------------------------------------------------------------------------------ // 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, ""); + 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) - { + for( size_t a = 0; a < mAnims.size(); ++a) { aiAnimation* templateAnim = mAnims[a]; - if( templateAnim->mNumChannels == 1) - { + 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) - { + 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); + if (other->mNumChannels == 1 && other->mDuration == templateAnim->mDuration && + other->mTicksPerSecond == templateAnim->mTicksPerSecond) + collectedAnimIndices.push_back(b); } // if there are other animations which fit the template anim, combine all channels into a single anim - if( !collectedAnimIndices.empty() ) + if (!collectedAnimIndices.empty()) { aiAnimation* combinedAnim = new aiAnimation(); - combinedAnim->mName = aiString( std::string( "combinedAnim_") + char( '0' + a)); + combinedAnim->mName = aiString(std::string("combinedAnim_") + char('0' + a)); combinedAnim->mDuration = templateAnim->mDuration; combinedAnim->mTicksPerSecond = templateAnim->mTicksPerSecond; combinedAnim->mNumChannels = static_cast(collectedAnimIndices.size() + 1); @@ -998,7 +992,7 @@ 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) + for (size_t b = 0; b < collectedAnimIndices.size(); ++b) { aiAnimation* srcAnimation = mAnims[collectedAnimIndices[b]]; combinedAnim->mChannels[1 + b] = srcAnimation->mChannels[0]; @@ -1008,9 +1002,9 @@ 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()); + mAnims.erase(mAnims.begin() + collectedAnimIndices.back()); collectedAnimIndices.pop_back(); } } @@ -1018,11 +1012,11 @@ 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()]; - std::copy( mAnims.begin(), mAnims.end(), pScene->mAnimations); + std::copy(mAnims.begin(), mAnims.end(), pScene->mAnimations); } mAnims.clear(); @@ -1030,17 +1024,17 @@ 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) - StoreAnimations( pScene, pParser, *it, animName); + for (std::vector::const_iterator it = pSrcAnim->mSubAnims.begin(); it != pSrcAnim->mSubAnims.end(); ++it) + StoreAnimations(pScene, pParser, *it, animName); // create animation channels, if any - if( !pSrcAnim->mChannels.empty()) - CreateAnimation( pScene, pParser, pSrcAnim, animName); + if (!pSrcAnim->mChannels.empty()) + CreateAnimation(pScene, pParser, pSrcAnim, animName); } struct MorphTimeValues @@ -1081,7 +1075,8 @@ void insertMorphTimeValue(std::vector &values, float time, floa { 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; @@ -1107,30 +1102,30 @@ 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; - CollectNodes( pScene->mRootNode, nodes); + CollectNodes(pScene->mRootNode, nodes); 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); -// ai_assert( srcNode != NULL); - if( !srcNode) + const Collada::Node* srcNode = FindNode(pParser.mRootNode, nodeName); + // ai_assert( srcNode != NULL); + if (!srcNode) continue; // now check all channels if they affect the current node std::string targetID, subElement; - for( std::vector::const_iterator cit = pSrcAnim->mChannels.begin(); + for (std::vector::const_iterator cit = pSrcAnim->mChannels.begin(); cit != pSrcAnim->mChannels.end(); ++cit) { const Collada::AnimationChannel& srcChannel = *cit; @@ -1138,8 +1133,8 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars // 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) + std::string::size_type slashPos = srcChannel.mTarget.find('/'); + if (slashPos == std::string::npos) { std::string::size_type targetPos = srcChannel.mTarget.find(srcNode->mID); if (targetPos == std::string::npos) @@ -1148,44 +1143,45 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars // 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); continue; } - if( srcChannel.mTarget.find( '/', slashPos+1) != std::string::npos) + if (srcChannel.mTarget.find('/', slashPos + 1) != std::string::npos) continue; targetID.clear(); - targetID = srcChannel.mTarget.substr( 0, slashPos); - if( targetID != srcNode->mID) + targetID = srcChannel.mTarget.substr(0, slashPos); + if (targetID != srcNode->mID) continue; // 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) + std::string::size_type dotPos = srcChannel.mTarget.find('.'); + if (dotPos != std::string::npos) { - if( srcChannel.mTarget.find( '.', dotPos+1) != std::string::npos) + if (srcChannel.mTarget.find('.', dotPos + 1) != std::string::npos) continue; - entry.mTransformId = srcChannel.mTarget.substr( slashPos+1, dotPos - slashPos - 1); + entry.mTransformId = srcChannel.mTarget.substr(slashPos + 1, dotPos - slashPos - 1); subElement.clear(); - subElement = srcChannel.mTarget.substr( dotPos+1); - if( subElement == "ANGLE") + subElement = srcChannel.mTarget.substr(dotPos + 1); + if (subElement == "ANGLE") entry.mSubElement = 3; // last number in an Axis-Angle-Transform is the angle - else if( subElement == "X") + else if (subElement == "X") entry.mSubElement = 0; - else if( subElement == "Y") + else if (subElement == "Y") entry.mSubElement = 1; - else if( subElement == "Z") + else if (subElement == "Z") entry.mSubElement = 2; else - ASSIMP_LOG_WARN_F( "Unknown anim subelement <", subElement, ">. Ignoring" ); - } else { + ASSIMP_LOG_WARN_F("Unknown anim subelement <", subElement, ">. Ignoring"); + } + else { // no subelement following, transformId is remaining string - entry.mTransformId = srcChannel.mTarget.substr( slashPos+1); + entry.mTransformId = srcChannel.mTarget.substr(slashPos + 1); } std::string::size_type bracketPos = srcChannel.mTarget.find('('); @@ -1231,194 +1227,196 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars // determine which transform step is affected by this channel entry.mTransformIndex = SIZE_MAX; - for( size_t a = 0; a < srcNode->mTransforms.size(); ++a) - if( srcNode->mTransforms[a].mID == entry.mTransformId) + for (size_t a = 0; a < srcNode->mTransforms.size(); ++a) + if (srcNode->mTransforms[a].mID == entry.mTransformId) entry.mTransformIndex = a; - if( entry.mTransformIndex == SIZE_MAX) + if (entry.mTransformIndex == SIZE_MAX) { if (entry.mTransformId.find("morph-weights") != std::string::npos) { entry.mTargetId = entry.mTransformId; entry.mTransformId = ""; - } else + } + else continue; } entry.mChannel = &(*cit); - entries.push_back( entry); + entries.push_back(entry); } // if there's no channel affecting the current node, we skip it - if( entries.empty()) + if (entries.empty()) continue; // 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) + 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; - 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); - e.mValueData = &pParser.ResolveLibraryReference( pParser.mDataLibrary, e.mValueAccessor->mSource); + 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); + e.mValueData = &pParser.ResolveLibraryReference(pParser.mDataLibrary, e.mValueAccessor->mSource); // time count and value count must match - 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 != e.mValueAccessor->mCount) + throw DeadlyImportError(format() << "Time count / value count mismatch in animation channel \"" << e.mChannel->mTarget << "\"."); - 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)); - } + 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)); + } } - std::vector resultTrafos; - if( !entries.empty() && entries.front().mTimeAccessor->mCount > 0 ) - { - // create a local transformation chain of the node's transforms - std::vector transforms = srcNode->mTransforms; + std::vector resultTrafos; + 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; + // 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; - // find the keyframe behind the current point in time - size_t pos = 0; - ai_real postTime = 0.0; - while( 1) - { - if( pos >= e.mTimeAccessor->mCount) - break; - postTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos, 0); - if( postTime >= time) - break; - ++pos; - } + // find the keyframe behind the current point in time + size_t pos = 0; + ai_real postTime = 0.0; + while (1) + { + if (pos >= e.mTimeAccessor->mCount) + break; + postTime = ReadFloat(*e.mTimeAccessor, *e.mTimeData, pos, 0); + if (postTime >= time) + break; + ++pos; + } - pos = std::min( pos, e.mTimeAccessor->mCount-1); + pos = std::min(pos, e.mTimeAccessor->mCount - 1); - // read values from there - ai_real temp[16]; - for( size_t c = 0; c < e.mValueAccessor->mSize; ++c) - temp[c] = ReadFloat( *e.mValueAccessor, *e.mValueData, pos, c); + // read values from there + ai_real temp[16]; + for (size_t c = 0; c < e.mValueAccessor->mSize; ++c) + 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) - { - ai_real preTime = ReadFloat( *e.mTimeAccessor, *e.mTimeData, pos-1, 0); - ai_real factor = (time - postTime) / (preTime - postTime); + // if not exactly at the key time, interpolate with previous value set + 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) - { - ai_real v = ReadFloat( *e.mValueAccessor, *e.mValueData, pos-1, c); - temp[c] += (v - temp[c]) * factor; - } - } + 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; + } + } - // Apply values to current transformation - std::copy( temp, temp + e.mValueAccessor->mSize, transforms[e.mTransformIndex].f + e.mSubElement); - } + // Apply values to current transformation + std::copy(temp, temp + e.mValueAccessor->mSize, transforms[e.mTransformIndex].f + e.mSubElement); + } - // Calculate resulting transformation - aiMatrix4x4 mat = pParser.CalculateResultTransform( transforms); + // Calculate resulting transformation + aiMatrix4x4 mat = pParser.CalculateResultTransform(transforms); - // out of laziness: we store the time in matrix.d4 - mat.d4 = time; - resultTrafos.push_back( mat); + // out of laziness: we store the time in matrix.d4 + mat.d4 = time; + resultTrafos.push_back(mat); - // 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; + // 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; - // find the next time value larger than the current - size_t pos = 0; - while( pos < channelElement.mTimeAccessor->mCount) - { - const ai_real t = ReadFloat( *channelElement.mTimeAccessor, *channelElement.mTimeData, pos, 0); - if( t > time) - { - nextTime = std::min( nextTime, t); - break; - } - ++pos; - } + // find the next time value larger than the current + size_t pos = 0; + while (pos < channelElement.mTimeAccessor->mCount) + { + const ai_real t = ReadFloat(*channelElement.mTimeAccessor, *channelElement.mTimeData, pos, 0); + if (t > time) + { + nextTime = std::min(nextTime, t); + break; + } + ++pos; + } - // https://github.com/assimp/assimp/issues/458 - // Sub-sample axis-angle channels if the delta between two consecutive - // key-frame angles is >= 180 degrees. - if (transforms[channelElement.mTransformIndex].mType == Collada::TF_ROTATE && channelElement.mSubElement == 3 && pos > 0 && pos < channelElement.mTimeAccessor->mCount) { - const ai_real cur_key_angle = ReadFloat(*channelElement.mValueAccessor, *channelElement.mValueData, pos, 0); - const ai_real last_key_angle = ReadFloat(*channelElement.mValueAccessor, *channelElement.mValueData, pos - 1, 0); - const ai_real cur_key_time = ReadFloat(*channelElement.mTimeAccessor, *channelElement.mTimeData, pos, 0); - const ai_real last_key_time = ReadFloat(*channelElement.mTimeAccessor, *channelElement.mTimeData, pos - 1, 0); - const ai_real last_eval_angle = last_key_angle + (cur_key_angle - last_key_angle) * (time - last_key_time) / (cur_key_time - last_key_time); - const ai_real delta = std::abs(cur_key_angle - last_eval_angle); - if (delta >= 180.0) { - const int subSampleCount = static_cast(std::floor(delta / 90.0)); - if (cur_key_time != time) { - const ai_real nextSampleTime = time + (cur_key_time - time) / subSampleCount; - nextTime = std::min(nextTime, nextSampleTime); - } - } - } - } + // https://github.com/assimp/assimp/issues/458 + // Sub-sample axis-angle channels if the delta between two consecutive + // key-frame angles is >= 180 degrees. + if (transforms[channelElement.mTransformIndex].mType == Collada::TF_ROTATE && channelElement.mSubElement == 3 && pos > 0 && pos < channelElement.mTimeAccessor->mCount) { + const ai_real cur_key_angle = ReadFloat(*channelElement.mValueAccessor, *channelElement.mValueData, pos, 0); + const ai_real last_key_angle = ReadFloat(*channelElement.mValueAccessor, *channelElement.mValueData, pos - 1, 0); + const ai_real cur_key_time = ReadFloat(*channelElement.mTimeAccessor, *channelElement.mTimeData, pos, 0); + const ai_real last_key_time = ReadFloat(*channelElement.mTimeAccessor, *channelElement.mTimeData, pos - 1, 0); + const ai_real last_eval_angle = last_key_angle + (cur_key_angle - last_key_angle) * (time - last_key_time) / (cur_key_time - last_key_time); + const ai_real delta = std::abs(cur_key_angle - last_eval_angle); + if (delta >= 180.0) { + const int subSampleCount = static_cast(std::floor(delta / 90.0)); + if (cur_key_time != time) { + const ai_real nextSampleTime = time + (cur_key_time - time) / subSampleCount; + nextTime = std::min(nextTime, nextSampleTime); + } + } + } + } - // no more keys on any channel after the current time -> we're done - if( nextTime > 1e19) - break; + // no more keys on any channel after the current time -> we're done + if (nextTime > 1e19) + break; - // else construct next keyframe at this following time point - time = nextTime; - } - } + // else construct next keyframe at this following time point + time = nextTime; + } + } // there should be some keyframes, but we aren't that fixated on valid input data // ai_assert( resultTrafos.size() > 0); // build an animation channel for the given node out of these trafo keys - if( !resultTrafos.empty() ) + if (!resultTrafos.empty()) { - aiNodeAnim* dstAnim = new aiNodeAnim; - dstAnim->mNodeName = nodeName; - dstAnim->mNumPositionKeys = static_cast(resultTrafos.size()); - dstAnim->mNumRotationKeys = static_cast(resultTrafos.size()); - dstAnim->mNumScalingKeys = static_cast(resultTrafos.size()); - dstAnim->mPositionKeys = new aiVectorKey[resultTrafos.size()]; - dstAnim->mRotationKeys = new aiQuatKey[resultTrafos.size()]; - dstAnim->mScalingKeys = new aiVectorKey[resultTrafos.size()]; + aiNodeAnim* dstAnim = new aiNodeAnim; + dstAnim->mNodeName = nodeName; + dstAnim->mNumPositionKeys = static_cast(resultTrafos.size()); + dstAnim->mNumRotationKeys = static_cast(resultTrafos.size()); + dstAnim->mNumScalingKeys = static_cast(resultTrafos.size()); + dstAnim->mPositionKeys = new aiVectorKey[resultTrafos.size()]; + dstAnim->mRotationKeys = new aiQuatKey[resultTrafos.size()]; + dstAnim->mScalingKeys = new aiVectorKey[resultTrafos.size()]; - 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; + 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; - dstAnim->mPositionKeys[a].mTime = time; - dstAnim->mRotationKeys[a].mTime = time; - dstAnim->mScalingKeys[a].mTime = time; - mat.Decompose( dstAnim->mScalingKeys[a].mValue, dstAnim->mRotationKeys[a].mValue, dstAnim->mPositionKeys[a].mValue); - } + dstAnim->mPositionKeys[a].mTime = time; + dstAnim->mRotationKeys[a].mTime = time; + dstAnim->mScalingKeys[a].mTime = time; + mat.Decompose(dstAnim->mScalingKeys[a].mValue, dstAnim->mRotationKeys[a].mValue, dstAnim->mPositionKeys[a].mValue); + } - anims.push_back( dstAnim); - } else + anims.push_back(dstAnim); + } + else { - ASSIMP_LOG_WARN( "Collada loader: found empty animation channel, ignored. Please check your exporter."); + 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) + for (std::vector::iterator it = entries.begin(); it != entries.end(); ++it) { Collada::ChannelEntry& e = *it; @@ -1441,7 +1439,7 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars std::vector morphTimeValues; int morphAnimChannelIndex = 0; - for( std::vector::iterator it = morphChannels.begin(); it != morphChannels.end(); ++it) + for (std::vector::iterator it = morphChannels.begin(); it != morphChannels.end(); ++it) { Collada::ChannelEntry& e = *it; std::string::size_type apos = e.mTargetId.find('('); @@ -1463,8 +1461,8 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars 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].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++) @@ -1479,48 +1477,48 @@ void ColladaLoader::CreateAnimation( aiScene* pScene, const ColladaParser& pPars } } - if( !anims.empty() || !morphAnims.empty()) + if (!anims.empty() || !morphAnims.empty()) { aiAnimation* anim = new aiAnimation; - anim->mName.Set( pName); + anim->mName.Set(pName); anim->mNumChannels = static_cast(anims.size()); if (anim->mNumChannels > 0) { anim->mChannels = new aiNodeAnim*[anims.size()]; - std::copy( anims.begin(), anims.end(), anim->mChannels); + std::copy(anims.begin(), anims.end(), anim->mChannels); } anim->mNumMorphMeshChannels = static_cast(morphAnims.size()); if (anim->mNumMorphMeshChannels > 0) { anim->mMorphMeshChannels = new aiMeshMorphAnim*[anim->mNumMorphMeshChannels]; - std::copy( morphAnims.begin(), morphAnims.end(), anim->mMorphMeshChannels); + 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); + 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) { - anim->mDuration = std::max(anim->mDuration, morphAnims[a]->mKeys[morphAnims[a]->mNumKeys-1].mTime); + anim->mDuration = std::max(anim->mDuration, morphAnims[a]->mKeys[morphAnims[a]->mNumKeys - 1].mTime); } anim->mTicksPerSecond = 1; - mAnims.push_back( anim); + mAnims.push_back(anim); } } // ------------------------------------------------------------------------------------------------ // Add a texture to a material structure -void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser, +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 ); + const aiString name = FindFilenameForEffectTexture(pParser, effect, sampler.mName); + mat.AddProperty(&name, _AI_MATKEY_TEXTURE_BASE, type, idx); // mapping mode int map = aiTextureMapMode_Clamp; @@ -1529,7 +1527,7 @@ void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser, if (sampler.mWrapU && sampler.mMirrorU) map = aiTextureMapMode_Mirror; - mat.AddProperty( &map, 1, _AI_MATKEY_MAPPINGMODE_U_BASE, type, idx); + mat.AddProperty(&map, 1, _AI_MATKEY_MAPPINGMODE_U_BASE, type, idx); map = aiTextureMapMode_Clamp; if (sampler.mWrapV) @@ -1537,18 +1535,18 @@ void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser, if (sampler.mWrapV && sampler.mMirrorV) map = aiTextureMapMode_Mirror; - mat.AddProperty( &map, 1, _AI_MATKEY_MAPPINGMODE_V_BASE, type, idx); + mat.AddProperty(&map, 1, _AI_MATKEY_MAPPINGMODE_V_BASE, type, idx); // UV transformation mat.AddProperty(&sampler.mTransform, 1, _AI_MATKEY_UVTRANSFORM_BASE, type, idx); // Blend mode - mat.AddProperty((int*)&sampler.mOp , 1, + mat.AddProperty((int*)&sampler.mOp, 1, _AI_MATKEY_TEXBLEND_BASE, type, idx); // Blend factor - mat.AddProperty((ai_real*)&sampler.mWeighting , 1, + 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 @@ -1560,7 +1558,7 @@ void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser, map = sampler.mUVId; else { map = -1; - for (std::string::const_iterator it = sampler.mUVChannel.begin();it != sampler.mUVChannel.end(); ++it){ + for (std::string::const_iterator it = sampler.mUVChannel.begin(); it != sampler.mUVChannel.end(); ++it) { if (IsNumeric(*it)) { map = strtoul10(&(*it)); break; @@ -1571,12 +1569,12 @@ void ColladaLoader::AddTexture ( aiMaterial& mat, const ColladaParser& pParser, map = 0; } } - mat.AddProperty(&map,1,_AI_MATKEY_UVWSRC_BASE,type,idx); + mat.AddProperty(&map, 1, _AI_MATKEY_UVWSRC_BASE, type, idx); } // ------------------------------------------------------------------------------------------------ // Fills materials from the collada material definitions -void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pScene*/) +void ColladaLoader::FillMaterials(const ColladaParser& pParser, aiScene* /*pScene*/) { for (auto &elem : newMats) { @@ -1588,7 +1586,7 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce if (effect.mFaceted) /* fixme */ shadeMode = aiShadingMode_Flat; else { - switch( effect.mShadeType) + switch (effect.mShadeType) { case Collada::Shade_Constant: shadeMode = aiShadingMode_NoShading; @@ -1609,56 +1607,57 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce break; } } - mat.AddProperty( &shadeMode, 1, AI_MATKEY_SHADING_MODEL); + mat.AddProperty(&shadeMode, 1, AI_MATKEY_SHADING_MODEL); // double-sided? shadeMode = effect.mDoubleSided; - mat.AddProperty( &shadeMode, 1, AI_MATKEY_TWOSIDED); + mat.AddProperty(&shadeMode, 1, AI_MATKEY_TWOSIDED); // wireframe? shadeMode = effect.mWireframe; - mat.AddProperty( &shadeMode, 1, AI_MATKEY_ENABLE_WIREFRAME); + mat.AddProperty(&shadeMode, 1, AI_MATKEY_ENABLE_WIREFRAME); // add material colors - mat.AddProperty( &effect.mAmbient, 1,AI_MATKEY_COLOR_AMBIENT); - mat.AddProperty( &effect.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE); - mat.AddProperty( &effect.mSpecular, 1,AI_MATKEY_COLOR_SPECULAR); - mat.AddProperty( &effect.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE); - mat.AddProperty( &effect.mReflective, 1, AI_MATKEY_COLOR_REFLECTIVE); + mat.AddProperty(&effect.mAmbient, 1, AI_MATKEY_COLOR_AMBIENT); + mat.AddProperty(&effect.mDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE); + mat.AddProperty(&effect.mSpecular, 1, AI_MATKEY_COLOR_SPECULAR); + mat.AddProperty(&effect.mEmissive, 1, AI_MATKEY_COLOR_EMISSIVE); + mat.AddProperty(&effect.mReflective, 1, AI_MATKEY_COLOR_REFLECTIVE); // scalar properties - mat.AddProperty( &effect.mShininess, 1, AI_MATKEY_SHININESS); - mat.AddProperty( &effect.mReflectivity, 1, AI_MATKEY_REFLECTIVITY); - mat.AddProperty( &effect.mRefractIndex, 1, AI_MATKEY_REFRACTI); + mat.AddProperty(&effect.mShininess, 1, AI_MATKEY_SHININESS); + mat.AddProperty(&effect.mReflectivity, 1, AI_MATKEY_REFLECTIVITY); + mat.AddProperty(&effect.mRefractIndex, 1, AI_MATKEY_REFRACTI); // transparency, a very hard one. seemingly not all files are following the // specification here (1.0 transparency => completely opaque)... // therefore, we let the opportunity for the user to manually invert // the transparency if necessary and we add preliminary support for RGB_ZERO mode - if(effect.mTransparency >= 0.f && effect.mTransparency <= 1.f) { + if (effect.mTransparency >= 0.f && effect.mTransparency <= 1.f) { // 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) + 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.mTransparent.a = 1.f; - mat.AddProperty( &effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT ); - } else { - effect.mTransparency *= effect.mTransparent.a; + mat.AddProperty(&effect.mTransparent, 1, AI_MATKEY_COLOR_TRANSPARENT); + } + else { + effect.mTransparency *= effect.mTransparent.a; } - if(effect.mInvertTransparency) { + if (effect.mInvertTransparency) { effect.mTransparency = 1.f - effect.mTransparency; } // Is the material finally transparent ? if (effect.mHasTransparency || effect.mTransparency < 1.f) { - mat.AddProperty( &effect.mTransparency, 1, AI_MATKEY_OPACITY ); + mat.AddProperty(&effect.mTransparency, 1, AI_MATKEY_OPACITY); } } @@ -1668,87 +1667,88 @@ void ColladaLoader::FillMaterials( const ColladaParser& pParser, aiScene* /*pSce AddTexture(mat, pParser, effect, effect.mTexAmbient, aiTextureType_LIGHTMAP); } - if( !effect.mTexEmissive.mName.empty()) - AddTexture( mat, pParser, effect, effect.mTexEmissive, aiTextureType_EMISSIVE); + if (!effect.mTexEmissive.mName.empty()) + AddTexture(mat, pParser, effect, effect.mTexEmissive, aiTextureType_EMISSIVE); - if( !effect.mTexSpecular.mName.empty()) - AddTexture( mat, pParser, effect, effect.mTexSpecular, aiTextureType_SPECULAR); + if (!effect.mTexSpecular.mName.empty()) + AddTexture(mat, pParser, effect, effect.mTexSpecular, aiTextureType_SPECULAR); - if( !effect.mTexDiffuse.mName.empty()) - AddTexture( mat, pParser, effect, effect.mTexDiffuse, aiTextureType_DIFFUSE); + if (!effect.mTexDiffuse.mName.empty()) + AddTexture(mat, pParser, effect, effect.mTexDiffuse, aiTextureType_DIFFUSE); - if( !effect.mTexBump.mName.empty()) - AddTexture( mat, pParser, effect, effect.mTexBump, aiTextureType_NORMALS); + if (!effect.mTexBump.mName.empty()) + AddTexture(mat, pParser, effect, effect.mTexBump, aiTextureType_NORMALS); - if( !effect.mTexTransparent.mName.empty()) - AddTexture( mat, pParser, effect, effect.mTexTransparent, aiTextureType_OPACITY); + if (!effect.mTexTransparent.mName.empty()) + AddTexture(mat, pParser, effect, effect.mTexTransparent, aiTextureType_OPACITY); - if( !effect.mTexReflective.mName.empty()) - AddTexture( mat, pParser, effect, effect.mTexReflective, aiTextureType_REFLECTION); + if (!effect.mTexReflective.mName.empty()) + AddTexture(mat, pParser, effect, effect.mTexReflective, aiTextureType_REFLECTION); } } // ------------------------------------------------------------------------------------------------ // 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(); + for (ColladaParser::MaterialLibrary::const_iterator matIt = pParser.mMaterialLibrary.begin(); 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()) + ColladaParser::EffectLibrary::iterator effIt = pParser.mEffectLibrary.find(material.mEffect); + if (effIt == pParser.mEffectLibrary.end()) continue; Collada::Effect& effect = effIt->second; // create material aiMaterial* mat = new aiMaterial; - aiString name( material.mName.empty() ? matIt->first : material.mName ); - mat->AddProperty(&name,AI_MATKEY_NAME); + 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 // we can safely let it to ScenePreprocessor. #if 0 - if( newMats.size() == 0) + if (newMats.size() == 0) { aiMaterial* mat = new aiMaterial; - aiString name( AI_DEFAULT_MATERIAL_NAME ); - mat->AddProperty( &name, AI_MATKEY_NAME); + aiString name(AI_DEFAULT_MATERIAL_NAME); + mat->AddProperty(&name, AI_MATKEY_NAME); const int shadeMode = aiShadingMode_Phong; - mat->AddProperty( &shadeMode, 1, AI_MATKEY_SHADING_MODEL); - aiColor4D colAmbient( 0.2, 0.2, 0.2, 1.0), colDiffuse( 0.8, 0.8, 0.8, 1.0), colSpecular( 0.5, 0.5, 0.5, 0.5); - mat->AddProperty( &colAmbient, 1, AI_MATKEY_COLOR_AMBIENT); - mat->AddProperty( &colDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE); - mat->AddProperty( &colSpecular, 1, AI_MATKEY_COLOR_SPECULAR); + mat->AddProperty(&shadeMode, 1, AI_MATKEY_SHADING_MODEL); + aiColor4D colAmbient(0.2, 0.2, 0.2, 1.0), colDiffuse(0.8, 0.8, 0.8, 1.0), colSpecular(0.5, 0.5, 0.5, 0.5); + mat->AddProperty(&colAmbient, 1, AI_MATKEY_COLOR_AMBIENT); + mat->AddProperty(&colDiffuse, 1, AI_MATKEY_COLOR_DIFFUSE); + mat->AddProperty(&colSpecular, 1, AI_MATKEY_COLOR_SPECULAR); const ai_real specExp = 5.0; - mat->AddProperty( &specExp, 1, AI_MATKEY_SHININESS); - } + mat->AddProperty(&specExp, 1, AI_MATKEY_SHININESS); +} #endif } // ------------------------------------------------------------------------------------------------ // Resolves the texture name for the given effect texture entry -aiString ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pParser, +// 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); + 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 - if( it == pEffect.mParams.end()) + if (it == pEffect.mParams.end()) break; // else recurse on @@ -1756,131 +1756,81 @@ aiString ColladaLoader::FindFilenameForEffectTexture( const ColladaParser& pPars } // 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()) + ColladaParser::ImageLibrary::const_iterator imIt = pParser.mImageLibrary.find(name); + 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 result.Set(name + ".jpg"); - ConvertPath(result); + ColladaParser::UriDecodePath(result); return result; } // if this is an embedded texture image setup an aiTexture for it - if (imIt->second.mFileName.empty()) + if (!imIt->second.mImageData.empty()) { - if (imIt->second.mImageData.empty()) { - throw DeadlyImportError("Collada: Invalid texture, no data or file reference given"); - } - 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())); + + // setup format hint - if (imIt->second.mEmbeddedFormat.length() > 3) { + if (imIt->second.mEmbeddedFormat.length() >= HINTMAXTEXTURELEN) { ASSIMP_LOG_WARN("Collada: texture format hint is too long, truncating to 3 characters"); } - strncpy(tex->achFormatHint,imIt->second.mEmbeddedFormat.c_str(),3); + strncpy(tex->achFormatHint, imIt->second.mEmbeddedFormat.c_str(), 3); // and copy texture data tex->mHeight = 0; tex->mWidth = static_cast(imIt->second.mImageData.size()); tex->pcData = (aiTexel*)new char[tex->mWidth]; - memcpy(tex->pcData,&imIt->second.mImageData[0],tex->mWidth); - - // TODO: check the possibility of using the flag "AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING" - // In FBX files textures are now stored internally by Assimp with their filename included - // Now Assimp can lookup through the loaded textures after all data is processed - // We need to load all textures before referencing them, as FBX file format order may reference a texture before loading it - // This may occur on this case too, it has to be studied - // setup texture reference string - result.data[0] = '*'; - result.length = 1 + ASSIMP_itoa10(result.data+1,static_cast(MAXLEN-1),static_cast(mTextures.size())); + memcpy(tex->pcData, &imIt->second.mImageData[0], tex->mWidth); // and add this texture to the list mTextures.push_back(tex); } else { - result.Set( imIt->second.mFileName ); - ConvertPath(result); + if (imIt->second.mFileName.empty()) { + throw DeadlyImportError("Collada: Invalid texture, no data or file reference given"); + } + + result.Set(imIt->second.mFileName); } return result; } -// ------------------------------------------------------------------------------------------------ -// Convert a path read from a collada file to the usual representation -void ColladaLoader::ConvertPath (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)) - { - ss.length -= 7; - memmove(ss.data,ss.data+7,ss.length); - ss.data[ss.length] = '\0'; - } - - // 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( ss.data[0] == '/' && isalpha( (unsigned char) ss.data[1]) && ss.data[2] == ':' ) { -#else - if (ss.data[ 0 ] == '/' && isalpha( ss.data[ 1 ] ) && ss.data[ 2 ] == ':') { -#endif - --ss.length; - ::memmove( ss.data, ss.data+1, ss.length); - ss.data[ss.length] = 0; - } - - // 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 ) - { - // 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 - { - *out++ = *it++; - } - } - - // adjust length and terminator of the shortened string - *out = 0; - ss.length = (ptrdiff_t) (out - ss.data); -} - // ------------------------------------------------------------------------------------------------ // 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()); + ai_assert(pos < pData.mValues.size()); return pData.mValues[pos]; } // ------------------------------------------------------------------------------------------------ // 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()); + ai_assert(pos < pData.mStrings.size()); return pData.mStrings[pos]; } // ------------------------------------------------------------------------------------------------ // 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); + poNodes.push_back(pNode); for (size_t a = 0; a < pNode->mNumChildren; ++a) { CollectNodes(pNode->mChildren[a], poNodes); } @@ -1888,15 +1838,15 @@ void ColladaLoader::CollectNodes( const aiNode* pNode, std::vectormName == pName || pNode->mID == pName) + if (pNode->mName == pName || pNode->mID == pName) return pNode; - for( size_t a = 0; a < pNode->mChildren.size(); ++a) + for (size_t a = 0; a < pNode->mChildren.size(); ++a) { - const Collada::Node* node = FindNode( pNode->mChildren[a], pName); - if( node) + const Collada::Node* node = FindNode(pNode->mChildren[a], pName); + if (node) return node; } @@ -1905,32 +1855,37 @@ const Collada::Node* ColladaLoader::FindNode( const Collada::Node* pNode, const // ------------------------------------------------------------------------------------------------ // 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 -{ - if( pNode->mSID == pSID) - return pNode; +const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, const std::string& pSID) const { + if (nullptr == pNode) { + return nullptr; + } - for( size_t a = 0; a < pNode->mChildren.size(); ++a) - { - const Collada::Node* node = FindNodeBySID( pNode->mChildren[a], pSID); - if( node) - return node; - } + if (pNode->mSID == pSID) { + return pNode; + } - return NULL; + for( size_t a = 0; a < pNode->mChildren.size(); ++a) { + const Collada::Node* node = FindNodeBySID( pNode->mChildren[a], pSID); + if (node) { + return node; + } + } + + return nullptr; } // ------------------------------------------------------------------------------------------------ // 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 (!pNode->mName.empty()) { return pNode->mName; - } else { + } + else { return format() << "$ColladaAutoName$_" << mNodeNameCounter++; } } @@ -1951,4 +1906,6 @@ std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode) } } +} // Namespace Assimp + #endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER diff --git a/Engine/lib/assimp/code/ColladaLoader.h b/Engine/lib/assimp/code/Collada/ColladaLoader.h similarity index 96% rename from Engine/lib/assimp/code/ColladaLoader.h rename to Engine/lib/assimp/code/Collada/ColladaLoader.h index 72c2dd8e7..d8d3f4f52 100644 --- a/Engine/lib/assimp/code/ColladaLoader.h +++ b/Engine/lib/assimp/code/Collada/ColladaLoader.h @@ -94,20 +94,20 @@ public: public: /** Returns whether the class can handle the format of the given file. * See BaseImporter::CanRead() for details. */ - bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const; + bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override; protected: /** Return importer meta information. * See #BaseImporter::GetInfo for the details */ - const aiImporterDesc* GetInfo () const; + const aiImporterDesc* GetInfo () const override; - void SetupProperties(const Importer* pImp); + void SetupProperties(const Importer* pImp) override; /** Imports the given file into the given scene structure. * See BaseImporter::InternReadFile() for details */ - void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); + void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) override; /** Recursively constructs a scene node for the given parser node and returns it. */ aiNode* BuildHierarchy( const ColladaParser& pParser, const Collada::Node* pNode); @@ -120,7 +120,7 @@ protected: void BuildMeshesForNode( const ColladaParser& pParser, const Collada::Node* pNode, aiNode* pTarget); - aiMesh *findMesh(std::string meshid); + aiMesh *findMesh(const std::string& meshid); /** Creates a mesh for the given ColladaMesh face subset and returns the newly created mesh */ aiMesh* CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh, @@ -184,9 +184,6 @@ protected: aiString FindFilenameForEffectTexture( const ColladaParser& pParser, const Collada::Effect& pEffect, const std::string& pName); - /** Converts a path read from a collada file to the usual representation */ - void ConvertPath( aiString& ss); - /** Reads a float value from an accessor and its data array. * @param pAccessor The accessor to use for reading * @param pData The data array to read from diff --git a/Engine/lib/assimp/code/Collada/ColladaParser.cpp b/Engine/lib/assimp/code/Collada/ColladaParser.cpp new file mode 100644 index 000000000..1a7b96189 --- /dev/null +++ b/Engine/lib/assimp/code/Collada/ColladaParser.cpp @@ -0,0 +1,3473 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 ColladaParser.cpp + * @brief Implementation of the Collada parser helper + */ + +#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER + +#include +#include +#include "ColladaParser.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace Assimp; +using namespace Assimp::Collada; +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 +{ + // validate io-handler instance + if (nullptr == pIOHandler) { + throw DeadlyImportError("IOSystem is NULL."); + } + + std::unique_ptr daefile; + std::unique_ptr zip_archive; + + // Determine type + std::string extension = BaseImporter::GetExtension(pFile); + if (extension != "dae") { + zip_archive.reset(new ZipArchiveIOSystem(pIOHandler, pFile)); + } + + if (zip_archive && zip_archive->isOpen()) { + std::string dae_filename = ReadZaeManifest(*zip_archive); + + if (dae_filename.empty()) { + ThrowException(std::string("Invalid ZAE")); + } + + daefile.reset(zip_archive->Open(dae_filename.c_str())); + if (daefile == nullptr) { + ThrowException(std::string("Invalid ZAE manifest: '") + std::string(dae_filename) + std::string("' is missing")); + } + } + else { + // attempt to open the file directly + daefile.reset(pIOHandler->Open(pFile)); + if (daefile.get() == nullptr) { + throw DeadlyImportError("Failed to open file '" + pFile + "'."); + } + } + + // generate a XML reader for it + std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(daefile.get())); + mReader = irr::io::createIrrXMLReader(mIOWrapper.get()); + if (!mReader) { + ThrowException("Unable to read file, malformed XML"); + } + + // start reading + ReadContents(); + + // read embedded textures + if (zip_archive && zip_archive->isOpen()) { + ReadEmbeddedTextures(*zip_archive); + } +} + +// ------------------------------------------------------------------------------------------------ +// Destructor, private as well +ColladaParser::~ColladaParser() +{ + delete mReader; + for (NodeLibrary::iterator it = mNodeLibrary.begin(); it != mNodeLibrary.end(); ++it) + delete it->second; + for (MeshLibrary::iterator it = mMeshLibrary.begin(); it != mMeshLibrary.end(); ++it) + delete it->second; +} + +// ------------------------------------------------------------------------------------------------ +// Read a ZAE manifest and return the filename to attempt to open +std::string ColladaParser::ReadZaeManifest(ZipArchiveIOSystem &zip_archive) { + // Open the manifest + std::unique_ptr manifestfile(zip_archive.Open("manifest.xml")); + if (manifestfile == nullptr) + { + // No manifest, hope there is only one .DAE inside + std::vector file_list; + zip_archive.getFileListExtension(file_list, "dae"); + + if (file_list.empty()) + return std::string(); + + return file_list.front(); + } + + std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(manifestfile.get())); + std::unique_ptr manifest_reader(irr::io::createIrrXMLReader(mIOWrapper.get())); + + 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->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(); + if (filepath == nullptr) + return std::string(); + + aiString ai_str(filepath); + UriDecodePath(ai_str); + + return std::string(ai_str.C_Str()); + } + } + } + return std::string(); +} + +// ------------------------------------------------------------------------------------------------ +// Convert a path read from a collada file to the usual representation +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)) + { + ss.length -= 7; + memmove(ss.data, ss.data + 7, ss.length); + ss.data[ss.length] = '\0'; + } + + // 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 (ss.data[0] == '/' && isalpha((unsigned char)ss.data[1]) && ss.data[2] == ':') { +#else + if (ss.data[0] == '/' && isalpha(ss.data[1]) && ss.data[2] == ':') { +#endif + --ss.length; + ::memmove(ss.data, ss.data + 1, ss.length); + ss.data[ss.length] = 0; + } + + // 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) + { + // 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 + { + *out++ = *it++; + } + } + + // adjust length and terminator of the shortened string + *out = 0; + ai_assert(out > ss.data); + ss.length = static_cast(out - ss.data); +} + +// ------------------------------------------------------------------------------------------------ +// Read bool from text contents of current element +bool ColladaParser::ReadBoolFromTextContent() +{ + const char* cur = GetTextContent(); + return (!ASSIMP_strincmp(cur, "true", 4) || '0' != *cur); +} + +// ------------------------------------------------------------------------------------------------ +// Read float from text contents of current element +ai_real ColladaParser::ReadFloatFromTextContent() +{ + const char* cur = GetTextContent(); + return fast_atof(cur); +} + +// ------------------------------------------------------------------------------------------------ +// Reads the contents of the file +void ColladaParser::ReadContents() +{ + while (mReader->read()) + { + // handle the root element "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); + + 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)) { + mFormat = FV_1_4_n; + ASSIMP_LOG_DEBUG("Collada schema version is 1.4.n"); + } + else if (!::strncmp(version, "1.3", 3)) { + mFormat = FV_1_3_n; + ASSIMP_LOG_DEBUG("Collada schema version is 1.3.n"); + } + } + + ReadStructure(); + } + else + { + ASSIMP_LOG_DEBUG_F("Ignoring global element <", mReader->getNodeName(), ">."); + SkipElement(); + } + } + else + { + // skip everything else silently + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the structure of the file +void ColladaParser::ReadStructure() +{ + while (mReader->read()) + { + // beginning of elements + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if (IsElement("asset")) + ReadAssetInfo(); + else if (IsElement("library_animations")) + ReadAnimationLibrary(); + else if (IsElement("library_animation_clips")) + ReadAnimationClipLibrary(); + else if (IsElement("library_controllers")) + ReadControllerLibrary(); + else if (IsElement("library_images")) + ReadImageLibrary(); + else if (IsElement("library_materials")) + ReadMaterialLibrary(); + else if (IsElement("library_effects")) + ReadEffectLibrary(); + else if (IsElement("library_geometries")) + ReadGeometryLibrary(); + else if (IsElement("library_visual_scenes")) + ReadSceneLibrary(); + else if (IsElement("library_lights")) + ReadLightLibrary(); + else if (IsElement("library_cameras")) + ReadCameraLibrary(); + else if (IsElement("library_nodes")) + ReadSceneNode(NULL); /* some hacking to reuse this piece of code */ + else if (IsElement("scene")) + ReadScene(); + else + SkipElement(); + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + break; + } + } + + PostProcessRootAnimations(); + PostProcessControllers(); +} + +// ------------------------------------------------------------------------------------------------ +// Reads asset information such as coordinate system information and legal blah +void ColladaParser::ReadAssetInfo() +{ + if (mReader->isEmptyElement()) + return; + + 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 { + mUnitSize = mReader->getAttributeValueAsFloat(attrIndex); + } + + // consume the trailing stuff + if (!mReader->isEmptyElement()) + SkipElement(); + } + else if (IsElement("up_axis")) + { + // read content, strip whitespace, compare + const char* content = GetTextContent(); + if (strncmp(content, "X_UP", 4) == 0) + mUpDirection = UP_X; + else if (strncmp(content, "Z_UP", 4) == 0) + mUpDirection = UP_Z; + else + mUpDirection = UP_Y; + + // check element end + TestClosing("up_axis"); + } + else if (IsElement("contributor")) + { + ReadContributorInfo(); + } + else + { + ReadMetaDataItem(mAssetMetaData); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "asset") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the contributor info +void ColladaParser::ReadContributorInfo() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + ReadMetaDataItem(mAssetMetaData); + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "contributor") != 0) + ThrowException("Expected end of element."); + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a single string metadata item +void ColladaParser::ReadMetaDataItem(StringMetaData &metadata) +{ + // 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) + { + std::string camel_key_str = key_str; + ToCamelCase(camel_key_str); + aiString aistr; + aistr.Set(value_char); + metadata.emplace(camel_key_str, aistr); + } + TestClosing(key_str.c_str()); + } + else + SkipElement(); +} + +// ------------------------------------------------------------------------------------------------ +// Convert underscore_seperated to CamelCase: "authoring_tool" becomes "AuthoringTool" +void ColladaParser::ToCamelCase(std::string &text) +{ + if (text.empty()) + return; + // Capitalise first character + text[0] = ToUpper(text[0]); + for (auto it = text.begin(); it != text.end(); /*iterated below*/) + { + if ((*it) == '_') + { + it = text.erase(it); + if (it != text.end()) + (*it) = ToUpper(*it); + } + else + ++it; + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the animation clips +void ColladaParser::ReadAnimationClipLibrary() +{ + if (mReader->isEmptyElement()) + return; + + 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"); + int indexID = TestAttribute("id"); + if (indexName >= 0) + animName = mReader->getAttributeValue(indexName); + else if (indexID >= 0) + animName = mReader->getAttributeValue(indexID); + else + animName = std::string("animation_") + to_string(mAnimationClipLibrary.size()); + + std::pair > clip; + + clip.first = animName; + + 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 (url[0] != '#') + ThrowException("Unknown reference format"); + + url++; + + clip.second.push_back(url); + } + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "animation_clip") != 0) + ThrowException("Expected end of element."); + + break; + } + } + + if (clip.second.size() > 0) + { + mAnimationClipLibrary.push_back(clip); + } + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "library_animation_clips") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +void ColladaParser::PostProcessControllers() +{ + std::string meshId; + for (ControllerLibrary::iterator it = mControllerLibrary.begin(); it != mControllerLibrary.end(); ++it) { + meshId = it->second.mMeshId; + ControllerLibrary::iterator findItr = mControllerLibrary.find(meshId); + while (findItr != mControllerLibrary.end()) { + meshId = findItr->second.mMeshId; + findItr = mControllerLibrary.find(meshId); + } + + it->second.mMeshId = meshId; + } +} + +// ------------------------------------------------------------------------------------------------ +// Re-build animations from animation clip library, if present, otherwise combine single-channel animations +void ColladaParser::PostProcessRootAnimations() +{ + if (mAnimationClipLibrary.size() > 0) + { + Animation temp; + + for (AnimationClipLibrary::iterator it = mAnimationClipLibrary.begin(); it != mAnimationClipLibrary.end(); ++it) + { + std::string clipName = it->first; + + Animation *clip = new Animation(); + clip->mName = clipName; + + temp.mSubAnims.push_back(clip); + + 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()) + { + Animation *pSourceAnimation = animation->second; + + pSourceAnimation->CollectChannelsRecursively(clip->mChannels); + } + } + } + + mAnims = temp; + + // Ensure no double deletes. + temp.mSubAnims.clear(); + } + else + { + mAnims.CombineSingleChannelAnimations(); + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the animation library +void ColladaParser::ReadAnimationLibrary() +{ + if (mReader->isEmptyElement()) + return; + + 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 + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "library_animations") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an animation into the given parent structure +void ColladaParser::ReadAnimation(Collada::Animation* pParent) +{ + if (mReader->isEmptyElement()) + return; + + // an element may be a container for grouping sub-elements or an animation channel + // this is the channel collection by ID, in case it has channels + typedef std::map ChannelMap; + ChannelMap channels; + // this is the anim container in case we're a container + Animation* anim = NULL; + + // optional name given as an attribute + std::string animName; + std::string animID; + int indexName = TestAttribute("name"); + int indexID = TestAttribute("id"); + + if (indexID >= 0) + animID = mReader->getAttributeValue(indexID); + + if (indexName >= 0) + animName = mReader->getAttributeValue(indexName); + else if (indexID >= 0) + animName = animID; + else + animName = "animation"; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + // we have subanimations + if (IsElement("animation")) + { + // create container from our element + if (!anim) + { + anim = new Animation; + anim->mName = animName; + pParent->mSubAnims.push_back(anim); + } + + // recurse into the subelement + ReadAnimation(anim); + } + else if (IsElement("source")) + { + // possible animation data - we'll never know. Better store it + ReadSource(); + } + else if (IsElement("sampler")) + { + // read the ID to assign the corresponding collada channel afterwards. + int indexID = GetAttribute("id"); + std::string id = mReader->getAttributeValue(indexID); + ChannelMap::iterator newChannel = channels.insert(std::make_pair(id, AnimationChannel())).first; + + // have it read into a channel + ReadAnimationSampler(newChannel->second); + } + 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); + if (sourceId[0] == '#') + sourceId++; + ChannelMap::iterator cit = channels.find(sourceId); + if (cit != channels.end()) + cit->second.mTarget = mReader->getAttributeValue(indexTarget); + + if (!mReader->isEmptyElement()) + SkipElement(); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "animation") != 0) + ThrowException("Expected end of element."); + + break; + } + } + + // it turned out to have channels - add them + 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) + { + pParent->mChannels.push_back( channels.begin()->second); + } else +*/ + { + // else create the animation, if not done yet, and store the channels + if (!anim) + { + anim = new Animation; + anim->mName = animName; + pParent->mSubAnims.push_back(anim); + } + for (ChannelMap::const_iterator it = channels.begin(); it != channels.end(); ++it) + anim->mChannels.push_back(it->second); + + if (indexID >= 0) + { + mAnimationLibrary[animID] = anim; + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// 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")) + { + int indexSemantic = GetAttribute("semantic"); + const char* semantic = mReader->getAttributeValue(indexSemantic); + int indexSource = GetAttribute("source"); + const char* source = mReader->getAttributeValue(indexSource); + if (source[0] != '#') + ThrowException("Unsupported URL format"); + source++; + + if (strcmp(semantic, "INPUT") == 0) + pChannel.mSourceTimes = source; + else if (strcmp(semantic, "OUTPUT") == 0) + pChannel.mSourceValues = source; + else if (strcmp(semantic, "IN_TANGENT") == 0) + pChannel.mInTanValues = source; + else if (strcmp(semantic, "OUT_TANGENT") == 0) + pChannel.mOutTanValues = source; + else if (strcmp(semantic, "INTERPOLATION") == 0) + pChannel.mInterpolationValues = source; + + if (!mReader->isEmptyElement()) + SkipElement(); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "sampler") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the skeleton controller library +void ColladaParser::ReadControllerLibrary() +{ + if (mReader->isEmptyElement()) + return; + + 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); + + // create an entry and store it in the library under its ID + mControllerLibrary[id] = Controller(); + + // read on from there + ReadController(mControllerLibrary[id]); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "library_controllers") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a controller into the given mesh structure +void ColladaParser::ReadController(Collada::Controller& pController) +{ + // initial values + pController.mType = Skin; + pController.mMethod = Normalized; + 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")) + { + pController.mType = Morph; + int baseIndex = GetAttribute("source"); + pController.mMeshId = mReader->getAttributeValue(baseIndex) + 1; + int methodIndex = GetAttribute("method"); + if (methodIndex > 0) { + const char *method = mReader->getAttributeValue(methodIndex); + if (strcmp(method, "RELATIVE") == 0) + pController.mMethod = Relative; + } + } + 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")) + { + // content is 16 floats to define a matrix... it seems to be important for some models + const char* content = GetTextContent(); + + // read the 16 floats + for (unsigned int a = 0; a < 16; a++) + { + // read a number + content = fast_atoreal_move(content, pController.mBindShapeMatrix[a]); + // skip whitespace after it + SkipSpacesAndLineEnd(&content); + } + + TestClosing("bind_shape_matrix"); + } + else if (IsElement("source")) + { + // data array - we have specialists to handle this + ReadSource(); + } + else if (IsElement("joints")) + { + ReadControllerJoints(pController); + } + else if (IsElement("vertex_weights")) + { + ReadControllerWeights(pController); + } + else if (IsElement("targets")) + { + while (mReader->read()) { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("input")) { + int semanticsIndex = GetAttribute("semantic"); + int sourceIndex = GetAttribute("source"); + + const char *semantics = mReader->getAttributeValue(semanticsIndex); + const char *source = mReader->getAttributeValue(sourceIndex); + if (strcmp(semantics, "MORPH_TARGET") == 0) { + pController.mMorphTarget = source + 1; + } + else if (strcmp(semantics, "MORPH_WEIGHT") == 0) + { + pController.mMorphWeight = source + 1; + } + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "targets") == 0) + break; + else + ThrowException("Expected end of element."); + } + } + } + else + { + // ignore the rest + SkipElement(); + } + } + 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) + ThrowException("Expected end of element."); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the joint definitions for the given controller +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")) + { + int indexSemantic = GetAttribute("semantic"); + const char* attrSemantic = mReader->getAttributeValue(indexSemantic); + int indexSource = GetAttribute("source"); + const char* attrSource = mReader->getAttributeValue(indexSource); + + // local URLS always start with a '#'. We don't support global URLs + if (attrSource[0] != '#') + ThrowException(format() << "Unsupported URL format in \"" << attrSource << "\" in source attribute of data element"); + attrSource++; + + // parse source URL to corresponding source + if (strcmp(attrSemantic, "JOINT") == 0) + pController.mJointNameSource = attrSource; + else if (strcmp(attrSemantic, "INV_BIND_MATRIX") == 0) + pController.mJointOffsetMatrixSource = attrSource; + else + ThrowException(format() << "Unknown semantic \"" << attrSemantic << "\" in data element"); + + // skip inner data, if present + if (!mReader->isEmptyElement()) + SkipElement(); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "joints") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the joint weights for the given controller +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) + { + // Input channels for weight data. Two possible semantics: "JOINT" and "WEIGHT" + if (IsElement("input") && vertexCount > 0) + { + InputChannel channel; + + int indexSemantic = GetAttribute("semantic"); + const char* attrSemantic = mReader->getAttributeValue(indexSemantic); + int indexSource = GetAttribute("source"); + const char* attrSource = mReader->getAttributeValue(indexSource); + int indexOffset = TestAttribute("offset"); + if (indexOffset >= 0) + channel.mOffset = mReader->getAttributeValueAsInt(indexOffset); + + // local URLS always start with a '#'. We don't support global URLs + if (attrSource[0] != '#') + ThrowException(format() << "Unsupported URL format in \"" << attrSource << "\" in source attribute of data element"); + channel.mAccessor = attrSource + 1; + + // parse source URL to corresponding source + if (strcmp(attrSemantic, "JOINT") == 0) + pController.mWeightInputJoints = channel; + else if (strcmp(attrSemantic, "WEIGHT") == 0) + pController.mWeightInputWeights = channel; + else + ThrowException(format() << "Unknown semantic \"" << attrSemantic << "\" in data element"); + + // skip inner data, if present + if (!mReader->isEmptyElement()) + SkipElement(); + } + else if (IsElement("vcount") && vertexCount > 0) + { + // read weight count per vertex + const char* text = GetTextContent(); + size_t numWeights = 0; + for (std::vector::iterator it = pController.mWeightCounts.begin(); it != pController.mWeightCounts.end(); ++it) + { + if (*text == 0) + ThrowException("Out of data while reading "); + + *it = strtoul10(text, &text); + numWeights += *it; + SkipSpacesAndLineEnd(&text); + } + + TestClosing("vcount"); + + // reserve weight count + pController.mWeights.resize(numWeights); + } + else if (IsElement("v") && vertexCount > 0) + { + // read JointIndex - WeightIndex pairs + const char* text = GetTextContent(); + + for (std::vector< std::pair >::iterator it = pController.mWeights.begin(); it != pController.mWeights.end(); ++it) + { + if (*text == 0) + ThrowException("Out of data while reading "); + it->first = strtoul10(text, &text); + SkipSpacesAndLineEnd(&text); + if (*text == 0) + ThrowException("Out of data while reading "); + it->second = strtoul10(text, &text); + SkipSpacesAndLineEnd(&text); + } + + TestClosing("v"); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "vertex_weights") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the image library contents +void ColladaParser::ReadImageLibrary() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + 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); + + // create an entry and store it in the library under its ID + mImageLibrary[id] = Image(); + + // read on from there + ReadImage(mImageLibrary[id]); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "library_images") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an image entry into the given image +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) + { + // FIX: C4D exporter writes empty tags + if (!mReader->isEmptyElement()) { + // element content is filename - hopefully + const char* sz = TestTextContent(); + if (sz) + { + aiString filepath(sz); + UriDecodePath(filepath); + pImage.mFileName = filepath.C_Str(); + } + TestClosing("init_from"); + } + if (!pImage.mFileName.length()) { + pImage.mFileName = "unknown_texture"; + } + } + 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. + int attrib = TestAttribute("array_index"); + if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) { + ASSIMP_LOG_WARN("Collada: Ignoring texture array index"); + continue; + } + + attrib = TestAttribute("mip_index"); + if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) { + ASSIMP_LOG_WARN("Collada: Ignoring MIP map layer"); + continue; + } + + // TODO: correctly jump over cube and volume maps? + } + } + else if (mFormat == FV_1_5_n) + { + if (IsElement("ref")) + { + // element content is filename - hopefully + 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()) + { + // 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); + + 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 unsigned int size = (unsigned int)(cur - data) * 2; + pImage.mImageData.resize(size); + for (unsigned int i = 0; i < size; ++i) + pImage.mImageData[i] = HexOctetToDecimal(data + (i << 1)); + + TestClosing("hex"); + } + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "image") == 0) + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the material library +void ColladaParser::ReadMaterialLibrary() +{ + if (mReader->isEmptyElement()) + return; + + std::map names; + 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); + + std::string name; + int attrName = TestAttribute("name"); + if (attrName >= 0) + name = mReader->getAttributeValue(attrName); + + // create an entry and store it in the library under its ID + mMaterialLibrary[id] = Material(); + + if (!name.empty()) + { + std::map::iterator it = names.find(name); + if (it != names.end()) + { + std::ostringstream strStream; + strStream << ++it->second; + name.append(" " + strStream.str()); + } + else + { + names[name] = 0; + } + + mMaterialLibrary[id].mName = name; + } + + ReadMaterial(mMaterialLibrary[id]); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "library_materials") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the light library +void ColladaParser::ReadLightLibrary() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + 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); + + // create an entry and store it in the library under its ID + ReadLight(mLightLibrary[id] = Light()); + + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "library_lights") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the camera library +void ColladaParser::ReadCameraLibrary() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + 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]; + attrID = TestAttribute("name"); + if (attrID != -1) + cam.mName = mReader->getAttributeValue(attrID); + + ReadCamera(cam); + + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "library_cameras") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a material entry into the given material +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")) + { + // referred effect by URL + int attrUrl = GetAttribute("url"); + const char* url = mReader->getAttributeValue(attrUrl); + if (url[0] != '#') + ThrowException("Unknown reference format"); + + pMaterial.mEffect = url + 1; + + SkipElement(); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "material") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a light entry into the given light +void ColladaParser::ReadLight(Collada::Light& pLight) +{ + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("light")) { + SkipElement(); + } + else if (IsElement("spot")) { + pLight.mType = aiLightSource_SPOT; + } + else if (IsElement("ambient")) { + pLight.mType = aiLightSource_AMBIENT; + } + else if (IsElement("directional")) { + pLight.mType = aiLightSource_DIRECTIONAL; + } + else if (IsElement("point")) { + pLight.mType = aiLightSource_POINT; + } + else if (IsElement("color")) { + // text content contains 3 floats + const char* content = GetTextContent(); + + content = fast_atoreal_move(content, (ai_real&)pLight.mColor.r); + SkipSpacesAndLineEnd(&content); + + content = fast_atoreal_move(content, (ai_real&)pLight.mColor.g); + SkipSpacesAndLineEnd(&content); + + content = fast_atoreal_move(content, (ai_real&)pLight.mColor.b); + SkipSpacesAndLineEnd(&content); + + TestClosing("color"); + } + else if (IsElement("constant_attenuation")) { + pLight.mAttConstant = ReadFloatFromTextContent(); + TestClosing("constant_attenuation"); + } + else if (IsElement("linear_attenuation")) { + pLight.mAttLinear = ReadFloatFromTextContent(); + TestClosing("linear_attenuation"); + } + else if (IsElement("quadratic_attenuation")) { + pLight.mAttQuadratic = ReadFloatFromTextContent(); + TestClosing("quadratic_attenuation"); + } + else if (IsElement("falloff_angle")) { + pLight.mFalloffAngle = ReadFloatFromTextContent(); + TestClosing("falloff_angle"); + } + else if (IsElement("falloff_exponent")) { + pLight.mFalloffExponent = ReadFloatFromTextContent(); + TestClosing("falloff_exponent"); + } + // FCOLLADA extensions + // ------------------------------------------------------- + else if (IsElement("outer_cone")) { + pLight.mOuterAngle = ReadFloatFromTextContent(); + TestClosing("outer_cone"); + } + // ... and this one is even deprecated + else if (IsElement("penumbra_angle")) { + pLight.mPenumbraAngle = ReadFloatFromTextContent(); + TestClosing("penumbra_angle"); + } + else if (IsElement("intensity")) { + pLight.mIntensity = ReadFloatFromTextContent(); + TestClosing("intensity"); + } + else if (IsElement("falloff")) { + pLight.mOuterAngle = ReadFloatFromTextContent(); + TestClosing("falloff"); + } + else if (IsElement("hotspot_beam")) { + pLight.mFalloffAngle = ReadFloatFromTextContent(); + TestClosing("hotspot_beam"); + } + // OpenCOLLADA extensions + // ------------------------------------------------------- + else if (IsElement("decay_falloff")) { + pLight.mOuterAngle = ReadFloatFromTextContent(); + TestClosing("decay_falloff"); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "light") == 0) + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a camera entry into the given light +void ColladaParser::ReadCamera(Collada::Camera& pCamera) +{ + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("camera")) { + SkipElement(); + } + else if (IsElement("orthographic")) { + pCamera.mOrtho = true; + } + else if (IsElement("xfov") || IsElement("xmag")) { + pCamera.mHorFov = ReadFloatFromTextContent(); + TestClosing((pCamera.mOrtho ? "xmag" : "xfov")); + } + else if (IsElement("yfov") || IsElement("ymag")) { + pCamera.mVerFov = ReadFloatFromTextContent(); + TestClosing((pCamera.mOrtho ? "ymag" : "yfov")); + } + else if (IsElement("aspect_ratio")) { + pCamera.mAspect = ReadFloatFromTextContent(); + TestClosing("aspect_ratio"); + } + else if (IsElement("znear")) { + pCamera.mZNear = ReadFloatFromTextContent(); + TestClosing("znear"); + } + else if (IsElement("zfar")) { + pCamera.mZFar = ReadFloatFromTextContent(); + TestClosing("zfar"); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "camera") == 0) + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the effect library +void ColladaParser::ReadEffectLibrary() +{ + if (mReader->isEmptyElement()) { + return; + } + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + 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); + + // create an entry and store it in the library under its ID + mEffectLibrary[id] = Effect(); + // read on from there + ReadEffect(mEffectLibrary[id]); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "library_effects") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an effect entry into the given effect +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) + { + if (IsElement("profile_COMMON")) + ReadEffectProfileCommon(pEffect); + else + SkipElement(); + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "effect") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an COMMON effect profile +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")) + { + // just syntactic sugar + } + + 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); + + // create an entry and store it in the library under its ID + mImageLibrary[id] = Image(); + + // read on from there + ReadImage(mImageLibrary[id]); + } + + /* Shading modes */ + else if (IsElement("phong")) + pEffect.mShadeType = Shade_Phong; + else if (IsElement("constant")) + pEffect.mShadeType = Shade_Constant; + else if (IsElement("lambert")) + pEffect.mShadeType = Shade_Lambert; + else if (IsElement("blinn")) + pEffect.mShadeType = Shade_Blinn; + + /* Color + texture properties */ + else if (IsElement("emission")) + ReadEffectColor(pEffect.mEmissive, pEffect.mTexEmissive); + else if (IsElement("ambient")) + ReadEffectColor(pEffect.mAmbient, pEffect.mTexAmbient); + else if (IsElement("diffuse")) + ReadEffectColor(pEffect.mDiffuse, pEffect.mTexDiffuse); + else if (IsElement("specular")) + ReadEffectColor(pEffect.mSpecular, pEffect.mTexSpecular); + else if (IsElement("reflective")) { + ReadEffectColor(pEffect.mReflective, pEffect.mTexReflective); + } + else if (IsElement("transparent")) { + pEffect.mHasTransparency = true; + + const char* opaque = mReader->getAttributeValueSafe("opaque"); + + if (::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "RGB_ONE") == 0) { + pEffect.mRGBTransparency = true; + } + + // In RGB_ZERO mode, the transparency is interpreted in reverse, go figure... + if (::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "A_ZERO") == 0) { + pEffect.mInvertTransparency = true; + } + + ReadEffectColor(pEffect.mTransparent, pEffect.mTexTransparent); + } + else if (IsElement("shininess")) + ReadEffectFloat(pEffect.mShininess); + else if (IsElement("reflectivity")) + ReadEffectFloat(pEffect.mReflectivity); + + /* Single scalar properties */ + else if (IsElement("transparency")) + ReadEffectFloat(pEffect.mTransparency); + else if (IsElement("index_of_refraction")) + ReadEffectFloat(pEffect.mRefractIndex); + + // GOOGLEEARTH/OKINO extensions + // ------------------------------------------------------- + else if (IsElement("double_sided")) + pEffect.mDoubleSided = ReadBoolFromTextContent(); + + // FCOLLADA extensions + // ------------------------------------------------------- + else if (IsElement("bump")) { + aiColor4D dummy; + ReadEffectColor(dummy, pEffect.mTexBump); + } + + // MAX3D extensions + // ------------------------------------------------------- + else if (IsElement("wireframe")) { + pEffect.mWireframe = ReadBoolFromTextContent(); + TestClosing("wireframe"); + } + else if (IsElement("faceted")) { + pEffect.mFaceted = ReadBoolFromTextContent(); + TestClosing("faceted"); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "profile_COMMON") == 0) + { + break; + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Read texture wrapping + UV transform settings from a profile==Maya chunk +void ColladaParser::ReadSamplerProperties(Sampler& out) +{ + if (mReader->isEmptyElement()) { + return; + } + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + + // MAYA extensions + // ------------------------------------------------------- + if (IsElement("wrapU")) { + out.mWrapU = ReadBoolFromTextContent(); + TestClosing("wrapU"); + } + else if (IsElement("wrapV")) { + out.mWrapV = ReadBoolFromTextContent(); + TestClosing("wrapV"); + } + else if (IsElement("mirrorU")) { + out.mMirrorU = ReadBoolFromTextContent(); + TestClosing("mirrorU"); + } + else if (IsElement("mirrorV")) { + out.mMirrorV = ReadBoolFromTextContent(); + TestClosing("mirrorV"); + } + else if (IsElement("repeatU")) { + out.mTransform.mScaling.x = ReadFloatFromTextContent(); + TestClosing("repeatU"); + } + else if (IsElement("repeatV")) { + out.mTransform.mScaling.y = ReadFloatFromTextContent(); + TestClosing("repeatV"); + } + else if (IsElement("offsetU")) { + out.mTransform.mTranslation.x = ReadFloatFromTextContent(); + TestClosing("offsetU"); + } + else if (IsElement("offsetV")) { + out.mTransform.mTranslation.y = ReadFloatFromTextContent(); + TestClosing("offsetV"); + } + else if (IsElement("rotateUV")) { + out.mTransform.mRotation = ReadFloatFromTextContent(); + TestClosing("rotateUV"); + } + else if (IsElement("blend_mode")) { + + 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)) + out.mOp = aiTextureOp_Add; + + else if (0 == ASSIMP_strincmp(sz, "SUBTRACT", 8)) + out.mOp = aiTextureOp_Subtract; + + else if (0 == ASSIMP_strincmp(sz, "MULTIPLY", 8)) + out.mOp = aiTextureOp_Multiply; + + else { + ASSIMP_LOG_WARN("Collada: Unsupported MAYA texture blend mode"); + } + TestClosing("blend_mode"); + } + // OKINO extensions + // ------------------------------------------------------- + else if (IsElement("weighting")) { + out.mWeighting = ReadFloatFromTextContent(); + TestClosing("weighting"); + } + else if (IsElement("mix_with_previous_layer")) { + out.mMixWithPrevious = ReadFloatFromTextContent(); + TestClosing("mix_with_previous_layer"); + } + // MAX3D extensions + // ------------------------------------------------------- + else if (IsElement("amount")) { + out.mWeighting = ReadFloatFromTextContent(); + TestClosing("amount"); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "technique") == 0) + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an effect entry containing a color or a texture defining that color +void ColladaParser::ReadEffectColor(aiColor4D& pColor, Sampler& pSampler) +{ + if (mReader->isEmptyElement()) + return; + + // Save current element name + const std::string curElem = mReader->getNodeName(); + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("color")) + { + // text content contains 4 floats + const char* content = GetTextContent(); + + content = fast_atoreal_move(content, (ai_real&)pColor.r); + SkipSpacesAndLineEnd(&content); + + content = fast_atoreal_move(content, (ai_real&)pColor.g); + SkipSpacesAndLineEnd(&content); + + content = fast_atoreal_move(content, (ai_real&)pColor.b); + SkipSpacesAndLineEnd(&content); + + content = fast_atoreal_move(content, (ai_real&)pColor.a); + SkipSpacesAndLineEnd(&content); + TestClosing("color"); + } + else if (IsElement("texture")) + { + // get name of source texture/sampler + int attrTex = GetAttribute("texture"); + pSampler.mName = mReader->getAttributeValue(attrTex); + + // get name of UV source channel. Specification demands it to be there, but some exporters + // don't write it. It will be the default UV channel in case it's missing. + attrTex = TestAttribute("texcoord"); + if (attrTex >= 0) + pSampler.mUVChannel = mReader->getAttributeValue(attrTex); + //SkipElement(); + + // 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")) + { + const int _profile = GetAttribute("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")) + { + // get more information on this sampler + ReadSamplerProperties(pSampler); + } + else SkipElement(); + } + else if (!IsElement("extra")) + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (mReader->getNodeName() == curElem) + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an effect entry containing a float +void ColladaParser::ReadEffectFloat(ai_real& pFloat) +{ + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("float")) + { + // text content contains a single floats + const char* content = GetTextContent(); + content = fast_atoreal_move(content, pFloat); + SkipSpacesAndLineEnd(&content); + + TestClosing("float"); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads an effect parameter specification of any kind +void ColladaParser::ReadEffectParam(Collada::EffectParam& pParam) +{ + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("surface")) + { + // image ID given inside tags + TestOpening("init_from"); + 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)) + { + // surface ID is given inside tags + TestOpening("source"); + 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")) + { + // surface ID is given inside tags + TestOpening("instance_image"); + int attrURL = GetAttribute("url"); + 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 + { + // ignore unknown element + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the geometry library contents +void ColladaParser::ReadGeometryLibrary() +{ + if (mReader->isEmptyElement()) + return; + + 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); + + // 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; + + // 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); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "library_geometries") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a geometry from the geometry library. +void ColladaParser::ReadGeometry(Collada::Mesh* pMesh) +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if (IsElement("mesh")) + { + // read on from there + ReadMesh(pMesh); + } + else + { + // ignore the rest + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "geometry") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a mesh from the geometry library +void ColladaParser::ReadMesh(Mesh* pMesh) +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) + { + if (IsElement("source")) + { + // we have professionals dealing with this + ReadSource(); + } + 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")) + { + // read per-index mesh data and faces setup + ReadIndexData(pMesh); + } + else + { + // ignore the restf + SkipElement(); + } + } + 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) + { + // end of element - we're done here + break; + } + else + { + // everything else should be punished + ThrowException("Expected end of element."); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a source element +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")) + { + ReadDataArray(); + } + else if (IsElement("technique_common")) + { + // I don't care for your profiles + } + else if (IsElement("accessor")) + { + ReadAccessor(sourceID); + } + else + { + // ignore the rest + SkipElement(); + } + } + 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) + { + // end of another meaningless element - read over it + } + else + { + // everything else should be punished + ThrowException("Expected end of element."); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a data array holding a number of floats, and stores it in the global library +void ColladaParser::ReadDataArray() +{ + std::string elmName = mReader->getNodeName(); + bool isStringArray = (elmName == "IDREF_array" || elmName == "Name_array"); + bool isEmptyElement = mReader->isEmptyElement(); + + // read attributes + int indexID = GetAttribute("id"); + std::string id = mReader->getAttributeValue(indexID); + int indexCount = GetAttribute("count"); + unsigned int count = (unsigned int)mReader->getAttributeValueAsInt(indexCount); + const char* content = TestTextContent(); + + // read values and store inside an array in the data library + mDataLibrary[id] = Data(); + 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) + { + data.mStrings.reserve(count); + std::string s; + + for (unsigned int a = 0; a < count; a++) + { + if (*content == 0) + ThrowException("Expected more values while reading IDREF_array contents."); + + s.clear(); + while (!IsSpaceOrNewLine(*content)) + s += *content++; + data.mStrings.push_back(s); + + SkipSpacesAndLineEnd(&content); + } + } + else + { + data.mValues.reserve(count); + + for (unsigned int a = 0; a < count; a++) + { + if (*content == 0) + ThrowException("Expected more values while reading float_array contents."); + + ai_real value; + // read a number + content = fast_atoreal_move(content, value); + data.mValues.push_back(value); + // skip whitespace after it + SkipSpacesAndLineEnd(&content); + } + } + } + + // test for closing tag + if (!isEmptyElement) + TestClosing(elmName.c_str()); +} + +// ------------------------------------------------------------------------------------------------ +// Reads an accessor and stores it in the global library +void ColladaParser::ReadAccessor(const std::string& pID) +{ + // read accessor attributes + int attrSource = GetAttribute("source"); + 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"); + unsigned int count = (unsigned int)mReader->getAttributeValueAsInt(attrCount); + int attrOffset = TestAttribute("offset"); + unsigned int offset = 0; + if (attrOffset > -1) + offset = (unsigned int)mReader->getAttributeValueAsInt(attrOffset); + int attrStride = TestAttribute("stride"); + unsigned int stride = 1; + if (attrStride > -1) + stride = (unsigned int)mReader->getAttributeValueAsInt(attrStride); + + // store in the library under the given ID + mAccessorLibrary[pID] = Accessor(); + Accessor& acc = mAccessorLibrary[pID]; + acc.mCount = count; + acc.mOffset = offset; + acc.mStride = stride; + acc.mSource = source + 1; // ignore the leading '#' + 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")) + { + // read data param + int attrName = TestAttribute("name"); + std::string name; + 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(); + + /* 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(); + + /* 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 == "Q") acc.mSubOffset[3] = acc.mParams.size(); + /* 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(); + //else + // DefaultLogger::get()->warn( format() << "Unknown accessor parameter \"" << name << "\". Ignoring data channel." ); + } + + // read data type + int attrType = TestAttribute("type"); + 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. + std::string type = mReader->getAttributeValue(attrType); + if (type == "float4x4") + acc.mSize += 16; + else + acc.mSize += 1; + } + + acc.mParams.push_back(name); + + // skip remaining stuff of this element, if any + SkipElement(); + } + else + { + ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag "); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "accessor") != 0) + ThrowException("Expected end of element."); + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads input declarations of per-vertex mesh data into the given mesh +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")) + { + ReadInputChannel(pMesh->mPerVertexData); + } + else + { + ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag "); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (strcmp(mReader->getNodeName(), "vertices") != 0) + ThrowException("Expected end of element."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads input declarations of per-index mesh data into the given mesh +void ColladaParser::ReadIndexData(Mesh* pMesh) +{ + std::vector vcount; + std::vector perIndexData; + + // read primitive count from the attribute + int attrCount = GetAttribute("count"); + size_t numPrimitives = (size_t)mReader->getAttributeValueAsInt(attrCount); + // some mesh types (e.g. tristrips) don't specify primitive count upfront, + // so we need to sum up the actual number of primitives while we read the

-tags + size_t actualPrimitives = 0; + + // material subgroup + int attrMaterial = TestAttribute("material"); + SubMesh subgroup; + if (attrMaterial > -1) + subgroup.mMaterial = mReader->getAttributeValue(attrMaterial); + + // distinguish between polys and triangles + std::string elementName = mReader->getNodeName(); + PrimitiveType primType = Prim_Invalid; + if (IsElement("lines")) + primType = Prim_Lines; + else if (IsElement("linestrips")) + primType = Prim_LineStrip; + else if (IsElement("polygons")) + primType = Prim_Polygon; + else if (IsElement("polylist")) + primType = Prim_Polylist; + else if (IsElement("triangles")) + primType = Prim_Triangles; + else if (IsElement("trifans")) + primType = Prim_TriFans; + else if (IsElement("tristrips")) + primType = Prim_TriStrips; + + 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")) + { + ReadInputChannel(perIndexData); + } + 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(); + vcount.reserve(numPrimitives); + for (unsigned int a = 0; a < numPrimitives; a++) + { + if (*content == 0) + ThrowException("Expected more values while reading contents."); + // read a number + vcount.push_back((size_t)strtoul10(content, &content)); + // skip whitespace after it + SkipSpacesAndLineEnd(&content); + } + } + + TestClosing("vcount"); + } + } + 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")) + { + SkipElement("extra"); + } + else if (IsElement("ph")) { + SkipElement("ph"); + } + else { + ThrowException(format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag <" << elementName << ">"); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + { + if (mReader->getNodeName() != elementName) + ThrowException(format() << "Expected end of <" << elementName << "> element."); + + break; + } + } + +#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'. + ai_assert(actualPrimitives == numPrimitives); + } +#endif + + // 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); +} + +// ------------------------------------------------------------------------------------------------ +// Reads a single input channel element and stores it in the given array, if valid +void ColladaParser::ReadInputChannel(std::vector& poChannels) +{ + InputChannel channel; + + // read semantic + int attrSemantic = GetAttribute("semantic"); + std::string semantic = mReader->getAttributeValue(attrSemantic); + channel.mType = GetTypeForSemantic(semantic); + + // read source + int attrSource = GetAttribute("source"); + 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 + + // read index offset, if per-index + int attrOffset = TestAttribute("offset"); + if (attrOffset > -1) + channel.mOffset = mReader->getAttributeValueAsInt(attrOffset); + + // read set if texture coordinates + if (channel.mType == IT_Texcoord || channel.mType == IT_Color) { + int attrSet = TestAttribute("set"); + if (attrSet > -1) { + attrSet = mReader->getAttributeValueAsInt(attrSet); + if (attrSet < 0) + ThrowException(format() << "Invalid index \"" << (attrSet) << "\" in set attribute of element"); + + channel.mIndex = attrSet; + } + } + + // store, if valid type + if (channel.mType != IT_Invalid) + poChannels.push_back(channel); + + // skip remaining stuff of this element, if any + SkipElement(); +} + +// ------------------------------------------------------------------------------------------------ +// 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) +{ + // 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) + { + numOffsets = std::max(numOffsets, channel.mOffset + 1); + if (channel.mType == IT_Vertex) + perVertexOffset = channel.mOffset; + } + + // determine the expected number of indices + size_t expectedPointCount = 0; + switch (pPrimType) + { + case Prim_Polylist: + { + for (size_t i : pVCount) + expectedPointCount += i; + break; + } + case Prim_Lines: + expectedPointCount = 2 * pNumPrimitives; + break; + case Prim_Triangles: + expectedPointCount = 3 * pNumPrimitives; + break; + default: + // other primitive types don't state the index count upfront... we need to guess + break; + } + + // and read all indices into a temporary array + std::vector indices; + if (expectedPointCount > 0) + indices.reserve(expectedPointCount * numOffsets); + + if (pNumPrimitives > 0) // It is possible to not contain any indices + { + 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)); + indices.push_back(size_t(value)); + // skip whitespace after it + SkipSpacesAndLineEnd(&content); + } + } + + // complain if the index count doesn't fit + if (expectedPointCount > 0 && indices.size() != expectedPointCount * numOffsets) { + if (pPrimType == Prim_Lines) { + // 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 + ThrowException("Expected different index count in

element."); + + } + 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; + 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; + 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; + if (input.mResolved) + continue; + + // 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) + ThrowException("Unsupported vertex referencing scheme."); + continue; + } + + // find accessor + input.mResolved = &ResolveLibraryReference(mAccessorLibrary, input.mAccessor); + // resolve accessor's data pointer as well, if necessary + const Accessor* acc = input.mResolved; + if (!acc->mData) + acc->mData = &ResolveLibraryReference(mDataLibrary, acc->mSource); + } + + // For continued primitives, the given count does not come all in one

, but only one primitive per

+ size_t numPrimitives = pNumPrimitives; + if (pPrimType == Prim_TriFans || pPrimType == Prim_Polygon) + numPrimitives = 1; + // For continued primitives, the given count is actually the number of

's inside the parent tag + if (pPrimType == Prim_TriStrips) { + size_t numberOfVertices = indices.size() / numOffsets; + numPrimitives = numberOfVertices - 2; + } + if (pPrimType == Prim_LineStrip) { + size_t numberOfVertices = indices.size() / numOffsets; + numPrimitives = numberOfVertices - 1; + } + + pMesh->mFaceSize.reserve(numPrimitives); + pMesh->mFacePosIndices.reserve(indices.size() / numOffsets); + + size_t polylistStartVertex = 0; + for (size_t currentPrimitive = 0; currentPrimitive < numPrimitives; currentPrimitive++) + { + // determine number of points for this primitive + size_t numPoints = 0; + switch (pPrimType) + { + case Prim_Lines: + numPoints = 2; + for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) + CopyVertex(currentVertex, numOffsets, numPoints, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); + break; + case Prim_LineStrip: + numPoints = 2; + for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) + CopyVertex(currentVertex, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); + break; + case Prim_Triangles: + numPoints = 3; + for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) + CopyVertex(currentVertex, numOffsets, numPoints, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); + break; + case Prim_TriStrips: + numPoints = 3; + ReadPrimTriStrips(numOffsets, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); + break; + case Prim_Polylist: + numPoints = pVCount[currentPrimitive]; + for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) + CopyVertex(polylistStartVertex + currentVertex, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, 0, indices); + polylistStartVertex += numPoints; + break; + case Prim_TriFans: + case Prim_Polygon: + numPoints = indices.size() / numOffsets; + for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) + CopyVertex(currentVertex, numOffsets, numPoints, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); + break; + default: + // LineStrip is not supported due to expected index unmangling + ThrowException("Unsupported primitive type."); + break; + } + + // store the face size to later reconstruct the face from + pMesh->mFaceSize.push_back(numPoints); + } + + // if I ever get my hands on that guy who invented this steaming pile of indirection... + TestClosing("p"); + return numPrimitives; +} + +///@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) { + // calculate the base offset of the vertex whose attributes we ant to copy + size_t baseOffset = currentPrimitive * numOffsets * numPoints + currentVertex * numOffsets; + + // don't overrun the boundaries of the index list + 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) + 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]); +} + +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 + 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); + } +} + +// ------------------------------------------------------------------------------------------------ +// 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) +{ + // ignore vertex referrer - we handle them that separate + if (pInput.mType == IT_Vertex) + return; + + 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; + + // assemble according to the accessors component sub-offset list. We don't care, yet, + // what kind of object exactly we're extracting here + ai_real obj[4]; + for (size_t c = 0; c < 4; ++c) + obj[c] = dataObject[acc.mSubOffset[c]]; + + // now we reinterpret it according to the type we're reading here + 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])); + 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)); + + // 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])); + 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)); + + // 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])); + 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)); + + // 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])); + else + ASSIMP_LOG_ERROR("Collada: just one vertex bitangent stream supported"); + break; + case IT_Texcoord: + // 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)); + + 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 + { + 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) + { + // 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)); + + 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); + } + else + { + ASSIMP_LOG_ERROR("Collada: too many vertex color sets. Skipping."); + } + + break; + default: + // IT_Invalid and IT_Vertex + ai_assert(false && "shouldn't ever get here"); + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads the library of node hierarchies and scene parts +void ColladaParser::ReadSceneLibrary() +{ + if (mReader->isEmptyElement()) + return; + + 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")) + { + // 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); + + // read name if given. + int indexName = TestAttribute("name"); + 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->mID = attrID; + node->mName = attrName; + mNodeLibrary[node->mID] = node; + + ReadSceneNode(node); + } + else + { + // ignore the rest + SkipElement(); + } + } + 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."); + + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a scene node's contents including children and stores it in the given node +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; + int attrID = TestAttribute("id"); + if (attrID > -1) + child->mID = mReader->getAttributeValue(attrID); + int attrSID = TestAttribute("sid"); + if (attrSID > -1) + child->mSID = mReader->getAttributeValue(attrSID); + + int attrName = TestAttribute("name"); + if (attrName > -1) + child->mName = mReader->getAttributeValue(attrName); + + // TODO: (thom) support SIDs + // ai_assert( TestAttribute( "sid") == -1); + + if (pNode) + { + pNode->mChildren.push_back(child); + child->mParent = pNode; + } + else + { + // no parent node given, probably called from element. + // create new node in node library + mNodeLibrary[child->mID] = child; + } + + // read on recursively from there + ReadSceneNode(child); + continue; + } + // For any further stuff we need a valid node to work on + else if (!pNode) + continue; + + if (IsElement("lookat")) + ReadNodeTransformation(pNode, TF_LOOKAT); + else if (IsElement("matrix")) + ReadNodeTransformation(pNode, TF_MATRIX); + else if (IsElement("rotate")) + ReadNodeTransformation(pNode, TF_ROTATE); + else if (IsElement("scale")) + ReadNodeTransformation(pNode, TF_SCALE); + else if (IsElement("skew")) + ReadNodeTransformation(pNode, TF_SKEW); + else if (IsElement("translate")) + ReadNodeTransformation(pNode, TF_TRANSLATE); + 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 (s[0] != '#') + ASSIMP_LOG_ERROR("Collada: Unresolved reference format of camera"); + else + pNode->mPrimaryCamera = s + 1; + } + } + 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 (s[0] != '#') + ASSIMP_LOG_ERROR("Collada: Unresolved reference format of node"); + else + { + pNode->mNodeInstances.push_back(NodeInstance()); + pNode->mNodeInstances.back().mNode = s + 1; + } + } + } + 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")) + { + // 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); + 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")) + { + // 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); + if (url[0] != '#') + ThrowException("Unknown reference format in element"); + + pNode->mCameras.push_back(CameraInstance()); + pNode->mCameras.back().mCamera = url + 1; + } + } + else + { + // skip everything else for the moment + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// 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) +{ + if (mReader->isEmptyElement()) + return; + + std::string tagName = mReader->getNodeName(); + + Transform tf; + tf.mType = pType; + + // read SID + int indexSID = TestAttribute("sid"); + if (indexSID >= 0) + tf.mID = mReader->getAttributeValue(indexSID); + + // how many parameters to read per transformation type + static const unsigned int sNumParameters[] = { 9, 4, 3, 3, 7, 16 }; + const char* content = GetTextContent(); + + // read as many parameters and store in the transformation + for (unsigned int a = 0; a < sNumParameters[pType]; a++) + { + // read a number + content = fast_atoreal_move(content, tf.f[a]); + // skip whitespace after it + SkipSpacesAndLineEnd(&content); + } + + // place the transformation at the queue of the node + pNode->mTransforms.push_back(tf); + + // and consume the closing tag + TestClosing(tagName.c_str()); +} + +// ------------------------------------------------------------------------------------------------ +// Processes bind_vertex_input and bind elements +void ColladaParser::ReadMaterialVertexInputBinding(Collada::SemanticMappingTable& tbl) +{ + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + if (IsElement("bind_vertex_input")) + { + Collada::InputSemanticMapEntry vn; + + // effect semantic + int n = GetAttribute("semantic"); + std::string s = mReader->getAttributeValue(n); + + // input semantic + n = GetAttribute("input_semantic"); + vn.mType = GetTypeForSemantic(mReader->getAttributeValue(n)); + + // index of input set + n = TestAttribute("input_set"); + if (-1 != n) + vn.mSet = mReader->getAttributeValueAsInt(n); + + tbl.mMap[s] = vn; + } + else if (IsElement("bind")) { + ASSIMP_LOG_WARN("Collada: Found unsupported element"); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + if (strcmp(mReader->getNodeName(), "instance_material") == 0) + break; + } + } +} + +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; + + if (image.mImageData.empty()) { + std::unique_ptr image_file(zip_archive.Open(image.mFileName.c_str())); + if (image_file) { + image.mImageData.resize(image_file->FileSize()); + image_file->Read(image.mImageData.data(), image_file->FileSize(), 1); + image.mEmbeddedFormat = BaseImporter::GetExtension(image.mFileName); + if (image.mEmbeddedFormat == "jpeg") { + image.mEmbeddedFormat = "jpg"; + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Reads a mesh reference in a node and adds it to the node's mesh list +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); + if (url[0] != '#') + ThrowException("Unknown reference format"); + + Collada::MeshInstance instance; + instance.mMeshOrController = url + 1; // skipping the leading # + + 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")) + { + // 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); + Collada::SemanticMappingTable s; + if (urlMat[0] == '#') + urlMat++; + + s.mMatName = urlMat; + + // resolve further material details + THIS UGLY AND NASTY semantic mapping stuff + if (!mReader->isEmptyElement()) + ReadMaterialVertexInputBinding(s); + + // 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) + break; + } + } + } + + // store it + pNode->mMeshes.push_back(instance); +} + +// ------------------------------------------------------------------------------------------------ +// Reads the collada scene +void ColladaParser::ReadScene() +{ + if (mReader->isEmptyElement()) + return; + + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT) { + 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); + if (url[0] != '#') + ThrowException("Unknown reference format in element"); + + // find the referred scene, skip the leading # + NodeLibrary::const_iterator sit = mNodeLibrary.find(url + 1); + if (sit == mNodeLibrary.end()) + ThrowException("Unable to resolve visual_scene reference \"" + std::string(url) + "\" in element."); + mRootNode = sit->second; + } + else { + SkipElement(); + } + } + else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { + break; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Aborts the file reading with an exception +AI_WONT_RETURN void ColladaParser::ThrowException(const std::string& pError) const +{ + throw DeadlyImportError(format() << "Collada: " << mFileName << " - " << pError); +} +void ColladaParser::ReportWarning(const char* msg, ...) +{ + ai_assert(NULL != msg); + + va_list args; + va_start(args, msg); + + char szBuffer[3000]; + const int iLen = vsprintf(szBuffer, msg, args); + ai_assert(iLen > 0); + + va_end(args); + ASSIMP_LOG_WARN_F("Validation warning: ", std::string(szBuffer, iLen)); +} + +// ------------------------------------------------------------------------------------------------ +// Skips all data until the end node of the current element +void ColladaParser::SkipElement() +{ + // nothing to skip if it's an + if (mReader->isEmptyElement()) + return; + + // reroute + SkipElement(mReader->getNodeName()); +} + +// ------------------------------------------------------------------------------------------------ +// Skips all data until the end node of the given element +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; + while (mReader->read()) + { + if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) + if (mReader->getNodeName() == element) + break; + } +} + +// ------------------------------------------------------------------------------------------------ +// Tests for an opening element of the given name, throws an exception if not found +void ColladaParser::TestOpening(const char* pName) +{ + // read element start + if (!mReader->read()) + ThrowException(format() << "Unexpected end of file while beginning of <" << pName << "> element."); + // whitespace in front is ok, just read again if found + if (mReader->getNodeType() == irr::io::EXN_TEXT) + if (!mReader->read()) + ThrowException(format() << "Unexpected end of file while reading beginning of <" << pName << "> element."); + + if (mReader->getNodeType() != irr::io::EXN_ELEMENT || strcmp(mReader->getNodeName(), pName) != 0) + ThrowException(format() << "Expected start of <" << pName << "> element."); +} + +// ------------------------------------------------------------------------------------------------ +// Tests for the closing tag of the given element, throws an exception if not found +void ColladaParser::TestClosing(const char* pName) +{ + // check if we're already on the closing tag and return right away + if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END && strcmp(mReader->getNodeName(), pName) == 0) + return; + + // if not, read some more + if (!mReader->read()) + ThrowException(format() << "Unexpected end of file while reading end of <" << pName << "> element."); + // whitespace in front is ok, just read again if found + if (mReader->getNodeType() == irr::io::EXN_TEXT) + if (!mReader->read()) + ThrowException(format() << "Unexpected end of file while reading end of <" << pName << "> element."); + + // but this has the be the closing tag, or we're lost + if (mReader->getNodeType() != irr::io::EXN_ELEMENT_END || strcmp(mReader->getNodeName(), pName) != 0) + ThrowException(format() << "Expected end of <" << pName << "> element."); +} + +// ------------------------------------------------------------------------------------------------ +// 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 index = TestAttribute(pAttr); + if (index != -1) + return index; + + // attribute not found -> throw an exception + ThrowException(format() << "Expected attribute \"" << pAttr << "\" for element <" << mReader->getNodeName() << ">."); + return -1; +} + +// ------------------------------------------------------------------------------------------------ +// 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 +{ + for (int a = 0; a < mReader->getAttributeCount(); a++) + if (strcmp(mReader->getAttributeName(a), pAttr) == 0) + return a; + + return -1; +} + +// ------------------------------------------------------------------------------------------------ +// Reads the text contents of an element, throws an exception if not given. Skips leading whitespace. +const char* ColladaParser::GetTextContent() +{ + const char* sz = TestTextContent(); + if (!sz) { + ThrowException("Invalid contents in element \"n\"."); + } + return sz; +} + +// ------------------------------------------------------------------------------------------------ +// Reads the text contents of an element, returns NULL if not given. Skips leading whitespace. +const char* ColladaParser::TestTextContent() +{ + // present node should be the beginning of an element + if (mReader->getNodeType() != irr::io::EXN_ELEMENT || mReader->isEmptyElement()) + return NULL; + + // read contents of the element + if (!mReader->read()) + return NULL; + if (mReader->getNodeType() != irr::io::EXN_TEXT && mReader->getNodeType() != irr::io::EXN_CDATA) + return NULL; + + // skip leading whitespace + const char* text = mReader->getNodeData(); + SkipSpacesAndLineEnd(&text); + + return text; +} + +// ------------------------------------------------------------------------------------------------ +// Calculates the resulting transformation fromm all the given transform steps +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: + { + 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(); + aiVector3D dir = aiVector3D(dstPos - pos).Normalize(); + 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); + break; + } + 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]); + aiMatrix4x4::Rotation(angle, axis, rot); + res *= rot; + break; + } + case TF_TRANSLATE: + { + aiMatrix4x4 trans; + aiMatrix4x4::Translation(aiVector3D(tf.f[0], tf.f[1], tf.f[2]), trans); + res *= trans; + break; + } + 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); + res *= scale; + break; + } + case TF_SKEW: + // TODO: (thom) + ai_assert(false); + break; + 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]); + res *= mat; + break; + } + default: + ai_assert(false); + break; + } + } + + return res; +} + +// ------------------------------------------------------------------------------------------------ +// Determines the input data type for the given semantic string +Collada::InputType ColladaParser::GetTypeForSemantic(const std::string& semantic) +{ + if (semantic.empty()) { + ASSIMP_LOG_WARN("Vertex input type is empty."); + return IT_Invalid; + } + + if (semantic == "POSITION") + return IT_Position; + else if (semantic == "TEXCOORD") + return IT_Texcoord; + else if (semantic == "NORMAL") + return IT_Normal; + else if (semantic == "COLOR") + return IT_Color; + else if (semantic == "VERTEX") + return IT_Vertex; + else if (semantic == "BINORMAL" || semantic == "TEXBINORMAL") + return IT_Bitangent; + else if (semantic == "TANGENT" || semantic == "TEXTANGENT") + return IT_Tangent; + + ASSIMP_LOG_WARN_F("Unknown vertex input type \"", semantic, "\". Ignoring."); + return IT_Invalid; +} + +#endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER diff --git a/Engine/lib/assimp/code/ColladaParser.h b/Engine/lib/assimp/code/Collada/ColladaParser.h similarity index 93% rename from Engine/lib/assimp/code/ColladaParser.h rename to Engine/lib/assimp/code/Collada/ColladaParser.h index 232d85654..4e8c8fccf 100644 --- a/Engine/lib/assimp/code/ColladaParser.h +++ b/Engine/lib/assimp/code/Collada/ColladaParser.h @@ -54,6 +54,7 @@ namespace Assimp { + class ZipArchiveIOSystem; // ------------------------------------------------------------------------------------------ /** Parser helper class for the Collada loader. @@ -65,13 +66,22 @@ namespace Assimp { friend class ColladaLoader; + /** 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; + /** Constructor from XML file */ - ColladaParser( IOSystem* pIOHandler, const std::string& pFile); + ColladaParser(IOSystem* pIOHandler, const std::string& pFile); /** Destructor */ ~ColladaParser(); + /** 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(); @@ -81,6 +91,15 @@ namespace Assimp /** 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 generic metadata into provided map */ + void ReadMetaDataItem(StringMetaData &metadata); + + /** Convert underscore_seperated to CamelCase "authoring_tool" becomes "AuthoringTool" */ + static void ToCamelCase(std::string &text); + /** Reads the animation library */ void ReadAnimationLibrary(); @@ -223,6 +242,9 @@ namespace Assimp // Processes bind_vertex_input and bind elements void ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl); + /** 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; @@ -343,6 +365,9 @@ namespace Assimp /** 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; }; diff --git a/Engine/lib/assimp/code/ColladaParser.cpp b/Engine/lib/assimp/code/ColladaParser.cpp deleted file mode 100644 index 0fa59362b..000000000 --- a/Engine/lib/assimp/code/ColladaParser.cpp +++ /dev/null @@ -1,3215 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 ColladaParser.cpp - * @brief Implementation of the Collada parser helper - */ - -#ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER - -#include -#include -#include "ColladaParser.h" -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace Assimp; -using namespace Assimp::Collada; -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 -{ - // validate io-handler instance - if (nullptr == pIOHandler ) { - throw DeadlyImportError("IOSystem is NULL." ); - } - - // open the file - std::unique_ptr file( pIOHandler->Open(pFile ) ); - if (file.get() == nullptr) { - throw DeadlyImportError( "Failed to open file " + pFile + "." ); - } - - // generate a XML reader for it - std::unique_ptr mIOWrapper(new CIrrXML_IOStreamReader(file.get())); - mReader = irr::io::createIrrXMLReader( mIOWrapper.get()); - if (!mReader) { - ThrowException("Collada: Unable to open file."); - } - - // start reading - ReadContents(); -} - -// ------------------------------------------------------------------------------------------------ -// Destructor, private as well -ColladaParser::~ColladaParser() -{ - delete mReader; - for( NodeLibrary::iterator it = mNodeLibrary.begin(); it != mNodeLibrary.end(); ++it) - delete it->second; - for( MeshLibrary::iterator it = mMeshLibrary.begin(); it != mMeshLibrary.end(); ++it) - delete it->second; -} - -// ------------------------------------------------------------------------------------------------ -// Read bool from text contents of current element -bool ColladaParser::ReadBoolFromTextContent() -{ - const char* cur = GetTextContent(); - return (!ASSIMP_strincmp(cur,"true",4) || '0' != *cur); -} - -// ------------------------------------------------------------------------------------------------ -// Read float from text contents of current element -ai_real ColladaParser::ReadFloatFromTextContent() -{ - const char* cur = GetTextContent(); - return fast_atof(cur); -} - -// ------------------------------------------------------------------------------------------------ -// Reads the contents of the file -void ColladaParser::ReadContents() -{ - while( mReader->read()) - { - // handle the root element "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); - - 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)) { - mFormat = FV_1_4_n; - ASSIMP_LOG_DEBUG("Collada schema version is 1.4.n"); - } - else if (!::strncmp(version,"1.3",3)) { - mFormat = FV_1_3_n; - ASSIMP_LOG_DEBUG("Collada schema version is 1.3.n"); - } - } - - ReadStructure(); - } else - { - ASSIMP_LOG_DEBUG_F( "Ignoring global element <", mReader->getNodeName(), ">." ); - SkipElement(); - } - } else - { - // skip everything else silently - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the structure of the file -void ColladaParser::ReadStructure() -{ - while( mReader->read()) - { - // beginning of elements - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if( IsElement( "asset")) - ReadAssetInfo(); - else if( IsElement( "library_animations")) - ReadAnimationLibrary(); - else if (IsElement("library_animation_clips")) - ReadAnimationClipLibrary(); - else if( IsElement( "library_controllers")) - ReadControllerLibrary(); - else if( IsElement( "library_images")) - ReadImageLibrary(); - else if( IsElement( "library_materials")) - ReadMaterialLibrary(); - else if( IsElement( "library_effects")) - ReadEffectLibrary(); - else if( IsElement( "library_geometries")) - ReadGeometryLibrary(); - else if( IsElement( "library_visual_scenes")) - ReadSceneLibrary(); - else if( IsElement( "library_lights")) - ReadLightLibrary(); - else if( IsElement( "library_cameras")) - ReadCameraLibrary(); - else if( IsElement( "library_nodes")) - ReadSceneNode(NULL); /* some hacking to reuse this piece of code */ - else if( IsElement( "scene")) - ReadScene(); - else - SkipElement(); - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - break; - } - } - - PostProcessRootAnimations(); - PostProcessControllers(); -} - -// ------------------------------------------------------------------------------------------------ -// Reads asset information such as coordinate system information and legal blah -void ColladaParser::ReadAssetInfo() -{ - if( mReader->isEmptyElement()) - return; - - 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 { - mUnitSize = mReader->getAttributeValueAsFloat( attrIndex); - } - - // consume the trailing stuff - if( !mReader->isEmptyElement()) - SkipElement(); - } - else if( IsElement( "up_axis")) - { - // read content, strip whitespace, compare - const char* content = GetTextContent(); - if( strncmp( content, "X_UP", 4) == 0) - mUpDirection = UP_X; - else if( strncmp( content, "Z_UP", 4) == 0) - mUpDirection = UP_Z; - else - mUpDirection = UP_Y; - - // check element end - TestClosing( "up_axis"); - } else - { - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "asset") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the animation clips -void ColladaParser::ReadAnimationClipLibrary() -{ - if (mReader->isEmptyElement()) - return; - - 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"); - int indexID = TestAttribute("id"); - if (indexName >= 0) - animName = mReader->getAttributeValue(indexName); - else if (indexID >= 0) - animName = mReader->getAttributeValue(indexID); - else - animName = std::string("animation_") + to_string(mAnimationClipLibrary.size()); - - std::pair > clip; - - clip.first = animName; - - 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 (url[0] != '#') - ThrowException("Unknown reference format"); - - url++; - - clip.second.push_back(url); - } - } - else - { - // ignore the rest - SkipElement(); - } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if (strcmp(mReader->getNodeName(), "animation_clip") != 0) - ThrowException("Expected end of element."); - - break; - } - } - - if (clip.second.size() > 0) - { - mAnimationClipLibrary.push_back(clip); - } - } - else - { - // ignore the rest - SkipElement(); - } - } - else if (mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if (strcmp(mReader->getNodeName(), "library_animation_clips") != 0) - ThrowException("Expected end of element."); - - break; - } - } -} - -void ColladaParser::PostProcessControllers() -{ - std::string meshId; - for (ControllerLibrary::iterator it = mControllerLibrary.begin(); it != mControllerLibrary.end(); ++it) { - meshId = it->second.mMeshId; - ControllerLibrary::iterator findItr = mControllerLibrary.find(meshId); - while(findItr != mControllerLibrary.end()) { - meshId = findItr->second.mMeshId; - findItr = mControllerLibrary.find(meshId); - } - - it->second.mMeshId = meshId; - } -} - -// ------------------------------------------------------------------------------------------------ -// Re-build animations from animation clip library, if present, otherwise combine single-channel animations -void ColladaParser::PostProcessRootAnimations() -{ - if (mAnimationClipLibrary.size() > 0) - { - Animation temp; - - for (AnimationClipLibrary::iterator it = mAnimationClipLibrary.begin(); it != mAnimationClipLibrary.end(); ++it) - { - std::string clipName = it->first; - - Animation *clip = new Animation(); - clip->mName = clipName; - - temp.mSubAnims.push_back(clip); - - 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()) - { - Animation *pSourceAnimation = animation->second; - - pSourceAnimation->CollectChannelsRecursively(clip->mChannels); - } - } - } - - mAnims = temp; - - // Ensure no double deletes. - temp.mSubAnims.clear(); - } - else - { - mAnims.CombineSingleChannelAnimations(); - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the animation library -void ColladaParser::ReadAnimationLibrary() -{ - if (mReader->isEmptyElement()) - return; - - 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 - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "library_animations") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an animation into the given parent structure -void ColladaParser::ReadAnimation( Collada::Animation* pParent) -{ - if( mReader->isEmptyElement()) - return; - - // an element may be a container for grouping sub-elements or an animation channel - // this is the channel collection by ID, in case it has channels - typedef std::map ChannelMap; - ChannelMap channels; - // this is the anim container in case we're a container - Animation* anim = NULL; - - // optional name given as an attribute - std::string animName; - std::string animID; - int indexName = TestAttribute( "name"); - int indexID = TestAttribute( "id"); - - if (indexID >= 0) - animID = mReader->getAttributeValue(indexID); - - if( indexName >= 0) - animName = mReader->getAttributeValue( indexName); - else if( indexID >= 0) - animName = animID; - else - animName = "animation"; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - // we have subanimations - if( IsElement( "animation")) - { - // create container from our element - if( !anim) - { - anim = new Animation; - anim->mName = animName; - pParent->mSubAnims.push_back( anim); - } - - // recurse into the subelement - ReadAnimation( anim); - } - else if( IsElement( "source")) - { - // possible animation data - we'll never know. Better store it - ReadSource(); - } - else if( IsElement( "sampler")) - { - // read the ID to assign the corresponding collada channel afterwards. - int indexID = GetAttribute( "id"); - std::string id = mReader->getAttributeValue( indexID); - ChannelMap::iterator newChannel = channels.insert( std::make_pair( id, AnimationChannel())).first; - - // have it read into a channel - ReadAnimationSampler( newChannel->second); - } - 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); - if( sourceId[0] == '#') - sourceId++; - ChannelMap::iterator cit = channels.find( sourceId); - if( cit != channels.end()) - cit->second.mTarget = mReader->getAttributeValue( indexTarget); - - if( !mReader->isEmptyElement()) - SkipElement(); - } - else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "animation") != 0) - ThrowException( "Expected end of element."); - - break; - } - } - - // it turned out to have channels - add them - 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) - { - pParent->mChannels.push_back( channels.begin()->second); - } else -*/ - { - // else create the animation, if not done yet, and store the channels - if( !anim) - { - anim = new Animation; - anim->mName = animName; - pParent->mSubAnims.push_back( anim); - } - for( ChannelMap::const_iterator it = channels.begin(); it != channels.end(); ++it) - anim->mChannels.push_back( it->second); - - if (indexID >= 0) - { - mAnimationLibrary[animID] = anim; - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// 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")) - { - int indexSemantic = GetAttribute( "semantic"); - const char* semantic = mReader->getAttributeValue( indexSemantic); - int indexSource = GetAttribute( "source"); - const char* source = mReader->getAttributeValue( indexSource); - if( source[0] != '#') - ThrowException( "Unsupported URL format"); - source++; - - if( strcmp( semantic, "INPUT") == 0) - pChannel.mSourceTimes = source; - else if( strcmp( semantic, "OUTPUT") == 0) - pChannel.mSourceValues = source; - else if( strcmp( semantic, "IN_TANGENT") == 0) - pChannel.mInTanValues = source; - else if( strcmp( semantic, "OUT_TANGENT") == 0) - pChannel.mOutTanValues = source; - else if( strcmp( semantic, "INTERPOLATION") == 0) - pChannel.mInterpolationValues = source; - - if( !mReader->isEmptyElement()) - SkipElement(); - } - else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "sampler") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the skeleton controller library -void ColladaParser::ReadControllerLibrary() -{ - if (mReader->isEmptyElement()) - return; - - 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); - - // create an entry and store it in the library under its ID - mControllerLibrary[id] = Controller(); - - // read on from there - ReadController( mControllerLibrary[id]); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "library_controllers") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a controller into the given mesh structure -void ColladaParser::ReadController( Collada::Controller& pController) -{ - // initial values - pController.mType = Skin; - pController.mMethod = Normalized; - 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")) - { - pController.mType = Morph; - int baseIndex = GetAttribute("source"); - pController.mMeshId = mReader->getAttributeValue(baseIndex) + 1; - int methodIndex = GetAttribute("method"); - if (methodIndex > 0) { - const char *method = mReader->getAttributeValue(methodIndex); - if (strcmp(method, "RELATIVE") == 0) - pController.mMethod = Relative; - } - } - 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")) - { - // content is 16 floats to define a matrix... it seems to be important for some models - const char* content = GetTextContent(); - - // read the 16 floats - for( unsigned int a = 0; a < 16; a++) - { - // read a number - content = fast_atoreal_move( content, pController.mBindShapeMatrix[a]); - // skip whitespace after it - SkipSpacesAndLineEnd( &content); - } - - TestClosing( "bind_shape_matrix"); - } - else if( IsElement( "source")) - { - // data array - we have specialists to handle this - ReadSource(); - } - else if( IsElement( "joints")) - { - ReadControllerJoints( pController); - } - else if( IsElement( "vertex_weights")) - { - ReadControllerWeights( pController); - } - else if ( IsElement( "targets" )) - { - while (mReader->read()) { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if ( IsElement( "input")) { - int semanticsIndex = GetAttribute("semantic"); - int sourceIndex = GetAttribute("source"); - - const char *semantics = mReader->getAttributeValue(semanticsIndex); - const char *source = mReader->getAttributeValue(sourceIndex); - if (strcmp(semantics, "MORPH_TARGET") == 0) { - pController.mMorphTarget = source + 1; - } - else if (strcmp(semantics, "MORPH_WEIGHT") == 0) - { - pController.mMorphWeight = source + 1; - } - } - } else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "targets") == 0) - break; - else - ThrowException( "Expected end of element."); - } - } - } - else - { - // ignore the rest - SkipElement(); - } - } - 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) - ThrowException( "Expected end of element."); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the joint definitions for the given controller -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")) - { - int indexSemantic = GetAttribute( "semantic"); - const char* attrSemantic = mReader->getAttributeValue( indexSemantic); - int indexSource = GetAttribute( "source"); - const char* attrSource = mReader->getAttributeValue( indexSource); - - // local URLS always start with a '#'. We don't support global URLs - if( attrSource[0] != '#') - ThrowException( format() << "Unsupported URL format in \"" << attrSource << "\" in source attribute of data element" ); - attrSource++; - - // parse source URL to corresponding source - if( strcmp( attrSemantic, "JOINT") == 0) - pController.mJointNameSource = attrSource; - else if( strcmp( attrSemantic, "INV_BIND_MATRIX") == 0) - pController.mJointOffsetMatrixSource = attrSource; - else - ThrowException( format() << "Unknown semantic \"" << attrSemantic << "\" in data element" ); - - // skip inner data, if present - if( !mReader->isEmptyElement()) - SkipElement(); - } - else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "joints") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the joint weights for the given controller -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) - { - // Input channels for weight data. Two possible semantics: "JOINT" and "WEIGHT" - if( IsElement( "input") && vertexCount > 0 ) - { - InputChannel channel; - - int indexSemantic = GetAttribute( "semantic"); - const char* attrSemantic = mReader->getAttributeValue( indexSemantic); - int indexSource = GetAttribute( "source"); - const char* attrSource = mReader->getAttributeValue( indexSource); - int indexOffset = TestAttribute( "offset"); - if( indexOffset >= 0) - channel.mOffset = mReader->getAttributeValueAsInt( indexOffset); - - // local URLS always start with a '#'. We don't support global URLs - if( attrSource[0] != '#') - ThrowException( format() << "Unsupported URL format in \"" << attrSource << "\" in source attribute of data element" ); - channel.mAccessor = attrSource + 1; - - // parse source URL to corresponding source - if( strcmp( attrSemantic, "JOINT") == 0) - pController.mWeightInputJoints = channel; - else if( strcmp( attrSemantic, "WEIGHT") == 0) - pController.mWeightInputWeights = channel; - else - ThrowException( format() << "Unknown semantic \"" << attrSemantic << "\" in data element" ); - - // skip inner data, if present - if( !mReader->isEmptyElement()) - SkipElement(); - } - else if( IsElement( "vcount") && vertexCount > 0 ) - { - // read weight count per vertex - const char* text = GetTextContent(); - size_t numWeights = 0; - for( std::vector::iterator it = pController.mWeightCounts.begin(); it != pController.mWeightCounts.end(); ++it) - { - if( *text == 0) - ThrowException( "Out of data while reading "); - - *it = strtoul10( text, &text); - numWeights += *it; - SkipSpacesAndLineEnd( &text); - } - - TestClosing( "vcount"); - - // reserve weight count - pController.mWeights.resize( numWeights); - } - else if( IsElement( "v") && vertexCount > 0 ) - { - // read JointIndex - WeightIndex pairs - const char* text = GetTextContent(); - - for( std::vector< std::pair >::iterator it = pController.mWeights.begin(); it != pController.mWeights.end(); ++it) - { - if( *text == 0) - ThrowException( "Out of data while reading "); - it->first = strtoul10( text, &text); - SkipSpacesAndLineEnd( &text); - if( *text == 0) - ThrowException( "Out of data while reading "); - it->second = strtoul10( text, &text); - SkipSpacesAndLineEnd( &text); - } - - TestClosing( "v"); - } - else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "vertex_weights") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the image library contents -void ColladaParser::ReadImageLibrary() -{ - if( mReader->isEmptyElement()) - return; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - 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); - - // create an entry and store it in the library under its ID - mImageLibrary[id] = Image(); - - // read on from there - ReadImage( mImageLibrary[id]); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "library_images") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an image entry into the given image -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) - { - // FIX: C4D exporter writes empty tags - if (!mReader->isEmptyElement()) { - // element content is filename - hopefully - const char* sz = TestTextContent(); - if (sz)pImage.mFileName = sz; - TestClosing( "init_from"); - } - if (!pImage.mFileName.length()) { - pImage.mFileName = "unknown_texture"; - } - } - 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. - int attrib = TestAttribute("array_index"); - if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) { - ASSIMP_LOG_WARN("Collada: Ignoring texture array index"); - continue; - } - - attrib = TestAttribute("mip_index"); - if (attrib != -1 && mReader->getAttributeValueAsInt(attrib) > 0) { - ASSIMP_LOG_WARN("Collada: Ignoring MIP map layer"); - continue; - } - - // TODO: correctly jump over cube and volume maps? - } - } - else if (mFormat == FV_1_5_n) - { - if( IsElement( "ref")) - { - // element content is filename - hopefully - const char* sz = TestTextContent(); - if (sz)pImage.mFileName = sz; - TestClosing( "ref"); - } - 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); - - 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 unsigned int size = (unsigned int)(cur-data) * 2; - pImage.mImageData.resize(size); - for (unsigned int i = 0; i < size;++i) - pImage.mImageData[i] = HexOctetToDecimal(data+(i<<1)); - - TestClosing( "hex"); - } - } - else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "image") == 0) - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the material library -void ColladaParser::ReadMaterialLibrary() -{ - if( mReader->isEmptyElement()) - return; - - std::map names; - 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); - - std::string name; - int attrName = TestAttribute("name"); - if (attrName >= 0) - name = mReader->getAttributeValue( attrName); - - // create an entry and store it in the library under its ID - mMaterialLibrary[id] = Material(); - - if( !name.empty()) - { - std::map::iterator it = names.find( name); - if( it != names.end()) - { - std::ostringstream strStream; - strStream << ++it->second; - name.append( " " + strStream.str()); - } - else - { - names[name] = 0; - } - - mMaterialLibrary[id].mName = name; - } - - ReadMaterial( mMaterialLibrary[id]); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "library_materials") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the light library -void ColladaParser::ReadLightLibrary() -{ - if( mReader->isEmptyElement()) - return; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - 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); - - // create an entry and store it in the library under its ID - ReadLight(mLightLibrary[id] = Light()); - - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "library_lights") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the camera library -void ColladaParser::ReadCameraLibrary() -{ - if( mReader->isEmptyElement()) - return; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - 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]; - attrID = TestAttribute( "name"); - if (attrID != -1) - cam.mName = mReader->getAttributeValue( attrID); - - ReadCamera(cam); - - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "library_cameras") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a material entry into the given material -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")) - { - // referred effect by URL - int attrUrl = GetAttribute( "url"); - const char* url = mReader->getAttributeValue( attrUrl); - if( url[0] != '#') - ThrowException( "Unknown reference format"); - - pMaterial.mEffect = url+1; - - SkipElement(); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "material") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a light entry into the given light -void ColladaParser::ReadLight( Collada::Light& pLight) -{ - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("light")) { - SkipElement(); - } - else if (IsElement("spot")) { - pLight.mType = aiLightSource_SPOT; - } - else if (IsElement("ambient")) { - pLight.mType = aiLightSource_AMBIENT; - } - else if (IsElement("directional")) { - pLight.mType = aiLightSource_DIRECTIONAL; - } - else if (IsElement("point")) { - pLight.mType = aiLightSource_POINT; - } - else if (IsElement("color")) { - // text content contains 3 floats - const char* content = GetTextContent(); - - content = fast_atoreal_move( content, (ai_real&)pLight.mColor.r); - SkipSpacesAndLineEnd( &content); - - content = fast_atoreal_move( content, (ai_real&)pLight.mColor.g); - SkipSpacesAndLineEnd( &content); - - content = fast_atoreal_move( content, (ai_real&)pLight.mColor.b); - SkipSpacesAndLineEnd( &content); - - TestClosing( "color"); - } - else if (IsElement("constant_attenuation")) { - pLight.mAttConstant = ReadFloatFromTextContent(); - TestClosing("constant_attenuation"); - } - else if (IsElement("linear_attenuation")) { - pLight.mAttLinear = ReadFloatFromTextContent(); - TestClosing("linear_attenuation"); - } - else if (IsElement("quadratic_attenuation")) { - pLight.mAttQuadratic = ReadFloatFromTextContent(); - TestClosing("quadratic_attenuation"); - } - else if (IsElement("falloff_angle")) { - pLight.mFalloffAngle = ReadFloatFromTextContent(); - TestClosing("falloff_angle"); - } - else if (IsElement("falloff_exponent")) { - pLight.mFalloffExponent = ReadFloatFromTextContent(); - TestClosing("falloff_exponent"); - } - // FCOLLADA extensions - // ------------------------------------------------------- - else if (IsElement("outer_cone")) { - pLight.mOuterAngle = ReadFloatFromTextContent(); - TestClosing("outer_cone"); - } - // ... and this one is even deprecated - else if (IsElement("penumbra_angle")) { - pLight.mPenumbraAngle = ReadFloatFromTextContent(); - TestClosing("penumbra_angle"); - } - else if (IsElement("intensity")) { - pLight.mIntensity = ReadFloatFromTextContent(); - TestClosing("intensity"); - } - else if (IsElement("falloff")) { - pLight.mOuterAngle = ReadFloatFromTextContent(); - TestClosing("falloff"); - } - else if (IsElement("hotspot_beam")) { - pLight.mFalloffAngle = ReadFloatFromTextContent(); - TestClosing("hotspot_beam"); - } - // OpenCOLLADA extensions - // ------------------------------------------------------- - else if (IsElement("decay_falloff")) { - pLight.mOuterAngle = ReadFloatFromTextContent(); - TestClosing("decay_falloff"); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "light") == 0) - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a camera entry into the given light -void ColladaParser::ReadCamera( Collada::Camera& pCamera) -{ - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if (IsElement("camera")) { - SkipElement(); - } - else if (IsElement("orthographic")) { - pCamera.mOrtho = true; - } - else if (IsElement("xfov") || IsElement("xmag")) { - pCamera.mHorFov = ReadFloatFromTextContent(); - TestClosing((pCamera.mOrtho ? "xmag" : "xfov")); - } - else if (IsElement("yfov") || IsElement("ymag")) { - pCamera.mVerFov = ReadFloatFromTextContent(); - TestClosing((pCamera.mOrtho ? "ymag" : "yfov")); - } - else if (IsElement("aspect_ratio")) { - pCamera.mAspect = ReadFloatFromTextContent(); - TestClosing("aspect_ratio"); - } - else if (IsElement("znear")) { - pCamera.mZNear = ReadFloatFromTextContent(); - TestClosing("znear"); - } - else if (IsElement("zfar")) { - pCamera.mZFar = ReadFloatFromTextContent(); - TestClosing("zfar"); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "camera") == 0) - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the effect library -void ColladaParser::ReadEffectLibrary() -{ - if (mReader->isEmptyElement()) { - return; - } - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - 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); - - // create an entry and store it in the library under its ID - mEffectLibrary[id] = Effect(); - // read on from there - ReadEffect( mEffectLibrary[id]); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "library_effects") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an effect entry into the given effect -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) - { - if( IsElement( "profile_COMMON")) - ReadEffectProfileCommon( pEffect); - else - SkipElement(); - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "effect") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an COMMON effect profile -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")) - { - // just syntactic sugar - } - - 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); - - // create an entry and store it in the library under its ID - mImageLibrary[id] = Image(); - - // read on from there - ReadImage( mImageLibrary[id]); - } - - /* Shading modes */ - else if( IsElement( "phong")) - pEffect.mShadeType = Shade_Phong; - else if( IsElement( "constant")) - pEffect.mShadeType = Shade_Constant; - else if( IsElement( "lambert")) - pEffect.mShadeType = Shade_Lambert; - else if( IsElement( "blinn")) - pEffect.mShadeType = Shade_Blinn; - - /* Color + texture properties */ - else if( IsElement( "emission")) - ReadEffectColor( pEffect.mEmissive, pEffect.mTexEmissive); - else if( IsElement( "ambient")) - ReadEffectColor( pEffect.mAmbient, pEffect.mTexAmbient); - else if( IsElement( "diffuse")) - ReadEffectColor( pEffect.mDiffuse, pEffect.mTexDiffuse); - else if( IsElement( "specular")) - ReadEffectColor( pEffect.mSpecular, pEffect.mTexSpecular); - else if( IsElement( "reflective")) { - ReadEffectColor( pEffect.mReflective, pEffect.mTexReflective); - } - else if( IsElement( "transparent")) { - pEffect.mHasTransparency = true; - - const char* opaque = mReader->getAttributeValueSafe("opaque"); - - if(::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "RGB_ONE") == 0) { - pEffect.mRGBTransparency = true; - } - - // In RGB_ZERO mode, the transparency is interpreted in reverse, go figure... - if(::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "A_ZERO") == 0) { - pEffect.mInvertTransparency = true; - } - - ReadEffectColor( pEffect.mTransparent,pEffect.mTexTransparent); - } - else if( IsElement( "shininess")) - ReadEffectFloat( pEffect.mShininess); - else if( IsElement( "reflectivity")) - ReadEffectFloat( pEffect.mReflectivity); - - /* Single scalar properties */ - else if( IsElement( "transparency")) - ReadEffectFloat( pEffect.mTransparency); - else if( IsElement( "index_of_refraction")) - ReadEffectFloat( pEffect.mRefractIndex); - - // GOOGLEEARTH/OKINO extensions - // ------------------------------------------------------- - else if( IsElement( "double_sided")) - pEffect.mDoubleSided = ReadBoolFromTextContent(); - - // FCOLLADA extensions - // ------------------------------------------------------- - else if( IsElement( "bump")) { - aiColor4D dummy; - ReadEffectColor( dummy,pEffect.mTexBump); - } - - // MAX3D extensions - // ------------------------------------------------------- - else if( IsElement( "wireframe")) { - pEffect.mWireframe = ReadBoolFromTextContent(); - TestClosing( "wireframe"); - } - else if( IsElement( "faceted")) { - pEffect.mFaceted = ReadBoolFromTextContent(); - TestClosing( "faceted"); - } - else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "profile_COMMON") == 0) - { - break; - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Read texture wrapping + UV transform settings from a profile==Maya chunk -void ColladaParser::ReadSamplerProperties( Sampler& out ) -{ - if (mReader->isEmptyElement()) { - return; - } - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - - // MAYA extensions - // ------------------------------------------------------- - if( IsElement( "wrapU")) { - out.mWrapU = ReadBoolFromTextContent(); - TestClosing( "wrapU"); - } - else if( IsElement( "wrapV")) { - out.mWrapV = ReadBoolFromTextContent(); - TestClosing( "wrapV"); - } - else if( IsElement( "mirrorU")) { - out.mMirrorU = ReadBoolFromTextContent(); - TestClosing( "mirrorU"); - } - else if( IsElement( "mirrorV")) { - out.mMirrorV = ReadBoolFromTextContent(); - TestClosing( "mirrorV"); - } - else if( IsElement( "repeatU")) { - out.mTransform.mScaling.x = ReadFloatFromTextContent(); - TestClosing( "repeatU"); - } - else if( IsElement( "repeatV")) { - out.mTransform.mScaling.y = ReadFloatFromTextContent(); - TestClosing( "repeatV"); - } - else if( IsElement( "offsetU")) { - out.mTransform.mTranslation.x = ReadFloatFromTextContent(); - TestClosing( "offsetU"); - } - else if( IsElement( "offsetV")) { - out.mTransform.mTranslation.y = ReadFloatFromTextContent(); - TestClosing( "offsetV"); - } - else if( IsElement( "rotateUV")) { - out.mTransform.mRotation = ReadFloatFromTextContent(); - TestClosing( "rotateUV"); - } - else if( IsElement( "blend_mode")) { - - 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)) - out.mOp = aiTextureOp_Add; - - else if (0 == ASSIMP_strincmp(sz,"SUBTRACT",8)) - out.mOp = aiTextureOp_Subtract; - - else if (0 == ASSIMP_strincmp(sz,"MULTIPLY",8)) - out.mOp = aiTextureOp_Multiply; - - else { - ASSIMP_LOG_WARN("Collada: Unsupported MAYA texture blend mode"); - } - TestClosing( "blend_mode"); - } - // OKINO extensions - // ------------------------------------------------------- - else if( IsElement( "weighting")) { - out.mWeighting = ReadFloatFromTextContent(); - TestClosing( "weighting"); - } - else if( IsElement( "mix_with_previous_layer")) { - out.mMixWithPrevious = ReadFloatFromTextContent(); - TestClosing( "mix_with_previous_layer"); - } - // MAX3D extensions - // ------------------------------------------------------- - else if( IsElement( "amount")) { - out.mWeighting = ReadFloatFromTextContent(); - TestClosing( "amount"); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "technique") == 0) - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an effect entry containing a color or a texture defining that color -void ColladaParser::ReadEffectColor( aiColor4D& pColor, Sampler& pSampler) -{ - if (mReader->isEmptyElement()) - return; - - // Save current element name - const std::string curElem = mReader->getNodeName(); - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if( IsElement( "color")) - { - // text content contains 4 floats - const char* content = GetTextContent(); - - content = fast_atoreal_move( content, (ai_real&)pColor.r); - SkipSpacesAndLineEnd( &content); - - content = fast_atoreal_move( content, (ai_real&)pColor.g); - SkipSpacesAndLineEnd( &content); - - content = fast_atoreal_move( content, (ai_real&)pColor.b); - SkipSpacesAndLineEnd( &content); - - content = fast_atoreal_move( content, (ai_real&)pColor.a); - SkipSpacesAndLineEnd( &content); - TestClosing( "color"); - } - else if( IsElement( "texture")) - { - // get name of source texture/sampler - int attrTex = GetAttribute( "texture"); - pSampler.mName = mReader->getAttributeValue( attrTex); - - // get name of UV source channel. Specification demands it to be there, but some exporters - // don't write it. It will be the default UV channel in case it's missing. - attrTex = TestAttribute( "texcoord"); - if( attrTex >= 0 ) - pSampler.mUVChannel = mReader->getAttributeValue( attrTex); - //SkipElement(); - - // 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")) - { - const int _profile = GetAttribute( "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")) - { - // get more information on this sampler - ReadSamplerProperties(pSampler); - } - else SkipElement(); - } - else if( !IsElement( "extra")) - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){ - if (mReader->getNodeName() == curElem) - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an effect entry containing a float -void ColladaParser::ReadEffectFloat( ai_real& pFloat) -{ - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT){ - if( IsElement( "float")) - { - // text content contains a single floats - const char* content = GetTextContent(); - content = fast_atoreal_move( content, pFloat); - SkipSpacesAndLineEnd( &content); - - TestClosing( "float"); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){ - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads an effect parameter specification of any kind -void ColladaParser::ReadEffectParam( Collada::EffectParam& pParam) -{ - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if( IsElement( "surface")) - { - // image ID given inside tags - TestOpening( "init_from"); - 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)) - { - // surface ID is given inside tags - TestOpening( "source"); - 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")) - { - // surface ID is given inside tags - TestOpening( "instance_image"); - int attrURL = GetAttribute("url"); - 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 - { - // ignore unknown element - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the geometry library contents -void ColladaParser::ReadGeometryLibrary() -{ - if( mReader->isEmptyElement()) - return; - - 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); - - // 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; - - // 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); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "library_geometries") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a geometry from the geometry library. -void ColladaParser::ReadGeometry( Collada::Mesh* pMesh) -{ - if( mReader->isEmptyElement()) - return; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if( IsElement( "mesh")) - { - // read on from there - ReadMesh( pMesh); - } else - { - // ignore the rest - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "geometry") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a mesh from the geometry library -void ColladaParser::ReadMesh( Mesh* pMesh) -{ - if( mReader->isEmptyElement()) - return; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) - { - if( IsElement( "source")) - { - // we have professionals dealing with this - ReadSource(); - } - 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")) - { - // read per-index mesh data and faces setup - ReadIndexData( pMesh); - } else - { - // ignore the restf - SkipElement(); - } - } - 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) - { - // end of element - we're done here - break; - } else - { - // everything else should be punished - ThrowException( "Expected end of element."); - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a source element -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")) - { - ReadDataArray(); - } - else if( IsElement( "technique_common")) - { - // I don't care for your profiles - } - else if( IsElement( "accessor")) - { - ReadAccessor( sourceID); - } else - { - // ignore the rest - SkipElement(); - } - } - 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) - { - // end of another meaningless element - read over it - } else - { - // everything else should be punished - ThrowException( "Expected end of element."); - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a data array holding a number of floats, and stores it in the global library -void ColladaParser::ReadDataArray() -{ - std::string elmName = mReader->getNodeName(); - bool isStringArray = (elmName == "IDREF_array" || elmName == "Name_array"); - bool isEmptyElement = mReader->isEmptyElement(); - - // read attributes - int indexID = GetAttribute( "id"); - std::string id = mReader->getAttributeValue( indexID); - int indexCount = GetAttribute( "count"); - unsigned int count = (unsigned int) mReader->getAttributeValueAsInt( indexCount); - const char* content = TestTextContent(); - - // read values and store inside an array in the data library - mDataLibrary[id] = Data(); - 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) - { - data.mStrings.reserve( count); - std::string s; - - for( unsigned int a = 0; a < count; a++) - { - if( *content == 0) - ThrowException( "Expected more values while reading IDREF_array contents."); - - s.clear(); - while( !IsSpaceOrNewLine( *content)) - s += *content++; - data.mStrings.push_back( s); - - SkipSpacesAndLineEnd( &content); - } - } else - { - data.mValues.reserve( count); - - for( unsigned int a = 0; a < count; a++) - { - if( *content == 0) - ThrowException( "Expected more values while reading float_array contents."); - - ai_real value; - // read a number - content = fast_atoreal_move( content, value); - data.mValues.push_back( value); - // skip whitespace after it - SkipSpacesAndLineEnd( &content); - } - } - } - - // test for closing tag - if( !isEmptyElement ) - TestClosing( elmName.c_str()); -} - -// ------------------------------------------------------------------------------------------------ -// Reads an accessor and stores it in the global library -void ColladaParser::ReadAccessor( const std::string& pID) -{ - // read accessor attributes - int attrSource = GetAttribute( "source"); - 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"); - unsigned int count = (unsigned int) mReader->getAttributeValueAsInt( attrCount); - int attrOffset = TestAttribute( "offset"); - unsigned int offset = 0; - if( attrOffset > -1) - offset = (unsigned int) mReader->getAttributeValueAsInt( attrOffset); - int attrStride = TestAttribute( "stride"); - unsigned int stride = 1; - if( attrStride > -1) - stride = (unsigned int) mReader->getAttributeValueAsInt( attrStride); - - // store in the library under the given ID - mAccessorLibrary[pID] = Accessor(); - Accessor& acc = mAccessorLibrary[pID]; - acc.mCount = count; - acc.mOffset = offset; - acc.mStride = stride; - acc.mSource = source+1; // ignore the leading '#' - 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")) - { - // read data param - int attrName = TestAttribute( "name"); - std::string name; - 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(); - - /* 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(); - - /* 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 == "Q") acc.mSubOffset[3] = acc.mParams.size(); - /* 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(); - //else - // DefaultLogger::get()->warn( format() << "Unknown accessor parameter \"" << name << "\". Ignoring data channel." ); - } - - // read data type - int attrType = TestAttribute( "type"); - 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. - std::string type = mReader->getAttributeValue( attrType); - if( type == "float4x4") - acc.mSize += 16; - else - acc.mSize += 1; - } - - acc.mParams.push_back( name); - - // skip remaining stuff of this element, if any - SkipElement(); - } else - { - ThrowException( format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag " ); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "accessor") != 0) - ThrowException( "Expected end of element."); - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads input declarations of per-vertex mesh data into the given mesh -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")) - { - ReadInputChannel( pMesh->mPerVertexData); - } else - { - ThrowException( format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag " ); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( strcmp( mReader->getNodeName(), "vertices") != 0) - ThrowException( "Expected end of element."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads input declarations of per-index mesh data into the given mesh -void ColladaParser::ReadIndexData( Mesh* pMesh) -{ - std::vector vcount; - std::vector perIndexData; - - // read primitive count from the attribute - int attrCount = GetAttribute( "count"); - size_t numPrimitives = (size_t) mReader->getAttributeValueAsInt( attrCount); - // some mesh types (e.g. tristrips) don't specify primitive count upfront, - // so we need to sum up the actual number of primitives while we read the

-tags - size_t actualPrimitives = 0; - - // material subgroup - int attrMaterial = TestAttribute( "material"); - SubMesh subgroup; - if( attrMaterial > -1) - subgroup.mMaterial = mReader->getAttributeValue( attrMaterial); - - // distinguish between polys and triangles - std::string elementName = mReader->getNodeName(); - PrimitiveType primType = Prim_Invalid; - if( IsElement( "lines")) - primType = Prim_Lines; - else if( IsElement( "linestrips")) - primType = Prim_LineStrip; - else if( IsElement( "polygons")) - primType = Prim_Polygon; - else if( IsElement( "polylist")) - primType = Prim_Polylist; - else if( IsElement( "triangles")) - primType = Prim_Triangles; - else if( IsElement( "trifans")) - primType = Prim_TriFans; - else if( IsElement( "tristrips")) - primType = Prim_TriStrips; - - 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")) - { - ReadInputChannel( perIndexData); - } - 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(); - vcount.reserve( numPrimitives); - for( unsigned int a = 0; a < numPrimitives; a++) - { - if( *content == 0) - ThrowException( "Expected more values while reading contents."); - // read a number - vcount.push_back( (size_t) strtoul10( content, &content)); - // skip whitespace after it - SkipSpacesAndLineEnd( &content); - } - } - - TestClosing( "vcount"); - } - } - 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")) - { - SkipElement("extra"); - } else if ( IsElement("ph")) { - SkipElement("ph"); - } else { - ThrowException( format() << "Unexpected sub element <" << mReader->getNodeName() << "> in tag <" << elementName << ">" ); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - { - if( mReader->getNodeName() != elementName) - ThrowException( format() << "Expected end of <" << elementName << "> element." ); - - break; - } - } - -#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'. - ai_assert(actualPrimitives == numPrimitives); - } -#endif - - // 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); -} - -// ------------------------------------------------------------------------------------------------ -// Reads a single input channel element and stores it in the given array, if valid -void ColladaParser::ReadInputChannel( std::vector& poChannels) -{ - InputChannel channel; - - // read semantic - int attrSemantic = GetAttribute( "semantic"); - std::string semantic = mReader->getAttributeValue( attrSemantic); - channel.mType = GetTypeForSemantic( semantic); - - // read source - int attrSource = GetAttribute( "source"); - 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 - - // read index offset, if per-index - int attrOffset = TestAttribute( "offset"); - if( attrOffset > -1) - channel.mOffset = mReader->getAttributeValueAsInt( attrOffset); - - // read set if texture coordinates - if(channel.mType == IT_Texcoord || channel.mType == IT_Color){ - int attrSet = TestAttribute("set"); - if(attrSet > -1){ - attrSet = mReader->getAttributeValueAsInt( attrSet); - if(attrSet < 0) - ThrowException( format() << "Invalid index \"" << (attrSet) << "\" in set attribute of element" ); - - channel.mIndex = attrSet; - } - } - - // store, if valid type - if( channel.mType != IT_Invalid) - poChannels.push_back( channel); - - // skip remaining stuff of this element, if any - SkipElement(); -} - -// ------------------------------------------------------------------------------------------------ -// 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) -{ - // 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) - { - numOffsets = std::max( numOffsets, channel.mOffset+1); - if( channel.mType == IT_Vertex) - perVertexOffset = channel.mOffset; - } - - // determine the expected number of indices - size_t expectedPointCount = 0; - switch( pPrimType) - { - case Prim_Polylist: - { - for( size_t i : pVCount) - expectedPointCount += i; - break; - } - case Prim_Lines: - expectedPointCount = 2 * pNumPrimitives; - break; - case Prim_Triangles: - expectedPointCount = 3 * pNumPrimitives; - break; - default: - // other primitive types don't state the index count upfront... we need to guess - break; - } - - // and read all indices into a temporary array - std::vector indices; - if( expectedPointCount > 0) - indices.reserve( expectedPointCount * numOffsets); - - if (pNumPrimitives > 0) // It is possible to not contain any indices - { - 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)); - indices.push_back( size_t( value)); - // skip whitespace after it - SkipSpacesAndLineEnd( &content); - } - } - - // complain if the index count doesn't fit - if( expectedPointCount > 0 && indices.size() != expectedPointCount * numOffsets) { - if (pPrimType == Prim_Lines) { - // 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 - ThrowException( "Expected different index count in

element."); - - } 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; - 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; - 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; - if( input.mResolved) - continue; - - // 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) - ThrowException( "Unsupported vertex referencing scheme."); - continue; - } - - // find accessor - input.mResolved = &ResolveLibraryReference( mAccessorLibrary, input.mAccessor); - // resolve accessor's data pointer as well, if necessary - const Accessor* acc = input.mResolved; - if( !acc->mData) - acc->mData = &ResolveLibraryReference( mDataLibrary, acc->mSource); - } - - // For continued primitives, the given count does not come all in one

, but only one primitive per

- size_t numPrimitives = pNumPrimitives; - if( pPrimType == Prim_TriFans || pPrimType == Prim_Polygon) - numPrimitives = 1; - // For continued primitives, the given count is actually the number of

's inside the parent tag - if ( pPrimType == Prim_TriStrips){ - size_t numberOfVertices = indices.size() / numOffsets; - numPrimitives = numberOfVertices - 2; - } - if (pPrimType == Prim_LineStrip) { - size_t numberOfVertices = indices.size() / numOffsets; - numPrimitives = numberOfVertices - 1; - } - - pMesh->mFaceSize.reserve( numPrimitives); - pMesh->mFacePosIndices.reserve( indices.size() / numOffsets); - - size_t polylistStartVertex = 0; - for (size_t currentPrimitive = 0; currentPrimitive < numPrimitives; currentPrimitive++) - { - // determine number of points for this primitive - size_t numPoints = 0; - switch( pPrimType) - { - case Prim_Lines: - numPoints = 2; - for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) - CopyVertex(currentVertex, numOffsets, numPoints, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); - break; - case Prim_LineStrip: - numPoints = 2; - for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) - CopyVertex(currentVertex, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); - break; - case Prim_Triangles: - numPoints = 3; - for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) - CopyVertex(currentVertex, numOffsets, numPoints, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); - break; - case Prim_TriStrips: - numPoints = 3; - ReadPrimTriStrips(numOffsets, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); - break; - case Prim_Polylist: - numPoints = pVCount[currentPrimitive]; - for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) - CopyVertex(polylistStartVertex + currentVertex, numOffsets, 1, perVertexOffset, pMesh, pPerIndexChannels, 0, indices); - polylistStartVertex += numPoints; - break; - case Prim_TriFans: - case Prim_Polygon: - numPoints = indices.size() / numOffsets; - for (size_t currentVertex = 0; currentVertex < numPoints; currentVertex++) - CopyVertex(currentVertex, numOffsets, numPoints, perVertexOffset, pMesh, pPerIndexChannels, currentPrimitive, indices); - break; - default: - // LineStrip is not supported due to expected index unmangling - ThrowException( "Unsupported primitive type."); - break; - } - - // store the face size to later reconstruct the face from - pMesh->mFaceSize.push_back( numPoints); - } - - // if I ever get my hands on that guy who invented this steaming pile of indirection... - TestClosing( "p"); - return numPrimitives; -} - -///@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){ - // calculate the base offset of the vertex whose attributes we ant to copy - size_t baseOffset = currentPrimitive * numOffsets * numPoints + currentVertex * numOffsets; - - // don't overrun the boundaries of the index list - 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) - 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]); -} - -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 - 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); - } -} - -// ------------------------------------------------------------------------------------------------ -// 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) -{ - // ignore vertex referrer - we handle them that separate - if( pInput.mType == IT_Vertex) - return; - - 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; - - // assemble according to the accessors component sub-offset list. We don't care, yet, - // what kind of object exactly we're extracting here - ai_real obj[4]; - for( size_t c = 0; c < 4; ++c) - obj[c] = dataObject[acc.mSubOffset[c]]; - - // now we reinterpret it according to the type we're reading here - 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])); - 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)); - - // 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])); - 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)); - - // 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])); - 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)); - - // 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])); - else - ASSIMP_LOG_ERROR("Collada: just one vertex bitangent stream supported"); - break; - case IT_Texcoord: - // 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)); - - 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 - { - 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) - { - // 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)); - - 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); - } else - { - ASSIMP_LOG_ERROR("Collada: too many vertex color sets. Skipping."); - } - - break; - default: - // IT_Invalid and IT_Vertex - ai_assert(false && "shouldn't ever get here"); - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads the library of node hierarchies and scene parts -void ColladaParser::ReadSceneLibrary() -{ - if( mReader->isEmptyElement()) - return; - - 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")) - { - // 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); - - // read name if given. - int indexName = TestAttribute( "name"); - 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->mID = attrID; - node->mName = attrName; - mNodeLibrary[node->mID] = node; - - ReadSceneNode( node); - } else - { - // ignore the rest - SkipElement(); - } - } - 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."); - - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a scene node's contents including children and stores it in the given node -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; - int attrID = TestAttribute( "id"); - if( attrID > -1) - child->mID = mReader->getAttributeValue( attrID); - int attrSID = TestAttribute( "sid"); - if( attrSID > -1) - child->mSID = mReader->getAttributeValue( attrSID); - - int attrName = TestAttribute( "name"); - if( attrName > -1) - child->mName = mReader->getAttributeValue( attrName); - - // TODO: (thom) support SIDs - // ai_assert( TestAttribute( "sid") == -1); - - if (pNode) - { - pNode->mChildren.push_back( child); - child->mParent = pNode; - } - else - { - // no parent node given, probably called from element. - // create new node in node library - mNodeLibrary[child->mID] = child; - } - - // read on recursively from there - ReadSceneNode( child); - continue; - } - // For any further stuff we need a valid node to work on - else if (!pNode) - continue; - - if( IsElement( "lookat")) - ReadNodeTransformation( pNode, TF_LOOKAT); - else if( IsElement( "matrix")) - ReadNodeTransformation( pNode, TF_MATRIX); - else if( IsElement( "rotate")) - ReadNodeTransformation( pNode, TF_ROTATE); - else if( IsElement( "scale")) - ReadNodeTransformation( pNode, TF_SCALE); - else if( IsElement( "skew")) - ReadNodeTransformation( pNode, TF_SKEW); - else if( IsElement( "translate")) - ReadNodeTransformation( pNode, TF_TRANSLATE); - 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 (s[0] != '#') - ASSIMP_LOG_ERROR("Collada: Unresolved reference format of camera"); - else - pNode->mPrimaryCamera = s+1; - } - } - 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 (s[0] != '#') - ASSIMP_LOG_ERROR("Collada: Unresolved reference format of node"); - else - { - pNode->mNodeInstances.push_back(NodeInstance()); - pNode->mNodeInstances.back().mNode = s+1; - } - } - } - 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")) - { - // 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); - 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")) - { - // 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); - if( url[0] != '#') - ThrowException( "Unknown reference format in element"); - - pNode->mCameras.push_back(CameraInstance()); - pNode->mCameras.back().mCamera = url+1; - } - } - else - { - // skip everything else for the moment - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// 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) -{ - if( mReader->isEmptyElement()) - return; - - std::string tagName = mReader->getNodeName(); - - Transform tf; - tf.mType = pType; - - // read SID - int indexSID = TestAttribute( "sid"); - if( indexSID >= 0) - tf.mID = mReader->getAttributeValue( indexSID); - - // how many parameters to read per transformation type - static const unsigned int sNumParameters[] = { 9, 4, 3, 3, 7, 16 }; - const char* content = GetTextContent(); - - // read as many parameters and store in the transformation - for( unsigned int a = 0; a < sNumParameters[pType]; a++) - { - // read a number - content = fast_atoreal_move( content, tf.f[a]); - // skip whitespace after it - SkipSpacesAndLineEnd( &content); - } - - // place the transformation at the queue of the node - pNode->mTransforms.push_back( tf); - - // and consume the closing tag - TestClosing( tagName.c_str()); -} - -// ------------------------------------------------------------------------------------------------ -// Processes bind_vertex_input and bind elements -void ColladaParser::ReadMaterialVertexInputBinding( Collada::SemanticMappingTable& tbl) -{ - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - if( IsElement( "bind_vertex_input")) - { - Collada::InputSemanticMapEntry vn; - - // effect semantic - int n = GetAttribute("semantic"); - std::string s = mReader->getAttributeValue(n); - - // input semantic - n = GetAttribute("input_semantic"); - vn.mType = GetTypeForSemantic( mReader->getAttributeValue(n) ); - - // index of input set - n = TestAttribute("input_set"); - if (-1 != n) - vn.mSet = mReader->getAttributeValueAsInt(n); - - tbl.mMap[s] = vn; - } - else if( IsElement( "bind")) { - ASSIMP_LOG_WARN("Collada: Found unsupported element"); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) { - if( strcmp( mReader->getNodeName(), "instance_material") == 0) - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Reads a mesh reference in a node and adds it to the node's mesh list -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); - if( url[0] != '#') - ThrowException( "Unknown reference format"); - - Collada::MeshInstance instance; - instance.mMeshOrController = url+1; // skipping the leading # - - 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")) - { - // 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); - Collada::SemanticMappingTable s; - if( urlMat[0] == '#') - urlMat++; - - s.mMatName = urlMat; - - // resolve further material details + THIS UGLY AND NASTY semantic mapping stuff - if( !mReader->isEmptyElement()) - ReadMaterialVertexInputBinding(s); - - // 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) - break; - } - } - } - - // store it - pNode->mMeshes.push_back( instance); -} - -// ------------------------------------------------------------------------------------------------ -// Reads the collada scene -void ColladaParser::ReadScene() -{ - if( mReader->isEmptyElement()) - return; - - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { - 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); - if( url[0] != '#') - ThrowException( "Unknown reference format in element"); - - // find the referred scene, skip the leading # - NodeLibrary::const_iterator sit = mNodeLibrary.find( url+1); - if( sit == mNodeLibrary.end()) - ThrowException( "Unable to resolve visual_scene reference \"" + std::string(url) + "\" in element."); - mRootNode = sit->second; - } else { - SkipElement(); - } - } - else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END){ - break; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Aborts the file reading with an exception -AI_WONT_RETURN void ColladaParser::ThrowException( const std::string& pError) const -{ - throw DeadlyImportError( format() << "Collada: " << mFileName << " - " << pError ); -} -void ColladaParser::ReportWarning(const char* msg,...) -{ - ai_assert(NULL != msg); - - va_list args; - va_start(args,msg); - - char szBuffer[3000]; - const int iLen = vsprintf(szBuffer,msg,args); - ai_assert(iLen > 0); - - va_end(args); - ASSIMP_LOG_WARN_F("Validation warning: ", std::string(szBuffer,iLen)); -} - -// ------------------------------------------------------------------------------------------------ -// Skips all data until the end node of the current element -void ColladaParser::SkipElement() -{ - // nothing to skip if it's an - if( mReader->isEmptyElement()) - return; - - // reroute - SkipElement( mReader->getNodeName()); -} - -// ------------------------------------------------------------------------------------------------ -// Skips all data until the end node of the given element -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; - while( mReader->read()) - { - if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) - if( mReader->getNodeName() == element) - break; - } -} - -// ------------------------------------------------------------------------------------------------ -// Tests for an opening element of the given name, throws an exception if not found -void ColladaParser::TestOpening( const char* pName) -{ - // read element start - if( !mReader->read()) - ThrowException( format() << "Unexpected end of file while beginning of <" << pName << "> element." ); - // whitespace in front is ok, just read again if found - if( mReader->getNodeType() == irr::io::EXN_TEXT) - if( !mReader->read()) - ThrowException( format() << "Unexpected end of file while reading beginning of <" << pName << "> element." ); - - if( mReader->getNodeType() != irr::io::EXN_ELEMENT || strcmp( mReader->getNodeName(), pName) != 0) - ThrowException( format() << "Expected start of <" << pName << "> element." ); -} - -// ------------------------------------------------------------------------------------------------ -// Tests for the closing tag of the given element, throws an exception if not found -void ColladaParser::TestClosing( const char* pName) -{ - // check if we're already on the closing tag and return right away - if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END && strcmp( mReader->getNodeName(), pName) == 0) - return; - - // if not, read some more - if( !mReader->read()) - ThrowException( format() << "Unexpected end of file while reading end of <" << pName << "> element." ); - // whitespace in front is ok, just read again if found - if( mReader->getNodeType() == irr::io::EXN_TEXT) - if( !mReader->read()) - ThrowException( format() << "Unexpected end of file while reading end of <" << pName << "> element." ); - - // but this has the be the closing tag, or we're lost - if( mReader->getNodeType() != irr::io::EXN_ELEMENT_END || strcmp( mReader->getNodeName(), pName) != 0) - ThrowException( format() << "Expected end of <" << pName << "> element." ); -} - -// ------------------------------------------------------------------------------------------------ -// 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 index = TestAttribute( pAttr); - if( index != -1) - return index; - - // attribute not found -> throw an exception - ThrowException( format() << "Expected attribute \"" << pAttr << "\" for element <" << mReader->getNodeName() << ">." ); - return -1; -} - -// ------------------------------------------------------------------------------------------------ -// 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 -{ - for( int a = 0; a < mReader->getAttributeCount(); a++) - if( strcmp( mReader->getAttributeName( a), pAttr) == 0) - return a; - - return -1; -} - -// ------------------------------------------------------------------------------------------------ -// Reads the text contents of an element, throws an exception if not given. Skips leading whitespace. -const char* ColladaParser::GetTextContent() -{ - const char* sz = TestTextContent(); - if(!sz) { - ThrowException( "Invalid contents in element \"n\"."); - } - return sz; -} - -// ------------------------------------------------------------------------------------------------ -// Reads the text contents of an element, returns NULL if not given. Skips leading whitespace. -const char* ColladaParser::TestTextContent() -{ - // present node should be the beginning of an element - if( mReader->getNodeType() != irr::io::EXN_ELEMENT || mReader->isEmptyElement()) - return NULL; - - // read contents of the element - if( !mReader->read() ) - return NULL; - if( mReader->getNodeType() != irr::io::EXN_TEXT && mReader->getNodeType() != irr::io::EXN_CDATA) - return NULL; - - // skip leading whitespace - const char* text = mReader->getNodeData(); - SkipSpacesAndLineEnd( &text); - - return text; -} - -// ------------------------------------------------------------------------------------------------ -// Calculates the resulting transformation fromm all the given transform steps -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: - { - 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(); - aiVector3D dir = aiVector3D( dstPos - pos).Normalize(); - 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); - break; - } - 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]); - aiMatrix4x4::Rotation( angle, axis, rot); - res *= rot; - break; - } - case TF_TRANSLATE: - { - aiMatrix4x4 trans; - aiMatrix4x4::Translation( aiVector3D( tf.f[0], tf.f[1], tf.f[2]), trans); - res *= trans; - break; - } - 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); - res *= scale; - break; - } - case TF_SKEW: - // TODO: (thom) - ai_assert( false); - break; - 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]); - res *= mat; - break; - } - default: - ai_assert( false); - break; - } - } - - return res; -} - -// ------------------------------------------------------------------------------------------------ -// Determines the input data type for the given semantic string -Collada::InputType ColladaParser::GetTypeForSemantic( const std::string& semantic) -{ - if ( semantic.empty() ) { - ASSIMP_LOG_WARN("Vertex input type is empty." ); - return IT_Invalid; - } - - if( semantic == "POSITION") - return IT_Position; - else if( semantic == "TEXCOORD") - return IT_Texcoord; - else if( semantic == "NORMAL") - return IT_Normal; - else if( semantic == "COLOR") - return IT_Color; - else if( semantic == "VERTEX") - return IT_Vertex; - else if( semantic == "BINORMAL" || semantic == "TEXBINORMAL") - return IT_Bitangent; - else if( semantic == "TANGENT" || semantic == "TEXTANGENT") - return IT_Tangent; - - ASSIMP_LOG_WARN_F( "Unknown vertex input type \"", semantic, "\". Ignoring." ); - return IT_Invalid; -} - -#endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER diff --git a/Engine/lib/assimp/code/Assimp.cpp b/Engine/lib/assimp/code/Common/Assimp.cpp similarity index 99% rename from Engine/lib/assimp/code/Assimp.cpp rename to Engine/lib/assimp/code/Common/Assimp.cpp index 41e1a4800..178b2c01d 100644 --- a/Engine/lib/assimp/code/Assimp.cpp +++ b/Engine/lib/assimp/code/Common/Assimp.cpp @@ -54,7 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include "CInterfaceIOWrapper.h" +#include "CApi/CInterfaceIOWrapper.h" #include "Importer.h" #include "ScenePrivate.h" diff --git a/Engine/lib/assimp/code/BaseImporter.cpp b/Engine/lib/assimp/code/Common/BaseImporter.cpp similarity index 93% rename from Engine/lib/assimp/code/BaseImporter.cpp rename to Engine/lib/assimp/code/Common/BaseImporter.cpp index 4803c6d6f..5c1e60554 100644 --- a/Engine/lib/assimp/code/BaseImporter.cpp +++ b/Engine/lib/assimp/code/Common/BaseImporter.cpp @@ -67,7 +67,20 @@ using namespace Assimp; // Constructor to be privately used by Importer BaseImporter::BaseImporter() AI_NO_EXCEPT : m_progress() { - // nothing to do here + /** + * Assimp Importer + * unit conversions available + * if you need another measurment unit add it below. + * it's currently defined in assimp that we prefer meters. + * + * NOTE: Initialised here rather than in the header file + * to workaround a VS2013 bug with brace initialisers + * */ + importerUnits[ImporterUnits::M] = 1.0; + importerUnits[ImporterUnits::CM] = 0.01; + importerUnits[ImporterUnits::MM] = 0.001; + importerUnits[ImporterUnits::INCHES] = 0.0254; + importerUnits[ImporterUnits::FEET] = 0.3048; } // ------------------------------------------------------------------------------------------------ @@ -76,9 +89,25 @@ BaseImporter::~BaseImporter() { // nothing to do here } +void BaseImporter::UpdateImporterScale( Importer* pImp ) +{ + ai_assert(pImp != nullptr); + ai_assert(importerScale != 0.0); + ai_assert(fileScale != 0.0); + + double activeScale = importerScale * fileScale; + + // Set active scaling + pImp->SetPropertyFloat( AI_CONFIG_APP_SCALE_KEY, static_cast( activeScale) ); + + ASSIMP_LOG_DEBUG_F("UpdateImporterScale scale set: %f", activeScale ); +} + // ------------------------------------------------------------------------------------------------ // Imports the given file and returns the imported data. -aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile, IOSystem* pIOHandler) { +aiScene* BaseImporter::ReadFile(Importer* pImp, const std::string& pFile, IOSystem* pIOHandler) { + + m_progress = pImp->GetProgressHandler(); if (nullptr == m_progress) { return nullptr; @@ -100,6 +129,11 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile, { InternReadFile( pFile, sc.get(), &filter); + // Calculate import scale hook - required because pImp not available anywhere else + // passes scale into ScaleProcess + UpdateImporterScale(pImp); + + } catch( const std::exception& err ) { // extract error description m_ErrorText = err.what(); @@ -112,7 +146,7 @@ aiScene* BaseImporter::ReadFile(const Importer* pImp, const std::string& pFile, } // ------------------------------------------------------------------------------------------------ -void BaseImporter::SetupProperties(const Importer* /*pImp*/) +void BaseImporter::SetupProperties(const Importer* pImp) { // the default implementation does nothing } @@ -320,7 +354,11 @@ std::string BaseImporter::GetExtension( const std::string& file ) { return false; } -#include "../contrib/utf8cpp/source/utf8.h" +#ifdef ASSIMP_USE_HUNTER +# include +#else +# include "../contrib/utf8cpp/source/utf8.h" +#endif // ------------------------------------------------------------------------------------------------ // Convert to UTF8 data @@ -584,6 +622,8 @@ aiScene* BatchLoader::GetImport( unsigned int which ) return nullptr; } + + // ------------------------------------------------------------------------------------------------ void BatchLoader::LoadAll() { diff --git a/Engine/lib/assimp/code/BaseProcess.cpp b/Engine/lib/assimp/code/Common/BaseProcess.cpp similarity index 98% rename from Engine/lib/assimp/code/BaseProcess.cpp rename to Engine/lib/assimp/code/Common/BaseProcess.cpp index 18872c369..e247be418 100644 --- a/Engine/lib/assimp/code/BaseProcess.cpp +++ b/Engine/lib/assimp/code/Common/BaseProcess.cpp @@ -89,7 +89,7 @@ void BaseProcess::ExecuteOnScene( Importer* pImp) // and kill the partially imported data delete pImp->Pimpl()->mScene; - pImp->Pimpl()->mScene = NULL; + pImp->Pimpl()->mScene = nullptr; } } diff --git a/Engine/lib/assimp/code/BaseProcess.h b/Engine/lib/assimp/code/Common/BaseProcess.h similarity index 100% rename from Engine/lib/assimp/code/BaseProcess.h rename to Engine/lib/assimp/code/Common/BaseProcess.h diff --git a/Engine/lib/assimp/code/Bitmap.cpp b/Engine/lib/assimp/code/Common/Bitmap.cpp similarity index 100% rename from Engine/lib/assimp/code/Bitmap.cpp rename to Engine/lib/assimp/code/Common/Bitmap.cpp diff --git a/Engine/lib/assimp/code/CreateAnimMesh.cpp b/Engine/lib/assimp/code/Common/CreateAnimMesh.cpp similarity index 96% rename from Engine/lib/assimp/code/CreateAnimMesh.cpp rename to Engine/lib/assimp/code/Common/CreateAnimMesh.cpp index 1a052849b..98b60e531 100644 --- a/Engine/lib/assimp/code/CreateAnimMesh.cpp +++ b/Engine/lib/assimp/code/Common/CreateAnimMesh.cpp @@ -47,10 +47,6 @@ namespace Assimp { aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh) { aiAnimMesh *animesh = new aiAnimMesh; - animesh->mVertices = NULL; - animesh->mNormals = NULL; - animesh->mTangents = NULL; - animesh->mBitangents = NULL; animesh->mNumVertices = mesh->mNumVertices; if (mesh->mVertices) { animesh->mVertices = new aiVector3D[animesh->mNumVertices]; diff --git a/Engine/lib/assimp/code/DefaultIOStream.cpp b/Engine/lib/assimp/code/Common/DefaultIOStream.cpp similarity index 87% rename from Engine/lib/assimp/code/DefaultIOStream.cpp rename to Engine/lib/assimp/code/Common/DefaultIOStream.cpp index 1c100b618..829b44731 100644 --- a/Engine/lib/assimp/code/DefaultIOStream.cpp +++ b/Engine/lib/assimp/code/Common/DefaultIOStream.cpp @@ -52,6 +52,35 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; +namespace +{ + template + size_t select_ftell(FILE* file) + { + return ::ftell(file); + } + + template + int select_fseek(FILE* file, int64_t offset, int origin) + { + return ::fseek(file, static_cast(offset), origin); + } + +#if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601) + template<> + size_t select_ftell<8>(FILE* file) + { + return ::_ftelli64(file); + } + + template<> + int select_fseek<8>(FILE* file, int64_t offset, int origin) + { + return ::_fseeki64(file, offset, origin); + } +#endif +} + // ---------------------------------------------------------------------------------- DefaultIOStream::~DefaultIOStream() { @@ -93,7 +122,7 @@ aiReturn DefaultIOStream::Seek(size_t pOffset, aiOrigin_END == SEEK_END && aiOrigin_SET == SEEK_SET"); // do the seek - return (0 == ::fseek(mFile, (long)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE); + return (0 == select_fseek(mFile, (int64_t)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE); } // ---------------------------------------------------------------------------------- @@ -102,7 +131,7 @@ size_t DefaultIOStream::Tell() const if (!mFile) { return 0; } - return ::ftell(mFile); + return select_ftell(mFile); } // ---------------------------------------------------------------------------------- diff --git a/Engine/lib/assimp/code/DefaultIOSystem.cpp b/Engine/lib/assimp/code/Common/DefaultIOSystem.cpp similarity index 57% rename from Engine/lib/assimp/code/DefaultIOSystem.cpp rename to Engine/lib/assimp/code/Common/DefaultIOSystem.cpp index d40b67de3..6fdc24dd8 100644 --- a/Engine/lib/assimp/code/DefaultIOSystem.cpp +++ b/Engine/lib/assimp/code/Common/DefaultIOSystem.cpp @@ -61,83 +61,66 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; -// maximum path length -// XXX http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html -#ifdef PATH_MAX -# define PATHLIMIT PATH_MAX -#else -# define PATHLIMIT 4096 +#ifdef _WIN32 +static std::wstring Utf8ToWide(const char* in) +{ + int size = MultiByteToWideChar(CP_UTF8, 0, in, -1, nullptr, 0); + // size includes terminating null; std::wstring adds null automatically + std::wstring out(static_cast(size) - 1, L'\0'); + MultiByteToWideChar(CP_UTF8, 0, in, -1, &out[0], size); + return out; +} + +static std::string WideToUtf8(const wchar_t* in) +{ + int size = WideCharToMultiByte(CP_UTF8, 0, in, -1, nullptr, 0, nullptr, nullptr); + // size includes terminating null; std::string adds null automatically + std::string out(static_cast(size) - 1, '\0'); + WideCharToMultiByte(CP_UTF8, 0, in, -1, &out[0], size, nullptr, nullptr); + return out; +} #endif // ------------------------------------------------------------------------------------------------ // Tests for the existence of a file at the given path. -bool DefaultIOSystem::Exists( const char* pFile) const +bool DefaultIOSystem::Exists(const char* pFile) const { #ifdef _WIN32 - wchar_t fileName16[PATHLIMIT]; - -#ifndef WindowsStore - bool isUnicode = IsTextUnicode(pFile, static_cast(strlen(pFile)), NULL) != 0; - if (isUnicode) { - - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, pFile, -1, fileName16, PATHLIMIT); - struct __stat64 filestat; - if (0 != _wstat64(fileName16, &filestat)) { - return false; - } - } else { -#endif - FILE* file = ::fopen(pFile, "rb"); - if (!file) - return false; - - ::fclose(file); -#ifndef WindowsStore + struct __stat64 filestat; + if (_wstat64(Utf8ToWide(pFile).c_str(), &filestat) != 0) { + return false; } -#endif #else - FILE* file = ::fopen( pFile, "rb"); - if( !file) + FILE* file = ::fopen(pFile, "rb"); + if (!file) return false; - ::fclose( file); + ::fclose(file); #endif return true; } // ------------------------------------------------------------------------------------------------ // Open a new file with a given path. -IOStream* DefaultIOSystem::Open( const char* strFile, const char* strMode) +IOStream* DefaultIOSystem::Open(const char* strFile, const char* strMode) { - ai_assert(NULL != strFile); - ai_assert(NULL != strMode); + ai_assert(strFile != nullptr); + ai_assert(strMode != nullptr); FILE* file; #ifdef _WIN32 - wchar_t fileName16[PATHLIMIT]; -#ifndef WindowsStore - bool isUnicode = IsTextUnicode(strFile, static_cast(strlen(strFile)), NULL) != 0; - if (isUnicode) { - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, strFile, -1, fileName16, PATHLIMIT); - std::string mode8(strMode); - file = ::_wfopen(fileName16, std::wstring(mode8.begin(), mode8.end()).c_str()); - } else { -#endif - file = ::fopen(strFile, strMode); -#ifndef WindowsStore - } -#endif + file = ::_wfopen(Utf8ToWide(strFile).c_str(), Utf8ToWide(strMode).c_str()); #else file = ::fopen(strFile, strMode); #endif - if (nullptr == file) + if (!file) return nullptr; - return new DefaultIOStream(file, (std::string) strFile); + return new DefaultIOStream(file, strFile); } // ------------------------------------------------------------------------------------------------ // Closes the given file and releases all resources associated with it. -void DefaultIOSystem::Close( IOStream* pFile) +void DefaultIOSystem::Close(IOStream* pFile) { delete pFile; } @@ -155,78 +138,56 @@ char DefaultIOSystem::getOsSeparator() const // ------------------------------------------------------------------------------------------------ // IOSystem default implementation (ComparePaths isn't a pure virtual function) -bool IOSystem::ComparePaths (const char* one, const char* second) const +bool IOSystem::ComparePaths(const char* one, const char* second) const { - return !ASSIMP_stricmp(one,second); + return !ASSIMP_stricmp(one, second); } // ------------------------------------------------------------------------------------------------ // Convert a relative path into an absolute path -inline static void MakeAbsolutePath (const char* in, char* _out) +inline static std::string MakeAbsolutePath(const char* in) { - ai_assert(in && _out); -#if defined( _MSC_VER ) || defined( __MINGW32__ ) -#ifndef WindowsStore - bool isUnicode = IsTextUnicode(in, static_cast(strlen(in)), NULL) != 0; - if (isUnicode) { - wchar_t out16[PATHLIMIT]; - wchar_t in16[PATHLIMIT]; - MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, in, -1, out16, PATHLIMIT); - wchar_t* ret = ::_wfullpath(out16, in16, PATHLIMIT); - if (ret) { - WideCharToMultiByte(CP_UTF8, MB_PRECOMPOSED, out16, -1, _out, PATHLIMIT, nullptr, nullptr); - } - if (!ret) { - // preserve the input path, maybe someone else is able to fix - // the path before it is accessed (e.g. our file system filter) - ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); - strcpy(_out, in); - } - - } else { -#endif - char* ret = :: _fullpath(_out, in, PATHLIMIT); - if (!ret) { - // preserve the input path, maybe someone else is able to fix - // the path before it is accessed (e.g. our file system filter) - ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); - strcpy(_out, in); - } -#ifndef WindowsStore + ai_assert(in); + std::string out; +#ifdef _WIN32 + wchar_t* ret = ::_wfullpath(nullptr, Utf8ToWide(in).c_str(), 0); + if (ret) { + out = WideToUtf8(ret); + free(ret); + } +#else + char* ret = realpath(in, nullptr); + if (ret) { + out = ret; + free(ret); } #endif -#else - // use realpath - char* ret = realpath(in, _out); - if(!ret) { + if (!ret) { // preserve the input path, maybe someone else is able to fix // the path before it is accessed (e.g. our file system filter) ASSIMP_LOG_WARN_F("Invalid path: ", std::string(in)); - strcpy(_out,in); + out = in; } -#endif + return out; } // ------------------------------------------------------------------------------------------------ // DefaultIOSystem's more specialized implementation -bool DefaultIOSystem::ComparePaths (const char* one, const char* second) const +bool DefaultIOSystem::ComparePaths(const char* one, const char* second) const { // chances are quite good both paths are formatted identically, // so we can hopefully return here already - if( !ASSIMP_stricmp(one,second) ) + if (!ASSIMP_stricmp(one, second)) return true; - char temp1[PATHLIMIT]; - char temp2[PATHLIMIT]; + std::string temp1 = MakeAbsolutePath(one); + std::string temp2 = MakeAbsolutePath(second); - MakeAbsolutePath (one, temp1); - MakeAbsolutePath (second, temp2); - - return !ASSIMP_stricmp(temp1,temp2); + return !ASSIMP_stricmp(temp1, temp2); } // ------------------------------------------------------------------------------------------------ -std::string DefaultIOSystem::fileName( const std::string &path ) +std::string DefaultIOSystem::fileName(const std::string& path) { std::string ret = path; std::size_t last = ret.find_last_of("\\/"); @@ -235,16 +196,16 @@ std::string DefaultIOSystem::fileName( const std::string &path ) } // ------------------------------------------------------------------------------------------------ -std::string DefaultIOSystem::completeBaseName( const std::string &path ) +std::string DefaultIOSystem::completeBaseName(const std::string& path) { std::string ret = fileName(path); std::size_t pos = ret.find_last_of('.'); - if(pos != ret.npos) ret = ret.substr(0, pos); + if (pos != std::string::npos) ret = ret.substr(0, pos); return ret; } // ------------------------------------------------------------------------------------------------ -std::string DefaultIOSystem::absolutePath( const std::string &path ) +std::string DefaultIOSystem::absolutePath(const std::string& path) { std::string ret = path; std::size_t last = ret.find_last_of("\\/"); @@ -253,5 +214,3 @@ std::string DefaultIOSystem::absolutePath( const std::string &path ) } // ------------------------------------------------------------------------------------------------ - -#undef PATHLIMIT diff --git a/Engine/lib/assimp/code/DefaultLogger.cpp b/Engine/lib/assimp/code/Common/DefaultLogger.cpp similarity index 100% rename from Engine/lib/assimp/code/DefaultLogger.cpp rename to Engine/lib/assimp/code/Common/DefaultLogger.cpp diff --git a/Engine/lib/assimp/code/DefaultProgressHandler.h b/Engine/lib/assimp/code/Common/DefaultProgressHandler.h similarity index 100% rename from Engine/lib/assimp/code/DefaultProgressHandler.h rename to Engine/lib/assimp/code/Common/DefaultProgressHandler.h diff --git a/Engine/lib/assimp/code/Exporter.cpp b/Engine/lib/assimp/code/Common/Exporter.cpp similarity index 79% rename from Engine/lib/assimp/code/Exporter.cpp rename to Engine/lib/assimp/code/Common/Exporter.cpp index 8848e87f5..8a95ceae5 100644 --- a/Engine/lib/assimp/code/Exporter.cpp +++ b/Engine/lib/assimp/code/Common/Exporter.cpp @@ -61,15 +61,16 @@ Here we implement only the C++ interface (Assimp::Exporter). #include #include #include - -#include "DefaultProgressHandler.h" -#include "BaseProcess.h" -#include "JoinVerticesProcess.h" -#include "MakeVerboseFormat.h" -#include "ConvertToLHProcess.h" -#include "PretransformVertices.h" #include -#include "ScenePrivate.h" + +#include "Common/DefaultProgressHandler.h" +#include "Common/BaseProcess.h" +#include "Common/ScenePrivate.h" +#include "PostProcessing/CalcTangentsProcess.h" +#include "PostProcessing/MakeVerboseFormat.h" +#include "PostProcessing/JoinVerticesProcess.h" +#include "PostProcessing/ConvertToLHProcess.h" +#include "PostProcessing/PretransformVertices.h" #include @@ -101,89 +102,92 @@ void ExportSceneX3D(const char*, IOSystem*, const aiScene*, const ExportProperti void ExportSceneFBX(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportSceneFBXA(const char*, IOSystem*, const aiScene*, const ExportProperties*); void ExportScene3MF( const char*, IOSystem*, const aiScene*, const ExportProperties* ); +void ExportSceneM3D(const char*, IOSystem*, const aiScene*, const ExportProperties*); +void ExportSceneA3D(const char*, IOSystem*, const aiScene*, const ExportProperties*); +void ExportAssimp2Json(const char* , IOSystem*, const aiScene* , const Assimp::ExportProperties*); -// ------------------------------------------------------------------------------------------------ -// global array of all export formats which Assimp supports in its current build -Exporter::ExportFormatEntry gExporters[] = -{ + +static void setupExporterArray(std::vector &exporters) { #ifndef ASSIMP_BUILD_NO_COLLADA_EXPORTER - Exporter::ExportFormatEntry( "collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada ), + exporters.push_back(Exporter::ExportFormatEntry("collada", "COLLADA - Digital Asset Exchange Schema", "dae", &ExportSceneCollada)); #endif #ifndef ASSIMP_BUILD_NO_X_EXPORTER - Exporter::ExportFormatEntry( "x", "X Files", "x", &ExportSceneXFile, - aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs ), + exporters.push_back(Exporter::ExportFormatEntry("x", "X Files", "x", &ExportSceneXFile, + aiProcess_MakeLeftHanded | aiProcess_FlipWindingOrder | aiProcess_FlipUVs)); #endif #ifndef ASSIMP_BUILD_NO_STEP_EXPORTER - Exporter::ExportFormatEntry( "stp", "Step Files", "stp", &ExportSceneStep, 0 ), + exporters.push_back(Exporter::ExportFormatEntry("stp", "Step Files", "stp", &ExportSceneStep, 0)); #endif #ifndef ASSIMP_BUILD_NO_OBJ_EXPORTER - Exporter::ExportFormatEntry( "obj", "Wavefront OBJ format", "obj", &ExportSceneObj, - aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ), - Exporter::ExportFormatEntry( "objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl, - aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */ ), + exporters.push_back(Exporter::ExportFormatEntry("obj", "Wavefront OBJ format", "obj", &ExportSceneObj, + aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */)); + exporters.push_back(Exporter::ExportFormatEntry("objnomtl", "Wavefront OBJ format without material file", "obj", &ExportSceneObjNoMtl, + aiProcess_GenSmoothNormals /*| aiProcess_PreTransformVertices */)); #endif #ifndef ASSIMP_BUILD_NO_STL_EXPORTER - Exporter::ExportFormatEntry( "stl", "Stereolithography", "stl" , &ExportSceneSTL, - aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices - ), - Exporter::ExportFormatEntry( "stlb", "Stereolithography (binary)", "stl" , &ExportSceneSTLBinary, - aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices - ), + exporters.push_back(Exporter::ExportFormatEntry("stl", "Stereolithography", "stl", &ExportSceneSTL, + aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices)); + exporters.push_back(Exporter::ExportFormatEntry("stlb", "Stereolithography (binary)", "stl", &ExportSceneSTLBinary, + aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_PreTransformVertices)); #endif #ifndef ASSIMP_BUILD_NO_PLY_EXPORTER - Exporter::ExportFormatEntry( "ply", "Stanford Polygon Library", "ply" , &ExportScenePly, - aiProcess_PreTransformVertices - ), - Exporter::ExportFormatEntry( "plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary, - aiProcess_PreTransformVertices - ), + exporters.push_back(Exporter::ExportFormatEntry("ply", "Stanford Polygon Library", "ply", &ExportScenePly, + aiProcess_PreTransformVertices)); + exporters.push_back(Exporter::ExportFormatEntry("plyb", "Stanford Polygon Library (binary)", "ply", &ExportScenePlyBinary, + aiProcess_PreTransformVertices)); #endif #ifndef ASSIMP_BUILD_NO_3DS_EXPORTER - Exporter::ExportFormatEntry( "3ds", "Autodesk 3DS (legacy)", "3ds" , &ExportScene3DS, - aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices ), + exporters.push_back(Exporter::ExportFormatEntry("3ds", "Autodesk 3DS (legacy)", "3ds", &ExportScene3DS, + aiProcess_Triangulate | aiProcess_SortByPType | aiProcess_JoinIdenticalVertices)); #endif #ifndef ASSIMP_BUILD_NO_GLTF_EXPORTER - Exporter::ExportFormatEntry( "gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), - Exporter::ExportFormatEntry( "glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), - Exporter::ExportFormatEntry( "gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), - Exporter::ExportFormatEntry( "glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, - aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType ), + exporters.push_back(Exporter::ExportFormatEntry("gltf2", "GL Transmission Format v. 2", "gltf", &ExportSceneGLTF2, + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); + exporters.push_back(Exporter::ExportFormatEntry("glb2", "GL Transmission Format v. 2 (binary)", "glb", &ExportSceneGLB2, + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); + exporters.push_back(Exporter::ExportFormatEntry("gltf", "GL Transmission Format", "gltf", &ExportSceneGLTF, + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); + exporters.push_back(Exporter::ExportFormatEntry("glb", "GL Transmission Format (binary)", "glb", &ExportSceneGLB, + aiProcess_JoinIdenticalVertices | aiProcess_Triangulate | aiProcess_SortByPType)); #endif #ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER - Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, 0 ), + exporters.push_back(Exporter::ExportFormatEntry("assbin", "Assimp Binary File", "assbin", &ExportSceneAssbin, 0)); #endif #ifndef ASSIMP_BUILD_NO_ASSXML_EXPORTER - Exporter::ExportFormatEntry( "assxml", "Assxml Document", "assxml" , &ExportSceneAssxml, 0 ), + exporters.push_back(Exporter::ExportFormatEntry("assxml", "Assimp XML Document", "assxml", &ExportSceneAssxml, 0)); #endif #ifndef ASSIMP_BUILD_NO_X3D_EXPORTER - Exporter::ExportFormatEntry( "x3d", "Extensible 3D", "x3d" , &ExportSceneX3D, 0 ), + exporters.push_back(Exporter::ExportFormatEntry("x3d", "Extensible 3D", "x3d", &ExportSceneX3D, 0)); #endif #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER - Exporter::ExportFormatEntry( "fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0 ), - Exporter::ExportFormatEntry( "fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0 ), + exporters.push_back(Exporter::ExportFormatEntry("fbx", "Autodesk FBX (binary)", "fbx", &ExportSceneFBX, 0)); + exporters.push_back(Exporter::ExportFormatEntry("fbxa", "Autodesk FBX (ascii)", "fbx", &ExportSceneFBXA, 0)); +#endif + +#ifndef ASSIMP_BUILD_NO_M3D_EXPORTER + exporters.push_back(Exporter::ExportFormatEntry("m3d", "Model 3D (binary)", "m3d", &ExportSceneM3D, 0)); + exporters.push_back(Exporter::ExportFormatEntry("a3d", "Model 3D (ascii)", "m3d", &ExportSceneA3D, 0)); #endif #ifndef ASSIMP_BUILD_NO_3MF_EXPORTER - Exporter::ExportFormatEntry( "3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0 ) + exporters.push_back(Exporter::ExportFormatEntry("3mf", "The 3MF-File-Format", "3mf", &ExportScene3MF, 0)); #endif -}; - -#define ASSIMP_NUM_EXPORTERS (sizeof(gExporters)/sizeof(gExporters[0])) +#ifndef ASSIMP_BUILD_NO_ASSJSON_EXPORTER + exporters.push_back(Exporter::ExportFormatEntry("assjson", "Assimp JSON Document", "json", &ExportAssimp2Json, 0)); +#endif +} class ExporterPimpl { public: @@ -199,10 +203,7 @@ public: GetPostProcessingStepInstanceList(mPostProcessingSteps); // grab all built-in exporters - if ( 0 != ( ASSIMP_NUM_EXPORTERS ) ) { - mExporters.resize( ASSIMP_NUM_EXPORTERS ); - std::copy( gExporters, gExporters + ASSIMP_NUM_EXPORTERS, mExporters.begin() ); - } + setupExporterArray(mExporters); } ~ExporterPimpl() { @@ -246,24 +247,28 @@ Exporter :: Exporter() // ------------------------------------------------------------------------------------------------ Exporter::~Exporter() { - FreeBlob(); + ai_assert(nullptr != pimpl); + FreeBlob(); delete pimpl; } // ------------------------------------------------------------------------------------------------ void Exporter::SetIOHandler( IOSystem* pIOHandler) { - pimpl->mIsDefaultIOHandler = !pIOHandler; + ai_assert(nullptr != pimpl); + pimpl->mIsDefaultIOHandler = !pIOHandler; pimpl->mIOSystem.reset(pIOHandler); } // ------------------------------------------------------------------------------------------------ IOSystem* Exporter::GetIOHandler() const { - return pimpl->mIOSystem.get(); + ai_assert(nullptr != pimpl); + return pimpl->mIOSystem.get(); } // ------------------------------------------------------------------------------------------------ bool Exporter::IsDefaultIOHandler() const { - return pimpl->mIsDefaultIOHandler; + ai_assert(nullptr != pimpl); + return pimpl->mIsDefaultIOHandler; } // ------------------------------------------------------------------------------------------------ @@ -288,7 +293,8 @@ void Exporter::SetProgressHandler(ProgressHandler* pHandler) { // ------------------------------------------------------------------------------------------------ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const char* pFormatId, - unsigned int, const ExportProperties* /*pProperties*/ ) { + unsigned int pPreprocessing, const ExportProperties* pProperties) { + ai_assert(nullptr != pimpl); if (pimpl->blob) { delete pimpl->blob; pimpl->blob = nullptr; @@ -298,7 +304,7 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha BlobIOSystem* blobio = new BlobIOSystem(); pimpl->mIOSystem = std::shared_ptr( blobio ); - if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName())) { + if (AI_SUCCESS != Export(pScene,pFormatId,blobio->GetMagicFileName(), pPreprocessing, pProperties)) { pimpl->mIOSystem = old; return nullptr; } @@ -309,44 +315,16 @@ const aiExportDataBlob* Exporter::ExportToBlob( const aiScene* pScene, const cha return pimpl->blob; } -// ------------------------------------------------------------------------------------------------ -bool IsVerboseFormat(const aiMesh* mesh) { - // avoid slow vector specialization - std::vector seen(mesh->mNumVertices,0); - for(unsigned int i = 0; i < mesh->mNumFaces; ++i) { - const aiFace& f = mesh->mFaces[i]; - for(unsigned int j = 0; j < f.mNumIndices; ++j) { - if(++seen[f.mIndices[j]] == 2) { - // found a duplicate index - return false; - } - } - } - - return true; -} - -// ------------------------------------------------------------------------------------------------ -bool IsVerboseFormat(const aiScene* pScene) { - for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) { - if(!IsVerboseFormat(pScene->mMeshes[i])) { - return false; - } - } - - return true; -} - // ------------------------------------------------------------------------------------------------ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const char* pPath, unsigned int pPreprocessing, const ExportProperties* pProperties) { ASSIMP_BEGIN_EXCEPTION_REGION(); - + ai_assert(nullptr != pimpl); // when they create scenes from scratch, users will likely create them not in verbose // format. They will likely not be aware that there is a flag in the scene to indicate // this, however. To avoid surprises and bug reports, we check for duplicates in // meshes upfront. - const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || IsVerboseFormat(pScene); + const bool is_verbose_format = !(pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) || MakeVerboseFormatProcess::IsVerboseFormat(pScene); pimpl->mProgressHandler->UpdateFileWrite(0, 4); @@ -466,7 +444,10 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c } ExportProperties emptyProperties; // Never pass NULL ExportProperties so Exporters don't have to worry. - exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProperties ? pProperties : &emptyProperties); + ExportProperties* pProp = pProperties ? (ExportProperties*)pProperties : &emptyProperties; + pProp->SetPropertyBool("bJoinIdenticalVertices", must_join_again); + exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp); + exp.mExportFunction(pPath,pimpl->mIOSystem.get(),scenecopy.get(), pProp); pimpl->mProgressHandler->UpdateFileWrite(4, 4); } catch (DeadlyExportError& err) { @@ -485,11 +466,13 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c // ------------------------------------------------------------------------------------------------ const char* Exporter::GetErrorString() const { + ai_assert(nullptr != pimpl); return pimpl->mError.c_str(); } // ------------------------------------------------------------------------------------------------ void Exporter::FreeBlob() { + ai_assert(nullptr != pimpl); delete pimpl->blob; pimpl->blob = nullptr; @@ -498,30 +481,34 @@ void Exporter::FreeBlob() { // ------------------------------------------------------------------------------------------------ const aiExportDataBlob* Exporter::GetBlob() const { - return pimpl->blob; + ai_assert(nullptr != pimpl); + return pimpl->blob; } // ------------------------------------------------------------------------------------------------ const aiExportDataBlob* Exporter::GetOrphanedBlob() const { - const aiExportDataBlob* tmp = pimpl->blob; + ai_assert(nullptr != pimpl); + const aiExportDataBlob *tmp = pimpl->blob; pimpl->blob = nullptr; return tmp; } // ------------------------------------------------------------------------------------------------ size_t Exporter::GetExportFormatCount() const { + ai_assert(nullptr != pimpl); return pimpl->mExporters.size(); } // ------------------------------------------------------------------------------------------------ const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) const { - if (index >= GetExportFormatCount()) { + ai_assert(nullptr != pimpl); + if (index >= GetExportFormatCount()) { return nullptr; } // Return from static storage if the requested index is built-in. - if (index < sizeof(gExporters) / sizeof(gExporters[0])) { - return &gExporters[index].mDescription; + if (index < pimpl->mExporters.size()) { + return &pimpl->mExporters[index].mDescription; } return &pimpl->mExporters[index].mDescription; @@ -529,7 +516,8 @@ const aiExportFormatDesc* Exporter::GetExportFormatDescription( size_t index ) c // ------------------------------------------------------------------------------------------------ aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) { - for(const ExportFormatEntry& e : pimpl->mExporters) { + ai_assert(nullptr != pimpl); + for (const ExportFormatEntry &e : pimpl->mExporters) { if (!strcmp(e.mDescription.id,desc.mDescription.id)) { return aiReturn_FAILURE; } @@ -541,7 +529,8 @@ aiReturn Exporter::RegisterExporter(const ExportFormatEntry& desc) { // ------------------------------------------------------------------------------------------------ void Exporter::UnregisterExporter(const char* id) { - for(std::vector::iterator it = pimpl->mExporters.begin(); + ai_assert(nullptr != pimpl); + for (std::vector::iterator it = pimpl->mExporters.begin(); it != pimpl->mExporters.end(); ++it) { if (!strcmp((*it).mDescription.id,id)) { pimpl->mExporters.erase(it); diff --git a/Engine/lib/assimp/code/FileLogStream.h b/Engine/lib/assimp/code/Common/FileLogStream.h similarity index 100% rename from Engine/lib/assimp/code/FileLogStream.h rename to Engine/lib/assimp/code/Common/FileLogStream.h diff --git a/Engine/lib/assimp/code/FileSystemFilter.h b/Engine/lib/assimp/code/Common/FileSystemFilter.h similarity index 100% rename from Engine/lib/assimp/code/FileSystemFilter.h rename to Engine/lib/assimp/code/Common/FileSystemFilter.h diff --git a/Engine/lib/assimp/code/IFF.h b/Engine/lib/assimp/code/Common/IFF.h similarity index 100% rename from Engine/lib/assimp/code/IFF.h rename to Engine/lib/assimp/code/Common/IFF.h diff --git a/Engine/lib/assimp/code/Importer.cpp b/Engine/lib/assimp/code/Common/Importer.cpp similarity index 98% rename from Engine/lib/assimp/code/Importer.cpp rename to Engine/lib/assimp/code/Common/Importer.cpp index 65b16471c..91b50859a 100644 --- a/Engine/lib/assimp/code/Importer.cpp +++ b/Engine/lib/assimp/code/Common/Importer.cpp @@ -64,15 +64,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ------------------------------------------------------------------------------------------------ // Internal headers // ------------------------------------------------------------------------------------------------ -#include "Importer.h" -#include -#include "BaseProcess.h" +#include "Common/Importer.h" +#include "Common/BaseProcess.h" +#include "Common/DefaultProgressHandler.h" +#include "PostProcessing/ProcessHelper.h" +#include "Common/ScenePreprocessor.h" +#include "Common/ScenePrivate.h" -#include "DefaultProgressHandler.h" +#include #include -#include "ProcessHelper.h" -#include "ScenePreprocessor.h" -#include "ScenePrivate.h" #include #include #include @@ -86,7 +86,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #ifndef ASSIMP_BUILD_NO_VALIDATEDS_PROCESS -# include "ValidateDataStructure.h" +# include "PostProcessing/ValidateDataStructure.h" #endif using namespace Assimp::Profiling; @@ -590,10 +590,12 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) // Find an worker class which can handle the file BaseImporter* imp = NULL; + SetPropertyInteger("importerIndex", -1); for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) { if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, false)) { imp = pimpl->mImporter[a]; + SetPropertyInteger("importerIndex", a); break; } } @@ -606,6 +608,7 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) { if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, true)) { imp = pimpl->mImporter[a]; + SetPropertyInteger("importerIndex", a); break; } } diff --git a/Engine/lib/assimp/code/Importer.h b/Engine/lib/assimp/code/Common/Importer.h similarity index 100% rename from Engine/lib/assimp/code/Importer.h rename to Engine/lib/assimp/code/Common/Importer.h diff --git a/Engine/lib/assimp/code/ImporterRegistry.cpp b/Engine/lib/assimp/code/Common/ImporterRegistry.cpp similarity index 85% rename from Engine/lib/assimp/code/ImporterRegistry.cpp rename to Engine/lib/assimp/code/Common/ImporterRegistry.cpp index 747815fa6..b9f28f035 100644 --- a/Engine/lib/assimp/code/ImporterRegistry.cpp +++ b/Engine/lib/assimp/code/Common/ImporterRegistry.cpp @@ -56,146 +56,149 @@ corresponding preprocessor flag to selectively disable formats. // (include_new_importers_here) // ------------------------------------------------------------------------------------------------ #ifndef ASSIMP_BUILD_NO_X_IMPORTER -# include "XFileImporter.h" +# include "X/XFileImporter.h" #endif #ifndef ASSIMP_BUILD_NO_AMF_IMPORTER -# include "AMFImporter.hpp" +# include "AMF/AMFImporter.hpp" #endif #ifndef ASSIMP_BUILD_NO_3DS_IMPORTER -# include "3DSLoader.h" +# include "3DS/3DSLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MD3_IMPORTER -# include "MD3Loader.h" +# include "MD3/MD3Loader.h" #endif #ifndef ASSIMP_BUILD_NO_MDL_IMPORTER -# include "MDLLoader.h" +# include "MDL/MDLLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MD2_IMPORTER -# include "MD2Loader.h" +# include "MD2/MD2Loader.h" #endif #ifndef ASSIMP_BUILD_NO_PLY_IMPORTER -# include "PlyLoader.h" +# include "Ply/PlyLoader.h" #endif #ifndef ASSIMP_BUILD_NO_ASE_IMPORTER -# include "ASELoader.h" +# include "ASE/ASELoader.h" #endif #ifndef ASSIMP_BUILD_NO_OBJ_IMPORTER -# include "ObjFileImporter.h" +# include "Obj/ObjFileImporter.h" #endif #ifndef ASSIMP_BUILD_NO_HMP_IMPORTER -# include "HMPLoader.h" +# include "HMP/HMPLoader.h" #endif #ifndef ASSIMP_BUILD_NO_SMD_IMPORTER -# include "SMDLoader.h" +# include "SMD/SMDLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MDC_IMPORTER -# include "MDCLoader.h" +# include "MDC/MDCLoader.h" #endif #ifndef ASSIMP_BUILD_NO_MD5_IMPORTER -# include "MD5Loader.h" +# include "MD5/MD5Loader.h" #endif #ifndef ASSIMP_BUILD_NO_STL_IMPORTER -# include "STLLoader.h" +# include "STL/STLLoader.h" #endif #ifndef ASSIMP_BUILD_NO_LWO_IMPORTER -# include "LWOLoader.h" +# include "LWO/LWOLoader.h" #endif #ifndef ASSIMP_BUILD_NO_DXF_IMPORTER -# include "DXFLoader.h" +# include "DXF/DXFLoader.h" #endif #ifndef ASSIMP_BUILD_NO_NFF_IMPORTER -# include "NFFLoader.h" +# include "NFF/NFFLoader.h" #endif #ifndef ASSIMP_BUILD_NO_RAW_IMPORTER -# include "RawLoader.h" +# include "Raw/RawLoader.h" #endif #ifndef ASSIMP_BUILD_NO_SIB_IMPORTER -# include "SIBImporter.h" +# include "SIB/SIBImporter.h" #endif #ifndef ASSIMP_BUILD_NO_OFF_IMPORTER -# include "OFFLoader.h" +# include "OFF/OFFLoader.h" #endif #ifndef ASSIMP_BUILD_NO_AC_IMPORTER -# include "ACLoader.h" +# include "AC/ACLoader.h" #endif #ifndef ASSIMP_BUILD_NO_BVH_IMPORTER -# include "BVHLoader.h" +# include "BVH/BVHLoader.h" #endif #ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER -# include "IRRMeshLoader.h" +# include "Irr/IRRMeshLoader.h" #endif #ifndef ASSIMP_BUILD_NO_IRR_IMPORTER -# include "IRRLoader.h" +# include "Irr/IRRLoader.h" #endif #ifndef ASSIMP_BUILD_NO_Q3D_IMPORTER -# include "Q3DLoader.h" +# include "Q3D/Q3DLoader.h" #endif #ifndef ASSIMP_BUILD_NO_B3D_IMPORTER -# include "B3DImporter.h" +# include "B3D/B3DImporter.h" #endif #ifndef ASSIMP_BUILD_NO_COLLADA_IMPORTER -# include "ColladaLoader.h" +# include "Collada/ColladaLoader.h" #endif #ifndef ASSIMP_BUILD_NO_TERRAGEN_IMPORTER -# include "TerragenLoader.h" +# include "Terragen/TerragenLoader.h" #endif #ifndef ASSIMP_BUILD_NO_CSM_IMPORTER -# include "CSMLoader.h" +# include "CSM/CSMLoader.h" #endif #ifndef ASSIMP_BUILD_NO_3D_IMPORTER -# include "UnrealLoader.h" +# include "Unreal/UnrealLoader.h" #endif #ifndef ASSIMP_BUILD_NO_LWS_IMPORTER -# include "LWSLoader.h" +# include "LWS/LWSLoader.h" #endif #ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER -# include "OgreImporter.h" +# include "Ogre/OgreImporter.h" #endif #ifndef ASSIMP_BUILD_NO_OPENGEX_IMPORTER -# include "OpenGEXImporter.h" +# include "OpenGEX/OpenGEXImporter.h" #endif #ifndef ASSIMP_BUILD_NO_MS3D_IMPORTER -# include "MS3DLoader.h" +# include "MS3D/MS3DLoader.h" #endif #ifndef ASSIMP_BUILD_NO_COB_IMPORTER -# include "COBLoader.h" +# include "COB/COBLoader.h" #endif #ifndef ASSIMP_BUILD_NO_BLEND_IMPORTER -# include "BlenderLoader.h" +# include "Blender/BlenderLoader.h" #endif #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER -# include "Q3BSPFileImporter.h" +# include "Q3BSP/Q3BSPFileImporter.h" #endif #ifndef ASSIMP_BUILD_NO_NDO_IMPORTER -# include "NDOLoader.h" +# include "NDO/NDOLoader.h" #endif #ifndef ASSIMP_BUILD_NO_IFC_IMPORTER # include "Importer/IFC/IFCLoader.h" #endif #ifndef ASSIMP_BUILD_NO_XGL_IMPORTER -# include "XGLLoader.h" +# include "XGL/XGLLoader.h" #endif #ifndef ASSIMP_BUILD_NO_FBX_IMPORTER -# include "FBXImporter.h" +# include "FBX/FBXImporter.h" #endif #ifndef ASSIMP_BUILD_NO_ASSBIN_IMPORTER -# include "AssbinLoader.h" +# include "Assbin/AssbinLoader.h" #endif #ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER -# include "glTFImporter.h" -# include "glTF2Importer.h" +# include "glTF/glTFImporter.h" +# include "glTF2/glTF2Importer.h" #endif #ifndef ASSIMP_BUILD_NO_C4D_IMPORTER -# include "C4DImporter.h" +# include "C4D/C4DImporter.h" #endif #ifndef ASSIMP_BUILD_NO_3MF_IMPORTER -# include "D3MFImporter.h" +# include "3MF/D3MFImporter.h" #endif #ifndef ASSIMP_BUILD_NO_X3D_IMPORTER -# include "X3DImporter.hpp" +# include "X3D/X3DImporter.hpp" #endif #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER -# include "MMDImporter.h" +# include "MMD/MMDImporter.h" +#endif +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER +# include "M3D/M3DImporter.h" #endif #ifndef ASSIMP_BUILD_NO_STEP_IMPORTER # include "Importer/StepFile/StepFileImporter.h" @@ -223,6 +226,9 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out) #if (!defined ASSIMP_BUILD_NO_3DS_IMPORTER) out.push_back( new Discreet3DSImporter()); #endif +#if (!defined ASSIMP_BUILD_NO_M3D_IMPORTER) + out.push_back( new M3DImporter()); +#endif #if (!defined ASSIMP_BUILD_NO_MD3_IMPORTER) out.push_back( new MD3Importer()); #endif @@ -364,7 +370,7 @@ void GetImporterInstanceList(std::vector< BaseImporter* >& out) void DeleteImporterInstanceList(std::vector< BaseImporter* >& deleteList){ for(size_t i= 0; i& out) #ifndef ASSIMP_BUILD_NO_TRANSFORMTEXCOORDS_PROCESS out.push_back( new TextureTransformStep()); #endif +#if (!defined ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS) + out.push_back( new ScaleProcess()); +#endif +#if (!defined ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS) + out.push_back( new ArmaturePopulate()); +#endif #if (!defined ASSIMP_BUILD_NO_PRETRANSFORMVERTICES_PROCESS) out.push_back( new PretransformVertices()); #endif @@ -208,9 +222,6 @@ void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out) #endif #if (!defined ASSIMP_BUILD_NO_GENFACENORMALS_PROCESS) out.push_back( new GenFaceNormalsProcess()); -#endif -#if (!defined ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS) - out.push_back( new ScaleProcess()); #endif // ......................................................................... // DON'T change the order of these five .. @@ -246,6 +257,9 @@ void GetPostProcessingStepInstanceList(std::vector< BaseProcess* >& out) #if (!defined ASSIMP_BUILD_NO_IMPROVECACHELOCALITY_PROCESS) out.push_back( new ImproveCacheLocalityProcess()); #endif +#if (!defined ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS) + out.push_back(new GenBoundingBoxesProcess); +#endif } } diff --git a/Engine/lib/assimp/code/RemoveComments.cpp b/Engine/lib/assimp/code/Common/RemoveComments.cpp similarity index 100% rename from Engine/lib/assimp/code/RemoveComments.cpp rename to Engine/lib/assimp/code/Common/RemoveComments.cpp diff --git a/Engine/lib/assimp/code/SGSpatialSort.cpp b/Engine/lib/assimp/code/Common/SGSpatialSort.cpp similarity index 100% rename from Engine/lib/assimp/code/SGSpatialSort.cpp rename to Engine/lib/assimp/code/Common/SGSpatialSort.cpp diff --git a/Engine/lib/assimp/code/SceneCombiner.cpp b/Engine/lib/assimp/code/Common/SceneCombiner.cpp similarity index 96% rename from Engine/lib/assimp/code/SceneCombiner.cpp rename to Engine/lib/assimp/code/Common/SceneCombiner.cpp index e445bd743..f7b13cc95 100644 --- a/Engine/lib/assimp/code/SceneCombiner.cpp +++ b/Engine/lib/assimp/code/Common/SceneCombiner.cpp @@ -1091,6 +1091,35 @@ void SceneCombiner::Copy( aiMesh** _dest, const aiMesh* src ) { aiFace& f = dest->mFaces[i]; GetArrayCopy(f.mIndices,f.mNumIndices); } + + // make a deep copy of all blend shapes + CopyPtrArray(dest->mAnimMeshes, dest->mAnimMeshes, dest->mNumAnimMeshes); +} + +// ------------------------------------------------------------------------------------------------ +void SceneCombiner::Copy(aiAnimMesh** _dest, const aiAnimMesh* src) { + if (nullptr == _dest || nullptr == src) { + return; + } + + aiAnimMesh* dest = *_dest = new aiAnimMesh(); + + // get a flat copy + ::memcpy(dest, src, sizeof(aiAnimMesh)); + + // and reallocate all arrays + GetArrayCopy(dest->mVertices, dest->mNumVertices); + GetArrayCopy(dest->mNormals, dest->mNumVertices); + GetArrayCopy(dest->mTangents, dest->mNumVertices); + GetArrayCopy(dest->mBitangents, dest->mNumVertices); + + unsigned int n = 0; + while (dest->HasTextureCoords(n)) + GetArrayCopy(dest->mTextureCoords[n++], dest->mNumVertices); + + n = 0; + while (dest->HasVertexColors(n)) + GetArrayCopy(dest->mColors[n++], dest->mNumVertices); } // ------------------------------------------------------------------------------------------------ @@ -1167,6 +1196,7 @@ void SceneCombiner::Copy( aiAnimation** _dest, const aiAnimation* src ) { // and reallocate all arrays CopyPtrArray( dest->mChannels, src->mChannels, dest->mNumChannels ); + CopyPtrArray( dest->mMorphMeshChannels, src->mMorphMeshChannels, dest->mNumMorphMeshChannels ); } // ------------------------------------------------------------------------------------------------ @@ -1186,6 +1216,26 @@ void SceneCombiner::Copy(aiNodeAnim** _dest, const aiNodeAnim* src) { GetArrayCopy( dest->mRotationKeys, dest->mNumRotationKeys ); } +void SceneCombiner::Copy(aiMeshMorphAnim** _dest, const aiMeshMorphAnim* src) { + if ( nullptr == _dest || nullptr == src ) { + return; + } + + aiMeshMorphAnim* dest = *_dest = new aiMeshMorphAnim(); + + // get a flat copy + ::memcpy(dest,src,sizeof(aiMeshMorphAnim)); + + // and reallocate all arrays + GetArrayCopy( dest->mKeys, dest->mNumKeys ); + for (ai_uint i = 0; i < dest->mNumKeys;++i) { + dest->mKeys[i].mValues = new unsigned int[dest->mKeys[i].mNumValuesAndWeights]; + dest->mKeys[i].mWeights = new double[dest->mKeys[i].mNumValuesAndWeights]; + ::memcpy(dest->mKeys[i].mValues, src->mKeys[i].mValues, dest->mKeys[i].mNumValuesAndWeights * sizeof(unsigned int)); + ::memcpy(dest->mKeys[i].mWeights, src->mKeys[i].mWeights, dest->mKeys[i].mNumValuesAndWeights * sizeof(double)); + } +} + // ------------------------------------------------------------------------------------------------ void SceneCombiner::Copy( aiCamera** _dest,const aiCamera* src) { if ( nullptr == _dest || nullptr == src ) { diff --git a/Engine/lib/assimp/code/ScenePreprocessor.cpp b/Engine/lib/assimp/code/Common/ScenePreprocessor.cpp similarity index 100% rename from Engine/lib/assimp/code/ScenePreprocessor.cpp rename to Engine/lib/assimp/code/Common/ScenePreprocessor.cpp diff --git a/Engine/lib/assimp/code/ScenePreprocessor.h b/Engine/lib/assimp/code/Common/ScenePreprocessor.h similarity index 100% rename from Engine/lib/assimp/code/ScenePreprocessor.h rename to Engine/lib/assimp/code/Common/ScenePreprocessor.h diff --git a/Engine/lib/assimp/code/ScenePrivate.h b/Engine/lib/assimp/code/Common/ScenePrivate.h similarity index 100% rename from Engine/lib/assimp/code/ScenePrivate.h rename to Engine/lib/assimp/code/Common/ScenePrivate.h diff --git a/Engine/lib/assimp/code/SkeletonMeshBuilder.cpp b/Engine/lib/assimp/code/Common/SkeletonMeshBuilder.cpp similarity index 100% rename from Engine/lib/assimp/code/SkeletonMeshBuilder.cpp rename to Engine/lib/assimp/code/Common/SkeletonMeshBuilder.cpp diff --git a/Engine/lib/assimp/code/SpatialSort.cpp b/Engine/lib/assimp/code/Common/SpatialSort.cpp similarity index 100% rename from Engine/lib/assimp/code/SpatialSort.cpp rename to Engine/lib/assimp/code/Common/SpatialSort.cpp diff --git a/Engine/lib/assimp/code/SplitByBoneCountProcess.cpp b/Engine/lib/assimp/code/Common/SplitByBoneCountProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/SplitByBoneCountProcess.cpp rename to Engine/lib/assimp/code/Common/SplitByBoneCountProcess.cpp diff --git a/Engine/lib/assimp/code/SplitByBoneCountProcess.h b/Engine/lib/assimp/code/Common/SplitByBoneCountProcess.h similarity index 100% rename from Engine/lib/assimp/code/SplitByBoneCountProcess.h rename to Engine/lib/assimp/code/Common/SplitByBoneCountProcess.h diff --git a/Engine/lib/assimp/code/StandardShapes.cpp b/Engine/lib/assimp/code/Common/StandardShapes.cpp similarity index 96% rename from Engine/lib/assimp/code/StandardShapes.cpp rename to Engine/lib/assimp/code/Common/StandardShapes.cpp index f262b6bac..2e5100130 100644 --- a/Engine/lib/assimp/code/StandardShapes.cpp +++ b/Engine/lib/assimp/code/Common/StandardShapes.cpp @@ -127,35 +127,35 @@ aiMesh* StandardShapes::MakeMesh(const std::vector& positions, // Determine which kinds of primitives the mesh consists of aiMesh* out = new aiMesh(); - switch (numIndices) - { - case 1: - out->mPrimitiveTypes = aiPrimitiveType_POINT; - break; - case 2: - out->mPrimitiveTypes = aiPrimitiveType_LINE; - break; - case 3: - out->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; - break; - default: - out->mPrimitiveTypes = aiPrimitiveType_POLYGON; - break; + switch (numIndices) { + case 1: + out->mPrimitiveTypes = aiPrimitiveType_POINT; + break; + case 2: + out->mPrimitiveTypes = aiPrimitiveType_LINE; + break; + case 3: + out->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; + break; + default: + out->mPrimitiveTypes = aiPrimitiveType_POLYGON; + break; }; out->mNumFaces = (unsigned int)positions.size() / numIndices; out->mFaces = new aiFace[out->mNumFaces]; - for (unsigned int i = 0, a = 0; i < out->mNumFaces;++i) - { + for (unsigned int i = 0, a = 0; i < out->mNumFaces;++i) { aiFace& f = out->mFaces[i]; f.mNumIndices = numIndices; f.mIndices = new unsigned int[numIndices]; - for (unsigned int i = 0; i < numIndices;++i,++a) - f.mIndices[i] = a; + for (unsigned int j = 0; i < numIndices; ++i, ++a) { + f.mIndices[j] = a; + } } out->mNumVertices = (unsigned int)positions.size(); out->mVertices = new aiVector3D[out->mNumVertices]; ::memcpy(out->mVertices,&positions[0],out->mNumVertices*sizeof(aiVector3D)); + return out; } @@ -466,8 +466,8 @@ void StandardShapes::MakeCone(ai_real height,ai_real radius1, // Need to flip face order? if ( SIZE_MAX != old ) { - for (size_t s = old; s < positions.size();s += 3) { - std::swap(positions[s],positions[s+1]); + for (size_t p = old; p < positions.size();p += 3) { + std::swap(positions[p],positions[p+1]); } } } diff --git a/Engine/lib/assimp/code/StdOStreamLogStream.h b/Engine/lib/assimp/code/Common/StdOStreamLogStream.h similarity index 100% rename from Engine/lib/assimp/code/StdOStreamLogStream.h rename to Engine/lib/assimp/code/Common/StdOStreamLogStream.h diff --git a/Engine/lib/assimp/code/Subdivision.cpp b/Engine/lib/assimp/code/Common/Subdivision.cpp similarity index 99% rename from Engine/lib/assimp/code/Subdivision.cpp rename to Engine/lib/assimp/code/Common/Subdivision.cpp index 19db223a5..60c54939f 100644 --- a/Engine/lib/assimp/code/Subdivision.cpp +++ b/Engine/lib/assimp/code/Common/Subdivision.cpp @@ -43,9 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include "ProcessHelper.h" #include #include + +#include "PostProcessing/ProcessHelper.h" + #include using namespace Assimp; @@ -56,8 +58,7 @@ void mydummy() {} * implementation is basing on recursive refinement. Directly evaluating the result is also * possible and much quicker, but it depends on lengthy matrix lookup tables. */ // ------------------------------------------------------------------------------------------------ -class CatmullClarkSubdivider : public Subdivider -{ +class CatmullClarkSubdivider : public Subdivider { public: void Subdivide (aiMesh* mesh, aiMesh*& out, unsigned int num, bool discard_input); void Subdivide (aiMesh** smesh, size_t nmesh, diff --git a/Engine/lib/assimp/code/TargetAnimation.cpp b/Engine/lib/assimp/code/Common/TargetAnimation.cpp similarity index 100% rename from Engine/lib/assimp/code/TargetAnimation.cpp rename to Engine/lib/assimp/code/Common/TargetAnimation.cpp diff --git a/Engine/lib/assimp/code/TargetAnimation.h b/Engine/lib/assimp/code/Common/TargetAnimation.h similarity index 100% rename from Engine/lib/assimp/code/TargetAnimation.h rename to Engine/lib/assimp/code/Common/TargetAnimation.h diff --git a/Engine/lib/assimp/code/Version.cpp b/Engine/lib/assimp/code/Common/Version.cpp similarity index 95% rename from Engine/lib/assimp/code/Version.cpp rename to Engine/lib/assimp/code/Common/Version.cpp index cc94340ac..cf1da7d5b 100644 --- a/Engine/lib/assimp/code/Version.cpp +++ b/Engine/lib/assimp/code/Common/Version.cpp @@ -46,8 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "ScenePrivate.h" -static const unsigned int MajorVersion = 4; -static const unsigned int MinorVersion = 1; +#include "revision.h" // -------------------------------------------------------------------------------- // Legal information string - don't remove this. @@ -56,9 +55,9 @@ static const char* LEGAL_INFORMATION = "Open Asset Import Library (Assimp).\n" "A free C/C++ library to import various 3D file formats into applications\n\n" -"(c) 2008-2017, assimp team\n" +"(c) 2006-2019, assimp team\n" "License under the terms and conditions of the 3-clause BSD license\n" -"http://assimp.sourceforge.net\n" +"http://assimp.org\n" ; // ------------------------------------------------------------------------------------------------ @@ -70,13 +69,13 @@ ASSIMP_API const char* aiGetLegalString () { // ------------------------------------------------------------------------------------------------ // Get Assimp minor version ASSIMP_API unsigned int aiGetVersionMinor () { - return MinorVersion; + return VER_MINOR; } // ------------------------------------------------------------------------------------------------ // Get Assimp major version ASSIMP_API unsigned int aiGetVersionMajor () { - return MajorVersion; + return VER_MAJOR; } // ------------------------------------------------------------------------------------------------ @@ -104,9 +103,6 @@ ASSIMP_API unsigned int aiGetCompileFlags () { return flags; } -// include current build revision, which is even updated from time to time -- :-) -#include "revision.h" - // ------------------------------------------------------------------------------------------------ ASSIMP_API unsigned int aiGetVersionRevision() { return GitVersion; diff --git a/Engine/lib/assimp/code/VertexTriangleAdjacency.cpp b/Engine/lib/assimp/code/Common/VertexTriangleAdjacency.cpp similarity index 100% rename from Engine/lib/assimp/code/VertexTriangleAdjacency.cpp rename to Engine/lib/assimp/code/Common/VertexTriangleAdjacency.cpp diff --git a/Engine/lib/assimp/code/VertexTriangleAdjacency.h b/Engine/lib/assimp/code/Common/VertexTriangleAdjacency.h similarity index 100% rename from Engine/lib/assimp/code/VertexTriangleAdjacency.h rename to Engine/lib/assimp/code/Common/VertexTriangleAdjacency.h diff --git a/Engine/lib/assimp/code/Win32DebugLogStream.h b/Engine/lib/assimp/code/Common/Win32DebugLogStream.h similarity index 100% rename from Engine/lib/assimp/code/Win32DebugLogStream.h rename to Engine/lib/assimp/code/Common/Win32DebugLogStream.h diff --git a/Engine/lib/assimp/code/Common/ZipArchiveIOSystem.cpp b/Engine/lib/assimp/code/Common/ZipArchiveIOSystem.cpp new file mode 100644 index 000000000..7c37a05f9 --- /dev/null +++ b/Engine/lib/assimp/code/Common/ZipArchiveIOSystem.cpp @@ -0,0 +1,539 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 ZipArchiveIOSystem.cpp + * @brief Zip File I/O implementation for #Importer + */ + +#include +#include + +#include + +#include +#include + +#ifdef ASSIMP_USE_HUNTER +# include +#else +# include +#endif + +namespace Assimp { + // ---------------------------------------------------------------- + // Wraps an existing Assimp::IOSystem for unzip + class IOSystem2Unzip { + public: + static voidpf open(voidpf opaque, const char* filename, int mode); + static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); + static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); + static long tell(voidpf opaque, voidpf stream); + static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); + static int close(voidpf opaque, voidpf stream); + static int testerror(voidpf opaque, voidpf stream); + static zlib_filefunc_def get(IOSystem* pIOHandler); + }; + + voidpf IOSystem2Unzip::open(voidpf opaque, const char* filename, int mode) { + IOSystem* io_system = reinterpret_cast(opaque); + + const char* mode_fopen = nullptr; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ) { + mode_fopen = "rb"; + } + else { + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) { + mode_fopen = "r+b"; + } + else { + if (mode & ZLIB_FILEFUNC_MODE_CREATE) { + mode_fopen = "wb"; + } + } + } + + return (voidpf)io_system->Open(filename, mode_fopen); + } + + uLong IOSystem2Unzip::read(voidpf /*opaque*/, voidpf stream, void* buf, uLong size) { + IOStream* io_stream = (IOStream*)stream; + + return static_cast(io_stream->Read(buf, 1, size)); + } + + uLong IOSystem2Unzip::write(voidpf /*opaque*/, voidpf stream, const void* buf, uLong size) { + IOStream* io_stream = (IOStream*)stream; + + return static_cast(io_stream->Write(buf, 1, size)); + } + + long IOSystem2Unzip::tell(voidpf /*opaque*/, voidpf stream) { + IOStream* io_stream = (IOStream*)stream; + + return static_cast(io_stream->Tell()); + } + + long IOSystem2Unzip::seek(voidpf /*opaque*/, voidpf stream, uLong offset, int origin) { + IOStream* io_stream = (IOStream*)stream; + + aiOrigin assimp_origin; + switch (origin) { + default: + case ZLIB_FILEFUNC_SEEK_CUR: + assimp_origin = aiOrigin_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END: + assimp_origin = aiOrigin_END; + break; + case ZLIB_FILEFUNC_SEEK_SET: + assimp_origin = aiOrigin_SET; + break; + } + + return (io_stream->Seek(offset, assimp_origin) == aiReturn_SUCCESS ? 0 : -1); + } + + int IOSystem2Unzip::close(voidpf opaque, voidpf stream) { + IOSystem* io_system = (IOSystem*)opaque; + IOStream* io_stream = (IOStream*)stream; + + io_system->Close(io_stream); + + return 0; + } + + int IOSystem2Unzip::testerror(voidpf /*opaque*/, voidpf /*stream*/) { + return 0; + } + + zlib_filefunc_def IOSystem2Unzip::get(IOSystem* pIOHandler) { + zlib_filefunc_def mapping; + +#ifdef ASSIMP_USE_HUNTER + mapping.zopen_file = (open_file_func)open; + mapping.zread_file = (read_file_func)read; + mapping.zwrite_file = (write_file_func)write; + mapping.ztell_file = (tell_file_func)tell; + mapping.zseek_file = (seek_file_func)seek; + mapping.zclose_file = (close_file_func)close; + mapping.zerror_file = (error_file_func)testerror; +#else + mapping.zopen_file = open; + mapping.zread_file = read; + mapping.zwrite_file = write; + mapping.ztell_file = tell; + mapping.zseek_file = seek; + mapping.zclose_file = close; + mapping.zerror_file = testerror; +#endif + mapping.opaque = reinterpret_cast(pIOHandler); + + return mapping; + } + + // ---------------------------------------------------------------- + // A read-only file inside a ZIP + + class ZipFile : public IOStream { + friend class ZipFileInfo; + explicit ZipFile(size_t size); + public: + virtual ~ZipFile(); + + // IOStream interface + size_t Read(void* pvBuffer, size_t pSize, size_t pCount) override; + size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) override { return 0; } + size_t FileSize() const override; + aiReturn Seek(size_t pOffset, aiOrigin pOrigin) override; + size_t Tell() const override; + void Flush() override {} + + private: + size_t m_Size = 0; + size_t m_SeekPtr = 0; + std::unique_ptr m_Buffer; + }; + + + // ---------------------------------------------------------------- + // Info about a read-only file inside a ZIP + class ZipFileInfo + { + public: + explicit ZipFileInfo(unzFile zip_handle, size_t size); + + // Allocate and Extract data from the ZIP + ZipFile * Extract(unzFile zip_handle) const; + + private: + size_t m_Size = 0; + unz_file_pos_s m_ZipFilePos; + }; + + ZipFileInfo::ZipFileInfo(unzFile zip_handle, size_t size) + : m_Size(size) { + ai_assert(m_Size != 0); + // Workaround for MSVC 2013 - C2797 + m_ZipFilePos.num_of_file = 0; + m_ZipFilePos.pos_in_zip_directory = 0; + unzGetFilePos(zip_handle, &(m_ZipFilePos)); + } + + ZipFile * ZipFileInfo::Extract(unzFile zip_handle) const { + // Find in the ZIP. This cannot fail + unz_file_pos_s *filepos = const_cast(&(m_ZipFilePos)); + if (unzGoToFilePos(zip_handle, filepos) != UNZ_OK) + return nullptr; + + if (unzOpenCurrentFile(zip_handle) != UNZ_OK) + return nullptr; + + ZipFile *zip_file = new ZipFile(m_Size); + + if (unzReadCurrentFile(zip_handle, zip_file->m_Buffer.get(), static_cast(m_Size)) != static_cast(m_Size)) + { + // Failed, release the memory + delete zip_file; + zip_file = nullptr; + } + + ai_assert(unzCloseCurrentFile(zip_handle) == UNZ_OK); + return zip_file; + } + + ZipFile::ZipFile(size_t size) + : m_Size(size) { + ai_assert(m_Size != 0); + m_Buffer = std::unique_ptr(new uint8_t[m_Size]); + } + + ZipFile::~ZipFile() { + } + + size_t ZipFile::Read(void* pvBuffer, size_t pSize, size_t pCount) { + // Should be impossible + ai_assert(m_Buffer != nullptr); + ai_assert(NULL != pvBuffer && 0 != pSize && 0 != pCount); + + // Clip down to file size + size_t byteSize = pSize * pCount; + if ((byteSize + m_SeekPtr) > m_Size) + { + pCount = (m_Size - m_SeekPtr) / pSize; + byteSize = pSize * pCount; + if (byteSize == 0) + return 0; + } + + std::memcpy(pvBuffer, m_Buffer.get() + m_SeekPtr, byteSize); + + m_SeekPtr += byteSize; + + return pCount; + } + + size_t ZipFile::FileSize() const { + return m_Size; + } + + aiReturn ZipFile::Seek(size_t pOffset, aiOrigin pOrigin) { + switch (pOrigin) + { + case aiOrigin_SET: { + if (pOffset > m_Size) return aiReturn_FAILURE; + m_SeekPtr = pOffset; + return aiReturn_SUCCESS; + } + + case aiOrigin_CUR: { + if ((pOffset + m_SeekPtr) > m_Size) return aiReturn_FAILURE; + m_SeekPtr += pOffset; + return aiReturn_SUCCESS; + } + + case aiOrigin_END: { + if (pOffset > m_Size) return aiReturn_FAILURE; + m_SeekPtr = m_Size - pOffset; + return aiReturn_SUCCESS; + } + default:; + } + + return aiReturn_FAILURE; + } + + size_t ZipFile::Tell() const { + return m_SeekPtr; + } + + // ---------------------------------------------------------------- + // pImpl of the Zip Archive IO + class ZipArchiveIOSystem::Implement { + public: + static const unsigned int FileNameSize = 256; + + Implement(IOSystem* pIOHandler, const char* pFilename, const char* pMode); + ~Implement(); + + bool isOpen() const; + void getFileList(std::vector& rFileList); + void getFileListExtension(std::vector& rFileList, const std::string& extension); + bool Exists(std::string& filename); + IOStream* OpenFile(std::string& filename); + + static void SimplifyFilename(std::string& filename); + + private: + void MapArchive(); + + private: + typedef std::map ZipFileInfoMap; + + unzFile m_ZipFileHandle = nullptr; + ZipFileInfoMap m_ArchiveMap; + }; + + ZipArchiveIOSystem::Implement::Implement(IOSystem* pIOHandler, const char* pFilename, const char* pMode) { + ai_assert(strcmp(pMode, "r") == 0); + ai_assert(pFilename != nullptr); + if (pFilename[0] == 0) + return; + + zlib_filefunc_def mapping = IOSystem2Unzip::get(pIOHandler); + m_ZipFileHandle = unzOpen2(pFilename, &mapping); + } + + ZipArchiveIOSystem::Implement::~Implement() { + m_ArchiveMap.clear(); + + if (m_ZipFileHandle != nullptr) { + unzClose(m_ZipFileHandle); + m_ZipFileHandle = nullptr; + } + } + + void ZipArchiveIOSystem::Implement::MapArchive() { + if (m_ZipFileHandle == nullptr) + return; + + if (!m_ArchiveMap.empty()) + return; + + // At first ensure file is already open + if (unzGoToFirstFile(m_ZipFileHandle) != UNZ_OK) + return; + + // Loop over all files + do { + char filename[FileNameSize]; + unz_file_info fileInfo; + + if (unzGetCurrentFileInfo(m_ZipFileHandle, &fileInfo, filename, FileNameSize, nullptr, 0, nullptr, 0) == UNZ_OK) { + if (fileInfo.uncompressed_size != 0) { + std::string filename_string(filename, fileInfo.size_filename); + SimplifyFilename(filename_string); + m_ArchiveMap.emplace(filename_string, ZipFileInfo(m_ZipFileHandle, fileInfo.uncompressed_size)); + } + } + } while (unzGoToNextFile(m_ZipFileHandle) != UNZ_END_OF_LIST_OF_FILE); + } + + bool ZipArchiveIOSystem::Implement::isOpen() const { + return (m_ZipFileHandle != nullptr); + } + + void ZipArchiveIOSystem::Implement::getFileList(std::vector& rFileList) { + MapArchive(); + rFileList.clear(); + + for (const auto &file : m_ArchiveMap) { + rFileList.push_back(file.first); + } + } + + void ZipArchiveIOSystem::Implement::getFileListExtension(std::vector& rFileList, const std::string& extension) { + MapArchive(); + rFileList.clear(); + + for (const auto &file : m_ArchiveMap) { + if (extension == BaseImporter::GetExtension(file.first)) + rFileList.push_back(file.first); + } + } + + bool ZipArchiveIOSystem::Implement::Exists(std::string& filename) { + MapArchive(); + + ZipFileInfoMap::const_iterator it = m_ArchiveMap.find(filename); + return (it != m_ArchiveMap.end()); + } + + IOStream * ZipArchiveIOSystem::Implement::OpenFile(std::string& filename) { + MapArchive(); + + SimplifyFilename(filename); + + // Find in the map + ZipFileInfoMap::const_iterator zip_it = m_ArchiveMap.find(filename); + if (zip_it == m_ArchiveMap.cend()) + return nullptr; + + const ZipFileInfo &zip_file = (*zip_it).second; + return zip_file.Extract(m_ZipFileHandle); + } + + inline void ReplaceAll(std::string& data, const std::string& before, const std::string& after) { + size_t pos = data.find(before); + while (pos != std::string::npos) + { + data.replace(pos, before.size(), after); + pos = data.find(before, pos + after.size()); + } + } + + inline void ReplaceAllChar(std::string& data, const char before, const char after) { + size_t pos = data.find(before); + while (pos != std::string::npos) + { + data[pos] = after; + pos = data.find(before, pos + 1); + } + } + + void ZipArchiveIOSystem::Implement::SimplifyFilename(std::string& filename) + { + ReplaceAllChar(filename, '\\', '/'); + + // Remove all . and / from the beginning of the path + size_t pos = filename.find_first_not_of("./"); + if (pos != 0) + filename.erase(0, pos); + + // Simplify "my/folder/../file.png" constructions, if any + static const std::string relative("/../"); + const size_t relsize = relative.size() - 1; + pos = filename.find(relative); + while (pos != std::string::npos) + { + // Previous slash + size_t prevpos = filename.rfind('/', pos - 1); + if (prevpos == pos) + filename.erase(0, pos + relative.size()); + else + filename.erase(prevpos, pos + relsize - prevpos); + + pos = filename.find(relative); + } + } + + ZipArchiveIOSystem::ZipArchiveIOSystem(IOSystem* pIOHandler, const char* pFilename, const char* pMode) + : pImpl(new Implement(pIOHandler, pFilename, pMode)) { + } + + // ---------------------------------------------------------------- + // The ZipArchiveIO + ZipArchiveIOSystem::ZipArchiveIOSystem(IOSystem* pIOHandler, const std::string& rFilename, const char* pMode) + : pImpl(new Implement(pIOHandler, rFilename.c_str(), pMode)) + { + } + + ZipArchiveIOSystem::~ZipArchiveIOSystem() { + delete pImpl; + } + + bool ZipArchiveIOSystem::Exists(const char* pFilename) const { + ai_assert(pFilename != nullptr); + + if (pFilename == nullptr) { + return false; + } + + std::string filename(pFilename); + return pImpl->Exists(filename); + } + + // This is always '/' in a ZIP + char ZipArchiveIOSystem::getOsSeparator() const { + return '/'; + } + + // Only supports Reading + IOStream * ZipArchiveIOSystem::Open(const char* pFilename, const char* pMode) { + ai_assert(pFilename != nullptr); + + for (size_t i = 0; pMode[i] != 0; ++i) + { + ai_assert(pMode[i] != 'w'); + if (pMode[i] == 'w') + return nullptr; + } + + std::string filename(pFilename); + return pImpl->OpenFile(filename); + } + + void ZipArchiveIOSystem::Close(IOStream* pFile) { + delete pFile; + } + + bool ZipArchiveIOSystem::isOpen() const { + return (pImpl->isOpen()); + } + + void ZipArchiveIOSystem::getFileList(std::vector& rFileList) const { + return pImpl->getFileList(rFileList); + } + + void ZipArchiveIOSystem::getFileListExtension(std::vector& rFileList, const std::string& extension) const { + return pImpl->getFileListExtension(rFileList, extension); + } + + bool ZipArchiveIOSystem::isZipArchive(IOSystem* pIOHandler, const char* pFilename) { + Implement tmp(pIOHandler, pFilename, "r"); + return tmp.isOpen(); + } + + bool ZipArchiveIOSystem::isZipArchive(IOSystem* pIOHandler, const std::string& rFilename) { + return isZipArchive(pIOHandler, rFilename.c_str()); + } + +} diff --git a/Engine/lib/assimp/code/assbin_chunks.h b/Engine/lib/assimp/code/Common/assbin_chunks.h similarity index 100% rename from Engine/lib/assimp/code/assbin_chunks.h rename to Engine/lib/assimp/code/Common/assbin_chunks.h diff --git a/Engine/lib/assimp/code/scene.cpp b/Engine/lib/assimp/code/Common/scene.cpp similarity index 95% rename from Engine/lib/assimp/code/scene.cpp rename to Engine/lib/assimp/code/Common/scene.cpp index 2acb348d8..d15619acf 100644 --- a/Engine/lib/assimp/code/scene.cpp +++ b/Engine/lib/assimp/code/Common/scene.cpp @@ -44,23 +44,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. aiNode::aiNode() : mName("") -, mParent(NULL) +, mParent(nullptr) , mNumChildren(0) -, mChildren(NULL) +, mChildren(nullptr) , mNumMeshes(0) -, mMeshes(NULL) -, mMetaData(NULL) { +, mMeshes(nullptr) +, mMetaData(nullptr) { // empty } aiNode::aiNode(const std::string& name) : mName(name) -, mParent(NULL) +, mParent(nullptr) , mNumChildren(0) -, mChildren(NULL) +, mChildren(nullptr) , mNumMeshes(0) -, mMeshes(NULL) -, mMetaData(NULL) { +, mMeshes(nullptr) +, mMetaData(nullptr) { // empty } @@ -68,7 +68,7 @@ aiNode::aiNode(const std::string& name) aiNode::~aiNode() { // delete all children recursively // to make sure we won't crash if the data is invalid ... - if (mChildren && mNumChildren) + if (mNumChildren && mChildren) { for (unsigned int a = 0; a < mNumChildren; a++) delete mChildren[a]; diff --git a/Engine/lib/assimp/code/simd.cpp b/Engine/lib/assimp/code/Common/simd.cpp similarity index 100% rename from Engine/lib/assimp/code/simd.cpp rename to Engine/lib/assimp/code/Common/simd.cpp diff --git a/Engine/lib/assimp/code/simd.h b/Engine/lib/assimp/code/Common/simd.h similarity index 100% rename from Engine/lib/assimp/code/simd.h rename to Engine/lib/assimp/code/Common/simd.h diff --git a/Engine/lib/assimp/code/D3MFOpcPackage.cpp b/Engine/lib/assimp/code/D3MFOpcPackage.cpp deleted file mode 100644 index 2545a2750..000000000 --- a/Engine/lib/assimp/code/D3MFOpcPackage.cpp +++ /dev/null @@ -1,531 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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_3MF_IMPORTER - -#include "D3MFOpcPackage.h" -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include "3MFXmlTags.h" - -namespace Assimp { - -namespace D3MF { - -class IOSystem2Unzip { -public: - static voidpf open(voidpf opaque, const char* filename, int mode); - static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); - static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); - static long tell(voidpf opaque, voidpf stream); - static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); - static int close(voidpf opaque, voidpf stream); - static int testerror(voidpf opaque, voidpf stream); - static zlib_filefunc_def get(IOSystem* pIOHandler); -}; - -voidpf IOSystem2Unzip::open(voidpf opaque, const char* filename, int mode) { - IOSystem* io_system = reinterpret_cast(opaque); - - const char* mode_fopen = NULL; - if((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) { - mode_fopen = "rb"; - } else { - if(mode & ZLIB_FILEFUNC_MODE_EXISTING) { - mode_fopen = "r+b"; - } else { - if(mode & ZLIB_FILEFUNC_MODE_CREATE) { - mode_fopen = "wb"; - } - } - } - - return (voidpf) io_system->Open(filename, mode_fopen); -} - -uLong IOSystem2Unzip::read(voidpf /*opaque*/, voidpf stream, void* buf, uLong size) { - IOStream* io_stream = (IOStream*) stream; - - return static_cast(io_stream->Read(buf, 1, size)); -} - -uLong IOSystem2Unzip::write(voidpf /*opaque*/, voidpf stream, const void* buf, uLong size) { - IOStream* io_stream = (IOStream*) stream; - - return static_cast(io_stream->Write(buf, 1, size)); -} - -long IOSystem2Unzip::tell(voidpf /*opaque*/, voidpf stream) { - IOStream* io_stream = (IOStream*) stream; - - return static_cast(io_stream->Tell()); -} - -long IOSystem2Unzip::seek(voidpf /*opaque*/, voidpf stream, uLong offset, int origin) { - IOStream* io_stream = (IOStream*) stream; - - aiOrigin assimp_origin; - switch (origin) { - default: - case ZLIB_FILEFUNC_SEEK_CUR: - assimp_origin = aiOrigin_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END: - assimp_origin = aiOrigin_END; - break; - case ZLIB_FILEFUNC_SEEK_SET: - assimp_origin = aiOrigin_SET; - break; - } - - return (io_stream->Seek(offset, assimp_origin) == aiReturn_SUCCESS ? 0 : -1); -} - -int IOSystem2Unzip::close(voidpf opaque, voidpf stream) { - IOSystem* io_system = (IOSystem*) opaque; - IOStream* io_stream = (IOStream*) stream; - - io_system->Close(io_stream); - - return 0; -} - -int IOSystem2Unzip::testerror(voidpf /*opaque*/, voidpf /*stream*/) { - return 0; -} - -zlib_filefunc_def IOSystem2Unzip::get(IOSystem* pIOHandler) { - zlib_filefunc_def mapping; - - mapping.zopen_file = open; - mapping.zread_file = read; - mapping.zwrite_file = write; - mapping.ztell_file = tell; - mapping.zseek_file = seek; - mapping.zclose_file = close; - mapping.zerror_file = testerror; - mapping.opaque = reinterpret_cast(pIOHandler); - - return mapping; -} - -class ZipFile : public IOStream { - friend class D3MFZipArchive; - -public: - explicit ZipFile(size_t size); - virtual ~ZipFile(); - 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 FileSize() const; - aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/); - size_t Tell() const; - void Flush(); - -private: - void *m_Buffer; - size_t m_Size; -}; - -ZipFile::ZipFile(size_t size) -: m_Buffer( nullptr ) -, m_Size(size) { - ai_assert(m_Size != 0); - m_Buffer = ::malloc(m_Size); -} - -ZipFile::~ZipFile() { - ::free(m_Buffer); - m_Buffer = NULL; -} - -size_t ZipFile::Read(void* pvBuffer, size_t pSize, size_t pCount) { - const size_t size = pSize * pCount; - ai_assert(size <= m_Size); - - std::memcpy(pvBuffer, m_Buffer, size); - - return size; -} - -size_t ZipFile::Write(const void* pvBuffer, size_t size, size_t pCount ) { - const size_t size_to_write( size * pCount ); - if ( 0 == size_to_write ) { - return 0U; - } - return 0U; -} - -size_t ZipFile::FileSize() const { - return m_Size; -} - -aiReturn ZipFile::Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) { - return aiReturn_FAILURE; -} - -size_t ZipFile::Tell() const { - return 0; -} - -void ZipFile::Flush() { - // empty -} - -class D3MFZipArchive : public IOSystem { -public: - static const unsigned int FileNameSize = 256; - - D3MFZipArchive(IOSystem* pIOHandler, const std::string & rFile); - ~D3MFZipArchive(); - bool Exists(const char* pFile) const; - char getOsSeparator() const; - IOStream* Open(const char* pFile, const char* pMode = "rb"); - void Close(IOStream* pFile); - bool isOpen() const; - void getFileList(std::vector &rFileList); - -private: - bool mapArchive(); - -private: - unzFile m_ZipFileHandle; - std::map m_ArchiveMap; -}; - -// ------------------------------------------------------------------------------------------------ -// Constructor. -D3MFZipArchive::D3MFZipArchive(IOSystem* pIOHandler, const std::string& rFile) -: m_ZipFileHandle( nullptr ) -, m_ArchiveMap() { - if (! rFile.empty()) { - zlib_filefunc_def mapping = IOSystem2Unzip::get(pIOHandler); - - m_ZipFileHandle = unzOpen2(rFile.c_str(), &mapping); - if(m_ZipFileHandle != nullptr ) { - mapArchive(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Destructor. -D3MFZipArchive::~D3MFZipArchive() { - for(auto &file : m_ArchiveMap) { - delete file.second; - } - m_ArchiveMap.clear(); - - if(m_ZipFileHandle != nullptr) { - unzClose(m_ZipFileHandle); - m_ZipFileHandle = nullptr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Returns true, if the archive is already open. -bool D3MFZipArchive::isOpen() const { - return (m_ZipFileHandle != nullptr ); -} - -// ------------------------------------------------------------------------------------------------ -// Returns true, if the filename is part of the archive. -bool D3MFZipArchive::Exists(const char* pFile) const { - ai_assert(pFile != nullptr ); - - if ( pFile == nullptr ) { - return false; - } - - std::string filename(pFile); - std::map::const_iterator it = m_ArchiveMap.find(filename); - bool exist( false ); - if(it != m_ArchiveMap.end()) { - exist = true; - } - - return exist; -} - -// ------------------------------------------------------------------------------------------------ -// Returns the separator delimiter. -char D3MFZipArchive::getOsSeparator() const { -#ifndef _WIN32 - return '/'; -#else - return '\\'; -#endif -} - -// ------------------------------------------------------------------------------------------------ -// Opens a file, which is part of the archive. -IOStream *D3MFZipArchive::Open(const char* pFile, const char* /*pMode*/) { - ai_assert(pFile != NULL); - - IOStream* result = NULL; - - std::map::iterator it = m_ArchiveMap.find(pFile); - - if(it != m_ArchiveMap.end()) { - result = static_cast(it->second); - } - - return result; -} - -// ------------------------------------------------------------------------------------------------ -// Close a filestream. -void D3MFZipArchive::Close(IOStream *pFile) { - (void)(pFile); - ai_assert(pFile != NULL); - - // We don't do anything in case the file would be opened again in the future -} -// ------------------------------------------------------------------------------------------------ -// Returns the file-list of the archive. -void D3MFZipArchive::getFileList(std::vector &rFileList) { - rFileList.clear(); - - for(const auto &file : m_ArchiveMap) { - rFileList.push_back(file.first); - } -} - -// ------------------------------------------------------------------------------------------------ -// Maps the archive content. -bool D3MFZipArchive::mapArchive() { - bool success = false; - - if(m_ZipFileHandle != NULL) { - if(m_ArchiveMap.empty()) { - // At first ensure file is already open - if(unzGoToFirstFile(m_ZipFileHandle) == UNZ_OK) { - // Loop over all files - do { - char filename[FileNameSize]; - unz_file_info fileInfo; - - if(unzGetCurrentFileInfo(m_ZipFileHandle, &fileInfo, filename, FileNameSize, NULL, 0, NULL, 0) == UNZ_OK) { - // The file has EXACTLY the size of uncompressed_size. In C - // you need to mark the last character with '\0', so add - // another character - if(fileInfo.uncompressed_size != 0 && unzOpenCurrentFile(m_ZipFileHandle) == UNZ_OK) { - std::pair::iterator, bool> result = m_ArchiveMap.insert(std::make_pair(filename, new ZipFile(fileInfo.uncompressed_size))); - - if(unzReadCurrentFile(m_ZipFileHandle, result.first->second->m_Buffer, fileInfo.uncompressed_size) == (long int) fileInfo.uncompressed_size) { - if(unzCloseCurrentFile(m_ZipFileHandle) == UNZ_OK) { - // Nothing to do anymore... - } - } - } - } - } while(unzGoToNextFile(m_ZipFileHandle) != UNZ_END_OF_LIST_OF_FILE); - } - } - - success = true; - } - - return success; -} - -// ------------------------------------------------------------------------------------------------ - -typedef std::shared_ptr OpcPackageRelationshipPtr; - -class OpcPackageRelationshipReader { -public: - OpcPackageRelationshipReader(XmlReader* xmlReader) { - while(xmlReader->read()) { - if(xmlReader->getNodeType() == irr::io::EXN_ELEMENT && - xmlReader->getNodeName() == XmlTag::RELS_RELATIONSHIP_CONTAINER) - { - ParseRootNode(xmlReader); - } - } - } - - void ParseRootNode(XmlReader* xmlReader) - { - ParseAttributes(xmlReader); - - while(xmlReader->read()) - { - if(xmlReader->getNodeType() == irr::io::EXN_ELEMENT && - xmlReader->getNodeName() == XmlTag::RELS_RELATIONSHIP_NODE) - { - ParseChildNode(xmlReader); - } - } - } - - void ParseAttributes(XmlReader*) { - // empty - } - - bool validateRels( OpcPackageRelationshipPtr &relPtr ) { - if ( relPtr->id.empty() || relPtr->type.empty() || relPtr->target.empty() ) { - return false; - } - return true; - } - - void ParseChildNode(XmlReader* xmlReader) { - OpcPackageRelationshipPtr relPtr(new OpcPackageRelationship()); - - relPtr->id = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_ID.c_str()); - relPtr->type = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_TYPE.c_str()); - relPtr->target = xmlReader->getAttributeValueSafe(XmlTag::RELS_ATTRIB_TARGET.c_str()); - if ( validateRels( relPtr ) ) { - m_relationShips.push_back( relPtr ); - } - } - - std::vector m_relationShips; -}; - -// ------------------------------------------------------------------------------------------------ -D3MFOpcPackage::D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile) -: mRootStream(nullptr) -, mZipArchive() { - mZipArchive.reset( new D3MF::D3MFZipArchive( pIOHandler, rFile ) ); - if(!mZipArchive->isOpen()) { - throw DeadlyImportError("Failed to open file " + rFile+ "."); - } - - std::vector fileList; - mZipArchive->getFileList(fileList); - - for (auto& file: fileList) { - if(file == D3MF::XmlTag::ROOT_RELATIONSHIPS_ARCHIVE) { - //PkgRelationshipReader pkgRelReader(file, archive); - ai_assert(mZipArchive->Exists(file.c_str())); - - IOStream *fileStream = mZipArchive->Open(file.c_str()); - - ai_assert(fileStream != nullptr); - - std::string rootFile = ReadPackageRootRelationship(fileStream); - if ( rootFile.size() > 0 && rootFile[ 0 ] == '/' ) { - rootFile = rootFile.substr( 1 ); - if ( rootFile[ 0 ] == '/' ) { - // deal with zip-bug - rootFile = rootFile.substr( 1 ); - } - } - - ASSIMP_LOG_DEBUG(rootFile); - - mRootStream = mZipArchive->Open(rootFile.c_str()); - ai_assert( mRootStream != nullptr ); - if ( nullptr == mRootStream ) { - throw DeadlyExportError( "Cannot open root-file in archive : " + rootFile ); - } - - mZipArchive->Close( fileStream ); - - } else if( file == D3MF::XmlTag::CONTENT_TYPES_ARCHIVE) { - - } - } -} - -D3MFOpcPackage::~D3MFOpcPackage() { - // empty -} - -IOStream* D3MFOpcPackage::RootStream() const { - return mRootStream; -} - -static const std::string ModelRef = "3D/3dmodel.model"; - -bool D3MFOpcPackage::validate() { - if ( nullptr == mRootStream || nullptr == mZipArchive ) { - return false; - } - - return mZipArchive->Exists( ModelRef.c_str() ); -} - -bool D3MFOpcPackage::isZipArchive( IOSystem* pIOHandler, const std::string& rFile ) { - D3MF::D3MFZipArchive ar( pIOHandler, rFile ); - if ( !ar.isOpen() ) { - return false; - } - - return true; -} - -std::string D3MFOpcPackage::ReadPackageRootRelationship(IOStream* stream) { - std::unique_ptr xmlStream(new CIrrXML_IOStreamReader(stream)); - std::unique_ptr xml(irr::io::createIrrXMLReader(xmlStream.get())); - - OpcPackageRelationshipReader reader(xml.get()); - - auto itr = std::find_if(reader.m_relationShips.begin(), reader.m_relationShips.end(), [](const OpcPackageRelationshipPtr& rel){ - return rel->type == XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE; - }); - - if ( itr == reader.m_relationShips.end() ) { - throw DeadlyImportError( "Cannot find " + XmlTag::PACKAGE_START_PART_RELATIONSHIP_TYPE ); - } - - return (*itr)->target; -} - -} // Namespace D3MF -} // Namespace Assimp - -#endif //ASSIMP_BUILD_NO_3MF_IMPORTER diff --git a/Engine/lib/assimp/code/DXFHelper.h b/Engine/lib/assimp/code/DXF/DXFHelper.h similarity index 100% rename from Engine/lib/assimp/code/DXFHelper.h rename to Engine/lib/assimp/code/DXF/DXFHelper.h diff --git a/Engine/lib/assimp/code/DXFLoader.cpp b/Engine/lib/assimp/code/DXF/DXFLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/DXFLoader.cpp rename to Engine/lib/assimp/code/DXF/DXFLoader.cpp index ab86f89ae..baf315485 100644 --- a/Engine/lib/assimp/code/DXFLoader.cpp +++ b/Engine/lib/assimp/code/DXF/DXFLoader.cpp @@ -48,12 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_DXF_IMPORTER -#include "DXFLoader.h" -#include -#include "ConvertToLHProcess.h" -#include +#include "DXF/DXFLoader.h" +#include "DXF/DXFHelper.h" +#include "PostProcessing/ConvertToLHProcess.h" -#include "DXFHelper.h" +#include +#include #include #include #include diff --git a/Engine/lib/assimp/code/DXFLoader.h b/Engine/lib/assimp/code/DXF/DXFLoader.h similarity index 100% rename from Engine/lib/assimp/code/DXFLoader.h rename to Engine/lib/assimp/code/DXF/DXFLoader.h diff --git a/Engine/lib/assimp/code/Exceptional.h b/Engine/lib/assimp/code/Exceptional.h deleted file mode 100644 index 5109b8f07..000000000 --- a/Engine/lib/assimp/code/Exceptional.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2008, 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 INCLUDED_EXCEPTIONAL_H -#define INCLUDED_EXCEPTIONAL_H - -#include -#include -using std::runtime_error; - -#ifdef _MSC_VER -# pragma warning(disable : 4275) -#endif - -// --------------------------------------------------------------------------- -/** FOR IMPORTER PLUGINS ONLY: Simple exception class to be thrown if an - * unrecoverable error occurs while importing. Loading APIs return - * NULL instead of a valid aiScene then. */ -class DeadlyImportError - : public runtime_error -{ -public: - /** Constructor with arguments */ - explicit DeadlyImportError( const std::string& errorText) - : runtime_error(errorText) - { - } - -private: -}; - -typedef DeadlyImportError DeadlyExportError; - -#ifdef _MSC_VER -# pragma warning(default : 4275) -#endif - -// --------------------------------------------------------------------------- -template -struct ExceptionSwallower { - T operator ()() const { - return T(); - } -}; - -// --------------------------------------------------------------------------- -template -struct ExceptionSwallower { - T* operator ()() const { - return NULL; - } -}; - -// --------------------------------------------------------------------------- -template <> -struct ExceptionSwallower { - aiReturn operator ()() const { - try { - throw; - } - catch (std::bad_alloc&) { - return aiReturn_OUTOFMEMORY; - } - catch (...) { - return aiReturn_FAILURE; - } - } -}; - -// --------------------------------------------------------------------------- -template <> -struct ExceptionSwallower { - void operator ()() const { - return; - } -}; - -#define ASSIMP_BEGIN_EXCEPTION_REGION()\ -{\ - try { - -#define ASSIMP_END_EXCEPTION_REGION(type)\ - } catch(...) {\ - return ExceptionSwallower()();\ - }\ -} - -#endif // INCLUDED_EXCEPTIONAL_H diff --git a/Engine/lib/assimp/code/FBXAnimation.cpp b/Engine/lib/assimp/code/FBX/FBXAnimation.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXAnimation.cpp rename to Engine/lib/assimp/code/FBX/FBXAnimation.cpp diff --git a/Engine/lib/assimp/code/FBXBinaryTokenizer.cpp b/Engine/lib/assimp/code/FBX/FBXBinaryTokenizer.cpp similarity index 97% rename from Engine/lib/assimp/code/FBXBinaryTokenizer.cpp rename to Engine/lib/assimp/code/FBX/FBXBinaryTokenizer.cpp index 7138df431..a4a2bc8e7 100644 --- a/Engine/lib/assimp/code/FBXBinaryTokenizer.cpp +++ b/Engine/lib/assimp/code/FBX/FBXBinaryTokenizer.cpp @@ -98,7 +98,7 @@ namespace FBX { // return (flags & to_check) != 0; //} // ------------------------------------------------------------------------------------------------ -Token::Token(const char* sbegin, const char* send, TokenType type, unsigned int offset) +Token::Token(const char* sbegin, const char* send, TokenType type, size_t offset) : #ifdef DEBUG contents(sbegin, static_cast(send-sbegin)), @@ -122,18 +122,18 @@ namespace { // ------------------------------------------------------------------------------------------------ // signal tokenization error, this is always unrecoverable. Throws DeadlyImportError. -AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int offset) AI_WONT_RETURN_SUFFIX; -AI_WONT_RETURN void TokenizeError(const std::string& message, unsigned int offset) +AI_WONT_RETURN void TokenizeError(const std::string& message, size_t offset) AI_WONT_RETURN_SUFFIX; +AI_WONT_RETURN void TokenizeError(const std::string& message, size_t offset) { throw DeadlyImportError(Util::AddOffset("FBX-Tokenize",message,offset)); } // ------------------------------------------------------------------------------------------------ -uint32_t Offset(const char* begin, const char* cursor) { +size_t Offset(const char* begin, const char* cursor) { ai_assert(begin <= cursor); - return static_cast(cursor - begin); + return cursor - begin; } // ------------------------------------------------------------------------------------------------ @@ -424,7 +424,7 @@ 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, unsigned int length) +void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length) { ai_assert(input); diff --git a/Engine/lib/assimp/code/FBXCommon.h b/Engine/lib/assimp/code/FBX/FBXCommon.h similarity index 89% rename from Engine/lib/assimp/code/FBXCommon.h rename to Engine/lib/assimp/code/FBX/FBXCommon.h index fcb20a5ca..b28601c74 100644 --- a/Engine/lib/assimp/code/FBXCommon.h +++ b/Engine/lib/assimp/code/FBX/FBXCommon.h @@ -47,12 +47,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER - +namespace Assimp { namespace FBX { - const std::string NULL_RECORD = { // 13 null bytes - '\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0' - }; // who knows why + const std::string NULL_RECORD = { // 25 null bytes in 64-bit and 13 null bytes in 32-bit + '\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0', + '\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0','\0' + }; // who knows why, it looks like two integers 32/64 bit (compressed and uncompressed sizes?) + 1 byte (might be compression type?) const std::string SEPARATOR = {'\x00', '\x01'}; // for use inside strings const std::string MAGIC_NODE_TAG = "_$AssimpFbx$"; // from import const int64_t SECOND = 46186158000; // FBX's kTime unit @@ -80,7 +81,7 @@ namespace FBX TransformInheritance_MAX // end-of-enum sentinel }; } - +} #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // AI_FBXCOMMON_H_INC diff --git a/Engine/lib/assimp/code/FBXCompileConfig.h b/Engine/lib/assimp/code/FBX/FBXCompileConfig.h similarity index 87% rename from Engine/lib/assimp/code/FBXCompileConfig.h rename to Engine/lib/assimp/code/FBX/FBXCompileConfig.h index 3a3841fa5..03536a182 100644 --- a/Engine/lib/assimp/code/FBXCompileConfig.h +++ b/Engine/lib/assimp/code/FBX/FBXCompileConfig.h @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define INCLUDED_AI_FBX_COMPILECONFIG_H #include +#include // #if _MSC_VER > 1500 || (defined __GNUC___) @@ -54,16 +55,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # else # define fbx_unordered_map map # define fbx_unordered_multimap multimap +# define fbx_unordered_set set +# define fbx_unordered_multiset multiset #endif #ifdef ASSIMP_FBX_USE_UNORDERED_MULTIMAP # include +# include # if _MSC_VER > 1600 # define fbx_unordered_map unordered_map # define fbx_unordered_multimap unordered_multimap +# define fbx_unordered_set unordered_set +# define fbx_unordered_multiset unordered_multiset # else # define fbx_unordered_map tr1::unordered_map # define fbx_unordered_multimap tr1::unordered_multimap +# define fbx_unordered_set tr1::unordered_set +# define fbx_unordered_multiset tr1::unordered_multiset # endif #endif diff --git a/Engine/lib/assimp/code/FBXConverter.cpp b/Engine/lib/assimp/code/FBX/FBXConverter.cpp similarity index 85% rename from Engine/lib/assimp/code/FBXConverter.cpp rename to Engine/lib/assimp/code/FBX/FBXConverter.cpp index c556d3bba..d8a22d9f7 100644 --- a/Engine/lib/assimp/code/FBXConverter.cpp +++ b/Engine/lib/assimp/code/FBX/FBXConverter.cpp @@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXImporter.h" #include +#include #include @@ -66,6 +67,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include +#include +#include namespace Assimp { namespace FBX { @@ -74,16 +78,33 @@ namespace Assimp { #define MAGIC_NODE_TAG "_$AssimpFbx$" -#define CONVERT_FBX_TIME(time) static_cast(time) / 46186158000L +#define CONVERT_FBX_TIME(time) static_cast(time) / 46186158000LL - FBXConverter::FBXConverter(aiScene* out, const Document& doc) - : defaultMaterialIndex() - , out(out) - , doc(doc) { + FBXConverter::FBXConverter(aiScene* out, const Document& doc, bool removeEmptyBones ) + : defaultMaterialIndex() + , lights() + , cameras() + , textures() + , materials_converted() + , textures_converted() + , meshes_converted() + , node_anim_chain_bits() + , mNodeNames() + , anim_fps() + , out(out) + , doc(doc) { // animations need to be converted first since this will // populate the node_anim_chain_bits map, which is needed // to determine which nodes need to be generated. ConvertAnimations(); + // Embedded textures in FBX could be connected to nothing but to itself, + // for instance Texture -> Video connection only but not to the main graph, + // 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(); + } ConvertRootNode(); if (doc.Settings().readAllMaterials) { @@ -128,13 +149,50 @@ namespace Assimp { void FBXConverter::ConvertRootNode() { out->mRootNode = new aiNode(); - out->mRootNode->mName.Set("RootNode"); + std::string unique_name; + GetUniqueName("RootNode", unique_name); + out->mRootNode->mName.Set(unique_name); // root has ID 0 - ConvertNodes(0L, *out->mRootNode); + ConvertNodes(0L, out->mRootNode, out->mRootNode); } - void FBXConverter::ConvertNodes(uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform) { + static std::string getAncestorBaseName(const aiNode* node) + { + const char* nodeName = nullptr; + size_t length = 0; + while (node && (!nodeName || length == 0)) + { + nodeName = node->mName.C_Str(); + length = node->mName.length; + node = node->mParent; + } + + if (!nodeName || length == 0) + { + return {}; + } + // could be std::string_view if c++17 available + return std::string(nodeName, length); + } + + // Make unique name + std::string FBXConverter::MakeUniqueNodeName(const Model* const model, const aiNode& parent) + { + std::string original_name = FixNodeName(model->Name()); + if (original_name.empty()) + { + original_name = getAncestorBaseName(&parent); + } + std::string unique_name; + GetUniqueName(original_name, unique_name); + return unique_name; + } + /// todo: pre-build node hierarchy + /// todo: get bone from stack + /// todo: make map of aiBone* to aiNode* + /// then update convert clusters to the new format + void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node) { const std::vector& conns = doc.GetConnectionsByDestinationSequenced(id, "Model"); std::vector nodes; @@ -145,79 +203,69 @@ namespace Assimp { try { for (const Connection* con : conns) { - // ignore object-property links if (con->PropertyName().length()) { - continue; + // really important we document why this is ignored. + FBXImporter::LogInfo("ignoring property link - no docs on why this is ignored"); + continue; //? } + // convert connection source object into Object base class const Object* const object = con->SourceObject(); if (nullptr == object) { - FBXImporter::LogWarn("failed to convert source object for Model link"); + FBXImporter::LogError("failed to convert source object for Model link"); continue; } + // FBX Model::Cube, Model::Bone001, etc elements + // This detects if we can cast the object into this model structure. const Model* const model = dynamic_cast(object); if (nullptr != model) { nodes_chain.clear(); post_nodes_chain.clear(); - aiMatrix4x4 new_abs_transform = parent_transform; - + aiMatrix4x4 new_abs_transform = parent->mTransformation; + std::string node_name = FixNodeName(model->Name()); // even though there is only a single input node, the design of // assimp (or rather: the complicated transformation chain that // is employed by fbx) means that we may need multiple aiNode's // to represent a fbx node's transformation. - GenerateTransformationNodeChain(*model, nodes_chain, post_nodes_chain); + + // generate node transforms - this includes pivot data + // if need_additional_node is true then you t + const bool need_additional_node = GenerateTransformationNodeChain(*model, node_name, nodes_chain, post_nodes_chain); + + // assert that for the current node we must have at least a single transform ai_assert(nodes_chain.size()); - std::string original_name = FixNodeName(model->Name()); - - // check if any of the nodes in the chain has the name the fbx node - // is supposed to have. If there is none, add another node to - // preserve the name - people might have scripts etc. that rely - // on specific node names. - aiNode* name_carrier = NULL; - for (aiNode* prenode : nodes_chain) { - if (!strcmp(prenode->mName.C_Str(), original_name.c_str())) { - name_carrier = prenode; - break; - } - } - - if (!name_carrier) { - std::string old_original_name = original_name; - GetUniqueName(old_original_name, original_name); - nodes_chain.push_back(new aiNode(original_name)); - } - else { - original_name = nodes_chain.back()->mName.C_Str(); + if (need_additional_node) { + nodes_chain.push_back(new aiNode(node_name)); } //setup metadata on newest node SetupNodeMetadata(*model, *nodes_chain.back()); // link all nodes in a row - aiNode* last_parent = &parent; - for (aiNode* prenode : nodes_chain) { - ai_assert(prenode); + aiNode* last_parent = parent; + for (aiNode* child : nodes_chain) { + ai_assert(child); - if (last_parent != &parent) { + if (last_parent != parent) { last_parent->mNumChildren = 1; last_parent->mChildren = new aiNode*[1]; - last_parent->mChildren[0] = prenode; + last_parent->mChildren[0] = child; } - prenode->mParent = last_parent; - last_parent = prenode; + child->mParent = last_parent; + last_parent = child; - new_abs_transform *= prenode->mTransformation; + new_abs_transform *= child->mTransformation; } // attach geometry - ConvertModel(*model, *nodes_chain.back(), new_abs_transform); + ConvertModel(*model, nodes_chain.back(), root_node, new_abs_transform); // check if there will be any child nodes const std::vector& child_conns @@ -229,7 +277,7 @@ namespace Assimp { for (aiNode* postnode : post_nodes_chain) { ai_assert(postnode); - if (last_parent != &parent) { + if (last_parent != parent) { last_parent->mNumChildren = 1; last_parent->mChildren = new aiNode*[1]; last_parent->mChildren[0] = postnode; @@ -251,15 +299,15 @@ namespace Assimp { ); } - // attach sub-nodes (if any) - ConvertNodes(model->ID(), *last_parent, new_abs_transform); + // recursion call - child nodes + ConvertNodes(model->ID(), last_parent, root_node); if (doc.Settings().readLights) { - ConvertLights(*model, original_name); + ConvertLights(*model, node_name); } if (doc.Settings().readCameras) { - ConvertCameras(*model, original_name); + ConvertCameras(*model, node_name); } nodes.push_back(nodes_chain.front()); @@ -268,11 +316,17 @@ namespace Assimp { } if (nodes.size()) { - parent.mChildren = new aiNode*[nodes.size()](); - parent.mNumChildren = static_cast(nodes.size()); + parent->mChildren = new aiNode*[nodes.size()](); + parent->mNumChildren = static_cast(nodes.size()); - std::swap_ranges(nodes.begin(), nodes.end(), parent.mChildren); + std::swap_ranges(nodes.begin(), nodes.end(), parent->mChildren); } + else + { + parent->mNumChildren = 0; + parent->mChildren = nullptr; + } + } catch (std::exception&) { Util::delete_fun deleter; @@ -377,6 +431,7 @@ namespace Assimp { break; default: ai_assert(false); + break; } } @@ -389,11 +444,6 @@ namespace Assimp { out_camera->mAspect = cam.AspectWidth() / cam.AspectHeight(); - //cameras are defined along positive x direction - /*out_camera->mPosition = cam.Position(); - out_camera->mLookAt = (cam.InterestPosition() - out_camera->mPosition).Normalize(); - out_camera->mUp = cam.UpVector();*/ - out_camera->mPosition = aiVector3D(0.0f); out_camera->mLookAt = aiVector3D(1.0f, 0.0f, 0.0f); out_camera->mUp = aiVector3D(0.0f, 1.0f, 0.0f); @@ -410,19 +460,19 @@ namespace Assimp { void FBXConverter::GetUniqueName(const std::string &name, std::string &uniqueName) { - int i = 0; uniqueName = name; - while (mNodeNames.find(uniqueName) != mNodeNames.end()) + auto it_pair = mNodeNames.insert({ name, 0 }); // duplicate node name instance count + unsigned int& i = it_pair.first->second; + while (!it_pair.second) { - ++i; - std::stringstream ext; + i++; + std::ostringstream ext; ext << name << std::setfill('0') << std::setw(3) << i; uniqueName = ext.str(); + it_pair = mNodeNames.insert({ uniqueName, 0 }); } - mNodeNames.insert(uniqueName); } - const char* FBXConverter::NameTransformationComp(TransformationComp comp) { switch (comp) { case TransformationComp_Translation: @@ -529,7 +579,7 @@ namespace Assimp { return; } - const float angle_epsilon = 1e-6f; + const float angle_epsilon = Math::getEpsilon(); out = aiMatrix4x4(); @@ -636,8 +686,7 @@ namespace Assimp { if ((v - all_ones).SquareLength() > zero_epsilon) { return true; } - } - else if (ok) { + } else if (ok) { if (v.SquareLength() > zero_epsilon) { return true; } @@ -652,7 +701,7 @@ namespace Assimp { return name + std::string(MAGIC_NODE_TAG) + "_" + NameTransformationComp(comp); } - void FBXConverter::GenerateTransformationNodeChain(const Model& model, std::vector& output_nodes, + bool FBXConverter::GenerateTransformationNodeChain(const Model& model, const std::string& name, std::vector& output_nodes, std::vector& post_output_nodes) { const PropertyTable& props = model.Props(); const Model::RotOrder rot = model.RotationOrder(); @@ -660,30 +709,37 @@ namespace Assimp { bool ok; aiMatrix4x4 chain[TransformationComp_MAXIMUM]; + + ai_assert(TransformationComp_MAXIMUM < 32); + std::uint32_t chainBits = 0; + // A node won't need a node chain if it only has these. + const std::uint32_t chainMaskSimple = (1 << TransformationComp_Translation) + (1 << TransformationComp_Scaling) + (1 << TransformationComp_Rotation); + // A node will need a node chain if it has any of these. + const std::uint32_t chainMaskComplex = ((1 << (TransformationComp_MAXIMUM)) - 1) - chainMaskSimple; + std::fill_n(chain, static_cast(TransformationComp_MAXIMUM), aiMatrix4x4()); // generate transformation matrices for all the different transformation components - const float zero_epsilon = 1e-6f; + const float zero_epsilon = Math::getEpsilon(); const aiVector3D all_ones(1.0f, 1.0f, 1.0f); - bool is_complex = false; const aiVector3D& PreRotation = PropertyGet(props, "PreRotation", ok); if (ok && PreRotation.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_PreRotation); GetRotationMatrix(Model::RotOrder::RotOrder_EulerXYZ, PreRotation, chain[TransformationComp_PreRotation]); } const aiVector3D& PostRotation = PropertyGet(props, "PostRotation", ok); if (ok && PostRotation.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_PostRotation); GetRotationMatrix(Model::RotOrder::RotOrder_EulerXYZ, PostRotation, chain[TransformationComp_PostRotation]); } const aiVector3D& RotationPivot = PropertyGet(props, "RotationPivot", ok); if (ok && RotationPivot.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_RotationPivot) | (1 << TransformationComp_RotationPivotInverse); aiMatrix4x4::Translation(RotationPivot, chain[TransformationComp_RotationPivot]); aiMatrix4x4::Translation(-RotationPivot, chain[TransformationComp_RotationPivotInverse]); @@ -691,21 +747,21 @@ namespace Assimp { const aiVector3D& RotationOffset = PropertyGet(props, "RotationOffset", ok); if (ok && RotationOffset.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_RotationOffset); aiMatrix4x4::Translation(RotationOffset, chain[TransformationComp_RotationOffset]); } const aiVector3D& ScalingOffset = PropertyGet(props, "ScalingOffset", ok); if (ok && ScalingOffset.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_ScalingOffset); aiMatrix4x4::Translation(ScalingOffset, chain[TransformationComp_ScalingOffset]); } const aiVector3D& ScalingPivot = PropertyGet(props, "ScalingPivot", ok); if (ok && ScalingPivot.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_ScalingPivot) | (1 << TransformationComp_ScalingPivotInverse); aiMatrix4x4::Translation(ScalingPivot, chain[TransformationComp_ScalingPivot]); aiMatrix4x4::Translation(-ScalingPivot, chain[TransformationComp_ScalingPivotInverse]); @@ -713,22 +769,28 @@ namespace Assimp { const aiVector3D& Translation = PropertyGet(props, "Lcl Translation", ok); if (ok && Translation.SquareLength() > zero_epsilon) { + chainBits = chainBits | (1 << TransformationComp_Translation); + aiMatrix4x4::Translation(Translation, chain[TransformationComp_Translation]); } const aiVector3D& Scaling = PropertyGet(props, "Lcl Scaling", ok); if (ok && (Scaling - all_ones).SquareLength() > zero_epsilon) { + chainBits = chainBits | (1 << TransformationComp_Scaling); + aiMatrix4x4::Scaling(Scaling, chain[TransformationComp_Scaling]); } const aiVector3D& Rotation = PropertyGet(props, "Lcl Rotation", ok); if (ok && Rotation.SquareLength() > zero_epsilon) { + chainBits = chainBits | (1 << TransformationComp_Rotation); + GetRotationMatrix(rot, Rotation, chain[TransformationComp_Rotation]); } const aiVector3D& GeometricScaling = PropertyGet(props, "GeometricScaling", ok); if (ok && (GeometricScaling - all_ones).SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_GeometricScaling); aiMatrix4x4::Scaling(GeometricScaling, chain[TransformationComp_GeometricScaling]); aiVector3D GeometricScalingInverse = GeometricScaling; bool canscale = true; @@ -743,13 +805,14 @@ namespace Assimp { } } if (canscale) { + chainBits = chainBits | (1 << TransformationComp_GeometricScalingInverse); aiMatrix4x4::Scaling(GeometricScalingInverse, chain[TransformationComp_GeometricScalingInverse]); } } const aiVector3D& GeometricRotation = PropertyGet(props, "GeometricRotation", ok); if (ok && GeometricRotation.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_GeometricRotation) | (1 << TransformationComp_GeometricRotationInverse); GetRotationMatrix(rot, GeometricRotation, chain[TransformationComp_GeometricRotation]); GetRotationMatrix(rot, GeometricRotation, chain[TransformationComp_GeometricRotationInverse]); chain[TransformationComp_GeometricRotationInverse].Inverse(); @@ -757,7 +820,7 @@ namespace Assimp { const aiVector3D& GeometricTranslation = PropertyGet(props, "GeometricTranslation", ok); if (ok && GeometricTranslation.SquareLength() > zero_epsilon) { - is_complex = true; + chainBits = chainBits | (1 << TransformationComp_GeometricTranslation) | (1 << TransformationComp_GeometricTranslationInverse); aiMatrix4x4::Translation(GeometricTranslation, chain[TransformationComp_GeometricTranslation]); aiMatrix4x4::Translation(-GeometricTranslation, chain[TransformationComp_GeometricTranslationInverse]); } @@ -765,14 +828,12 @@ namespace Assimp { // is_complex needs to be consistent with NeedsComplexTransformationChain() // or the interplay between this code and the animation converter would // not be guaranteed. - ai_assert(NeedsComplexTransformationChain(model) == is_complex); - - std::string name = FixNodeName(model.Name()); + //ai_assert(NeedsComplexTransformationChain(model) == ((chainBits & chainMaskComplex) != 0)); // now, if we have more than just Translation, Scaling and Rotation, // we need to generate a full node chain to accommodate for assimp's // lack to express pivots and offsets. - if (is_complex && doc.Settings().preservePivots) { + if ((chainBits & chainMaskComplex) && doc.Settings().preservePivots) { FBXImporter::LogInfo("generating full transformation chain for node: " + name); // query the anim_chain_bits dictionary to find out which chain elements @@ -785,7 +846,7 @@ namespace Assimp { for (size_t i = 0; i < TransformationComp_MAXIMUM; ++i, bit <<= 1) { const TransformationComp comp = static_cast(i); - if (chain[i].IsIdentity() && (anim_chain_bitmask & bit) == 0) { + if ((chainBits & bit) == 0 && (anim_chain_bitmask & bit) == 0) { continue; } @@ -810,20 +871,20 @@ namespace Assimp { } ai_assert(output_nodes.size()); - return; + return true; } // else, we can just multiply the matrices together aiNode* nd = new aiNode(); output_nodes.push_back(nd); - std::string uniqueName; - GetUniqueName(name, uniqueName); - nd->mName.Set(uniqueName); + // name passed to the method is already unique + nd->mName.Set(name); for (const auto &transform : chain) { nd->mTransformation = nd->mTransformation * transform; } + return false; } void FBXConverter::SetupNodeMetadata(const Model& model, aiNode& nd) @@ -869,7 +930,8 @@ namespace Assimp { } } - void FBXConverter::ConvertModel(const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform) + void FBXConverter::ConvertModel(const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { const std::vector& geos = model.GetGeometry(); @@ -881,11 +943,12 @@ namespace Assimp { const MeshGeometry* const mesh = dynamic_cast(geo); const LineGeometry* const line = dynamic_cast(geo); if (mesh) { - const std::vector& indices = ConvertMesh(*mesh, model, node_global_transform, nd); + const std::vector& indices = ConvertMesh(*mesh, model, parent, root_node, + absolute_transform); std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); } else if (line) { - const std::vector& indices = ConvertLine(*line, model, node_global_transform, nd); + const std::vector& indices = ConvertLine(*line, model, parent, root_node); std::copy(indices.begin(), indices.end(), std::back_inserter(meshes)); } else { @@ -894,15 +957,16 @@ namespace Assimp { } if (meshes.size()) { - nd.mMeshes = new unsigned int[meshes.size()](); - nd.mNumMeshes = static_cast(meshes.size()); + parent->mMeshes = new unsigned int[meshes.size()](); + parent->mNumMeshes = static_cast(meshes.size()); - std::swap_ranges(meshes.begin(), meshes.end(), nd.mMeshes); + std::swap_ranges(meshes.begin(), meshes.end(), parent->mMeshes); } } - std::vector FBXConverter::ConvertMesh(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + std::vector + FBXConverter::ConvertMesh(const MeshGeometry &mesh, const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { std::vector temp; @@ -926,18 +990,18 @@ namespace Assimp { const MatIndexArray::value_type base = mindices[0]; for (MatIndexArray::value_type index : mindices) { if (index != base) { - return ConvertMeshMultiMaterial(mesh, model, node_global_transform, nd); + return ConvertMeshMultiMaterial(mesh, model, parent, root_node, absolute_transform); } } } // faster code-path, just copy the data - temp.push_back(ConvertMeshSingleMaterial(mesh, model, node_global_transform, nd)); + temp.push_back(ConvertMeshSingleMaterial(mesh, model, absolute_transform, parent, root_node)); return temp; } std::vector FBXConverter::ConvertLine(const LineGeometry& line, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + aiNode *parent, aiNode *root_node) { std::vector temp; @@ -948,7 +1012,7 @@ namespace Assimp { return temp; } - aiMesh* const out_mesh = SetupEmptyMesh(line, nd); + aiMesh* const out_mesh = SetupEmptyMesh(line, root_node); out_mesh->mPrimitiveTypes |= aiPrimitiveType_LINE; // copy vertices @@ -962,9 +1026,11 @@ namespace Assimp { unsigned int epcount = 0; for (unsigned i = 0; i < indices.size(); i++) { - if (indices[i] < 0) epcount++; + if (indices[i] < 0) { + epcount++; + } } - unsigned int pcount = indices.size(); + unsigned int pcount = static_cast( indices.size() ); unsigned int scount = out_mesh->mNumFaces = pcount - epcount; aiFace* fac = out_mesh->mFaces = new aiFace[scount](); @@ -981,7 +1047,7 @@ namespace Assimp { return temp; } - aiMesh* FBXConverter::SetupEmptyMesh(const Geometry& mesh, aiNode& nd) + aiMesh* FBXConverter::SetupEmptyMesh(const Geometry& mesh, aiNode *parent) { aiMesh* const out_mesh = new aiMesh(); meshes.push_back(out_mesh); @@ -998,17 +1064,18 @@ namespace Assimp { } else { - out_mesh->mName = nd.mName; + out_mesh->mName = parent->mName; } return out_mesh; } - unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + unsigned int FBXConverter::ConvertMeshSingleMaterial(const MeshGeometry &mesh, const Model &model, + const aiMatrix4x4 &absolute_transform, aiNode *parent, + aiNode *root_node) { const MatIndexArray& mindices = mesh.GetMaterialIndices(); - aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); + aiMesh* const out_mesh = SetupEmptyMesh(mesh, parent); const std::vector& vertices = mesh.GetVertices(); const std::vector& faces = mesh.GetFaceIndexCounts(); @@ -1075,7 +1142,7 @@ namespace Assimp { binormals = &tempBinormals; } else { - binormals = NULL; + binormals = nullptr; } } @@ -1125,8 +1192,9 @@ namespace Assimp { ConvertMaterialForMesh(out_mesh, model, mesh, mindices[0]); } - if (doc.Settings().readWeights && mesh.DeformerSkin() != NULL) { - ConvertWeights(out_mesh, model, mesh, node_global_transform, NO_MATERIAL_SEPARATION); + if (doc.Settings().readWeights && mesh.DeformerSkin() != nullptr) { + ConvertWeights(out_mesh, model, mesh, absolute_transform, parent, root_node, NO_MATERIAL_SEPARATION, + nullptr); } std::vector animMeshes; @@ -1171,8 +1239,10 @@ namespace Assimp { return static_cast(meshes.size() - 1); } - std::vector FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd) + std::vector + FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, aiNode *parent, + aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { const MatIndexArray& mindices = mesh.GetMaterialIndices(); ai_assert(mindices.size()); @@ -1183,7 +1253,7 @@ namespace Assimp { for (MatIndexArray::value_type index : mindices) { if (had.find(index) == had.end()) { - indices.push_back(ConvertMeshMultiMaterial(mesh, model, index, node_global_transform, nd)); + indices.push_back(ConvertMeshMultiMaterial(mesh, model, index, parent, root_node, absolute_transform)); had.insert(index); } } @@ -1191,18 +1261,18 @@ namespace Assimp { return indices; } - unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - MatIndexArray::value_type index, - const aiMatrix4x4& node_global_transform, - aiNode& nd) + unsigned int FBXConverter::ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, + MatIndexArray::value_type index, + aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform) { - aiMesh* const out_mesh = SetupEmptyMesh(mesh, nd); + aiMesh* const out_mesh = SetupEmptyMesh(mesh, parent); const MatIndexArray& mindices = mesh.GetMaterialIndices(); const std::vector& vertices = mesh.GetVertices(); const std::vector& faces = mesh.GetFaceIndexCounts(); - const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != NULL; + const bool process_weights = doc.Settings().readWeights && mesh.DeformerSkin() != nullptr; unsigned int count_faces = 0; unsigned int count_vertices = 0; @@ -1222,10 +1292,10 @@ namespace Assimp { ai_assert(count_faces); ai_assert(count_vertices); - // mapping from output indices to DOM indexing, needed to resolve weights + // mapping from output indices to DOM indexing, needed to resolve weights or blendshapes std::vector reverseMapping; - - if (process_weights) { + std::map translateIndexMap; + if (process_weights || mesh.GetBlendShapes().size() > 0) { reverseMapping.resize(count_vertices); } @@ -1262,7 +1332,7 @@ namespace Assimp { binormals = &tempBinormals; } else { - binormals = NULL; + binormals = nullptr; } } @@ -1332,6 +1402,7 @@ namespace Assimp { if (reverseMapping.size()) { reverseMapping[cursor] = in_cursor; + translateIndexMap[in_cursor] = cursor; } out_mesh->mVertices[cursor] = vertices[in_cursor]; @@ -1360,16 +1431,60 @@ namespace Assimp { ConvertMaterialForMesh(out_mesh, model, mesh, index); if (process_weights) { - ConvertWeights(out_mesh, model, mesh, node_global_transform, index, &reverseMapping); + ConvertWeights(out_mesh, model, mesh, absolute_transform, parent, root_node, index, &reverseMapping); + } + + std::vector animMeshes; + for (const BlendShape* blendShape : mesh.GetBlendShapes()) { + for (const BlendShapeChannel* blendShapeChannel : blendShape->BlendShapeChannels()) { + const std::vector& shapeGeometries = blendShapeChannel->GetShapeGeometries(); + for (size_t i = 0; i < shapeGeometries.size(); i++) { + aiAnimMesh* animMesh = aiCreateAnimMesh(out_mesh); + const ShapeGeometry* shapeGeometry = shapeGeometries.at(i); + const std::vector& vertices = shapeGeometry->GetVertices(); + const std::vector& normals = shapeGeometry->GetNormals(); + const std::vector& indices = shapeGeometry->GetIndices(); + animMesh->mName.Set(FixAnimMeshName(shapeGeometry->Name())); + for (size_t j = 0; j < indices.size(); j++) { + unsigned int index = indices.at(j); + aiVector3D vertex = vertices.at(j); + aiVector3D normal = normals.at(j); + unsigned int count = 0; + const unsigned int* outIndices = mesh.ToOutputVertexIndex(index, count); + for (unsigned int k = 0; k < count; k++) { + unsigned int outIndex = outIndices[k]; + if (translateIndexMap.find(outIndex) == translateIndexMap.end()) + continue; + unsigned int index = translateIndexMap[outIndex]; + animMesh->mVertices[index] += vertex; + if (animMesh->mNormals != nullptr) { + animMesh->mNormals[index] += normal; + animMesh->mNormals[index].NormalizeSafe(); + } + } + } + animMesh->mWeight = shapeGeometries.size() > 1 ? blendShapeChannel->DeformPercent() / 100.0f : 1.0f; + animMeshes.push_back(animMesh); + } + } + } + + const size_t numAnimMeshes = animMeshes.size(); + if (numAnimMeshes > 0) { + out_mesh->mNumAnimMeshes = static_cast(numAnimMeshes); + out_mesh->mAnimMeshes = new aiAnimMesh*[numAnimMeshes]; + for (size_t i = 0; i < numAnimMeshes; i++) { + out_mesh->mAnimMeshes[i] = animMeshes.at(i); + } } return static_cast(meshes.size() - 1); } - void FBXConverter::ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo, - const aiMatrix4x4& node_global_transform, - unsigned int materialIndex, - std::vector* outputVertStartIndices) + void FBXConverter::ConvertWeights(aiMesh *out, const Model &model, const MeshGeometry &geo, + const aiMatrix4x4 &absolute_transform, + aiNode *parent, aiNode *root_node, unsigned int materialIndex, + std::vector *outputVertStartIndices) { ai_assert(geo.DeformerSkin()); @@ -1380,41 +1495,35 @@ namespace Assimp { const Skin& sk = *geo.DeformerSkin(); std::vector bones; - bones.reserve(sk.Clusters().size()); const bool no_mat_check = materialIndex == NO_MATERIAL_SEPARATION; ai_assert(no_mat_check || outputVertStartIndices); try { - + // iterate over the sub deformers for (const Cluster* cluster : sk.Clusters()) { ai_assert(cluster); const WeightIndexArray& indices = cluster->GetIndices(); - if (indices.empty()) { - continue; - } - const MatIndexArray& mats = geo.GetMaterialIndices(); - bool ok = false; - const size_t no_index_sentinel = std::numeric_limits::max(); count_out_indices.clear(); index_out_indices.clear(); out_indices.clear(); + // now check if *any* of these weights is contained in the output mesh, // taking notes so we don't need to do it twice. for (WeightIndexArray::value_type index : indices) { unsigned int count = 0; const unsigned int* const out_idx = geo.ToOutputVertexIndex(index, count); - // ToOutputVertexIndex only returns NULL if index is out of bounds + // ToOutputVertexIndex only returns nullptr if index is out of bounds // which should never happen - ai_assert(out_idx != NULL); + ai_assert(out_idx != nullptr); index_out_indices.push_back(no_index_sentinel); count_out_indices.push_back(0); @@ -1424,13 +1533,11 @@ namespace Assimp { if (index_out_indices.back() == no_index_sentinel) { index_out_indices.back() = out_indices.size(); - } if (no_mat_check) { out_indices.push_back(out_idx[i]); - } - else { + } else { // this extra lookup is in O(logn), so the entire algorithm becomes O(nlogn) const std::vector::iterator it = std::lower_bound( outputVertStartIndices->begin(), @@ -1441,8 +1548,7 @@ namespace Assimp { out_indices.push_back(std::distance(outputVertStartIndices->begin(), it)); } - ++count_out_indices.back(); - ok = true; + ++count_out_indices.back(); } } } @@ -1450,66 +1556,103 @@ namespace Assimp { // if we found at least one, generate the output bones // XXX this could be heavily simplified by collecting the bone // data in a single step. - if (ok) { - ConvertCluster(bones, model, *cluster, out_indices, index_out_indices, - count_out_indices, node_global_transform); - } + ConvertCluster(bones, cluster, out_indices, index_out_indices, + count_out_indices, absolute_transform, parent, root_node); } + + bone_map.clear(); } - catch (std::exception&) { + catch (std::exception&e) { std::for_each(bones.begin(), bones.end(), Util::delete_fun()); throw; } if (bones.empty()) { + out->mBones = nullptr; + out->mNumBones = 0; return; + } else { + out->mBones = new aiBone *[bones.size()](); + out->mNumBones = static_cast(bones.size()); + + std::swap_ranges(bones.begin(), bones.end(), out->mBones); } - - out->mBones = new aiBone*[bones.size()](); - out->mNumBones = static_cast(bones.size()); - - std::swap_ranges(bones.begin(), bones.end(), out->mBones); } - void FBXConverter::ConvertCluster(std::vector& bones, const Model& /*model*/, const Cluster& cl, - std::vector& out_indices, - std::vector& index_out_indices, - std::vector& count_out_indices, - const aiMatrix4x4& node_global_transform) + const aiNode* FBXConverter::GetNodeByName( const aiString& name, aiNode *current_node ) { + aiNode * iter = current_node; + //printf("Child count: %d", iter->mNumChildren); + return iter; + } - aiBone* const bone = new aiBone(); - bones.push_back(bone); + void FBXConverter::ConvertCluster(std::vector &local_mesh_bones, const Cluster *cl, + std::vector &out_indices, std::vector &index_out_indices, + std::vector &count_out_indices, const aiMatrix4x4 &absolute_transform, + aiNode *parent, aiNode *root_node) { + ai_assert(cl); // make sure cluster valid + std::string deformer_name = cl->TargetNode()->Name(); + aiString bone_name = aiString(FixNodeName(deformer_name)); - bone->mName = FixNodeName(cl.TargetNode()->Name()); + aiBone *bone = nullptr; - bone->mOffsetMatrix = cl.TransformLink(); - bone->mOffsetMatrix.Inverse(); + if (bone_map.count(deformer_name)) { + std::cout << "retrieved bone from lookup " << bone_name.C_Str() << ". Deformer: " << deformer_name + << std::endl; + bone = bone_map[deformer_name]; + } else { + std::cout << "created new bone " << bone_name.C_Str() << ". Deformer: " << deformer_name << std::endl; + bone = new aiBone(); + bone->mName = bone_name; - bone->mOffsetMatrix = bone->mOffsetMatrix * node_global_transform; + // store local transform link for post processing + bone->mOffsetMatrix = cl->TransformLink(); + bone->mOffsetMatrix.Inverse(); - bone->mNumWeights = static_cast(out_indices.size()); - aiVertexWeight* cursor = bone->mWeights = new aiVertexWeight[out_indices.size()]; + aiMatrix4x4 matrix = (aiMatrix4x4)absolute_transform; - const size_t no_index_sentinel = std::numeric_limits::max(); - const WeightArray& weights = cl.GetWeights(); + bone->mOffsetMatrix = bone->mOffsetMatrix * matrix; // * mesh_offset - const size_t c = index_out_indices.size(); - for (size_t i = 0; i < c; ++i) { - const size_t index_index = index_out_indices[i]; - if (index_index == no_index_sentinel) { - continue; + // + // Now calculate the aiVertexWeights + // + + aiVertexWeight *cursor = nullptr; + + bone->mNumWeights = static_cast(out_indices.size()); + cursor = bone->mWeights = new aiVertexWeight[out_indices.size()]; + + const size_t no_index_sentinel = std::numeric_limits::max(); + const WeightArray& weights = cl->GetWeights(); + + const size_t c = index_out_indices.size(); + for (size_t i = 0; i < c; ++i) { + const size_t index_index = index_out_indices[i]; + + if (index_index == no_index_sentinel) { + continue; + } + + const size_t cc = count_out_indices[i]; + for (size_t j = 0; j < cc; ++j) { + // cursor runs from first element relative to the start + // or relative to the start of the next indexes. + aiVertexWeight& out_weight = *cursor++; + + out_weight.mVertexId = static_cast(out_indices[index_index + j]); + out_weight.mWeight = weights[i]; + } } - const size_t cc = count_out_indices[i]; - for (size_t j = 0; j < cc; ++j) { - aiVertexWeight& out_weight = *cursor++; - - out_weight.mVertexId = static_cast(out_indices[index_index + j]); - out_weight.mWeight = weights[i]; - } + bone_map.insert(std::pair(deformer_name, bone)); } + + std::cout << "bone research: Indicies size: " << out_indices.size() << std::endl; + + // lookup must be populated in case something goes wrong + // this also allocates bones to mesh instance outside + local_mesh_bones.push_back(bone); } void FBXConverter::ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo, @@ -1581,6 +1724,13 @@ namespace Assimp { out_mat->AddProperty(&str, AI_MATKEY_NAME); } + // Set the shading mode as best we can: The FBX specification only mentions Lambert and Phong, and only Phong is mentioned in Assimp's aiShadingMode enum. + if (material.GetShadingModel() == "phong") + { + aiShadingMode shadingMode = aiShadingMode_Phong; + out_mat->AddProperty(&shadingMode, 1, AI_MATKEY_SHADING_MODEL); + } + // shading stuff and colors SetShadingPropertiesCommon(out_mat, props); SetShadingPropertiesRaw( out_mat, props, material.Textures(), mesh ); @@ -1606,7 +1756,7 @@ namespace Assimp { out_tex->pcData = reinterpret_cast(const_cast(video).RelinquishContent()); // try to extract a hint from the file extension - const std::string& filename = video.FileName().empty() ? video.RelativeFilename() : video.FileName(); + const std::string& filename = video.RelativeFilename().empty() ? video.FileName() : video.RelativeFilename(); std::string ext = BaseImporter::GetExtension(filename); if (ext == "jpeg") { @@ -1617,7 +1767,7 @@ namespace Assimp { memcpy(out_tex->achFormatHint, ext.c_str(), ext.size()); } - out_tex->mFilename.Set(video.FileName().c_str()); + out_tex->mFilename.Set(filename.c_str()); return static_cast(textures.size() - 1); } @@ -1632,7 +1782,7 @@ namespace Assimp { bool textureReady = false; //tells if our texture is ready (if it was loaded or if it was found) unsigned int index; - VideoMap::const_iterator it = textures_converted.find(media); + VideoMap::const_iterator it = textures_converted.find(*media); if (it != textures_converted.end()) { index = (*it).second; textureReady = true; @@ -1640,7 +1790,7 @@ namespace Assimp { else { if (media->ContentLength() > 0) { index = ConvertVideo(*media); - textures_converted[media] = index; + textures_converted[*media] = index; textureReady = true; } } @@ -1663,9 +1813,8 @@ namespace Assimp { } void FBXConverter::TrySetTextureProperties(aiMaterial* out_mat, const TextureMap& textures, - const std::string& propName, - aiTextureType target, const MeshGeometry* const mesh) - { + const std::string& propName, + aiTextureType target, const MeshGeometry* const mesh) { TextureMap::const_iterator it = textures.find(propName); if (it == textures.end()) { return; @@ -1712,22 +1861,22 @@ namespace Assimp { if (!mesh) { for (const MeshMap::value_type& v : meshes_converted) { - const MeshGeometry* const mesh = dynamic_cast (v.first); - if (!mesh) { + const MeshGeometry* const meshGeom = dynamic_cast (v.first); + if (!meshGeom) { continue; } - const MatIndexArray& mats = mesh->GetMaterialIndices(); + const MatIndexArray& mats = meshGeom->GetMaterialIndices(); if (std::find(mats.begin(), mats.end(), matIndex) == mats.end()) { continue; } int index = -1; for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { - if (mesh->GetTextureCoords(i).empty()) { + if (meshGeom->GetTextureCoords(i).empty()) { break; } - const std::string& name = mesh->GetTextureCoordChannelName(i); + const std::string& name = meshGeom->GetTextureCoordChannelName(i); if (name == uvSet) { index = static_cast(i); break; @@ -1835,22 +1984,22 @@ namespace Assimp { if (!mesh) { for (const MeshMap::value_type& v : meshes_converted) { - const MeshGeometry* const mesh = dynamic_cast (v.first); - if (!mesh) { + const MeshGeometry* const meshGeom = dynamic_cast (v.first); + if (!meshGeom) { continue; } - const MatIndexArray& mats = mesh->GetMaterialIndices(); + const MatIndexArray& mats = meshGeom->GetMaterialIndices(); if (std::find(mats.begin(), mats.end(), matIndex) == mats.end()) { continue; } int index = -1; for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { - if (mesh->GetTextureCoords(i).empty()) { + if (meshGeom->GetTextureCoords(i).empty()) { break; } - const std::string& name = mesh->GetTextureCoordChannelName(i); + const std::string& name = meshGeom->GetTextureCoordChannelName(i); if (name == uvSet) { index = static_cast(i); break; @@ -1924,6 +2073,21 @@ namespace Assimp { TrySetTextureProperties(out_mat, textures, "Maya|SpecularTexture", aiTextureType_SPECULAR, mesh); TrySetTextureProperties(out_mat, textures, "Maya|FalloffTexture", aiTextureType_OPACITY, mesh); 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); + + // 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); } void FBXConverter::SetTextureProperties(aiMaterial* out_mat, const LayeredTextureMap& layeredTextures, const MeshGeometry* const mesh) @@ -2041,6 +2205,12 @@ namespace Assimp { CalculatedOpacity = 1.0f - ((Transparent.r + Transparent.g + Transparent.b) / 3.0f); } + // try to get the transparency factor + const float TransparencyFactor = PropertyGet(props, "TransparencyFactor", ok); + if (ok) { + out_mat->AddProperty(&TransparencyFactor, 1, AI_MATKEY_TRANSPARENCYFACTOR); + } + // use of TransparencyFactor is inconsistent. // Maya always stores it as 1.0, // so we can't use it to set AI_MATKEY_OPACITY. @@ -2144,13 +2314,13 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa if (media != nullptr && media->ContentLength() > 0) { unsigned int index; - VideoMap::const_iterator it = textures_converted.find(media); + VideoMap::const_iterator it = textures_converted.find(*media); if (it != textures_converted.end()) { index = (*it).second; } else { index = ConvertVideo(*media); - textures_converted[media] = index; + textures_converted[*media] = index; } // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture) @@ -2191,22 +2361,22 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa if (!mesh) { for (const MeshMap::value_type& v : meshes_converted) { - const MeshGeometry* const mesh = dynamic_cast(v.first); - if (!mesh) { + const MeshGeometry* const meshGeom = dynamic_cast(v.first); + if (!meshGeom) { continue; } - const MatIndexArray& mats = mesh->GetMaterialIndices(); + const MatIndexArray& mats = meshGeom->GetMaterialIndices(); if (std::find(mats.begin(), mats.end(), matIndex) == mats.end()) { continue; } int index = -1; for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { - if (mesh->GetTextureCoords(i).empty()) { + if (meshGeom->GetTextureCoords(i).empty()) { break; } - const std::string& name = mesh->GetTextureCoordChannelName(i); + const std::string& name = meshGeom->GetTextureCoordChannelName(i); if (name == uvSet) { index = static_cast(i); break; @@ -2578,7 +2748,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa // sanity check whether the input is ok static void validateAnimCurveNodes(const std::vector& curves, bool strictMode) { - const Object* target(NULL); + const Object* target(nullptr); for (const AnimationCurveNode* node : curves) { if (!target) { target = node->Target(); @@ -2609,7 +2779,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa #ifdef ASSIMP_BUILD_DEBUG validateAnimCurveNodes(curves, doc.Settings().strictMode); #endif - const AnimationCurveNode* curve_node = NULL; + const AnimationCurveNode* curve_node = nullptr; for (const AnimationCurveNode* node : curves) { ai_assert(node); @@ -2869,7 +3039,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa TransformationCompDefaultValue(comp) ); - const float epsilon = 1e-6f; + const float epsilon = Math::getEpsilon(); return (dyn_val - static_val).SquareLength() < epsilon; } @@ -3386,8 +3556,9 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa na->mNumScalingKeys = static_cast(keys.size()); na->mScalingKeys = new aiVectorKey[keys.size()]; - if (keys.size() > 0) + if (keys.size() > 0) { InterpolateKeys(na->mScalingKeys, keys, inputs, aiVector3D(1.0f, 1.0f, 1.0f), maxTime, minTime); + } } void FBXConverter::ConvertTranslationKeys(aiNodeAnim* na, const std::vector& nodes, @@ -3456,7 +3627,7 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa ai_assert(!out->mMeshes); ai_assert(!out->mNumMeshes); - // note: the trailing () ensures initialization with NULL - not + // note: the trailing () ensures initialization with nullptr - not // many C++ users seem to know this, so pointing it out to avoid // confusion why this code works. @@ -3503,10 +3674,51 @@ void FBXConverter::SetShadingPropertiesRaw(aiMaterial* out_mat, const PropertyTa } } - // ------------------------------------------------------------------------------------------------ - void ConvertToAssimpScene(aiScene* out, const Document& doc) + void FBXConverter::ConvertOrphantEmbeddedTextures() { - FBXConverter converter(out, doc); + // in C++14 it could be: + // for (auto&& [id, object] : objects) + for (auto&& id_and_object : doc.Objects()) + { + auto&& id = std::get<0>(id_and_object); + auto&& object = std::get<1>(id_and_object); + // If an object doesn't have parent + if (doc.ConnectionsBySource().count(id) == 0) + { + const Texture* realTexture = nullptr; + try + { + const auto& element = object->GetElement(); + const Token& key = element.KeyToken(); + const char* obtype = key.begin(); + const size_t length = static_cast(key.end() - key.begin()); + if (strncmp(obtype, "Texture", length) == 0) + { + const Texture* texture = static_cast(object->Get()); + if (texture->Media() && texture->Media()->ContentLength() > 0) + { + realTexture = texture; + } + } + } + catch (...) + { + // do nothing + } + if (realTexture) + { + const Video* media = realTexture->Media(); + unsigned int index = ConvertVideo(*media); + textures_converted[*media] = index; + } + } + } + } + + // ------------------------------------------------------------------------------------------------ + void ConvertToAssimpScene(aiScene* out, const Document& doc, bool removeEmptyBones) + { + FBXConverter converter(out, doc, removeEmptyBones); } } // !FBX diff --git a/Engine/lib/assimp/code/FBXConverter.h b/Engine/lib/assimp/code/FBX/FBXConverter.h similarity index 81% rename from Engine/lib/assimp/code/FBXConverter.h rename to Engine/lib/assimp/code/FBX/FBXConverter.h index 398baa445..46693bdca 100644 --- a/Engine/lib/assimp/code/FBXConverter.h +++ b/Engine/lib/assimp/code/FBX/FBXConverter.h @@ -52,12 +52,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXUtil.h" #include "FBXProperties.h" #include "FBXImporter.h" + #include #include #include #include #include #include +#include +#include struct aiScene; struct aiNode; @@ -73,15 +76,13 @@ namespace Assimp { namespace FBX { class Document; - -using NodeNameCache = std::set; - /** * Convert a FBX #Document to #aiScene * @param out Empty scene to be populated - * @param doc Parsed FBX document + * @param doc Parsed FBX document + * @param removeEmptyBones Will remove bones, which do not have any references to vertices. */ -void ConvertToAssimpScene(aiScene* out, const Document& doc); +void ConvertToAssimpScene(aiScene* out, const Document& doc, bool removeEmptyBones); /** Dummy class to encapsulate the conversion process */ class FBXConverter { @@ -112,7 +113,7 @@ public: }; public: - FBXConverter(aiScene* out, const Document& doc); + FBXConverter(aiScene* out, const Document& doc, bool removeEmptyBones); ~FBXConverter(); private: @@ -122,7 +123,7 @@ private: // ------------------------------------------------------------------------------------------------ // collect and assign child nodes - void ConvertNodes(uint64_t id, aiNode& parent, const aiMatrix4x4& parent_transform = aiMatrix4x4()); + void ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node); // ------------------------------------------------------------------------------------------------ void ConvertLights(const Model& model, const std::string &orig_name ); @@ -144,6 +145,11 @@ private: // while these would be allowed, they are a potential trouble spot so better not use them). const char* NameTransformationComp(TransformationComp comp); + // ------------------------------------------------------------------------------------------------ + // Returns an unique name for a node or traverses up a hierarchy until a non-empty name is found and + // then makes this name unique + std::string MakeUniqueNodeName(const Model* const model, const aiNode& parent); + // ------------------------------------------------------------------------------------------------ // note: this returns the REAL fbx property names const char* NameTransformationCompProperty(TransformationComp comp); @@ -167,38 +173,41 @@ private: /** * note: memory for output_nodes will be managed by the caller */ - void GenerateTransformationNodeChain(const Model& model, std::vector& output_nodes, std::vector& post_output_nodes); + bool GenerateTransformationNodeChain(const Model& model, const std::string& name, std::vector& output_nodes, std::vector& post_output_nodes); // ------------------------------------------------------------------------------------------------ void SetupNodeMetadata(const Model& model, aiNode& nd); // ------------------------------------------------------------------------------------------------ - void ConvertModel(const Model& model, aiNode& nd, const aiMatrix4x4& node_global_transform); + void ConvertModel(const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ // MeshGeometry -> aiMesh, return mesh index + 1 or 0 if the conversion failed - std::vector ConvertMesh(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + std::vector + ConvertMesh(const MeshGeometry &mesh, const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ std::vector ConvertLine(const LineGeometry& line, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + aiNode *parent, aiNode *root_node); // ------------------------------------------------------------------------------------------------ - aiMesh* SetupEmptyMesh(const Geometry& mesh, aiNode& nd); + aiMesh* SetupEmptyMesh(const Geometry& mesh, aiNode *parent); // ------------------------------------------------------------------------------------------------ - unsigned int ConvertMeshSingleMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + unsigned int ConvertMeshSingleMaterial(const MeshGeometry &mesh, const Model &model, + const aiMatrix4x4 &absolute_transform, aiNode *parent, + aiNode *root_node); // ------------------------------------------------------------------------------------------------ - std::vector ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - const aiMatrix4x4& node_global_transform, aiNode& nd); + std::vector + ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, aiNode *parent, aiNode *root_node, + const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ - unsigned int ConvertMeshMultiMaterial(const MeshGeometry& mesh, const Model& model, - MatIndexArray::value_type index, - const aiMatrix4x4& node_global_transform, aiNode& nd); + unsigned int ConvertMeshMultiMaterial(const MeshGeometry &mesh, const Model &model, MatIndexArray::value_type index, + aiNode *parent, aiNode *root_node, const aiMatrix4x4 &absolute_transform); // ------------------------------------------------------------------------------------------------ static const unsigned int NO_MATERIAL_SEPARATION = /* std::numeric_limits::max() */ @@ -211,17 +220,17 @@ private: * - outputVertStartIndices is only used when a material index is specified, it gives for * each output vertex the DOM index it maps to. */ - void ConvertWeights(aiMesh* out, const Model& model, const MeshGeometry& geo, - const aiMatrix4x4& node_global_transform = aiMatrix4x4(), - unsigned int materialIndex = NO_MATERIAL_SEPARATION, - std::vector* outputVertStartIndices = NULL); - + void ConvertWeights(aiMesh *out, const Model &model, const MeshGeometry &geo, const aiMatrix4x4 &absolute_transform, + aiNode *parent = NULL, aiNode *root_node = NULL, + unsigned int materialIndex = NO_MATERIAL_SEPARATION, + std::vector *outputVertStartIndices = NULL); + // lookup + static const aiNode* GetNodeByName( const aiString& name, aiNode *current_node ); // ------------------------------------------------------------------------------------------------ - void ConvertCluster(std::vector& bones, const Model& /*model*/, const Cluster& cl, - std::vector& out_indices, - std::vector& index_out_indices, - std::vector& count_out_indices, - const aiMatrix4x4& node_global_transform); + void ConvertCluster(std::vector &local_mesh_bones, const Cluster *cl, + std::vector &out_indices, std::vector &index_out_indices, + std::vector &count_out_indices, const aiMatrix4x4 &absolute_transform, + aiNode *parent, aiNode *root_node); // ------------------------------------------------------------------------------------------------ void ConvertMaterialForMesh(aiMesh* out, const Model& model, const MeshGeometry& geo, @@ -418,8 +427,11 @@ private: // copy generated meshes, animations, lights, cameras and textures to the output scene void TransferDataToScene(); -private: + // ------------------------------------------------------------------------------------------------ + // FBX file could have embedded textures not connected to anything + void ConvertOrphantEmbeddedTextures(); +private: // 0: not assigned yet, others: index is value - 1 unsigned int defaultMaterialIndex; @@ -429,26 +441,48 @@ private: std::vector lights; std::vector cameras; std::vector textures; - - typedef std::map MaterialMap; + using MaterialMap = std::fbx_unordered_map; MaterialMap materials_converted; - typedef std::map VideoMap; + using VideoMap = std::fbx_unordered_map; VideoMap textures_converted; - typedef std::map > MeshMap; + using MeshMap = std::fbx_unordered_map >; MeshMap meshes_converted; // fixed node name -> which trafo chain components have animations? - typedef std::map NodeAnimBitMap; + using NodeAnimBitMap = std::fbx_unordered_map ; NodeAnimBitMap node_anim_chain_bits; + // number of nodes with the same name + using NodeNameCache = std::fbx_unordered_map; NodeNameCache mNodeNames; + + // Deformer name is not the same as a bone name - it does contain the bone name though :) + // Deformer names in FBX are always unique in an FBX file. + std::map bone_map; + double anim_fps; aiScene* const out; const FBX::Document& doc; + + static void BuildBoneList(aiNode *current_node, const aiNode *root_node, const aiScene *scene, + std::vector& bones); + + void BuildBoneStack(aiNode *current_node, const aiNode *root_node, const aiScene *scene, + const std::vector &bones, + std::map &bone_stack, + std::vector &node_stack ); + + static void BuildNodeList(aiNode *current_node, std::vector &nodes); + + static aiNode *GetNodeFromStack(const aiString &node_name, std::vector &nodes); + + static aiNode *GetArmatureRoot(aiNode *bone_node, std::vector &bone_list); + + static bool IsBoneNode(const aiString &bone_name, std::vector &bones); }; } diff --git a/Engine/lib/assimp/code/FBXDeformer.cpp b/Engine/lib/assimp/code/FBX/FBXDeformer.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXDeformer.cpp rename to Engine/lib/assimp/code/FBX/FBXDeformer.cpp diff --git a/Engine/lib/assimp/code/FBXDocument.cpp b/Engine/lib/assimp/code/FBX/FBXDocument.cpp similarity index 98% rename from Engine/lib/assimp/code/FBXDocument.cpp rename to Engine/lib/assimp/code/FBX/FBXDocument.cpp index 1af08fe6d..506fd978d 100644 --- a/Engine/lib/assimp/code/FBXDocument.cpp +++ b/Engine/lib/assimp/code/FBX/FBXDocument.cpp @@ -90,14 +90,6 @@ const Object* LazyObject::Get(bool dieOnError) return object.get(); } - // if this is the root object, we return a dummy since there - // is no root object int he fbx file - it is just referenced - // with id 0. - if(id == 0L) { - object.reset(new Object(id, element, "Model::RootNode")); - return object.get(); - } - const Token& key = element.KeyToken(); const TokenList& tokens = element.Tokens(); diff --git a/Engine/lib/assimp/code/FBXDocument.h b/Engine/lib/assimp/code/FBX/FBXDocument.h similarity index 96% rename from Engine/lib/assimp/code/FBXDocument.h rename to Engine/lib/assimp/code/FBX/FBXDocument.h index c849defdc..a60d7d9ef 100644 --- a/Engine/lib/assimp/code/FBXDocument.h +++ b/Engine/lib/assimp/code/FBX/FBXDocument.h @@ -627,7 +627,7 @@ public: return content; } - uint32_t ContentLength() const { + uint64_t ContentLength() const { return contentLength; } @@ -637,13 +637,27 @@ public: return ptr; } + bool operator==(const Video& other) const + { + return ( + type == other.type + && relativeFileName == other.relativeFileName + && fileName == other.fileName + ); + } + + bool operator<(const Video& other) const + { + return std::tie(type, relativeFileName, fileName) < std::tie(other.type, other.relativeFileName, other.fileName); + } + private: std::string type; std::string relativeFileName; std::string fileName; std::shared_ptr props; - uint32_t contentLength; + uint64_t contentLength; uint8_t* content; }; @@ -1005,10 +1019,10 @@ public: // during their entire lifetime (Document). FBX files have // up to many thousands of objects (most of which we never use), // so the memory overhead for them should be kept at a minimum. -typedef std::map ObjectMap; +typedef std::fbx_unordered_map ObjectMap; typedef std::fbx_unordered_map > PropertyTemplateMap; -typedef std::multimap ConnectionMap; +typedef std::fbx_unordered_multimap ConnectionMap; /** DOM class for global document settings, a single instance per document can * be accessed via Document.Globals(). */ @@ -1177,4 +1191,25 @@ private: } // Namespace FBX } // Namespace Assimp +namespace std +{ + template <> + struct hash + { + std::size_t operator()(const Assimp::FBX::Video& video) const + { + using std::size_t; + using std::hash; + using std::string; + + size_t res = 17; + res = res * 31 + hash()(video.Name()); + res = res * 31 + hash()(video.RelativeFilename()); + res = res * 31 + hash()(video.Type()); + + return res; + } + }; +} + #endif // INCLUDED_AI_FBX_DOCUMENT_H diff --git a/Engine/lib/assimp/code/FBXDocumentUtil.cpp b/Engine/lib/assimp/code/FBX/FBXDocumentUtil.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXDocumentUtil.cpp rename to Engine/lib/assimp/code/FBX/FBXDocumentUtil.cpp diff --git a/Engine/lib/assimp/code/FBXDocumentUtil.h b/Engine/lib/assimp/code/FBX/FBXDocumentUtil.h similarity index 100% rename from Engine/lib/assimp/code/FBXDocumentUtil.h rename to Engine/lib/assimp/code/FBX/FBXDocumentUtil.h diff --git a/Engine/lib/assimp/code/FBXExportNode.cpp b/Engine/lib/assimp/code/FBX/FBXExportNode.cpp similarity index 96% rename from Engine/lib/assimp/code/FBXExportNode.cpp rename to Engine/lib/assimp/code/FBX/FBXExportNode.cpp index ace6a6ac2..9b29995cc 100644 --- a/Engine/lib/assimp/code/FBXExportNode.cpp +++ b/Engine/lib/assimp/code/FBX/FBXExportNode.cpp @@ -54,6 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include // ostringstream #include // shared_ptr +namespace Assimp { // AddP70 helpers... there's no usable pattern here, // so all are defined as separate functions. // Even "animatable" properties are often completely different @@ -252,7 +253,8 @@ void FBX::Node::DumpChildren( } else { std::ostringstream ss; DumpChildrenAscii(ss, indent); - s.PutString(ss.str()); + if (ss.tellp() > 0) + s.PutString(ss.str()); } } @@ -266,7 +268,8 @@ void FBX::Node::End( } else { std::ostringstream ss; EndAscii(ss, indent, has_children); - s.PutString(ss.str()); + if (ss.tellp() > 0) + s.PutString(ss.str()); } } @@ -322,9 +325,9 @@ void FBX::Node::BeginBinary(Assimp::StreamWriterLE &s) this->start_pos = s.Tell(); // placeholders for end pos and property section info - s.PutU4(0); // end pos - s.PutU4(0); // number of properties - s.PutU4(0); // total property section length + s.PutU8(0); // end pos + s.PutU8(0); // number of properties + s.PutU8(0); // total property section length // node name s.PutU1(uint8_t(name.size())); // length of node name @@ -349,9 +352,9 @@ void FBX::Node::EndPropertiesBinary( size_t pos = s.Tell(); ai_assert(pos > property_start); size_t property_section_size = pos - property_start; - s.Seek(start_pos + 4); - s.PutU4(uint32_t(num_properties)); - s.PutU4(uint32_t(property_section_size)); + s.Seek(start_pos + 8); // 8 bytes of uint64_t of end_pos + s.PutU8(num_properties); + s.PutU8(property_section_size); s.Seek(pos); } @@ -367,12 +370,12 @@ void FBX::Node::EndBinary( bool has_children ) { // if there were children, add a null record - if (has_children) { s.PutString(FBX::NULL_RECORD); } + if (has_children) { s.PutString(Assimp::FBX::NULL_RECORD); } // now go back and write initial pos this->end_pos = s.Tell(); s.Seek(start_pos); - s.PutU4(uint32_t(end_pos)); + s.PutU8(end_pos); s.Seek(end_pos); } @@ -432,7 +435,7 @@ void FBX::Node::WritePropertyNodeAscii( char buffer[32]; FBX::Node node(name); node.Begin(s, false, indent); - std::string vsize = std::to_string(v.size()); + std::string vsize = to_string(v.size()); // * { s.PutChar('*'); s.PutString(vsize); s.PutString(" {\n"); // indent + 1 @@ -468,7 +471,7 @@ void FBX::Node::WritePropertyNodeAscii( char buffer[32]; FBX::Node node(name); node.Begin(s, false, indent); - std::string vsize = std::to_string(v.size()); + std::string vsize = to_string(v.size()); // * { s.PutChar('*'); s.PutString(vsize); s.PutString(" {\n"); // indent + 1 @@ -563,6 +566,6 @@ void FBX::Node::WritePropertyNode( FBX::Node::WritePropertyNodeAscii(name, v, s, indent); } } - +} #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // ASSIMP_BUILD_NO_EXPORT diff --git a/Engine/lib/assimp/code/FBXExportNode.h b/Engine/lib/assimp/code/FBX/FBXExportNode.h similarity index 98% rename from Engine/lib/assimp/code/FBXExportNode.h rename to Engine/lib/assimp/code/FBX/FBXExportNode.h index e1ebc3696..ef3bc781a 100644 --- a/Engine/lib/assimp/code/FBXExportNode.h +++ b/Engine/lib/assimp/code/FBX/FBXExportNode.h @@ -54,16 +54,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +namespace Assimp { namespace FBX { class Node; } -class FBX::Node -{ -public: // public data members +class FBX::Node { +public: // TODO: accessors std::string name; // node name - std::vector properties; // node properties + std::vector properties; // node properties std::vector children; // child nodes // some nodes always pretend they have children... @@ -214,7 +214,7 @@ public: // static member functions Assimp::StreamWriterLE& s, bool binary, int indent ) { - FBX::Property p(value); + FBX::FBXExportProperty p(value); FBX::Node node(name, p); node.Dump(s, binary, indent); } @@ -264,7 +264,7 @@ private: // static helper functions ); }; - +} #endif // ASSIMP_BUILD_NO_FBX_EXPORTER diff --git a/Engine/lib/assimp/code/FBXExportProperty.cpp b/Engine/lib/assimp/code/FBX/FBXExportProperty.cpp similarity index 60% rename from Engine/lib/assimp/code/FBXExportProperty.cpp rename to Engine/lib/assimp/code/FBX/FBXExportProperty.cpp index 9981d6b1c..f2a63b72b 100644 --- a/Engine/lib/assimp/code/FBXExportProperty.cpp +++ b/Engine/lib/assimp/code/FBX/FBXExportProperty.cpp @@ -52,187 +52,206 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include // ostringstream +namespace Assimp { +namespace FBX { // constructors for single element properties -FBX::Property::Property(bool v) - : type('C'), data(1) -{ - data = {uint8_t(v)}; -} +FBXExportProperty::FBXExportProperty(bool v) +: type('C') +, data(1, uint8_t(v)) {} -FBX::Property::Property(int16_t v) : type('Y'), data(2) -{ +FBXExportProperty::FBXExportProperty(int16_t v) +: type('Y') +, data(2) { uint8_t* d = data.data(); (reinterpret_cast(d))[0] = v; } -FBX::Property::Property(int32_t v) : type('I'), data(4) -{ +FBXExportProperty::FBXExportProperty(int32_t v) +: type('I') +, data(4) { uint8_t* d = data.data(); (reinterpret_cast(d))[0] = v; } -FBX::Property::Property(float v) : type('F'), data(4) -{ +FBXExportProperty::FBXExportProperty(float v) +: type('F') +, data(4) { uint8_t* d = data.data(); (reinterpret_cast(d))[0] = v; } -FBX::Property::Property(double v) : type('D'), data(8) -{ +FBXExportProperty::FBXExportProperty(double v) +: type('D') +, data(8) { uint8_t* d = data.data(); (reinterpret_cast(d))[0] = v; } -FBX::Property::Property(int64_t v) : type('L'), data(8) -{ +FBXExportProperty::FBXExportProperty(int64_t v) +: type('L') +, data(8) { uint8_t* d = data.data(); (reinterpret_cast(d))[0] = v; } - // constructors for array-type properties -FBX::Property::Property(const char* c, bool raw) - : Property(std::string(c), raw) -{} +FBXExportProperty::FBXExportProperty(const char* c, bool raw) +: FBXExportProperty(std::string(c), raw) { + // empty +} // strings can either be saved as "raw" (R) data, or "string" (S) data -FBX::Property::Property(const std::string& s, bool raw) - : type(raw ? 'R' : 'S'), data(s.size()) -{ +FBXExportProperty::FBXExportProperty(const std::string& s, bool raw) +: type(raw ? 'R' : 'S') +, data(s.size()) { for (size_t i = 0; i < s.size(); ++i) { data[i] = uint8_t(s[i]); } } -FBX::Property::Property(const std::vector& r) - : type('R'), data(r) -{} +FBXExportProperty::FBXExportProperty(const std::vector& r) +: type('R') +, data(r) { + // empty +} -FBX::Property::Property(const std::vector& va) - : type('i'), data(4*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector& va) +: type('i') +, data(4 * va.size() ) { int32_t* d = reinterpret_cast(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const std::vector& va) - : type('l'), data(8*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector& va) +: type('l') +, data(8 * va.size()) { int64_t* d = reinterpret_cast(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const std::vector& va) - : type('f'), data(4*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector& va) +: type('f') +, data(4 * va.size()) { float* d = reinterpret_cast(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const std::vector& va) - : type('d'), data(8*va.size()) -{ +FBXExportProperty::FBXExportProperty(const std::vector& va) +: type('d') +, data(8 * va.size()) { double* d = reinterpret_cast(data.data()); - for (size_t i = 0; i < va.size(); ++i) { d[i] = va[i]; } + for (size_t i = 0; i < va.size(); ++i) { + d[i] = va[i]; + } } -FBX::Property::Property(const aiMatrix4x4& vm) - : type('d'), data(8*16) -{ +FBXExportProperty::FBXExportProperty(const aiMatrix4x4& vm) +: type('d') +, data(8 * 16) { double* d = reinterpret_cast(data.data()); for (unsigned int c = 0; c < 4; ++c) { for (unsigned int r = 0; r < 4; ++r) { - d[4*c+r] = vm[r][c]; + d[4 * c + r] = vm[r][c]; } } } // public member functions -size_t FBX::Property::size() -{ +size_t FBXExportProperty::size() { switch (type) { - case 'C': case 'Y': case 'I': case 'F': case 'D': case 'L': - return data.size() + 1; - case 'S': case 'R': - return data.size() + 5; - case 'i': case 'd': - return data.size() + 13; - default: - throw DeadlyExportError("Requested size on property of unknown type"); + case 'C': + case 'Y': + case 'I': + case 'F': + case 'D': + case 'L': + return data.size() + 1; + case 'S': + case 'R': + return data.size() + 5; + case 'i': + case 'd': + return data.size() + 13; + default: + throw DeadlyExportError("Requested size on property of unknown type"); } } -void FBX::Property::DumpBinary(Assimp::StreamWriterLE &s) -{ +void FBXExportProperty::DumpBinary(Assimp::StreamWriterLE& s) { s.PutU1(type); uint8_t* d = data.data(); size_t N; switch (type) { - case 'C': s.PutU1(*(reinterpret_cast(d))); return; - case 'Y': s.PutI2(*(reinterpret_cast(d))); return; - case 'I': s.PutI4(*(reinterpret_cast(d))); return; - case 'F': s.PutF4(*(reinterpret_cast(d))); return; - case 'D': s.PutF8(*(reinterpret_cast(d))); return; - case 'L': s.PutI8(*(reinterpret_cast(d))); return; - case 'S': - case 'R': - s.PutU4(uint32_t(data.size())); - for (size_t i = 0; i < data.size(); ++i) { s.PutU1(data[i]); } - return; - case 'i': - N = data.size() / 4; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutI4((reinterpret_cast(d))[i]); - } - return; - case 'l': - N = data.size() / 8; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutI8((reinterpret_cast(d))[i]); - } - return; - case 'f': - N = data.size() / 4; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutF4((reinterpret_cast(d))[i]); - } - return; - case 'd': - N = data.size() / 8; - s.PutU4(uint32_t(N)); // number of elements - s.PutU4(0); // no encoding (1 would be zip-compressed) - // TODO: compress if large? - s.PutU4(uint32_t(data.size())); // data size - for (size_t i = 0; i < N; ++i) { - s.PutF8((reinterpret_cast(d))[i]); - } - return; - default: - std::ostringstream err; - err << "Tried to dump property with invalid type '"; - err << type << "'!"; - throw DeadlyExportError(err.str()); + case 'C': s.PutU1(*(reinterpret_cast(d))); return; + case 'Y': s.PutI2(*(reinterpret_cast(d))); return; + case 'I': s.PutI4(*(reinterpret_cast(d))); return; + case 'F': s.PutF4(*(reinterpret_cast(d))); return; + case 'D': s.PutF8(*(reinterpret_cast(d))); return; + case 'L': s.PutI8(*(reinterpret_cast(d))); return; + case 'S': + case 'R': + s.PutU4(uint32_t(data.size())); + for (size_t i = 0; i < data.size(); ++i) { s.PutU1(data[i]); } + return; + case 'i': + N = data.size() / 4; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutI4((reinterpret_cast(d))[i]); + } + return; + case 'l': + N = data.size() / 8; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutI8((reinterpret_cast(d))[i]); + } + return; + case 'f': + N = data.size() / 4; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutF4((reinterpret_cast(d))[i]); + } + return; + case 'd': + N = data.size() / 8; + s.PutU4(uint32_t(N)); // number of elements + s.PutU4(0); // no encoding (1 would be zip-compressed) + // TODO: compress if large? + s.PutU4(uint32_t(data.size())); // data size + for (size_t i = 0; i < N; ++i) { + s.PutF8((reinterpret_cast(d))[i]); + } + return; + default: + std::ostringstream err; + err << "Tried to dump property with invalid type '"; + err << type << "'!"; + throw DeadlyExportError(err.str()); } } -void FBX::Property::DumpAscii(Assimp::StreamWriterLE &outstream, int indent) -{ +void FBXExportProperty::DumpAscii(Assimp::StreamWriterLE& outstream, int indent) { std::ostringstream ss; ss.imbue(std::locale::classic()); ss.precision(15); // this seems to match official FBX SDK exports @@ -240,8 +259,7 @@ void FBX::Property::DumpAscii(Assimp::StreamWriterLE &outstream, int indent) outstream.PutString(ss.str()); } -void FBX::Property::DumpAscii(std::ostream& s, int indent) -{ +void FBXExportProperty::DumpAscii(std::ostream& s, int indent) { // no writing type... or anything. just shove it into the stream. uint8_t* d = data.data(); size_t N; @@ -360,5 +378,8 @@ void FBX::Property::DumpAscii(std::ostream& s, int indent) } } +} // Namespace FBX +} // Namespace Assimp + #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // ASSIMP_BUILD_NO_EXPORT diff --git a/Engine/lib/assimp/code/FBXExportProperty.h b/Engine/lib/assimp/code/FBX/FBXExportProperty.h similarity index 77% rename from Engine/lib/assimp/code/FBXExportProperty.h rename to Engine/lib/assimp/code/FBX/FBXExportProperty.h index 9c9d37c36..d692fe6ee 100644 --- a/Engine/lib/assimp/code/FBXExportProperty.h +++ b/Engine/lib/assimp/code/FBX/FBXExportProperty.h @@ -47,7 +47,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_FBX_EXPORTER - #include // aiMatrix4x4 #include // StreamWriterLE @@ -56,11 +55,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include // is_void +namespace Assimp { namespace FBX { - class Property; -} -/** FBX::Property +/** @brief FBX::Property * * Holds a value of any of FBX's recognized types, * each represented by a particular one-character code. @@ -78,35 +76,34 @@ namespace FBX { * S : string (array of 1-byte char) * R : raw data (array of bytes) */ -class FBX::Property -{ +class FBXExportProperty { public: // constructors for basic types. // all explicit to avoid accidental typecasting - explicit Property(bool v); + explicit FBXExportProperty(bool v); // TODO: determine if there is actually a byte type, // or if this always means . 'C' seems to imply , // so possibly the above was intended to represent both. - explicit Property(int16_t v); - explicit Property(int32_t v); - explicit Property(float v); - explicit Property(double v); - explicit Property(int64_t v); + explicit FBXExportProperty(int16_t v); + explicit FBXExportProperty(int32_t v); + explicit FBXExportProperty(float v); + explicit FBXExportProperty(double v); + explicit FBXExportProperty(int64_t v); // strings can either be stored as 'R' (raw) or 'S' (string) type - explicit Property(const char* c, bool raw=false); - explicit Property(const std::string& s, bool raw=false); - explicit Property(const std::vector& r); - explicit Property(const std::vector& va); - explicit Property(const std::vector& va); - explicit Property(const std::vector& va); - explicit Property(const std::vector& va); - explicit Property(const aiMatrix4x4& vm); + explicit FBXExportProperty(const char* c, bool raw = false); + explicit FBXExportProperty(const std::string& s, bool raw = false); + explicit FBXExportProperty(const std::vector& r); + explicit FBXExportProperty(const std::vector& va); + explicit FBXExportProperty(const std::vector& va); + explicit FBXExportProperty(const std::vector& va); + explicit FBXExportProperty(const std::vector& va); + explicit FBXExportProperty(const aiMatrix4x4& vm); // this will catch any type not defined above, // so that we don't accidentally convert something we don't want. // for example (const char*) --> (bool)... seriously wtf C++ template - explicit Property(T v) : type('X') { + explicit FBXExportProperty(T v) : type('X') { static_assert(std::is_void::value, "TRIED TO CREATE FBX PROPERTY WITH UNSUPPORTED TYPE, CHECK YOUR PROPERTY INSTANTIATION"); } // note: no line wrap so it appears verbatim on the compiler error @@ -114,9 +111,9 @@ public: size_t size(); // write this property node as binary data to the given stream - void DumpBinary(Assimp::StreamWriterLE &s); - void DumpAscii(Assimp::StreamWriterLE &s, int indent=0); - void DumpAscii(std::ostream &s, int indent=0); + void DumpBinary(Assimp::StreamWriterLE& s); + void DumpAscii(Assimp::StreamWriterLE& s, int indent = 0); + void DumpAscii(std::ostream& s, int indent = 0); // note: make sure the ostream is in classic "C" locale private: @@ -124,6 +121,9 @@ private: std::vector data; }; +} // Namespace FBX +} // Namespace Assimp + #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // AI_FBXEXPORTPROPERTY_H_INC diff --git a/Engine/lib/assimp/code/FBXExporter.cpp b/Engine/lib/assimp/code/FBX/FBXExporter.cpp similarity index 91% rename from Engine/lib/assimp/code/FBXExporter.cpp rename to Engine/lib/assimp/code/FBX/FBXExporter.cpp index acb122714..9767f9a0a 100644 --- a/Engine/lib/assimp/code/FBXExporter.cpp +++ b/Engine/lib/assimp/code/FBX/FBXExporter.cpp @@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXExportNode.h" #include "FBXExportProperty.h" #include "FBXCommon.h" +#include "FBXUtil.h" #include // aiGetVersion #include @@ -66,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ @@ -73,10 +75,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. const ai_real DEG = ai_real( 57.29577951308232087679815481 ); // degrees per radian +using namespace Assimp; +using namespace Assimp::FBX; + // some constants that we'll use for writing metadata +namespace Assimp { namespace FBX { - const std::string EXPORT_VERSION_STR = "7.4.0"; - const uint32_t EXPORT_VERSION_INT = 7400; // 7.4 == 2014/2015 + const std::string EXPORT_VERSION_STR = "7.5.0"; + const uint32_t EXPORT_VERSION_INT = 7500; // 7.5 == 2016+ // FBX files have some hashed values that depend on the creation time field, // but for now we don't actually know how to generate these. // what we can do is set them to a known-working version. @@ -92,11 +98,6 @@ namespace FBX { ";------------------------------------------------------------------"; } -using namespace Assimp; -using namespace FBX; - -namespace Assimp { - // --------------------------------------------------------------------- // Worker function for exporting a scene to binary FBX. // Prototyped and registered in Exporter.cpp @@ -121,6 +122,7 @@ namespace Assimp { IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties + ){ // initialize the exporter FBXExporter exporter(pScene, pProperties); @@ -1004,6 +1006,9 @@ void FBXExporter::WriteObjects () object_node.EndProperties(outstream, binary, indent); object_node.BeginChildren(outstream, binary, indent); + bool bJoinIdenticalVertices = mProperties->GetPropertyBool("bJoinIdenticalVertices", true); + std::vector> vVertexIndice;//save vertex_indices as it is needed later + // geometry (aiMesh) mesh_uids.clear(); indent = 1; @@ -1030,21 +1035,35 @@ void FBXExporter::WriteObjects () std::vector vertex_indices; // map of vertex value to its index in the data vector std::map index_by_vertex_value; - int32_t index = 0; - for (size_t vi = 0; vi < m->mNumVertices; ++vi) { - aiVector3D vtx = m->mVertices[vi]; - auto elem = index_by_vertex_value.find(vtx); - if (elem == index_by_vertex_value.end()) { - vertex_indices.push_back(index); - index_by_vertex_value[vtx] = index; - flattened_vertices.push_back(vtx[0]); - flattened_vertices.push_back(vtx[1]); - flattened_vertices.push_back(vtx[2]); - ++index; - } else { - vertex_indices.push_back(int32_t(elem->second)); + if(bJoinIdenticalVertices){ + int32_t index = 0; + for (size_t vi = 0; vi < m->mNumVertices; ++vi) { + aiVector3D vtx = m->mVertices[vi]; + auto elem = index_by_vertex_value.find(vtx); + if (elem == index_by_vertex_value.end()) { + vertex_indices.push_back(index); + index_by_vertex_value[vtx] = index; + flattened_vertices.push_back(vtx[0]); + flattened_vertices.push_back(vtx[1]); + flattened_vertices.push_back(vtx[2]); + ++index; + } else { + vertex_indices.push_back(int32_t(elem->second)); + } } } + else { // do not join vertex, respect the export flag + vertex_indices.resize(m->mNumVertices); + std::iota(vertex_indices.begin(), vertex_indices.end(), 0); + for(unsigned int v = 0; v < m->mNumVertices; ++ v) { + aiVector3D vtx = m->mVertices[v]; + flattened_vertices.push_back(vtx.x); + flattened_vertices.push_back(vtx.y); + flattened_vertices.push_back(vtx.z); + } + } + vVertexIndice.push_back(vertex_indices); + FBX::Node::WritePropertyNode( "Vertices", flattened_vertices, outstream, binary, indent ); @@ -1115,6 +1134,51 @@ void FBXExporter::WriteObjects () normals.End(outstream, binary, indent, true); } + // colors, if any + // TODO only one color channel currently + const int32_t colorChannelIndex = 0; + if (m->HasVertexColors(colorChannelIndex)) { + FBX::Node vertexcolors("LayerElementColor", int32_t(colorChannelIndex)); + vertexcolors.Begin(outstream, binary, indent); + vertexcolors.DumpProperties(outstream, binary, indent); + vertexcolors.EndProperties(outstream, binary, indent); + vertexcolors.BeginChildren(outstream, binary, indent); + indent = 3; + FBX::Node::WritePropertyNode( + "Version", int32_t(101), outstream, binary, indent + ); + char layerName[8]; + sprintf(layerName, "COLOR_%d", colorChannelIndex); + FBX::Node::WritePropertyNode( + "Name", (const char*)layerName, outstream, binary, indent + ); + FBX::Node::WritePropertyNode( + "MappingInformationType", "ByPolygonVertex", + outstream, binary, indent + ); + FBX::Node::WritePropertyNode( + "ReferenceInformationType", "Direct", + outstream, binary, indent + ); + std::vector color_data; + color_data.reserve(4 * polygon_data.size()); + for (size_t fi = 0; fi < m->mNumFaces; ++fi) { + const aiFace &f = m->mFaces[fi]; + for (size_t pvi = 0; pvi < f.mNumIndices; ++pvi) { + const aiColor4D &c = m->mColors[colorChannelIndex][f.mIndices[pvi]]; + color_data.push_back(c.r); + color_data.push_back(c.g); + color_data.push_back(c.b); + color_data.push_back(c.a); + } + } + FBX::Node::WritePropertyNode( + "Colors", color_data, outstream, binary, indent + ); + indent = 2; + vertexcolors.End(outstream, binary, indent, true); + } + // uvs, if any for (size_t uvi = 0; uvi < m->GetNumUVChannels(); ++uvi) { if (m->mNumUVComponents[uvi] > 2) { @@ -1208,6 +1272,11 @@ void FBXExporter::WriteObjects () le.AddChild("Type", "LayerElementNormal"); le.AddChild("TypedIndex", int32_t(0)); layer.AddChild(le); + // TODO only 1 color channel currently + le = FBX::Node("LayerElement"); + le.AddChild("Type", "LayerElementColor"); + le.AddChild("TypedIndex", int32_t(0)); + layer.AddChild(le); le = FBX::Node("LayerElement"); le.AddChild("Type", "LayerElementMaterial"); le.AddChild("TypedIndex", int32_t(0)); @@ -1218,6 +1287,16 @@ void FBXExporter::WriteObjects () layer.AddChild(le); layer.Dump(outstream, binary, indent); + for(unsigned int lr = 1; lr < m->GetNumUVChannels(); ++ lr) + { + FBX::Node layerExtra("Layer", int32_t(lr)); + layerExtra.AddChild("Version", int32_t(100)); + FBX::Node leExtra("LayerElement"); + leExtra.AddChild("Type", "LayerElementUV"); + leExtra.AddChild("TypedIndex", int32_t(lr)); + layerExtra.AddChild(leExtra); + layerExtra.Dump(outstream, binary, indent); + } // finish the node record indent = 1; n.End(outstream, binary, indent, true); @@ -1393,10 +1472,6 @@ void FBXExporter::WriteObjects () // FbxVideo - stores images used by textures. for (const auto &it : uid_by_image) { - if (it.first.compare(0, 1, "*") == 0) { - // TODO: embedded textures - continue; - } FBX::Node n("Video"); const int64_t& uid = it.second; const std::string name = ""; // TODO: ... name??? @@ -1406,7 +1481,33 @@ void FBXExporter::WriteObjects () // TODO: get full path... relative path... etc... ugh... // for now just use the same path for everything, // and hopefully one of them will work out. - const std::string& path = it.first; + std::string path = it.first; + // try get embedded texture + const aiTexture* embedded_texture = mScene->GetEmbeddedTexture(it.first.c_str()); + if (embedded_texture != nullptr) { + // change the path (use original filename, if available. If name is empty, concatenate texture index with file extension) + std::stringstream newPath; + if (embedded_texture->mFilename.length > 0) { + newPath << embedded_texture->mFilename.C_Str(); + } else if (embedded_texture->achFormatHint[0]) { + int texture_index = std::stoi(path.substr(1, path.size() - 1)); + newPath << texture_index << "." << embedded_texture->achFormatHint; + } + path = newPath.str(); + // embed the texture + size_t texture_size = static_cast(embedded_texture->mWidth * std::max(embedded_texture->mHeight, 1u)); + if (binary) { + // embed texture as binary data + std::vector tex_data; + tex_data.resize(texture_size); + memcpy(&tex_data[0], (char*)embedded_texture->pcData, texture_size); + n.AddChild("Content", tex_data); + } else { + // embed texture in base64 encoding + std::string encoded_texture = FBX::Util::EncodeBase64((char*)embedded_texture->pcData, texture_size); + n.AddChild("Content", encoded_texture); + } + } p.AddP70("Path", "KString", "XRefUrl", "", path); n.AddChild(p); n.AddChild("UseMipMap", int32_t(0)); @@ -1419,17 +1520,17 @@ void FBXExporter::WriteObjects () // referenced by material_index/texture_type pairs. std::map,int64_t> texture_uids; const std::map prop_name_by_tt = { - {aiTextureType_DIFFUSE, "DiffuseColor"}, - {aiTextureType_SPECULAR, "SpecularColor"}, - {aiTextureType_AMBIENT, "AmbientColor"}, - {aiTextureType_EMISSIVE, "EmissiveColor"}, - {aiTextureType_HEIGHT, "Bump"}, - {aiTextureType_NORMALS, "NormalMap"}, - {aiTextureType_SHININESS, "ShininessExponent"}, - {aiTextureType_OPACITY, "TransparentColor"}, + {aiTextureType_DIFFUSE, "DiffuseColor"}, + {aiTextureType_SPECULAR, "SpecularColor"}, + {aiTextureType_AMBIENT, "AmbientColor"}, + {aiTextureType_EMISSIVE, "EmissiveColor"}, + {aiTextureType_HEIGHT, "Bump"}, + {aiTextureType_NORMALS, "NormalMap"}, + {aiTextureType_SHININESS, "ShininessExponent"}, + {aiTextureType_OPACITY, "TransparentColor"}, {aiTextureType_DISPLACEMENT, "DisplacementColor"}, //{aiTextureType_LIGHTMAP, "???"}, - {aiTextureType_REFLECTION, "ReflectionColor"} + {aiTextureType_REFLECTION, "ReflectionColor"} //{aiTextureType_UNKNOWN, ""} }; for (size_t i = 0; i < mScene->mNumMaterials; ++i) { @@ -1575,19 +1676,41 @@ void FBXExporter::WriteObjects () // one sticky point is that the number of vertices may not match, // because assimp splits vertices by normal, uv, etc. + // functor for aiNode sorting + struct SortNodeByName + { + bool operator()(const aiNode *lhs, const aiNode *rhs) const + { + return strcmp(lhs->mName.C_Str(), rhs->mName.C_Str()) < 0; + } + }; + // first we should mark the skeleton for each mesh. // the skeleton must include not only the aiBones, // but also all their parent nodes. // anything that affects the position of any bone node must be included. - std::vector> skeleton_by_mesh(mScene->mNumMeshes); + // Use SorNodeByName to make sure the exported result will be the same across all systems + // Otherwise the aiNodes of the skeleton would be sorted based on the pointer address, which isn't consistent + std::vector> skeleton_by_mesh(mScene->mNumMeshes); // at the same time we can build a list of all the skeleton nodes, // which will be used later to mark them as type "limbNode". std::unordered_set limbnodes; + + //actual bone nodes in fbx, without parenting-up + std::unordered_set setAllBoneNamesInScene; + for(unsigned int m = 0; m < mScene->mNumMeshes; ++ m) + { + aiMesh* pMesh = mScene->mMeshes[m]; + for(unsigned int b = 0; b < pMesh->mNumBones; ++ b) + setAllBoneNamesInScene.insert(pMesh->mBones[b]->mName.data); + } + aiMatrix4x4 mxTransIdentity; + // and a map of nodes by bone name, as finding them is annoying. std::map node_by_bone; for (size_t mi = 0; mi < mScene->mNumMeshes; ++mi) { const aiMesh* m = mScene->mMeshes[mi]; - std::set skeleton; + std::set skeleton; for (size_t bi =0; bi < m->mNumBones; ++bi) { const aiBone* b = m->mBones[bi]; const std::string name(b->mName.C_Str()); @@ -1626,6 +1749,11 @@ void FBXExporter::WriteObjects () if (node_name.find(MAGIC_NODE_TAG) != std::string::npos) { continue; } + //not a bone in scene && no effect in transform + if(setAllBoneNamesInScene.find(node_name)==setAllBoneNamesInScene.end() + && parent->mTransformation == mxTransIdentity) { + continue; + } // otherwise check if this is the root of the skeleton bool end = false; // is the mesh part of this node? @@ -1646,8 +1774,7 @@ void FBXExporter::WriteObjects () } if (end) { break; } } - limbnodes.insert(parent); - skeleton.insert(parent); + // if it was the skeleton root we can finish here if (end) { break; } } @@ -1689,28 +1816,8 @@ void FBXExporter::WriteObjects () // connect it connections.emplace_back("C", "OO", deformer_uid, mesh_uids[mi]); - // we will be indexing by vertex... - // but there might be a different number of "vertices" - // between assimp and our output FBX. - // this code is cut-and-pasted from the geometry section above... - // ideally this should not be so. - // --- - // index of original vertex in vertex data vector - std::vector vertex_indices; - // map of vertex value to its index in the data vector - std::map index_by_vertex_value; - int32_t index = 0; - for (size_t vi = 0; vi < m->mNumVertices; ++vi) { - aiVector3D vtx = m->mVertices[vi]; - auto elem = index_by_vertex_value.find(vtx); - if (elem == index_by_vertex_value.end()) { - vertex_indices.push_back(index); - index_by_vertex_value[vtx] = index; - ++index; - } else { - vertex_indices.push_back(int32_t(elem->second)); - } - } + //computed before + std::vector& vertex_indices = vVertexIndice[mi]; // TODO, FIXME: this won't work if anything is not in the bind pose. // for now if such a situation is detected, we throw an exception. @@ -1728,7 +1835,7 @@ void FBXExporter::WriteObjects () aiMatrix4x4 mesh_xform = get_world_transform(mesh_node, mScene); // now make a subdeformer for each bone in the skeleton - const std::set &skeleton = skeleton_by_mesh[mi]; + const std::set skeleton= skeleton_by_mesh[mi]; for (const aiNode* bone_node : skeleton) { // if there's a bone for this node, find it const aiBone* b = nullptr; @@ -1788,41 +1895,10 @@ void FBXExporter::WriteObjects () inverse_bone_xform.Inverse(); aiMatrix4x4 tr = inverse_bone_xform * mesh_xform; - // this should be the same as the bone's mOffsetMatrix. - // if it's not the same, the skeleton isn't in the bind pose. - const float epsilon = 1e-4f; // some error is to be expected - bool bone_xform_okay = true; - if (b && ! tr.Equal(b->mOffsetMatrix, epsilon)) { - not_in_bind_pose.insert(b); - bone_xform_okay = false; - } + sdnode.AddChild("Transform", tr); - // if we have a bone we should use the mOffsetMatrix, - // otherwise try to just use the calculated transform. - if (b) { - sdnode.AddChild("Transform", b->mOffsetMatrix); - } else { - sdnode.AddChild("Transform", tr); - } - // note: it doesn't matter if we mix these, - // because if they disagree we'll throw an exception later. - // it could be that the skeleton is not in the bone pose - // but all bones are still defined, - // in which case this would use the mOffsetMatrix for everything - // and a correct skeleton would still be output. - // transformlink should be the position of the bone in world space. - // if the bone is in the bind pose (or nonexistent), - // we can just use the matrix we already calculated - if (bone_xform_okay) { - sdnode.AddChild("TransformLink", bone_xform); - // otherwise we can only work it out using the mesh position. - } else { - aiMatrix4x4 trl = b->mOffsetMatrix; - trl.Inverse(); - trl *= mesh_xform; - sdnode.AddChild("TransformLink", trl); - } + sdnode.AddChild("TransformLink", bone_xform); // note: this means we ALWAYS rely on the mesh node transform // being unchanged from the time the skeleton was bound. // there's not really any way around this at the moment. @@ -2237,8 +2313,8 @@ void FBXExporter::WriteModelNode( // not sure what these are for, // but they seem to be omnipresent - m.AddChild("Shading", Property(true)); - m.AddChild("Culling", Property("CullingOff")); + m.AddChild("Shading", FBXExportProperty(true)); + m.AddChild("Culling", FBXExportProperty("CullingOff")); m.Dump(outstream, binary, 1); } @@ -2351,7 +2427,7 @@ void FBXExporter::WriteModelNodes( na.AddProperties( node_attribute_uid, FBX::SEPARATOR + "NodeAttribute", "LimbNode" ); - na.AddChild("TypeFlags", Property("Skeleton")); + na.AddChild("TypeFlags", FBXExportProperty("Skeleton")); na.Dump(outstream, binary, 1); // and connect them connections.emplace_back("C", "OO", node_attribute_uid, node_uid); @@ -2407,7 +2483,7 @@ void FBXExporter::WriteModelNodes( void FBXExporter::WriteAnimationCurveNode( StreamWriterLE& outstream, int64_t uid, - std::string name, // "T", "R", or "S" + const std::string& name, // "T", "R", or "S" aiVector3D default_value, std::string property_name, // "Lcl Translation" etc int64_t layer_uid, diff --git a/Engine/lib/assimp/code/FBXExporter.h b/Engine/lib/assimp/code/FBX/FBXExporter.h similarity index 99% rename from Engine/lib/assimp/code/FBXExporter.h rename to Engine/lib/assimp/code/FBX/FBXExporter.h index 71fb55c57..1ae727eda 100644 --- a/Engine/lib/assimp/code/FBXExporter.h +++ b/Engine/lib/assimp/code/FBX/FBXExporter.h @@ -156,7 +156,7 @@ namespace Assimp void WriteAnimationCurveNode( StreamWriterLE& outstream, int64_t uid, - std::string name, // "T", "R", or "S" + const std::string& name, // "T", "R", or "S" aiVector3D default_value, std::string property_name, // "Lcl Translation" etc int64_t animation_layer_uid, diff --git a/Engine/lib/assimp/code/FBXImportSettings.h b/Engine/lib/assimp/code/FBX/FBXImportSettings.h similarity index 88% rename from Engine/lib/assimp/code/FBXImportSettings.h rename to Engine/lib/assimp/code/FBX/FBXImportSettings.h index d5e1c2060..1a4c80f8b 100644 --- a/Engine/lib/assimp/code/FBXImportSettings.h +++ b/Engine/lib/assimp/code/FBX/FBXImportSettings.h @@ -53,19 +53,22 @@ namespace FBX { struct ImportSettings { ImportSettings() - : strictMode(true) - , readAllLayers(true) - , readAllMaterials(false) - , readMaterials(true) - , readTextures(true) - , readCameras(true) - , readLights(true) - , readAnimations(true) - , readWeights(true) - , preservePivots(true) - , optimizeEmptyAnimationCurves(true) - , useLegacyEmbeddedTextureNaming(false) - {} + : strictMode(true) + , readAllLayers(true) + , readAllMaterials(false) + , readMaterials(true) + , readTextures(true) + , readCameras(true) + , readLights(true) + , readAnimations(true) + , readWeights(true) + , preservePivots(true) + , optimizeEmptyAnimationCurves(true) + , useLegacyEmbeddedTextureNaming(false) + , removeEmptyBones( true ) + , convertToMeters( false ) { + // empty + } /** enable strict mode: @@ -141,8 +144,16 @@ struct ImportSettings bool optimizeEmptyAnimationCurves; /** use legacy naming for embedded textures eg: (*0, *1, *2) - **/ + */ bool useLegacyEmbeddedTextureNaming; + + /** Empty bones shall be removed + */ + bool removeEmptyBones; + + /** Set to true to perform a conversion from cm to meter after the import + */ + bool convertToMeters; }; diff --git a/Engine/lib/assimp/code/FBX/FBXImporter.cpp b/Engine/lib/assimp/code/FBX/FBXImporter.cpp new file mode 100644 index 000000000..afcc1ddc7 --- /dev/null +++ b/Engine/lib/assimp/code/FBX/FBXImporter.cpp @@ -0,0 +1,198 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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. +r +* 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 FBXImporter.cpp + * @brief Implementation of the FBX importer. + */ + +#ifndef ASSIMP_BUILD_NO_FBX_IMPORTER + +#include "FBXImporter.h" + +#include "FBXConverter.h" +#include "FBXDocument.h" +#include "FBXParser.h" +#include "FBXTokenizer.h" +#include "FBXUtil.h" + +#include +#include +#include +#include + +namespace Assimp { + +template <> +const char *LogFunctions::Prefix() { + static auto prefix = "FBX: "; + return prefix; +} + +} // namespace Assimp + +using namespace Assimp; +using namespace Assimp::Formatter; +using namespace Assimp::FBX; + +namespace { + +static const aiImporterDesc desc = { + "Autodesk FBX Importer", + "", + "", + "", + aiImporterFlags_SupportTextFlavour, + 0, + 0, + 0, + 0, + "fbx" +}; +} + +// ------------------------------------------------------------------------------------------------ +// Constructor to be privately used by #Importer +FBXImporter::FBXImporter() { +} + +// ------------------------------------------------------------------------------------------------ +// Destructor, private as well +FBXImporter::~FBXImporter() { +} + +// ------------------------------------------------------------------------------------------------ +// Returns whether the class can handle the format of the given file. +bool FBXImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const { + const std::string &extension = GetExtension(pFile); + if (extension == std::string(desc.mFileExtensions)) { + return true; + } + + else if ((!extension.length() || checkSig) && pIOHandler) { + // at least ASCII-FBX files usually have a 'FBX' somewhere in their head + const char *tokens[] = { "fbx" }; + return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 1); + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +// List all extensions handled by this loader +const aiImporterDesc *FBXImporter::GetInfo() const { + return &desc; +} + +// ------------------------------------------------------------------------------------------------ +// Setup configuration properties for the loader +void FBXImporter::SetupProperties(const Importer *pImp) { + settings.readAllLayers = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS, true); + settings.readAllMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS, false); + settings.readMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_MATERIALS, true); + settings.readTextures = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_TEXTURES, true); + settings.readCameras = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_CAMERAS, true); + settings.readLights = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_LIGHTS, true); + settings.readAnimations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS, true); + settings.strictMode = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_STRICT_MODE, false); + settings.preservePivots = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, true); + settings.optimizeEmptyAnimationCurves = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, true); + settings.useLegacyEmbeddedTextureNaming = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING, false); + settings.removeEmptyBones = pImp->GetPropertyBool(AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES, true); + settings.convertToMeters = pImp->GetPropertyBool(AI_CONFIG_FBX_CONVERT_TO_M, false); +} + +// ------------------------------------------------------------------------------------------------ +// Imports the given file into the given scene structure. +void FBXImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) { + std::unique_ptr stream(pIOHandler->Open(pFile, "rb")); + if (!stream) { + ThrowException("Could not open file for reading"); + } + + // 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 + // streaming for its output data structures so the net win with + // streaming input data would be very low. + std::vector contents; + contents.resize(stream->FileSize() + 1); + stream->Read(&*contents.begin(), 1, contents.size() - 1); + contents[contents.size() - 1] = 0; + const char *const begin = &*contents.begin(); + + // broadphase tokenizing pass in which we identify the core + // syntax elements of FBX (brackets, commas, key:value mappings) + TokenList tokens; + try { + + bool is_binary = false; + if (!strncmp(begin, "Kaydara FBX Binary", 18)) { + is_binary = true; + TokenizeBinary(tokens, begin, contents.size()); + } else { + Tokenize(tokens, begin); + } + + // use this information to construct a very rudimentary + // parse-tree representing the FBX scope structure + Parser parser(tokens, is_binary); + + // take the raw parse-tree and convert it to a FBX DOM + Document doc(parser, settings); + + // convert the FBX DOM to aiScene + ConvertToAssimpScene(pScene, doc, settings.removeEmptyBones); + + // size relative to cm + float size_relative_to_cm = doc.GlobalSettings().UnitScaleFactor(); + + // Set FBX file scale is relative to CM must be converted to M for + // assimp universal format (M) + SetFileScale(size_relative_to_cm * 0.01f); + + std::for_each(tokens.begin(), tokens.end(), Util::delete_fun()); + } catch (std::exception &) { + std::for_each(tokens.begin(), tokens.end(), Util::delete_fun()); + throw; + } +} + +#endif // !ASSIMP_BUILD_NO_FBX_IMPORTER diff --git a/Engine/lib/assimp/code/FBXImporter.h b/Engine/lib/assimp/code/FBX/FBXImporter.h similarity index 100% rename from Engine/lib/assimp/code/FBXImporter.h rename to Engine/lib/assimp/code/FBX/FBXImporter.h diff --git a/Engine/lib/assimp/code/FBXMaterial.cpp b/Engine/lib/assimp/code/FBX/FBXMaterial.cpp similarity index 78% rename from Engine/lib/assimp/code/FBXMaterial.cpp rename to Engine/lib/assimp/code/FBX/FBXMaterial.cpp index f5f6fda03..f43a8b84b 100644 --- a/Engine/lib/assimp/code/FBXMaterial.cpp +++ b/Engine/lib/assimp/code/FBX/FBXMaterial.cpp @@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include // std::transform +#include "FBXUtil.h" namespace Assimp { namespace FBX { @@ -206,6 +207,20 @@ Texture::Texture(uint64_t id, const Element& element, const Document& doc, const props = GetPropertyTable(doc,"Texture.FbxFileTexture",element,sc); + // 3DS Max and FBX SDK use "Scaling" and "Translation" instead of "ModelUVScaling" and "ModelUVTranslation". Use these properties if available. + bool ok; + const aiVector3D& scaling = PropertyGet(*props, "Scaling", ok); + if (ok) { + uvScaling.x = scaling.x; + uvScaling.y = scaling.y; + } + + const aiVector3D& trans = PropertyGet(*props, "Translation", ok); + if (ok) { + uvTrans.x = trans.x; + uvTrans.y = trans.y; + } + // resolve video links if(doc.Settings().readTextures) { const std::vector& conns = doc.GetConnectionsByDestinationSequenced(ID()); @@ -301,13 +316,52 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std relativeFileName = ParseTokenAsString(GetRequiredToken(*RelativeFilename,0)); } - if(Content) { + if(Content && !Content->Tokens().empty()) { //this field is omitted when the embedded texture is already loaded, let's ignore if it's not found try { const Token& token = GetRequiredToken(*Content, 0); const char* data = token.begin(); if (!token.IsBinary()) { - DOMWarning("video content is not binary data, ignoring", &element); + if (*data != '"') { + DOMError("embedded content is not surrounded by quotation marks", &element); + } + else { + size_t targetLength = 0; + auto numTokens = Content->Tokens().size(); + // First time compute size (it could be large like 64Gb and it is good to allocate it once) + for (uint32_t tokenIdx = 0; tokenIdx < numTokens; ++tokenIdx) + { + const Token& dataToken = GetRequiredToken(*Content, tokenIdx); + size_t tokenLength = dataToken.end() - dataToken.begin() - 2; // ignore double quotes + const char* base64data = dataToken.begin() + 1; + const size_t outLength = Util::ComputeDecodedSizeBase64(base64data, tokenLength); + if (outLength == 0) + { + DOMError("Corrupted embedded content found", &element); + } + targetLength += outLength; + } + if (targetLength == 0) + { + DOMError("Corrupted embedded content found", &element); + } + content = new uint8_t[targetLength]; + contentLength = static_cast(targetLength); + size_t dst_offset = 0; + for (uint32_t tokenIdx = 0; tokenIdx < numTokens; ++tokenIdx) + { + const Token& dataToken = GetRequiredToken(*Content, tokenIdx); + size_t tokenLength = dataToken.end() - dataToken.begin() - 2; // ignore double quotes + const char* base64data = dataToken.begin() + 1; + dst_offset += Util::DecodeBase64(base64data, tokenLength, content + dst_offset, targetLength - dst_offset); + } + if (targetLength != dst_offset) + { + delete[] content; + contentLength = 0; + DOMError("Corrupted embedded content found", &element); + } + } } else if (static_cast(token.end() - data) < 5) { DOMError("binary data array is too short, need five (5) bytes for type signature and element count", &element); @@ -326,8 +380,11 @@ Video::Video(uint64_t id, const Element& element, const Document& doc, const std content = new uint8_t[len]; ::memcpy(content, data + 5, len); } - } catch (runtime_error runtimeError) { + } 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): ", + runtimeError.what()); } } diff --git a/Engine/lib/assimp/code/FBXMeshGeometry.cpp b/Engine/lib/assimp/code/FBX/FBXMeshGeometry.cpp similarity index 97% rename from Engine/lib/assimp/code/FBXMeshGeometry.cpp rename to Engine/lib/assimp/code/FBX/FBXMeshGeometry.cpp index d75476b82..1386e2383 100644 --- a/Engine/lib/assimp/code/FBXMeshGeometry.cpp +++ b/Engine/lib/assimp/code/FBX/FBXMeshGeometry.cpp @@ -115,7 +115,6 @@ MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::strin if(tempVerts.empty()) { FBXImporter::LogWarn("encountered mesh with no vertices"); - return; } std::vector tempFaces; @@ -123,7 +122,6 @@ MeshGeometry::MeshGeometry(uint64_t id, const Element& element, const std::strin if(tempFaces.empty()) { FBXImporter::LogWarn("encountered mesh with no faces"); - return; } m_vertices.reserve(tempFaces.size()); @@ -568,15 +566,15 @@ void MeshGeometry::ReadVertexDataColors(std::vector& colors_out, cons } // ------------------------------------------------------------------------------------------------ -static const std::string TangentIndexToken = "TangentIndex"; -static const std::string TangentsIndexToken = "TangentsIndex"; +static const char *TangentIndexToken = "TangentIndex"; +static const char *TangentsIndexToken = "TangentsIndex"; void MeshGeometry::ReadVertexDataTangents(std::vector& tangents_out, const Scope& source, const std::string& MappingInformationType, const std::string& ReferenceInformationType) { const char * str = source.Elements().count( "Tangents" ) > 0 ? "Tangents" : "Tangent"; - const char * strIdx = source.Elements().count( "Tangents" ) > 0 ? TangentsIndexToken.c_str() : TangentIndexToken.c_str(); + const char * strIdx = source.Elements().count( "Tangents" ) > 0 ? TangentsIndexToken : TangentIndexToken; ResolveVertexDataArray(tangents_out,source,MappingInformationType,ReferenceInformationType, str, strIdx, @@ -612,8 +610,11 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector& materials_out, cons const std::string& ReferenceInformationType) { const size_t face_count = m_faces.size(); - ai_assert(face_count); - + if( 0 == face_count ) + { + return; + } + // materials are handled separately. First of all, they are assigned per-face // and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect // has a slightly different meaning for materials. @@ -624,16 +625,15 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector& materials_out, cons if (materials_out.empty()) { FBXImporter::LogError(Formatter::format("expected material index, ignoring")); return; - } - else if (materials_out.size() > 1) { + } else if (materials_out.size() > 1) { FBXImporter::LogWarn(Formatter::format("expected only a single material index, ignoring all except the first one")); materials_out.clear(); } - m_materials.assign(m_vertices.size(),materials_out[0]); - } - else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") { - m_materials.resize(face_count); + materials_out.resize(m_vertices.size()); + std::fill(materials_out.begin(), materials_out.end(), materials_out.at(0)); + } else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") { + materials_out.resize(face_count); if(materials_out.size() != face_count) { FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ") @@ -641,18 +641,16 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector& materials_out, cons ); return; } - } - else { + } else { FBXImporter::LogError(Formatter::format("ignoring material assignments, access type not implemented: ") << MappingInformationType << "," << ReferenceInformationType); } } // ------------------------------------------------------------------------------------------------ ShapeGeometry::ShapeGeometry(uint64_t id, const Element& element, const std::string& name, const Document& doc) - : Geometry(id, element, name, doc) -{ - const Scope* sc = element.Compound(); - if (!sc) { +: Geometry(id, element, name, doc) { + const Scope *sc = element.Compound(); + if (nullptr == sc) { DOMError("failed to read Geometry object (class: Shape), no data scope found"); } const Element& Indexes = GetRequiredElement(*sc, "Indexes", &element); diff --git a/Engine/lib/assimp/code/FBXMeshGeometry.h b/Engine/lib/assimp/code/FBX/FBXMeshGeometry.h similarity index 100% rename from Engine/lib/assimp/code/FBXMeshGeometry.h rename to Engine/lib/assimp/code/FBX/FBXMeshGeometry.h diff --git a/Engine/lib/assimp/code/FBXModel.cpp b/Engine/lib/assimp/code/FBX/FBXModel.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXModel.cpp rename to Engine/lib/assimp/code/FBX/FBXModel.cpp diff --git a/Engine/lib/assimp/code/FBXNodeAttribute.cpp b/Engine/lib/assimp/code/FBX/FBXNodeAttribute.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXNodeAttribute.cpp rename to Engine/lib/assimp/code/FBX/FBXNodeAttribute.cpp diff --git a/Engine/lib/assimp/code/FBXParser.cpp b/Engine/lib/assimp/code/FBX/FBXParser.cpp similarity index 99% rename from Engine/lib/assimp/code/FBXParser.cpp rename to Engine/lib/assimp/code/FBX/FBXParser.cpp index b255c4734..4a9346040 100644 --- a/Engine/lib/assimp/code/FBXParser.cpp +++ b/Engine/lib/assimp/code/FBX/FBXParser.cpp @@ -117,7 +117,7 @@ namespace FBX { Element::Element(const Token& key_token, Parser& parser) : key_token(key_token) { - TokenPtr n = NULL; + TokenPtr n = nullptr; do { n = parser.AdvanceToNextToken(); if(!n) { @@ -643,9 +643,9 @@ void ParseVectorDataArray(std::vector& out, const Element& el) if (type == 'd') { const double* d = reinterpret_cast(&buff[0]); for (unsigned int i = 0; i < count3; ++i, d += 3) { - out.push_back(aiVector3D(static_cast(d[0]), - static_cast(d[1]), - static_cast(d[2]))); + out.push_back(aiVector3D(static_cast(d[0]), + static_cast(d[1]), + static_cast(d[2]))); } // for debugging /*for ( size_t i = 0; i < out.size(); i++ ) { @@ -963,7 +963,6 @@ void ParseVectorDataArray(std::vector& out, const Element& el) } } - // ------------------------------------------------------------------------------------------------ // read an array of uints void ParseVectorDataArray(std::vector& out, const Element& el) @@ -1280,7 +1279,6 @@ float ParseTokenAsFloat(const Token& t) return i; } - // ------------------------------------------------------------------------------------------------ // wrapper around ParseTokenAsInt() with ParseError handling int ParseTokenAsInt(const Token& t) @@ -1293,8 +1291,6 @@ int ParseTokenAsInt(const Token& t) return i; } - - // ------------------------------------------------------------------------------------------------ // wrapper around ParseTokenAsInt64() with ParseError handling int64_t ParseTokenAsInt64(const Token& t) diff --git a/Engine/lib/assimp/code/FBXParser.h b/Engine/lib/assimp/code/FBX/FBXParser.h similarity index 100% rename from Engine/lib/assimp/code/FBXParser.h rename to Engine/lib/assimp/code/FBX/FBXParser.h diff --git a/Engine/lib/assimp/code/FBXProperties.cpp b/Engine/lib/assimp/code/FBX/FBXProperties.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXProperties.cpp rename to Engine/lib/assimp/code/FBX/FBXProperties.cpp diff --git a/Engine/lib/assimp/code/FBXProperties.h b/Engine/lib/assimp/code/FBX/FBXProperties.h similarity index 100% rename from Engine/lib/assimp/code/FBXProperties.h rename to Engine/lib/assimp/code/FBX/FBXProperties.h diff --git a/Engine/lib/assimp/code/FBXTokenizer.cpp b/Engine/lib/assimp/code/FBX/FBXTokenizer.cpp similarity index 100% rename from Engine/lib/assimp/code/FBXTokenizer.cpp rename to Engine/lib/assimp/code/FBX/FBXTokenizer.cpp diff --git a/Engine/lib/assimp/code/FBXTokenizer.h b/Engine/lib/assimp/code/FBX/FBXTokenizer.h similarity index 96% rename from Engine/lib/assimp/code/FBXTokenizer.h rename to Engine/lib/assimp/code/FBX/FBXTokenizer.h index 2af29743f..afa588a47 100644 --- a/Engine/lib/assimp/code/FBXTokenizer.h +++ b/Engine/lib/assimp/code/FBX/FBXTokenizer.h @@ -93,7 +93,7 @@ public: Token(const char* sbegin, const char* send, TokenType type, unsigned int line, unsigned int column); /** construct a binary token */ - Token(const char* sbegin, const char* send, TokenType type, unsigned int offset); + Token(const char* sbegin, const char* send, TokenType type, size_t offset); ~Token(); @@ -118,14 +118,14 @@ public: return type; } - unsigned int Offset() const { + size_t Offset() const { ai_assert(IsBinary()); return offset; } unsigned int Line() const { ai_assert(!IsBinary()); - return line; + return static_cast(line); } unsigned int Column() const { @@ -147,8 +147,8 @@ private: const TokenType type; union { - const unsigned int line; - unsigned int offset; + size_t line; + size_t offset; }; const unsigned int column; }; @@ -178,7 +178,7 @@ void Tokenize(TokenList& output_tokens, const char* input); * @param input_buffer Binary input buffer to be processed. * @param length Length of input buffer, in bytes. There is no 0-terminal. * @throw DeadlyImportError if something goes wrong */ -void TokenizeBinary(TokenList& output_tokens, const char* input, unsigned int length); +void TokenizeBinary(TokenList& output_tokens, const char* input, size_t length); } // ! FBX diff --git a/Engine/lib/assimp/code/FBX/FBXUtil.cpp b/Engine/lib/assimp/code/FBX/FBXUtil.cpp new file mode 100644 index 000000000..c10e057c8 --- /dev/null +++ b/Engine/lib/assimp/code/FBX/FBXUtil.cpp @@ -0,0 +1,243 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 FBXUtil.cpp + * @brief Implementation of internal FBX utility functions + */ + +#include "FBXUtil.h" +#include "FBXTokenizer.h" + +#include +#include +#include + +#ifndef ASSIMP_BUILD_NO_FBX_IMPORTER + +namespace Assimp { +namespace FBX { +namespace Util { + +// ------------------------------------------------------------------------------------------------ +const char* TokenTypeString(TokenType t) +{ + switch(t) { + case TokenType_OPEN_BRACKET: + return "TOK_OPEN_BRACKET"; + + case TokenType_CLOSE_BRACKET: + return "TOK_CLOSE_BRACKET"; + + case TokenType_DATA: + return "TOK_DATA"; + + case TokenType_COMMA: + return "TOK_COMMA"; + + case TokenType_KEY: + return "TOK_KEY"; + + case TokenType_BINARY_DATA: + return "TOK_BINARY_DATA"; + } + + ai_assert(false); + return ""; +} + + +// ------------------------------------------------------------------------------------------------ +std::string AddOffset(const std::string& prefix, const std::string& text, size_t offset) +{ + return static_cast( (Formatter::format() << prefix << " (offset 0x" << std::hex << offset << ") " << text) ); +} + +// ------------------------------------------------------------------------------------------------ +std::string AddLineAndColumn(const std::string& prefix, const std::string& text, unsigned int line, unsigned int column) +{ + return static_cast( (Formatter::format() << prefix << " (line " << line << " << col " << column << ") " << text) ); +} + +// ------------------------------------------------------------------------------------------------ +std::string AddTokenText(const std::string& prefix, const std::string& text, const Token* tok) +{ + if(tok->IsBinary()) { + return static_cast( (Formatter::format() << prefix << + " (" << TokenTypeString(tok->Type()) << + ", offset 0x" << std::hex << tok->Offset() << ") " << + text) ); + } + + return static_cast( (Formatter::format() << prefix << + " (" << TokenTypeString(tok->Type()) << + ", line " << tok->Line() << + ", col " << tok->Column() << ") " << + text) ); +} + +// Generated by this formula: T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i; +static const uint8_t base64DecodeTable[128] = { + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 255, 255, 255, + 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, + 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 255, 255, 255, 255, 255 +}; + +uint8_t DecodeBase64(char ch) +{ + const auto idx = static_cast(ch); + if (idx > 127) + return 255; + return base64DecodeTable[idx]; +} + +size_t ComputeDecodedSizeBase64(const char* in, size_t inLength) +{ + if (inLength < 2) + { + return 0; + } + const size_t equals = size_t(in[inLength - 1] == '=') + size_t(in[inLength - 2] == '='); + const size_t full_length = (inLength * 3) >> 2; // div by 4 + if (full_length < equals) + { + return 0; + } + return full_length - equals; +} + +size_t DecodeBase64(const char* in, size_t inLength, uint8_t* out, size_t maxOutLength) +{ + if (maxOutLength == 0 || inLength < 2) { + return 0; + } + const size_t realLength = inLength - size_t(in[inLength - 1] == '=') - size_t(in[inLength - 2] == '='); + size_t dst_offset = 0; + int val = 0, valb = -8; + for (size_t src_offset = 0; src_offset < realLength; ++src_offset) + { + const uint8_t table_value = Util::DecodeBase64(in[src_offset]); + if (table_value == 255) + { + return 0; + } + val = (val << 6) + table_value; + valb += 6; + if (valb >= 0) + { + out[dst_offset++] = static_cast((val >> valb) & 0xFF); + valb -= 8; + val &= 0xFFF; + } + } + return dst_offset; +} + +static const char to_base64_string[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +char EncodeBase64(char byte) +{ + return to_base64_string[(size_t)byte]; +} + +/** Encodes a block of 4 bytes to base64 encoding +* +* @param bytes Bytes to encode. +* @param out_string String to write encoded values to. +* @param string_pos Position in out_string.*/ +void EncodeByteBlock(const char* bytes, std::string& out_string, size_t string_pos) +{ + char b0 = (bytes[0] & 0xFC) >> 2; + char b1 = (bytes[0] & 0x03) << 4 | ((bytes[1] & 0xF0) >> 4); + char b2 = (bytes[1] & 0x0F) << 2 | ((bytes[2] & 0xC0) >> 6); + char b3 = (bytes[2] & 0x3F); + + out_string[string_pos + 0] = EncodeBase64(b0); + out_string[string_pos + 1] = EncodeBase64(b1); + out_string[string_pos + 2] = EncodeBase64(b2); + out_string[string_pos + 3] = EncodeBase64(b3); +} + +std::string EncodeBase64(const char* data, size_t length) +{ + // calculate extra bytes needed to get a multiple of 3 + size_t extraBytes = 3 - length % 3; + + // number of base64 bytes + size_t encodedBytes = 4 * (length + extraBytes) / 3; + + std::string encoded_string(encodedBytes, '='); + + // read blocks of 3 bytes + for (size_t ib3 = 0; ib3 < length / 3; ib3++) + { + const size_t iByte = ib3 * 3; + const size_t iEncodedByte = ib3 * 4; + const char* currData = &data[iByte]; + + EncodeByteBlock(currData, encoded_string, iEncodedByte); + } + + // if size of data is not a multiple of 3, also encode the final bytes (and add zeros where needed) + if (extraBytes > 0) + { + char finalBytes[4] = { 0,0,0,0 }; + memcpy(&finalBytes[0], &data[length - length % 3], length % 3); + + const size_t iEncodedByte = encodedBytes - 4; + EncodeByteBlock(&finalBytes[0], encoded_string, iEncodedByte); + + // add '=' at the end + for (size_t i = 0; i < 4 * extraBytes / 3; i++) + encoded_string[encodedBytes - i - 1] = '='; + } + return encoded_string; +} + +} // !Util +} // !FBX +} // !Assimp + +#endif diff --git a/Engine/lib/assimp/code/FBXUtil.h b/Engine/lib/assimp/code/FBX/FBXUtil.h similarity index 76% rename from Engine/lib/assimp/code/FBXUtil.h rename to Engine/lib/assimp/code/FBX/FBXUtil.h index 1a37d346b..b63441885 100644 --- a/Engine/lib/assimp/code/FBXUtil.h +++ b/Engine/lib/assimp/code/FBX/FBXUtil.h @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXCompileConfig.h" #include "FBXTokenizer.h" +#include namespace Assimp { namespace FBX { @@ -77,7 +78,7 @@ const char* TokenTypeString(TokenType t); * @param line Line index, 1-based * @param column Column index, 1-based * @return A string of the following format: {prefix} (offset 0x{offset}) {text}*/ -std::string AddOffset(const std::string& prefix, const std::string& text, unsigned int offset); +std::string AddOffset(const std::string& prefix, const std::string& text, size_t offset); /** Format log/error messages using a given line location in the source file. @@ -98,6 +99,37 @@ std::string AddLineAndColumn(const std::string& prefix, const std::string& text, * @return A string of the following format: {prefix} ({token-type}, line {line}, col {column}) {text}*/ std::string AddTokenText(const std::string& prefix, const std::string& text, const Token* tok); +/** Decode a single Base64-encoded character. +* +* @param ch Character to decode (from base64 to binary). +* @return decoded byte value*/ +uint8_t DecodeBase64(char ch); + +/** Compute decoded size of a Base64-encoded string +* +* @param in Characters to decode. +* @param inLength Number of characters to decode. +* @return size of the decoded data (number of bytes)*/ +size_t ComputeDecodedSizeBase64(const char* in, size_t inLength); + +/** Decode a Base64-encoded string +* +* @param in Characters to decode. +* @param inLength Number of characters to decode. +* @param out Pointer where we will store the decoded data. +* @param maxOutLength Size of output buffer. +* @return size of the decoded data (number of bytes)*/ +size_t DecodeBase64(const char* in, size_t inLength, uint8_t* out, size_t maxOutLength); + +char EncodeBase64(char byte); + +/** Encode bytes in base64-encoding +* +* @param data Binary data to encode. +* @param inLength Number of bytes to encode. +* @return base64-encoded string*/ +std::string EncodeBase64(const char* data, size_t length); + } } } diff --git a/Engine/lib/assimp/code/FBXImporter.cpp b/Engine/lib/assimp/code/FBXImporter.cpp deleted file mode 100644 index 2cc8bffc2..000000000 --- a/Engine/lib/assimp/code/FBXImporter.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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. -r -* 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 FBXImporter.cpp - * @brief Implementation of the FBX importer. - */ - -#ifndef ASSIMP_BUILD_NO_FBX_IMPORTER - -#include "FBXImporter.h" - -#include "FBXTokenizer.h" -#include "FBXParser.h" -#include "FBXUtil.h" -#include "FBXDocument.h" -#include "FBXConverter.h" - -#include -#include -#include -#include - -namespace Assimp { - -template<> -const char* LogFunctions::Prefix() { - static auto prefix = "FBX: "; - return prefix; -} - -} - -using namespace Assimp; -using namespace Assimp::Formatter; -using namespace Assimp::FBX; - -namespace { - -static const aiImporterDesc desc = { - "Autodesk FBX Importer", - "", - "", - "", - aiImporterFlags_SupportTextFlavour, - 0, - 0, - 0, - 0, - "fbx" -}; -} - -// ------------------------------------------------------------------------------------------------ -// Constructor to be privately used by #Importer -FBXImporter::FBXImporter() -{ -} - -// ------------------------------------------------------------------------------------------------ -// Destructor, private as well -FBXImporter::~FBXImporter() -{ -} - -// ------------------------------------------------------------------------------------------------ -// Returns whether the class can handle the format of the given file. -bool FBXImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const -{ - const std::string& extension = GetExtension(pFile); - if (extension == std::string( desc.mFileExtensions ) ) { - return true; - } - - else if ((!extension.length() || checkSig) && pIOHandler) { - // at least ASCII-FBX files usually have a 'FBX' somewhere in their head - const char* tokens[] = {"fbx"}; - return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1); - } - return false; -} - -// ------------------------------------------------------------------------------------------------ -// List all extensions handled by this loader -const aiImporterDesc* FBXImporter::GetInfo () const -{ - return &desc; -} - -// ------------------------------------------------------------------------------------------------ -// Setup configuration properties for the loader -void FBXImporter::SetupProperties(const Importer* pImp) -{ - settings.readAllLayers = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_GEOMETRY_LAYERS, true); - settings.readAllMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ALL_MATERIALS, false); - settings.readMaterials = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_MATERIALS, true); - settings.readTextures = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_TEXTURES, true); - settings.readCameras = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_CAMERAS, true); - settings.readLights = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_LIGHTS, true); - settings.readAnimations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_READ_ANIMATIONS, true); - settings.strictMode = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_STRICT_MODE, false); - settings.preservePivots = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, true); - settings.optimizeEmptyAnimationCurves = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, true); - settings.useLegacyEmbeddedTextureNaming = pImp->GetPropertyBool(AI_CONFIG_IMPORT_FBX_EMBEDDED_TEXTURES_LEGACY_NAMING, false); -} - -// ------------------------------------------------------------------------------------------------ -// Imports the given file into the given scene structure. -void FBXImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) -{ - std::unique_ptr stream(pIOHandler->Open(pFile,"rb")); - if (!stream) { - ThrowException("Could not open file for reading"); - } - - // 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 - // streaming for its output data structures so the net win with - // streaming input data would be very low. - std::vector contents; - contents.resize(stream->FileSize()+1); - stream->Read( &*contents.begin(), 1, contents.size()-1 ); - contents[ contents.size() - 1 ] = 0; - const char* const begin = &*contents.begin(); - - // broadphase tokenizing pass in which we identify the core - // syntax elements of FBX (brackets, commas, key:value mappings) - TokenList tokens; - try { - - bool is_binary = false; - if (!strncmp(begin,"Kaydara FBX Binary",18)) { - is_binary = true; - TokenizeBinary(tokens,begin,static_cast(contents.size())); - } - else { - Tokenize(tokens,begin); - } - - // use this information to construct a very rudimentary - // parse-tree representing the FBX scope structure - Parser parser(tokens, is_binary); - - // take the raw parse-tree and convert it to a FBX DOM - Document doc(parser,settings); - - // convert the FBX DOM to aiScene - ConvertToAssimpScene(pScene,doc); - - std::for_each(tokens.begin(),tokens.end(),Util::delete_fun()); - } - catch(std::exception&) { - std::for_each(tokens.begin(),tokens.end(),Util::delete_fun()); - throw; - } -} - -#endif // !ASSIMP_BUILD_NO_FBX_IMPORTER diff --git a/Engine/lib/assimp/code/FBXUtil.cpp b/Engine/lib/assimp/code/FBXUtil.cpp deleted file mode 100644 index c184c4a00..000000000 --- a/Engine/lib/assimp/code/FBXUtil.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 FBXUtil.cpp - * @brief Implementation of internal FBX utility functions - */ - -#include "FBXUtil.h" -#include "FBXTokenizer.h" - -#include -#include - -#ifndef ASSIMP_BUILD_NO_FBX_IMPORTER - -namespace Assimp { -namespace FBX { -namespace Util { - -// ------------------------------------------------------------------------------------------------ -const char* TokenTypeString(TokenType t) -{ - switch(t) { - case TokenType_OPEN_BRACKET: - return "TOK_OPEN_BRACKET"; - - case TokenType_CLOSE_BRACKET: - return "TOK_CLOSE_BRACKET"; - - case TokenType_DATA: - return "TOK_DATA"; - - case TokenType_COMMA: - return "TOK_COMMA"; - - case TokenType_KEY: - return "TOK_KEY"; - - case TokenType_BINARY_DATA: - return "TOK_BINARY_DATA"; - } - - ai_assert(false); - return ""; -} - - -// ------------------------------------------------------------------------------------------------ -std::string AddOffset(const std::string& prefix, const std::string& text, unsigned int offset) -{ - return static_cast( (Formatter::format() << prefix << " (offset 0x" << std::hex << offset << ") " << text) ); -} - -// ------------------------------------------------------------------------------------------------ -std::string AddLineAndColumn(const std::string& prefix, const std::string& text, unsigned int line, unsigned int column) -{ - return static_cast( (Formatter::format() << prefix << " (line " << line << " << col " << column << ") " << text) ); -} - -// ------------------------------------------------------------------------------------------------ -std::string AddTokenText(const std::string& prefix, const std::string& text, const Token* tok) -{ - if(tok->IsBinary()) { - return static_cast( (Formatter::format() << prefix << - " (" << TokenTypeString(tok->Type()) << - ", offset 0x" << std::hex << tok->Offset() << ") " << - text) ); - } - - return static_cast( (Formatter::format() << prefix << - " (" << TokenTypeString(tok->Type()) << - ", line " << tok->Line() << - ", col " << tok->Column() << ") " << - text) ); -} - -} // !Util -} // !FBX -} // !Assimp - -#endif diff --git a/Engine/lib/assimp/code/GenericProperty.h b/Engine/lib/assimp/code/GenericProperty.h deleted file mode 100644 index 454f4952b..000000000 --- a/Engine/lib/assimp/code/GenericProperty.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -#ifndef AI_GENERIC_PROPERTY_H_INCLUDED -#define AI_GENERIC_PROPERTY_H_INCLUDED - -#include -#include -#include "Hash.h" -#include - - -// ------------------------------------------------------------------------------------------------ -template -inline bool SetGenericProperty(std::map< unsigned int, T >& list, - const char* szName, const T& value) -{ - ai_assert(NULL != szName); - const uint32_t hash = SuperFastHash(szName); - - typename std::map::iterator it = list.find(hash); - if (it == list.end()) { - list.insert(std::pair( hash, value )); - return false; - } - (*it).second = value; - return true; -} - -// ------------------------------------------------------------------------------------------------ -template -inline const T& GetGenericProperty(const std::map< unsigned int, T >& list, - const char* szName, const T& errorReturn) -{ - ai_assert(NULL != szName); - const uint32_t hash = SuperFastHash(szName); - - typename std::map::const_iterator it = list.find(hash); - if (it == list.end()) - return errorReturn; - - return (*it).second; -} - -// ------------------------------------------------------------------------------------------------ -// Special version for pointer types - they will be deleted when replaced with another value -// passing NULL removes the whole property -template -inline void SetGenericPropertyPtr(std::map< unsigned int, T* >& list, - const char* szName, T* value, bool* bWasExisting = NULL) -{ - ai_assert(NULL != szName); - const uint32_t hash = SuperFastHash(szName); - - typename std::map::iterator it = list.find(hash); - if (it == list.end()) { - if (bWasExisting) - *bWasExisting = false; - - list.insert(std::pair( hash, value )); - return; - } - if ((*it).second != value) { - delete (*it).second; - (*it).second = value; - } - if (!value) { - list.erase(it); - } - if (bWasExisting) - *bWasExisting = true; -} - -// ------------------------------------------------------------------------------------------------ -template -inline bool HasGenericProperty(const std::map< unsigned int, T >& list, - const char* szName) -{ - ai_assert(NULL != szName); - const uint32_t hash = SuperFastHash(szName); - - typename std::map::const_iterator it = list.find(hash); - if (it == list.end()) return false; - - return true; -} - -#endif // !! AI_GENERIC_PROPERTY_H_INCLUDED diff --git a/Engine/lib/assimp/code/HMPFileData.h b/Engine/lib/assimp/code/HMP/HMPFileData.h similarity index 100% rename from Engine/lib/assimp/code/HMPFileData.h rename to Engine/lib/assimp/code/HMP/HMPFileData.h diff --git a/Engine/lib/assimp/code/HMPLoader.cpp b/Engine/lib/assimp/code/HMP/HMPLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/HMPLoader.cpp rename to Engine/lib/assimp/code/HMP/HMPLoader.cpp index 7c1d0b65f..d5469181e 100644 --- a/Engine/lib/assimp/code/HMPLoader.cpp +++ b/Engine/lib/assimp/code/HMP/HMPLoader.cpp @@ -47,14 +47,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_HMP_IMPORTER // internal headers -#include "HMPLoader.h" -#include "MD2FileData.h" -#include +#include "HMP/HMPLoader.h" +#include "MD2/MD2FileData.h" + #include #include #include #include +#include + using namespace Assimp; static const aiImporterDesc desc = { diff --git a/Engine/lib/assimp/code/HMPLoader.h b/Engine/lib/assimp/code/HMP/HMPLoader.h similarity index 98% rename from Engine/lib/assimp/code/HMPLoader.h rename to Engine/lib/assimp/code/HMP/HMPLoader.h index d0a34bfb7..421826c91 100644 --- a/Engine/lib/assimp/code/HMPLoader.h +++ b/Engine/lib/assimp/code/HMP/HMPLoader.h @@ -48,8 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include -#include "MDLLoader.h" -#include "HMPFileData.h" + +#include "MDL/MDLLoader.h" +#include "HMP/HMPFileData.h" namespace Assimp { using namespace HMP; diff --git a/Engine/lib/assimp/code/HalfLifeFileData.h b/Engine/lib/assimp/code/HMP/HalfLifeFileData.h similarity index 100% rename from Engine/lib/assimp/code/HalfLifeFileData.h rename to Engine/lib/assimp/code/HMP/HalfLifeFileData.h diff --git a/Engine/lib/assimp/code/Hash.h b/Engine/lib/assimp/code/Hash.h deleted file mode 100644 index a567adbc3..000000000 --- a/Engine/lib/assimp/code/Hash.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -#ifndef AI_HASH_H_INCLUDED -#define AI_HASH_H_INCLUDED - -#include -#include - -// ------------------------------------------------------------------------------------------------ -// Hashing function taken from -// http://www.azillionmonkeys.com/qed/hash.html -// (incremental version) -// -// This code is Copyright 2004-2008 by Paul Hsieh. It is used here in the belief that -// Assimp's license is considered compatible with Pauls's derivative license as specified -// on his web page. -// -// (stdint.h should have been been included here) -// ------------------------------------------------------------------------------------------------ -#undef get16bits -#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ - || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) -#define get16bits(d) (*((const uint16_t *) (d))) -#endif - -#if !defined (get16bits) -#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ - +(uint32_t)(((const uint8_t *)(d))[0]) ) -#endif - -// ------------------------------------------------------------------------------------------------ -inline uint32_t SuperFastHash (const char * data, uint32_t len = 0, uint32_t hash = 0) { -uint32_t tmp; -int rem; - - if (!data) return 0; - if (!len)len = (uint32_t)::strlen(data); - - rem = len & 3; - len >>= 2; - - /* Main loop */ - for (;len > 0; len--) { - hash += get16bits (data); - tmp = (get16bits (data+2) << 11) ^ hash; - hash = (hash << 16) ^ tmp; - data += 2*sizeof (uint16_t); - hash += hash >> 11; - } - - /* Handle end cases */ - switch (rem) { - case 3: hash += get16bits (data); - hash ^= hash << 16; - hash ^= data[sizeof (uint16_t)] << 18; - hash += hash >> 11; - break; - case 2: hash += get16bits (data); - hash ^= hash << 11; - hash += hash >> 17; - break; - case 1: hash += *data; - hash ^= hash << 10; - hash += hash >> 1; - } - - /* Force "avalanching" of final 127 bits */ - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - - return hash; -} - -#endif // !! AI_HASH_H_INCLUDED diff --git a/Engine/lib/assimp/code/IOStreamBuffer.h b/Engine/lib/assimp/code/IOStreamBuffer.h deleted file mode 100644 index d7528de7e..000000000 --- a/Engine/lib/assimp/code/IOStreamBuffer.h +++ /dev/null @@ -1,350 +0,0 @@ -#pragma once - -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -#include -#include -#include "ParsingUtils.h" - -#include - -namespace Assimp { - -// --------------------------------------------------------------------------- -/** - * Implementation of a cached stream buffer. - */ -template -class IOStreamBuffer { -public: - /// @brief The class constructor. - IOStreamBuffer( size_t cache = 4096 * 4096 ); - - /// @brief The class destructor. - ~IOStreamBuffer(); - - /// @brief Will open the cached access for a given stream. - /// @param stream The stream to cache. - /// @return true if successful. - bool open( IOStream *stream ); - - /// @brief Will close the cached access. - /// @return true if successful. - bool close(); - - /// @brief Returns the file-size. - /// @return The file-size. - size_t size() const; - - /// @brief Returns the cache size. - /// @return The cache size. - size_t cacheSize() const; - - /// @brief Will read the next block. - /// @return true if successful. - bool readNextBlock(); - - /// @brief Returns the number of blocks to read. - /// @return The number of blocks. - size_t getNumBlocks() const; - - /// @brief Returns the current block index. - /// @return The current block index. - size_t getCurrentBlockIndex() const; - - /// @brief Returns the current file pos. - /// @return The current file pos. - size_t getFilePos() const; - - /// @brief Will read the next line. - /// @param buffer The buffer for the next line. - /// @return true if successful. - bool getNextDataLine( std::vector &buffer, T continuationToken ); - - /// @brief Will read the next line ascii or binary end line char. - /// @param buffer The buffer for the next line. - /// @return true if successful. - bool getNextLine(std::vector &buffer); - - /// @brief Will read the next block. - /// @param buffer The buffer for the next block. - /// @return true if successful. - bool getNextBlock( std::vector &buffer ); - -private: - IOStream *m_stream; - size_t m_filesize; - size_t m_cacheSize; - size_t m_numBlocks; - size_t m_blockIdx; - std::vector m_cache; - size_t m_cachePos; - size_t m_filePos; -}; - -template -inline -IOStreamBuffer::IOStreamBuffer( size_t cache ) -: m_stream( nullptr ) -, m_filesize( 0 ) -, m_cacheSize( cache ) -, m_numBlocks( 0 ) -, m_blockIdx( 0 ) -, m_cachePos( 0 ) -, m_filePos( 0 ) { - m_cache.resize( cache ); - std::fill( m_cache.begin(), m_cache.end(), '\n' ); -} - -template -inline -IOStreamBuffer::~IOStreamBuffer() { - // empty -} - -template -inline -bool IOStreamBuffer::open( IOStream *stream ) { - // file still opened! - if ( nullptr != m_stream ) { - return false; - } - - // Invalid stream pointer - if ( nullptr == stream ) { - return false; - } - - m_stream = stream; - m_filesize = m_stream->FileSize(); - if ( m_filesize == 0 ) { - return false; - } - if ( m_filesize < m_cacheSize ) { - m_cacheSize = m_filesize; - } - - m_numBlocks = m_filesize / m_cacheSize; - if ( ( m_filesize % m_cacheSize ) > 0 ) { - m_numBlocks++; - } - - return true; -} - -template -inline -bool IOStreamBuffer::close() { - if ( nullptr == m_stream ) { - return false; - } - - // init counters and state vars - m_stream = nullptr; - m_filesize = 0; - m_numBlocks = 0; - m_blockIdx = 0; - m_cachePos = 0; - m_filePos = 0; - - return true; -} - -template -inline -size_t IOStreamBuffer::size() const { - return m_filesize; -} - -template -inline -size_t IOStreamBuffer::cacheSize() const { - return m_cacheSize; -} - -template -inline -bool IOStreamBuffer::readNextBlock() { - m_stream->Seek( m_filePos, aiOrigin_SET ); - size_t readLen = m_stream->Read( &m_cache[ 0 ], sizeof( T ), m_cacheSize ); - if ( readLen == 0 ) { - return false; - } - if ( readLen < m_cacheSize ) { - m_cacheSize = readLen; - } - m_filePos += m_cacheSize; - m_cachePos = 0; - m_blockIdx++; - - return true; -} - -template -inline -size_t IOStreamBuffer::getNumBlocks() const { - return m_numBlocks; -} - -template -inline -size_t IOStreamBuffer::getCurrentBlockIndex() const { - return m_blockIdx; -} - -template -inline -size_t IOStreamBuffer::getFilePos() const { - return m_filePos; -} - -template -inline -bool IOStreamBuffer::getNextDataLine( std::vector &buffer, T continuationToken ) { - buffer.resize( m_cacheSize ); - if ( m_cachePos == m_cacheSize || 0 == m_filePos ) { - if ( !readNextBlock() ) { - return false; - } - } - - bool continuationFound( false ), endOfDataLine( false ); - size_t i = 0; - while ( !endOfDataLine ) { - if ( continuationToken == m_cache[ m_cachePos ] ) { - continuationFound = true; - ++m_cachePos; - } - if ( IsLineEnd( m_cache[ m_cachePos ] ) ) { - if ( !continuationFound ) { - // the end of the data line - break; - } else { - // skip line end - while ( m_cache[m_cachePos] != '\n') { - ++m_cachePos; - } - ++m_cachePos; - continuationFound = false; - } - } - - buffer[ i ] = m_cache[ m_cachePos ]; - m_cachePos++; - i++; - if ( m_cachePos >= m_cacheSize ) { - if ( !readNextBlock() ) { - return false; - } - } - } - - buffer[ i ] = '\n'; - m_cachePos++; - - return true; -} - -static -inline -bool isEndOfCache( size_t pos, size_t cacheSize ) { - return ( pos == cacheSize ); -} - -template -inline -bool IOStreamBuffer::getNextLine(std::vector &buffer) { - buffer.resize(m_cacheSize); - if ( isEndOfCache( m_cachePos, m_cacheSize ) || 0 == m_filePos) { - if (!readNextBlock()) { - return false; - } - } - - if (IsLineEnd(m_cache[m_cachePos])) { - // skip line end - while (m_cache[m_cachePos] != '\n') { - ++m_cachePos; - } - ++m_cachePos; - if ( isEndOfCache( m_cachePos, m_cacheSize ) ) { - if ( !readNextBlock() ) { - return false; - } - } - } - - size_t i = 0; - while (!IsLineEnd(m_cache[ m_cachePos ])) { - buffer[i] = m_cache[ m_cachePos ]; - m_cachePos++; - i++; - if (m_cachePos >= m_cacheSize) { - if (!readNextBlock()) { - return false; - } - } - } - buffer[i] = '\n'; - m_cachePos++; - - return true; -} - -template -inline -bool IOStreamBuffer::getNextBlock( std::vector &buffer) { - //just return the last blockvalue if getNextLine was used before - if ( m_cachePos != 0) { - buffer = std::vector(m_cache.begin() + m_cachePos, m_cache.end()); - m_cachePos = 0; - } - else { - if ( !readNextBlock() ) - return false; - - buffer = std::vector(m_cache.begin(), m_cache.end()); - } - return true; -} - -} // !ns Assimp diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCBoolean.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCBoolean.cpp new file mode 100644 index 000000000..10e7bf3af --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCBoolean.cpp @@ -0,0 +1,829 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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 IFCBoolean.cpp + * @brief Implements a subset of Ifc boolean operations + */ + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER +#include "code/Importer/IFC/IFCUtil.h" +#include "code/Common/PolyTools.h" +#include "code/PostProcessing/ProcessHelper.h" +#include + +#include +#include + +namespace Assimp { + namespace IFC { + +// ------------------------------------------------------------------------------------------------ +// Calculates intersection between line segment and plane. To catch corner cases, specify which side you prefer. +// The function then generates a hit only if the end is beyond a certain margin in that direction, filtering out +// "very close to plane" ghost hits as long as start and end stay directly on or within the given plane side. +bool IntersectSegmentPlane(const IfcVector3& p,const IfcVector3& n, const IfcVector3& e0, + const IfcVector3& e1, bool assumeStartOnWhiteSide, IfcVector3& out) +{ + const IfcVector3 pdelta = e0 - p, seg = e1 - e0; + const IfcFloat dotOne = n*seg, dotTwo = -(n*pdelta); + + // if segment ends on plane, do not report a hit. We stay on that side until a following segment starting at this + // point leaves the plane through the other side + if( std::abs(dotOne + dotTwo) < 1e-6 ) + return false; + + // if segment starts on the plane, report a hit only if the end lies on the *other* side + if( std::abs(dotTwo) < 1e-6 ) + { + if( (assumeStartOnWhiteSide && dotOne + dotTwo < 1e-6) || (!assumeStartOnWhiteSide && dotOne + dotTwo > -1e-6) ) + { + out = e0; + return true; + } + else + { + return false; + } + } + + // ignore if segment is parallel to plane and far away from it on either side + // Warning: if there's a few thousand of such segments which slowly accumulate beyond the epsilon, no hit would be registered + if( std::abs(dotOne) < 1e-6 ) + return false; + + // t must be in [0..1] if the intersection point is within the given segment + const IfcFloat t = dotTwo / dotOne; + if( t > 1.0 || t < 0.0 ) + return false; + + out = e0 + t*seg; + return true; +} + +// ------------------------------------------------------------------------------------------------ +void FilterPolygon(std::vector& resultpoly) +{ + if( resultpoly.size() < 3 ) + { + resultpoly.clear(); + return; + } + + IfcVector3 vmin, vmax; + ArrayBounds(resultpoly.data(), static_cast(resultpoly.size()), vmin, vmax); + + // filter our IfcFloat points - those may happen if a point lies + // directly on the intersection line or directly on the clipping plane + const IfcFloat epsilon = (vmax - vmin).SquareLength() / 1e6f; + FuzzyVectorCompare fz(epsilon); + std::vector::iterator e = std::unique(resultpoly.begin(), resultpoly.end(), fz); + + if( e != resultpoly.end() ) + resultpoly.erase(e, resultpoly.end()); + + if( !resultpoly.empty() && fz(resultpoly.front(), resultpoly.back()) ) + resultpoly.pop_back(); +} + +// ------------------------------------------------------------------------------------------------ +void WritePolygon(std::vector& resultpoly, TempMesh& result) +{ + FilterPolygon(resultpoly); + + if( resultpoly.size() > 2 ) + { + result.mVerts.insert(result.mVerts.end(), resultpoly.begin(), resultpoly.end()); + result.mVertcnt.push_back(static_cast(resultpoly.size())); + } +} + + +// ------------------------------------------------------------------------------------------------ +void ProcessBooleanHalfSpaceDifference(const Schema_2x3::IfcHalfSpaceSolid* hs, TempMesh& result, + const TempMesh& first_operand, + ConversionData& /*conv*/) +{ + ai_assert(hs != NULL); + + const Schema_2x3::IfcPlane* const plane = hs->BaseSurface->ToPtr(); + if(!plane) { + IFCImporter::LogError("expected IfcPlane as base surface for the IfcHalfSpaceSolid"); + return; + } + + // extract plane base position vector and normal vector + IfcVector3 p,n(0.f,0.f,1.f); + if (plane->Position->Axis) { + ConvertDirection(n,plane->Position->Axis.Get()); + } + ConvertCartesianPoint(p,plane->Position->Location); + + if(!IsTrue(hs->AgreementFlag)) { + n *= -1.f; + } + + // clip the current contents of `meshout` against the plane we obtained from the second operand + const std::vector& in = first_operand.mVerts; + std::vector& outvert = result.mVerts; + + std::vector::const_iterator begin = first_operand.mVertcnt.begin(), + end = first_operand.mVertcnt.end(), iit; + + outvert.reserve(in.size()); + result.mVertcnt.reserve(first_operand.mVertcnt.size()); + + unsigned int vidx = 0; + for(iit = begin; iit != end; vidx += *iit++) { + + unsigned int newcount = 0; + bool isAtWhiteSide = (in[vidx] - p) * n > -1e-6; + for( unsigned int i = 0; i < *iit; ++i ) { + const IfcVector3& e0 = in[vidx + i], e1 = in[vidx + (i + 1) % *iit]; + + // does the next segment intersect the plane? + IfcVector3 isectpos; + if( IntersectSegmentPlane(p, n, e0, e1, isAtWhiteSide, isectpos) ) { + if( isAtWhiteSide ) { + // e0 is on the right side, so keep it + outvert.push_back(e0); + outvert.push_back(isectpos); + newcount += 2; + } + else { + // e0 is on the wrong side, so drop it and keep e1 instead + outvert.push_back(isectpos); + ++newcount; + } + isAtWhiteSide = !isAtWhiteSide; + } + else + { + if( isAtWhiteSide ) { + outvert.push_back(e0); + ++newcount; + } + } + } + + if (!newcount) { + continue; + } + + IfcVector3 vmin,vmax; + ArrayBounds(&*(outvert.end()-newcount),newcount,vmin,vmax); + + // filter our IfcFloat points - those may happen if a point lies + // directly on the intersection line. However, due to IfcFloat + // precision a bitwise comparison is not feasible to detect + // this case. + const IfcFloat epsilon = (vmax-vmin).SquareLength() / 1e6f; + FuzzyVectorCompare fz(epsilon); + + std::vector::iterator e = std::unique( outvert.end()-newcount, outvert.end(), fz ); + + if (e != outvert.end()) { + newcount -= static_cast(std::distance(e,outvert.end())); + outvert.erase(e,outvert.end()); + } + if (fz(*( outvert.end()-newcount),outvert.back())) { + outvert.pop_back(); + --newcount; + } + if(newcount > 2) { + result.mVertcnt.push_back(newcount); + } + else while(newcount-->0) { + result.mVerts.pop_back(); + } + + } + IFCImporter::LogDebug("generating CSG geometry by plane clipping (IfcBooleanClippingResult)"); +} + +// ------------------------------------------------------------------------------------------------ +// Check if e0-e1 intersects a sub-segment of the given boundary line. +// note: this functions works on 3D vectors, but performs its intersection checks solely in xy. +// New version takes the supposed inside/outside state as a parameter and treats corner cases as if +// the line stays on that side. This should make corner cases more stable. +// Two million assumptions! Boundary should have all z at 0.0, will be treated as closed, should not have +// segments with length <1e-6, self-intersecting might break the corner case handling... just don't go there, ok? +bool IntersectsBoundaryProfile(const IfcVector3& e0, const IfcVector3& e1, const std::vector& boundary, + const bool isStartAssumedInside, std::vector >& intersect_results, + const bool halfOpen = false) +{ + ai_assert(intersect_results.empty()); + + // determine winding order - necessary to detect segments going "inwards" or "outwards" from a point directly on the border + // positive sum of angles means clockwise order when looking down the -Z axis + IfcFloat windingOrder = 0.0; + for( size_t i = 0, bcount = boundary.size(); i < bcount; ++i ) { + IfcVector3 b01 = boundary[(i + 1) % bcount] - boundary[i]; + IfcVector3 b12 = boundary[(i + 2) % bcount] - boundary[(i + 1) % bcount]; + IfcVector3 b1_side = IfcVector3(b01.y, -b01.x, 0.0); // rotated 90° clockwise in Z plane + // Warning: rough estimate only. A concave poly with lots of small segments each featuring a small counter rotation + // could fool the accumulation. Correct implementation would be sum( acos( b01 * b2) * sign( b12 * b1_side)) + windingOrder += (b1_side.x*b12.x + b1_side.y*b12.y); + } + windingOrder = windingOrder > 0.0 ? 1.0 : -1.0; + + const IfcVector3 e = e1 - e0; + + for( size_t i = 0, bcount = boundary.size(); i < bcount; ++i ) { + // boundary segment i: b0-b1 + const IfcVector3& b0 = boundary[i]; + const IfcVector3& b1 = boundary[(i + 1) % bcount]; + IfcVector3 b = b1 - b0; + + // segment-segment intersection + // solve b0 + b*s = e0 + e*t for (s,t) + const IfcFloat det = (-b.x * e.y + e.x * b.y); + if( std::abs(det) < 1e-6 ) { + // no solutions (parallel lines) + continue; + } + IfcFloat b_sqlen_inv = 1.0 / b.SquareLength(); + + const IfcFloat x = b0.x - e0.x; + const IfcFloat y = b0.y - e0.y; + const IfcFloat s = (x*e.y - e.x*y) / det; // scale along boundary edge + const IfcFloat t = (x*b.y - b.x*y) / det; // scale along given segment + const IfcVector3 p = e0 + e*t; +#ifdef ASSIMP_BUILD_DEBUG + const IfcVector3 check = b0 + b*s - p; + ai_assert((IfcVector2(check.x, check.y)).SquareLength() < 1e-5); +#endif + + // also calculate the distance of e0 and e1 to the segment. We need to detect the "starts directly on segment" + // and "ends directly at segment" cases + bool startsAtSegment, endsAtSegment; + { + // calculate closest point to each end on the segment, clamp that point to the segment's length, then check + // distance to that point. This approach is like testing if e0 is inside a capped cylinder. + IfcFloat et0 = (b.x*(e0.x - b0.x) + b.y*(e0.y - b0.y)) * b_sqlen_inv; + IfcVector3 closestPosToE0OnBoundary = b0 + std::max(IfcFloat(0.0), std::min(IfcFloat(1.0), et0)) * b; + startsAtSegment = (closestPosToE0OnBoundary - IfcVector3(e0.x, e0.y, 0.0)).SquareLength() < 1e-12; + IfcFloat et1 = (b.x*(e1.x - b0.x) + b.y*(e1.y - b0.y)) * b_sqlen_inv; + IfcVector3 closestPosToE1OnBoundary = b0 + std::max(IfcFloat(0.0), std::min(IfcFloat(1.0), et1)) * b; + endsAtSegment = (closestPosToE1OnBoundary - IfcVector3(e1.x, e1.y, 0.0)).SquareLength() < 1e-12; + } + + // Line segment ends at boundary -> ignore any hit, it will be handled by possibly following segments + if( endsAtSegment && !halfOpen ) + continue; + + // Line segment starts at boundary -> generate a hit only if following that line would change the INSIDE/OUTSIDE + // state. This should catch the case where a connected set of segments has a point directly on the boundary, + // one segment not hitting it because it ends there and the next segment not hitting it because it starts there + // Should NOT generate a hit if the segment only touches the boundary but turns around and stays inside. + if( startsAtSegment ) + { + IfcVector3 inside_dir = IfcVector3(b.y, -b.x, 0.0) * windingOrder; + bool isGoingInside = (inside_dir * e) > 0.0; + if( isGoingInside == isStartAssumedInside ) + continue; + + // only insert the point into the list if it is sufficiently far away from the previous intersection point. + // This way, we avoid duplicate detection if the intersection is directly on the vertex between two segments. + if( !intersect_results.empty() && intersect_results.back().first == i - 1 ) + { + const IfcVector3 diff = intersect_results.back().second - e0; + if( IfcVector2(diff.x, diff.y).SquareLength() < 1e-10 ) + continue; + } + intersect_results.push_back(std::make_pair(i, e0)); + continue; + } + + // for a valid intersection, s and t should be in range [0,1]. Including a bit of epsilon on s, potential double + // hits on two consecutive boundary segments are filtered + if( s >= -1e-6 * b_sqlen_inv && s <= 1.0 + 1e-6*b_sqlen_inv && t >= 0.0 && (t <= 1.0 || halfOpen) ) + { + // only insert the point into the list if it is sufficiently far away from the previous intersection point. + // This way, we avoid duplicate detection if the intersection is directly on the vertex between two segments. + if( !intersect_results.empty() && intersect_results.back().first == i - 1 ) + { + const IfcVector3 diff = intersect_results.back().second - p; + if( IfcVector2(diff.x, diff.y).SquareLength() < 1e-10 ) + continue; + } + intersect_results.push_back(std::make_pair(i, p)); + } + } + + return !intersect_results.empty(); +} + + +// ------------------------------------------------------------------------------------------------ +// note: this functions works on 3D vectors, but performs its intersection checks solely in xy. +bool PointInPoly(const IfcVector3& p, const std::vector& boundary) +{ + // even-odd algorithm: take a random vector that extends from p to infinite + // and counts how many times it intersects edges of the boundary. + // because checking for segment intersections is prone to numeric inaccuracies + // or double detections (i.e. when hitting multiple adjacent segments at their + // shared vertices) we do it thrice with different rays and vote on it. + + // the even-odd algorithm doesn't work for points which lie directly on + // the border of the polygon. If any of our attempts produces this result, + // we return false immediately. + + std::vector > intersected_boundary; + size_t votes = 0; + + IntersectsBoundaryProfile(p, p + IfcVector3(1.0, 0, 0), boundary, true, intersected_boundary, true); + votes += intersected_boundary.size() % 2; + + intersected_boundary.clear(); + IntersectsBoundaryProfile(p, p + IfcVector3(0, 1.0, 0), boundary, true, intersected_boundary, true); + votes += intersected_boundary.size() % 2; + + intersected_boundary.clear(); + IntersectsBoundaryProfile(p, p + IfcVector3(0.6, -0.6, 0.0), boundary, true, intersected_boundary, true); + votes += intersected_boundary.size() % 2; + + return votes > 1; +} + + +// ------------------------------------------------------------------------------------------------ +void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPolygonalBoundedHalfSpace* hs, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv) +{ + ai_assert(hs != NULL); + + const Schema_2x3::IfcPlane* const plane = hs->BaseSurface->ToPtr(); + if(!plane) { + IFCImporter::LogError("expected IfcPlane as base surface for the IfcHalfSpaceSolid"); + return; + } + + // extract plane base position vector and normal vector + IfcVector3 p,n(0.f,0.f,1.f); + if (plane->Position->Axis) { + ConvertDirection(n,plane->Position->Axis.Get()); + } + ConvertCartesianPoint(p,plane->Position->Location); + + if(!IsTrue(hs->AgreementFlag)) { + n *= -1.f; + } + + n.Normalize(); + + // obtain the polygonal bounding volume + std::shared_ptr profile = std::shared_ptr(new TempMesh()); + if(!ProcessCurve(hs->PolygonalBoundary, *profile.get(), conv)) { + IFCImporter::LogError("expected valid polyline for boundary of boolean halfspace"); + return; + } + + // determine winding order by calculating the normal. + IfcVector3 profileNormal = TempMesh::ComputePolygonNormal(profile->mVerts.data(), profile->mVerts.size()); + + IfcMatrix4 proj_inv; + ConvertAxisPlacement(proj_inv,hs->Position); + + // and map everything into a plane coordinate space so all intersection + // tests can be done in 2D space. + IfcMatrix4 proj = proj_inv; + proj.Inverse(); + + // clip the current contents of `meshout` against the plane we obtained from the second operand + const std::vector& in = first_operand.mVerts; + std::vector& outvert = result.mVerts; + std::vector& outvertcnt = result.mVertcnt; + + outvert.reserve(in.size()); + outvertcnt.reserve(first_operand.mVertcnt.size()); + + unsigned int vidx = 0; + std::vector::const_iterator begin = first_operand.mVertcnt.begin(); + std::vector::const_iterator end = first_operand.mVertcnt.end(); + std::vector::const_iterator iit; + for( iit = begin; iit != end; vidx += *iit++ ) + { + // Our new approach: we cut the poly along the plane, then we intersect the part on the black side of the plane + // against the bounding polygon. All the white parts, and the black part outside the boundary polygon, are kept. + std::vector whiteside, blackside; + + { + const IfcVector3* srcVertices = &in[vidx]; + const size_t srcVtxCount = *iit; + if( srcVtxCount == 0 ) + continue; + + IfcVector3 polyNormal = TempMesh::ComputePolygonNormal(srcVertices, srcVtxCount, true); + + // if the poly is parallel to the plane, put it completely on the black or white side + if( std::abs(polyNormal * n) > 0.9999 ) + { + bool isOnWhiteSide = (srcVertices[0] - p) * n > -1e-6; + std::vector& targetSide = isOnWhiteSide ? whiteside : blackside; + targetSide.insert(targetSide.end(), srcVertices, srcVertices + srcVtxCount); + } + else + { + // otherwise start building one polygon for each side. Whenever the current line segment intersects the plane + // we put a point there as an end of the current segment. Then we switch to the other side, put a point there, too, + // as a beginning of the current segment, and simply continue accumulating vertices. + bool isCurrentlyOnWhiteSide = ((srcVertices[0]) - p) * n > -1e-6; + for( size_t a = 0; a < srcVtxCount; ++a ) + { + IfcVector3 e0 = srcVertices[a]; + IfcVector3 e1 = srcVertices[(a + 1) % srcVtxCount]; + IfcVector3 ei; + + // put starting point to the current mesh + std::vector& trgt = isCurrentlyOnWhiteSide ? whiteside : blackside; + trgt.push_back(srcVertices[a]); + + // if there's an intersection, put an end vertex there, switch to the other side's mesh, + // and add a starting vertex there, too + bool isPlaneHit = IntersectSegmentPlane(p, n, e0, e1, isCurrentlyOnWhiteSide, ei); + if( isPlaneHit ) + { + if( trgt.empty() || (trgt.back() - ei).SquareLength() > 1e-12 ) + trgt.push_back(ei); + isCurrentlyOnWhiteSide = !isCurrentlyOnWhiteSide; + std::vector& newtrgt = isCurrentlyOnWhiteSide ? whiteside : blackside; + newtrgt.push_back(ei); + } + } + } + } + + // the part on the white side can be written into the target mesh right away + WritePolygon(whiteside, result); + + // The black part is the piece we need to get rid of, but only the part of it within the boundary polygon. + // So we now need to construct all the polygons that result from BlackSidePoly minus BoundaryPoly. + FilterPolygon(blackside); + + // Complicated, II. We run along the polygon. a) When we're inside the boundary, we run on until we hit an + // intersection, which means we're leaving it. We then start a new out poly there. b) When we're outside the + // boundary, we start collecting vertices until we hit an intersection, then we run along the boundary until we hit + // an intersection, then we switch back to the poly and run on on this one again, and so on until we got a closed + // loop. Then we continue with the path we left to catch potential additional polys on the other side of the + // boundary as described in a) + if( !blackside.empty() ) + { + // poly edge index, intersection point, edge index in boundary poly + std::vector > intersections; + bool startedInside = PointInPoly(proj * blackside.front(), profile->mVerts); + bool isCurrentlyInside = startedInside; + + std::vector > intersected_boundary; + + for( size_t a = 0; a < blackside.size(); ++a ) + { + const IfcVector3 e0 = proj * blackside[a]; + const IfcVector3 e1 = proj * blackside[(a + 1) % blackside.size()]; + + intersected_boundary.clear(); + IntersectsBoundaryProfile(e0, e1, profile->mVerts, isCurrentlyInside, intersected_boundary); + // sort the hits by distance from e0 to get the correct in/out/in sequence. Manually :-( I miss you, C++11. + if( intersected_boundary.size() > 1 ) + { + bool keepSorting = true; + while( keepSorting ) + { + keepSorting = false; + for( size_t b = 0; b < intersected_boundary.size() - 1; ++b ) + { + if( (intersected_boundary[b + 1].second - e0).SquareLength() < (intersected_boundary[b].second - e0).SquareLength() ) + { + keepSorting = true; + std::swap(intersected_boundary[b + 1], intersected_boundary[b]); + } + } + } + } + // now add them to the list of intersections + for( size_t b = 0; b < intersected_boundary.size(); ++b ) + intersections.push_back(std::make_tuple(a, proj_inv * intersected_boundary[b].second, intersected_boundary[b].first)); + + // and calculate our new inside/outside state + if( intersected_boundary.size() & 1 ) + isCurrentlyInside = !isCurrentlyInside; + } + + // we got a list of in-out-combinations of intersections. That should be an even number of intersections, or + // we're fucked. + if( (intersections.size() & 1) != 0 ) + { + IFCImporter::LogWarn("Odd number of intersections, can't work with that. Omitting half space boundary check."); + continue; + } + + if( intersections.size() > 1 ) + { + // If we started outside, the first intersection is a out->in intersection. Cycle them so that it + // starts with an intersection leaving the boundary + if( !startedInside ) + for( size_t b = 0; b < intersections.size() - 1; ++b ) + std::swap(intersections[b], intersections[(b + intersections.size() - 1) % intersections.size()]); + + // Filter pairs of out->in->out that lie too close to each other. + for( size_t a = 0; intersections.size() > 0 && a < intersections.size() - 1; /**/ ) + { + if( (std::get<1>(intersections[a]) - std::get<1>(intersections[(a + 1) % intersections.size()])).SquareLength() < 1e-10 ) + intersections.erase(intersections.begin() + a, intersections.begin() + a + 2); + else + a++; + } + if( intersections.size() > 1 && (std::get<1>(intersections.back()) - std::get<1>(intersections.front())).SquareLength() < 1e-10 ) + { + intersections.pop_back(); intersections.erase(intersections.begin()); + } + } + + + // no intersections at all: either completely inside the boundary, so everything gets discarded, or completely outside. + // in the latter case we're implementional lost. I'm simply going to ignore this, so a large poly will not get any + // holes if the boundary is smaller and does not touch it anywhere. + if( intersections.empty() ) + { + // starting point was outside -> everything is outside the boundary -> nothing is clipped -> add black side + // to result mesh unchanged + if( !startedInside ) + { + outvertcnt.push_back(static_cast(blackside.size())); + outvert.insert(outvert.end(), blackside.begin(), blackside.end()); + continue; + } + else + { + // starting point was inside the boundary -> everything is inside the boundary -> nothing is spared from the + // clipping -> nothing left to add to the result mesh + continue; + } + } + + // determine the direction in which we're marching along the boundary polygon. If the src poly is faced upwards + // and the boundary is also winded this way, we need to march *backwards* on the boundary. + const IfcVector3 polyNormal = IfcMatrix3(proj) * TempMesh::ComputePolygonNormal(blackside.data(), blackside.size()); + bool marchBackwardsOnBoundary = (profileNormal * polyNormal) >= 0.0; + + // Build closed loops from these intersections. Starting from an intersection leaving the boundary we + // walk along the polygon to the next intersection (which should be an IS entering the boundary poly). + // From there we walk along the boundary until we hit another intersection leaving the boundary, + // walk along the poly to the next IS and so on until we're back at the starting point. + // We remove every intersection we "used up", so any remaining intersection is the start of a new loop. + while( !intersections.empty() ) + { + std::vector resultpoly; + size_t currentIntersecIdx = 0; + + while( true ) + { + ai_assert(intersections.size() > currentIntersecIdx + 1); + std::tuple currintsec = intersections[currentIntersecIdx + 0]; + std::tuple nextintsec = intersections[currentIntersecIdx + 1]; + intersections.erase(intersections.begin() + currentIntersecIdx, intersections.begin() + currentIntersecIdx + 2); + + // we start with an in->out intersection + resultpoly.push_back(std::get<1>(currintsec)); + // climb along the polygon to the next intersection, which should be an out->in + size_t numPolyPoints = (std::get<0>(currintsec) > std::get<0>(nextintsec) ? blackside.size() : 0) + + std::get<0>(nextintsec) - std::get<0>(currintsec); + for( size_t a = 1; a <= numPolyPoints; ++a ) + resultpoly.push_back(blackside[(std::get<0>(currintsec) + a) % blackside.size()]); + // put the out->in intersection + resultpoly.push_back(std::get<1>(nextintsec)); + + // generate segments along the boundary polygon that lie in the poly's plane until we hit another intersection + IfcVector3 startingPoint = proj * std::get<1>(nextintsec); + size_t currentBoundaryEdgeIdx = (std::get<2>(nextintsec) + (marchBackwardsOnBoundary ? 1 : 0)) % profile->mVerts.size(); + size_t nextIntsecIdx = SIZE_MAX; + while( nextIntsecIdx == SIZE_MAX ) + { + IfcFloat t = 1e10; + + size_t nextBoundaryEdgeIdx = marchBackwardsOnBoundary ? (currentBoundaryEdgeIdx + profile->mVerts.size() - 1) : currentBoundaryEdgeIdx + 1; + nextBoundaryEdgeIdx %= profile->mVerts.size(); + // vertices of the current boundary segments + IfcVector3 currBoundaryPoint = profile->mVerts[currentBoundaryEdgeIdx]; + IfcVector3 nextBoundaryPoint = profile->mVerts[nextBoundaryEdgeIdx]; + // project the two onto the polygon + if( std::abs(polyNormal.z) > 1e-5 ) + { + currBoundaryPoint.z = startingPoint.z + (currBoundaryPoint.x - startingPoint.x) * polyNormal.x/polyNormal.z + (currBoundaryPoint.y - startingPoint.y) * polyNormal.y/polyNormal.z; + nextBoundaryPoint.z = startingPoint.z + (nextBoundaryPoint.x - startingPoint.x) * polyNormal.x/polyNormal.z + (nextBoundaryPoint.y - startingPoint.y) * polyNormal.y/polyNormal.z; + } + + // build a direction that goes along the boundary border but lies in the poly plane + IfcVector3 boundaryPlaneNormal = ((nextBoundaryPoint - currBoundaryPoint) ^ profileNormal).Normalize(); + IfcVector3 dirAtPolyPlane = (boundaryPlaneNormal ^ polyNormal).Normalize() * (marchBackwardsOnBoundary ? -1.0 : 1.0); + // if we can project the direction to the plane, we can calculate a maximum marching distance along that dir + // until we finish that boundary segment and continue on the next + if( std::abs(polyNormal.z) > 1e-5 ) + { + t = std::min(t, (nextBoundaryPoint - startingPoint).Length()); + } + + // check if the direction hits the loop start - if yes, we got a poly to output + IfcVector3 dirToThatPoint = proj * resultpoly.front() - startingPoint; + IfcFloat tpt = dirToThatPoint * dirAtPolyPlane; + if( tpt > -1e-6 && tpt <= t && (dirToThatPoint - tpt * dirAtPolyPlane).SquareLength() < 1e-10 ) + { + nextIntsecIdx = intersections.size(); // dirty hack to end marching along the boundary and signal the end of the loop + t = tpt; + } + + // also check if the direction hits any in->out intersections earlier. If we hit one, we can switch back + // to marching along the poly border from that intersection point + for( size_t a = 0; a < intersections.size(); a += 2 ) + { + dirToThatPoint = proj * std::get<1>(intersections[a]) - startingPoint; + tpt = dirToThatPoint * dirAtPolyPlane; + if( tpt > -1e-6 && tpt <= t && (dirToThatPoint - tpt * dirAtPolyPlane).SquareLength() < 1e-10 ) + { + nextIntsecIdx = a; // switch back to poly and march on from this in->out intersection + t = tpt; + } + } + + // if we keep marching on the boundary, put the segment end point to the result poly and well... keep marching + if( nextIntsecIdx == SIZE_MAX ) + { + resultpoly.push_back(proj_inv * nextBoundaryPoint); + currentBoundaryEdgeIdx = nextBoundaryEdgeIdx; + startingPoint = nextBoundaryPoint; + } + + // quick endless loop check + if( resultpoly.size() > blackside.size() + profile->mVerts.size() ) + { + IFCImporter::LogError("Encountered endless loop while clipping polygon against poly-bounded half space."); + break; + } + } + + // we're back on the poly - if this is the intersection we started from, we got a closed loop. + if( nextIntsecIdx >= intersections.size() ) + { + break; + } + + // otherwise it's another intersection. Continue marching from there. + currentIntersecIdx = nextIntsecIdx; + } + + WritePolygon(resultpoly, result); + } + } + } + IFCImporter::LogDebug("generating CSG geometry by plane clipping with polygonal bounding (IfcBooleanClippingResult)"); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedAreaSolid* as, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv) +{ + ai_assert(as != NULL); + + // This case is handled by reduction to an instance of the quadrify() algorithm. + // Obviously, this won't work for arbitrarily complex cases. In fact, the first + // operand should be near-planar. Luckily, this is usually the case in Ifc + // buildings. + + std::shared_ptr meshtmp = std::shared_ptr(new TempMesh()); + ProcessExtrudedAreaSolid(*as,*meshtmp,conv,false); + + std::vector openings(1, TempOpening(as,IfcVector3(0,0,0),meshtmp,std::shared_ptr())); + + result = first_operand; + + TempMesh temp; + + std::vector::const_iterator vit = first_operand.mVerts.begin(); + for(unsigned int pcount : first_operand.mVertcnt) { + temp.Clear(); + + temp.mVerts.insert(temp.mVerts.end(), vit, vit + pcount); + temp.mVertcnt.push_back(pcount); + + // The algorithms used to generate mesh geometry sometimes + // spit out lines or other degenerates which must be + // filtered to avoid running into assertions later on. + + // ComputePolygonNormal returns the Newell normal, so the + // length of the normal is the area of the polygon. + const IfcVector3& normal = temp.ComputeLastPolygonNormal(false); + if (normal.SquareLength() < static_cast(1e-5)) { + IFCImporter::LogWarn("skipping degenerate polygon (ProcessBooleanExtrudedAreaSolidDifference)"); + continue; + } + + GenerateOpenings(openings, std::vector(1,IfcVector3(1,0,0)), temp, false, true); + result.Append(temp); + + vit += pcount; + } + + IFCImporter::LogDebug("generating CSG geometry by geometric difference to a solid (IfcExtrudedAreaSolid)"); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessBoolean(const Schema_2x3::IfcBooleanResult& boolean, TempMesh& result, ConversionData& conv) +{ + // supported CSG operations: + // DIFFERENCE + if(const Schema_2x3::IfcBooleanResult* const clip = boolean.ToPtr()) { + if(clip->Operator != "DIFFERENCE") { + IFCImporter::LogWarn("encountered unsupported boolean operator: " + (std::string)clip->Operator); + return; + } + + // supported cases (1st operand): + // IfcBooleanResult -- call ProcessBoolean recursively + // IfcSweptAreaSolid -- obtain polygonal geometry first + + // supported cases (2nd operand): + // IfcHalfSpaceSolid -- easy, clip against plane + // IfcExtrudedAreaSolid -- reduce to an instance of the quadrify() algorithm + + + const Schema_2x3::IfcHalfSpaceSolid* const hs = clip->SecondOperand->ResolveSelectPtr(conv.db); + const Schema_2x3::IfcExtrudedAreaSolid* const as = clip->SecondOperand->ResolveSelectPtr(conv.db); + if(!hs && !as) { + IFCImporter::LogError("expected IfcHalfSpaceSolid or IfcExtrudedAreaSolid as second clipping operand"); + return; + } + + TempMesh first_operand; + if(const Schema_2x3::IfcBooleanResult* const op0 = clip->FirstOperand->ResolveSelectPtr(conv.db)) { + ProcessBoolean(*op0,first_operand,conv); + } + else if (const Schema_2x3::IfcSweptAreaSolid* const swept = clip->FirstOperand->ResolveSelectPtr(conv.db)) { + ProcessSweptAreaSolid(*swept,first_operand,conv); + } + else { + IFCImporter::LogError("expected IfcSweptAreaSolid or IfcBooleanResult as first clipping operand"); + return; + } + + if(hs) { + + const Schema_2x3::IfcPolygonalBoundedHalfSpace* const hs_bounded = clip->SecondOperand->ResolveSelectPtr(conv.db); + if (hs_bounded) { + ProcessPolygonalBoundedBooleanHalfSpaceDifference(hs_bounded, result, first_operand, conv); + } + else { + ProcessBooleanHalfSpaceDifference(hs, result, first_operand, conv); + } + } + else { + ProcessBooleanExtrudedAreaSolidDifference(as, result, first_operand, conv); + } + } + else { + IFCImporter::LogWarn("skipping unknown IfcBooleanResult entity, type is " + boolean.GetClassName()); + } +} + +} // ! IFC +} // ! Assimp + +#endif + diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCCurve.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCCurve.cpp new file mode 100644 index 000000000..a817b4f9f --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCCurve.cpp @@ -0,0 +1,616 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFCProfile.cpp + * @brief Read profile and curves entities from IFC files + */ + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER +#include "IFCUtil.h" + +namespace Assimp { +namespace IFC { +namespace { + + +// -------------------------------------------------------------------------------- +// Conic is the base class for Circle and Ellipse +// -------------------------------------------------------------------------------- +class Conic : public Curve { +public: + // -------------------------------------------------- + Conic(const Schema_2x3::IfcConic& entity, ConversionData& conv) + : Curve(entity,conv) { + IfcMatrix4 trafo; + ConvertAxisPlacement(trafo,*entity.Position,conv); + + // for convenience, extract the matrix rows + location = IfcVector3(trafo.a4,trafo.b4,trafo.c4); + p[0] = IfcVector3(trafo.a1,trafo.b1,trafo.c1); + p[1] = IfcVector3(trafo.a2,trafo.b2,trafo.c2); + p[2] = IfcVector3(trafo.a3,trafo.b3,trafo.c3); + } + + // -------------------------------------------------- + bool IsClosed() const { + return true; + } + + // -------------------------------------------------- + size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + + a *= conv.angle_scale; + b *= conv.angle_scale; + + a = std::fmod(a,static_cast( AI_MATH_TWO_PI )); + b = std::fmod(b,static_cast( AI_MATH_TWO_PI )); + const IfcFloat setting = static_cast( AI_MATH_PI * conv.settings.conicSamplingAngle / 180.0 ); + return static_cast( std::ceil(std::abs( b-a)) / setting); + } + + // -------------------------------------------------- + ParamRange GetParametricRange() const { + return std::make_pair(static_cast( 0. ), static_cast( AI_MATH_TWO_PI / conv.angle_scale )); + } + +protected: + IfcVector3 location, p[3]; +}; + +// -------------------------------------------------------------------------------- +// Circle +// -------------------------------------------------------------------------------- +class Circle : public Conic { +public: + // -------------------------------------------------- + Circle(const Schema_2x3::IfcCircle& entity, ConversionData& conv) + : Conic(entity,conv) + , entity(entity) + { + } + + // -------------------------------------------------- + IfcVector3 Eval(IfcFloat u) const { + u = -conv.angle_scale * u; + return location + static_cast(entity.Radius)*(static_cast(std::cos(u))*p[0] + + static_cast(std::sin(u))*p[1]); + } + +private: + const Schema_2x3::IfcCircle& entity; +}; + +// -------------------------------------------------------------------------------- +// Ellipse +// -------------------------------------------------------------------------------- +class Ellipse : public Conic { +public: + // -------------------------------------------------- + Ellipse(const Schema_2x3::IfcEllipse& entity, ConversionData& conv) + : Conic(entity,conv) + , entity(entity) { + // empty + } + + // -------------------------------------------------- + IfcVector3 Eval(IfcFloat u) const { + u = -conv.angle_scale * u; + return location + static_cast(entity.SemiAxis1)*static_cast(std::cos(u))*p[0] + + static_cast(entity.SemiAxis2)*static_cast(std::sin(u))*p[1]; + } + +private: + const Schema_2x3::IfcEllipse& entity; +}; + +// -------------------------------------------------------------------------------- +// Line +// -------------------------------------------------------------------------------- +class Line : public Curve { +public: + // -------------------------------------------------- + Line(const Schema_2x3::IfcLine& entity, ConversionData& conv) + : Curve(entity,conv) { + ConvertCartesianPoint(p,entity.Pnt); + ConvertVector(v,entity.Dir); + } + + // -------------------------------------------------- + bool IsClosed() const { + return false; + } + + // -------------------------------------------------- + IfcVector3 Eval(IfcFloat u) const { + return p + u*v; + } + + // -------------------------------------------------- + size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + // two points are always sufficient for a line segment + return a==b ? 1 : 2; + } + + + // -------------------------------------------------- + void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + + if (a == b) { + out.mVerts.push_back(Eval(a)); + return; + } + out.mVerts.reserve(out.mVerts.size()+2); + out.mVerts.push_back(Eval(a)); + out.mVerts.push_back(Eval(b)); + } + + // -------------------------------------------------- + ParamRange GetParametricRange() const { + const IfcFloat inf = std::numeric_limits::infinity(); + + return std::make_pair(-inf,+inf); + } + +private: + IfcVector3 p,v; +}; + +// -------------------------------------------------------------------------------- +// CompositeCurve joins multiple smaller, bounded curves +// -------------------------------------------------------------------------------- +class CompositeCurve : public BoundedCurve { + typedef std::pair< std::shared_ptr< BoundedCurve >, bool > CurveEntry; + +public: + // -------------------------------------------------- + CompositeCurve(const Schema_2x3::IfcCompositeCurve& entity, ConversionData& conv) + : BoundedCurve(entity,conv) + , total() { + curves.reserve(entity.Segments.size()); + for(const Schema_2x3::IfcCompositeCurveSegment& curveSegment :entity.Segments) { + // according to the specification, this must be a bounded curve + std::shared_ptr< Curve > cv(Curve::Convert(curveSegment.ParentCurve,conv)); + std::shared_ptr< BoundedCurve > bc = std::dynamic_pointer_cast(cv); + + if (!bc) { + IFCImporter::LogError("expected segment of composite curve to be a bounded curve"); + continue; + } + + if ( (std::string)curveSegment.Transition != "CONTINUOUS" ) { + IFCImporter::LogDebug("ignoring transition code on composite curve segment, only continuous transitions are supported"); + } + + curves.push_back( CurveEntry(bc,IsTrue(curveSegment.SameSense)) ); + total += bc->GetParametricRangeDelta(); + } + + if (curves.empty()) { + throw CurveError("empty composite curve"); + } + } + + // -------------------------------------------------- + IfcVector3 Eval(IfcFloat u) const { + if (curves.empty()) { + return IfcVector3(); + } + + IfcFloat acc = 0; + for(const CurveEntry& entry : curves) { + const ParamRange& range = entry.first->GetParametricRange(); + const IfcFloat delta = std::abs(range.second-range.first); + if (u < acc+delta) { + return entry.first->Eval( entry.second ? (u-acc) + range.first : range.second-(u-acc)); + } + + acc += delta; + } + // clamp to end + return curves.back().first->Eval(curves.back().first->GetParametricRange().second); + } + + // -------------------------------------------------- + size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + size_t cnt = 0; + + IfcFloat acc = 0; + for(const CurveEntry& entry : curves) { + const ParamRange& range = entry.first->GetParametricRange(); + const IfcFloat delta = std::abs(range.second-range.first); + if (a <= acc+delta && b >= acc) { + const IfcFloat at = std::max(static_cast( 0. ),a-acc), bt = std::min(delta,b-acc); + cnt += entry.first->EstimateSampleCount( entry.second ? at + range.first : range.second - bt, entry.second ? bt + range.first : range.second - at ); + } + + acc += delta; + } + + return cnt; + } + + // -------------------------------------------------- + void SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + + const size_t cnt = EstimateSampleCount(a,b); + out.mVerts.reserve(out.mVerts.size() + cnt); + + for(const CurveEntry& entry : curves) { + const size_t cnt = out.mVerts.size(); + entry.first->SampleDiscrete(out); + + if (!entry.second && cnt != out.mVerts.size()) { + std::reverse(out.mVerts.begin()+cnt,out.mVerts.end()); + } + } + } + + // -------------------------------------------------- + ParamRange GetParametricRange() const { + return std::make_pair(static_cast( 0. ),total); + } + +private: + std::vector< CurveEntry > curves; + IfcFloat total; +}; + +// -------------------------------------------------------------------------------- +// TrimmedCurve can be used to trim an unbounded curve to a bounded range +// -------------------------------------------------------------------------------- +class TrimmedCurve : public BoundedCurve { +public: + // -------------------------------------------------- + TrimmedCurve(const Schema_2x3::IfcTrimmedCurve& entity, ConversionData& conv) + : BoundedCurve(entity,conv), + base(std::shared_ptr(Curve::Convert(entity.BasisCurve,conv))) + { + typedef std::shared_ptr Entry; + + // for some reason, trimmed curves can either specify a parametric value + // or a point on the curve, or both. And they can even specify which of the + // two representations they prefer, even though an information invariant + // claims that they must be identical if both are present. + // oh well. + bool have_param = false, have_point = false; + IfcVector3 point; + for(const Entry sel :entity.Trim1) { + if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { + range.first = *r; + have_param = true; + break; + } + else if (const Schema_2x3::IfcCartesianPoint* const r = sel->ResolveSelectPtr(conv.db)) { + ConvertCartesianPoint(point,*r); + have_point = true; + } + } + if (!have_param) { + if (!have_point || !base->ReverseEval(point,range.first)) { + throw CurveError("IfcTrimmedCurve: failed to read first trim parameter, ignoring curve"); + } + } + have_param = false, have_point = false; + for(const Entry sel :entity.Trim2) { + if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { + range.second = *r; + have_param = true; + break; + } + else if (const Schema_2x3::IfcCartesianPoint* const r = sel->ResolveSelectPtr(conv.db)) { + ConvertCartesianPoint(point,*r); + have_point = true; + } + } + if (!have_param) { + if (!have_point || !base->ReverseEval(point,range.second)) { + throw CurveError("IfcTrimmedCurve: failed to read second trim parameter, ignoring curve"); + } + } + + agree_sense = IsTrue(entity.SenseAgreement); + if( !agree_sense ) { + std::swap(range.first,range.second); + } + + // "NOTE In case of a closed curve, it may be necessary to increment t1 or t2 + // by the parametric length for consistency with the sense flag." + if (base->IsClosed()) { + if( range.first > range.second ) { + range.second += base->GetParametricRangeDelta(); + } + } + + maxval = range.second-range.first; + ai_assert(maxval >= 0); + } + + // -------------------------------------------------- + IfcVector3 Eval(IfcFloat p) const { + ai_assert(InRange(p)); + return base->Eval( TrimParam(p) ); + } + + // -------------------------------------------------- + size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + return base->EstimateSampleCount(TrimParam(a),TrimParam(b)); + } + + // -------------------------------------------------- + void SampleDiscrete(TempMesh& out,IfcFloat a,IfcFloat b) const { + ai_assert(InRange(a) && InRange(b)); + return base->SampleDiscrete(out,TrimParam(a),TrimParam(b)); + } + + // -------------------------------------------------- + ParamRange GetParametricRange() const { + return std::make_pair(static_cast( 0. ),maxval); + } + +private: + // -------------------------------------------------- + IfcFloat TrimParam(IfcFloat f) const { + return agree_sense ? f + range.first : range.second - f; + } + +private: + ParamRange range; + IfcFloat maxval; + bool agree_sense; + + std::shared_ptr base; +}; + + +// -------------------------------------------------------------------------------- +// PolyLine is a 'curve' defined by linear interpolation over a set of discrete points +// -------------------------------------------------------------------------------- +class PolyLine : public BoundedCurve { +public: + // -------------------------------------------------- + PolyLine(const Schema_2x3::IfcPolyline& entity, ConversionData& conv) + : BoundedCurve(entity,conv) + { + points.reserve(entity.Points.size()); + + IfcVector3 t; + for(const Schema_2x3::IfcCartesianPoint& cp : entity.Points) { + ConvertCartesianPoint(t,cp); + points.push_back(t); + } + } + + // -------------------------------------------------- + IfcVector3 Eval(IfcFloat p) const { + ai_assert(InRange(p)); + + const size_t b = static_cast(std::floor(p)); + if (b == points.size()-1) { + return points.back(); + } + + const IfcFloat d = p-static_cast(b); + return points[b+1] * d + points[b] * (static_cast( 1. )-d); + } + + // -------------------------------------------------- + size_t EstimateSampleCount(IfcFloat a, IfcFloat b) const { + ai_assert(InRange(a) && InRange(b)); + return static_cast( std::ceil(b) - std::floor(a) ); + } + + // -------------------------------------------------- + ParamRange GetParametricRange() const { + return std::make_pair(static_cast( 0. ),static_cast(points.size()-1)); + } + +private: + std::vector points; +}; + +} // anon + +// ------------------------------------------------------------------------------------------------ +Curve* Curve::Convert(const IFC::Schema_2x3::IfcCurve& curve,ConversionData& conv) { + if(curve.ToPtr()) { + if(const Schema_2x3::IfcPolyline* c = curve.ToPtr()) { + return new PolyLine(*c,conv); + } + if(const Schema_2x3::IfcTrimmedCurve* c = curve.ToPtr()) { + return new TrimmedCurve(*c,conv); + } + if(const Schema_2x3::IfcCompositeCurve* c = curve.ToPtr()) { + return new CompositeCurve(*c,conv); + } + } + + if(curve.ToPtr()) { + if(const Schema_2x3::IfcCircle* c = curve.ToPtr()) { + return new Circle(*c,conv); + } + if(const Schema_2x3::IfcEllipse* c = curve.ToPtr()) { + return new Ellipse(*c,conv); + } + } + + if(const Schema_2x3::IfcLine* c = curve.ToPtr()) { + return new Line(*c,conv); + } + + // XXX OffsetCurve2D, OffsetCurve3D not currently supported + return NULL; +} + +#ifdef ASSIMP_BUILD_DEBUG +// ------------------------------------------------------------------------------------------------ +bool Curve::InRange(IfcFloat u) const { + const ParamRange range = GetParametricRange(); + if (IsClosed()) { + return true; + } + const IfcFloat epsilon = Math::getEpsilon(); + return u - range.first > -epsilon && range.second - u > -epsilon; +} +#endif + +// ------------------------------------------------------------------------------------------------ +IfcFloat Curve::GetParametricRangeDelta() const { + const ParamRange& range = GetParametricRange(); + return std::abs(range.second - range.first); +} + +// ------------------------------------------------------------------------------------------------ +size_t Curve::EstimateSampleCount(IfcFloat a, IfcFloat b) const { + (void)(a); (void)(b); + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + + // arbitrary default value, deriving classes should supply better suited values + return 16; +} + +// ------------------------------------------------------------------------------------------------ +IfcFloat RecursiveSearch(const Curve* cv, const IfcVector3& val, IfcFloat a, IfcFloat b, + unsigned int samples, IfcFloat threshold, unsigned int recurse = 0, unsigned int max_recurse = 15) { + ai_assert(samples>1); + + const IfcFloat delta = (b-a)/samples, inf = std::numeric_limits::infinity(); + IfcFloat min_point[2] = {a,b}, min_diff[2] = {inf,inf}; + IfcFloat runner = a; + + for (unsigned int i = 0; i < samples; ++i, runner += delta) { + const IfcFloat diff = (cv->Eval(runner)-val).SquareLength(); + if (diff < min_diff[0]) { + min_diff[1] = min_diff[0]; + min_point[1] = min_point[0]; + + min_diff[0] = diff; + min_point[0] = runner; + } + else if (diff < min_diff[1]) { + min_diff[1] = diff; + min_point[1] = runner; + } + } + + ai_assert( min_diff[ 0 ] != inf ); + ai_assert( min_diff[ 1 ] != inf ); + if ( std::fabs(a-min_point[0]) < threshold || recurse >= max_recurse) { + return min_point[0]; + } + + // fix for closed curves to take their wrap-over into account + if (cv->IsClosed() && std::fabs(min_point[0]-min_point[1]) > cv->GetParametricRangeDelta()*0.5 ) { + const Curve::ParamRange& range = cv->GetParametricRange(); + const IfcFloat wrapdiff = (cv->Eval(range.first)-val).SquareLength(); + + if (wrapdiff < min_diff[0]) { + const IfcFloat t = min_point[0]; + min_point[0] = min_point[1] > min_point[0] ? range.first : range.second; + min_point[1] = t; + } + } + + return RecursiveSearch(cv,val,min_point[0],min_point[1],samples,threshold,recurse+1,max_recurse); +} + +// ------------------------------------------------------------------------------------------------ +bool Curve::ReverseEval(const IfcVector3& val, IfcFloat& paramOut) const +{ + // note: the following algorithm is not guaranteed to find the 'right' parameter value + // in all possible cases, but it will always return at least some value so this function + // will never fail in the default implementation. + + // XXX derive threshold from curve topology + static const IfcFloat threshold = 1e-4f; + static const unsigned int samples = 16; + + const ParamRange& range = GetParametricRange(); + paramOut = RecursiveSearch(this,val,range.first,range.second,samples,threshold); + + return true; +} + +// ------------------------------------------------------------------------------------------------ +void Curve::SampleDiscrete(TempMesh& out,IfcFloat a, IfcFloat b) const { + ai_assert( InRange( a ) ); + ai_assert( InRange( b ) ); + + const size_t cnt = std::max(static_cast(0),EstimateSampleCount(a,b)); + out.mVerts.reserve( out.mVerts.size() + cnt + 1); + + IfcFloat p = a, delta = (b-a)/cnt; + for(size_t i = 0; i <= cnt; ++i, p += delta) { + out.mVerts.push_back(Eval(p)); + } +} + +// ------------------------------------------------------------------------------------------------ +bool BoundedCurve::IsClosed() const { + return false; +} + +// ------------------------------------------------------------------------------------------------ +void BoundedCurve::SampleDiscrete(TempMesh& out) const { + const ParamRange& range = GetParametricRange(); + ai_assert( range.first != std::numeric_limits::infinity() ); + ai_assert( range.second != std::numeric_limits::infinity() ); + + return SampleDiscrete(out,range.first,range.second); +} + +} // IFC +} // Assimp + +#endif // ASSIMP_BUILD_NO_IFC_IMPORTER diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCGeometry.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCGeometry.cpp new file mode 100644 index 000000000..d1c7aee19 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCGeometry.cpp @@ -0,0 +1,888 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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 IFCGeometry.cpp + * @brief Geometry conversion and synthesis for IFC + */ + + + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER +#include "IFCUtil.h" +#include "Common/PolyTools.h" +#include "PostProcessing/ProcessHelper.h" + +#ifdef ASSIMP_USE_HUNTER +# include +# include +#else +# include "../contrib/poly2tri/poly2tri/poly2tri.h" +# include "../contrib/clipper/clipper.hpp" +#endif + +#include +#include + +namespace Assimp { +namespace IFC { + +// ------------------------------------------------------------------------------------------------ +bool ProcessPolyloop(const Schema_2x3::IfcPolyLoop& loop, TempMesh& meshout, ConversionData& /*conv*/) +{ + size_t cnt = 0; + for(const Schema_2x3::IfcCartesianPoint& c : loop.Polygon) { + IfcVector3 tmp; + ConvertCartesianPoint(tmp,c); + + meshout.mVerts.push_back(tmp); + ++cnt; + } + + meshout.mVertcnt.push_back(static_cast(cnt)); + + // zero- or one- vertex polyloops simply ignored + if (meshout.mVertcnt.back() > 1) { + return true; + } + + if (meshout.mVertcnt.back()==1) { + meshout.mVertcnt.pop_back(); + meshout.mVerts.pop_back(); + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +void ProcessPolygonBoundaries(TempMesh& result, const TempMesh& inmesh, size_t master_bounds = (size_t)-1) +{ + // handle all trivial cases + if(inmesh.mVertcnt.empty()) { + return; + } + if(inmesh.mVertcnt.size() == 1) { + result.Append(inmesh); + return; + } + + ai_assert(std::count(inmesh.mVertcnt.begin(), inmesh.mVertcnt.end(), 0) == 0); + + typedef std::vector::const_iterator face_iter; + + face_iter begin = inmesh.mVertcnt.begin(), end = inmesh.mVertcnt.end(), iit; + std::vector::const_iterator outer_polygon_it = end; + + // major task here: given a list of nested polygon boundaries (one of which + // is the outer contour), reduce the triangulation task arising here to + // one that can be solved using the "quadrulation" algorithm which we use + // for pouring windows out of walls. The algorithm does not handle all + // cases but at least it is numerically stable and gives "nice" triangles. + + // first compute normals for all polygons using Newell's algorithm + // do not normalize 'normals', we need the original length for computing the polygon area + std::vector normals; + inmesh.ComputePolygonNormals(normals,false); + + // One of the polygons might be a IfcFaceOuterBound (in which case `master_bounds` + // is its index). Sadly we can't rely on it, the docs say 'At most one of the bounds + // shall be of the type IfcFaceOuterBound' + IfcFloat area_outer_polygon = 1e-10f; + if (master_bounds != (size_t)-1) { + ai_assert(master_bounds < inmesh.mVertcnt.size()); + outer_polygon_it = begin + master_bounds; + } + else { + for(iit = begin; iit != end; ++iit) { + // find the polygon with the largest area and take it as the outer bound. + IfcVector3& n = normals[std::distance(begin,iit)]; + const IfcFloat area = n.SquareLength(); + if (area > area_outer_polygon) { + area_outer_polygon = area; + outer_polygon_it = iit; + } + } + } + + ai_assert(outer_polygon_it != end); + + const size_t outer_polygon_size = *outer_polygon_it; + const IfcVector3& master_normal = normals[std::distance(begin, outer_polygon_it)]; + + // Generate fake openings to meet the interface for the quadrulate + // algorithm. It boils down to generating small boxes given the + // inner polygon and the surface normal of the outer contour. + // It is important that we use the outer contour's normal because + // this is the plane onto which the quadrulate algorithm will + // project the entire mesh. + std::vector fake_openings; + fake_openings.reserve(inmesh.mVertcnt.size()-1); + + std::vector::const_iterator vit = inmesh.mVerts.begin(), outer_vit; + + for(iit = begin; iit != end; vit += *iit++) { + if (iit == outer_polygon_it) { + outer_vit = vit; + continue; + } + + // Filter degenerate polygons to keep them from causing trouble later on + IfcVector3& n = normals[std::distance(begin,iit)]; + const IfcFloat area = n.SquareLength(); + if (area < 1e-5f) { + IFCImporter::LogWarn("skipping degenerate polygon (ProcessPolygonBoundaries)"); + continue; + } + + fake_openings.push_back(TempOpening()); + TempOpening& opening = fake_openings.back(); + + opening.extrusionDir = master_normal; + opening.solid = NULL; + + opening.profileMesh = std::make_shared(); + opening.profileMesh->mVerts.reserve(*iit); + opening.profileMesh->mVertcnt.push_back(*iit); + + std::copy(vit, vit + *iit, std::back_inserter(opening.profileMesh->mVerts)); + } + + // fill a mesh with ONLY the main polygon + TempMesh temp; + temp.mVerts.reserve(outer_polygon_size); + temp.mVertcnt.push_back(static_cast(outer_polygon_size)); + std::copy(outer_vit, outer_vit+outer_polygon_size, + std::back_inserter(temp.mVerts)); + + GenerateOpenings(fake_openings, normals, temp, false, false); + result.Append(temp); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessConnectedFaceSet(const Schema_2x3::IfcConnectedFaceSet& fset, TempMesh& result, ConversionData& conv) +{ + for(const Schema_2x3::IfcFace& face : fset.CfsFaces) { + // size_t ob = -1, cnt = 0; + TempMesh meshout; + for(const Schema_2x3::IfcFaceBound& bound : face.Bounds) { + + if(const Schema_2x3::IfcPolyLoop* const polyloop = bound.Bound->ToPtr()) { + if(ProcessPolyloop(*polyloop, meshout,conv)) { + + // The outer boundary is better determined by checking which + // polygon covers the largest area. + + //if(bound.ToPtr()) { + // ob = cnt; + //} + //++cnt; + + } + } + else { + IFCImporter::LogWarn("skipping unknown IfcFaceBound entity, type is " + bound.Bound->GetClassName()); + continue; + } + + // And this, even though it is sometimes TRUE and sometimes FALSE, + // does not really improve results. + + /*if(!IsTrue(bound.Orientation)) { + size_t c = 0; + for(unsigned int& c : meshout.vertcnt) { + std::reverse(result.verts.begin() + cnt,result.verts.begin() + cnt + c); + cnt += c; + } + }*/ + } + ProcessPolygonBoundaries(result, meshout); + } +} + +// ------------------------------------------------------------------------------------------------ +void ProcessRevolvedAreaSolid(const Schema_2x3::IfcRevolvedAreaSolid& solid, TempMesh& result, ConversionData& conv) +{ + TempMesh meshout; + + // first read the profile description + if(!ProcessProfile(*solid.SweptArea,meshout,conv) || meshout.mVerts.size()<=1) { + return; + } + + IfcVector3 axis, pos; + ConvertAxisPlacement(axis,pos,solid.Axis); + + IfcMatrix4 tb0,tb1; + IfcMatrix4::Translation(pos,tb0); + IfcMatrix4::Translation(-pos,tb1); + + const std::vector& in = meshout.mVerts; + const size_t size=in.size(); + + bool has_area = solid.SweptArea->ProfileType == "AREA" && size>2; + const IfcFloat max_angle = solid.Angle*conv.angle_scale; + if(std::fabs(max_angle) < 1e-3) { + if(has_area) { + result = meshout; + } + return; + } + + const unsigned int cnt_segments = std::max(2u,static_cast(conv.settings.cylindricalTessellation * std::fabs(max_angle)/AI_MATH_HALF_PI_F)); + const IfcFloat delta = max_angle/cnt_segments; + + has_area = has_area && std::fabs(max_angle) < AI_MATH_TWO_PI_F*0.99; + + result.mVerts.reserve(size*((cnt_segments+1)*4+(has_area?2:0))); + result.mVertcnt.reserve(size*cnt_segments+2); + + IfcMatrix4 rot; + rot = tb0 * IfcMatrix4::Rotation(delta,axis,rot) * tb1; + + size_t base = 0; + std::vector& out = result.mVerts; + + // dummy data to simplify later processing + for(size_t i = 0; i < size; ++i) { + out.insert(out.end(),4,in[i]); + } + + for(unsigned int seg = 0; seg < cnt_segments; ++seg) { + for(size_t i = 0; i < size; ++i) { + const size_t next = (i+1)%size; + + result.mVertcnt.push_back(4); + const IfcVector3 base_0 = out[base+i*4+3],base_1 = out[base+next*4+3]; + + out.push_back(base_0); + out.push_back(base_1); + out.push_back(rot*base_1); + out.push_back(rot*base_0); + } + base += size*4; + } + + out.erase(out.begin(),out.begin()+size*4); + + if(has_area) { + // leave the triangulation of the profile area to the ear cutting + // implementation in aiProcess_Triangulate - for now we just + // feed in two huge polygons. + base -= size*8; + for(size_t i = size; i--; ) { + out.push_back(out[base+i*4+3]); + } + for(size_t i = 0; i < size; ++i ) { + out.push_back(out[i*4]); + } + result.mVertcnt.push_back(static_cast(size)); + result.mVertcnt.push_back(static_cast(size)); + } + + IfcMatrix4 trafo; + ConvertAxisPlacement(trafo, solid.Position); + + result.Transform(trafo); + IFCImporter::LogDebug("generate mesh procedurally by radial extrusion (IfcRevolvedAreaSolid)"); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessSweptDiskSolid(const Schema_2x3::IfcSweptDiskSolid &solid, TempMesh& result, ConversionData& conv) +{ + const Curve* const curve = Curve::Convert(*solid.Directrix, conv); + if(!curve) { + IFCImporter::LogError("failed to convert Directrix curve (IfcSweptDiskSolid)"); + return; + } + + const unsigned int cnt_segments = conv.settings.cylindricalTessellation; + const IfcFloat deltaAngle = AI_MATH_TWO_PI/cnt_segments; + + TempMesh temp; + curve->SampleDiscrete(temp, solid.StartParam, solid.EndParam); + const std::vector& curve_points = temp.mVerts; + + const size_t samples = curve_points.size(); + + result.mVerts.reserve(cnt_segments * samples * 4); + result.mVertcnt.reserve((cnt_segments - 1) * samples); + + std::vector points; + points.reserve(cnt_segments * samples); + + if(curve_points.empty()) { + IFCImporter::LogWarn("curve evaluation yielded no points (IfcSweptDiskSolid)"); + return; + } + + IfcVector3 current = curve_points[0]; + IfcVector3 previous = current; + IfcVector3 next; + + IfcVector3 startvec; + startvec.x = 1.0f; + startvec.y = 1.0f; + startvec.z = 1.0f; + + unsigned int last_dir = 0; + + // generate circles at the sweep positions + for(size_t i = 0; i < samples; ++i) { + + if(i != samples - 1) { + next = curve_points[i + 1]; + } + + // get a direction vector reflecting the approximate curvature (i.e. tangent) + IfcVector3 d = (current-previous) + (next-previous); + + d.Normalize(); + + // figure out an arbitrary point q so that (p-q) * d = 0, + // try to maximize ||(p-q)|| * ||(p_last-q_last)|| + IfcVector3 q; + bool take_any = false; + + for (unsigned int i = 0; i < 2; ++i, take_any = true) { + if ((last_dir == 0 || take_any) && std::abs(d.x) > 1e-6) { + q.y = startvec.y; + q.z = startvec.z; + q.x = -(d.y * q.y + d.z * q.z) / d.x; + last_dir = 0; + break; + } + else if ((last_dir == 1 || take_any) && std::abs(d.y) > 1e-6) { + q.x = startvec.x; + q.z = startvec.z; + q.y = -(d.x * q.x + d.z * q.z) / d.y; + last_dir = 1; + break; + } + else if ((last_dir == 2 && std::abs(d.z) > 1e-6) || take_any) { + q.y = startvec.y; + q.x = startvec.x; + q.z = -(d.y * q.y + d.x * q.x) / d.z; + last_dir = 2; + break; + } + } + + q *= solid.Radius / q.Length(); + startvec = q; + + // generate a rotation matrix to rotate q around d + IfcMatrix4 rot; + IfcMatrix4::Rotation(deltaAngle,d,rot); + + for (unsigned int seg = 0; seg < cnt_segments; ++seg, q *= rot ) { + points.push_back(q + current); + } + + previous = current; + current = next; + } + + // make quads + for(size_t i = 0; i < samples - 1; ++i) { + + const aiVector3D& this_start = points[ i * cnt_segments ]; + + // locate corresponding point on next sample ring + unsigned int best_pair_offset = 0; + float best_distance_squared = 1e10f; + for (unsigned int seg = 0; seg < cnt_segments; ++seg) { + const aiVector3D& p = points[ (i+1) * cnt_segments + seg]; + const float l = (p-this_start).SquareLength(); + + if(l < best_distance_squared) { + best_pair_offset = seg; + best_distance_squared = l; + } + } + + for (unsigned int seg = 0; seg < cnt_segments; ++seg) { + + result.mVerts.push_back(points[ i * cnt_segments + (seg % cnt_segments)]); + result.mVerts.push_back(points[ i * cnt_segments + (seg + 1) % cnt_segments]); + result.mVerts.push_back(points[ (i+1) * cnt_segments + ((seg + 1 + best_pair_offset) % cnt_segments)]); + result.mVerts.push_back(points[ (i+1) * cnt_segments + ((seg + best_pair_offset) % cnt_segments)]); + + IfcVector3& v1 = *(result.mVerts.end()-1); + IfcVector3& v2 = *(result.mVerts.end()-2); + IfcVector3& v3 = *(result.mVerts.end()-3); + IfcVector3& v4 = *(result.mVerts.end()-4); + + if (((v4-v3) ^ (v4-v1)) * (v4 - curve_points[i]) < 0.0f) { + std::swap(v4, v1); + std::swap(v3, v2); + } + + result.mVertcnt.push_back(4); + } + } + + IFCImporter::LogDebug("generate mesh procedurally by sweeping a disk along a curve (IfcSweptDiskSolid)"); +} + +// ------------------------------------------------------------------------------------------------ +IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVector3& norOut) +{ + const std::vector& out = curmesh.mVerts; + IfcMatrix3 m; + + ok = true; + + // The input "mesh" must be a single polygon + const size_t s = out.size(); + ai_assert( curmesh.mVertcnt.size() == 1 ); + ai_assert( curmesh.mVertcnt.back() == s); + + const IfcVector3 any_point = out[s-1]; + IfcVector3 nor; + + // The input polygon is arbitrarily shaped, therefore we might need some tries + // until we find a suitable normal. Note that Newell's algorithm would give + // a more robust result, but this variant also gives us a suitable first + // axis for the 2D coordinate space on the polygon plane, exploiting the + // fact that the input polygon is nearly always a quad. + bool done = false; + size_t idx( 0 ); + for (size_t i = 0; !done && i < s-2; done || ++i) { + idx = i; + for (size_t j = i+1; j < s-1; ++j) { + nor = -((out[i]-any_point)^(out[j]-any_point)); + if(std::fabs(nor.Length()) > 1e-8f) { + done = true; + break; + } + } + } + + if(!done) { + ok = false; + return m; + } + + nor.Normalize(); + norOut = nor; + + IfcVector3 r = (out[idx]-any_point); + r.Normalize(); + + //if(d) { + // *d = -any_point * nor; + //} + + // Reconstruct orthonormal basis + // XXX use Gram Schmidt for increased robustness + IfcVector3 u = r ^ nor; + u.Normalize(); + + m.a1 = r.x; + m.a2 = r.y; + m.a3 = r.z; + + m.b1 = u.x; + m.b2 = u.y; + m.b3 = u.z; + + m.c1 = -nor.x; + m.c2 = -nor.y; + m.c3 = -nor.z; + + return m; +} + +// Extrudes the given polygon along the direction, converts it into an opening or applies all openings as necessary. +void ProcessExtrudedArea(const Schema_2x3::IfcExtrudedAreaSolid& solid, const TempMesh& curve, + const IfcVector3& extrusionDir, TempMesh& result, ConversionData &conv, bool collect_openings) +{ + // Outline: 'curve' is now a list of vertex points forming the underlying profile, extrude along the given axis, + // forming new triangles. + const bool has_area = solid.SweptArea->ProfileType == "AREA" && curve.mVerts.size() > 2; + if( solid.Depth < 1e-6 ) { + if( has_area ) { + result.Append(curve); + } + return; + } + + result.mVerts.reserve(curve.mVerts.size()*(has_area ? 4 : 2)); + result.mVertcnt.reserve(curve.mVerts.size() + 2); + std::vector in = curve.mVerts; + + // First step: transform all vertices into the target coordinate space + IfcMatrix4 trafo; + ConvertAxisPlacement(trafo, solid.Position); + + IfcVector3 vmin, vmax; + MinMaxChooser()(vmin, vmax); + for(IfcVector3& v : in) { + v *= trafo; + + vmin = std::min(vmin, v); + vmax = std::max(vmax, v); + } + + vmax -= vmin; + const IfcFloat diag = vmax.Length(); + IfcVector3 dir = IfcMatrix3(trafo) * extrusionDir; + + // reverse profile polygon if it's winded in the wrong direction in relation to the extrusion direction + IfcVector3 profileNormal = TempMesh::ComputePolygonNormal(in.data(), in.size()); + if( profileNormal * dir < 0.0 ) + std::reverse(in.begin(), in.end()); + + std::vector nors; + const bool openings = !!conv.apply_openings && conv.apply_openings->size(); + + // Compute the normal vectors for all opening polygons as a prerequisite + // to TryAddOpenings_Poly2Tri() + // XXX this belongs into the aforementioned function + if( openings ) { + + if( !conv.settings.useCustomTriangulation ) { + // it is essential to apply the openings in the correct spatial order. The direction + // doesn't matter, but we would screw up if we started with e.g. a door in between + // two windows. + std::sort(conv.apply_openings->begin(), conv.apply_openings->end(), TempOpening::DistanceSorter(in[0])); + } + + nors.reserve(conv.apply_openings->size()); + for(TempOpening& t : *conv.apply_openings) { + TempMesh& bounds = *t.profileMesh.get(); + + if( bounds.mVerts.size() <= 2 ) { + nors.push_back(IfcVector3()); + continue; + } + nors.push_back(((bounds.mVerts[2] - bounds.mVerts[0]) ^ (bounds.mVerts[1] - bounds.mVerts[0])).Normalize()); + } + } + + + TempMesh temp; + TempMesh& curmesh = openings ? temp : result; + std::vector& out = curmesh.mVerts; + + size_t sides_with_openings = 0; + for( size_t i = 0; i < in.size(); ++i ) { + const size_t next = (i + 1) % in.size(); + + curmesh.mVertcnt.push_back(4); + + out.push_back(in[i]); + out.push_back(in[next]); + out.push_back(in[next] + dir); + out.push_back(in[i] + dir); + + if( openings ) { + if( (in[i] - in[next]).Length() > diag * 0.1 && GenerateOpenings(*conv.apply_openings, nors, temp, true, true, dir) ) { + ++sides_with_openings; + } + + result.Append(temp); + temp.Clear(); + } + } + + if( openings ) { + for(TempOpening& opening : *conv.apply_openings) { + if( !opening.wallPoints.empty() ) { + IFCImporter::LogError("failed to generate all window caps"); + } + opening.wallPoints.clear(); + } + } + + size_t sides_with_v_openings = 0; + if( has_area ) { + + for( size_t n = 0; n < 2; ++n ) { + if( n > 0 ) { + for( size_t i = 0; i < in.size(); ++i ) + out.push_back(in[i] + dir); + } + else { + for( size_t i = in.size(); i--; ) + out.push_back(in[i]); + } + + curmesh.mVertcnt.push_back(static_cast(in.size())); + if( openings && in.size() > 2 ) { + if( GenerateOpenings(*conv.apply_openings, nors, temp, true, true, dir) ) { + ++sides_with_v_openings; + } + + result.Append(temp); + temp.Clear(); + } + } + } + + if( openings && ((sides_with_openings == 1 && sides_with_openings) || (sides_with_v_openings == 2 && sides_with_v_openings)) ) { + IFCImporter::LogWarn("failed to resolve all openings, presumably their topology is not supported by Assimp"); + } + + IFCImporter::LogDebug("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. + if( collect_openings && !result.IsEmpty() ) { + ai_assert(conv.collect_openings); + std::shared_ptr profile = std::shared_ptr(new TempMesh()); + profile->Swap(result); + + std::shared_ptr profile2D = std::shared_ptr(new TempMesh()); + profile2D->mVerts.insert(profile2D->mVerts.end(), in.begin(), in.end()); + profile2D->mVertcnt.push_back(static_cast(in.size())); + conv.collect_openings->push_back(TempOpening(&solid, dir, profile, profile2D)); + + ai_assert(result.IsEmpty()); + } +} + +// ------------------------------------------------------------------------------------------------ +void ProcessExtrudedAreaSolid(const Schema_2x3::IfcExtrudedAreaSolid& solid, TempMesh& result, + ConversionData& conv, bool collect_openings) +{ + TempMesh meshout; + + // First read the profile description. + if(!ProcessProfile(*solid.SweptArea,meshout,conv) || meshout.mVerts.size()<=1) { + return; + } + + IfcVector3 dir; + ConvertDirection(dir,solid.ExtrudedDirection); + dir *= solid.Depth; + + // Some profiles bring their own holes, for which we need to provide a container. This all is somewhat backwards, + // and there's still so many corner cases uncovered - we really need a generic solution to all of this hole carving. + std::vector fisherPriceMyFirstOpenings; + std::vector* oldApplyOpenings = conv.apply_openings; + if( const Schema_2x3::IfcArbitraryProfileDefWithVoids* const cprofile = solid.SweptArea->ToPtr() ) { + if( !cprofile->InnerCurves.empty() ) { + // read all inner curves and extrude them to form proper openings. + std::vector* oldCollectOpenings = conv.collect_openings; + conv.collect_openings = &fisherPriceMyFirstOpenings; + + for (const Schema_2x3::IfcCurve* curve : cprofile->InnerCurves) { + TempMesh curveMesh, tempMesh; + ProcessCurve(*curve, curveMesh, conv); + ProcessExtrudedArea(solid, curveMesh, dir, tempMesh, conv, true); + } + // and then apply those to the geometry we're about to generate + conv.apply_openings = conv.collect_openings; + conv.collect_openings = oldCollectOpenings; + } + } + + ProcessExtrudedArea(solid, meshout, dir, result, conv, collect_openings); + conv.apply_openings = oldApplyOpenings; +} + +// ------------------------------------------------------------------------------------------------ +void ProcessSweptAreaSolid(const Schema_2x3::IfcSweptAreaSolid& swept, TempMesh& meshout, + ConversionData& conv) +{ + if(const Schema_2x3::IfcExtrudedAreaSolid* const solid = swept.ToPtr()) { + ProcessExtrudedAreaSolid(*solid,meshout,conv, !!conv.collect_openings); + } + else if(const Schema_2x3::IfcRevolvedAreaSolid* const rev = swept.ToPtr()) { + ProcessRevolvedAreaSolid(*rev,meshout,conv); + } + else { + IFCImporter::LogWarn("skipping unknown IfcSweptAreaSolid entity, type is " + swept.GetClassName()); + } +} + +// ------------------------------------------------------------------------------------------------ +bool ProcessGeometricItem(const Schema_2x3::IfcRepresentationItem& geo, unsigned int matid, std::set& mesh_indices, + ConversionData& conv) +{ + bool fix_orientation = false; + std::shared_ptr< TempMesh > meshtmp = std::make_shared(); + if(const Schema_2x3::IfcShellBasedSurfaceModel* shellmod = geo.ToPtr()) { + for(std::shared_ptr shell :shellmod->SbsmBoundary) { + try { + const ::Assimp::STEP::EXPRESS::ENTITY& e = shell->To<::Assimp::STEP::EXPRESS::ENTITY>(); + const Schema_2x3::IfcConnectedFaceSet& fs = conv.db.MustGetObject(e).To(); + + ProcessConnectedFaceSet(fs,*meshtmp.get(),conv); + } + catch(std::bad_cast&) { + IFCImporter::LogWarn("unexpected type error, IfcShell ought to inherit from IfcConnectedFaceSet"); + } + } + fix_orientation = true; + } + else if(const Schema_2x3::IfcConnectedFaceSet* fset = geo.ToPtr()) { + ProcessConnectedFaceSet(*fset,*meshtmp.get(),conv); + fix_orientation = true; + } + else if(const Schema_2x3::IfcSweptAreaSolid* swept = geo.ToPtr()) { + ProcessSweptAreaSolid(*swept,*meshtmp.get(),conv); + } + else if(const Schema_2x3::IfcSweptDiskSolid* disk = geo.ToPtr()) { + ProcessSweptDiskSolid(*disk,*meshtmp.get(),conv); + } + else if(const Schema_2x3::IfcManifoldSolidBrep* brep = geo.ToPtr()) { + ProcessConnectedFaceSet(brep->Outer,*meshtmp.get(),conv); + fix_orientation = true; + } + else if(const Schema_2x3::IfcFaceBasedSurfaceModel* surf = geo.ToPtr()) { + for(const Schema_2x3::IfcConnectedFaceSet& fc : surf->FbsmFaces) { + ProcessConnectedFaceSet(fc,*meshtmp.get(),conv); + } + fix_orientation = true; + } + else if(const Schema_2x3::IfcBooleanResult* boolean = geo.ToPtr()) { + ProcessBoolean(*boolean,*meshtmp.get(),conv); + } + else if(geo.ToPtr()) { + // silently skip over bounding boxes + return false; + } + else { + IFCImporter::LogWarn("skipping unknown IfcGeometricRepresentationItem entity, type is " + geo.GetClassName()); + return false; + } + + // Do we just collect openings for a parent element (i.e. a wall)? + // In such a case, we generate the polygonal mesh as usual, + // but attach it to a TempOpening instance which will later be applied + // to the wall it pertains to. + + // Note: swep area solids are added in ProcessExtrudedAreaSolid(), + // which returns an empty mesh. + if(conv.collect_openings) { + if (!meshtmp->IsEmpty()) { + conv.collect_openings->push_back(TempOpening(geo.ToPtr(), + IfcVector3(0,0,0), + meshtmp, + std::shared_ptr())); + } + return true; + } + + if (meshtmp->IsEmpty()) { + return false; + } + + meshtmp->RemoveAdjacentDuplicates(); + meshtmp->RemoveDegenerates(); + + if(fix_orientation) { +// meshtmp->FixupFaceOrientation(); + } + + aiMesh* const mesh = meshtmp->ToMesh(); + if(mesh) { + mesh->mMaterialIndex = matid; + mesh_indices.insert(static_cast(conv.meshes.size())); + conv.meshes.push_back(mesh); + return true; + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +void AssignAddedMeshes(std::set& mesh_indices,aiNode* nd, + ConversionData& /*conv*/) +{ + if (!mesh_indices.empty()) { + std::set::const_iterator it = mesh_indices.cbegin(); + std::set::const_iterator end = mesh_indices.cend(); + + nd->mNumMeshes = static_cast(mesh_indices.size()); + + nd->mMeshes = new unsigned int[nd->mNumMeshes]; + for(unsigned int i = 0; it != end && i < nd->mNumMeshes; ++i, ++it) { + nd->mMeshes[i] = *it; + } + } +} + +// ------------------------------------------------------------------------------------------------ +bool TryQueryMeshCache(const Schema_2x3::IfcRepresentationItem& item, + std::set& mesh_indices, unsigned int mat_index, + ConversionData& conv) +{ + ConversionData::MeshCacheIndex idx(&item, mat_index); + ConversionData::MeshCache::const_iterator it = conv.cached_meshes.find(idx); + if (it != conv.cached_meshes.end()) { + std::copy((*it).second.begin(),(*it).second.end(),std::inserter(mesh_indices, mesh_indices.end())); + return true; + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +void PopulateMeshCache(const Schema_2x3::IfcRepresentationItem& item, + const std::set& mesh_indices, unsigned int mat_index, + ConversionData& conv) +{ + ConversionData::MeshCacheIndex idx(&item, mat_index); + conv.cached_meshes[idx] = mesh_indices; +} + +// ------------------------------------------------------------------------------------------------ +bool ProcessRepresentationItem(const Schema_2x3::IfcRepresentationItem& item, unsigned int matid, + std::set& mesh_indices, + ConversionData& conv) +{ + // determine material + unsigned int localmatid = ProcessMaterials(item.GetID(), matid, conv, true); + + if (!TryQueryMeshCache(item,mesh_indices,localmatid,conv)) { + if(ProcessGeometricItem(item,localmatid,mesh_indices,conv)) { + if(mesh_indices.size()) { + PopulateMeshCache(item,mesh_indices,localmatid,conv); + } + } + else return false; + } + return true; +} + + +} // ! IFC +} // ! Assimp + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCLoader.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCLoader.cpp new file mode 100644 index 000000000..5c705c256 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCLoader.cpp @@ -0,0 +1,988 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFCLoad.cpp + * @brief Implementation of the Industry Foundation Classes loader. + */ + + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include +#include +#include + +#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC +# ifdef ASSIMP_USE_HUNTER +# include +# else +# include +# endif +#endif + +#include "IFCLoader.h" +#include "../STEPParser/STEPFileReader.h" + +#include "IFCUtil.h" + +#include +#include +#include +#include + + +namespace Assimp { + template<> const char* LogFunctions::Prefix() + { + static auto prefix = "IFC: "; + return prefix; + } +} + +using namespace Assimp; +using namespace Assimp::Formatter; +using namespace Assimp::IFC; + +/* DO NOT REMOVE this comment block. The genentitylist.sh script + * just looks for names adhering to the IfcSomething naming scheme + * and includes all matches in the whitelist for code-generation. Thus, + * all entity classes that are only indirectly referenced need to be + * mentioned explicitly. + + IfcRepresentationMap + IfcProductRepresentation + IfcUnitAssignment + IfcClosedShell + IfcDoor + + */ + +namespace { + + +// forward declarations +void SetUnits(ConversionData& conv); +void SetCoordinateSpace(ConversionData& conv); +void ProcessSpatialStructures(ConversionData& conv); +void MakeTreeRelative(ConversionData& conv); +void ConvertUnit(const ::Assimp::STEP::EXPRESS::DataType& dt,ConversionData& conv); + +} // anon + +static const aiImporterDesc desc = { + "Industry Foundation Classes (IFC) Importer", + "", + "", + "", + aiImporterFlags_SupportBinaryFlavour, + 0, + 0, + 0, + 0, + "ifc ifczip stp" +}; + + +// ------------------------------------------------------------------------------------------------ +// Constructor to be privately used by Importer +IFCImporter::IFCImporter() +{} + +// ------------------------------------------------------------------------------------------------ +// Destructor, private as well +IFCImporter::~IFCImporter() +{ +} + +// ------------------------------------------------------------------------------------------------ +// Returns whether the class can handle the format of the given file. +bool IFCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const +{ + const std::string& extension = GetExtension(pFile); + if (extension == "ifc" || extension == "ifczip" ) { + return true; + } else if ((!extension.length() || checkSig) && pIOHandler) { + // note: this is the common identification for STEP-encoded files, so + // it is only unambiguous as long as we don't support any further + // file formats with STEP as their encoding. + const char* tokens[] = {"ISO-10303-21"}; + const bool found( SearchFileHeaderForToken( pIOHandler, pFile, tokens, 1 ) ); + return found; + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +// List all extensions handled by this loader +const aiImporterDesc* IFCImporter::GetInfo () const +{ + return &desc; +} + +// ------------------------------------------------------------------------------------------------ +// Setup configuration properties for the loader +void IFCImporter::SetupProperties(const Importer* pImp) +{ + settings.skipSpaceRepresentations = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_SKIP_SPACE_REPRESENTATIONS,true); + settings.useCustomTriangulation = pImp->GetPropertyBool(AI_CONFIG_IMPORT_IFC_CUSTOM_TRIANGULATION,true); + settings.conicSamplingAngle = std::min(std::max((float) pImp->GetPropertyFloat(AI_CONFIG_IMPORT_IFC_SMOOTHING_ANGLE, AI_IMPORT_IFC_DEFAULT_SMOOTHING_ANGLE), 5.0f), 120.0f); + settings.cylindricalTessellation = std::min(std::max(pImp->GetPropertyInteger(AI_CONFIG_IMPORT_IFC_CYLINDRICAL_TESSELLATION, AI_IMPORT_IFC_DEFAULT_CYLINDRICAL_TESSELLATION), 3), 180); + settings.skipAnnotations = true; +} + + +// ------------------------------------------------------------------------------------------------ +// Imports the given file into the given scene structure. +void IFCImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) +{ + std::shared_ptr stream(pIOHandler->Open(pFile)); + if (!stream) { + ThrowException("Could not open file for reading"); + } + + + // if this is a ifczip file, decompress its contents first + if(GetExtension(pFile) == "ifczip") { +#ifndef ASSIMP_BUILD_NO_COMPRESSED_IFC + unzFile zip = unzOpen( pFile.c_str() ); + if(zip == NULL) { + ThrowException("Could not open ifczip file for reading, unzip failed"); + } + + // chop 'zip' postfix + std::string fileName = pFile.substr(0,pFile.length() - 3); + + std::string::size_type s = pFile.find_last_of('\\'); + if(s == std::string::npos) { + s = pFile.find_last_of('/'); + } + if(s != std::string::npos) { + fileName = fileName.substr(s+1); + } + + // search file (same name as the IFCZIP except for the file extension) and place file pointer there + if(UNZ_OK == unzGoToFirstFile(zip)) { + do { + // get file size, etc. + unz_file_info fileInfo; + char filename[256]; + unzGetCurrentFileInfo( zip , &fileInfo, filename, sizeof(filename), 0, 0, 0, 0 ); + if (GetExtension(filename) != "ifc") { + continue; + } + uint8_t* buff = new uint8_t[fileInfo.uncompressed_size]; + LogInfo("Decompressing IFCZIP file"); + unzOpenCurrentFile(zip); + size_t total = 0; + int read = 0; + do { + int bufferSize = fileInfo.uncompressed_size < INT16_MAX ? fileInfo.uncompressed_size : INT16_MAX; + void* buffer = malloc(bufferSize); + read = unzReadCurrentFile(zip, buffer, bufferSize); + if (read > 0) { + memcpy((char*)buff + total, buffer, read); + total += read; + } + free(buffer); + } while (read > 0); + size_t filesize = fileInfo.uncompressed_size; + if (total == 0 || size_t(total) != filesize) + { + delete[] buff; + ThrowException("Failed to decompress IFC ZIP file"); + } + unzCloseCurrentFile( zip ); + stream.reset(new MemoryIOStream(buff,fileInfo.uncompressed_size,true)); + break; + + if (unzGoToNextFile(zip) == UNZ_END_OF_LIST_OF_FILE) { + ThrowException("Found no IFC file member in IFCZIP file (1)"); + } + + } while(true); + } + else { + ThrowException("Found no IFC file member in IFCZIP file (2)"); + } + + unzClose(zip); +#else + ThrowException("Could not open ifczip file for reading, assimp was built without ifczip support"); +#endif + } + + std::unique_ptr db(STEP::ReadFileHeader(stream)); + const STEP::HeaderInfo& head = static_cast(*db).GetHeader(); + + if(!head.fileSchema.size() || head.fileSchema.substr(0,3) != "IFC") { + ThrowException("Unrecognized file schema: " + head.fileSchema); + } + + if (!DefaultLogger::isNullLogger()) { + LogDebug("File schema is \'" + head.fileSchema + '\''); + if (head.timestamp.length()) { + LogDebug("Timestamp \'" + head.timestamp + '\''); + } + if (head.app.length()) { + LogDebug("Application/Exporter identline is \'" + head.app + '\''); + } + } + + // obtain a copy of the machine-generated IFC scheme + ::Assimp::STEP::EXPRESS::ConversionSchema schema; + Schema_2x3::GetSchema(schema); + + // tell the reader which entity types to track with special care + static const char* const types_to_track[] = { + "ifcsite", "ifcbuilding", "ifcproject" + }; + + // tell the reader for which types we need to simulate STEPs reverse indices + static const char* const inverse_indices_to_track[] = { + "ifcrelcontainedinspatialstructure", "ifcrelaggregates", "ifcrelvoidselement", "ifcreldefinesbyproperties", "ifcpropertyset", "ifcstyleditem" + }; + + // feed the IFC schema into the reader and pre-parse all lines + STEP::ReadFile(*db, schema, types_to_track, inverse_indices_to_track); + const STEP::LazyObject* proj = db->GetObject("ifcproject"); + if (!proj) { + ThrowException("missing IfcProject entity"); + } + + ConversionData conv(*db,proj->To(),pScene,settings); + SetUnits(conv); + SetCoordinateSpace(conv); + ProcessSpatialStructures(conv); + MakeTreeRelative(conv); + + // NOTE - this is a stress test for the importer, but it works only + // in a build with no entities disabled. See + // scripts/IFCImporter/CPPGenerator.py + // for more information. + #ifdef ASSIMP_IFC_TEST + db->EvaluateAll(); + #endif + + // do final data copying + if (conv.meshes.size()) { + pScene->mNumMeshes = static_cast(conv.meshes.size()); + pScene->mMeshes = new aiMesh*[pScene->mNumMeshes](); + std::copy(conv.meshes.begin(),conv.meshes.end(),pScene->mMeshes); + + // needed to keep the d'tor from burning us + conv.meshes.clear(); + } + + if (conv.materials.size()) { + pScene->mNumMaterials = static_cast(conv.materials.size()); + pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials](); + std::copy(conv.materials.begin(),conv.materials.end(),pScene->mMaterials); + + // needed to keep the d'tor from burning us + conv.materials.clear(); + } + + // apply world coordinate system (which includes the scaling to convert to meters and a -90 degrees rotation around x) + aiMatrix4x4 scale, rot; + aiMatrix4x4::Scaling(static_cast(IfcVector3(conv.len_scale)),scale); + aiMatrix4x4::RotationX(-AI_MATH_HALF_PI_F,rot); + + pScene->mRootNode->mTransformation = rot * scale * conv.wcs * pScene->mRootNode->mTransformation; + + // this must be last because objects are evaluated lazily as we process them + if ( !DefaultLogger::isNullLogger() ){ + LogDebug((Formatter::format(),"STEP: evaluated ",db->GetEvaluatedObjectCount()," object records")); + } +} + +namespace { + + +// ------------------------------------------------------------------------------------------------ +void ConvertUnit(const Schema_2x3::IfcNamedUnit& unit,ConversionData& conv) +{ + if(const Schema_2x3::IfcSIUnit* const si = unit.ToPtr()) { + if(si->UnitType == "LENGTHUNIT") { + conv.len_scale = si->Prefix ? ConvertSIPrefix(si->Prefix) : 1.f; + IFCImporter::LogDebug("got units used for lengths"); + } + if(si->UnitType == "PLANEANGLEUNIT") { + if (si->Name != "RADIAN") { + IFCImporter::LogWarn("expected base unit for angles to be radian"); + } + } + } + else if(const Schema_2x3::IfcConversionBasedUnit* const convu = unit.ToPtr()) { + if(convu->UnitType == "PLANEANGLEUNIT") { + try { + conv.angle_scale = convu->ConversionFactor->ValueComponent->To<::Assimp::STEP::EXPRESS::REAL>(); + ConvertUnit(*convu->ConversionFactor->UnitComponent,conv); + IFCImporter::LogDebug("got units used for angles"); + } + catch(std::bad_cast&) { + IFCImporter::LogError("skipping unknown IfcConversionBasedUnit.ValueComponent entry - expected REAL"); + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +void ConvertUnit(const ::Assimp::STEP::EXPRESS::DataType& dt,ConversionData& conv) +{ + try { + const ::Assimp::STEP::EXPRESS::ENTITY& e = dt.To<::Assimp::STEP::EXPRESS::ENTITY>(); + + const Schema_2x3::IfcNamedUnit& unit = e.ResolveSelect(conv.db); + if(unit.UnitType != "LENGTHUNIT" && unit.UnitType != "PLANEANGLEUNIT") { + return; + } + + ConvertUnit(unit,conv); + } + catch(std::bad_cast&) { + // not entity, somehow + IFCImporter::LogError("skipping unknown IfcUnit entry - expected entity"); + } +} + +// ------------------------------------------------------------------------------------------------ +void SetUnits(ConversionData& conv) +{ + // see if we can determine the coordinate space used to express. + for(size_t i = 0; i < conv.proj.UnitsInContext->Units.size(); ++i ) { + ConvertUnit(*conv.proj.UnitsInContext->Units[i],conv); + } +} + + +// ------------------------------------------------------------------------------------------------ +void SetCoordinateSpace(ConversionData& conv) +{ + const Schema_2x3::IfcRepresentationContext* fav = NULL; + for(const Schema_2x3::IfcRepresentationContext& v : conv.proj.RepresentationContexts) { + fav = &v; + // Model should be the most suitable type of context, hence ignore the others + if (v.ContextType && v.ContextType.Get() == "Model") { + break; + } + } + if (fav) { + if(const Schema_2x3::IfcGeometricRepresentationContext* const geo = fav->ToPtr()) { + ConvertAxisPlacement(conv.wcs, *geo->WorldCoordinateSystem, conv); + IFCImporter::LogDebug("got world coordinate system"); + } + } +} + + +// ------------------------------------------------------------------------------------------------ +void ResolveObjectPlacement(aiMatrix4x4& m, const Schema_2x3::IfcObjectPlacement& place, ConversionData& conv) +{ + if (const Schema_2x3::IfcLocalPlacement* const local = place.ToPtr()){ + IfcMatrix4 tmp; + ConvertAxisPlacement(tmp, *local->RelativePlacement, conv); + + m = static_cast(tmp); + + if (local->PlacementRelTo) { + aiMatrix4x4 tmp; + ResolveObjectPlacement(tmp,local->PlacementRelTo.Get(),conv); + m = tmp * m; + } + } + else { + IFCImporter::LogWarn("skipping unknown IfcObjectPlacement entity, type is " + place.GetClassName()); + } +} + +// ------------------------------------------------------------------------------------------------ +bool ProcessMappedItem(const Schema_2x3::IfcMappedItem& mapped, aiNode* nd_src, std::vector< aiNode* >& subnodes_src, unsigned int matid, ConversionData& conv) +{ + // insert a custom node here, the carthesian transform operator is simply a conventional transformation matrix + std::unique_ptr nd(new aiNode()); + nd->mName.Set("IfcMappedItem"); + + // handle the Cartesian operator + IfcMatrix4 m; + ConvertTransformOperator(m, *mapped.MappingTarget); + + IfcMatrix4 msrc; + ConvertAxisPlacement(msrc,*mapped.MappingSource->MappingOrigin,conv); + + msrc = m*msrc; + + std::set meshes; + const size_t old_openings = conv.collect_openings ? conv.collect_openings->size() : 0; + if (conv.apply_openings) { + IfcMatrix4 minv = msrc; + minv.Inverse(); + for(TempOpening& open :*conv.apply_openings){ + open.Transform(minv); + } + } + + unsigned int localmatid = ProcessMaterials(mapped.GetID(),matid,conv,false); + const Schema_2x3::IfcRepresentation& repr = mapped.MappingSource->MappedRepresentation; + + bool got = false; + for(const Schema_2x3::IfcRepresentationItem& item : repr.Items) { + if(!ProcessRepresentationItem(item,localmatid,meshes,conv)) { + IFCImporter::LogWarn("skipping mapped entity of type " + item.GetClassName() + ", no representations could be generated"); + } + else got = true; + } + + if (!got) { + return false; + } + + AssignAddedMeshes(meshes,nd.get(),conv); + if (conv.collect_openings) { + + // if this pass serves us only to collect opening geometry, + // make sure we transform the TempMesh's which we need to + // preserve as well. + if(const size_t diff = conv.collect_openings->size() - old_openings) { + for(size_t i = 0; i < diff; ++i) { + (*conv.collect_openings)[old_openings+i].Transform(msrc); + } + } + } + + nd->mTransformation = nd_src->mTransformation * static_cast( msrc ); + subnodes_src.push_back(nd.release()); + + return true; +} + +// ------------------------------------------------------------------------------------------------ +struct RateRepresentationPredicate { + int Rate(const Schema_2x3::IfcRepresentation* r) const { + // the smaller, the better + + if (! r->RepresentationIdentifier) { + // neutral choice if no extra information is specified + return 0; + } + + + const std::string& name = r->RepresentationIdentifier.Get(); + if (name == "MappedRepresentation") { + if (!r->Items.empty()) { + // take the first item and base our choice on it + const Schema_2x3::IfcMappedItem* const m = r->Items.front()->ToPtr(); + if (m) { + return Rate(m->MappingSource->MappedRepresentation); + } + } + return 100; + } + + return Rate(name); + } + + int Rate(const std::string& r) const { + if (r == "SolidModel") { + return -3; + } + + // give strong preference to extruded geometry. + if (r == "SweptSolid") { + return -10; + } + + if (r == "Clipping") { + return -5; + } + + // 'Brep' is difficult to get right due to possible voids in the + // polygon boundaries, so take it only if we are forced to (i.e. + // if the only alternative is (non-clipping) boolean operations, + // which are not supported at all). + if (r == "Brep") { + return -2; + } + + // Curves, bounding boxes - those will most likely not be loaded + // as we can't make any use out of this data. So consider them + // last. + if (r == "BoundingBox" || r == "Curve2D") { + return 100; + } + return 0; + } + + bool operator() (const Schema_2x3::IfcRepresentation* a, const Schema_2x3::IfcRepresentation* b) const { + return Rate(a) < Rate(b); + } +}; + +// ------------------------------------------------------------------------------------------------ +void ProcessProductRepresentation(const Schema_2x3::IfcProduct& el, aiNode* nd, std::vector< aiNode* >& subnodes, ConversionData& conv) +{ + if(!el.Representation) { + return; + } + + // extract Color from metadata, if present + unsigned int matid = ProcessMaterials( el.GetID(), std::numeric_limits::max(), conv, false); + std::set meshes; + + // we want only one representation type, so bring them in a suitable order (i.e try those + // that look as if we could read them quickly at first). This way of reading + // representation is relatively generic and allows the concrete implementations + // for the different representation types to make some sensible choices what + // to load and what not to load. + const STEP::ListOf< STEP::Lazy< Schema_2x3::IfcRepresentation >, 1, 0 >& src = el.Representation.Get()->Representations; + std::vector repr_ordered(src.size()); + std::copy(src.begin(),src.end(),repr_ordered.begin()); + std::sort(repr_ordered.begin(),repr_ordered.end(),RateRepresentationPredicate()); + for(const Schema_2x3::IfcRepresentation* repr : repr_ordered) { + bool res = false; + for(const Schema_2x3::IfcRepresentationItem& item : repr->Items) { + if(const Schema_2x3::IfcMappedItem* const geo = item.ToPtr()) { + res = ProcessMappedItem(*geo,nd,subnodes,matid,conv) || res; + } + else { + res = ProcessRepresentationItem(item,matid,meshes,conv) || res; + } + } + // if we got something meaningful at this point, skip any further representations + if(res) { + break; + } + } + AssignAddedMeshes(meshes,nd,conv); +} + +typedef std::map Metadata; + +// ------------------------------------------------------------------------------------------------ +void ProcessMetadata(const Schema_2x3::ListOf< Schema_2x3::Lazy< Schema_2x3::IfcProperty >, 1, 0 >& set, ConversionData& conv, Metadata& properties, + const std::string& prefix = "", + unsigned int nest = 0) { + for(const Schema_2x3::IfcProperty& property : set) { + const std::string& key = prefix.length() > 0 ? (prefix + "." + property.Name) : property.Name; + if (const Schema_2x3::IfcPropertySingleValue* const singleValue = property.ToPtr()) { + if (singleValue->NominalValue) { + if (const ::Assimp::STEP::EXPRESS::STRING* str = singleValue->NominalValue.Get()->ToPtr<::Assimp::STEP::EXPRESS::STRING>()) { + std::string value = static_cast(*str); + properties[key]=value; + } + else if (const ::Assimp::STEP::EXPRESS::REAL* val = singleValue->NominalValue.Get()->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { + float value = static_cast(*val); + std::stringstream s; + s << value; + properties[key]=s.str(); + } + else if (const ::Assimp::STEP::EXPRESS::INTEGER* val = singleValue->NominalValue.Get()->ToPtr<::Assimp::STEP::EXPRESS::INTEGER>()) { + int64_t value = static_cast(*val); + std::stringstream s; + s << value; + properties[key]=s.str(); + } + } + } + else if (const Schema_2x3::IfcPropertyListValue* const listValue = property.ToPtr()) { + std::stringstream ss; + ss << "["; + unsigned index=0; + for(const Schema_2x3::IfcValue::Out& v : listValue->ListValues) { + if (!v) continue; + if (const ::Assimp::STEP::EXPRESS::STRING* str = v->ToPtr<::Assimp::STEP::EXPRESS::STRING>()) { + std::string value = static_cast(*str); + ss << "'" << value << "'"; + } + else if (const ::Assimp::STEP::EXPRESS::REAL* val = v->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { + float value = static_cast(*val); + ss << value; + } + else if (const ::Assimp::STEP::EXPRESS::INTEGER* val = v->ToPtr<::Assimp::STEP::EXPRESS::INTEGER>()) { + int64_t value = static_cast(*val); + ss << value; + } + if (index+1ListValues.size()) { + ss << ","; + } + index++; + } + ss << "]"; + properties[key]=ss.str(); + } + else if (const Schema_2x3::IfcComplexProperty* const complexProp = property.ToPtr()) { + if(nest > 2) { // mostly arbitrary limit to prevent stack overflow vulnerabilities + IFCImporter::LogError("maximum nesting level for IfcComplexProperty reached, skipping this property."); + } + else { + ProcessMetadata(complexProp->HasProperties, conv, properties, key, nest + 1); + } + } + else { + properties[key]=""; + } + } +} + + +// ------------------------------------------------------------------------------------------------ +void ProcessMetadata(uint64_t relDefinesByPropertiesID, ConversionData& conv, Metadata& properties) +{ + if (const Schema_2x3::IfcRelDefinesByProperties* const pset = conv.db.GetObject(relDefinesByPropertiesID)->ToPtr()) { + if (const Schema_2x3::IfcPropertySet* const set = conv.db.GetObject(pset->RelatingPropertyDefinition->GetID())->ToPtr()) { + ProcessMetadata(set->HasProperties, conv, properties); + } + } +} + +// ------------------------------------------------------------------------------------------------ +aiNode* ProcessSpatialStructure(aiNode* parent, const Schema_2x3::IfcProduct& el, ConversionData& conv, + std::vector* collect_openings = nullptr ) { + const STEP::DB::RefMap& refs = conv.db.GetRefs(); + + // skip over space and annotation nodes - usually, these have no meaning in Assimp's context + bool skipGeometry = false; + if(conv.settings.skipSpaceRepresentations) { + if(el.ToPtr()) { + IFCImporter::LogDebug("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"); + return nullptr; + } + } + + // add an output node for this spatial structure + aiNode *nd(new aiNode ); + nd->mName.Set(el.GetClassName()+"_"+(el.Name?el.Name.Get():"Unnamed")+"_"+el.GlobalId); + nd->mParent = parent; + + conv.already_processed.insert(el.GetID()); + + // check for node metadata + STEP::DB::RefMapRange children = refs.equal_range(el.GetID()); + if (children.first!=refs.end()) { + Metadata properties; + if (children.first==children.second) { + // handles single property set + ProcessMetadata((*children.first).second, conv, properties); + } else { + // handles multiple property sets (currently all property sets are merged, + // which may not be the best solution in the long run) + for (STEP::DB::RefMap::const_iterator it=children.first; it!=children.second; ++it) { + ProcessMetadata((*it).second, conv, properties); + } + } + + if (!properties.empty()) { + aiMetadata* data = aiMetadata::Alloc( static_cast(properties.size()) ); + unsigned int index( 0 ); + for ( const Metadata::value_type& kv : properties ) { + data->Set( index++, kv.first, aiString( kv.second ) ); + } + nd->mMetaData = data; + } + } + + if(el.ObjectPlacement) { + ResolveObjectPlacement(nd->mTransformation,el.ObjectPlacement.Get(),conv); + } + + std::vector openings; + + IfcMatrix4 myInv; + bool didinv = false; + + // convert everything contained directly within this structure, + // this may result in more nodes. + std::vector< aiNode* > subnodes; + try { + // locate aggregates and 'contained-in-here'-elements of this spatial structure and add them in recursively + // on our way, collect openings in *this* element + STEP::DB::RefMapRange range = refs.equal_range(el.GetID()); + + for(STEP::DB::RefMapRange range2 = range; range2.first != range.second; ++range2.first) { + // skip over meshes that have already been processed before. This is strictly necessary + // because the reverse indices also include references contained in argument lists and + // therefore every element has a back-reference hold by its parent. + if (conv.already_processed.find((*range2.first).second) != conv.already_processed.end()) { + continue; + } + const STEP::LazyObject& obj = conv.db.MustGetObject((*range2.first).second); + + // handle regularly-contained elements + if(const Schema_2x3::IfcRelContainedInSpatialStructure* const cont = obj->ToPtr()) { + if(cont->RelatingStructure->GetID() != el.GetID()) { + continue; + } + for(const Schema_2x3::IfcProduct& pro : cont->RelatedElements) { + if(pro.ToPtr()) { + // IfcOpeningElement is handled below. Sadly we can't use it here as is: + // The docs say that opening elements are USUALLY attached to building storey, + // but we want them for the building elements to which they belong. + continue; + } + + aiNode* const ndnew = ProcessSpatialStructure(nd,pro,conv,nullptr); + if(ndnew) { + subnodes.push_back( ndnew ); + } + } + } + // handle openings, which we collect in a list rather than adding them to the node graph + else if(const Schema_2x3::IfcRelVoidsElement* const fills = obj->ToPtr()) { + if(fills->RelatingBuildingElement->GetID() == el.GetID()) { + const Schema_2x3::IfcFeatureElementSubtraction& open = fills->RelatedOpeningElement; + + // move opening elements to a separate node since they are semantically different than elements that are just 'contained' + std::unique_ptr nd_aggr(new aiNode()); + nd_aggr->mName.Set("$RelVoidsElement"); + nd_aggr->mParent = nd; + + nd_aggr->mTransformation = nd->mTransformation; + + std::vector openings_local; + aiNode* const ndnew = ProcessSpatialStructure( nd_aggr.get(),open, conv,&openings_local); + if (ndnew) { + + nd_aggr->mNumChildren = 1; + nd_aggr->mChildren = new aiNode*[1](); + + + nd_aggr->mChildren[0] = ndnew; + + if(openings_local.size()) { + if (!didinv) { + myInv = aiMatrix4x4(nd->mTransformation ).Inverse(); + didinv = true; + } + + // we need all openings to be in the local space of *this* node, so transform them + for(TempOpening& op :openings_local) { + op.Transform( myInv*nd_aggr->mChildren[0]->mTransformation); + openings.push_back(op); + } + } + subnodes.push_back( nd_aggr.release() ); + } + } + } + } + + for(;range.first != range.second; ++range.first) { + // see note in loop above + if (conv.already_processed.find((*range.first).second) != conv.already_processed.end()) { + continue; + } + if(const Schema_2x3::IfcRelAggregates* const aggr = conv.db.GetObject((*range.first).second)->ToPtr()) { + if(aggr->RelatingObject->GetID() != el.GetID()) { + continue; + } + + // move aggregate elements to a separate node since they are semantically different than elements that are just 'contained' + std::unique_ptr nd_aggr(new aiNode()); + nd_aggr->mName.Set("$RelAggregates"); + nd_aggr->mParent = nd; + + nd_aggr->mTransformation = nd->mTransformation; + + nd_aggr->mChildren = new aiNode*[aggr->RelatedObjects.size()](); + for(const Schema_2x3::IfcObjectDefinition& def : aggr->RelatedObjects) { + if(const Schema_2x3::IfcProduct* const prod = def.ToPtr()) { + + aiNode* const ndnew = ProcessSpatialStructure(nd_aggr.get(),*prod,conv,NULL); + if(ndnew) { + nd_aggr->mChildren[nd_aggr->mNumChildren++] = ndnew; + } + } + } + + subnodes.push_back( nd_aggr.release() ); + } + } + + conv.collect_openings = collect_openings; + if(!conv.collect_openings) { + conv.apply_openings = &openings; + } + + if (!skipGeometry) { + ProcessProductRepresentation(el, nd, subnodes, conv); + conv.apply_openings = conv.collect_openings = nullptr; + } + + if (subnodes.size()) { + nd->mChildren = new aiNode*[subnodes.size()](); + for(aiNode* nd2 : subnodes) { + nd->mChildren[nd->mNumChildren++] = nd2; + nd2->mParent = nd; + } + } + } catch(...) { + // it hurts, but I don't want to pull boost::ptr_vector into -noboost only for these few spots here + std::for_each(subnodes.begin(),subnodes.end(),delete_fun()); + throw; + } + + ai_assert(conv.already_processed.find(el.GetID()) != conv.already_processed.end()); + conv.already_processed.erase(conv.already_processed.find(el.GetID())); + return nd; +} + +// ------------------------------------------------------------------------------------------------ +void ProcessSpatialStructures(ConversionData& conv) +{ + // XXX add support for multiple sites (i.e. IfcSpatialStructureElements with composition == COMPLEX) + + + // process all products in the file. it is reasonable to assume that a + // file that is relevant for us contains at least a site or a building. + const STEP::DB::ObjectMapByType& map = conv.db.GetObjectsByType(); + + ai_assert(map.find("ifcsite") != map.end()); + const STEP::DB::ObjectSet* range = &map.find("ifcsite")->second; + + if (range->empty()) { + ai_assert(map.find("ifcbuilding") != map.end()); + range = &map.find("ifcbuilding")->second; + if (range->empty()) { + // no site, no building - fail; + IFCImporter::ThrowException("no root element found (expected IfcBuilding or preferably IfcSite)"); + } + } + + std::vector nodes; + + for(const STEP::LazyObject* lz : *range) { + const Schema_2x3::IfcSpatialStructureElement* const prod = lz->ToPtr(); + if(!prod) { + continue; + } + IFCImporter::LogDebug("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(); + STEP::DB::RefMapRange ref_range = refs.equal_range(conv.proj.GetID()); + for(; ref_range.first != ref_range.second; ++ref_range.first) { + if(const Schema_2x3::IfcRelAggregates* const aggr = conv.db.GetObject((*ref_range.first).second)->ToPtr()) { + + for(const Schema_2x3::IfcObjectDefinition& def : aggr->RelatedObjects) { + // 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"); + // got it, this is one primary site. + nodes.push_back(ProcessSpatialStructure(NULL, *prod, conv, NULL)); + } + } + } + } + } + + size_t nb_nodes = nodes.size(); + + if (nb_nodes == 0) { + IFCImporter::LogWarn("failed to determine primary site element, taking all the IfcSite"); + for (const STEP::LazyObject* lz : *range) { + const Schema_2x3::IfcSpatialStructureElement* const prod = lz->ToPtr(); + if (!prod) { + continue; + } + + nodes.push_back(ProcessSpatialStructure(NULL, *prod, conv, NULL)); + } + + nb_nodes = nodes.size(); + } + + if (nb_nodes == 1) { + conv.out->mRootNode = nodes[0]; + } + else if (nb_nodes > 1) { + conv.out->mRootNode = new aiNode("Root"); + conv.out->mRootNode->mParent = NULL; + conv.out->mRootNode->mNumChildren = static_cast(nb_nodes); + conv.out->mRootNode->mChildren = new aiNode*[conv.out->mRootNode->mNumChildren]; + + for (size_t i = 0; i < nb_nodes; ++i) { + aiNode* node = nodes[i]; + + node->mParent = conv.out->mRootNode; + + conv.out->mRootNode->mChildren[i] = node; + } + } + else { + IFCImporter::ThrowException("failed to determine primary site element"); + } +} + +// ------------------------------------------------------------------------------------------------ +void MakeTreeRelative(aiNode* start, const aiMatrix4x4& combined) +{ + // combined is the parent's absolute transformation matrix + const aiMatrix4x4 old = start->mTransformation; + + if (!combined.IsIdentity()) { + start->mTransformation = aiMatrix4x4(combined).Inverse() * start->mTransformation; + } + + // All nodes store absolute transformations right now, so we need to make them relative + for (unsigned int i = 0; i < start->mNumChildren; ++i) { + MakeTreeRelative(start->mChildren[i],old); + } +} + +// ------------------------------------------------------------------------------------------------ +void MakeTreeRelative(ConversionData& conv) +{ + MakeTreeRelative(conv.out->mRootNode,IfcMatrix4()); +} + +} // !anon + + + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCLoader.h b/Engine/lib/assimp/code/Importer/IFC/IFCLoader.h new file mode 100644 index 000000000..678c60343 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCLoader.h @@ -0,0 +1,134 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFC.h + * @brief Declaration of the Industry Foundation Classes (IFC) loader main class + */ +#ifndef INCLUDED_AI_IFC_LOADER_H +#define INCLUDED_AI_IFC_LOADER_H + +#include +#include + +namespace Assimp { + + // TinyFormatter.h + namespace Formatter { + template class basic_formatter; + typedef class basic_formatter< char, std::char_traits, std::allocator > format; + } + + namespace STEP { + class DB; + } + + +// ------------------------------------------------------------------------------------------- +/** Load the IFC format, which is an open specification to describe building and construction + industry data. + + See http://en.wikipedia.org/wiki/Industry_Foundation_Classes +*/ +// ------------------------------------------------------------------------------------------- +class IFCImporter : public BaseImporter, public LogFunctions +{ +public: + IFCImporter(); + ~IFCImporter(); + + +public: + + // -------------------- + bool CanRead( const std::string& pFile, + IOSystem* pIOHandler, + bool checkSig + ) const; + +protected: + + // -------------------- + const aiImporterDesc* GetInfo () const; + + // -------------------- + void SetupProperties(const Importer* pImp); + + // -------------------- + void InternReadFile( const std::string& pFile, + aiScene* pScene, + IOSystem* pIOHandler + ); + +private: + + +public: + + + // loader settings, publicly accessible via their corresponding AI_CONFIG constants + struct Settings + { + Settings() + : skipSpaceRepresentations() + , useCustomTriangulation() + , skipAnnotations() + , conicSamplingAngle(10.f) + , cylindricalTessellation(32) + {} + + + bool skipSpaceRepresentations; + bool useCustomTriangulation; + bool skipAnnotations; + float conicSamplingAngle; + int cylindricalTessellation; + }; + + +private: + + Settings settings; + +}; // !class IFCImporter + +} // end of namespace Assimp +#endif // !INCLUDED_AI_IFC_LOADER_H diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCMaterial.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCMaterial.cpp new file mode 100644 index 000000000..5fda0a1de --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCMaterial.cpp @@ -0,0 +1,202 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFCMaterial.cpp + * @brief Implementation of conversion routines to convert IFC materials to aiMaterial + */ + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "IFCUtil.h" +#include +#include + +namespace Assimp { +namespace IFC { + +// ------------------------------------------------------------------------------------------------ +static int ConvertShadingMode(const std::string& name) { + if (name == "BLINN") { + return aiShadingMode_Blinn; + } + else if (name == "FLAT" || name == "NOTDEFINED") { + return aiShadingMode_NoShading; + } + else if (name == "PHONG") { + return aiShadingMode_Phong; + } + IFCImporter::LogWarn("shading mode "+name+" not recognized by Assimp, using Phong instead"); + return aiShadingMode_Phong; +} + +// ------------------------------------------------------------------------------------------------ +static void FillMaterial(aiMaterial* mat,const IFC::Schema_2x3::IfcSurfaceStyle* surf,ConversionData& conv) { + aiString name; + name.Set((surf->Name? surf->Name.Get() : "IfcSurfaceStyle_Unnamed")); + mat->AddProperty(&name,AI_MATKEY_NAME); + + // now see which kinds of surface information are present + for(std::shared_ptr< const IFC::Schema_2x3::IfcSurfaceStyleElementSelect > sel2 : surf->Styles) { + if (const IFC::Schema_2x3::IfcSurfaceStyleShading* shade = sel2->ResolveSelectPtr(conv.db)) { + aiColor4D col_base,col; + + ConvertColor(col_base, shade->SurfaceColour); + mat->AddProperty(&col_base,1, AI_MATKEY_COLOR_DIFFUSE); + + if (const IFC::Schema_2x3::IfcSurfaceStyleRendering* ren = shade->ToPtr()) { + + if (ren->Transparency) { + const float t = 1.f-static_cast(ren->Transparency.Get()); + mat->AddProperty(&t,1, AI_MATKEY_OPACITY); + } + + if (ren->DiffuseColour) { + ConvertColor(col, *ren->DiffuseColour.Get(),conv,&col_base); + mat->AddProperty(&col,1, AI_MATKEY_COLOR_DIFFUSE); + } + + if (ren->SpecularColour) { + ConvertColor(col, *ren->SpecularColour.Get(),conv,&col_base); + mat->AddProperty(&col,1, AI_MATKEY_COLOR_SPECULAR); + } + + if (ren->TransmissionColour) { + ConvertColor(col, *ren->TransmissionColour.Get(),conv,&col_base); + mat->AddProperty(&col,1, AI_MATKEY_COLOR_TRANSPARENT); + } + + if (ren->ReflectionColour) { + ConvertColor(col, *ren->ReflectionColour.Get(),conv,&col_base); + mat->AddProperty(&col,1, AI_MATKEY_COLOR_REFLECTIVE); + } + + const int shading = (ren->SpecularHighlight && ren->SpecularColour)?ConvertShadingMode(ren->ReflectanceMethod):static_cast(aiShadingMode_Gouraud); + mat->AddProperty(&shading,1, AI_MATKEY_SHADING_MODEL); + + if (ren->SpecularHighlight) { + if(const ::Assimp::STEP::EXPRESS::REAL* rt = ren->SpecularHighlight.Get()->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { + // at this point we don't distinguish between the two distinct ways of + // specifying highlight intensities. leave this to the user. + const float e = static_cast(*rt); + mat->AddProperty(&e,1,AI_MATKEY_SHININESS); + } + else { + IFCImporter::LogWarn("unexpected type error, SpecularHighlight should be a REAL"); + } + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +unsigned int ProcessMaterials(uint64_t id, unsigned int prevMatId, ConversionData& conv, bool forceDefaultMat) { + STEP::DB::RefMapRange range = conv.db.GetRefs().equal_range(id); + for(;range.first != range.second; ++range.first) { + if(const IFC::Schema_2x3::IfcStyledItem* const styled = conv.db.GetObject((*range.first).second)->ToPtr()) { + for(const IFC::Schema_2x3::IfcPresentationStyleAssignment& as : styled->Styles) { + for(std::shared_ptr sel : as.Styles) { + + if( const IFC::Schema_2x3::IfcSurfaceStyle* const surf = sel->ResolveSelectPtr(conv.db) ) { + // try to satisfy from cache + ConversionData::MaterialCache::iterator mit = conv.cached_materials.find(surf); + if( mit != conv.cached_materials.end() ) + return mit->second; + + // not found, create new material + const std::string side = static_cast(surf->Side); + if( side != "BOTH" ) { + IFCImporter::LogWarn("ignoring surface side marker on IFC::IfcSurfaceStyle: " + side); + } + + std::unique_ptr mat(new aiMaterial()); + + FillMaterial(mat.get(), surf, conv); + + conv.materials.push_back(mat.release()); + unsigned int matindex = static_cast(conv.materials.size() - 1); + conv.cached_materials[surf] = matindex; + return matindex; + } + } + } + } + } + + // no local material defined. If there's global one, use that instead + if ( prevMatId != std::numeric_limits::max() ) { + return prevMatId; + } + + // we're still here - create an default material if required, or simply fail otherwise + if ( !forceDefaultMat ) { + return std::numeric_limits::max(); + } + + aiString name; + name.Set(""); + // ConvertColorToString( color, name); + + // look if there's already a default material with this base color + for( size_t a = 0; a < conv.materials.size(); ++a ) { + aiString mname; + conv.materials[a]->Get(AI_MATKEY_NAME, mname); + if ( name == mname ) { + return ( unsigned int )a; + } + } + + // we're here, yet - no default material with suitable color available. Generate one + std::unique_ptr mat(new aiMaterial()); + mat->AddProperty(&name,AI_MATKEY_NAME); + + const aiColor4D col = aiColor4D( 0.6f, 0.6f, 0.6f, 1.0f); // aiColor4D( color.r, color.g, color.b, 1.0f); + mat->AddProperty(&col,1, AI_MATKEY_COLOR_DIFFUSE); + + conv.materials.push_back(mat.release()); + return (unsigned int) conv.materials.size() - 1; +} + +} // ! IFC +} // ! Assimp + +#endif // ASSIMP_BUILD_NO_IFC_IMPORTER diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCOpenings.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCOpenings.cpp new file mode 100644 index 000000000..d6c40b383 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCOpenings.cpp @@ -0,0 +1,1704 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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 IFCOpenings.cpp + * @brief Implements a subset of Ifc CSG operations for pouring + * holes for windows and doors into walls. + */ + + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER +#include "IFCUtil.h" +#include "Common/PolyTools.h" +#include "PostProcessing/ProcessHelper.h" + +#ifdef ASSIMP_USE_HUNTER +# include +# include +#else +# include "../contrib/poly2tri/poly2tri/poly2tri.h" +# include "../contrib/clipper/clipper.hpp" +#endif + +#include + +namespace Assimp { + namespace IFC { + + using ClipperLib::ulong64; + // XXX use full -+ range ... + const ClipperLib::long64 max_ulong64 = 1518500249; // clipper.cpp / hiRange var + + //#define to_int64(p) (static_cast( std::max( 0., std::min( static_cast((p)), 1.) ) * max_ulong64 )) +#define to_int64(p) (static_cast(static_cast((p) ) * max_ulong64 )) +#define from_int64(p) (static_cast((p)) / max_ulong64) +#define one_vec (IfcVector2(static_cast(1.0),static_cast(1.0))) + + + // fallback method to generate wall openings + bool TryAddOpenings_Poly2Tri(const std::vector& openings,const std::vector& nors, + TempMesh& curmesh); + + +typedef std::pair< IfcVector2, IfcVector2 > BoundingBox; +typedef std::map XYSortedField; + + +// ------------------------------------------------------------------------------------------------ +void QuadrifyPart(const IfcVector2& pmin, const IfcVector2& pmax, XYSortedField& field, + const std::vector< BoundingBox >& bbs, + std::vector& out) +{ + if (!(pmin.x-pmax.x) || !(pmin.y-pmax.y)) { + return; + } + + IfcFloat xs = 1e10, xe = 1e10; + bool found = false; + + // Search along the x-axis until we find an opening + XYSortedField::iterator start = field.begin(); + for(; start != field.end(); ++start) { + const BoundingBox& bb = bbs[(*start).second]; + if(bb.first.x >= pmax.x) { + break; + } + + if (bb.second.x > pmin.x && bb.second.y > pmin.y && bb.first.y < pmax.y) { + xs = bb.first.x; + xe = bb.second.x; + found = true; + break; + } + } + + if (!found) { + // the rectangle [pmin,pend] is opaque, fill it + out.push_back(pmin); + out.push_back(IfcVector2(pmin.x,pmax.y)); + out.push_back(pmax); + out.push_back(IfcVector2(pmax.x,pmin.y)); + return; + } + + xs = std::max(pmin.x,xs); + xe = std::min(pmax.x,xe); + + // see if there's an offset to fill at the top of our quad + if (xs - pmin.x) { + out.push_back(pmin); + out.push_back(IfcVector2(pmin.x,pmax.y)); + out.push_back(IfcVector2(xs,pmax.y)); + out.push_back(IfcVector2(xs,pmin.y)); + } + + // search along the y-axis for all openings that overlap xs and our quad + IfcFloat ylast = pmin.y; + found = false; + for(; start != field.end(); ++start) { + const BoundingBox& bb = bbs[(*start).second]; + if (bb.first.x > xs || bb.first.y >= pmax.y) { + break; + } + + if (bb.second.y > ylast) { + + found = true; + const IfcFloat ys = std::max(bb.first.y,pmin.y), ye = std::min(bb.second.y,pmax.y); + if (ys - ylast > 0.0f) { + QuadrifyPart( IfcVector2(xs,ylast), IfcVector2(xe,ys) ,field,bbs,out); + } + + // the following are the window vertices + + /*wnd.push_back(IfcVector2(xs,ys)); + wnd.push_back(IfcVector2(xs,ye)); + wnd.push_back(IfcVector2(xe,ye)); + wnd.push_back(IfcVector2(xe,ys));*/ + ylast = ye; + } + } + if (!found) { + // the rectangle [pmin,pend] is opaque, fill it + out.push_back(IfcVector2(xs,pmin.y)); + out.push_back(IfcVector2(xs,pmax.y)); + out.push_back(IfcVector2(xe,pmax.y)); + out.push_back(IfcVector2(xe,pmin.y)); + return; + } + if (ylast < pmax.y) { + QuadrifyPart( IfcVector2(xs,ylast), IfcVector2(xe,pmax.y) ,field,bbs,out); + } + + // now for the whole rest + if (pmax.x-xe) { + QuadrifyPart(IfcVector2(xe,pmin.y), pmax ,field,bbs,out); + } +} + +typedef std::vector Contour; +typedef std::vector SkipList; // should probably use int for performance reasons + +struct ProjectedWindowContour +{ + Contour contour; + BoundingBox bb; + SkipList skiplist; + bool is_rectangular; + + + ProjectedWindowContour(const Contour& contour, const BoundingBox& bb, bool is_rectangular) + : contour(contour) + , bb(bb) + , is_rectangular(is_rectangular) + {} + + + bool IsInvalid() const { + return contour.empty(); + } + + void FlagInvalid() { + contour.clear(); + } + + void PrepareSkiplist() { + skiplist.resize(contour.size(),false); + } +}; + +typedef std::vector< ProjectedWindowContour > ContourVector; + +// ------------------------------------------------------------------------------------------------ +bool BoundingBoxesOverlapping( const BoundingBox &ibb, const BoundingBox &bb ) +{ + // count the '=' case as non-overlapping but as adjacent to each other + return ibb.first.x < bb.second.x && ibb.second.x > bb.first.x && + ibb.first.y < bb.second.y && ibb.second.y > bb.first.y; +} + +// ------------------------------------------------------------------------------------------------ +bool IsDuplicateVertex(const IfcVector2& vv, const std::vector& temp_contour) +{ + // sanity check for duplicate vertices + for(const IfcVector2& cp : temp_contour) { + if ((cp-vv).SquareLength() < 1e-5f) { + return true; + } + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +void ExtractVerticesFromClipper(const ClipperLib::Polygon& poly, std::vector& temp_contour, + bool filter_duplicates = false) +{ + temp_contour.clear(); + for(const ClipperLib::IntPoint& point : poly) { + IfcVector2 vv = IfcVector2( from_int64(point.X), from_int64(point.Y)); + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); + + if (!filter_duplicates || !IsDuplicateVertex(vv, temp_contour)) { + temp_contour.push_back(vv); + } + } +} + +// ------------------------------------------------------------------------------------------------ +BoundingBox GetBoundingBox(const ClipperLib::Polygon& poly) +{ + IfcVector2 newbb_min, newbb_max; + MinMaxChooser()(newbb_min, newbb_max); + + for(const ClipperLib::IntPoint& point : poly) { + IfcVector2 vv = IfcVector2( from_int64(point.X), from_int64(point.Y)); + + // sanity rounding + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); + + newbb_min = std::min(newbb_min,vv); + newbb_max = std::max(newbb_max,vv); + } + return BoundingBox(newbb_min, newbb_max); +} + +// ------------------------------------------------------------------------------------------------ +void InsertWindowContours(const ContourVector& contours, + const std::vector& /*openings*/, + TempMesh& curmesh) +{ + // fix windows - we need to insert the real, polygonal shapes into the quadratic holes that we have now + for(size_t i = 0; i < contours.size();++i) { + const BoundingBox& bb = contours[i].bb; + const std::vector& contour = contours[i].contour; + if(contour.empty()) { + continue; + } + + // check if we need to do it at all - many windows just fit perfectly into their quadratic holes, + // i.e. their contours *are* already their bounding boxes. + if (contour.size() == 4) { + std::set verts; + for(size_t n = 0; n < 4; ++n) { + verts.insert(contour[n]); + } + const std::set::const_iterator end = verts.end(); + if (verts.find(bb.first)!=end && verts.find(bb.second)!=end + && verts.find(IfcVector2(bb.first.x,bb.second.y))!=end + && verts.find(IfcVector2(bb.second.x,bb.first.y))!=end + ) { + continue; + } + } + + const IfcFloat diag = (bb.first-bb.second).Length(); + const IfcFloat epsilon = diag/1000.f; + + // walk through all contour points and find those that lie on the BB corner + size_t last_hit = -1, very_first_hit = -1; + IfcVector2 edge; + for(size_t n = 0, e=0, size = contour.size();; n=(n+1)%size, ++e) { + + // sanity checking + if (e == size*2) { + IFCImporter::LogError("encountered unexpected topology while generating window contour"); + break; + } + + const IfcVector2& v = contour[n]; + + bool hit = false; + if (std::fabs(v.x-bb.first.x) n ? size-(last_hit-n) : n-last_hit; + for(size_t a = last_hit, e = 0; e <= cnt; a=(a+1)%size, ++e) { + // hack: this is to fix cases where opening contours are self-intersecting. + // Clipper doesn't produce such polygons, but as soon as we're back in + // our brave new floating-point world, very small distances are consumed + // by the maximum available precision, leading to self-intersecting + // polygons. This fix makes concave windows fail even worse, but + // anyway, fail is fail. + if ((contour[a] - edge).SquareLength() > diag*diag*0.7) { + continue; + } + curmesh.mVerts.push_back(IfcVector3(contour[a].x, contour[a].y, 0.0f)); + } + + if (edge != contour[last_hit]) { + + IfcVector2 corner = edge; + + if (std::fabs(contour[last_hit].x-bb.first.x)(d)); + std::reverse(curmesh.mVerts.rbegin(),curmesh.mVerts.rbegin()+d); + } + if (n == very_first_hit) { + break; + } + } + else { + very_first_hit = n; + } + + last_hit = n; + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +void MergeWindowContours (const std::vector& a, + const std::vector& b, + ClipperLib::ExPolygons& out) +{ + out.clear(); + + ClipperLib::Clipper clipper; + ClipperLib::Polygon clip; + + for(const IfcVector2& pip : a) { + clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (ClipperLib::Orientation(clip)) { + std::reverse(clip.begin(), clip.end()); + } + + clipper.AddPolygon(clip, ClipperLib::ptSubject); + clip.clear(); + + for(const IfcVector2& pip : b) { + clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (ClipperLib::Orientation(clip)) { + std::reverse(clip.begin(), clip.end()); + } + + clipper.AddPolygon(clip, ClipperLib::ptSubject); + clipper.Execute(ClipperLib::ctUnion, out,ClipperLib::pftNonZero,ClipperLib::pftNonZero); +} + +// ------------------------------------------------------------------------------------------------ +// Subtract a from b +void MakeDisjunctWindowContours (const std::vector& a, + const std::vector& b, + ClipperLib::ExPolygons& out) +{ + out.clear(); + + ClipperLib::Clipper clipper; + ClipperLib::Polygon clip; + + for(const IfcVector2& pip : a) { + clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (ClipperLib::Orientation(clip)) { + std::reverse(clip.begin(), clip.end()); + } + + clipper.AddPolygon(clip, ClipperLib::ptClip); + clip.clear(); + + for(const IfcVector2& pip : b) { + clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (ClipperLib::Orientation(clip)) { + std::reverse(clip.begin(), clip.end()); + } + + clipper.AddPolygon(clip, ClipperLib::ptSubject); + clipper.Execute(ClipperLib::ctDifference, out,ClipperLib::pftNonZero,ClipperLib::pftNonZero); +} + +// ------------------------------------------------------------------------------------------------ +void CleanupWindowContour(ProjectedWindowContour& window) +{ + std::vector scratch; + std::vector& contour = window.contour; + + ClipperLib::Polygon subject; + ClipperLib::Clipper clipper; + ClipperLib::ExPolygons clipped; + + for(const IfcVector2& pip : contour) { + subject.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + clipper.AddPolygon(subject,ClipperLib::ptSubject); + clipper.Execute(ClipperLib::ctUnion,clipped,ClipperLib::pftNonZero,ClipperLib::pftNonZero); + + // This should yield only one polygon or something went wrong + if (clipped.size() != 1) { + + // Empty polygon? drop the contour altogether + if(clipped.empty()) { + IFCImporter::LogError("error during polygon clipping, window contour is degenerate"); + window.FlagInvalid(); + return; + } + + // Else: take the first only + IFCImporter::LogError("error during polygon clipping, window contour is not convex"); + } + + ExtractVerticesFromClipper(clipped[0].outer, scratch); + // Assume the bounding box doesn't change during this operation +} + +// ------------------------------------------------------------------------------------------------ +void CleanupWindowContours(ContourVector& contours) +{ + // Use PolyClipper to clean up window contours + try { + for(ProjectedWindowContour& window : contours) { + CleanupWindowContour(window); + } + } + catch (const char* sx) { + IFCImporter::LogError("error during polygon clipping, window shape may be wrong: (Clipper: " + + std::string(sx) + ")"); + } +} + +// ------------------------------------------------------------------------------------------------ +void CleanupOuterContour(const std::vector& contour_flat, TempMesh& curmesh) +{ + std::vector vold; + std::vector iold; + + vold.reserve(curmesh.mVerts.size()); + iold.reserve(curmesh.mVertcnt.size()); + + // Fix the outer contour using polyclipper + try { + + ClipperLib::Polygon subject; + ClipperLib::Clipper clipper; + ClipperLib::ExPolygons clipped; + + ClipperLib::Polygon clip; + clip.reserve(contour_flat.size()); + for(const IfcVector2& pip : contour_flat) { + clip.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (!ClipperLib::Orientation(clip)) { + std::reverse(clip.begin(), clip.end()); + } + + // We need to run polyclipper on every single polygon -- we can't run it one all + // of them at once or it would merge them all together which would undo all + // previous steps + subject.reserve(4); + size_t index = 0; + size_t countdown = 0; + for(const IfcVector3& pip : curmesh.mVerts) { + if (!countdown) { + countdown = curmesh.mVertcnt[index++]; + if (!countdown) { + continue; + } + } + subject.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + if (--countdown == 0) { + if (!ClipperLib::Orientation(subject)) { + std::reverse(subject.begin(), subject.end()); + } + + clipper.AddPolygon(subject,ClipperLib::ptSubject); + clipper.AddPolygon(clip,ClipperLib::ptClip); + + clipper.Execute(ClipperLib::ctIntersection,clipped,ClipperLib::pftNonZero,ClipperLib::pftNonZero); + + for(const ClipperLib::ExPolygon& ex : clipped) { + iold.push_back(static_cast(ex.outer.size())); + for(const ClipperLib::IntPoint& point : ex.outer) { + vold.push_back(IfcVector3( + from_int64(point.X), + from_int64(point.Y), + 0.0f)); + } + } + + subject.clear(); + clipped.clear(); + clipper.Clear(); + } + } + } + catch (const char* sx) { + IFCImporter::LogError("Ifc: error during polygon clipping, wall contour line may be wrong: (Clipper: " + + std::string(sx) + ")"); + + return; + } + + // swap data arrays + std::swap(vold,curmesh.mVerts); + std::swap(iold,curmesh.mVertcnt); +} + +typedef std::vector OpeningRefs; +typedef std::vector OpeningRefVector; + +typedef std::vector +> ContourRefVector; + +// ------------------------------------------------------------------------------------------------ +bool BoundingBoxesAdjacent(const BoundingBox& bb, const BoundingBox& ibb) +{ + // TODO: I'm pretty sure there is a much more compact way to check this + const IfcFloat epsilon = Math::getEpsilon(); + return (std::fabs(bb.second.x - ibb.first.x) < epsilon && bb.first.y <= ibb.second.y && bb.second.y >= ibb.first.y) || + (std::fabs(bb.first.x - ibb.second.x) < epsilon && ibb.first.y <= bb.second.y && ibb.second.y >= bb.first.y) || + (std::fabs(bb.second.y - ibb.first.y) < epsilon && bb.first.x <= ibb.second.x && bb.second.x >= ibb.first.x) || + (std::fabs(bb.first.y - ibb.second.y) < epsilon && ibb.first.x <= bb.second.x && ibb.second.x >= bb.first.x); +} + +// ------------------------------------------------------------------------------------------------ +// Check if m0,m1 intersects n0,n1 assuming same ordering of the points in the line segments +// output the intersection points on n0,n1 +bool IntersectingLineSegments(const IfcVector2& n0, const IfcVector2& n1, + const IfcVector2& m0, const IfcVector2& m1, + IfcVector2& out0, IfcVector2& out1) +{ + const IfcVector2 n0_to_n1 = n1 - n0; + + const IfcVector2 n0_to_m0 = m0 - n0; + const IfcVector2 n1_to_m1 = m1 - n1; + + const IfcVector2 n0_to_m1 = m1 - n0; + + const IfcFloat e = 1e-5f; + const IfcFloat smalle = 1e-9f; + + static const IfcFloat inf = std::numeric_limits::infinity(); + + if (!(n0_to_m0.SquareLength() < e*e || std::fabs(n0_to_m0 * n0_to_n1) / (n0_to_m0.Length() * n0_to_n1.Length()) > 1-1e-5 )) { + return false; + } + + if (!(n1_to_m1.SquareLength() < e*e || std::fabs(n1_to_m1 * n0_to_n1) / (n1_to_m1.Length() * n0_to_n1.Length()) > 1-1e-5 )) { + return false; + } + + IfcFloat s0; + IfcFloat s1; + + // pick the axis with the higher absolute difference so the result + // is more accurate. Since we cannot guarantee that the axis with + // the higher absolute difference is big enough as to avoid + // divisions by zero, the case 0/0 ~ infinity is detected and + // handled separately. + if(std::fabs(n0_to_n1.x) > std::fabs(n0_to_n1.y)) { + s0 = n0_to_m0.x / n0_to_n1.x; + s1 = n0_to_m1.x / n0_to_n1.x; + + if (std::fabs(s0) == inf && std::fabs(n0_to_m0.x) < smalle) { + s0 = 0.; + } + if (std::fabs(s1) == inf && std::fabs(n0_to_m1.x) < smalle) { + s1 = 0.; + } + } + else { + s0 = n0_to_m0.y / n0_to_n1.y; + s1 = n0_to_m1.y / n0_to_n1.y; + + if (std::fabs(s0) == inf && std::fabs(n0_to_m0.y) < smalle) { + s0 = 0.; + } + if (std::fabs(s1) == inf && std::fabs(n0_to_m1.y) < smalle) { + s1 = 0.; + } + } + + if (s1 < s0) { + std::swap(s1,s0); + } + + s0 = std::max(0.0,s0); + s1 = std::max(0.0,s1); + + s0 = std::min(1.0,s0); + s1 = std::min(1.0,s1); + + if (std::fabs(s1-s0) < e) { + return false; + } + + out0 = n0 + s0 * n0_to_n1; + out1 = n0 + s1 * n0_to_n1; + + return true; +} + +// ------------------------------------------------------------------------------------------------ +void FindAdjacentContours(ContourVector::iterator current, const ContourVector& contours) +{ + const IfcFloat sqlen_epsilon = static_cast(Math::getEpsilon()); + const BoundingBox& bb = (*current).bb; + + // What is to be done here is to populate the skip lists for the contour + // and to add necessary padding points when needed. + SkipList& skiplist = (*current).skiplist; + + // First step to find possible adjacent contours is to check for adjacent bounding + // boxes. If the bounding boxes are not adjacent, the contours lines cannot possibly be. + for (ContourVector::const_iterator it = contours.begin(), end = contours.end(); it != end; ++it) { + if ((*it).IsInvalid()) { + continue; + } + + // this left here to make clear we also run on the current contour + // to check for overlapping contour segments (which can happen due + // to projection artifacts). + //if(it == current) { + // continue; + //} + + const bool is_me = it == current; + + const BoundingBox& ibb = (*it).bb; + + // Assumption: the bounding boxes are pairwise disjoint or identical + ai_assert(is_me || !BoundingBoxesOverlapping(bb, ibb)); + + if (is_me || BoundingBoxesAdjacent(bb, ibb)) { + + // Now do a each-against-everyone check for intersecting contour + // lines. This obviously scales terribly, but in typical real + // world Ifc files it will not matter since most windows that + // are adjacent to each others are rectangular anyway. + + Contour& ncontour = (*current).contour; + const Contour& mcontour = (*it).contour; + + for (size_t n = 0; n < ncontour.size(); ++n) { + const IfcVector2 n0 = ncontour[n]; + const IfcVector2 n1 = ncontour[(n+1) % ncontour.size()]; + + for (size_t m = 0, mend = (is_me ? n : mcontour.size()); m < mend; ++m) { + ai_assert(&mcontour != &ncontour || m < n); + + const IfcVector2 m0 = mcontour[m]; + const IfcVector2 m1 = mcontour[(m+1) % mcontour.size()]; + + IfcVector2 isect0, isect1; + if (IntersectingLineSegments(n0,n1, m0, m1, isect0, isect1)) { + + if ((isect0 - n0).SquareLength() > sqlen_epsilon) { + ++n; + + ncontour.insert(ncontour.begin() + n, isect0); + skiplist.insert(skiplist.begin() + n, true); + } + else { + skiplist[n] = true; + } + + if ((isect1 - n1).SquareLength() > sqlen_epsilon) { + ++n; + + ncontour.insert(ncontour.begin() + n, isect1); + skiplist.insert(skiplist.begin() + n, false); + } + } + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +AI_FORCE_INLINE bool LikelyBorder(const IfcVector2& vdelta) +{ + const IfcFloat dot_point_epsilon = static_cast(Math::getEpsilon()); + return std::fabs(vdelta.x * vdelta.y) < dot_point_epsilon; +} + +// ------------------------------------------------------------------------------------------------ +void FindBorderContours(ContourVector::iterator current) +{ + const IfcFloat border_epsilon_upper = static_cast(1-1e-4); + const IfcFloat border_epsilon_lower = static_cast(1e-4); + + bool outer_border = false; + bool start_on_outer_border = false; + + SkipList& skiplist = (*current).skiplist; + IfcVector2 last_proj_point; + + const Contour::const_iterator cbegin = (*current).contour.begin(), cend = (*current).contour.end(); + + for (Contour::const_iterator cit = cbegin; cit != cend; ++cit) { + const IfcVector2& proj_point = *cit; + + // Check if this connection is along the outer boundary of the projection + // plane. In such a case we better drop it because such 'edges' should + // not have any geometry to close them (think of door openings). + if (proj_point.x <= border_epsilon_lower || proj_point.x >= border_epsilon_upper || + proj_point.y <= border_epsilon_lower || proj_point.y >= border_epsilon_upper) { + + if (outer_border) { + ai_assert(cit != cbegin); + if (LikelyBorder(proj_point - last_proj_point)) { + skiplist[std::distance(cbegin, cit) - 1] = true; + } + } + else if (cit == cbegin) { + start_on_outer_border = true; + } + + outer_border = true; + } + else { + outer_border = false; + } + + last_proj_point = proj_point; + } + + // handle last segment + if (outer_border && start_on_outer_border) { + const IfcVector2& proj_point = *cbegin; + if (LikelyBorder(proj_point - last_proj_point)) { + skiplist[skiplist.size()-1] = true; + } + } +} + +// ------------------------------------------------------------------------------------------------ +AI_FORCE_INLINE bool LikelyDiagonal(IfcVector2 vdelta) +{ + vdelta.x = std::fabs(vdelta.x); + vdelta.y = std::fabs(vdelta.y); + return (std::fabs(vdelta.x-vdelta.y) < 0.8 * std::max(vdelta.x, vdelta.y)); +} + +// ------------------------------------------------------------------------------------------------ +void FindLikelyCrossingLines(ContourVector::iterator current) +{ + SkipList& skiplist = (*current).skiplist; + IfcVector2 last_proj_point; + + const Contour::const_iterator cbegin = (*current).contour.begin(), cend = (*current).contour.end(); + for (Contour::const_iterator cit = cbegin; cit != cend; ++cit) { + const IfcVector2& proj_point = *cit; + + if (cit != cbegin) { + IfcVector2 vdelta = proj_point - last_proj_point; + if (LikelyDiagonal(vdelta)) { + skiplist[std::distance(cbegin, cit) - 1] = true; + } + } + + last_proj_point = proj_point; + } + + // handle last segment + if (LikelyDiagonal(*cbegin - last_proj_point)) { + skiplist[skiplist.size()-1] = true; + } +} + +// ------------------------------------------------------------------------------------------------ +size_t CloseWindows(ContourVector& contours, + const IfcMatrix4& minv, + OpeningRefVector& contours_to_openings, + TempMesh& curmesh) +{ + size_t closed = 0; + // For all contour points, check if one of the assigned openings does + // already have points assigned to it. In this case, assume this is + // the other side of the wall and generate connections between + // the two holes in order to close the window. + + // All this gets complicated by the fact that contours may pertain to + // multiple openings(due to merging of adjacent or overlapping openings). + // The code is based on the assumption that this happens symmetrically + // on both sides of the wall. If it doesn't (which would be a bug anyway) + // wrong geometry may be generated. + for (ContourVector::iterator it = contours.begin(), end = contours.end(); it != end; ++it) { + if ((*it).IsInvalid()) { + continue; + } + OpeningRefs& refs = contours_to_openings[std::distance(contours.begin(), it)]; + + bool has_other_side = false; + for(const TempOpening* opening : refs) { + if(!opening->wallPoints.empty()) { + has_other_side = true; + break; + } + } + + if (has_other_side) { + + ContourRefVector adjacent_contours; + + // prepare a skiplist for this contour. The skiplist is used to + // eliminate unwanted contour lines for adjacent windows and + // those bordering the outer frame. + (*it).PrepareSkiplist(); + + FindAdjacentContours(it, contours); + FindBorderContours(it); + + // if the window is the result of a finite union or intersection of rectangles, + // there shouldn't be any crossing or diagonal lines in it. Such lines would + // be artifacts caused by numerical inaccuracies or other bugs in polyclipper + // and our own code. Since rectangular openings are by far the most frequent + // case, it is worth filtering for this corner case. + if((*it).is_rectangular) { + FindLikelyCrossingLines(it); + } + + ai_assert((*it).skiplist.size() == (*it).contour.size()); + + SkipList::const_iterator skipbegin = (*it).skiplist.begin(); + + curmesh.mVerts.reserve(curmesh.mVerts.size() + (*it).contour.size() * 4); + curmesh.mVertcnt.reserve(curmesh.mVertcnt.size() + (*it).contour.size()); + + bool reverseCountourFaces = false; + + // compare base poly normal and contour normal to detect if we need to reverse the face winding + if(curmesh.mVertcnt.size() > 0) { + IfcVector3 basePolyNormal = TempMesh::ComputePolygonNormal(curmesh.mVerts.data(), curmesh.mVertcnt.front()); + + std::vector worldSpaceContourVtx(it->contour.size()); + + for(size_t a = 0; a < it->contour.size(); ++a) + worldSpaceContourVtx[a] = minv * IfcVector3(it->contour[a].x, it->contour[a].y, 0.0); + + IfcVector3 contourNormal = TempMesh::ComputePolygonNormal(worldSpaceContourVtx.data(), worldSpaceContourVtx.size()); + + reverseCountourFaces = (contourNormal * basePolyNormal) > 0.0; + } + + // XXX this algorithm is really a bit inefficient - both in terms + // of constant factor and of asymptotic runtime. + std::vector::const_iterator skipit = skipbegin; + + IfcVector3 start0; + IfcVector3 start1; + + const Contour::const_iterator cbegin = (*it).contour.begin(), cend = (*it).contour.end(); + + bool drop_this_edge = false; + for (Contour::const_iterator cit = cbegin; cit != cend; ++cit, drop_this_edge = *skipit++) { + const IfcVector2& proj_point = *cit; + + // Locate the closest opposite point. This should be a good heuristic to + // connect only the points that are really intended to be connected. + IfcFloat best = static_cast(1e10); + IfcVector3 bestv; + + const IfcVector3 world_point = minv * IfcVector3(proj_point.x,proj_point.y,0.0f); + + for(const TempOpening* opening : refs) { + for(const IfcVector3& other : opening->wallPoints) { + const IfcFloat sqdist = (world_point - other).SquareLength(); + + if (sqdist < best) { + // avoid self-connections + if(sqdist < 1e-5) { + continue; + } + + bestv = other; + best = sqdist; + } + } + } + + if (drop_this_edge) { + curmesh.mVerts.pop_back(); + curmesh.mVerts.pop_back(); + } + else { + curmesh.mVerts.push_back(((cit == cbegin) != reverseCountourFaces) ? world_point : bestv); + curmesh.mVerts.push_back(((cit == cbegin) != reverseCountourFaces) ? bestv : world_point); + + curmesh.mVertcnt.push_back(4); + ++closed; + } + + if (cit == cbegin) { + start0 = world_point; + start1 = bestv; + continue; + } + + curmesh.mVerts.push_back(reverseCountourFaces ? bestv : world_point); + curmesh.mVerts.push_back(reverseCountourFaces ? world_point : bestv); + + if (cit == cend - 1) { + drop_this_edge = *skipit; + + // Check if the final connection (last to first element) is itself + // a border edge that needs to be dropped. + if (drop_this_edge) { + --closed; + curmesh.mVertcnt.pop_back(); + curmesh.mVerts.pop_back(); + curmesh.mVerts.pop_back(); + } + else { + curmesh.mVerts.push_back(reverseCountourFaces ? start0 : start1); + curmesh.mVerts.push_back(reverseCountourFaces ? start1 : start0); + } + } + } + } + else { + + const Contour::const_iterator cbegin = (*it).contour.begin(), cend = (*it).contour.end(); + for(TempOpening* opening : refs) { + ai_assert(opening->wallPoints.empty()); + opening->wallPoints.reserve(opening->wallPoints.capacity() + (*it).contour.size()); + for (Contour::const_iterator cit = cbegin; cit != cend; ++cit) { + + const IfcVector2& proj_point = *cit; + opening->wallPoints.push_back(minv * IfcVector3(proj_point.x,proj_point.y,0.0f)); + } + } + } + } + return closed; +} + +// ------------------------------------------------------------------------------------------------ +void Quadrify(const std::vector< BoundingBox >& bbs, TempMesh& curmesh) +{ + ai_assert(curmesh.IsEmpty()); + + std::vector quads; + quads.reserve(bbs.size()*4); + + // sort openings by x and y axis as a preliminiary to the QuadrifyPart() algorithm + XYSortedField field; + for (std::vector::const_iterator it = bbs.begin(); it != bbs.end(); ++it) { + if (field.find((*it).first) != field.end()) { + IFCImporter::LogWarn("constraint failure during generation of wall openings, results may be faulty"); + } + field[(*it).first] = std::distance(bbs.begin(),it); + } + + QuadrifyPart(IfcVector2(),one_vec,field,bbs,quads); + ai_assert(!(quads.size() % 4)); + + curmesh.mVertcnt.resize(quads.size()/4,4); + curmesh.mVerts.reserve(quads.size()); + for(const IfcVector2& v2 : quads) { + curmesh.mVerts.push_back(IfcVector3(v2.x, v2.y, static_cast(0.0))); + } +} + +// ------------------------------------------------------------------------------------------------ +void Quadrify(const ContourVector& contours, TempMesh& curmesh) +{ + std::vector bbs; + bbs.reserve(contours.size()); + + for(const ContourVector::value_type& val : contours) { + bbs.push_back(val.bb); + } + + Quadrify(bbs, curmesh); +} + +// ------------------------------------------------------------------------------------------------ +IfcMatrix4 ProjectOntoPlane(std::vector& out_contour, const TempMesh& in_mesh, + bool &ok, IfcVector3& nor_out) +{ + const std::vector& in_verts = in_mesh.mVerts; + ok = true; + + IfcMatrix4 m = IfcMatrix4(DerivePlaneCoordinateSpace(in_mesh, ok, nor_out)); + if(!ok) { + return IfcMatrix4(); + } +#ifdef ASSIMP_BUILD_DEBUG + const IfcFloat det = m.Determinant(); + ai_assert(std::fabs(det-1) < 1e-5); +#endif + + IfcFloat zcoord = 0; + out_contour.reserve(in_verts.size()); + + + IfcVector3 vmin, vmax; + MinMaxChooser()(vmin, vmax); + + // Project all points into the new coordinate system, collect min/max verts on the way + for(const IfcVector3& x : in_verts) { + const IfcVector3 vv = m * x; + // keep Z offset in the plane coordinate system. Ignoring precision issues + // (which are present, of course), this should be the same value for + // all polygon vertices (assuming the polygon is planar). + + // XXX this should be guarded, but we somehow need to pick a suitable + // epsilon + // if(coord != -1.0f) { + // assert(std::fabs(coord - vv.z) < 1e-3f); + // } + zcoord += vv.z; + vmin = std::min(vv, vmin); + vmax = std::max(vv, vmax); + + out_contour.push_back(IfcVector2(vv.x,vv.y)); + } + + zcoord /= in_verts.size(); + + // Further improve the projection by mapping the entire working set into + // [0,1] range. This gives us a consistent data range so all epsilons + // used below can be constants. + vmax -= vmin; + for(IfcVector2& vv : out_contour) { + vv.x = (vv.x - vmin.x) / vmax.x; + vv.y = (vv.y - vmin.y) / vmax.y; + + // sanity rounding + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); + } + + IfcMatrix4 mult; + mult.a1 = static_cast(1.0) / vmax.x; + mult.b2 = static_cast(1.0) / vmax.y; + + mult.a4 = -vmin.x * mult.a1; + mult.b4 = -vmin.y * mult.b2; + mult.c4 = -zcoord; + m = mult * m; + + // debug code to verify correctness +#ifdef ASSIMP_BUILD_DEBUG + std::vector out_contour2; + for(const IfcVector3& x : in_verts) { + const IfcVector3& vv = m * x; + + out_contour2.push_back(IfcVector2(vv.x,vv.y)); + ai_assert(std::fabs(vv.z) < vmax.z + 1e-8); + } + + for(size_t i = 0; i < out_contour.size(); ++i) { + ai_assert((out_contour[i]-out_contour2[i]).SquareLength() < 1e-6); + } +#endif + + return m; +} + +// ------------------------------------------------------------------------------------------------ +bool GenerateOpenings(std::vector& openings, + const std::vector& nors, + TempMesh& curmesh, + bool check_intersection, + bool generate_connection_geometry, + const IfcVector3& wall_extrusion_axis) +{ + OpeningRefVector contours_to_openings; + + // Try to derive a solid base plane within the current surface for use as + // working coordinate system. Map all vertices onto this plane and + // rescale them to [0,1] range. This normalization means all further + // epsilons need not be scaled. + bool ok = true; + + std::vector contour_flat; + + IfcVector3 nor; + const IfcMatrix4 m = ProjectOntoPlane(contour_flat, curmesh, ok, nor); + if(!ok) { + return false; + } + + // Obtain inverse transform for getting back to world space later on + const IfcMatrix4 minv = IfcMatrix4(m).Inverse(); + + // Compute bounding boxes for all 2D openings in projection space + ContourVector contours; + + std::vector temp_contour; + std::vector temp_contour2; + + IfcVector3 wall_extrusion_axis_norm = wall_extrusion_axis; + wall_extrusion_axis_norm.Normalize(); + + for(TempOpening& opening :openings) { + + // extrusionDir may be 0,0,0 on case where the opening mesh is not an + // IfcExtrudedAreaSolid but something else (i.e. a brep) + IfcVector3 norm_extrusion_dir = opening.extrusionDir; + if (norm_extrusion_dir.SquareLength() > 1e-10) { + norm_extrusion_dir.Normalize(); + } + else { + norm_extrusion_dir = IfcVector3(); + } + + TempMesh* profile_data = opening.profileMesh.get(); + bool is_2d_source = false; + if (opening.profileMesh2D && norm_extrusion_dir.SquareLength() > 0) { + + if(std::fabs(norm_extrusion_dir * wall_extrusion_axis_norm) < 0.1) { + // horizontal extrusion + if (std::fabs(norm_extrusion_dir * nor) > 0.9) { + profile_data = opening.profileMesh2D.get(); + is_2d_source = true; + } + } + else { + // vertical extrusion + if (std::fabs(norm_extrusion_dir * nor) > 0.9) { + profile_data = opening.profileMesh2D.get(); + is_2d_source = true; + } + } + } + std::vector profile_verts = profile_data->mVerts; + std::vector profile_vertcnts = profile_data->mVertcnt; + if(profile_verts.size() <= 2) { + continue; + } + + // The opening meshes are real 3D meshes so skip over all faces + // clearly facing into the wrong direction. Also, we need to check + // whether the meshes do actually intersect the base surface plane. + // This is done by recording minimum and maximum values for the + // d component of the plane equation for all polys and checking + // against surface d. + + // Use the sign of the dot product of the face normal to the plane + // normal to determine to which side of the difference mesh a + // triangle belongs. Get independent bounding boxes and vertex + // sets for both sides and take the better one (we can't just + // take both - this would likely cause major screwup of vertex + // winding, producing errors as late as in CloseWindows()). + IfcFloat dmin, dmax; + MinMaxChooser()(dmin,dmax); + + temp_contour.clear(); + temp_contour2.clear(); + + IfcVector2 vpmin,vpmax; + MinMaxChooser()(vpmin,vpmax); + + IfcVector2 vpmin2,vpmax2; + MinMaxChooser()(vpmin2,vpmax2); + + for (size_t f = 0, vi_total = 0, fend = profile_vertcnts.size(); f < fend; ++f) { + + bool side_flag = true; + if (!is_2d_source) { + const IfcVector3 face_nor = ((profile_verts[vi_total+2] - profile_verts[vi_total]) ^ + (profile_verts[vi_total+1] - profile_verts[vi_total])).Normalize(); + + const IfcFloat abs_dot_face_nor = std::abs(nor * face_nor); + if (abs_dot_face_nor < 0.9) { + vi_total += profile_vertcnts[f]; + continue; + } + + side_flag = nor * face_nor > 0; + } + + for (unsigned int vi = 0, vend = profile_vertcnts[f]; vi < vend; ++vi, ++vi_total) { + const IfcVector3& x = profile_verts[vi_total]; + + const IfcVector3 v = m * x; + IfcVector2 vv(v.x, v.y); + + //if(check_intersection) { + dmin = std::min(dmin, v.z); + dmax = std::max(dmax, v.z); + //} + + // sanity rounding + vv = std::max(vv,IfcVector2()); + vv = std::min(vv,one_vec); + + if(side_flag) { + vpmin = std::min(vpmin,vv); + vpmax = std::max(vpmax,vv); + } + else { + vpmin2 = std::min(vpmin2,vv); + vpmax2 = std::max(vpmax2,vv); + } + + std::vector& store = side_flag ? temp_contour : temp_contour2; + + if (!IsDuplicateVertex(vv, store)) { + store.push_back(vv); + } + } + } + + if (temp_contour2.size() > 2) { + ai_assert(!is_2d_source); + const IfcVector2 area = vpmax-vpmin; + const IfcVector2 area2 = vpmax2-vpmin2; + if (temp_contour.size() <= 2 || std::fabs(area2.x * area2.y) > std::fabs(area.x * area.y)) { + temp_contour.swap(temp_contour2); + + vpmax = vpmax2; + vpmin = vpmin2; + } + } + if(temp_contour.size() <= 2) { + continue; + } + + // TODO: This epsilon may be too large + const IfcFloat epsilon = std::fabs(dmax-dmin) * 0.0001; + if (!is_2d_source && check_intersection && (0 < dmin-epsilon || 0 > dmax+epsilon)) { + continue; + } + + BoundingBox bb = BoundingBox(vpmin,vpmax); + + // Skip over very small openings - these are likely projection errors + // (i.e. they don't belong to this side of the wall) + if(std::fabs(vpmax.x - vpmin.x) * std::fabs(vpmax.y - vpmin.y) < static_cast(1e-10)) { + continue; + } + std::vector joined_openings(1, &opening); + + bool is_rectangle = temp_contour.size() == 4; + + // See if this BB intersects or is in close adjacency to any other BB we have so far. + for (ContourVector::iterator it = contours.begin(); it != contours.end(); ) { + const BoundingBox& ibb = (*it).bb; + + if (BoundingBoxesOverlapping(ibb, bb)) { + + if (!(*it).is_rectangular) { + is_rectangle = false; + } + + const std::vector& other = (*it).contour; + ClipperLib::ExPolygons poly; + + // First check whether subtracting the old contour (to which ibb belongs) + // from the new contour (to which bb belongs) yields an updated bb which + // no longer overlaps ibb + MakeDisjunctWindowContours(other, temp_contour, poly); + if(poly.size() == 1) { + + const BoundingBox newbb = GetBoundingBox(poly[0].outer); + if (!BoundingBoxesOverlapping(ibb, newbb )) { + // Good guy bounding box + bb = newbb ; + + ExtractVerticesFromClipper(poly[0].outer, temp_contour, false); + continue; + } + } + + // Take these two overlapping contours and try to merge them. If they + // overlap (which should not happen, but in fact happens-in-the-real- + // world [tm] ), resume using a single contour and a single bounding box. + MergeWindowContours(temp_contour, other, poly); + + if (poly.size() > 1) { + return TryAddOpenings_Poly2Tri(openings, nors, curmesh); + } + else if (poly.size() == 0) { + IFCImporter::LogWarn("ignoring duplicate opening"); + temp_contour.clear(); + break; + } + else { + IFCImporter::LogDebug("merging overlapping openings"); + ExtractVerticesFromClipper(poly[0].outer, temp_contour, false); + + // Generate the union of the bounding boxes + bb.first = std::min(bb.first, ibb.first); + bb.second = std::max(bb.second, ibb.second); + + // Update contour-to-opening tables accordingly + if (generate_connection_geometry) { + std::vector& t = contours_to_openings[std::distance(contours.begin(),it)]; + joined_openings.insert(joined_openings.end(), t.begin(), t.end()); + + contours_to_openings.erase(contours_to_openings.begin() + std::distance(contours.begin(),it)); + } + + contours.erase(it); + + // Restart from scratch because the newly formed BB might now + // overlap any other BB which its constituent BBs didn't + // previously overlap. + it = contours.begin(); + continue; + } + } + ++it; + } + + if(!temp_contour.empty()) { + if (generate_connection_geometry) { + contours_to_openings.push_back(std::vector( + joined_openings.begin(), + joined_openings.end())); + } + + contours.push_back(ProjectedWindowContour(temp_contour, bb, is_rectangle)); + } + } + + // Check if we still have any openings left - it may well be that this is + // not the cause, for example if all the opening candidates don't intersect + // this surface or point into a direction perpendicular to it. + if (contours.empty()) { + return false; + } + + curmesh.Clear(); + + // Generate a base subdivision into quads to accommodate the given list + // of window bounding boxes. + Quadrify(contours,curmesh); + + // Run a sanity cleanup pass on the window contours to avoid generating + // artifacts during the contour generation phase later on. + CleanupWindowContours(contours); + + // Previously we reduced all windows to rectangular AABBs in projection + // space, now it is time to fill the gaps between the BBs and the real + // window openings. + InsertWindowContours(contours,openings, curmesh); + + // Clip the entire outer contour of our current result against the real + // outer contour of the surface. This is necessary because the result + // of the Quadrify() algorithm is always a square area spanning + // over [0,1]^2 (i.e. entire projection space). + CleanupOuterContour(contour_flat, curmesh); + + // Undo the projection and get back to world (or local object) space + for(IfcVector3& v3 : curmesh.mVerts) { + v3 = minv * v3; + } + + // Generate window caps to connect the symmetric openings on both sides + // of the wall. + if (generate_connection_geometry) { + CloseWindows(contours, minv, contours_to_openings, curmesh); + } + return true; +} + +// ------------------------------------------------------------------------------------------------ +bool TryAddOpenings_Poly2Tri(const std::vector& openings,const std::vector& nors, + TempMesh& curmesh) +{ + IFCImporter::LogWarn("forced to use poly2tri fallback method to generate wall openings"); + std::vector& out = curmesh.mVerts; + + bool result = false; + + // Try to derive a solid base plane within the current surface for use as + // working coordinate system. + bool ok; + IfcVector3 nor; + const IfcMatrix3 m = DerivePlaneCoordinateSpace(curmesh, ok, nor); + if (!ok) { + return false; + } + + const IfcMatrix3 minv = IfcMatrix3(m).Inverse(); + + + IfcFloat coord = -1; + + std::vector contour_flat; + contour_flat.reserve(out.size()); + + IfcVector2 vmin, vmax; + MinMaxChooser()(vmin, vmax); + + // Move all points into the new coordinate system, collecting min/max verts on the way + for(IfcVector3& x : out) { + const IfcVector3 vv = m * x; + + // keep Z offset in the plane coordinate system. Ignoring precision issues + // (which are present, of course), this should be the same value for + // all polygon vertices (assuming the polygon is planar). + + + // XXX this should be guarded, but we somehow need to pick a suitable + // epsilon + // if(coord != -1.0f) { + // assert(std::fabs(coord - vv.z) < 1e-3f); + // } + + coord = vv.z; + + vmin = std::min(IfcVector2(vv.x, vv.y), vmin); + vmax = std::max(IfcVector2(vv.x, vv.y), vmax); + + contour_flat.push_back(IfcVector2(vv.x,vv.y)); + } + + // With the current code in DerivePlaneCoordinateSpace, + // vmin,vmax should always be the 0...1 rectangle (+- numeric inaccuracies) + // but here we won't rely on this. + + vmax -= vmin; + + // If this happens then the projection must have been wrong. + ai_assert(vmax.Length()); + + ClipperLib::ExPolygons clipped; + ClipperLib::Polygons holes_union; + + + IfcVector3 wall_extrusion; + bool first = true; + + try { + + ClipperLib::Clipper clipper_holes; + size_t c = 0; + + for(const TempOpening& t :openings) { + const IfcVector3& outernor = nors[c++]; + const IfcFloat dot = nor * outernor; + if (std::fabs(dot)<1.f-1e-6f) { + continue; + } + + const std::vector& va = t.profileMesh->mVerts; + if(va.size() <= 2) { + continue; + } + + std::vector contour; + + for(const IfcVector3& xx : t.profileMesh->mVerts) { + IfcVector3 vv = m * xx, vv_extr = m * (xx + t.extrusionDir); + + const bool is_extruded_side = std::fabs(vv.z - coord) > std::fabs(vv_extr.z - coord); + if (first) { + first = false; + if (dot > 0.f) { + wall_extrusion = t.extrusionDir; + if (is_extruded_side) { + wall_extrusion = - wall_extrusion; + } + } + } + + // XXX should not be necessary - but it is. Why? For precision reasons? + vv = is_extruded_side ? vv_extr : vv; + contour.push_back(IfcVector2(vv.x,vv.y)); + } + + ClipperLib::Polygon hole; + for(IfcVector2& pip : contour) { + pip.x = (pip.x - vmin.x) / vmax.x; + pip.y = (pip.y - vmin.y) / vmax.y; + + hole.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (!ClipperLib::Orientation(hole)) { + std::reverse(hole.begin(), hole.end()); + // assert(ClipperLib::Orientation(hole)); + } + + /*ClipperLib::Polygons pol_temp(1), pol_temp2(1); + pol_temp[0] = hole; + + ClipperLib::OffsetPolygons(pol_temp,pol_temp2,5.0); + hole = pol_temp2[0];*/ + + clipper_holes.AddPolygon(hole,ClipperLib::ptSubject); + } + + clipper_holes.Execute(ClipperLib::ctUnion,holes_union, + ClipperLib::pftNonZero, + ClipperLib::pftNonZero); + + if (holes_union.empty()) { + return false; + } + + // Now that we have the big union of all holes, subtract it from the outer contour + // to obtain the final polygon to feed into the triangulator. + { + ClipperLib::Polygon poly; + for(IfcVector2& pip : contour_flat) { + pip.x = (pip.x - vmin.x) / vmax.x; + pip.y = (pip.y - vmin.y) / vmax.y; + + poly.push_back(ClipperLib::IntPoint( to_int64(pip.x), to_int64(pip.y) )); + } + + if (ClipperLib::Orientation(poly)) { + std::reverse(poly.begin(), poly.end()); + } + clipper_holes.Clear(); + clipper_holes.AddPolygon(poly,ClipperLib::ptSubject); + + clipper_holes.AddPolygons(holes_union,ClipperLib::ptClip); + clipper_holes.Execute(ClipperLib::ctDifference,clipped, + ClipperLib::pftNonZero, + ClipperLib::pftNonZero); + } + + } + catch (const char* sx) { + IFCImporter::LogError("Ifc: error during polygon clipping, skipping openings for this face: (Clipper: " + + std::string(sx) + ")"); + + return false; + } + + std::vector old_verts; + std::vector old_vertcnt; + + old_verts.swap(curmesh.mVerts); + old_vertcnt.swap(curmesh.mVertcnt); + + std::vector< std::vector > contours; + for(ClipperLib::ExPolygon& clip : clipped) { + + contours.clear(); + + // Build the outer polygon contour line for feeding into poly2tri + std::vector contour_points; + for(ClipperLib::IntPoint& point : clip.outer) { + contour_points.push_back( new p2t::Point(from_int64(point.X), from_int64(point.Y)) ); + } + + p2t::CDT* cdt ; + try { + // Note: this relies on custom modifications in poly2tri to raise runtime_error's + // instead if assertions. These failures are not debug only, they can actually + // happen in production use if the input data is broken. An assertion would be + // inappropriate. + cdt = new p2t::CDT(contour_points); + } + catch(const std::exception& e) { + IFCImporter::LogError("Ifc: error during polygon triangulation, skipping some openings: (poly2tri: " + + std::string(e.what()) + ")"); + continue; + } + + + // Build the poly2tri inner contours for all holes we got from ClipperLib + for(ClipperLib::Polygon& opening : clip.holes) { + + contours.push_back(std::vector()); + std::vector& contour = contours.back(); + + for(ClipperLib::IntPoint& point : opening) { + contour.push_back( new p2t::Point(from_int64(point.X), from_int64(point.Y)) ); + } + + cdt->AddHole(contour); + } + + try { + // Note: See above + cdt->Triangulate(); + } + catch(const std::exception& e) { + IFCImporter::LogError("Ifc: error during polygon triangulation, skipping some openings: (poly2tri: " + + std::string(e.what()) + ")"); + continue; + } + + const std::vector tris = cdt->GetTriangles(); + + // Collect the triangles we just produced + for(p2t::Triangle* tri : tris) { + for(int i = 0; i < 3; ++i) { + + const IfcVector2 v = IfcVector2( + static_cast( tri->GetPoint(i)->x ), + static_cast( tri->GetPoint(i)->y ) + ); + + ai_assert(v.x <= 1.0 && v.x >= 0.0 && v.y <= 1.0 && v.y >= 0.0); + const IfcVector3 v3 = minv * IfcVector3(vmin.x + v.x * vmax.x, vmin.y + v.y * vmax.y,coord) ; + + curmesh.mVerts.push_back(v3); + } + curmesh.mVertcnt.push_back(3); + } + + result = true; + } + + if (!result) { + // revert -- it's a shame, but better than nothing + curmesh.mVerts.insert(curmesh.mVerts.end(),old_verts.begin(), old_verts.end()); + curmesh.mVertcnt.insert(curmesh.mVertcnt.end(),old_vertcnt.begin(), old_vertcnt.end()); + + IFCImporter::LogError("Ifc: revert, could not generate openings for this wall"); + } + + return result; +} + + + } // ! IFC +} // ! Assimp + +#undef to_int64 +#undef from_int64 +#undef one_vec + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCProfile.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCProfile.cpp new file mode 100644 index 000000000..daafc9afe --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCProfile.cpp @@ -0,0 +1,190 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFCProfile.cpp + * @brief Read profile and curves entities from IFC files + */ + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "IFCUtil.h" + +namespace Assimp { +namespace IFC { + +// ------------------------------------------------------------------------------------------------ +void ProcessPolyLine(const Schema_2x3::IfcPolyline& def, TempMesh& meshout, ConversionData& /*conv*/) +{ + // this won't produce a valid mesh, it just spits out a list of vertices + IfcVector3 t; + for(const Schema_2x3::IfcCartesianPoint& cp : def.Points) { + ConvertCartesianPoint(t,cp); + meshout.mVerts.push_back(t); + } + meshout.mVertcnt.push_back(static_cast(meshout.mVerts.size())); +} + +// ------------------------------------------------------------------------------------------------ +bool ProcessCurve(const Schema_2x3::IfcCurve& curve, TempMesh& meshout, ConversionData& conv) +{ + std::unique_ptr cv(Curve::Convert(curve,conv)); + if (!cv) { + IFCImporter::LogWarn("skipping unknown IfcCurve entity, type is " + curve.GetClassName()); + return false; + } + + // we must have a bounded curve at this point + if (const BoundedCurve* bc = dynamic_cast(cv.get())) { + try { + bc->SampleDiscrete(meshout); + } + catch(const CurveError& cv) { + IFCImporter::LogError(cv.mStr + " (error occurred while processing curve)"); + return false; + } + meshout.mVertcnt.push_back(static_cast(meshout.mVerts.size())); + return true; + } + + IFCImporter::LogError("cannot use unbounded curve as profile"); + return false; +} + +// ------------------------------------------------------------------------------------------------ +void ProcessClosedProfile(const Schema_2x3::IfcArbitraryClosedProfileDef& def, TempMesh& meshout, ConversionData& conv) +{ + ProcessCurve(def.OuterCurve,meshout,conv); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessOpenProfile(const Schema_2x3::IfcArbitraryOpenProfileDef& def, TempMesh& meshout, ConversionData& conv) +{ + ProcessCurve(def.Curve,meshout,conv); +} + +// ------------------------------------------------------------------------------------------------ +void ProcessParametrizedProfile(const Schema_2x3::IfcParameterizedProfileDef& def, TempMesh& meshout, ConversionData& conv) +{ + if(const Schema_2x3::IfcRectangleProfileDef* const cprofile = def.ToPtr()) { + const IfcFloat x = cprofile->XDim*0.5f, y = cprofile->YDim*0.5f; + + meshout.mVerts.reserve(meshout.mVerts.size()+4); + meshout.mVerts.push_back( IfcVector3( x, y, 0.f )); + meshout.mVerts.push_back( IfcVector3(-x, y, 0.f )); + meshout.mVerts.push_back( IfcVector3(-x,-y, 0.f )); + meshout.mVerts.push_back( IfcVector3( x,-y, 0.f )); + meshout.mVertcnt.push_back(4); + } + else if( const Schema_2x3::IfcCircleProfileDef* const circle = def.ToPtr()) { + if(def.ToPtr()) { + // TODO + } + const size_t segments = conv.settings.cylindricalTessellation; + const IfcFloat delta = AI_MATH_TWO_PI_F/segments, radius = circle->Radius; + + meshout.mVerts.reserve(segments); + + IfcFloat angle = 0.f; + for(size_t i = 0; i < segments; ++i, angle += delta) { + meshout.mVerts.push_back( IfcVector3( std::cos(angle)*radius, std::sin(angle)*radius, 0.f )); + } + + meshout.mVertcnt.push_back(static_cast(segments)); + } + else if( const Schema_2x3::IfcIShapeProfileDef* const ishape = def.ToPtr()) { + // construct simplified IBeam shape + const IfcFloat offset = (ishape->OverallWidth - ishape->WebThickness) / 2; + const IfcFloat inner_height = ishape->OverallDepth - ishape->FlangeThickness * 2; + + meshout.mVerts.reserve(12); + meshout.mVerts.push_back(IfcVector3(0,0,0)); + meshout.mVerts.push_back(IfcVector3(0,ishape->FlangeThickness,0)); + meshout.mVerts.push_back(IfcVector3(offset,ishape->FlangeThickness,0)); + meshout.mVerts.push_back(IfcVector3(offset,ishape->FlangeThickness + inner_height,0)); + meshout.mVerts.push_back(IfcVector3(0,ishape->FlangeThickness + inner_height,0)); + meshout.mVerts.push_back(IfcVector3(0,ishape->OverallDepth,0)); + meshout.mVerts.push_back(IfcVector3(ishape->OverallWidth,ishape->OverallDepth,0)); + meshout.mVerts.push_back(IfcVector3(ishape->OverallWidth,ishape->FlangeThickness + inner_height,0)); + meshout.mVerts.push_back(IfcVector3(offset+ishape->WebThickness,ishape->FlangeThickness + inner_height,0)); + meshout.mVerts.push_back(IfcVector3(offset+ishape->WebThickness,ishape->FlangeThickness,0)); + meshout.mVerts.push_back(IfcVector3(ishape->OverallWidth,ishape->FlangeThickness,0)); + meshout.mVerts.push_back(IfcVector3(ishape->OverallWidth,0,0)); + + meshout.mVertcnt.push_back(12); + } + else { + IFCImporter::LogWarn("skipping unknown IfcParameterizedProfileDef entity, type is " + def.GetClassName()); + return; + } + + IfcMatrix4 trafo; + ConvertAxisPlacement(trafo, *def.Position); + meshout.Transform(trafo); +} + +// ------------------------------------------------------------------------------------------------ +bool ProcessProfile(const Schema_2x3::IfcProfileDef& prof, TempMesh& meshout, ConversionData& conv) +{ + if(const Schema_2x3::IfcArbitraryClosedProfileDef* const cprofile = prof.ToPtr()) { + ProcessClosedProfile(*cprofile,meshout,conv); + } + else if(const Schema_2x3::IfcArbitraryOpenProfileDef* const copen = prof.ToPtr()) { + ProcessOpenProfile(*copen,meshout,conv); + } + else if(const Schema_2x3::IfcParameterizedProfileDef* const cparam = prof.ToPtr()) { + ProcessParametrizedProfile(*cparam,meshout,conv); + } + else { + IFCImporter::LogWarn("skipping unknown IfcProfileDef entity, type is " + prof.GetClassName()); + return false; + } + meshout.RemoveAdjacentDuplicates(); + if (!meshout.mVertcnt.size() || meshout.mVertcnt.front() <= 1) { + return false; + } + return true; +} + +} // ! IFC +} // ! Assimp + +#endif // ASSIMP_BUILD_NO_IFC_IMPORTER diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen1_2x3.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen1_2x3.cpp new file mode 100644 index 000000000..f4dbed1d1 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen1_2x3.cpp @@ -0,0 +1,3168 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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 */ + +//#include "AssimpPCH.h" +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "IFCReaderGen_2x3.h" + +namespace Assimp { + +using namespace ::Assimp::IFC; +using namespace ::Assimp::IFC::Schema_2x3; + +namespace { + typedef EXPRESS::ConversionSchema::SchemaEntry SchemaEntry; + + static const SchemaEntry schema_raw_2x3[] = { + SchemaEntry("ifcstairtypeenum",NULL ) +, SchemaEntry("ifcspacetypeenum",NULL ) +, SchemaEntry("ifcwalltypeenum",NULL ) +, SchemaEntry("ifcmonthinyearnumber",NULL ) +, SchemaEntry("ifcheatfluxdensitymeasure",NULL ) +, SchemaEntry("ifckinematicviscositymeasure",NULL ) +, SchemaEntry("ifcsequenceenum",NULL ) +, SchemaEntry("ifcairtoairheatrecoverytypeenum",NULL ) +, SchemaEntry("ifcactorselect",NULL ) +, SchemaEntry("ifctransformertypeenum",NULL ) +, SchemaEntry("ifcunitaryequipmenttypeenum",NULL ) +, SchemaEntry("ifcelectricflowstoragedevicetypeenum",NULL ) +, SchemaEntry("ifcenergysequenceenum",NULL ) +, SchemaEntry("ifcworkcontroltypeenum",NULL ) +, SchemaEntry("ifccurvaturemeasure",NULL ) +, SchemaEntry("ifcparametervalue",NULL ) +, SchemaEntry("ifcappliedvalueselect",NULL ) +, SchemaEntry("ifcwarpingconstantmeasure",NULL ) +, SchemaEntry("ifcarithmeticoperatorenum",NULL ) +, SchemaEntry("ifclinearforcemeasure",NULL ) +, SchemaEntry("ifcwindowpanelpositionenum",NULL ) +, SchemaEntry("ifcflowmetertypeenum",NULL ) +, SchemaEntry("ifcrampflighttypeenum",NULL ) +, SchemaEntry("ifcspecularhighlightselect",NULL ) +, SchemaEntry("ifcactiontypeenum",NULL ) +, SchemaEntry("ifcgeometricprojectionenum",NULL ) +, SchemaEntry("ifctimeseriesdatatypeenum",NULL ) +, SchemaEntry("ifcmagneticfluxmeasure",NULL ) +, SchemaEntry("ifcobjecttypeenum",NULL ) +, SchemaEntry("ifcdataoriginenum",NULL ) +, SchemaEntry("ifcmassdensitymeasure",NULL ) +, SchemaEntry("ifclightfixturetypeenum",NULL ) +, SchemaEntry("ifcservicelifetypeenum",NULL ) +, SchemaEntry("ifcelectricvoltagemeasure",NULL ) +, SchemaEntry("ifcheatingvaluemeasure",NULL ) +, SchemaEntry("ifcpresentabletext",NULL ) +, SchemaEntry("ifcaheadorbehind",NULL ) +, SchemaEntry("ifcsimplevalue",NULL ) +, SchemaEntry("ifcsensortypeenum",NULL ) +, SchemaEntry("ifcderivedunitenum",NULL ) +, SchemaEntry("ifcsizeselect",NULL ) +, SchemaEntry("ifctransportelementtypeenum",NULL ) +, SchemaEntry("ifcinventorytypeenum",NULL ) +, SchemaEntry("ifctextdecoration",NULL ) +, SchemaEntry("ifcdirectionsenseenum",NULL ) +, SchemaEntry("ifcductfittingtypeenum",NULL ) +, SchemaEntry("ifcdocumentstatusenum",NULL ) +, SchemaEntry("ifcslabtypeenum",NULL ) +, SchemaEntry("ifcdoorstyleconstructionenum",NULL ) +, SchemaEntry("ifcvolumemeasure",NULL ) +, SchemaEntry("ifcinductancemeasure",NULL ) +, SchemaEntry("ifccurtainwalltypeenum",NULL ) +, SchemaEntry("ifcsiunitname",NULL ) +, SchemaEntry("ifcspecularexponent",NULL ) +, SchemaEntry("ifcsoundpressuremeasure",NULL ) +, SchemaEntry("ifcanalysistheorytypeenum",NULL ) +, SchemaEntry("ifcgasterminaltypeenum",NULL ) +, SchemaEntry("ifcyearnumber",NULL ) +, SchemaEntry("ifcmodulusofelasticitymeasure",NULL ) +, SchemaEntry("ifcchangeactionenum",NULL ) +, SchemaEntry("ifcdampertypeenum",NULL ) +, SchemaEntry("ifcevaporatortypeenum",NULL ) +, SchemaEntry("ifcionconcentrationmeasure",NULL ) +, SchemaEntry("ifcductsegmenttypeenum",NULL ) +, SchemaEntry("ifcprotectivedevicetypeenum",NULL ) +, SchemaEntry("ifcabsorbeddosemeasure",NULL ) +, SchemaEntry("ifcmassperlengthmeasure",NULL ) +, SchemaEntry("ifctextfontname",NULL ) +, SchemaEntry("ifcorientationselect",NULL ) +, SchemaEntry("ifcilluminancemeasure",NULL ) +, SchemaEntry("ifcfiresuppressionterminaltypeenum",NULL ) +, SchemaEntry("ifcfontstyle",NULL ) +, SchemaEntry("ifcmomentofinertiameasure",NULL ) +, SchemaEntry("ifcmodulusofsubgradereactionmeasure",NULL ) +, SchemaEntry("ifccomplexnumber",NULL ) +, SchemaEntry("ifchumidifiertypeenum",NULL ) +, SchemaEntry("ifcpresentationstyleselect",NULL ) +, SchemaEntry("ifcthermaltransmittancemeasure",NULL ) +, SchemaEntry("ifcribplatedirectionenum",NULL ) +, SchemaEntry("ifcclassificationnotationselect",NULL ) +, SchemaEntry("ifcminuteinhour",NULL ) +, SchemaEntry("ifcinternalorexternalenum",NULL ) +, SchemaEntry("ifcrotationalfrequencymeasure",NULL ) +, SchemaEntry("ifcsanitaryterminaltypeenum",NULL ) +, SchemaEntry("ifcsymbolstyleselect",NULL ) +, SchemaEntry("ifcelementcompositionenum",NULL ) +, SchemaEntry("ifctextpath",NULL ) +, SchemaEntry("ifcpowermeasure",NULL ) +, SchemaEntry("ifcsurfacestyleelementselect",NULL ) +, SchemaEntry("ifcresourceconsumptionenum",NULL ) +, SchemaEntry("ifcelectriccapacitancemeasure",NULL ) +, SchemaEntry("ifclayersetdirectionenum",NULL ) +, SchemaEntry("ifcrailingtypeenum",NULL ) +, SchemaEntry("ifcobjectiveenum",NULL ) +, SchemaEntry("ifcdocumentselect",NULL ) +, SchemaEntry("ifcmodulusoflinearsubgradereactionmeasure",NULL ) +, SchemaEntry("ifcthermaladmittancemeasure",NULL ) +, SchemaEntry("ifctransitioncode",NULL ) +, SchemaEntry("ifcconnectiontypeenum",NULL ) +, SchemaEntry("ifcmonetarymeasure",NULL ) +, SchemaEntry("ifcstackterminaltypeenum",NULL ) +, SchemaEntry("ifccolour",NULL ) +, SchemaEntry("ifctext",NULL ) +, SchemaEntry("ifccontextdependentmeasure",NULL ) +, SchemaEntry("ifcthermalconductivitymeasure",NULL ) +, SchemaEntry("ifcprojectedortruelengthenum",NULL ) +, SchemaEntry("ifcpressuremeasure",NULL ) +, SchemaEntry("ifcmoisturediffusivitymeasure",NULL ) +, SchemaEntry("ifcbooleanoperator",NULL ) +, SchemaEntry("ifcpropertysourceenum",NULL ) +, SchemaEntry("ifctimestamp",NULL ) +, SchemaEntry("ifcmaterialselect",NULL ) +, SchemaEntry("ifcgloballyuniqueid",NULL ) +, SchemaEntry("ifcreflectancemethodenum",NULL ) +, SchemaEntry("ifcvaporpermeabilitymeasure",NULL ) +, SchemaEntry("ifctimeseriesscheduletypeenum",NULL ) +, SchemaEntry("ifclinearmomentmeasure",NULL ) +, SchemaEntry("ifcgeometricsetselect",NULL ) +, SchemaEntry("ifcsectionmodulusmeasure",NULL ) +, SchemaEntry("ifcbsplinecurveform",NULL ) +, SchemaEntry("ifcdimensionextentusage",NULL ) +, SchemaEntry("ifcthermalexpansioncoefficientmeasure",NULL ) +, SchemaEntry("ifchourinday",NULL ) +, SchemaEntry("ifclinearvelocitymeasure",NULL ) +, SchemaEntry("ifctorquemeasure",NULL ) +, SchemaEntry("ifctemperaturegradientmeasure",NULL ) +, SchemaEntry("ifcfillstyleselect",NULL ) +, SchemaEntry("ifcelectricchargemeasure",NULL ) +, SchemaEntry("ifcheatexchangertypeenum",NULL ) +, SchemaEntry("ifcelectriccurrentenum",NULL ) +, SchemaEntry("ifcdaylightsavinghour",NULL ) +, SchemaEntry("ifcshell",NULL ) +, SchemaEntry("ifcdoseequivalentmeasure",NULL ) +, SchemaEntry("ifcprojectordertypeenum",NULL ) +, SchemaEntry("ifcderivedmeasurevalue",NULL ) +, SchemaEntry("ifclightdistributioncurveenum",NULL ) +, SchemaEntry("ifcwarpingmomentmeasure",NULL ) +, SchemaEntry("ifcmembertypeenum",NULL ) +, SchemaEntry("ifcsoundpowermeasure",NULL ) +, SchemaEntry("ifctextalignment",NULL ) +, SchemaEntry("ifccurveoredgecurve",NULL ) +, SchemaEntry("ifcmassflowratemeasure",NULL ) +, SchemaEntry("ifcisothermalmoisturecapacitymeasure",NULL ) +, SchemaEntry("ifccsgselect",NULL ) +, SchemaEntry("ifccoolingtowertypeenum",NULL ) +, SchemaEntry("ifcmassmeasure",NULL ) +, SchemaEntry("ifcpileconstructionenum",NULL ) +, SchemaEntry("ifcdoorstyleoperationenum",NULL ) +, SchemaEntry("ifcflowdirectionenum",NULL ) +, SchemaEntry("ifcthermalloadsourceenum",NULL ) +, SchemaEntry("ifclengthmeasure",NULL ) +, SchemaEntry("ifcconstraintenum",NULL ) +, SchemaEntry("ifcaxis2placement",NULL ) +, SchemaEntry("ifcloadgrouptypeenum",NULL ) +, SchemaEntry("ifcvalue",NULL ) +, SchemaEntry("ifcreinforcingbarsurfaceenum",NULL ) +, SchemaEntry("ifcprojectorderrecordtypeenum",NULL ) +, SchemaEntry("ifcdatetimeselect",NULL ) +, SchemaEntry("ifcstructuralsurfacetypeenum",NULL ) +, SchemaEntry("ifcpermeablecoveringoperationenum",NULL ) +, SchemaEntry("ifcfontweight",NULL ) +, SchemaEntry("ifcphmeasure",NULL ) +, SchemaEntry("ifcdescriptivemeasure",NULL ) +, SchemaEntry("ifccurvestylefontselect",NULL ) +, SchemaEntry("ifcunit",NULL ) +, SchemaEntry("ifchatchlinedistanceselect",NULL ) +, SchemaEntry("ifctextstyleselect",NULL ) +, SchemaEntry("ifcmetricvalueselect",NULL ) +, SchemaEntry("ifcvectorordirection",NULL ) +, SchemaEntry("ifcassemblyplaceenum",NULL ) +, SchemaEntry("ifcairterminaltypeenum",NULL ) +, SchemaEntry("ifccoveringtypeenum",NULL ) +, SchemaEntry("ifcplanarforcemeasure",NULL ) +, SchemaEntry("ifcvalvetypeenum",NULL ) +, SchemaEntry("ifcalarmtypeenum",NULL ) +, SchemaEntry("ifcdynamicviscositymeasure",NULL ) +, SchemaEntry("ifccurrencyenum",NULL ) +, SchemaEntry("ifcmodulusofrotationalsubgradereactionmeasure",NULL ) +, SchemaEntry("ifccablecarrierfittingtypeenum",NULL ) +, SchemaEntry("ifcboolean",NULL ) +, SchemaEntry("ifcactionsourcetypeenum",NULL ) +, SchemaEntry("ifcstructuralactivityassignmentselect",NULL ) +, SchemaEntry("ifcdistributionchamberelementtypeenum",NULL ) +, SchemaEntry("ifcevaporativecoolertypeenum",NULL ) +, SchemaEntry("ifcmagneticfluxdensitymeasure",NULL ) +, SchemaEntry("ifclightdistributiondatasourceselect",NULL ) +, SchemaEntry("ifctubebundletypeenum",NULL ) +, SchemaEntry("ifcaccelerationmeasure",NULL ) +, SchemaEntry("ifcboilertypeenum",NULL ) +, SchemaEntry("ifcramptypeenum",NULL ) +, SchemaEntry("ifcluminousintensitydistributionmeasure",NULL ) +, SchemaEntry("ifctrimmingpreference",NULL ) +, SchemaEntry("ifcspecificheatcapacitymeasure",NULL ) +, SchemaEntry("ifcamountofsubstancemeasure",NULL ) +, SchemaEntry("ifcroleenum",NULL ) +, SchemaEntry("ifcdocumentconfidentialityenum",NULL ) +, SchemaEntry("ifcfrequencymeasure",NULL ) +, SchemaEntry("ifcsectiontypeenum",NULL ) +, SchemaEntry("ifcelementassemblytypeenum",NULL ) +, SchemaEntry("ifcfootingtypeenum",NULL ) +, SchemaEntry("ifclayereditem",NULL ) +, SchemaEntry("ifccablesegmenttypeenum",NULL ) +, SchemaEntry("ifcdefinedsymbolselect",NULL ) +, SchemaEntry("ifcbuildingelementproxytypeenum",NULL ) +, SchemaEntry("ifcelectricgeneratortypeenum",NULL ) +, SchemaEntry("ifcrotationalstiffnessmeasure",NULL ) +, SchemaEntry("ifcspaceheatertypeenum",NULL ) +, SchemaEntry("ifcareameasure",NULL ) +, SchemaEntry("ifclabel",NULL ) +, SchemaEntry("ifccostscheduletypeenum",NULL ) +, SchemaEntry("ifcswitchingdevicetypeenum",NULL ) +, SchemaEntry("ifcelectrictimecontroltypeenum",NULL ) +, SchemaEntry("ifcfiltertypeenum",NULL ) +, SchemaEntry("ifcpositivelengthmeasure",NULL ) +, SchemaEntry("ifcnullstyle",NULL ) +, SchemaEntry("ifcconditioncriterionselect",NULL ) +, SchemaEntry("ifcshearmodulusmeasure",NULL ) +, SchemaEntry("ifcnormalisedratiomeasure",NULL ) +, SchemaEntry("ifcdoorpaneloperationenum",NULL ) +, SchemaEntry("ifcpointorvertexpoint",NULL ) +, SchemaEntry("ifcrooftypeenum",NULL ) +, SchemaEntry("ifccountmeasure",NULL ) +, SchemaEntry("ifcelectricconductancemeasure",NULL ) +, SchemaEntry("ifcproceduretypeenum",NULL ) +, SchemaEntry("ifcflowinstrumenttypeenum",NULL ) +, SchemaEntry("ifcelectricmotortypeenum",NULL ) +, SchemaEntry("ifcsurfaceside",NULL ) +, SchemaEntry("ifcstructuralcurvetypeenum",NULL ) +, SchemaEntry("ifccondensertypeenum",NULL ) +, SchemaEntry("ifclinearstiffnessmeasure",NULL ) +, SchemaEntry("ifcunitenum",NULL ) +, SchemaEntry("ifcoccupanttypeenum",NULL ) +, SchemaEntry("ifcthermalloadtypeenum",NULL ) +, SchemaEntry("ifcreinforcingbarroleenum",NULL ) +, SchemaEntry("ifcbenchmarkenum",NULL ) +, SchemaEntry("ifcpositiveplaneanglemeasure",NULL ) +, SchemaEntry("ifctexttransformation",NULL ) +, SchemaEntry("ifcdraughtingcalloutelement",NULL ) +, SchemaEntry("ifcratiomeasure",NULL ) +, SchemaEntry("ifcsolidanglemeasure",NULL ) +, SchemaEntry("ifcpipesegmenttypeenum",NULL ) +, SchemaEntry("ifccablecarriersegmenttypeenum",NULL ) +, SchemaEntry("ifccolourorfactor",NULL ) +, SchemaEntry("ifcidentifier",NULL ) +, SchemaEntry("ifctendontypeenum",NULL ) +, SchemaEntry("ifccontrollertypeenum",NULL ) +, SchemaEntry("ifcradioactivitymeasure",NULL ) +, SchemaEntry("ifctimemeasure",NULL ) +, SchemaEntry("ifcpumptypeenum",NULL ) +, SchemaEntry("ifcelectricheatertypeenum",NULL ) +, SchemaEntry("ifcbeamtypeenum",NULL ) +, SchemaEntry("ifcstateenum",NULL ) +, SchemaEntry("ifcsiprefix",NULL ) +, SchemaEntry("ifcnumericmeasure",NULL ) +, SchemaEntry("ifcoutlettypeenum",NULL ) +, SchemaEntry("ifccompoundplaneanglemeasure",NULL ) +, SchemaEntry("ifcservicelifefactortypeenum",NULL ) +, SchemaEntry("ifclogicaloperatorenum",NULL ) +, SchemaEntry("ifcbooleanoperand",NULL ) +, SchemaEntry("ifcobjectreferenceselect",NULL ) +, SchemaEntry("ifccooledbeamtypeenum",NULL ) +, SchemaEntry("ifcductsilencertypeenum",NULL ) +, SchemaEntry("ifcsectionalareaintegralmeasure",NULL ) +, SchemaEntry("ifcfontvariant",NULL ) +, SchemaEntry("ifcvolumetricflowratemeasure",NULL ) +, SchemaEntry("ifcplatetypeenum",NULL ) +, SchemaEntry("ifcenvironmentalimpactcategoryenum",NULL ) +, SchemaEntry("ifcvibrationisolatortypeenum",NULL ) +, SchemaEntry("ifcthermodynamictemperaturemeasure",NULL ) +, SchemaEntry("ifcrotationalmassmeasure",NULL ) +, SchemaEntry("ifcsecondinminute",NULL ) +, SchemaEntry("ifcdayinmonthnumber",NULL ) +, SchemaEntry("ifcdimensioncount",NULL ) +, SchemaEntry("ifcwindowstyleoperationenum",NULL ) +, SchemaEntry("ifcthermalresistancemeasure",NULL ) +, SchemaEntry("ifcmeasurevalue",NULL ) +, SchemaEntry("ifcwindowpaneloperationenum",NULL ) +, SchemaEntry("ifcchillertypeenum",NULL ) +, SchemaEntry("ifcpositiveratiomeasure",NULL ) +, SchemaEntry("ifcinteger",NULL ) +, SchemaEntry("ifclogical",NULL ) +, SchemaEntry("ifcjunctionboxtypeenum",NULL ) +, SchemaEntry("ifcaddresstypeenum",NULL ) +, SchemaEntry("ifcwasteterminaltypeenum",NULL ) +, SchemaEntry("ifctrimmingselect",NULL ) +, SchemaEntry("ifclightemissionsourceenum",NULL ) +, SchemaEntry("ifcsoundscaleenum",NULL ) +, SchemaEntry("ifcluminousfluxmeasure",NULL ) +, SchemaEntry("ifcelectricresistancemeasure",NULL ) +, SchemaEntry("ifcintegercountratemeasure",NULL ) +, SchemaEntry("ifcphysicalorvirtualenum",NULL ) +, SchemaEntry("ifcmolecularweightmeasure",NULL ) +, SchemaEntry("ifcprofiletypeenum",NULL ) +, SchemaEntry("ifcboxalignment",NULL ) +, SchemaEntry("ifcglobalorlocalenum",NULL ) +, SchemaEntry("ifcspecularroughness",NULL ) +, SchemaEntry("ifclamptypeenum",NULL ) +, SchemaEntry("ifcpiletypeenum",NULL ) +, SchemaEntry("ifcelectriccurrentmeasure",NULL ) +, SchemaEntry("ifcfantypeenum",NULL ) +, SchemaEntry("ifcsurfaceorfacesurface",NULL ) +, SchemaEntry("ifcpipefittingtypeenum",NULL ) +, SchemaEntry("ifctanktypeenum",NULL ) +, SchemaEntry("ifccurvefontorscaledcurvefontselect",NULL ) +, SchemaEntry("ifcwindowstyleconstructionenum",NULL ) +, SchemaEntry("ifcairterminalboxtypeenum",NULL ) +, SchemaEntry("ifcstairflighttypeenum",NULL ) +, SchemaEntry("ifcluminousintensitymeasure",NULL ) +, SchemaEntry("ifcmotorconnectiontypeenum",NULL ) +, SchemaEntry("ifcplaneanglemeasure",NULL ) +, SchemaEntry("ifcactuatortypeenum",NULL ) +, SchemaEntry("ifccolumntypeenum",NULL ) +, SchemaEntry("ifctextfontselect",NULL ) +, SchemaEntry("ifcdoorpanelpositionenum",NULL ) +, SchemaEntry("ifccoiltypeenum",NULL ) +, SchemaEntry("ifcangularvelocitymeasure",NULL ) +, SchemaEntry("ifcanalysismodeltypeenum",NULL ) +, SchemaEntry("ifclibraryselect",NULL ) +, SchemaEntry("ifcforcemeasure",NULL ) +, SchemaEntry("ifcfillareastyletileshapeselect",NULL ) +, SchemaEntry("ifcelectricappliancetypeenum",NULL ) +, SchemaEntry("ifcsurfacetextureenum",NULL ) +, SchemaEntry("ifccharacterstyleselect",NULL ) +, SchemaEntry("ifcenergymeasure",NULL ) +, SchemaEntry("ifcreal",NULL ) +, SchemaEntry("ifccompressortypeenum",NULL ) +, SchemaEntry("ifcelectricdistributionpointfunctionenum",NULL ) +, SchemaEntry("ifcroot",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjectdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionflowelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowcontrollertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectrictimecontroltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshapemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctopologyrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnects",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcoversspaces",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarrierfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslippageconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyconversiondevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoiltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcperformancehistory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextliteral",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextliteralwithextent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionflowelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundedcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifc2dcompositecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarycondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundaryfacecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsimpleproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyenumeratedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationlayerassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationlayerwithstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairflighttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementarysurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplane",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbooleanresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbooleanclippingresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsolidmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmanifoldsolidbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeneralprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstackterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurveconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcjunctionboxtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociates",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesconstraint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertydefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysetdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorpanelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraintrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspacethermalloadproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclibraryinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctask",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcappliedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenvironmentalimpactvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelfillselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprocedure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralload",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadstatic",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingledisplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproxy",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubcontractresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccalendardate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentelectronicformat",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcontainedinspatialstructure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductsofcombustionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctopologicalrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplatetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjectplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgridplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiresuppressionterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowstoragedevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcperson",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfaceofrevolution",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorientededge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcownerhistory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassigns",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdirection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcementbarproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcparameterizedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelementsubtraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchamferedgefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumn",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyreferencevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialclassificationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricmotortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialstructureelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspacetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedhatchstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumntype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccranerailashapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccondensertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectselements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectswithrealizingelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccircleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccirclehollowprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorganizationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis2placement3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcequipmentelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurvesegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalcomplexquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociateslibrary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelsequence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementproxy",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncontrolelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowinstrumenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingcallout",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncurvedirectedcallout",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclineardimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementassembly",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingcalloutrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccsgprimitive3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrightcircularcone",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedsurfacestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectorder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyconstraintrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcangulardimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylefordefinedfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclocalplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrevolvedareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfaceconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcradiusdimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptdisksolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchalfspacesolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolygonalboundedhalfspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncalloutrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccooledbeamtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclaborresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingledisplacementdistortion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyboundedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrampflighttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadplanarforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctubebundletype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvalvetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctrimmedcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefines",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbyproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstocontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoccupant",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchumidifiertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryopenprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoprojectorder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpermit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoffsetcurve3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcepositional",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacetexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcblobtexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylelighting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalsimplequantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationnotation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcramp",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefineditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedcurvefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedcolour",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurrencyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmovingdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspaceheatertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclamptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementcomponent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingbar",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricheatertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjective",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralactivity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturecoordinate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmonetaryunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitytime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctablerow",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightdistributiondata",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator2dnonuniform",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationnotationfacet",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesapproval",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedcurvefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingleforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingleforcewarping",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefontandscaling",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvirtualelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrightcircularcylinder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoutlettype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldecomposes",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelnests",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccovering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcirregulartimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolyline",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpath",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementcomponent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfastener",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmappeditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmetric",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangularpyramid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelreferencedinspatialstructure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccrewresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcnamedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontextdependentunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitaryequipmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroof",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstasks",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsports",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstylemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstyledrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialstructureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuilding",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectedfaceset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopenshell",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacetedbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclocaltime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalconcretematerialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconic",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoveringtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroundedrectangleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmovingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompressortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowpanelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedterminatorsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcishapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcasymmetricishapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontrollertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrailing",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcasset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialdefinitionrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefontpattern",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalpropertyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrailingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwall",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectiongeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionpointgeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertylistvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurniturestandard",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelschedulescostitems",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricgeneratortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstyleditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationsymboloccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryclosedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryprofiledefwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcline",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayerset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowsegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminalboxtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysinglevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcalarmtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcellipseprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstair",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylefontmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestyleshading",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpumptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdefinedsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationitemrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeneralmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementcomponenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfastenertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalfastenertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpermeablecoveringproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowfitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapproval",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshapeaspect",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraintclassificationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcedirectional",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralactivity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfuelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowcontroller",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfailureconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingstorey",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkcontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctable",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsteelprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacemember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacemembervarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacesurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallist",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoordinateduniversaltimeoffset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplanarextent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplanarbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionreinforcementproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourspecification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvector",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeam",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourrgb",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralplanaraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralplanaractionvarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsite",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiscreteaccessorytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvibrationisolatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporativecoolertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionchamberelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelementaddition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructureddimensioncallout",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoolingtowertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccenterlineprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturevertex",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorganization",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcegoniometric",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcribplateprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransformertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmembertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfaceoflinearextrusion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmotorconnectiontype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowtreatmentdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsilencertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowliningproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnishingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystemfurnitureelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionpointeccentricity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwasteterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbsplinecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeziercurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentinformationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactuatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncontrolelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesdocument",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorliningproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshellbasedsurfacemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactionrequest",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextrudedareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastylehatching",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelvoidselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectspathelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelspaceboundary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacecurvesweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator3dnonuniform",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelinteractionrequirements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurtainwalltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitylength",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcequipmentstandard",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowstoragedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvirtualgridintersection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiameterdimension",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcswitchingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaddress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctelecomaddress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindow",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalsteelmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowtreatmentdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelservicesbuildings",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchillertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectanglehollowprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboxedhalfspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis2placement2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspaceprogram",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesianpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolyloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedpointmarkersymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcterminatorsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncurveterminator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelprojectselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctrapeziumprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylewithboxcharacteristics",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurveboundedplane",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitycount",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesreferencerelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadtemperature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsiunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralreaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointreaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis1placement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcementdefinitionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricappliancetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsensortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnishingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprotectivedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifczshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcscheduletimecontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationmap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclosedshell",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementpart",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedcolour",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpostaladdress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcblock",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightfixturetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopeningelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcespot",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendonanchor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylerefraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricflowstoragedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfluidflowproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsphere",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesappliedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdampertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectorderrecord",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensionalexponents",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionchamberelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalfastener",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityvolume",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangulartrimmedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdateandtime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifczone",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfantype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyletiles",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpixeltexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablesegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreloverridesproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmeasurewithunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslabtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcservicelife",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnituretype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingmesh",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextendedmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactorrole",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacetedbrepwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraintaggregationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgasterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectswitheccentricity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpile",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyletilesymbolwithstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricalbaseproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionmaterialresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationcurveoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensioncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometriccurveset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelaggregates",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacebasedsurfacemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyconversiondevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrampflight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyenumeration",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcushapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchygroscopicmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacebound",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfaceouterbound",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifconedirectionrepeatfactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboilertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionequipmentresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccomplexproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfooting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopticalmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionproductresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundaryedgecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertytablevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstogroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmetertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsporttoelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesclassification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccranerailfshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowsegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarynodecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarynodeconditionwarping",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurtainwall",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiscreteaccessory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgrid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsanitaryterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsoundproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubedge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstyletextmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiltertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsymbolstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendon",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensionpair",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationstyleassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcregulartimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvemember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourceambient",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcport",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcheatexchangertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctanktype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcinventory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcappliedvaluerelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsoundvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransportelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairtoairheatrecoverytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairflight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricalelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightintensitydistribution",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylewithtextures",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundingbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapplication",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwalltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmove",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccircle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoffsetcurve2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayersetusage",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpointoncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralresultgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionedspine",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslab",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionportgeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityweight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesmaterial",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertex",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreferencesvaluedocument",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpersonandorganization",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelflowcontrolelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructurallinearaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructurallinearactionvarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementproxytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectionelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalactorrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconversionbasedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterial",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationsubcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationsurfaceoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefineddimensionsymbol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroundededgefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcoversbldgelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricdistributionpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarriersegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadlinearforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgridaxis",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcirregulartimeseriesvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwallstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreloccupiesspaces",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedunitelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccsgsolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeamtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationfillarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelaxation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvemembervarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpointonsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertydependencyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexbasedtexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorderaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclibraryreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgeloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationfillareaoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkplan",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcellipse",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductdefinitionshape",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectioncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricalcircuit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrationalbeziercurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcservicelifefactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcthermalmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturecoordinategenerator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipesegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctwodirectionrepeatfactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshaperepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylerendering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionport",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcimagetexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipefittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransportelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationtextoccurrence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionsurfacegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralanalysismodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectioncurvegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconditioncriterion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwaterproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayer",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostvalue",&STEP::ObjectHelper::Construct ) + + }; +} + +// ----------------------------------------------------------------------------------------------------------- +void IFC::Schema_2x3::GetSchema(EXPRESS::ConversionSchema& out) { + out = EXPRESS::ConversionSchema(schema_raw_2x3); +} + +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, IfcRoot* in) +{ + size_t base = 0; + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRoot"); } do { // convert the 'GlobalId' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->GlobalId, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRoot to be a `IfcGloballyUniqueId`")); } + } while(0); + do { // convert the 'OwnerHistory' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->OwnerHistory, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRoot to be a `IfcOwnerHistory`")); } + } while(0); + do { // convert the 'Name' 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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRoot to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Description' 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->Description, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRoot to be a `IfcText`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcObjectDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeObject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeProduct* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowControllerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricTimeControlType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentation* in) +{ + size_t base = 0; + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRepresentation"); } do { // convert the 'ContextOfItems' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ContextOfItems, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentation to be a `IfcRepresentationContext`")); } + } while(0); + do { // convert the 'RepresentationIdentifier' 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->RepresentationIdentifier, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'RepresentationType' 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->RepresentationType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Items' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->Items, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRepresentation to be a `SET [1:?] OF IfcRepresentationItem`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologyRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelationship* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelationship"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelConnects* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelConnects"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoilType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcObject"); } do { // convert the 'ObjectType' 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->ObjectType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcObject to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPerformanceHistory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& /*db*/, const LIST& /*params*/, IfcRepresentationItem* /*in*/) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteral* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteralWithExtent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductRepresentation* in) +{ + size_t base = 0; + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcProductRepresentation"); } do { // convert the 'Name' 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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProductRepresentation to be a `IfcLabel`")); } + } 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 IfcProductRepresentation to be a `IfcText`")); } + } while(0); + do { // convert the 'Representations' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->Representations, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcProductRepresentation to be a `LIST [1:?] OF IfcRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProduct* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcProduct"); } do { // convert the 'ObjectPlacement' 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->ObjectPlacement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProduct to be a `IfcObjectPlacement`")); } + } while(0); + do { // convert the 'Representation' 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->Representation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProduct to be a `IfcProductRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcElement"); } do { // convert the 'Tag' 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->Tag, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcElement to be a `IfcIdentifier`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCompositeCurve"); } 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 0 to IfcCompositeCurve to be a `LIST [1:?] OF IfcCompositeCurveSegment`")); } + } while(0); + do { // convert the 'SelfIntersect' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->SelfIntersect, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurve to be a `LOGICAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, Ifc2DCompositeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCartesianTransformationOperator"); } 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 IfcCartesianTransformationOperator to be a `IfcDirection`")); } + } 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 IfcCartesianTransformationOperator to be a `IfcDirection`")); } + } while(0); + do { // convert the 'LocalOrigin' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->LocalOrigin, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCartesianTransformationOperator to be a `IfcCartesianPoint`")); } + } 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 IfcCartesianTransformationOperator to be a `REAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCartesianTransformationOperator3D"); } do { // convert the 'Axis3' 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->Axis3, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCartesianTransformationOperator3D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProperty* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProperty"); } 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 IfcProperty to be a `IfcIdentifier`")); } + } 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 IfcProperty to be a `IfcText`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSimpleProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSimpleProperty"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyEnumeratedValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlightType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementarySurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcElementarySurface"); } 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 0 to IfcElementarySurface to be a `IfcAxis2Placement3D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlane* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlane"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanResult* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanResult"); } do { // convert the 'Operator' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Operator, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBooleanResult to be a `IfcBooleanOperator`")); } + } while(0); + do { // convert the 'FirstOperand' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->FirstOperand, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBooleanResult to be a `IfcBooleanOperand`")); } + } while(0); + do { // convert the 'SecondOperand' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->SecondOperand, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBooleanResult to be a `IfcBooleanOperand`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanClippingResult* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanClippingResult"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSolidModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcManifoldSolidBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcManifoldSolidBrep"); } 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 0 to IfcManifoldSolidBrep to be a `IfcClosedShell`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStackTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcJunctionBoxType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySetDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySetDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcess* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTask* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelFillsElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelFillsElement"); } do { // convert the 'RelatingOpeningElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelFillsElement to be a `IfcOpeningElement`")); } + } while(0); + do { // convert the 'RelatedBuildingElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelFillsElement to be a `IfcElement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcedure* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProxy* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubContractResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelContainedInSpatialStructure* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelContainedInSpatialStructure"); } do { // convert the 'RelatedElements' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedElements, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelContainedInSpatialStructure to be a `SET [1:?] OF IfcProduct`")); } + } while(0); + do { // convert the 'RelatingStructure' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingStructure, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelContainedInSpatialStructure to be a `IfcSpatialStructureElement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologicalRepresentationItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlateType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& /*db*/, const LIST& /*params*/, IfcObjectPlacement* /*in*/) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGridPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFireSuppressionTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfRevolution* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrientedEdge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDirection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcDirection"); } do { // convert the 'DirectionRatios' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->DirectionRatios, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcDirection to be a `LIST [2:3] OF REAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProfileDef* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProfileDef"); } do { // convert the 'ProfileType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ProfileType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProfileDef to be a `IfcProfileTypeEnum`")); } + } while(0); + do { // convert the 'ProfileName' 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->ProfileName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProfileDef to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcParameterizedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcParameterizedProfileDef"); } 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 2 to IfcParameterizedProfileDef to be a `IfcAxis2Placement2D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementSubtraction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElementSubtraction"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChamferEdgeFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcBuildingElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumn* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyReferenceValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricMotorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumnType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCraneRailAShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondenserType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCircleProfileDef"); } 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 3 to IfcCircleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleHollowProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCircleHollowProfileDef"); } do { // convert the 'WallThickness' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->WallThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCircleHollowProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlacement"); } 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 0 to IfcPlacement to be a `IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcAxis2Placement3D"); } 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 1 to IfcAxis2Placement3D to be a `IfcDirection`")); } + } while(0); + do { // convert the 'RefDirection' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcAxis2Placement3D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyle* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyle"); } do { // convert the 'Name' 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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyle to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEquipmentElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurveSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcCompositeCurveSegment"); } do { // convert the 'Transition' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Transition, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCompositeCurveSegment to be a `IfcTransitionCode`")); } + } while(0); + do { // convert the 'SameSense' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SameSense, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurveSegment to be a `BOOLEAN`")); } + } while(0); + do { // convert the 'ParentCurve' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ParentCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCompositeCurveSegment to be a `IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRectangleProfileDef"); } do { // convert the 'XDim' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->XDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'YDim' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->YDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxy* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowInstrumentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDraughtingCallout* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurveDirectedCallout* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLinearDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementAssembly* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgPrimitive3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrder* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAngularDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLocalPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLocalPlacement"); } do { // convert the 'PlacementRelTo' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->PlacementRelTo, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLocalPlacement to be a `IfcObjectPlacement`")); } + } while(0); + do { // convert the 'RelativePlacement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelativePlacement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLocalPlacement to be a `IfcAxis2Placement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSweptAreaSolid"); } do { // convert the 'SweptArea' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->SweptArea, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptAreaSolid to be a `IfcProfileDef`")); } + } while(0); + do { // convert the 'Position' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptAreaSolid to be a `IfcAxis2Placement3D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRevolvedAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRevolvedAreaSolid"); } 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 IfcRevolvedAreaSolid to be a `IfcAxis1Placement`")); } + } 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 IfcRevolvedAreaSolid to be a `IfcPlaneAngleMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRadiusDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptDiskSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcSweptDiskSolid"); } 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 0 to IfcSweptDiskSolid to be a `IfcCurve`")); } + } 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 1 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'InnerRadius' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->InnerRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'StartParam' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->StartParam, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } + } while(0); + do { // convert the 'EndParam' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->EndParam, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHalfSpaceSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcHalfSpaceSolid"); } do { // convert the 'BaseSurface' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->BaseSurface, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcHalfSpaceSolid to be a `IfcSurface`")); } + } while(0); + do { // convert the 'AgreementFlag' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->AgreementFlag, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcHalfSpaceSolid to be a `BOOLEAN`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolygonalBoundedHalfSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPolygonalBoundedHalfSpace"); } 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 IfcPolygonalBoundedHalfSpace to be a `IfcAxis2Placement3D`")); } + } while(0); + do { // convert the 'PolygonalBoundary' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->PolygonalBoundary, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPolygonalBoundedHalfSpace to be a `IfcBoundedCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTimeSeriesSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCooledBeamType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcProject"); } do { // convert the 'LongName' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->LongName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProject to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Phase' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Phase, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProject to be a `IfcLabel`")); } + } while(0); + do { // convert the 'RepresentationContexts' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RepresentationContexts, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcProject to be a `SET [1:?] OF IfcRepresentationContext`")); } + } while(0); + do { // convert the 'UnitsInContext' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->UnitsInContext, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcProject to be a `IfcUnitAssignment`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLaborResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyBoundedValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlightType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTubeBundleType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcValveType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrimmedCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcTrimmedCurve"); } do { // convert the 'BasisCurve' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->BasisCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcTrimmedCurve to be a `IfcCurve`")); } + } while(0); + do { // convert the 'Trim1' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Trim1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } + } while(0); + do { // convert the 'Trim2' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Trim2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } + } while(0); + do { // convert the 'SenseAgreement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SenseAgreement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcTrimmedCurve to be a `BOOLEAN`")); } + } while(0); + do { // convert the 'MasterRepresentation' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MasterRepresentation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcTrimmedCurve to be a `IfcTrimmingPreference`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefines* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRelDefines"); } do { // convert the 'RelatedObjects' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->RelatedObjects, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDefines to be a `SET [1:?] OF IfcObject`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefinesByProperties* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDefinesByProperties"); } do { // convert the 'RelatingPropertyDefinition' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->RelatingPropertyDefinition, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDefinesByProperties to be a `IfcPropertySetDefinition`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOccupant* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHumidifierType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryOpenProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryOpenProfileDef"); } do { // convert the 'Curve' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Curve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryOpenProfileDef to be a `IfcBoundedCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPermit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourcePositional* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRamp* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceHeaterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLampType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementComponent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingBar* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricHeaterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralActivity* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2DnonUniform* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVirtualElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCylinder* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOutletType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDecomposes* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDecomposes"); } do { // convert the 'RelatingObject' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->RelatingObject, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDecomposes to be a `IfcObjectDefinition`")); } + } while(0); + do { // convert the 'RelatedObjects' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->RelatedObjects, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDecomposes to be a `SET [1:?] OF IfcObjectDefinition`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCovering* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyline* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyline"); } 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 0 to IfcPolyline to be a `LIST [2:?] OF IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPath* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastener* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMappedItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMappedItem"); } do { // convert the 'MappingSource' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingSource, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMappedItem to be a `IfcRepresentationMap`")); } + } while(0); + do { // convert the 'MappingTarget' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingTarget, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMappedItem to be a `IfcCartesianTransformationOperator`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularPyramid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCrewResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcNamedUnit* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); } do { // convert the 'Dimensions' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + 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 IfcNamedUnit to be a `IfcDimensionalExponents`")); } + } while(0); + do { // convert the 'UnitType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->UnitType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcNamedUnit to be a `IfcUnitEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcContextDependentUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryEquipmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoof* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyleModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSpatialStructureElement"); } do { // convert the 'LongName' 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->LongName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSpatialStructureElement to be a `IfcLabel`")); } + } while(0); + do { // convert the 'CompositionType' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->CompositionType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuilding* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 12) { throw STEP::TypeError("expected 12 arguments to IfcBuilding"); } do { // convert the 'ElevationOfRefHeight' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationOfRefHeight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcBuilding to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'ElevationOfTerrain' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationOfTerrain, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcBuilding to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'BuildingAddress' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->BuildingAddress, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcBuilding to be a `IfcPostalAddress`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConnectedFaceSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConnectedFaceSet"); } do { // convert the 'CfsFaces' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->CfsFaces, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConnectedFaceSet to be a `SET [1:?] OF IfcFace`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpenShell* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConic* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConic"); } 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 0 to IfcConic to be a `IfcAxis2Placement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoveringType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedRectangleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompressorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcIShapeProfileDef"); } do { // convert the 'OverallWidth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->OverallWidth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'OverallDepth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->OverallDepth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'WebThickness' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->WebThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'FlangeThickness' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->FlangeThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'FilletRadius' 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->FilletRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcControllerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailing* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsset* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMaterialDefinitionRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWall* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyListValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyListValue"); } do { // convert the 'ListValues' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ListValues, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertyListValue to be a `LIST [1:?] OF IfcValue`")); } + } while(0); + do { // convert the 'Unit' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Unit, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertyListValue to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureStandard* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricGeneratorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to IfcDoor"); } do { // convert the 'OverallHeight' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->OverallHeight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'OverallWidth' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->OverallWidth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcStyledItem"); } do { // convert the 'Item' 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->Item, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcStyledItem to be a `IfcRepresentationItem`")); } + } while(0); + do { // convert the 'Styles' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->Styles, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcStyledItem to be a `SET [1:?] OF IfcPresentationStyleAssignment`")); } + } while(0); + do { // convert the 'Name' 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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcStyledItem to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSymbolOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryClosedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryClosedProfileDef"); } do { // convert the 'OuterCurve' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->OuterCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryClosedProfileDef to be a `IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLine"); } 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 0 to IfcLine to be a `IfcCartesianPoint`")); } + } 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 1 to IfcLine to be a `IfcVector`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalBoxType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySingleValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySingleValue"); } do { // convert the 'NominalValue' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->NominalValue, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertySingleValue to be a `IfcValue`")); } + } while(0); + do { // convert the 'Unit' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Unit, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertySingleValue to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAlarmType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipseProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStair* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleShading* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleShading"); } do { // convert the 'SurfaceColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->SurfaceColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleShading to be a `IfcColourRgb`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPumpType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDefinedSymbol* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastenerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastenerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceDirectional* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- + +} // ! STEP +} // ! Assimp + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen2_2x3.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen2_2x3.cpp new file mode 100644 index 000000000..7dabe278e --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen2_2x3.cpp @@ -0,0 +1,1918 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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 "AssimpPCH.h" +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "IFCReaderGen_2x3.h" + +namespace Assimp { +using namespace IFC; +using namespace ::Assimp::IFC::Schema_2x3; + +namespace STEP { + +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcSurfaceStyle"); } 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 1 to IfcSurfaceStyle to be a `IfcSurfaceSide`")); } + } 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 2 to IfcSurfaceStyle to be a `SET [1:5] OF IfcSurfaceStyleElementSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowController* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingStorey* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFace"); } 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 0 to IfcFace to be a `SET [1:?] OF IfcFaceBound`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMemberVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarExtent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourSpecification* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcColourSpecification"); } do { // convert the 'Name' 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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcColourSpecification to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVector* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcVector"); } 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 0 to IfcVector to be a `IfcDirection`")); } + } 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 1 to IfcVector to be a `IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeam* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourRgb* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcColourRgb"); } 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 IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } 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 IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } 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 IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarActionVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSite* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 14) { throw STEP::TypeError("expected 14 arguments to IfcSite"); } do { // convert the 'RefLatitude' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefLatitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } + } while(0); + do { // convert the 'RefLongitude' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefLongitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } + } while(0); + do { // convert the 'RefElevation' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefElevation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcSite to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'LandTitleNumber' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->LandTitleNumber, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcSite to be a `IfcLabel`")); } + } while(0); + do { // convert the 'SiteAddress' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SiteAddress, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to IfcSite to be a `IfcPostalAddress`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessoryType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVibrationIsolatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporativeCoolerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementAddition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuredDimensionCallout* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoolingTowerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCenterLineProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindowStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceGoniometric* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransformerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMemberType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfLinearExtrusion* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMotorConnectionType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSilencerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystemFurnitureElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWasteTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcBSplineCurve"); } 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 0 to IfcBSplineCurve to be a `INTEGER`")); } + } while(0); + do { // convert the 'ControlPointsList' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->ControlPointsList, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBSplineCurve to be a `LIST [2:?] OF IfcCartesianPoint`")); } + } while(0); + do { // convert the 'CurveForm' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->CurveForm, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBSplineCurve to be a `IfcBSplineCurveForm`")); } + } while(0); + do { // convert the 'ClosedCurve' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->ClosedCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBSplineCurve to be a `LOGICAL`")); } + } while(0); + do { // convert the 'SelfIntersect' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } + try { GenericConvert( in->SelfIntersect, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcBSplineCurve to be a `LOGICAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBezierCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActuatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcAnnotation"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShellBasedSurfaceModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcShellBasedSurfaceModel"); } do { // convert the 'SbsmBoundary' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SbsmBoundary, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcShellBasedSurfaceModel to be a `SET [1:?] OF IfcShell`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActionRequest* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcExtrudedAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcExtrudedAreaSolid"); } do { // convert the 'ExtrudedDirection' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ExtrudedDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcExtrudedAreaSolid to be a `IfcDirection`")); } + } 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 IfcExtrudedAreaSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleHatching* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelVoidsElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelVoidsElement"); } do { // convert the 'RelatingBuildingElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelVoidsElement to be a `IfcElement`")); } + } while(0); + do { // convert the 'RelatedOpeningElement' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelVoidsElement to be a `IfcFeatureElementSubtraction`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceCurveSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3DnonUniform* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcCartesianTransformationOperator3DnonUniform"); } do { // convert the 'Scale2' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); } + } while(0); + do { // convert the 'Scale3' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale3, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcCartesianTransformationOperator3DnonUniform to be a `REAL`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWallType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEquipmentStandard* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiameterDimension* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSwitchingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindow* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChillerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleHollowProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoxedHalfSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis2Placement2D"); } do { // convert the 'RefDirection' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement2D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceProgram* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcCartesianPoint"); } 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 0 to IfcCartesianPoint to be a `LIST [1:3] OF IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyLoop"); } 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 IfcPolyLoop to be a `LIST [3:?] OF IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTerminatorSymbol* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurveTerminator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrapeziumProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationContext* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationContext"); } do { // convert the 'ContextIdentifier' 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->ContextIdentifier, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationContext to be a `IfcLabel`")); } + } while(0); + do { // convert the 'ContextType' 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->ContextType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationContext to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcGeometricRepresentationContext"); } do { // convert the 'CoordinateSpaceDimension' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->CoordinateSpaceDimension, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcGeometricRepresentationContext to be a `IfcDimensionCount`")); } + } while(0); + do { // convert the 'Precision' 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->Precision, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcGeometricRepresentationContext to be a `REAL`")); } + } while(0); + do { // convert the 'WorldCoordinateSystem' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->WorldCoordinateSystem, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcGeometricRepresentationContext to be a `IfcAxis2Placement`")); } + } while(0); + do { // convert the 'TrueNorth' 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->TrueNorth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcGeometricRepresentationContext to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurveBoundedPlane* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSIUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcSIUnit"); } 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 2 to IfcSIUnit to be a `IfcSIPrefix`")); } + } 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 3 to IfcSIUnit to be a `IfcSIUnitName`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis1Placement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis1Placement"); } 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 1 to IfcAxis1Placement to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricApplianceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSensorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcZShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcScheduleTimeControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationMap* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationMap"); } do { // convert the 'MappingOrigin' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingOrigin, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationMap to be a `IfcAxis2Placement`")); } + } while(0); + do { // convert the 'MappedRepresentation' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappedRepresentation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationMap to be a `IfcRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcClosedShell* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcClosedShell"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementPart* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBlock* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightFixtureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpeningElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcOpeningElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceSpot* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendonAnchor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricFlowStorageDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSphere* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDamperType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrderRecord* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastener* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularTrimmedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcZone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFanType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTiles* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelOverridesProperties* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMeasureWithUnit* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMeasureWithUnit"); } do { // convert the 'ValueComponent' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ValueComponent, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMeasureWithUnit to be a `IfcValue`")); } + } while(0); + do { // convert the 'UnitComponent' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->UnitComponent, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMeasureWithUnit to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlabType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcServiceLife* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingMesh* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrepWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGasTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPile* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTileSymbolWithStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionMaterialResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationCurveOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDimensionCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricCurveSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelAggregates* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelAggregates"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBasedSurfaceModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFaceBasedSurfaceModel"); } do { // convert the 'FbsmFaces' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->FbsmFaces, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBasedSurfaceModel to be a `SET [1:?] OF IfcConnectedFaceSet`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlight* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlate* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBound* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceBound"); } 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 0 to IfcFaceBound to be a `IfcLoop`")); } + } 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 1 to IfcFaceBound to be a `BOOLEAN`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceOuterBound* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceOuterBound"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOneDirectionRepeatFactor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoilerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionEquipmentResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcComplexProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcComplexProperty"); } do { // convert the 'UsageName' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->UsageName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcComplexProperty to be a `IfcIdentifier`")); } + } while(0); + do { // convert the 'HasProperties' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->HasProperties, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcComplexProperty to be a `SET [1:?] OF IfcProperty`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFooting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionProductResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDerivedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyTableValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMeterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoorStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitAssignment* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcUnitAssignment"); } 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 0 to IfcUnitAssignment to be a `SET [1:?] OF IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCraneRailFShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementQuantity* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcElementQuantity"); } do { // convert the 'MethodOfMeasurement' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->MethodOfMeasurement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcElementQuantity to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Quantities' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Quantities, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcElementQuantity to be a `SET [1:?] OF IfcPhysicalQuantity`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWall* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGrid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSanitaryTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubedge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFilterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendon* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLoadGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyleAssignment* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyleAssignment"); } 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 0 to IfcPresentationStyleAssignment to be a `SET [1:?] OF IfcPresentationStyleSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceAmbient* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPort* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 11) { throw STEP::TypeError("expected 11 arguments to IfcSpace"); } do { // convert the 'InteriorOrExteriorSpace' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->InteriorOrExteriorSpace, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSpace to be a `IfcInternalOrExternalEnum`")); } + } while(0); + do { // convert the 'ElevationWithFlooring' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationWithFlooring, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSpace to be a `IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHeatExchangerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTankType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcInventory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirToAirHeatRecoveryType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlight* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricalElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleWithTextures* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleWithTextures"); } do { // convert the 'Textures' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->Textures, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleWithTextures to be a `LIST [1:?] OF IfcSurfaceTexture`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundingBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcBoundingBox"); } 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 IfcBoundingBox to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'XDim' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->XDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'YDim' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->YDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'ZDim' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ZDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMove* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCircle"); } 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 IfcCircle to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralResultGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSectionedSpine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlab* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertex* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearActionVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxyType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConversionBasedUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcConversionBasedUnit"); } 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 IfcConversionBasedUnit to be a `IfcLabel`")); } + } while(0); + do { // convert the 'ConversionFactor' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ConversionFactor, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcConversionBasedUnit to be a `IfcMeasureWithUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationSubContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationSurfaceOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedEdgeFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricDistributionPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeamType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillArea* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMemberVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrderAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillAreaOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkPlan* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipse* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcEllipse"); } do { // convert the 'SemiAxis1' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SemiAxis1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'SemiAxis2' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->SemiAxis2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductDefinitionShape* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricalCircuit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRationalBezierCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTwoDirectionRepeatFactor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcPropertySet"); } do { // convert the 'HasProperties' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->HasProperties, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcPropertySet to be a `SET [1:?] OF IfcProperty`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleRendering* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSurfaceStyleRendering"); } do { // convert the 'Transparency' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Transparency, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyleRendering to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + do { // convert the 'DiffuseColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->DiffuseColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'TransmissionColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->TransmissionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'DiffuseTransmissionColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'ReflectionColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ReflectionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'SpecularColour' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SpecularColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'SpecularHighlight' argument + std::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SpecularHighlight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSurfaceStyleRendering to be a `IfcSpecularHighlightSelect`")); } + } while(0); + do { // convert the 'ReflectanceMethod' argument + std::shared_ptr arg = params[base++]; + try { GenericConvert( in->ReflectanceMethod, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSurfaceStyleRendering to be a `IfcReflectanceMethodEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionPort* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationTextOccurrence* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAnalysisModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConditionCriterion* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} + +} // ! STEP +} // ! Assimp + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_2x3.h b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_2x3.h new file mode 100644 index 000000000..8b39ccdc2 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_2x3.h @@ -0,0 +1,4371 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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_IFC_READER_GEN_H +#define INCLUDED_IFC_READER_GEN_H + +#include "code/Step/STEPFile.h" + +namespace Assimp { +namespace IFC { + namespace Schema_2x3 { + + using namespace STEP; + using namespace STEP::EXPRESS; + + + struct NotImplemented : public ObjectHelper { + + }; + + + // ****************************************************************************** + // IFC Custom data types + // ****************************************************************************** + + + // C++ wrapper type for IfcAbsorbedDoseMeasure + typedef REAL IfcAbsorbedDoseMeasure; + // C++ wrapper type for IfcAccelerationMeasure + typedef REAL IfcAccelerationMeasure; + // C++ wrapper type for IfcAmountOfSubstanceMeasure + typedef REAL IfcAmountOfSubstanceMeasure; + // C++ wrapper type for IfcAngularVelocityMeasure + typedef REAL IfcAngularVelocityMeasure; + // C++ wrapper type for IfcAreaMeasure + typedef REAL IfcAreaMeasure; + // C++ wrapper type for IfcBoolean + typedef BOOLEAN IfcBoolean; + // C++ wrapper type for IfcBoxAlignment + typedef STRING IfcBoxAlignment; + // C++ wrapper type for IfcCompoundPlaneAngleMeasure + typedef ListOf< INTEGER, 3, 3 > IfcCompoundPlaneAngleMeasure; + // C++ wrapper type for IfcContextDependentMeasure + typedef REAL IfcContextDependentMeasure; + // C++ wrapper type for IfcCountMeasure + typedef NUMBER IfcCountMeasure; + // C++ wrapper type for IfcCurvatureMeasure + typedef REAL IfcCurvatureMeasure; + // C++ wrapper type for IfcDayInMonthNumber + typedef INTEGER IfcDayInMonthNumber; + // C++ wrapper type for IfcDaylightSavingHour + typedef INTEGER IfcDaylightSavingHour; + // C++ wrapper type for IfcDescriptiveMeasure + typedef STRING IfcDescriptiveMeasure; + // C++ wrapper type for IfcDimensionCount + typedef INTEGER IfcDimensionCount; + // C++ wrapper type for IfcDoseEquivalentMeasure + typedef REAL IfcDoseEquivalentMeasure; + // C++ wrapper type for IfcDynamicViscosityMeasure + typedef REAL IfcDynamicViscosityMeasure; + // C++ wrapper type for IfcElectricCapacitanceMeasure + typedef REAL IfcElectricCapacitanceMeasure; + // C++ wrapper type for IfcElectricChargeMeasure + typedef REAL IfcElectricChargeMeasure; + // C++ wrapper type for IfcElectricConductanceMeasure + typedef REAL IfcElectricConductanceMeasure; + // C++ wrapper type for IfcElectricCurrentMeasure + typedef REAL IfcElectricCurrentMeasure; + // C++ wrapper type for IfcElectricResistanceMeasure + typedef REAL IfcElectricResistanceMeasure; + // C++ wrapper type for IfcElectricVoltageMeasure + typedef REAL IfcElectricVoltageMeasure; + // C++ wrapper type for IfcEnergyMeasure + typedef REAL IfcEnergyMeasure; + // C++ wrapper type for IfcFontStyle + typedef STRING IfcFontStyle; + // C++ wrapper type for IfcFontVariant + typedef STRING IfcFontVariant; + // C++ wrapper type for IfcFontWeight + typedef STRING IfcFontWeight; + // C++ wrapper type for IfcForceMeasure + typedef REAL IfcForceMeasure; + // C++ wrapper type for IfcFrequencyMeasure + typedef REAL IfcFrequencyMeasure; + // C++ wrapper type for IfcGloballyUniqueId + typedef STRING IfcGloballyUniqueId; + // C++ wrapper type for IfcHeatFluxDensityMeasure + typedef REAL IfcHeatFluxDensityMeasure; + // C++ wrapper type for IfcHeatingValueMeasure + typedef REAL IfcHeatingValueMeasure; + // C++ wrapper type for IfcHourInDay + typedef INTEGER IfcHourInDay; + // C++ wrapper type for IfcIdentifier + typedef STRING IfcIdentifier; + // C++ wrapper type for IfcIlluminanceMeasure + typedef REAL IfcIlluminanceMeasure; + // C++ wrapper type for IfcInductanceMeasure + typedef REAL IfcInductanceMeasure; + // C++ wrapper type for IfcInteger + typedef INTEGER IfcInteger; + // C++ wrapper type for IfcIntegerCountRateMeasure + typedef INTEGER IfcIntegerCountRateMeasure; + // C++ wrapper type for IfcIonConcentrationMeasure + typedef REAL IfcIonConcentrationMeasure; + // C++ wrapper type for IfcIsothermalMoistureCapacityMeasure + typedef REAL IfcIsothermalMoistureCapacityMeasure; + // C++ wrapper type for IfcKinematicViscosityMeasure + typedef REAL IfcKinematicViscosityMeasure; + // C++ wrapper type for IfcLabel + typedef STRING IfcLabel; + // C++ wrapper type for IfcLengthMeasure + typedef REAL IfcLengthMeasure; + // C++ wrapper type for IfcLinearForceMeasure + typedef REAL IfcLinearForceMeasure; + // C++ wrapper type for IfcLinearMomentMeasure + typedef REAL IfcLinearMomentMeasure; + // C++ wrapper type for IfcLinearStiffnessMeasure + typedef REAL IfcLinearStiffnessMeasure; + // C++ wrapper type for IfcLinearVelocityMeasure + typedef REAL IfcLinearVelocityMeasure; + // C++ wrapper type for IfcLogical + typedef LOGICAL IfcLogical; + // C++ wrapper type for IfcLuminousFluxMeasure + typedef REAL IfcLuminousFluxMeasure; + // C++ wrapper type for IfcLuminousIntensityDistributionMeasure + typedef REAL IfcLuminousIntensityDistributionMeasure; + // C++ wrapper type for IfcLuminousIntensityMeasure + typedef REAL IfcLuminousIntensityMeasure; + // C++ wrapper type for IfcMagneticFluxDensityMeasure + typedef REAL IfcMagneticFluxDensityMeasure; + // C++ wrapper type for IfcMagneticFluxMeasure + typedef REAL IfcMagneticFluxMeasure; + // C++ wrapper type for IfcMassDensityMeasure + typedef REAL IfcMassDensityMeasure; + // C++ wrapper type for IfcMassFlowRateMeasure + typedef REAL IfcMassFlowRateMeasure; + // C++ wrapper type for IfcMassMeasure + typedef REAL IfcMassMeasure; + // C++ wrapper type for IfcMassPerLengthMeasure + typedef REAL IfcMassPerLengthMeasure; + // C++ wrapper type for IfcMinuteInHour + typedef INTEGER IfcMinuteInHour; + // C++ wrapper type for IfcModulusOfElasticityMeasure + typedef REAL IfcModulusOfElasticityMeasure; + // C++ wrapper type for IfcModulusOfLinearSubgradeReactionMeasure + typedef REAL IfcModulusOfLinearSubgradeReactionMeasure; + // C++ wrapper type for IfcModulusOfRotationalSubgradeReactionMeasure + typedef REAL IfcModulusOfRotationalSubgradeReactionMeasure; + // C++ wrapper type for IfcModulusOfSubgradeReactionMeasure + typedef REAL IfcModulusOfSubgradeReactionMeasure; + // C++ wrapper type for IfcMoistureDiffusivityMeasure + typedef REAL IfcMoistureDiffusivityMeasure; + // C++ wrapper type for IfcMolecularWeightMeasure + typedef REAL IfcMolecularWeightMeasure; + // C++ wrapper type for IfcMomentOfInertiaMeasure + typedef REAL IfcMomentOfInertiaMeasure; + // C++ wrapper type for IfcMonetaryMeasure + typedef REAL IfcMonetaryMeasure; + // C++ wrapper type for IfcMonthInYearNumber + typedef INTEGER IfcMonthInYearNumber; + // C++ wrapper type for IfcNormalisedRatioMeasure + typedef REAL IfcNormalisedRatioMeasure; + // C++ wrapper type for IfcNumericMeasure + typedef NUMBER IfcNumericMeasure; + // C++ wrapper type for IfcPHMeasure + typedef REAL IfcPHMeasure; + // C++ wrapper type for IfcParameterValue + typedef REAL IfcParameterValue; + // C++ wrapper type for IfcPlanarForceMeasure + typedef REAL IfcPlanarForceMeasure; + // C++ wrapper type for IfcPlaneAngleMeasure + typedef REAL IfcPlaneAngleMeasure; + // C++ wrapper type for IfcPositiveLengthMeasure + typedef REAL IfcPositiveLengthMeasure; + // C++ wrapper type for IfcPositivePlaneAngleMeasure + typedef REAL IfcPositivePlaneAngleMeasure; + // C++ wrapper type for IfcPositiveRatioMeasure + typedef REAL IfcPositiveRatioMeasure; + // C++ wrapper type for IfcPowerMeasure + typedef REAL IfcPowerMeasure; + // C++ wrapper type for IfcPresentableText + typedef STRING IfcPresentableText; + // C++ wrapper type for IfcPressureMeasure + typedef REAL IfcPressureMeasure; + // C++ wrapper type for IfcRadioActivityMeasure + typedef REAL IfcRadioActivityMeasure; + // C++ wrapper type for IfcRatioMeasure + typedef REAL IfcRatioMeasure; + // C++ wrapper type for IfcReal + typedef REAL IfcReal; + // C++ wrapper type for IfcRotationalFrequencyMeasure + typedef REAL IfcRotationalFrequencyMeasure; + // C++ wrapper type for IfcRotationalMassMeasure + typedef REAL IfcRotationalMassMeasure; + // C++ wrapper type for IfcRotationalStiffnessMeasure + typedef REAL IfcRotationalStiffnessMeasure; + // C++ wrapper type for IfcSecondInMinute + typedef REAL IfcSecondInMinute; + // C++ wrapper type for IfcSectionModulusMeasure + typedef REAL IfcSectionModulusMeasure; + // C++ wrapper type for IfcSectionalAreaIntegralMeasure + typedef REAL IfcSectionalAreaIntegralMeasure; + // C++ wrapper type for IfcShearModulusMeasure + typedef REAL IfcShearModulusMeasure; + // C++ wrapper type for IfcSolidAngleMeasure + typedef REAL IfcSolidAngleMeasure; + // C++ wrapper type for IfcSoundPowerMeasure + typedef REAL IfcSoundPowerMeasure; + // C++ wrapper type for IfcSoundPressureMeasure + typedef REAL IfcSoundPressureMeasure; + // C++ wrapper type for IfcSpecificHeatCapacityMeasure + typedef REAL IfcSpecificHeatCapacityMeasure; + // C++ wrapper type for IfcSpecularExponent + typedef REAL IfcSpecularExponent; + // C++ wrapper type for IfcSpecularRoughness + typedef REAL IfcSpecularRoughness; + // C++ wrapper type for IfcTemperatureGradientMeasure + typedef REAL IfcTemperatureGradientMeasure; + // C++ wrapper type for IfcText + typedef STRING IfcText; + // C++ wrapper type for IfcTextAlignment + typedef STRING IfcTextAlignment; + // C++ wrapper type for IfcTextDecoration + typedef STRING IfcTextDecoration; + // C++ wrapper type for IfcTextFontName + typedef STRING IfcTextFontName; + // C++ wrapper type for IfcTextTransformation + typedef STRING IfcTextTransformation; + // C++ wrapper type for IfcThermalAdmittanceMeasure + typedef REAL IfcThermalAdmittanceMeasure; + // C++ wrapper type for IfcThermalConductivityMeasure + typedef REAL IfcThermalConductivityMeasure; + // C++ wrapper type for IfcThermalExpansionCoefficientMeasure + typedef REAL IfcThermalExpansionCoefficientMeasure; + // C++ wrapper type for IfcThermalResistanceMeasure + typedef REAL IfcThermalResistanceMeasure; + // C++ wrapper type for IfcThermalTransmittanceMeasure + typedef REAL IfcThermalTransmittanceMeasure; + // C++ wrapper type for IfcThermodynamicTemperatureMeasure + typedef REAL IfcThermodynamicTemperatureMeasure; + // C++ wrapper type for IfcTimeMeasure + typedef REAL IfcTimeMeasure; + // C++ wrapper type for IfcTimeStamp + typedef INTEGER IfcTimeStamp; + // C++ wrapper type for IfcTorqueMeasure + typedef REAL IfcTorqueMeasure; + // C++ wrapper type for IfcVaporPermeabilityMeasure + typedef REAL IfcVaporPermeabilityMeasure; + // C++ wrapper type for IfcVolumeMeasure + typedef REAL IfcVolumeMeasure; + // C++ wrapper type for IfcVolumetricFlowRateMeasure + typedef REAL IfcVolumetricFlowRateMeasure; + // C++ wrapper type for IfcWarpingConstantMeasure + typedef REAL IfcWarpingConstantMeasure; + // C++ wrapper type for IfcWarpingMomentMeasure + typedef REAL IfcWarpingMomentMeasure; + // C++ wrapper type for IfcYearNumber + typedef INTEGER IfcYearNumber; + // C++ wrapper type for IfcActionSourceTypeEnum + typedef ENUMERATION IfcActionSourceTypeEnum; + // C++ wrapper type for IfcActionTypeEnum + typedef ENUMERATION IfcActionTypeEnum; + // C++ wrapper type for IfcActuatorTypeEnum + typedef ENUMERATION IfcActuatorTypeEnum; + // C++ wrapper type for IfcAddressTypeEnum + typedef ENUMERATION IfcAddressTypeEnum; + // C++ wrapper type for IfcAheadOrBehind + typedef ENUMERATION IfcAheadOrBehind; + // C++ wrapper type for IfcAirTerminalBoxTypeEnum + typedef ENUMERATION IfcAirTerminalBoxTypeEnum; + // C++ wrapper type for IfcAirTerminalTypeEnum + typedef ENUMERATION IfcAirTerminalTypeEnum; + // C++ wrapper type for IfcAirToAirHeatRecoveryTypeEnum + typedef ENUMERATION IfcAirToAirHeatRecoveryTypeEnum; + // C++ wrapper type for IfcAlarmTypeEnum + typedef ENUMERATION IfcAlarmTypeEnum; + // C++ wrapper type for IfcAnalysisModelTypeEnum + typedef ENUMERATION IfcAnalysisModelTypeEnum; + // C++ wrapper type for IfcAnalysisTheoryTypeEnum + typedef ENUMERATION IfcAnalysisTheoryTypeEnum; + // C++ wrapper type for IfcArithmeticOperatorEnum + typedef ENUMERATION IfcArithmeticOperatorEnum; + // C++ wrapper type for IfcAssemblyPlaceEnum + typedef ENUMERATION IfcAssemblyPlaceEnum; + // C++ wrapper type for IfcBSplineCurveForm + typedef ENUMERATION IfcBSplineCurveForm; + // C++ wrapper type for IfcBeamTypeEnum + typedef ENUMERATION IfcBeamTypeEnum; + // C++ wrapper type for IfcBenchmarkEnum + typedef ENUMERATION IfcBenchmarkEnum; + // C++ wrapper type for IfcBoilerTypeEnum + typedef ENUMERATION IfcBoilerTypeEnum; + // C++ wrapper type for IfcBooleanOperator + typedef ENUMERATION IfcBooleanOperator; + // C++ wrapper type for IfcBuildingElementProxyTypeEnum + typedef ENUMERATION IfcBuildingElementProxyTypeEnum; + // C++ wrapper type for IfcCableCarrierFittingTypeEnum + typedef ENUMERATION IfcCableCarrierFittingTypeEnum; + // C++ wrapper type for IfcCableCarrierSegmentTypeEnum + typedef ENUMERATION IfcCableCarrierSegmentTypeEnum; + // C++ wrapper type for IfcCableSegmentTypeEnum + typedef ENUMERATION IfcCableSegmentTypeEnum; + // C++ wrapper type for IfcChangeActionEnum + typedef ENUMERATION IfcChangeActionEnum; + // C++ wrapper type for IfcChillerTypeEnum + typedef ENUMERATION IfcChillerTypeEnum; + // C++ wrapper type for IfcCoilTypeEnum + typedef ENUMERATION IfcCoilTypeEnum; + // C++ wrapper type for IfcColumnTypeEnum + typedef ENUMERATION IfcColumnTypeEnum; + // C++ wrapper type for IfcCompressorTypeEnum + typedef ENUMERATION IfcCompressorTypeEnum; + // C++ wrapper type for IfcCondenserTypeEnum + typedef ENUMERATION IfcCondenserTypeEnum; + // C++ wrapper type for IfcConnectionTypeEnum + typedef ENUMERATION IfcConnectionTypeEnum; + // C++ wrapper type for IfcConstraintEnum + typedef ENUMERATION IfcConstraintEnum; + // C++ wrapper type for IfcControllerTypeEnum + typedef ENUMERATION IfcControllerTypeEnum; + // C++ wrapper type for IfcCooledBeamTypeEnum + typedef ENUMERATION IfcCooledBeamTypeEnum; + // C++ wrapper type for IfcCoolingTowerTypeEnum + typedef ENUMERATION IfcCoolingTowerTypeEnum; + // C++ wrapper type for IfcCostScheduleTypeEnum + typedef ENUMERATION IfcCostScheduleTypeEnum; + // C++ wrapper type for IfcCoveringTypeEnum + typedef ENUMERATION IfcCoveringTypeEnum; + // C++ wrapper type for IfcCurrencyEnum + typedef ENUMERATION IfcCurrencyEnum; + // C++ wrapper type for IfcCurtainWallTypeEnum + typedef ENUMERATION IfcCurtainWallTypeEnum; + // C++ wrapper type for IfcDamperTypeEnum + typedef ENUMERATION IfcDamperTypeEnum; + // C++ wrapper type for IfcDataOriginEnum + typedef ENUMERATION IfcDataOriginEnum; + // C++ wrapper type for IfcDerivedUnitEnum + typedef ENUMERATION IfcDerivedUnitEnum; + // C++ wrapper type for IfcDimensionExtentUsage + typedef ENUMERATION IfcDimensionExtentUsage; + // C++ wrapper type for IfcDirectionSenseEnum + typedef ENUMERATION IfcDirectionSenseEnum; + // C++ wrapper type for IfcDistributionChamberElementTypeEnum + typedef ENUMERATION IfcDistributionChamberElementTypeEnum; + // C++ wrapper type for IfcDocumentConfidentialityEnum + typedef ENUMERATION IfcDocumentConfidentialityEnum; + // C++ wrapper type for IfcDocumentStatusEnum + typedef ENUMERATION IfcDocumentStatusEnum; + // C++ wrapper type for IfcDoorPanelOperationEnum + typedef ENUMERATION IfcDoorPanelOperationEnum; + // C++ wrapper type for IfcDoorPanelPositionEnum + typedef ENUMERATION IfcDoorPanelPositionEnum; + // C++ wrapper type for IfcDoorStyleConstructionEnum + typedef ENUMERATION IfcDoorStyleConstructionEnum; + // C++ wrapper type for IfcDoorStyleOperationEnum + typedef ENUMERATION IfcDoorStyleOperationEnum; + // C++ wrapper type for IfcDuctFittingTypeEnum + typedef ENUMERATION IfcDuctFittingTypeEnum; + // C++ wrapper type for IfcDuctSegmentTypeEnum + typedef ENUMERATION IfcDuctSegmentTypeEnum; + // C++ wrapper type for IfcDuctSilencerTypeEnum + typedef ENUMERATION IfcDuctSilencerTypeEnum; + // C++ wrapper type for IfcElectricApplianceTypeEnum + typedef ENUMERATION IfcElectricApplianceTypeEnum; + // C++ wrapper type for IfcElectricCurrentEnum + typedef ENUMERATION IfcElectricCurrentEnum; + // C++ wrapper type for IfcElectricDistributionPointFunctionEnum + typedef ENUMERATION IfcElectricDistributionPointFunctionEnum; + // C++ wrapper type for IfcElectricFlowStorageDeviceTypeEnum + typedef ENUMERATION IfcElectricFlowStorageDeviceTypeEnum; + // C++ wrapper type for IfcElectricGeneratorTypeEnum + typedef ENUMERATION IfcElectricGeneratorTypeEnum; + // C++ wrapper type for IfcElectricHeaterTypeEnum + typedef ENUMERATION IfcElectricHeaterTypeEnum; + // C++ wrapper type for IfcElectricMotorTypeEnum + typedef ENUMERATION IfcElectricMotorTypeEnum; + // C++ wrapper type for IfcElectricTimeControlTypeEnum + typedef ENUMERATION IfcElectricTimeControlTypeEnum; + // C++ wrapper type for IfcElementAssemblyTypeEnum + typedef ENUMERATION IfcElementAssemblyTypeEnum; + // C++ wrapper type for IfcElementCompositionEnum + typedef ENUMERATION IfcElementCompositionEnum; + // C++ wrapper type for IfcEnergySequenceEnum + typedef ENUMERATION IfcEnergySequenceEnum; + // C++ wrapper type for IfcEnvironmentalImpactCategoryEnum + typedef ENUMERATION IfcEnvironmentalImpactCategoryEnum; + // C++ wrapper type for IfcEvaporativeCoolerTypeEnum + typedef ENUMERATION IfcEvaporativeCoolerTypeEnum; + // C++ wrapper type for IfcEvaporatorTypeEnum + typedef ENUMERATION IfcEvaporatorTypeEnum; + // C++ wrapper type for IfcFanTypeEnum + typedef ENUMERATION IfcFanTypeEnum; + // C++ wrapper type for IfcFilterTypeEnum + typedef ENUMERATION IfcFilterTypeEnum; + // C++ wrapper type for IfcFireSuppressionTerminalTypeEnum + typedef ENUMERATION IfcFireSuppressionTerminalTypeEnum; + // C++ wrapper type for IfcFlowDirectionEnum + typedef ENUMERATION IfcFlowDirectionEnum; + // C++ wrapper type for IfcFlowInstrumentTypeEnum + typedef ENUMERATION IfcFlowInstrumentTypeEnum; + // C++ wrapper type for IfcFlowMeterTypeEnum + typedef ENUMERATION IfcFlowMeterTypeEnum; + // C++ wrapper type for IfcFootingTypeEnum + typedef ENUMERATION IfcFootingTypeEnum; + // C++ wrapper type for IfcGasTerminalTypeEnum + typedef ENUMERATION IfcGasTerminalTypeEnum; + // C++ wrapper type for IfcGeometricProjectionEnum + typedef ENUMERATION IfcGeometricProjectionEnum; + // C++ wrapper type for IfcGlobalOrLocalEnum + typedef ENUMERATION IfcGlobalOrLocalEnum; + // C++ wrapper type for IfcHeatExchangerTypeEnum + typedef ENUMERATION IfcHeatExchangerTypeEnum; + // C++ wrapper type for IfcHumidifierTypeEnum + typedef ENUMERATION IfcHumidifierTypeEnum; + // C++ wrapper type for IfcInternalOrExternalEnum + typedef ENUMERATION IfcInternalOrExternalEnum; + // C++ wrapper type for IfcInventoryTypeEnum + typedef ENUMERATION IfcInventoryTypeEnum; + // C++ wrapper type for IfcJunctionBoxTypeEnum + typedef ENUMERATION IfcJunctionBoxTypeEnum; + // C++ wrapper type for IfcLampTypeEnum + typedef ENUMERATION IfcLampTypeEnum; + // C++ wrapper type for IfcLayerSetDirectionEnum + typedef ENUMERATION IfcLayerSetDirectionEnum; + // C++ wrapper type for IfcLightDistributionCurveEnum + typedef ENUMERATION IfcLightDistributionCurveEnum; + // C++ wrapper type for IfcLightEmissionSourceEnum + typedef ENUMERATION IfcLightEmissionSourceEnum; + // C++ wrapper type for IfcLightFixtureTypeEnum + typedef ENUMERATION IfcLightFixtureTypeEnum; + // C++ wrapper type for IfcLoadGroupTypeEnum + typedef ENUMERATION IfcLoadGroupTypeEnum; + // C++ wrapper type for IfcLogicalOperatorEnum + typedef ENUMERATION IfcLogicalOperatorEnum; + // C++ wrapper type for IfcMemberTypeEnum + typedef ENUMERATION IfcMemberTypeEnum; + // C++ wrapper type for IfcMotorConnectionTypeEnum + typedef ENUMERATION IfcMotorConnectionTypeEnum; + // C++ wrapper type for IfcNullStyle + typedef ENUMERATION IfcNullStyle; + // C++ wrapper type for IfcObjectTypeEnum + typedef ENUMERATION IfcObjectTypeEnum; + // C++ wrapper type for IfcObjectiveEnum + typedef ENUMERATION IfcObjectiveEnum; + // C++ wrapper type for IfcOccupantTypeEnum + typedef ENUMERATION IfcOccupantTypeEnum; + // C++ wrapper type for IfcOutletTypeEnum + typedef ENUMERATION IfcOutletTypeEnum; + // C++ wrapper type for IfcPermeableCoveringOperationEnum + typedef ENUMERATION IfcPermeableCoveringOperationEnum; + // C++ wrapper type for IfcPhysicalOrVirtualEnum + typedef ENUMERATION IfcPhysicalOrVirtualEnum; + // C++ wrapper type for IfcPileConstructionEnum + typedef ENUMERATION IfcPileConstructionEnum; + // C++ wrapper type for IfcPileTypeEnum + typedef ENUMERATION IfcPileTypeEnum; + // C++ wrapper type for IfcPipeFittingTypeEnum + typedef ENUMERATION IfcPipeFittingTypeEnum; + // C++ wrapper type for IfcPipeSegmentTypeEnum + typedef ENUMERATION IfcPipeSegmentTypeEnum; + // C++ wrapper type for IfcPlateTypeEnum + typedef ENUMERATION IfcPlateTypeEnum; + // C++ wrapper type for IfcProcedureTypeEnum + typedef ENUMERATION IfcProcedureTypeEnum; + // C++ wrapper type for IfcProfileTypeEnum + typedef ENUMERATION IfcProfileTypeEnum; + // C++ wrapper type for IfcProjectOrderRecordTypeEnum + typedef ENUMERATION IfcProjectOrderRecordTypeEnum; + // C++ wrapper type for IfcProjectOrderTypeEnum + typedef ENUMERATION IfcProjectOrderTypeEnum; + // C++ wrapper type for IfcProjectedOrTrueLengthEnum + typedef ENUMERATION IfcProjectedOrTrueLengthEnum; + // C++ wrapper type for IfcPropertySourceEnum + typedef ENUMERATION IfcPropertySourceEnum; + // C++ wrapper type for IfcProtectiveDeviceTypeEnum + typedef ENUMERATION IfcProtectiveDeviceTypeEnum; + // C++ wrapper type for IfcPumpTypeEnum + typedef ENUMERATION IfcPumpTypeEnum; + // C++ wrapper type for IfcRailingTypeEnum + typedef ENUMERATION IfcRailingTypeEnum; + // C++ wrapper type for IfcRampFlightTypeEnum + typedef ENUMERATION IfcRampFlightTypeEnum; + // C++ wrapper type for IfcRampTypeEnum + typedef ENUMERATION IfcRampTypeEnum; + // C++ wrapper type for IfcReflectanceMethodEnum + typedef ENUMERATION IfcReflectanceMethodEnum; + // C++ wrapper type for IfcReinforcingBarRoleEnum + typedef ENUMERATION IfcReinforcingBarRoleEnum; + // C++ wrapper type for IfcReinforcingBarSurfaceEnum + typedef ENUMERATION IfcReinforcingBarSurfaceEnum; + // C++ wrapper type for IfcResourceConsumptionEnum + typedef ENUMERATION IfcResourceConsumptionEnum; + // C++ wrapper type for IfcRibPlateDirectionEnum + typedef ENUMERATION IfcRibPlateDirectionEnum; + // C++ wrapper type for IfcRoleEnum + typedef ENUMERATION IfcRoleEnum; + // C++ wrapper type for IfcRoofTypeEnum + typedef ENUMERATION IfcRoofTypeEnum; + // C++ wrapper type for IfcSIPrefix + typedef ENUMERATION IfcSIPrefix; + // C++ wrapper type for IfcSIUnitName + typedef ENUMERATION IfcSIUnitName; + // C++ wrapper type for IfcSanitaryTerminalTypeEnum + typedef ENUMERATION IfcSanitaryTerminalTypeEnum; + // C++ wrapper type for IfcSectionTypeEnum + typedef ENUMERATION IfcSectionTypeEnum; + // C++ wrapper type for IfcSensorTypeEnum + typedef ENUMERATION IfcSensorTypeEnum; + // C++ wrapper type for IfcSequenceEnum + typedef ENUMERATION IfcSequenceEnum; + // C++ wrapper type for IfcServiceLifeFactorTypeEnum + typedef ENUMERATION IfcServiceLifeFactorTypeEnum; + // C++ wrapper type for IfcServiceLifeTypeEnum + typedef ENUMERATION IfcServiceLifeTypeEnum; + // C++ wrapper type for IfcSlabTypeEnum + typedef ENUMERATION IfcSlabTypeEnum; + // C++ wrapper type for IfcSoundScaleEnum + typedef ENUMERATION IfcSoundScaleEnum; + // C++ wrapper type for IfcSpaceHeaterTypeEnum + typedef ENUMERATION IfcSpaceHeaterTypeEnum; + // C++ wrapper type for IfcSpaceTypeEnum + typedef ENUMERATION IfcSpaceTypeEnum; + // C++ wrapper type for IfcStackTerminalTypeEnum + typedef ENUMERATION IfcStackTerminalTypeEnum; + // C++ wrapper type for IfcStairFlightTypeEnum + typedef ENUMERATION IfcStairFlightTypeEnum; + // C++ wrapper type for IfcStairTypeEnum + typedef ENUMERATION IfcStairTypeEnum; + // C++ wrapper type for IfcStateEnum + typedef ENUMERATION IfcStateEnum; + // C++ wrapper type for IfcStructuralCurveTypeEnum + typedef ENUMERATION IfcStructuralCurveTypeEnum; + // C++ wrapper type for IfcStructuralSurfaceTypeEnum + typedef ENUMERATION IfcStructuralSurfaceTypeEnum; + // C++ wrapper type for IfcSurfaceSide + typedef ENUMERATION IfcSurfaceSide; + // C++ wrapper type for IfcSurfaceTextureEnum + typedef ENUMERATION IfcSurfaceTextureEnum; + // C++ wrapper type for IfcSwitchingDeviceTypeEnum + typedef ENUMERATION IfcSwitchingDeviceTypeEnum; + // C++ wrapper type for IfcTankTypeEnum + typedef ENUMERATION IfcTankTypeEnum; + // C++ wrapper type for IfcTendonTypeEnum + typedef ENUMERATION IfcTendonTypeEnum; + // C++ wrapper type for IfcTextPath + typedef ENUMERATION IfcTextPath; + // C++ wrapper type for IfcThermalLoadSourceEnum + typedef ENUMERATION IfcThermalLoadSourceEnum; + // C++ wrapper type for IfcThermalLoadTypeEnum + typedef ENUMERATION IfcThermalLoadTypeEnum; + // C++ wrapper type for IfcTimeSeriesDataTypeEnum + typedef ENUMERATION IfcTimeSeriesDataTypeEnum; + // C++ wrapper type for IfcTimeSeriesScheduleTypeEnum + typedef ENUMERATION IfcTimeSeriesScheduleTypeEnum; + // C++ wrapper type for IfcTransformerTypeEnum + typedef ENUMERATION IfcTransformerTypeEnum; + // C++ wrapper type for IfcTransitionCode + typedef ENUMERATION IfcTransitionCode; + // C++ wrapper type for IfcTransportElementTypeEnum + typedef ENUMERATION IfcTransportElementTypeEnum; + // C++ wrapper type for IfcTrimmingPreference + typedef ENUMERATION IfcTrimmingPreference; + // C++ wrapper type for IfcTubeBundleTypeEnum + typedef ENUMERATION IfcTubeBundleTypeEnum; + // C++ wrapper type for IfcUnitEnum + typedef ENUMERATION IfcUnitEnum; + // C++ wrapper type for IfcUnitaryEquipmentTypeEnum + typedef ENUMERATION IfcUnitaryEquipmentTypeEnum; + // C++ wrapper type for IfcValveTypeEnum + typedef ENUMERATION IfcValveTypeEnum; + // C++ wrapper type for IfcVibrationIsolatorTypeEnum + typedef ENUMERATION IfcVibrationIsolatorTypeEnum; + // C++ wrapper type for IfcWallTypeEnum + typedef ENUMERATION IfcWallTypeEnum; + // C++ wrapper type for IfcWasteTerminalTypeEnum + typedef ENUMERATION IfcWasteTerminalTypeEnum; + // C++ wrapper type for IfcWindowPanelOperationEnum + typedef ENUMERATION IfcWindowPanelOperationEnum; + // C++ wrapper type for IfcWindowPanelPositionEnum + typedef ENUMERATION IfcWindowPanelPositionEnum; + // C++ wrapper type for IfcWindowStyleConstructionEnum + typedef ENUMERATION IfcWindowStyleConstructionEnum; + // C++ wrapper type for IfcWindowStyleOperationEnum + typedef ENUMERATION IfcWindowStyleOperationEnum; + // C++ wrapper type for IfcWorkControlTypeEnum + typedef ENUMERATION IfcWorkControlTypeEnum; + // C++ wrapper type for IfcActorSelect + typedef SELECT IfcActorSelect; + // C++ wrapper type for IfcAppliedValueSelect + typedef SELECT IfcAppliedValueSelect; + // C++ wrapper type for IfcAxis2Placement + typedef SELECT IfcAxis2Placement; + // C++ wrapper type for IfcBooleanOperand + typedef SELECT IfcBooleanOperand; + // C++ wrapper type for IfcCharacterStyleSelect + typedef SELECT IfcCharacterStyleSelect; + // C++ wrapper type for IfcClassificationNotationSelect + typedef SELECT IfcClassificationNotationSelect; + // C++ wrapper type for IfcColour + typedef SELECT IfcColour; + // C++ wrapper type for IfcColourOrFactor + typedef SELECT IfcColourOrFactor; + // C++ wrapper type for IfcConditionCriterionSelect + typedef SELECT IfcConditionCriterionSelect; + // C++ wrapper type for IfcCsgSelect + typedef SELECT IfcCsgSelect; + // C++ wrapper type for IfcCurveFontOrScaledCurveFontSelect + typedef SELECT IfcCurveFontOrScaledCurveFontSelect; + // C++ wrapper type for IfcCurveOrEdgeCurve + typedef SELECT IfcCurveOrEdgeCurve; + // C++ wrapper type for IfcCurveStyleFontSelect + typedef SELECT IfcCurveStyleFontSelect; + // C++ wrapper type for IfcDateTimeSelect + typedef SELECT IfcDateTimeSelect; + // C++ wrapper type for IfcDefinedSymbolSelect + typedef SELECT IfcDefinedSymbolSelect; + // C++ wrapper type for IfcDerivedMeasureValue + typedef SELECT IfcDerivedMeasureValue; + // C++ wrapper type for IfcDocumentSelect + typedef SELECT IfcDocumentSelect; + // C++ wrapper type for IfcDraughtingCalloutElement + typedef SELECT IfcDraughtingCalloutElement; + // C++ wrapper type for IfcFillAreaStyleTileShapeSelect + typedef SELECT IfcFillAreaStyleTileShapeSelect; + // C++ wrapper type for IfcFillStyleSelect + typedef SELECT IfcFillStyleSelect; + // C++ wrapper type for IfcGeometricSetSelect + typedef SELECT IfcGeometricSetSelect; + // C++ wrapper type for IfcHatchLineDistanceSelect + typedef SELECT IfcHatchLineDistanceSelect; + // C++ wrapper type for IfcLayeredItem + typedef SELECT IfcLayeredItem; + // C++ wrapper type for IfcLibrarySelect + typedef SELECT IfcLibrarySelect; + // C++ wrapper type for IfcLightDistributionDataSourceSelect + typedef SELECT IfcLightDistributionDataSourceSelect; + // C++ wrapper type for IfcMaterialSelect + typedef SELECT IfcMaterialSelect; + // C++ wrapper type for IfcMeasureValue + typedef SELECT IfcMeasureValue; + // C++ wrapper type for IfcMetricValueSelect + typedef SELECT IfcMetricValueSelect; + // C++ wrapper type for IfcObjectReferenceSelect + typedef SELECT IfcObjectReferenceSelect; + // C++ wrapper type for IfcOrientationSelect + typedef SELECT IfcOrientationSelect; + // C++ wrapper type for IfcPointOrVertexPoint + typedef SELECT IfcPointOrVertexPoint; + // C++ wrapper type for IfcPresentationStyleSelect + typedef SELECT IfcPresentationStyleSelect; + // C++ wrapper type for IfcShell + typedef SELECT IfcShell; + // C++ wrapper type for IfcSimpleValue + typedef SELECT IfcSimpleValue; + // C++ wrapper type for IfcSizeSelect + typedef SELECT IfcSizeSelect; + // C++ wrapper type for IfcSpecularHighlightSelect + typedef SELECT IfcSpecularHighlightSelect; + // C++ wrapper type for IfcStructuralActivityAssignmentSelect + typedef SELECT IfcStructuralActivityAssignmentSelect; + // C++ wrapper type for IfcSurfaceOrFaceSurface + typedef SELECT IfcSurfaceOrFaceSurface; + // C++ wrapper type for IfcSurfaceStyleElementSelect + typedef SELECT IfcSurfaceStyleElementSelect; + // C++ wrapper type for IfcSymbolStyleSelect + typedef SELECT IfcSymbolStyleSelect; + // C++ wrapper type for IfcTextFontSelect + typedef SELECT IfcTextFontSelect; + // C++ wrapper type for IfcTextStyleSelect + typedef SELECT IfcTextStyleSelect; + // C++ wrapper type for IfcTrimmingSelect + typedef SELECT IfcTrimmingSelect; + // C++ wrapper type for IfcUnit + typedef SELECT IfcUnit; + // C++ wrapper type for IfcValue + typedef SELECT IfcValue; + // C++ wrapper type for IfcVectorOrDirection + typedef SELECT IfcVectorOrDirection; + + + // ****************************************************************************** + // IFC Entities + // ****************************************************************************** + + struct IfcRepresentationItem; + struct IfcGeometricRepresentationItem; + struct IfcCurve; + struct IfcBoundedCurve; + struct IfcCompositeCurve; + struct Ifc2DCompositeCurve; + struct IfcRoot; + struct IfcObjectDefinition; + struct IfcObject; + struct IfcControl; + struct IfcActionRequest; + struct IfcActor; + typedef NotImplemented IfcActorRole; // (not currently used by Assimp) + struct IfcTypeObject; + struct IfcTypeProduct; + struct IfcElementType; + struct IfcDistributionElementType; + struct IfcDistributionControlElementType; + struct IfcActuatorType; + typedef NotImplemented IfcAddress; // (not currently used by Assimp) + struct IfcDistributionFlowElementType; + struct IfcFlowControllerType; + struct IfcAirTerminalBoxType; + struct IfcFlowTerminalType; + struct IfcAirTerminalType; + struct IfcEnergyConversionDeviceType; + struct IfcAirToAirHeatRecoveryType; + struct IfcAlarmType; + struct IfcDraughtingCallout; + struct IfcDimensionCurveDirectedCallout; + struct IfcAngularDimension; + struct IfcProduct; + struct IfcAnnotation; + struct IfcStyledItem; + struct IfcAnnotationOccurrence; + struct IfcAnnotationCurveOccurrence; + struct IfcAnnotationFillArea; + struct IfcAnnotationFillAreaOccurrence; + struct IfcAnnotationSurface; + struct IfcAnnotationSurfaceOccurrence; + struct IfcAnnotationSymbolOccurrence; + struct IfcAnnotationTextOccurrence; + typedef NotImplemented IfcApplication; // (not currently used by Assimp) + typedef NotImplemented IfcAppliedValue; // (not currently used by Assimp) + typedef NotImplemented IfcAppliedValueRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcApproval; // (not currently used by Assimp) + typedef NotImplemented IfcApprovalActorRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcApprovalPropertyRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcApprovalRelationship; // (not currently used by Assimp) + struct IfcProfileDef; + struct IfcArbitraryClosedProfileDef; + struct IfcArbitraryOpenProfileDef; + struct IfcArbitraryProfileDefWithVoids; + struct IfcGroup; + struct IfcAsset; + struct IfcParameterizedProfileDef; + struct IfcIShapeProfileDef; + struct IfcAsymmetricIShapeProfileDef; + struct IfcPlacement; + struct IfcAxis1Placement; + struct IfcAxis2Placement2D; + struct IfcAxis2Placement3D; + struct IfcBSplineCurve; + struct IfcElement; + struct IfcBuildingElement; + struct IfcBeam; + struct IfcBuildingElementType; + struct IfcBeamType; + struct IfcBezierCurve; + typedef NotImplemented IfcSurfaceTexture; // (not currently used by Assimp) + typedef NotImplemented IfcBlobTexture; // (not currently used by Assimp) + struct IfcCsgPrimitive3D; + struct IfcBlock; + struct IfcBoilerType; + struct IfcBooleanResult; + struct IfcBooleanClippingResult; + typedef NotImplemented IfcBoundaryCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryEdgeCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryFaceCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryNodeCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryNodeConditionWarping; // (not currently used by Assimp) + struct IfcSurface; + struct IfcBoundedSurface; + struct IfcBoundingBox; + struct IfcHalfSpaceSolid; + struct IfcBoxedHalfSpace; + struct IfcSpatialStructureElement; + struct IfcBuilding; + struct IfcBuildingElementComponent; + struct IfcBuildingElementPart; + struct IfcBuildingElementProxy; + struct IfcBuildingElementProxyType; + struct IfcBuildingStorey; + struct IfcCShapeProfileDef; + struct IfcFlowFittingType; + struct IfcCableCarrierFittingType; + struct IfcFlowSegmentType; + struct IfcCableCarrierSegmentType; + struct IfcCableSegmentType; + typedef NotImplemented IfcCalendarDate; // (not currently used by Assimp) + struct IfcPoint; + struct IfcCartesianPoint; + struct IfcCartesianTransformationOperator; + struct IfcCartesianTransformationOperator2D; + struct IfcCartesianTransformationOperator2DnonUniform; + struct IfcCartesianTransformationOperator3D; + struct IfcCartesianTransformationOperator3DnonUniform; + struct IfcCenterLineProfileDef; + struct IfcFeatureElement; + struct IfcFeatureElementSubtraction; + struct IfcEdgeFeature; + struct IfcChamferEdgeFeature; + struct IfcChillerType; + struct IfcConic; + struct IfcCircle; + struct IfcCircleProfileDef; + struct IfcCircleHollowProfileDef; + typedef NotImplemented IfcClassification; // (not currently used by Assimp) + typedef NotImplemented IfcClassificationItem; // (not currently used by Assimp) + typedef NotImplemented IfcClassificationItemRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcClassificationNotation; // (not currently used by Assimp) + typedef NotImplemented IfcClassificationNotationFacet; // (not currently used by Assimp) + typedef NotImplemented IfcExternalReference; // (not currently used by Assimp) + typedef NotImplemented IfcClassificationReference; // (not currently used by Assimp) + struct IfcTopologicalRepresentationItem; + struct IfcConnectedFaceSet; + struct IfcClosedShell; + struct IfcCoilType; + struct IfcColourSpecification; + struct IfcColourRgb; + struct IfcColumn; + struct IfcColumnType; + struct IfcProperty; + struct IfcComplexProperty; + struct IfcCompositeCurveSegment; + struct IfcCompositeProfileDef; + struct IfcFlowMovingDeviceType; + struct IfcCompressorType; + struct IfcCondenserType; + struct IfcCondition; + struct IfcConditionCriterion; + typedef NotImplemented IfcConnectionGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionCurveGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionPointGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionPointEccentricity; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionPortGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionSurfaceGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConstraint; // (not currently used by Assimp) + typedef NotImplemented IfcConstraintAggregationRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcConstraintClassificationRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcConstraintRelationship; // (not currently used by Assimp) + struct IfcResource; + struct IfcConstructionResource; + struct IfcConstructionEquipmentResource; + struct IfcConstructionMaterialResource; + struct IfcConstructionProductResource; + struct IfcNamedUnit; + struct IfcContextDependentUnit; + struct IfcControllerType; + struct IfcConversionBasedUnit; + struct IfcCooledBeamType; + struct IfcCoolingTowerType; + typedef NotImplemented IfcCoordinatedUniversalTimeOffset; // (not currently used by Assimp) + struct IfcCostItem; + struct IfcCostSchedule; + typedef NotImplemented IfcCostValue; // (not currently used by Assimp) + struct IfcCovering; + struct IfcCoveringType; + struct IfcCraneRailAShapeProfileDef; + struct IfcCraneRailFShapeProfileDef; + struct IfcCrewResource; + struct IfcSolidModel; + struct IfcCsgSolid; + typedef NotImplemented IfcCurrencyRelationship; // (not currently used by Assimp) + struct IfcCurtainWall; + struct IfcCurtainWallType; + struct IfcCurveBoundedPlane; + struct IfcPresentationStyle; + typedef NotImplemented IfcCurveStyle; // (not currently used by Assimp) + typedef NotImplemented IfcCurveStyleFont; // (not currently used by Assimp) + typedef NotImplemented IfcCurveStyleFontAndScaling; // (not currently used by Assimp) + typedef NotImplemented IfcCurveStyleFontPattern; // (not currently used by Assimp) + struct IfcDamperType; + typedef NotImplemented IfcDateAndTime; // (not currently used by Assimp) + struct IfcDefinedSymbol; + struct IfcDerivedProfileDef; + typedef NotImplemented IfcDerivedUnit; // (not currently used by Assimp) + typedef NotImplemented IfcDerivedUnitElement; // (not currently used by Assimp) + struct IfcDiameterDimension; + typedef NotImplemented IfcDraughtingCalloutRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcDimensionCalloutRelationship; // (not currently used by Assimp) + struct IfcDimensionCurve; + struct IfcTerminatorSymbol; + struct IfcDimensionCurveTerminator; + typedef NotImplemented IfcDimensionPair; // (not currently used by Assimp) + typedef NotImplemented IfcDimensionalExponents; // (not currently used by Assimp) + struct IfcDirection; + struct IfcElementComponent; + struct IfcDiscreteAccessory; + struct IfcElementComponentType; + struct IfcDiscreteAccessoryType; + struct IfcDistributionElement; + struct IfcDistributionFlowElement; + struct IfcDistributionChamberElement; + struct IfcDistributionChamberElementType; + struct IfcDistributionControlElement; + struct IfcPort; + struct IfcDistributionPort; + typedef NotImplemented IfcDocumentElectronicFormat; // (not currently used by Assimp) + typedef NotImplemented IfcDocumentInformation; // (not currently used by Assimp) + typedef NotImplemented IfcDocumentInformationRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcDocumentReference; // (not currently used by Assimp) + struct IfcDoor; + struct IfcPropertyDefinition; + struct IfcPropertySetDefinition; + typedef NotImplemented IfcDoorLiningProperties; // (not currently used by Assimp) + typedef NotImplemented IfcDoorPanelProperties; // (not currently used by Assimp) + struct IfcDoorStyle; + typedef NotImplemented IfcPreDefinedItem; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedColour; // (not currently used by Assimp) + typedef NotImplemented IfcDraughtingPreDefinedColour; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedCurveFont; // (not currently used by Assimp) + typedef NotImplemented IfcDraughtingPreDefinedCurveFont; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedTextFont; // (not currently used by Assimp) + typedef NotImplemented IfcDraughtingPreDefinedTextFont; // (not currently used by Assimp) + struct IfcDuctFittingType; + struct IfcDuctSegmentType; + struct IfcFlowTreatmentDeviceType; + struct IfcDuctSilencerType; + struct IfcEdge; + struct IfcEdgeCurve; + struct IfcLoop; + struct IfcEdgeLoop; + struct IfcElectricApplianceType; + struct IfcFlowController; + struct IfcElectricDistributionPoint; + struct IfcFlowStorageDeviceType; + struct IfcElectricFlowStorageDeviceType; + struct IfcElectricGeneratorType; + struct IfcElectricHeaterType; + struct IfcElectricMotorType; + struct IfcElectricTimeControlType; + typedef NotImplemented IfcEnergyProperties; // (not currently used by Assimp) + typedef NotImplemented IfcElectricalBaseProperties; // (not currently used by Assimp) + struct IfcSystem; + struct IfcElectricalCircuit; + struct IfcElectricalElement; + struct IfcElementAssembly; + struct IfcElementQuantity; + struct IfcElementarySurface; + struct IfcEllipse; + struct IfcEllipseProfileDef; + struct IfcEnergyConversionDevice; + typedef NotImplemented IfcEnvironmentalImpactValue; // (not currently used by Assimp) + struct IfcEquipmentElement; + struct IfcEquipmentStandard; + struct IfcEvaporativeCoolerType; + struct IfcEvaporatorType; + typedef NotImplemented IfcMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcExtendedMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcExternallyDefinedHatchStyle; // (not currently used by Assimp) + typedef NotImplemented IfcExternallyDefinedSurfaceStyle; // (not currently used by Assimp) + typedef NotImplemented IfcExternallyDefinedSymbol; // (not currently used by Assimp) + typedef NotImplemented IfcExternallyDefinedTextFont; // (not currently used by Assimp) + struct IfcSweptAreaSolid; + struct IfcExtrudedAreaSolid; + struct IfcFace; + struct IfcFaceBasedSurfaceModel; + struct IfcFaceBound; + struct IfcFaceOuterBound; + struct IfcFaceSurface; + struct IfcManifoldSolidBrep; + struct IfcFacetedBrep; + struct IfcFacetedBrepWithVoids; + typedef NotImplemented IfcStructuralConnectionCondition; // (not currently used by Assimp) + typedef NotImplemented IfcFailureConnectionCondition; // (not currently used by Assimp) + struct IfcFanType; + struct IfcFastener; + struct IfcFastenerType; + struct IfcFeatureElementAddition; + typedef NotImplemented IfcFillAreaStyle; // (not currently used by Assimp) + struct IfcFillAreaStyleHatching; + struct IfcFillAreaStyleTileSymbolWithStyle; + struct IfcFillAreaStyleTiles; + struct IfcFilterType; + struct IfcFireSuppressionTerminalType; + struct IfcFlowFitting; + struct IfcFlowInstrumentType; + struct IfcFlowMeterType; + struct IfcFlowMovingDevice; + struct IfcFlowSegment; + struct IfcFlowStorageDevice; + struct IfcFlowTerminal; + struct IfcFlowTreatmentDevice; + typedef NotImplemented IfcFluidFlowProperties; // (not currently used by Assimp) + struct IfcFooting; + typedef NotImplemented IfcFuelProperties; // (not currently used by Assimp) + struct IfcFurnishingElement; + struct IfcFurnishingElementType; + struct IfcFurnitureStandard; + struct IfcFurnitureType; + struct IfcGasTerminalType; + typedef NotImplemented IfcGeneralMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcProfileProperties; // (not currently used by Assimp) + typedef NotImplemented IfcGeneralProfileProperties; // (not currently used by Assimp) + struct IfcGeometricSet; + struct IfcGeometricCurveSet; + struct IfcRepresentationContext; + struct IfcGeometricRepresentationContext; + struct IfcGeometricRepresentationSubContext; + struct IfcGrid; + typedef NotImplemented IfcGridAxis; // (not currently used by Assimp) + struct IfcObjectPlacement; + struct IfcGridPlacement; + struct IfcHeatExchangerType; + struct IfcHumidifierType; + typedef NotImplemented IfcHygroscopicMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcImageTexture; // (not currently used by Assimp) + struct IfcInventory; + typedef NotImplemented IfcTimeSeries; // (not currently used by Assimp) + typedef NotImplemented IfcIrregularTimeSeries; // (not currently used by Assimp) + typedef NotImplemented IfcIrregularTimeSeriesValue; // (not currently used by Assimp) + struct IfcJunctionBoxType; + struct IfcLShapeProfileDef; + struct IfcLaborResource; + struct IfcLampType; + typedef NotImplemented IfcLibraryInformation; // (not currently used by Assimp) + typedef NotImplemented IfcLibraryReference; // (not currently used by Assimp) + typedef NotImplemented IfcLightDistributionData; // (not currently used by Assimp) + struct IfcLightFixtureType; + typedef NotImplemented IfcLightIntensityDistribution; // (not currently used by Assimp) + struct IfcLightSource; + struct IfcLightSourceAmbient; + struct IfcLightSourceDirectional; + struct IfcLightSourceGoniometric; + struct IfcLightSourcePositional; + struct IfcLightSourceSpot; + struct IfcLine; + struct IfcLinearDimension; + struct IfcLocalPlacement; + typedef NotImplemented IfcLocalTime; // (not currently used by Assimp) + struct IfcMappedItem; + typedef NotImplemented IfcMaterial; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialClassificationRelationship; // (not currently used by Assimp) + struct IfcProductRepresentation; + struct IfcMaterialDefinitionRepresentation; + typedef NotImplemented IfcMaterialLayer; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialLayerSet; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialLayerSetUsage; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialList; // (not currently used by Assimp) + struct IfcMeasureWithUnit; + typedef NotImplemented IfcMechanicalMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcMechanicalConcreteMaterialProperties; // (not currently used by Assimp) + struct IfcMechanicalFastener; + struct IfcMechanicalFastenerType; + typedef NotImplemented IfcMechanicalSteelMaterialProperties; // (not currently used by Assimp) + struct IfcMember; + struct IfcMemberType; + typedef NotImplemented IfcMetric; // (not currently used by Assimp) + typedef NotImplemented IfcMonetaryUnit; // (not currently used by Assimp) + struct IfcMotorConnectionType; + struct IfcProcess; + struct IfcTask; + struct IfcMove; + typedef NotImplemented IfcObjective; // (not currently used by Assimp) + struct IfcOccupant; + struct IfcOffsetCurve2D; + struct IfcOffsetCurve3D; + struct IfcOneDirectionRepeatFactor; + struct IfcOpenShell; + struct IfcOpeningElement; + typedef NotImplemented IfcOpticalMaterialProperties; // (not currently used by Assimp) + struct IfcOrderAction; + typedef NotImplemented IfcOrganization; // (not currently used by Assimp) + typedef NotImplemented IfcOrganizationRelationship; // (not currently used by Assimp) + struct IfcOrientedEdge; + struct IfcOutletType; + typedef NotImplemented IfcOwnerHistory; // (not currently used by Assimp) + struct IfcPath; + struct IfcPerformanceHistory; + typedef NotImplemented IfcPermeableCoveringProperties; // (not currently used by Assimp) + struct IfcPermit; + typedef NotImplemented IfcPerson; // (not currently used by Assimp) + typedef NotImplemented IfcPersonAndOrganization; // (not currently used by Assimp) + typedef NotImplemented IfcPhysicalQuantity; // (not currently used by Assimp) + typedef NotImplemented IfcPhysicalComplexQuantity; // (not currently used by Assimp) + typedef NotImplemented IfcPhysicalSimpleQuantity; // (not currently used by Assimp) + struct IfcPile; + struct IfcPipeFittingType; + struct IfcPipeSegmentType; + typedef NotImplemented IfcPixelTexture; // (not currently used by Assimp) + struct IfcPlanarExtent; + struct IfcPlanarBox; + struct IfcPlane; + struct IfcPlate; + struct IfcPlateType; + struct IfcPointOnCurve; + struct IfcPointOnSurface; + struct IfcPolyLoop; + struct IfcPolygonalBoundedHalfSpace; + struct IfcPolyline; + typedef NotImplemented IfcPostalAddress; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedSymbol; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedDimensionSymbol; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedPointMarkerSymbol; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedTerminatorSymbol; // (not currently used by Assimp) + typedef NotImplemented IfcPresentationLayerAssignment; // (not currently used by Assimp) + typedef NotImplemented IfcPresentationLayerWithStyle; // (not currently used by Assimp) + struct IfcPresentationStyleAssignment; + struct IfcProcedure; + struct IfcProductDefinitionShape; + typedef NotImplemented IfcProductsOfCombustionProperties; // (not currently used by Assimp) + struct IfcProject; + struct IfcProjectOrder; + struct IfcProjectOrderRecord; + struct IfcProjectionCurve; + struct IfcProjectionElement; + struct IfcSimpleProperty; + struct IfcPropertyBoundedValue; + typedef NotImplemented IfcPropertyConstraintRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcPropertyDependencyRelationship; // (not currently used by Assimp) + struct IfcPropertyEnumeratedValue; + typedef NotImplemented IfcPropertyEnumeration; // (not currently used by Assimp) + struct IfcPropertyListValue; + struct IfcPropertyReferenceValue; + struct IfcPropertySet; + struct IfcPropertySingleValue; + struct IfcPropertyTableValue; + struct IfcProtectiveDeviceType; + struct IfcProxy; + struct IfcPumpType; + typedef NotImplemented IfcQuantityArea; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityCount; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityLength; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityTime; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityVolume; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityWeight; // (not currently used by Assimp) + struct IfcRadiusDimension; + struct IfcRailing; + struct IfcRailingType; + struct IfcRamp; + struct IfcRampFlight; + struct IfcRampFlightType; + struct IfcRationalBezierCurve; + struct IfcRectangleProfileDef; + struct IfcRectangleHollowProfileDef; + struct IfcRectangularPyramid; + struct IfcRectangularTrimmedSurface; + typedef NotImplemented IfcReferencesValueDocument; // (not currently used by Assimp) + typedef NotImplemented IfcRegularTimeSeries; // (not currently used by Assimp) + typedef NotImplemented IfcReinforcementBarProperties; // (not currently used by Assimp) + typedef NotImplemented IfcReinforcementDefinitionProperties; // (not currently used by Assimp) + struct IfcReinforcingElement; + struct IfcReinforcingBar; + struct IfcReinforcingMesh; + struct IfcRelationship; + struct IfcRelDecomposes; + struct IfcRelAggregates; + typedef NotImplemented IfcRelAssigns; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToControl; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsTasks; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToActor; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToGroup; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToProcess; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToProduct; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToProjectOrder; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToResource; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociates; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesAppliedValue; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesApproval; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesClassification; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesConstraint; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesDocument; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesLibrary; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesMaterial; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesProfileProperties; // (not currently used by Assimp) + struct IfcRelConnects; + typedef NotImplemented IfcRelConnectsElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsPathElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsPortToElement; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsPorts; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsStructuralActivity; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsStructuralElement; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsStructuralMember; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsWithEccentricity; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsWithRealizingElements; // (not currently used by Assimp) + struct IfcRelContainedInSpatialStructure; + typedef NotImplemented IfcRelCoversBldgElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelCoversSpaces; // (not currently used by Assimp) + struct IfcRelDefines; + struct IfcRelDefinesByProperties; + typedef NotImplemented IfcRelDefinesByType; // (not currently used by Assimp) + struct IfcRelFillsElement; + typedef NotImplemented IfcRelFlowControlElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelInteractionRequirements; // (not currently used by Assimp) + typedef NotImplemented IfcRelNests; // (not currently used by Assimp) + typedef NotImplemented IfcRelOccupiesSpaces; // (not currently used by Assimp) + struct IfcRelOverridesProperties; + typedef NotImplemented IfcRelProjectsElement; // (not currently used by Assimp) + typedef NotImplemented IfcRelReferencedInSpatialStructure; // (not currently used by Assimp) + typedef NotImplemented IfcRelSchedulesCostItems; // (not currently used by Assimp) + typedef NotImplemented IfcRelSequence; // (not currently used by Assimp) + typedef NotImplemented IfcRelServicesBuildings; // (not currently used by Assimp) + typedef NotImplemented IfcRelSpaceBoundary; // (not currently used by Assimp) + struct IfcRelVoidsElement; + typedef NotImplemented IfcRelaxation; // (not currently used by Assimp) + struct IfcRepresentation; + struct IfcRepresentationMap; + struct IfcRevolvedAreaSolid; + typedef NotImplemented IfcRibPlateProfileProperties; // (not currently used by Assimp) + struct IfcRightCircularCone; + struct IfcRightCircularCylinder; + struct IfcRoof; + struct IfcRoundedEdgeFeature; + struct IfcRoundedRectangleProfileDef; + struct IfcSIUnit; + struct IfcSanitaryTerminalType; + struct IfcScheduleTimeControl; + typedef NotImplemented IfcSectionProperties; // (not currently used by Assimp) + typedef NotImplemented IfcSectionReinforcementProperties; // (not currently used by Assimp) + struct IfcSectionedSpine; + struct IfcSensorType; + struct IfcServiceLife; + typedef NotImplemented IfcServiceLifeFactor; // (not currently used by Assimp) + typedef NotImplemented IfcShapeAspect; // (not currently used by Assimp) + struct IfcShapeModel; + struct IfcShapeRepresentation; + struct IfcShellBasedSurfaceModel; + struct IfcSite; + struct IfcSlab; + struct IfcSlabType; + typedef NotImplemented IfcSlippageConnectionCondition; // (not currently used by Assimp) + typedef NotImplemented IfcSoundProperties; // (not currently used by Assimp) + typedef NotImplemented IfcSoundValue; // (not currently used by Assimp) + struct IfcSpace; + struct IfcSpaceHeaterType; + struct IfcSpaceProgram; + typedef NotImplemented IfcSpaceThermalLoadProperties; // (not currently used by Assimp) + struct IfcSpatialStructureElementType; + struct IfcSpaceType; + struct IfcSphere; + struct IfcStackTerminalType; + struct IfcStair; + struct IfcStairFlight; + struct IfcStairFlightType; + struct IfcStructuralActivity; + struct IfcStructuralAction; + struct IfcStructuralAnalysisModel; + struct IfcStructuralItem; + struct IfcStructuralConnection; + struct IfcStructuralCurveConnection; + struct IfcStructuralMember; + struct IfcStructuralCurveMember; + struct IfcStructuralCurveMemberVarying; + struct IfcStructuralLinearAction; + struct IfcStructuralLinearActionVarying; + typedef NotImplemented IfcStructuralLoad; // (not currently used by Assimp) + struct IfcStructuralLoadGroup; + typedef NotImplemented IfcStructuralLoadStatic; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadLinearForce; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadPlanarForce; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleDisplacement; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleDisplacementDistortion; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleForce; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleForceWarping; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadTemperature; // (not currently used by Assimp) + struct IfcStructuralPlanarAction; + struct IfcStructuralPlanarActionVarying; + struct IfcStructuralPointAction; + struct IfcStructuralPointConnection; + struct IfcStructuralReaction; + struct IfcStructuralPointReaction; + typedef NotImplemented IfcStructuralProfileProperties; // (not currently used by Assimp) + struct IfcStructuralResultGroup; + typedef NotImplemented IfcStructuralSteelProfileProperties; // (not currently used by Assimp) + struct IfcStructuralSurfaceConnection; + struct IfcStructuralSurfaceMember; + struct IfcStructuralSurfaceMemberVarying; + struct IfcStructuredDimensionCallout; + struct IfcStyleModel; + struct IfcStyledRepresentation; + struct IfcSubContractResource; + struct IfcSubedge; + struct IfcSurfaceCurveSweptAreaSolid; + struct IfcSweptSurface; + struct IfcSurfaceOfLinearExtrusion; + struct IfcSurfaceOfRevolution; + struct IfcSurfaceStyle; + typedef NotImplemented IfcSurfaceStyleLighting; // (not currently used by Assimp) + typedef NotImplemented IfcSurfaceStyleRefraction; // (not currently used by Assimp) + struct IfcSurfaceStyleShading; + struct IfcSurfaceStyleRendering; + struct IfcSurfaceStyleWithTextures; + struct IfcSweptDiskSolid; + struct IfcSwitchingDeviceType; + typedef NotImplemented IfcSymbolStyle; // (not currently used by Assimp) + struct IfcSystemFurnitureElementType; + struct IfcTShapeProfileDef; + typedef NotImplemented IfcTable; // (not currently used by Assimp) + typedef NotImplemented IfcTableRow; // (not currently used by Assimp) + struct IfcTankType; + typedef NotImplemented IfcTelecomAddress; // (not currently used by Assimp) + struct IfcTendon; + struct IfcTendonAnchor; + struct IfcTextLiteral; + struct IfcTextLiteralWithExtent; + typedef NotImplemented IfcTextStyle; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleFontModel; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleForDefinedFont; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleTextModel; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleWithBoxCharacteristics; // (not currently used by Assimp) + typedef NotImplemented IfcTextureCoordinate; // (not currently used by Assimp) + typedef NotImplemented IfcTextureCoordinateGenerator; // (not currently used by Assimp) + typedef NotImplemented IfcTextureMap; // (not currently used by Assimp) + typedef NotImplemented IfcTextureVertex; // (not currently used by Assimp) + typedef NotImplemented IfcThermalMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcTimeSeriesReferenceRelationship; // (not currently used by Assimp) + struct IfcTimeSeriesSchedule; + typedef NotImplemented IfcTimeSeriesValue; // (not currently used by Assimp) + struct IfcTopologyRepresentation; + struct IfcTransformerType; + struct IfcTransportElement; + struct IfcTransportElementType; + struct IfcTrapeziumProfileDef; + struct IfcTrimmedCurve; + struct IfcTubeBundleType; + struct IfcTwoDirectionRepeatFactor; + struct IfcUShapeProfileDef; + struct IfcUnitAssignment; + struct IfcUnitaryEquipmentType; + struct IfcValveType; + struct IfcVector; + struct IfcVertex; + typedef NotImplemented IfcVertexBasedTextureMap; // (not currently used by Assimp) + struct IfcVertexLoop; + struct IfcVertexPoint; + struct IfcVibrationIsolatorType; + struct IfcVirtualElement; + typedef NotImplemented IfcVirtualGridIntersection; // (not currently used by Assimp) + struct IfcWall; + struct IfcWallStandardCase; + struct IfcWallType; + struct IfcWasteTerminalType; + typedef NotImplemented IfcWaterProperties; // (not currently used by Assimp) + struct IfcWindow; + typedef NotImplemented IfcWindowLiningProperties; // (not currently used by Assimp) + typedef NotImplemented IfcWindowPanelProperties; // (not currently used by Assimp) + struct IfcWindowStyle; + struct IfcWorkControl; + struct IfcWorkPlan; + struct IfcWorkSchedule; + struct IfcZShapeProfileDef; + struct IfcZone; + + + + // C++ wrapper for IfcRepresentationItem + struct IfcRepresentationItem : ObjectHelper { IfcRepresentationItem() : Object("IfcRepresentationItem") {} + + }; + + // C++ wrapper for IfcGeometricRepresentationItem + struct IfcGeometricRepresentationItem : IfcRepresentationItem, ObjectHelper { IfcGeometricRepresentationItem() : Object("IfcGeometricRepresentationItem") {} + + }; + + // C++ wrapper for IfcCurve + struct IfcCurve : IfcGeometricRepresentationItem, ObjectHelper { IfcCurve() : Object("IfcCurve") {} + + }; + + // C++ wrapper for IfcBoundedCurve + struct IfcBoundedCurve : IfcCurve, ObjectHelper { IfcBoundedCurve() : Object("IfcBoundedCurve") {} + + }; + + // C++ wrapper for IfcCompositeCurve + struct IfcCompositeCurve : IfcBoundedCurve, ObjectHelper { IfcCompositeCurve() : Object("IfcCompositeCurve") {} + ListOf< Lazy< IfcCompositeCurveSegment >, 1, 0 > Segments; + LOGICAL::Out SelfIntersect; + }; + + // C++ wrapper for Ifc2DCompositeCurve + struct Ifc2DCompositeCurve : IfcCompositeCurve, ObjectHelper { Ifc2DCompositeCurve() : Object("Ifc2DCompositeCurve") {} + + }; + + // C++ wrapper for IfcRoot + struct IfcRoot : ObjectHelper { IfcRoot() : Object("IfcRoot") {} + IfcGloballyUniqueId::Out GlobalId; + Lazy< NotImplemented > OwnerHistory; + Maybe< IfcLabel::Out > Name; + Maybe< IfcText::Out > Description; + }; + + // C++ wrapper for IfcObjectDefinition + struct IfcObjectDefinition : IfcRoot, ObjectHelper { IfcObjectDefinition() : Object("IfcObjectDefinition") {} + + }; + + // C++ wrapper for IfcObject + struct IfcObject : IfcObjectDefinition, ObjectHelper { IfcObject() : Object("IfcObject") {} + Maybe< IfcLabel::Out > ObjectType; + }; + + // C++ wrapper for IfcControl + struct IfcControl : IfcObject, ObjectHelper { IfcControl() : Object("IfcControl") {} + + }; + + // C++ wrapper for IfcActionRequest + struct IfcActionRequest : IfcControl, ObjectHelper { IfcActionRequest() : Object("IfcActionRequest") {} + IfcIdentifier::Out RequestID; + }; + + // C++ wrapper for IfcActor + struct IfcActor : IfcObject, ObjectHelper { IfcActor() : Object("IfcActor") {} + IfcActorSelect::Out TheActor; + }; + + // C++ wrapper for IfcTypeObject + struct IfcTypeObject : IfcObjectDefinition, ObjectHelper { IfcTypeObject() : Object("IfcTypeObject") {} + Maybe< IfcLabel::Out > ApplicableOccurrence; + Maybe< ListOf< Lazy< IfcPropertySetDefinition >, 1, 0 > > HasPropertySets; + }; + + // C++ wrapper for IfcTypeProduct + struct IfcTypeProduct : IfcTypeObject, ObjectHelper { IfcTypeProduct() : Object("IfcTypeProduct") {} + Maybe< ListOf< Lazy< IfcRepresentationMap >, 1, 0 > > RepresentationMaps; + Maybe< IfcLabel::Out > Tag; + }; + + // C++ wrapper for IfcElementType + struct IfcElementType : IfcTypeProduct, ObjectHelper { IfcElementType() : Object("IfcElementType") {} + Maybe< IfcLabel::Out > ElementType; + }; + + // C++ wrapper for IfcDistributionElementType + struct IfcDistributionElementType : IfcElementType, ObjectHelper { IfcDistributionElementType() : Object("IfcDistributionElementType") {} + + }; + + // C++ wrapper for IfcDistributionControlElementType + struct IfcDistributionControlElementType : IfcDistributionElementType, ObjectHelper { IfcDistributionControlElementType() : Object("IfcDistributionControlElementType") {} + + }; + + // C++ wrapper for IfcActuatorType + struct IfcActuatorType : IfcDistributionControlElementType, ObjectHelper { IfcActuatorType() : Object("IfcActuatorType") {} + IfcActuatorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDistributionFlowElementType + struct IfcDistributionFlowElementType : IfcDistributionElementType, ObjectHelper { IfcDistributionFlowElementType() : Object("IfcDistributionFlowElementType") {} + + }; + + // C++ wrapper for IfcFlowControllerType + struct IfcFlowControllerType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowControllerType() : Object("IfcFlowControllerType") {} + + }; + + // C++ wrapper for IfcAirTerminalBoxType + struct IfcAirTerminalBoxType : IfcFlowControllerType, ObjectHelper { IfcAirTerminalBoxType() : Object("IfcAirTerminalBoxType") {} + IfcAirTerminalBoxTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowTerminalType + struct IfcFlowTerminalType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowTerminalType() : Object("IfcFlowTerminalType") {} + + }; + + // C++ wrapper for IfcAirTerminalType + struct IfcAirTerminalType : IfcFlowTerminalType, ObjectHelper { IfcAirTerminalType() : Object("IfcAirTerminalType") {} + IfcAirTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEnergyConversionDeviceType + struct IfcEnergyConversionDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcEnergyConversionDeviceType() : Object("IfcEnergyConversionDeviceType") {} + + }; + + // C++ wrapper for IfcAirToAirHeatRecoveryType + struct IfcAirToAirHeatRecoveryType : IfcEnergyConversionDeviceType, ObjectHelper { IfcAirToAirHeatRecoveryType() : Object("IfcAirToAirHeatRecoveryType") {} + IfcAirToAirHeatRecoveryTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcAlarmType + struct IfcAlarmType : IfcDistributionControlElementType, ObjectHelper { IfcAlarmType() : Object("IfcAlarmType") {} + IfcAlarmTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDraughtingCallout + struct IfcDraughtingCallout : IfcGeometricRepresentationItem, ObjectHelper { IfcDraughtingCallout() : Object("IfcDraughtingCallout") {} + ListOf< IfcDraughtingCalloutElement, 1, 0 >::Out Contents; + }; + + // C++ wrapper for IfcDimensionCurveDirectedCallout + struct IfcDimensionCurveDirectedCallout : IfcDraughtingCallout, ObjectHelper { IfcDimensionCurveDirectedCallout() : Object("IfcDimensionCurveDirectedCallout") {} + + }; + + // C++ wrapper for IfcAngularDimension + struct IfcAngularDimension : IfcDimensionCurveDirectedCallout, ObjectHelper { IfcAngularDimension() : Object("IfcAngularDimension") {} + + }; + + // C++ wrapper for IfcProduct + struct IfcProduct : IfcObject, ObjectHelper { IfcProduct() : Object("IfcProduct") {} + Maybe< Lazy< IfcObjectPlacement > > ObjectPlacement; + Maybe< Lazy< IfcProductRepresentation > > Representation; + }; + + // C++ wrapper for IfcAnnotation + struct IfcAnnotation : IfcProduct, ObjectHelper { IfcAnnotation() : Object("IfcAnnotation") {} + + }; + + // C++ wrapper for IfcStyledItem + struct IfcStyledItem : IfcRepresentationItem, ObjectHelper { IfcStyledItem() : Object("IfcStyledItem") {} + Maybe< Lazy< IfcRepresentationItem > > Item; + ListOf< Lazy< IfcPresentationStyleAssignment >, 1, 0 > Styles; + Maybe< IfcLabel::Out > Name; + }; + + // C++ wrapper for IfcAnnotationOccurrence + struct IfcAnnotationOccurrence : IfcStyledItem, ObjectHelper { IfcAnnotationOccurrence() : Object("IfcAnnotationOccurrence") {} + + }; + + // C++ wrapper for IfcAnnotationCurveOccurrence + struct IfcAnnotationCurveOccurrence : IfcAnnotationOccurrence, ObjectHelper { IfcAnnotationCurveOccurrence() : Object("IfcAnnotationCurveOccurrence") {} + + }; + + // C++ wrapper for IfcAnnotationFillArea + struct IfcAnnotationFillArea : IfcGeometricRepresentationItem, ObjectHelper { IfcAnnotationFillArea() : Object("IfcAnnotationFillArea") {} + Lazy< IfcCurve > OuterBoundary; + Maybe< ListOf< Lazy< IfcCurve >, 1, 0 > > InnerBoundaries; + }; + + // C++ wrapper for IfcAnnotationFillAreaOccurrence + struct IfcAnnotationFillAreaOccurrence : IfcAnnotationOccurrence, ObjectHelper { IfcAnnotationFillAreaOccurrence() : Object("IfcAnnotationFillAreaOccurrence") {} + Maybe< Lazy< IfcPoint > > FillStyleTarget; + Maybe< IfcGlobalOrLocalEnum::Out > GlobalOrLocal; + }; + + // C++ wrapper for IfcAnnotationSurface + struct IfcAnnotationSurface : IfcGeometricRepresentationItem, ObjectHelper { IfcAnnotationSurface() : Object("IfcAnnotationSurface") {} + Lazy< IfcGeometricRepresentationItem > Item; + Maybe< Lazy< NotImplemented > > TextureCoordinates; + }; + + // C++ wrapper for IfcAnnotationSurfaceOccurrence + struct IfcAnnotationSurfaceOccurrence : IfcAnnotationOccurrence, ObjectHelper { IfcAnnotationSurfaceOccurrence() : Object("IfcAnnotationSurfaceOccurrence") {} + + }; + + // C++ wrapper for IfcAnnotationSymbolOccurrence + struct IfcAnnotationSymbolOccurrence : IfcAnnotationOccurrence, ObjectHelper { IfcAnnotationSymbolOccurrence() : Object("IfcAnnotationSymbolOccurrence") {} + + }; + + // C++ wrapper for IfcAnnotationTextOccurrence + struct IfcAnnotationTextOccurrence : IfcAnnotationOccurrence, ObjectHelper { IfcAnnotationTextOccurrence() : Object("IfcAnnotationTextOccurrence") {} + + }; + + // C++ wrapper for IfcProfileDef + struct IfcProfileDef : ObjectHelper { IfcProfileDef() : Object("IfcProfileDef") {} + IfcProfileTypeEnum::Out ProfileType; + Maybe< IfcLabel::Out > ProfileName; + }; + + // C++ wrapper for IfcArbitraryClosedProfileDef + struct IfcArbitraryClosedProfileDef : IfcProfileDef, ObjectHelper { IfcArbitraryClosedProfileDef() : Object("IfcArbitraryClosedProfileDef") {} + Lazy< IfcCurve > OuterCurve; + }; + + // C++ wrapper for IfcArbitraryOpenProfileDef + struct IfcArbitraryOpenProfileDef : IfcProfileDef, ObjectHelper { IfcArbitraryOpenProfileDef() : Object("IfcArbitraryOpenProfileDef") {} + Lazy< IfcBoundedCurve > Curve; + }; + + // C++ wrapper for IfcArbitraryProfileDefWithVoids + struct IfcArbitraryProfileDefWithVoids : IfcArbitraryClosedProfileDef, ObjectHelper { IfcArbitraryProfileDefWithVoids() : Object("IfcArbitraryProfileDefWithVoids") {} + ListOf< Lazy< IfcCurve >, 1, 0 > InnerCurves; + }; + + // C++ wrapper for IfcGroup + struct IfcGroup : IfcObject, ObjectHelper { IfcGroup() : Object("IfcGroup") {} + + }; + + // C++ wrapper for IfcAsset + struct IfcAsset : IfcGroup, ObjectHelper { IfcAsset() : Object("IfcAsset") {} + IfcIdentifier::Out AssetID; + Lazy< NotImplemented > OriginalValue; + Lazy< NotImplemented > CurrentValue; + Lazy< NotImplemented > TotalReplacementCost; + IfcActorSelect::Out Owner; + IfcActorSelect::Out User; + Lazy< NotImplemented > ResponsiblePerson; + Lazy< NotImplemented > IncorporationDate; + Lazy< NotImplemented > DepreciatedValue; + }; + + // C++ wrapper for IfcParameterizedProfileDef + struct IfcParameterizedProfileDef : IfcProfileDef, ObjectHelper { IfcParameterizedProfileDef() : Object("IfcParameterizedProfileDef") {} + Lazy< IfcAxis2Placement2D > Position; + }; + + // C++ wrapper for IfcIShapeProfileDef + struct IfcIShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcIShapeProfileDef() : Object("IfcIShapeProfileDef") {} + IfcPositiveLengthMeasure::Out OverallWidth; + IfcPositiveLengthMeasure::Out OverallDepth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcPositiveLengthMeasure::Out > FilletRadius; + }; + + // C++ wrapper for IfcAsymmetricIShapeProfileDef + struct IfcAsymmetricIShapeProfileDef : IfcIShapeProfileDef, ObjectHelper { IfcAsymmetricIShapeProfileDef() : Object("IfcAsymmetricIShapeProfileDef") {} + IfcPositiveLengthMeasure::Out TopFlangeWidth; + Maybe< IfcPositiveLengthMeasure::Out > TopFlangeThickness; + Maybe< IfcPositiveLengthMeasure::Out > TopFlangeFilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInY; + }; + + // C++ wrapper for IfcPlacement + struct IfcPlacement : IfcGeometricRepresentationItem, ObjectHelper { IfcPlacement() : Object("IfcPlacement") {} + Lazy< IfcCartesianPoint > Location; + }; + + // C++ wrapper for IfcAxis1Placement + struct IfcAxis1Placement : IfcPlacement, ObjectHelper { IfcAxis1Placement() : Object("IfcAxis1Placement") {} + Maybe< Lazy< IfcDirection > > Axis; + }; + + // C++ wrapper for IfcAxis2Placement2D + struct IfcAxis2Placement2D : IfcPlacement, ObjectHelper { IfcAxis2Placement2D() : Object("IfcAxis2Placement2D") {} + Maybe< Lazy< IfcDirection > > RefDirection; + }; + + // C++ wrapper for IfcAxis2Placement3D + struct IfcAxis2Placement3D : IfcPlacement, ObjectHelper { IfcAxis2Placement3D() : Object("IfcAxis2Placement3D") {} + Maybe< Lazy< IfcDirection > > Axis; + Maybe< Lazy< IfcDirection > > RefDirection; + }; + + // C++ wrapper for IfcBSplineCurve + struct IfcBSplineCurve : IfcBoundedCurve, ObjectHelper { IfcBSplineCurve() : Object("IfcBSplineCurve") {} + INTEGER::Out Degree; + ListOf< Lazy< IfcCartesianPoint >, 2, 0 > ControlPointsList; + IfcBSplineCurveForm::Out CurveForm; + LOGICAL::Out ClosedCurve; + LOGICAL::Out SelfIntersect; + }; + + // C++ wrapper for IfcElement + struct IfcElement : IfcProduct, ObjectHelper { IfcElement() : Object("IfcElement") {} + Maybe< IfcIdentifier::Out > Tag; + }; + + // C++ wrapper for IfcBuildingElement + struct IfcBuildingElement : IfcElement, ObjectHelper { IfcBuildingElement() : Object("IfcBuildingElement") {} + + }; + + // C++ wrapper for IfcBeam + struct IfcBeam : IfcBuildingElement, ObjectHelper { IfcBeam() : Object("IfcBeam") {} + + }; + + // C++ wrapper for IfcBuildingElementType + struct IfcBuildingElementType : IfcElementType, ObjectHelper { IfcBuildingElementType() : Object("IfcBuildingElementType") {} + + }; + + // C++ wrapper for IfcBeamType + struct IfcBeamType : IfcBuildingElementType, ObjectHelper { IfcBeamType() : Object("IfcBeamType") {} + IfcBeamTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcBezierCurve + struct IfcBezierCurve : IfcBSplineCurve, ObjectHelper { IfcBezierCurve() : Object("IfcBezierCurve") {} + + }; + + // C++ wrapper for IfcCsgPrimitive3D + struct IfcCsgPrimitive3D : IfcGeometricRepresentationItem, ObjectHelper { IfcCsgPrimitive3D() : Object("IfcCsgPrimitive3D") {} + Lazy< IfcAxis2Placement3D > Position; + }; + + // C++ wrapper for IfcBlock + struct IfcBlock : IfcCsgPrimitive3D, ObjectHelper { IfcBlock() : Object("IfcBlock") {} + IfcPositiveLengthMeasure::Out XLength; + IfcPositiveLengthMeasure::Out YLength; + IfcPositiveLengthMeasure::Out ZLength; + }; + + // C++ wrapper for IfcBoilerType + struct IfcBoilerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcBoilerType() : Object("IfcBoilerType") {} + IfcBoilerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcBooleanResult + struct IfcBooleanResult : IfcGeometricRepresentationItem, ObjectHelper { IfcBooleanResult() : Object("IfcBooleanResult") {} + IfcBooleanOperator::Out Operator; + IfcBooleanOperand::Out FirstOperand; + IfcBooleanOperand::Out SecondOperand; + }; + + // C++ wrapper for IfcBooleanClippingResult + struct IfcBooleanClippingResult : IfcBooleanResult, ObjectHelper { IfcBooleanClippingResult() : Object("IfcBooleanClippingResult") {} + + }; + + // C++ wrapper for IfcSurface + struct IfcSurface : IfcGeometricRepresentationItem, ObjectHelper { IfcSurface() : Object("IfcSurface") {} + + }; + + // C++ wrapper for IfcBoundedSurface + struct IfcBoundedSurface : IfcSurface, ObjectHelper { IfcBoundedSurface() : Object("IfcBoundedSurface") {} + + }; + + // C++ wrapper for IfcBoundingBox + struct IfcBoundingBox : IfcGeometricRepresentationItem, ObjectHelper { IfcBoundingBox() : Object("IfcBoundingBox") {} + Lazy< IfcCartesianPoint > Corner; + IfcPositiveLengthMeasure::Out XDim; + IfcPositiveLengthMeasure::Out YDim; + IfcPositiveLengthMeasure::Out ZDim; + }; + + // C++ wrapper for IfcHalfSpaceSolid + struct IfcHalfSpaceSolid : IfcGeometricRepresentationItem, ObjectHelper { IfcHalfSpaceSolid() : Object("IfcHalfSpaceSolid") {} + Lazy< IfcSurface > BaseSurface; + BOOLEAN::Out AgreementFlag; + }; + + // C++ wrapper for IfcBoxedHalfSpace + struct IfcBoxedHalfSpace : IfcHalfSpaceSolid, ObjectHelper { IfcBoxedHalfSpace() : Object("IfcBoxedHalfSpace") {} + Lazy< IfcBoundingBox > Enclosure; + }; + + // C++ wrapper for IfcSpatialStructureElement + struct IfcSpatialStructureElement : IfcProduct, ObjectHelper { IfcSpatialStructureElement() : Object("IfcSpatialStructureElement") {} + Maybe< IfcLabel::Out > LongName; + IfcElementCompositionEnum::Out CompositionType; + }; + + // C++ wrapper for IfcBuilding + struct IfcBuilding : IfcSpatialStructureElement, ObjectHelper { IfcBuilding() : Object("IfcBuilding") {} + Maybe< IfcLengthMeasure::Out > ElevationOfRefHeight; + Maybe< IfcLengthMeasure::Out > ElevationOfTerrain; + Maybe< Lazy< NotImplemented > > BuildingAddress; + }; + + // C++ wrapper for IfcBuildingElementComponent + struct IfcBuildingElementComponent : IfcBuildingElement, ObjectHelper { IfcBuildingElementComponent() : Object("IfcBuildingElementComponent") {} + + }; + + // C++ wrapper for IfcBuildingElementPart + struct IfcBuildingElementPart : IfcBuildingElementComponent, ObjectHelper { IfcBuildingElementPart() : Object("IfcBuildingElementPart") {} + + }; + + // C++ wrapper for IfcBuildingElementProxy + struct IfcBuildingElementProxy : IfcBuildingElement, ObjectHelper { IfcBuildingElementProxy() : Object("IfcBuildingElementProxy") {} + Maybe< IfcElementCompositionEnum::Out > CompositionType; + }; + + // C++ wrapper for IfcBuildingElementProxyType + struct IfcBuildingElementProxyType : IfcBuildingElementType, ObjectHelper { IfcBuildingElementProxyType() : Object("IfcBuildingElementProxyType") {} + IfcBuildingElementProxyTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcBuildingStorey + struct IfcBuildingStorey : IfcSpatialStructureElement, ObjectHelper { IfcBuildingStorey() : Object("IfcBuildingStorey") {} + Maybe< IfcLengthMeasure::Out > Elevation; + }; + + // C++ wrapper for IfcCShapeProfileDef + struct IfcCShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcCShapeProfileDef() : Object("IfcCShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out Width; + IfcPositiveLengthMeasure::Out WallThickness; + IfcPositiveLengthMeasure::Out Girth; + Maybe< IfcPositiveLengthMeasure::Out > InternalFilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInX; + }; + + // C++ wrapper for IfcFlowFittingType + struct IfcFlowFittingType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowFittingType() : Object("IfcFlowFittingType") {} + + }; + + // C++ wrapper for IfcCableCarrierFittingType + struct IfcCableCarrierFittingType : IfcFlowFittingType, ObjectHelper { IfcCableCarrierFittingType() : Object("IfcCableCarrierFittingType") {} + IfcCableCarrierFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowSegmentType + struct IfcFlowSegmentType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowSegmentType() : Object("IfcFlowSegmentType") {} + + }; + + // C++ wrapper for IfcCableCarrierSegmentType + struct IfcCableCarrierSegmentType : IfcFlowSegmentType, ObjectHelper { IfcCableCarrierSegmentType() : Object("IfcCableCarrierSegmentType") {} + IfcCableCarrierSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCableSegmentType + struct IfcCableSegmentType : IfcFlowSegmentType, ObjectHelper { IfcCableSegmentType() : Object("IfcCableSegmentType") {} + IfcCableSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPoint + struct IfcPoint : IfcGeometricRepresentationItem, ObjectHelper { IfcPoint() : Object("IfcPoint") {} + + }; + + // C++ wrapper for IfcCartesianPoint + struct IfcCartesianPoint : IfcPoint, ObjectHelper { IfcCartesianPoint() : Object("IfcCartesianPoint") {} + ListOf< IfcLengthMeasure, 1, 3 >::Out Coordinates; + }; + + // C++ wrapper for IfcCartesianTransformationOperator + struct IfcCartesianTransformationOperator : IfcGeometricRepresentationItem, ObjectHelper { IfcCartesianTransformationOperator() : Object("IfcCartesianTransformationOperator") {} + Maybe< Lazy< IfcDirection > > Axis1; + Maybe< Lazy< IfcDirection > > Axis2; + Lazy< IfcCartesianPoint > LocalOrigin; + Maybe< REAL::Out > Scale; + }; + + // C++ wrapper for IfcCartesianTransformationOperator2D + struct IfcCartesianTransformationOperator2D : IfcCartesianTransformationOperator, ObjectHelper { IfcCartesianTransformationOperator2D() : Object("IfcCartesianTransformationOperator2D") {} + + }; + + // C++ wrapper for IfcCartesianTransformationOperator2DnonUniform + struct IfcCartesianTransformationOperator2DnonUniform : IfcCartesianTransformationOperator2D, ObjectHelper { IfcCartesianTransformationOperator2DnonUniform() : Object("IfcCartesianTransformationOperator2DnonUniform") {} + Maybe< REAL::Out > Scale2; + }; + + // C++ wrapper for IfcCartesianTransformationOperator3D + struct IfcCartesianTransformationOperator3D : IfcCartesianTransformationOperator, ObjectHelper { IfcCartesianTransformationOperator3D() : Object("IfcCartesianTransformationOperator3D") {} + Maybe< Lazy< IfcDirection > > Axis3; + }; + + // C++ wrapper for IfcCartesianTransformationOperator3DnonUniform + struct IfcCartesianTransformationOperator3DnonUniform : IfcCartesianTransformationOperator3D, ObjectHelper { IfcCartesianTransformationOperator3DnonUniform() : Object("IfcCartesianTransformationOperator3DnonUniform") {} + Maybe< REAL::Out > Scale2; + Maybe< REAL::Out > Scale3; + }; + + // C++ wrapper for IfcCenterLineProfileDef + struct IfcCenterLineProfileDef : IfcArbitraryOpenProfileDef, ObjectHelper { IfcCenterLineProfileDef() : Object("IfcCenterLineProfileDef") {} + IfcPositiveLengthMeasure::Out Thickness; + }; + + // C++ wrapper for IfcFeatureElement + struct IfcFeatureElement : IfcElement, ObjectHelper { IfcFeatureElement() : Object("IfcFeatureElement") {} + + }; + + // C++ wrapper for IfcFeatureElementSubtraction + struct IfcFeatureElementSubtraction : IfcFeatureElement, ObjectHelper { IfcFeatureElementSubtraction() : Object("IfcFeatureElementSubtraction") {} + + }; + + // C++ wrapper for IfcEdgeFeature + struct IfcEdgeFeature : IfcFeatureElementSubtraction, ObjectHelper { IfcEdgeFeature() : Object("IfcEdgeFeature") {} + Maybe< IfcPositiveLengthMeasure::Out > FeatureLength; + }; + + // C++ wrapper for IfcChamferEdgeFeature + struct IfcChamferEdgeFeature : IfcEdgeFeature, ObjectHelper { IfcChamferEdgeFeature() : Object("IfcChamferEdgeFeature") {} + Maybe< IfcPositiveLengthMeasure::Out > Width; + Maybe< IfcPositiveLengthMeasure::Out > Height; + }; + + // C++ wrapper for IfcChillerType + struct IfcChillerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcChillerType() : Object("IfcChillerType") {} + IfcChillerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcConic + struct IfcConic : IfcCurve, ObjectHelper { IfcConic() : Object("IfcConic") {} + IfcAxis2Placement::Out Position; + }; + + // C++ wrapper for IfcCircle + struct IfcCircle : IfcConic, ObjectHelper { IfcCircle() : Object("IfcCircle") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcCircleProfileDef + struct IfcCircleProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcCircleProfileDef() : Object("IfcCircleProfileDef") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcCircleHollowProfileDef + struct IfcCircleHollowProfileDef : IfcCircleProfileDef, ObjectHelper { IfcCircleHollowProfileDef() : Object("IfcCircleHollowProfileDef") {} + IfcPositiveLengthMeasure::Out WallThickness; + }; + + // C++ wrapper for IfcTopologicalRepresentationItem + struct IfcTopologicalRepresentationItem : IfcRepresentationItem, ObjectHelper { IfcTopologicalRepresentationItem() : Object("IfcTopologicalRepresentationItem") {} + + }; + + // C++ wrapper for IfcConnectedFaceSet + struct IfcConnectedFaceSet : IfcTopologicalRepresentationItem, ObjectHelper { IfcConnectedFaceSet() : Object("IfcConnectedFaceSet") {} + ListOf< Lazy< IfcFace >, 1, 0 > CfsFaces; + }; + + // C++ wrapper for IfcClosedShell + struct IfcClosedShell : IfcConnectedFaceSet, ObjectHelper { IfcClosedShell() : Object("IfcClosedShell") {} + + }; + + // C++ wrapper for IfcCoilType + struct IfcCoilType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCoilType() : Object("IfcCoilType") {} + IfcCoilTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcColourSpecification + struct IfcColourSpecification : ObjectHelper { IfcColourSpecification() : Object("IfcColourSpecification") {} + Maybe< IfcLabel::Out > Name; + }; + + // C++ wrapper for IfcColourRgb + struct IfcColourRgb : IfcColourSpecification, ObjectHelper { IfcColourRgb() : Object("IfcColourRgb") {} + IfcNormalisedRatioMeasure::Out Red; + IfcNormalisedRatioMeasure::Out Green; + IfcNormalisedRatioMeasure::Out Blue; + }; + + // C++ wrapper for IfcColumn + struct IfcColumn : IfcBuildingElement, ObjectHelper { IfcColumn() : Object("IfcColumn") {} + + }; + + // C++ wrapper for IfcColumnType + struct IfcColumnType : IfcBuildingElementType, ObjectHelper { IfcColumnType() : Object("IfcColumnType") {} + IfcColumnTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProperty + struct IfcProperty : ObjectHelper { IfcProperty() : Object("IfcProperty") {} + IfcIdentifier::Out Name; + Maybe< IfcText::Out > Description; + }; + + // C++ wrapper for IfcComplexProperty + struct IfcComplexProperty : IfcProperty, ObjectHelper { IfcComplexProperty() : Object("IfcComplexProperty") {} + IfcIdentifier::Out UsageName; + ListOf< Lazy< IfcProperty >, 1, 0 > HasProperties; + }; + + // C++ wrapper for IfcCompositeCurveSegment + struct IfcCompositeCurveSegment : IfcGeometricRepresentationItem, ObjectHelper { IfcCompositeCurveSegment() : Object("IfcCompositeCurveSegment") {} + IfcTransitionCode::Out Transition; + BOOLEAN::Out SameSense; + Lazy< IfcCurve > ParentCurve; + }; + + // C++ wrapper for IfcCompositeProfileDef + struct IfcCompositeProfileDef : IfcProfileDef, ObjectHelper { IfcCompositeProfileDef() : Object("IfcCompositeProfileDef") {} + ListOf< Lazy< IfcProfileDef >, 2, 0 > Profiles; + Maybe< IfcLabel::Out > Label; + }; + + // C++ wrapper for IfcFlowMovingDeviceType + struct IfcFlowMovingDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowMovingDeviceType() : Object("IfcFlowMovingDeviceType") {} + + }; + + // C++ wrapper for IfcCompressorType + struct IfcCompressorType : IfcFlowMovingDeviceType, ObjectHelper { IfcCompressorType() : Object("IfcCompressorType") {} + IfcCompressorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCondenserType + struct IfcCondenserType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCondenserType() : Object("IfcCondenserType") {} + IfcCondenserTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCondition + struct IfcCondition : IfcGroup, ObjectHelper { IfcCondition() : Object("IfcCondition") {} + + }; + + // C++ wrapper for IfcConditionCriterion + struct IfcConditionCriterion : IfcControl, ObjectHelper { IfcConditionCriterion() : Object("IfcConditionCriterion") {} + IfcConditionCriterionSelect::Out Criterion; + IfcDateTimeSelect::Out CriterionDateTime; + }; + + // C++ wrapper for IfcResource + struct IfcResource : IfcObject, ObjectHelper { IfcResource() : Object("IfcResource") {} + + }; + + // C++ wrapper for IfcConstructionResource + struct IfcConstructionResource : IfcResource, ObjectHelper { IfcConstructionResource() : Object("IfcConstructionResource") {} + Maybe< IfcIdentifier::Out > ResourceIdentifier; + Maybe< IfcLabel::Out > ResourceGroup; + Maybe< IfcResourceConsumptionEnum::Out > ResourceConsumption; + Maybe< Lazy< IfcMeasureWithUnit > > BaseQuantity; + }; + + // C++ wrapper for IfcConstructionEquipmentResource + struct IfcConstructionEquipmentResource : IfcConstructionResource, ObjectHelper { IfcConstructionEquipmentResource() : Object("IfcConstructionEquipmentResource") {} + + }; + + // C++ wrapper for IfcConstructionMaterialResource + struct IfcConstructionMaterialResource : IfcConstructionResource, ObjectHelper { IfcConstructionMaterialResource() : Object("IfcConstructionMaterialResource") {} + Maybe< ListOf< IfcActorSelect, 1, 0 >::Out > Suppliers; + Maybe< IfcRatioMeasure::Out > UsageRatio; + }; + + // C++ wrapper for IfcConstructionProductResource + struct IfcConstructionProductResource : IfcConstructionResource, ObjectHelper { IfcConstructionProductResource() : Object("IfcConstructionProductResource") {} + + }; + + // C++ wrapper for IfcNamedUnit + struct IfcNamedUnit : ObjectHelper { IfcNamedUnit() : Object("IfcNamedUnit") {} + Lazy< NotImplemented > Dimensions; + IfcUnitEnum::Out UnitType; + }; + + // C++ wrapper for IfcContextDependentUnit + struct IfcContextDependentUnit : IfcNamedUnit, ObjectHelper { IfcContextDependentUnit() : Object("IfcContextDependentUnit") {} + IfcLabel::Out Name; + }; + + // C++ wrapper for IfcControllerType + struct IfcControllerType : IfcDistributionControlElementType, ObjectHelper { IfcControllerType() : Object("IfcControllerType") {} + IfcControllerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcConversionBasedUnit + struct IfcConversionBasedUnit : IfcNamedUnit, ObjectHelper { IfcConversionBasedUnit() : Object("IfcConversionBasedUnit") {} + IfcLabel::Out Name; + Lazy< IfcMeasureWithUnit > ConversionFactor; + }; + + // C++ wrapper for IfcCooledBeamType + struct IfcCooledBeamType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCooledBeamType() : Object("IfcCooledBeamType") {} + IfcCooledBeamTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCoolingTowerType + struct IfcCoolingTowerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCoolingTowerType() : Object("IfcCoolingTowerType") {} + IfcCoolingTowerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCostItem + struct IfcCostItem : IfcControl, ObjectHelper { IfcCostItem() : Object("IfcCostItem") {} + + }; + + // C++ wrapper for IfcCostSchedule + struct IfcCostSchedule : IfcControl, ObjectHelper { IfcCostSchedule() : Object("IfcCostSchedule") {} + Maybe< IfcActorSelect::Out > SubmittedBy; + Maybe< IfcActorSelect::Out > PreparedBy; + Maybe< IfcDateTimeSelect::Out > SubmittedOn; + Maybe< IfcLabel::Out > Status; + Maybe< ListOf< IfcActorSelect, 1, 0 >::Out > TargetUsers; + Maybe< IfcDateTimeSelect::Out > UpdateDate; + IfcIdentifier::Out ID; + IfcCostScheduleTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCovering + struct IfcCovering : IfcBuildingElement, ObjectHelper { IfcCovering() : Object("IfcCovering") {} + Maybe< IfcCoveringTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCoveringType + struct IfcCoveringType : IfcBuildingElementType, ObjectHelper { IfcCoveringType() : Object("IfcCoveringType") {} + IfcCoveringTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCraneRailAShapeProfileDef + struct IfcCraneRailAShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcCraneRailAShapeProfileDef() : Object("IfcCraneRailAShapeProfileDef") {} + IfcPositiveLengthMeasure::Out OverallHeight; + IfcPositiveLengthMeasure::Out BaseWidth2; + Maybe< IfcPositiveLengthMeasure::Out > Radius; + IfcPositiveLengthMeasure::Out HeadWidth; + IfcPositiveLengthMeasure::Out HeadDepth2; + IfcPositiveLengthMeasure::Out HeadDepth3; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out BaseWidth4; + IfcPositiveLengthMeasure::Out BaseDepth1; + IfcPositiveLengthMeasure::Out BaseDepth2; + IfcPositiveLengthMeasure::Out BaseDepth3; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInY; + }; + + // C++ wrapper for IfcCraneRailFShapeProfileDef + struct IfcCraneRailFShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcCraneRailFShapeProfileDef() : Object("IfcCraneRailFShapeProfileDef") {} + IfcPositiveLengthMeasure::Out OverallHeight; + IfcPositiveLengthMeasure::Out HeadWidth; + Maybe< IfcPositiveLengthMeasure::Out > Radius; + IfcPositiveLengthMeasure::Out HeadDepth2; + IfcPositiveLengthMeasure::Out HeadDepth3; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out BaseDepth1; + IfcPositiveLengthMeasure::Out BaseDepth2; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInY; + }; + + // C++ wrapper for IfcCrewResource + struct IfcCrewResource : IfcConstructionResource, ObjectHelper { IfcCrewResource() : Object("IfcCrewResource") {} + + }; + + // C++ wrapper for IfcSolidModel + struct IfcSolidModel : IfcGeometricRepresentationItem, ObjectHelper { IfcSolidModel() : Object("IfcSolidModel") {} + + }; + + // C++ wrapper for IfcCsgSolid + struct IfcCsgSolid : IfcSolidModel, ObjectHelper { IfcCsgSolid() : Object("IfcCsgSolid") {} + IfcCsgSelect::Out TreeRootExpression; + }; + + // C++ wrapper for IfcCurtainWall + struct IfcCurtainWall : IfcBuildingElement, ObjectHelper { IfcCurtainWall() : Object("IfcCurtainWall") {} + + }; + + // C++ wrapper for IfcCurtainWallType + struct IfcCurtainWallType : IfcBuildingElementType, ObjectHelper { IfcCurtainWallType() : Object("IfcCurtainWallType") {} + IfcCurtainWallTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCurveBoundedPlane + struct IfcCurveBoundedPlane : IfcBoundedSurface, ObjectHelper { IfcCurveBoundedPlane() : Object("IfcCurveBoundedPlane") {} + Lazy< IfcPlane > BasisSurface; + Lazy< IfcCurve > OuterBoundary; + ListOf< Lazy< IfcCurve >, 0, 0 > InnerBoundaries; + }; + + // C++ wrapper for IfcPresentationStyle + struct IfcPresentationStyle : ObjectHelper { IfcPresentationStyle() : Object("IfcPresentationStyle") {} + Maybe< IfcLabel::Out > Name; + }; + + // C++ wrapper for IfcDamperType + struct IfcDamperType : IfcFlowControllerType, ObjectHelper { IfcDamperType() : Object("IfcDamperType") {} + IfcDamperTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDefinedSymbol + struct IfcDefinedSymbol : IfcGeometricRepresentationItem, ObjectHelper { IfcDefinedSymbol() : Object("IfcDefinedSymbol") {} + IfcDefinedSymbolSelect::Out Definition; + Lazy< IfcCartesianTransformationOperator2D > Target; + }; + + // C++ wrapper for IfcDerivedProfileDef + struct IfcDerivedProfileDef : IfcProfileDef, ObjectHelper { IfcDerivedProfileDef() : Object("IfcDerivedProfileDef") {} + Lazy< IfcProfileDef > ParentProfile; + Lazy< IfcCartesianTransformationOperator2D > Operator; + Maybe< IfcLabel::Out > Label; + }; + + // C++ wrapper for IfcDiameterDimension + struct IfcDiameterDimension : IfcDimensionCurveDirectedCallout, ObjectHelper { IfcDiameterDimension() : Object("IfcDiameterDimension") {} + + }; + + // C++ wrapper for IfcDimensionCurve + struct IfcDimensionCurve : IfcAnnotationCurveOccurrence, ObjectHelper { IfcDimensionCurve() : Object("IfcDimensionCurve") {} + + }; + + // C++ wrapper for IfcTerminatorSymbol + struct IfcTerminatorSymbol : IfcAnnotationSymbolOccurrence, ObjectHelper { IfcTerminatorSymbol() : Object("IfcTerminatorSymbol") {} + Lazy< IfcAnnotationCurveOccurrence > AnnotatedCurve; + }; + + // C++ wrapper for IfcDimensionCurveTerminator + struct IfcDimensionCurveTerminator : IfcTerminatorSymbol, ObjectHelper { IfcDimensionCurveTerminator() : Object("IfcDimensionCurveTerminator") {} + IfcDimensionExtentUsage::Out Role; + }; + + // C++ wrapper for IfcDirection + struct IfcDirection : IfcGeometricRepresentationItem, ObjectHelper { IfcDirection() : Object("IfcDirection") {} + ListOf< REAL, 2, 3 >::Out DirectionRatios; + }; + + // C++ wrapper for IfcElementComponent + struct IfcElementComponent : IfcElement, ObjectHelper { IfcElementComponent() : Object("IfcElementComponent") {} + + }; + + // C++ wrapper for IfcDiscreteAccessory + struct IfcDiscreteAccessory : IfcElementComponent, ObjectHelper { IfcDiscreteAccessory() : Object("IfcDiscreteAccessory") {} + + }; + + // C++ wrapper for IfcElementComponentType + struct IfcElementComponentType : IfcElementType, ObjectHelper { IfcElementComponentType() : Object("IfcElementComponentType") {} + + }; + + // C++ wrapper for IfcDiscreteAccessoryType + struct IfcDiscreteAccessoryType : IfcElementComponentType, ObjectHelper { IfcDiscreteAccessoryType() : Object("IfcDiscreteAccessoryType") {} + + }; + + // C++ wrapper for IfcDistributionElement + struct IfcDistributionElement : IfcElement, ObjectHelper { IfcDistributionElement() : Object("IfcDistributionElement") {} + + }; + + // C++ wrapper for IfcDistributionFlowElement + struct IfcDistributionFlowElement : IfcDistributionElement, ObjectHelper { IfcDistributionFlowElement() : Object("IfcDistributionFlowElement") {} + + }; + + // C++ wrapper for IfcDistributionChamberElement + struct IfcDistributionChamberElement : IfcDistributionFlowElement, ObjectHelper { IfcDistributionChamberElement() : Object("IfcDistributionChamberElement") {} + + }; + + // C++ wrapper for IfcDistributionChamberElementType + struct IfcDistributionChamberElementType : IfcDistributionFlowElementType, ObjectHelper { IfcDistributionChamberElementType() : Object("IfcDistributionChamberElementType") {} + IfcDistributionChamberElementTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDistributionControlElement + struct IfcDistributionControlElement : IfcDistributionElement, ObjectHelper { IfcDistributionControlElement() : Object("IfcDistributionControlElement") {} + Maybe< IfcIdentifier::Out > ControlElementId; + }; + + // C++ wrapper for IfcPort + struct IfcPort : IfcProduct, ObjectHelper { IfcPort() : Object("IfcPort") {} + + }; + + // C++ wrapper for IfcDistributionPort + struct IfcDistributionPort : IfcPort, ObjectHelper { IfcDistributionPort() : Object("IfcDistributionPort") {} + Maybe< IfcFlowDirectionEnum::Out > FlowDirection; + }; + + // C++ wrapper for IfcDoor + struct IfcDoor : IfcBuildingElement, ObjectHelper { IfcDoor() : Object("IfcDoor") {} + Maybe< IfcPositiveLengthMeasure::Out > OverallHeight; + Maybe< IfcPositiveLengthMeasure::Out > OverallWidth; + }; + + // C++ wrapper for IfcPropertyDefinition + struct IfcPropertyDefinition : IfcRoot, ObjectHelper { IfcPropertyDefinition() : Object("IfcPropertyDefinition") {} + + }; + + // C++ wrapper for IfcPropertySetDefinition + struct IfcPropertySetDefinition : IfcPropertyDefinition, ObjectHelper { IfcPropertySetDefinition() : Object("IfcPropertySetDefinition") {} + + }; + + // C++ wrapper for IfcDoorStyle + struct IfcDoorStyle : IfcTypeProduct, ObjectHelper { IfcDoorStyle() : Object("IfcDoorStyle") {} + IfcDoorStyleOperationEnum::Out OperationType; + IfcDoorStyleConstructionEnum::Out ConstructionType; + BOOLEAN::Out ParameterTakesPrecedence; + BOOLEAN::Out Sizeable; + }; + + // C++ wrapper for IfcDuctFittingType + struct IfcDuctFittingType : IfcFlowFittingType, ObjectHelper { IfcDuctFittingType() : Object("IfcDuctFittingType") {} + IfcDuctFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDuctSegmentType + struct IfcDuctSegmentType : IfcFlowSegmentType, ObjectHelper { IfcDuctSegmentType() : Object("IfcDuctSegmentType") {} + IfcDuctSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowTreatmentDeviceType + struct IfcFlowTreatmentDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowTreatmentDeviceType() : Object("IfcFlowTreatmentDeviceType") {} + + }; + + // C++ wrapper for IfcDuctSilencerType + struct IfcDuctSilencerType : IfcFlowTreatmentDeviceType, ObjectHelper { IfcDuctSilencerType() : Object("IfcDuctSilencerType") {} + IfcDuctSilencerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEdge + struct IfcEdge : IfcTopologicalRepresentationItem, ObjectHelper { IfcEdge() : Object("IfcEdge") {} + Lazy< IfcVertex > EdgeStart; + Lazy< IfcVertex > EdgeEnd; + }; + + // C++ wrapper for IfcEdgeCurve + struct IfcEdgeCurve : IfcEdge, ObjectHelper { IfcEdgeCurve() : Object("IfcEdgeCurve") {} + Lazy< IfcCurve > EdgeGeometry; + BOOLEAN::Out SameSense; + }; + + // C++ wrapper for IfcLoop + struct IfcLoop : IfcTopologicalRepresentationItem, ObjectHelper { IfcLoop() : Object("IfcLoop") {} + + }; + + // C++ wrapper for IfcEdgeLoop + struct IfcEdgeLoop : IfcLoop, ObjectHelper { IfcEdgeLoop() : Object("IfcEdgeLoop") {} + ListOf< Lazy< IfcOrientedEdge >, 1, 0 > EdgeList; + }; + + // C++ wrapper for IfcElectricApplianceType + struct IfcElectricApplianceType : IfcFlowTerminalType, ObjectHelper { IfcElectricApplianceType() : Object("IfcElectricApplianceType") {} + IfcElectricApplianceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowController + struct IfcFlowController : IfcDistributionFlowElement, ObjectHelper { IfcFlowController() : Object("IfcFlowController") {} + + }; + + // C++ wrapper for IfcElectricDistributionPoint + struct IfcElectricDistributionPoint : IfcFlowController, ObjectHelper { IfcElectricDistributionPoint() : Object("IfcElectricDistributionPoint") {} + IfcElectricDistributionPointFunctionEnum::Out DistributionPointFunction; + Maybe< IfcLabel::Out > UserDefinedFunction; + }; + + // C++ wrapper for IfcFlowStorageDeviceType + struct IfcFlowStorageDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowStorageDeviceType() : Object("IfcFlowStorageDeviceType") {} + + }; + + // C++ wrapper for IfcElectricFlowStorageDeviceType + struct IfcElectricFlowStorageDeviceType : IfcFlowStorageDeviceType, ObjectHelper { IfcElectricFlowStorageDeviceType() : Object("IfcElectricFlowStorageDeviceType") {} + IfcElectricFlowStorageDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricGeneratorType + struct IfcElectricGeneratorType : IfcEnergyConversionDeviceType, ObjectHelper { IfcElectricGeneratorType() : Object("IfcElectricGeneratorType") {} + IfcElectricGeneratorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricHeaterType + struct IfcElectricHeaterType : IfcFlowTerminalType, ObjectHelper { IfcElectricHeaterType() : Object("IfcElectricHeaterType") {} + IfcElectricHeaterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricMotorType + struct IfcElectricMotorType : IfcEnergyConversionDeviceType, ObjectHelper { IfcElectricMotorType() : Object("IfcElectricMotorType") {} + IfcElectricMotorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricTimeControlType + struct IfcElectricTimeControlType : IfcFlowControllerType, ObjectHelper { IfcElectricTimeControlType() : Object("IfcElectricTimeControlType") {} + IfcElectricTimeControlTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSystem + struct IfcSystem : IfcGroup, ObjectHelper { IfcSystem() : Object("IfcSystem") {} + + }; + + // C++ wrapper for IfcElectricalCircuit + struct IfcElectricalCircuit : IfcSystem, ObjectHelper { IfcElectricalCircuit() : Object("IfcElectricalCircuit") {} + + }; + + // C++ wrapper for IfcElectricalElement + struct IfcElectricalElement : IfcElement, ObjectHelper { IfcElectricalElement() : Object("IfcElectricalElement") {} + + }; + + // C++ wrapper for IfcElementAssembly + struct IfcElementAssembly : IfcElement, ObjectHelper { IfcElementAssembly() : Object("IfcElementAssembly") {} + Maybe< IfcAssemblyPlaceEnum::Out > AssemblyPlace; + IfcElementAssemblyTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElementQuantity + struct IfcElementQuantity : IfcPropertySetDefinition, ObjectHelper { IfcElementQuantity() : Object("IfcElementQuantity") {} + Maybe< IfcLabel::Out > MethodOfMeasurement; + ListOf< Lazy< NotImplemented >, 1, 0 > Quantities; + }; + + // C++ wrapper for IfcElementarySurface + struct IfcElementarySurface : IfcSurface, ObjectHelper { IfcElementarySurface() : Object("IfcElementarySurface") {} + Lazy< IfcAxis2Placement3D > Position; + }; + + // C++ wrapper for IfcEllipse + struct IfcEllipse : IfcConic, ObjectHelper { IfcEllipse() : Object("IfcEllipse") {} + IfcPositiveLengthMeasure::Out SemiAxis1; + IfcPositiveLengthMeasure::Out SemiAxis2; + }; + + // C++ wrapper for IfcEllipseProfileDef + struct IfcEllipseProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcEllipseProfileDef() : Object("IfcEllipseProfileDef") {} + IfcPositiveLengthMeasure::Out SemiAxis1; + IfcPositiveLengthMeasure::Out SemiAxis2; + }; + + // C++ wrapper for IfcEnergyConversionDevice + struct IfcEnergyConversionDevice : IfcDistributionFlowElement, ObjectHelper { IfcEnergyConversionDevice() : Object("IfcEnergyConversionDevice") {} + + }; + + // C++ wrapper for IfcEquipmentElement + struct IfcEquipmentElement : IfcElement, ObjectHelper { IfcEquipmentElement() : Object("IfcEquipmentElement") {} + + }; + + // C++ wrapper for IfcEquipmentStandard + struct IfcEquipmentStandard : IfcControl, ObjectHelper { IfcEquipmentStandard() : Object("IfcEquipmentStandard") {} + + }; + + // C++ wrapper for IfcEvaporativeCoolerType + struct IfcEvaporativeCoolerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcEvaporativeCoolerType() : Object("IfcEvaporativeCoolerType") {} + IfcEvaporativeCoolerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEvaporatorType + struct IfcEvaporatorType : IfcEnergyConversionDeviceType, ObjectHelper { IfcEvaporatorType() : Object("IfcEvaporatorType") {} + IfcEvaporatorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSweptAreaSolid + struct IfcSweptAreaSolid : IfcSolidModel, ObjectHelper { IfcSweptAreaSolid() : Object("IfcSweptAreaSolid") {} + Lazy< IfcProfileDef > SweptArea; + Lazy< IfcAxis2Placement3D > Position; + }; + + // C++ wrapper for IfcExtrudedAreaSolid + struct IfcExtrudedAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcExtrudedAreaSolid() : Object("IfcExtrudedAreaSolid") {} + Lazy< IfcDirection > ExtrudedDirection; + IfcPositiveLengthMeasure::Out Depth; + }; + + // C++ wrapper for IfcFace + struct IfcFace : IfcTopologicalRepresentationItem, ObjectHelper { IfcFace() : Object("IfcFace") {} + ListOf< Lazy< IfcFaceBound >, 1, 0 > Bounds; + }; + + // C++ wrapper for IfcFaceBasedSurfaceModel + struct IfcFaceBasedSurfaceModel : IfcGeometricRepresentationItem, ObjectHelper { IfcFaceBasedSurfaceModel() : Object("IfcFaceBasedSurfaceModel") {} + ListOf< Lazy< IfcConnectedFaceSet >, 1, 0 > FbsmFaces; + }; + + // C++ wrapper for IfcFaceBound + struct IfcFaceBound : IfcTopologicalRepresentationItem, ObjectHelper { IfcFaceBound() : Object("IfcFaceBound") {} + Lazy< IfcLoop > Bound; + BOOLEAN::Out Orientation; + }; + + // C++ wrapper for IfcFaceOuterBound + struct IfcFaceOuterBound : IfcFaceBound, ObjectHelper { IfcFaceOuterBound() : Object("IfcFaceOuterBound") {} + + }; + + // C++ wrapper for IfcFaceSurface + struct IfcFaceSurface : IfcFace, ObjectHelper { IfcFaceSurface() : Object("IfcFaceSurface") {} + Lazy< IfcSurface > FaceSurface; + BOOLEAN::Out SameSense; + }; + + // C++ wrapper for IfcManifoldSolidBrep + struct IfcManifoldSolidBrep : IfcSolidModel, ObjectHelper { IfcManifoldSolidBrep() : Object("IfcManifoldSolidBrep") {} + Lazy< IfcClosedShell > Outer; + }; + + // C++ wrapper for IfcFacetedBrep + struct IfcFacetedBrep : IfcManifoldSolidBrep, ObjectHelper { IfcFacetedBrep() : Object("IfcFacetedBrep") {} + + }; + + // C++ wrapper for IfcFacetedBrepWithVoids + struct IfcFacetedBrepWithVoids : IfcManifoldSolidBrep, ObjectHelper { IfcFacetedBrepWithVoids() : Object("IfcFacetedBrepWithVoids") {} + ListOf< Lazy< IfcClosedShell >, 1, 0 > Voids; + }; + + // C++ wrapper for IfcFanType + struct IfcFanType : IfcFlowMovingDeviceType, ObjectHelper { IfcFanType() : Object("IfcFanType") {} + IfcFanTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFastener + struct IfcFastener : IfcElementComponent, ObjectHelper { IfcFastener() : Object("IfcFastener") {} + + }; + + // C++ wrapper for IfcFastenerType + struct IfcFastenerType : IfcElementComponentType, ObjectHelper { IfcFastenerType() : Object("IfcFastenerType") {} + + }; + + // C++ wrapper for IfcFeatureElementAddition + struct IfcFeatureElementAddition : IfcFeatureElement, ObjectHelper { IfcFeatureElementAddition() : Object("IfcFeatureElementAddition") {} + + }; + + // C++ wrapper for IfcFillAreaStyleHatching + struct IfcFillAreaStyleHatching : IfcGeometricRepresentationItem, ObjectHelper { IfcFillAreaStyleHatching() : Object("IfcFillAreaStyleHatching") {} + Lazy< NotImplemented > HatchLineAppearance; + IfcHatchLineDistanceSelect::Out StartOfNextHatchLine; + Maybe< Lazy< IfcCartesianPoint > > PointOfReferenceHatchLine; + Maybe< Lazy< IfcCartesianPoint > > PatternStart; + IfcPlaneAngleMeasure::Out HatchLineAngle; + }; + + // C++ wrapper for IfcFillAreaStyleTileSymbolWithStyle + struct IfcFillAreaStyleTileSymbolWithStyle : IfcGeometricRepresentationItem, ObjectHelper { IfcFillAreaStyleTileSymbolWithStyle() : Object("IfcFillAreaStyleTileSymbolWithStyle") {} + Lazy< IfcAnnotationSymbolOccurrence > Symbol; + }; + + // C++ wrapper for IfcFillAreaStyleTiles + struct IfcFillAreaStyleTiles : IfcGeometricRepresentationItem, ObjectHelper { IfcFillAreaStyleTiles() : Object("IfcFillAreaStyleTiles") {} + Lazy< IfcOneDirectionRepeatFactor > TilingPattern; + ListOf< IfcFillAreaStyleTileShapeSelect, 1, 0 >::Out Tiles; + IfcPositiveRatioMeasure::Out TilingScale; + }; + + // C++ wrapper for IfcFilterType + struct IfcFilterType : IfcFlowTreatmentDeviceType, ObjectHelper { IfcFilterType() : Object("IfcFilterType") {} + IfcFilterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFireSuppressionTerminalType + struct IfcFireSuppressionTerminalType : IfcFlowTerminalType, ObjectHelper { IfcFireSuppressionTerminalType() : Object("IfcFireSuppressionTerminalType") {} + IfcFireSuppressionTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowFitting + struct IfcFlowFitting : IfcDistributionFlowElement, ObjectHelper { IfcFlowFitting() : Object("IfcFlowFitting") {} + + }; + + // C++ wrapper for IfcFlowInstrumentType + struct IfcFlowInstrumentType : IfcDistributionControlElementType, ObjectHelper { IfcFlowInstrumentType() : Object("IfcFlowInstrumentType") {} + IfcFlowInstrumentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowMeterType + struct IfcFlowMeterType : IfcFlowControllerType, ObjectHelper { IfcFlowMeterType() : Object("IfcFlowMeterType") {} + IfcFlowMeterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowMovingDevice + struct IfcFlowMovingDevice : IfcDistributionFlowElement, ObjectHelper { IfcFlowMovingDevice() : Object("IfcFlowMovingDevice") {} + + }; + + // C++ wrapper for IfcFlowSegment + struct IfcFlowSegment : IfcDistributionFlowElement, ObjectHelper { IfcFlowSegment() : Object("IfcFlowSegment") {} + + }; + + // C++ wrapper for IfcFlowStorageDevice + struct IfcFlowStorageDevice : IfcDistributionFlowElement, ObjectHelper { IfcFlowStorageDevice() : Object("IfcFlowStorageDevice") {} + + }; + + // C++ wrapper for IfcFlowTerminal + struct IfcFlowTerminal : IfcDistributionFlowElement, ObjectHelper { IfcFlowTerminal() : Object("IfcFlowTerminal") {} + + }; + + // C++ wrapper for IfcFlowTreatmentDevice + struct IfcFlowTreatmentDevice : IfcDistributionFlowElement, ObjectHelper { IfcFlowTreatmentDevice() : Object("IfcFlowTreatmentDevice") {} + + }; + + // C++ wrapper for IfcFooting + struct IfcFooting : IfcBuildingElement, ObjectHelper { IfcFooting() : Object("IfcFooting") {} + IfcFootingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFurnishingElement + struct IfcFurnishingElement : IfcElement, ObjectHelper { IfcFurnishingElement() : Object("IfcFurnishingElement") {} + + }; + + // C++ wrapper for IfcFurnishingElementType + struct IfcFurnishingElementType : IfcElementType, ObjectHelper { IfcFurnishingElementType() : Object("IfcFurnishingElementType") {} + + }; + + // C++ wrapper for IfcFurnitureStandard + struct IfcFurnitureStandard : IfcControl, ObjectHelper { IfcFurnitureStandard() : Object("IfcFurnitureStandard") {} + + }; + + // C++ wrapper for IfcFurnitureType + struct IfcFurnitureType : IfcFurnishingElementType, ObjectHelper { IfcFurnitureType() : Object("IfcFurnitureType") {} + IfcAssemblyPlaceEnum::Out AssemblyPlace; + }; + + // C++ wrapper for IfcGasTerminalType + struct IfcGasTerminalType : IfcFlowTerminalType, ObjectHelper { IfcGasTerminalType() : Object("IfcGasTerminalType") {} + IfcGasTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcGeometricSet + struct IfcGeometricSet : IfcGeometricRepresentationItem, ObjectHelper { IfcGeometricSet() : Object("IfcGeometricSet") {} + ListOf< IfcGeometricSetSelect, 1, 0 >::Out Elements; + }; + + // C++ wrapper for IfcGeometricCurveSet + struct IfcGeometricCurveSet : IfcGeometricSet, ObjectHelper { IfcGeometricCurveSet() : Object("IfcGeometricCurveSet") {} + + }; + + // C++ wrapper for IfcRepresentationContext + struct IfcRepresentationContext : ObjectHelper { IfcRepresentationContext() : Object("IfcRepresentationContext") {} + Maybe< IfcLabel::Out > ContextIdentifier; + Maybe< IfcLabel::Out > ContextType; + }; + + // C++ wrapper for IfcGeometricRepresentationContext + struct IfcGeometricRepresentationContext : IfcRepresentationContext, ObjectHelper { IfcGeometricRepresentationContext() : Object("IfcGeometricRepresentationContext") {} + IfcDimensionCount::Out CoordinateSpaceDimension; + Maybe< REAL::Out > Precision; + IfcAxis2Placement::Out WorldCoordinateSystem; + Maybe< Lazy< IfcDirection > > TrueNorth; + }; + + // C++ wrapper for IfcGeometricRepresentationSubContext + struct IfcGeometricRepresentationSubContext : IfcGeometricRepresentationContext, ObjectHelper { IfcGeometricRepresentationSubContext() : Object("IfcGeometricRepresentationSubContext") {} + Lazy< IfcGeometricRepresentationContext > ParentContext; + Maybe< IfcPositiveRatioMeasure::Out > TargetScale; + IfcGeometricProjectionEnum::Out TargetView; + Maybe< IfcLabel::Out > UserDefinedTargetView; + }; + + // C++ wrapper for IfcGrid + struct IfcGrid : IfcProduct, ObjectHelper { IfcGrid() : Object("IfcGrid") {} + ListOf< Lazy< NotImplemented >, 1, 0 > UAxes; + ListOf< Lazy< NotImplemented >, 1, 0 > VAxes; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > WAxes; + }; + + // C++ wrapper for IfcObjectPlacement + struct IfcObjectPlacement : ObjectHelper { IfcObjectPlacement() : Object("IfcObjectPlacement") {} + + }; + + // C++ wrapper for IfcGridPlacement + struct IfcGridPlacement : IfcObjectPlacement, ObjectHelper { IfcGridPlacement() : Object("IfcGridPlacement") {} + Lazy< NotImplemented > PlacementLocation; + Maybe< Lazy< NotImplemented > > PlacementRefDirection; + }; + + // C++ wrapper for IfcHeatExchangerType + struct IfcHeatExchangerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcHeatExchangerType() : Object("IfcHeatExchangerType") {} + IfcHeatExchangerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcHumidifierType + struct IfcHumidifierType : IfcEnergyConversionDeviceType, ObjectHelper { IfcHumidifierType() : Object("IfcHumidifierType") {} + IfcHumidifierTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcInventory + struct IfcInventory : IfcGroup, ObjectHelper { IfcInventory() : Object("IfcInventory") {} + IfcInventoryTypeEnum::Out InventoryType; + IfcActorSelect::Out Jurisdiction; + ListOf< Lazy< NotImplemented >, 1, 0 > ResponsiblePersons; + Lazy< NotImplemented > LastUpdateDate; + Maybe< Lazy< NotImplemented > > CurrentValue; + Maybe< Lazy< NotImplemented > > OriginalValue; + }; + + // C++ wrapper for IfcJunctionBoxType + struct IfcJunctionBoxType : IfcFlowFittingType, ObjectHelper { IfcJunctionBoxType() : Object("IfcJunctionBoxType") {} + IfcJunctionBoxTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLShapeProfileDef + struct IfcLShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcLShapeProfileDef() : Object("IfcLShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + Maybe< IfcPositiveLengthMeasure::Out > Width; + IfcPositiveLengthMeasure::Out Thickness; + Maybe< IfcPositiveLengthMeasure::Out > FilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > EdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > LegSlope; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInX; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInY; + }; + + // C++ wrapper for IfcLaborResource + struct IfcLaborResource : IfcConstructionResource, ObjectHelper { IfcLaborResource() : Object("IfcLaborResource") {} + Maybe< IfcText::Out > SkillSet; + }; + + // C++ wrapper for IfcLampType + struct IfcLampType : IfcFlowTerminalType, ObjectHelper { IfcLampType() : Object("IfcLampType") {} + IfcLampTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLightFixtureType + struct IfcLightFixtureType : IfcFlowTerminalType, ObjectHelper { IfcLightFixtureType() : Object("IfcLightFixtureType") {} + IfcLightFixtureTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLightSource + struct IfcLightSource : IfcGeometricRepresentationItem, ObjectHelper { IfcLightSource() : Object("IfcLightSource") {} + Maybe< IfcLabel::Out > Name; + Lazy< IfcColourRgb > LightColour; + Maybe< IfcNormalisedRatioMeasure::Out > AmbientIntensity; + Maybe< IfcNormalisedRatioMeasure::Out > Intensity; + }; + + // C++ wrapper for IfcLightSourceAmbient + struct IfcLightSourceAmbient : IfcLightSource, ObjectHelper { IfcLightSourceAmbient() : Object("IfcLightSourceAmbient") {} + + }; + + // C++ wrapper for IfcLightSourceDirectional + struct IfcLightSourceDirectional : IfcLightSource, ObjectHelper { IfcLightSourceDirectional() : Object("IfcLightSourceDirectional") {} + Lazy< IfcDirection > Orientation; + }; + + // C++ wrapper for IfcLightSourceGoniometric + struct IfcLightSourceGoniometric : IfcLightSource, ObjectHelper { IfcLightSourceGoniometric() : Object("IfcLightSourceGoniometric") {} + Lazy< IfcAxis2Placement3D > Position; + Maybe< Lazy< IfcColourRgb > > ColourAppearance; + IfcThermodynamicTemperatureMeasure::Out ColourTemperature; + IfcLuminousFluxMeasure::Out LuminousFlux; + IfcLightEmissionSourceEnum::Out LightEmissionSource; + IfcLightDistributionDataSourceSelect::Out LightDistributionDataSource; + }; + + // C++ wrapper for IfcLightSourcePositional + struct IfcLightSourcePositional : IfcLightSource, ObjectHelper { IfcLightSourcePositional() : Object("IfcLightSourcePositional") {} + Lazy< IfcCartesianPoint > Position; + IfcPositiveLengthMeasure::Out Radius; + IfcReal::Out ConstantAttenuation; + IfcReal::Out DistanceAttenuation; + IfcReal::Out QuadricAttenuation; + }; + + // C++ wrapper for IfcLightSourceSpot + struct IfcLightSourceSpot : IfcLightSourcePositional, ObjectHelper { IfcLightSourceSpot() : Object("IfcLightSourceSpot") {} + Lazy< IfcDirection > Orientation; + Maybe< IfcReal::Out > ConcentrationExponent; + IfcPositivePlaneAngleMeasure::Out SpreadAngle; + IfcPositivePlaneAngleMeasure::Out BeamWidthAngle; + }; + + // C++ wrapper for IfcLine + struct IfcLine : IfcCurve, ObjectHelper { IfcLine() : Object("IfcLine") {} + Lazy< IfcCartesianPoint > Pnt; + Lazy< IfcVector > Dir; + }; + + // C++ wrapper for IfcLinearDimension + struct IfcLinearDimension : IfcDimensionCurveDirectedCallout, ObjectHelper { IfcLinearDimension() : Object("IfcLinearDimension") {} + + }; + + // C++ wrapper for IfcLocalPlacement + struct IfcLocalPlacement : IfcObjectPlacement, ObjectHelper { IfcLocalPlacement() : Object("IfcLocalPlacement") {} + Maybe< Lazy< IfcObjectPlacement > > PlacementRelTo; + IfcAxis2Placement::Out RelativePlacement; + }; + + // C++ wrapper for IfcMappedItem + struct IfcMappedItem : IfcRepresentationItem, ObjectHelper { IfcMappedItem() : Object("IfcMappedItem") {} + Lazy< IfcRepresentationMap > MappingSource; + Lazy< IfcCartesianTransformationOperator > MappingTarget; + }; + + // C++ wrapper for IfcProductRepresentation + struct IfcProductRepresentation : ObjectHelper { IfcProductRepresentation() : Object("IfcProductRepresentation") {} + Maybe< IfcLabel::Out > Name; + Maybe< IfcText::Out > Description; + ListOf< Lazy< IfcRepresentation >, 1, 0 > Representations; + }; + + // C++ wrapper for IfcMaterialDefinitionRepresentation + struct IfcMaterialDefinitionRepresentation : IfcProductRepresentation, ObjectHelper { IfcMaterialDefinitionRepresentation() : Object("IfcMaterialDefinitionRepresentation") {} + Lazy< NotImplemented > RepresentedMaterial; + }; + + // C++ wrapper for IfcMeasureWithUnit + struct IfcMeasureWithUnit : ObjectHelper { IfcMeasureWithUnit() : Object("IfcMeasureWithUnit") {} + IfcValue::Out ValueComponent; + IfcUnit::Out UnitComponent; + }; + + // C++ wrapper for IfcMechanicalFastener + struct IfcMechanicalFastener : IfcFastener, ObjectHelper { IfcMechanicalFastener() : Object("IfcMechanicalFastener") {} + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcPositiveLengthMeasure::Out > NominalLength; + }; + + // C++ wrapper for IfcMechanicalFastenerType + struct IfcMechanicalFastenerType : IfcFastenerType, ObjectHelper { IfcMechanicalFastenerType() : Object("IfcMechanicalFastenerType") {} + + }; + + // C++ wrapper for IfcMember + struct IfcMember : IfcBuildingElement, ObjectHelper { IfcMember() : Object("IfcMember") {} + + }; + + // C++ wrapper for IfcMemberType + struct IfcMemberType : IfcBuildingElementType, ObjectHelper { IfcMemberType() : Object("IfcMemberType") {} + IfcMemberTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcMotorConnectionType + struct IfcMotorConnectionType : IfcEnergyConversionDeviceType, ObjectHelper { IfcMotorConnectionType() : Object("IfcMotorConnectionType") {} + IfcMotorConnectionTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProcess + struct IfcProcess : IfcObject, ObjectHelper { IfcProcess() : Object("IfcProcess") {} + + }; + + // C++ wrapper for IfcTask + struct IfcTask : IfcProcess, ObjectHelper { IfcTask() : Object("IfcTask") {} + IfcIdentifier::Out TaskId; + Maybe< IfcLabel::Out > Status; + Maybe< IfcLabel::Out > WorkMethod; + BOOLEAN::Out IsMilestone; + Maybe< INTEGER::Out > Priority; + }; + + // C++ wrapper for IfcMove + struct IfcMove : IfcTask, ObjectHelper { IfcMove() : Object("IfcMove") {} + Lazy< IfcSpatialStructureElement > MoveFrom; + Lazy< IfcSpatialStructureElement > MoveTo; + Maybe< ListOf< IfcText, 1, 0 >::Out > PunchList; + }; + + // C++ wrapper for IfcOccupant + struct IfcOccupant : IfcActor, ObjectHelper { IfcOccupant() : Object("IfcOccupant") {} + IfcOccupantTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcOffsetCurve2D + struct IfcOffsetCurve2D : IfcCurve, ObjectHelper { IfcOffsetCurve2D() : Object("IfcOffsetCurve2D") {} + Lazy< IfcCurve > BasisCurve; + IfcLengthMeasure::Out Distance; + LOGICAL::Out SelfIntersect; + }; + + // C++ wrapper for IfcOffsetCurve3D + struct IfcOffsetCurve3D : IfcCurve, ObjectHelper { IfcOffsetCurve3D() : Object("IfcOffsetCurve3D") {} + Lazy< IfcCurve > BasisCurve; + IfcLengthMeasure::Out Distance; + LOGICAL::Out SelfIntersect; + Lazy< IfcDirection > RefDirection; + }; + + // C++ wrapper for IfcOneDirectionRepeatFactor + struct IfcOneDirectionRepeatFactor : IfcGeometricRepresentationItem, ObjectHelper { IfcOneDirectionRepeatFactor() : Object("IfcOneDirectionRepeatFactor") {} + Lazy< IfcVector > RepeatFactor; + }; + + // C++ wrapper for IfcOpenShell + struct IfcOpenShell : IfcConnectedFaceSet, ObjectHelper { IfcOpenShell() : Object("IfcOpenShell") {} + + }; + + // C++ wrapper for IfcOpeningElement + struct IfcOpeningElement : IfcFeatureElementSubtraction, ObjectHelper { IfcOpeningElement() : Object("IfcOpeningElement") {} + + }; + + // C++ wrapper for IfcOrderAction + struct IfcOrderAction : IfcTask, ObjectHelper { IfcOrderAction() : Object("IfcOrderAction") {} + IfcIdentifier::Out ActionID; + }; + + // C++ wrapper for IfcOrientedEdge + struct IfcOrientedEdge : IfcEdge, ObjectHelper { IfcOrientedEdge() : Object("IfcOrientedEdge") {} + Lazy< IfcEdge > EdgeElement; + BOOLEAN::Out Orientation; + }; + + // C++ wrapper for IfcOutletType + struct IfcOutletType : IfcFlowTerminalType, ObjectHelper { IfcOutletType() : Object("IfcOutletType") {} + IfcOutletTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPath + struct IfcPath : IfcTopologicalRepresentationItem, ObjectHelper { IfcPath() : Object("IfcPath") {} + ListOf< Lazy< IfcOrientedEdge >, 1, 0 > EdgeList; + }; + + // C++ wrapper for IfcPerformanceHistory + struct IfcPerformanceHistory : IfcControl, ObjectHelper { IfcPerformanceHistory() : Object("IfcPerformanceHistory") {} + IfcLabel::Out LifeCyclePhase; + }; + + // C++ wrapper for IfcPermit + struct IfcPermit : IfcControl, ObjectHelper { IfcPermit() : Object("IfcPermit") {} + IfcIdentifier::Out PermitID; + }; + + // C++ wrapper for IfcPile + struct IfcPile : IfcBuildingElement, ObjectHelper { IfcPile() : Object("IfcPile") {} + IfcPileTypeEnum::Out PredefinedType; + Maybe< IfcPileConstructionEnum::Out > ConstructionType; + }; + + // C++ wrapper for IfcPipeFittingType + struct IfcPipeFittingType : IfcFlowFittingType, ObjectHelper { IfcPipeFittingType() : Object("IfcPipeFittingType") {} + IfcPipeFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPipeSegmentType + struct IfcPipeSegmentType : IfcFlowSegmentType, ObjectHelper { IfcPipeSegmentType() : Object("IfcPipeSegmentType") {} + IfcPipeSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPlanarExtent + struct IfcPlanarExtent : IfcGeometricRepresentationItem, ObjectHelper { IfcPlanarExtent() : Object("IfcPlanarExtent") {} + IfcLengthMeasure::Out SizeInX; + IfcLengthMeasure::Out SizeInY; + }; + + // C++ wrapper for IfcPlanarBox + struct IfcPlanarBox : IfcPlanarExtent, ObjectHelper { IfcPlanarBox() : Object("IfcPlanarBox") {} + IfcAxis2Placement::Out Placement; + }; + + // C++ wrapper for IfcPlane + struct IfcPlane : IfcElementarySurface, ObjectHelper { IfcPlane() : Object("IfcPlane") {} + + }; + + // C++ wrapper for IfcPlate + struct IfcPlate : IfcBuildingElement, ObjectHelper { IfcPlate() : Object("IfcPlate") {} + + }; + + // C++ wrapper for IfcPlateType + struct IfcPlateType : IfcBuildingElementType, ObjectHelper { IfcPlateType() : Object("IfcPlateType") {} + IfcPlateTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPointOnCurve + struct IfcPointOnCurve : IfcPoint, ObjectHelper { IfcPointOnCurve() : Object("IfcPointOnCurve") {} + Lazy< IfcCurve > BasisCurve; + IfcParameterValue::Out PointParameter; + }; + + // C++ wrapper for IfcPointOnSurface + struct IfcPointOnSurface : IfcPoint, ObjectHelper { IfcPointOnSurface() : Object("IfcPointOnSurface") {} + Lazy< IfcSurface > BasisSurface; + IfcParameterValue::Out PointParameterU; + IfcParameterValue::Out PointParameterV; + }; + + // C++ wrapper for IfcPolyLoop + struct IfcPolyLoop : IfcLoop, ObjectHelper { IfcPolyLoop() : Object("IfcPolyLoop") {} + ListOf< Lazy< IfcCartesianPoint >, 3, 0 > Polygon; + }; + + // C++ wrapper for IfcPolygonalBoundedHalfSpace + struct IfcPolygonalBoundedHalfSpace : IfcHalfSpaceSolid, ObjectHelper { IfcPolygonalBoundedHalfSpace() : Object("IfcPolygonalBoundedHalfSpace") {} + Lazy< IfcAxis2Placement3D > Position; + Lazy< IfcBoundedCurve > PolygonalBoundary; + }; + + // C++ wrapper for IfcPolyline + struct IfcPolyline : IfcBoundedCurve, ObjectHelper { IfcPolyline() : Object("IfcPolyline") {} + ListOf< Lazy< IfcCartesianPoint >, 2, 0 > Points; + }; + + // C++ wrapper for IfcPresentationStyleAssignment + struct IfcPresentationStyleAssignment : ObjectHelper { IfcPresentationStyleAssignment() : Object("IfcPresentationStyleAssignment") {} + ListOf< IfcPresentationStyleSelect, 1, 0 >::Out Styles; + }; + + // C++ wrapper for IfcProcedure + struct IfcProcedure : IfcProcess, ObjectHelper { IfcProcedure() : Object("IfcProcedure") {} + IfcIdentifier::Out ProcedureID; + IfcProcedureTypeEnum::Out ProcedureType; + Maybe< IfcLabel::Out > UserDefinedProcedureType; + }; + + // C++ wrapper for IfcProductDefinitionShape + struct IfcProductDefinitionShape : IfcProductRepresentation, ObjectHelper { IfcProductDefinitionShape() : Object("IfcProductDefinitionShape") {} + + }; + + // C++ wrapper for IfcProject + struct IfcProject : IfcObject, ObjectHelper { IfcProject() : Object("IfcProject") {} + Maybe< IfcLabel::Out > LongName; + Maybe< IfcLabel::Out > Phase; + ListOf< Lazy< IfcRepresentationContext >, 1, 0 > RepresentationContexts; + Lazy< IfcUnitAssignment > UnitsInContext; + }; + + // C++ wrapper for IfcProjectOrder + struct IfcProjectOrder : IfcControl, ObjectHelper { IfcProjectOrder() : Object("IfcProjectOrder") {} + IfcIdentifier::Out ID; + IfcProjectOrderTypeEnum::Out PredefinedType; + Maybe< IfcLabel::Out > Status; + }; + + // C++ wrapper for IfcProjectOrderRecord + struct IfcProjectOrderRecord : IfcControl, ObjectHelper { IfcProjectOrderRecord() : Object("IfcProjectOrderRecord") {} + ListOf< Lazy< NotImplemented >, 1, 0 > Records; + IfcProjectOrderRecordTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProjectionCurve + struct IfcProjectionCurve : IfcAnnotationCurveOccurrence, ObjectHelper { IfcProjectionCurve() : Object("IfcProjectionCurve") {} + + }; + + // C++ wrapper for IfcProjectionElement + struct IfcProjectionElement : IfcFeatureElementAddition, ObjectHelper { IfcProjectionElement() : Object("IfcProjectionElement") {} + + }; + + // C++ wrapper for IfcSimpleProperty + struct IfcSimpleProperty : IfcProperty, ObjectHelper { IfcSimpleProperty() : Object("IfcSimpleProperty") {} + + }; + + // C++ wrapper for IfcPropertyBoundedValue + struct IfcPropertyBoundedValue : IfcSimpleProperty, ObjectHelper { IfcPropertyBoundedValue() : Object("IfcPropertyBoundedValue") {} + Maybe< IfcValue::Out > UpperBoundValue; + Maybe< IfcValue::Out > LowerBoundValue; + Maybe< IfcUnit::Out > Unit; + }; + + // C++ wrapper for IfcPropertyEnumeratedValue + struct IfcPropertyEnumeratedValue : IfcSimpleProperty, ObjectHelper { IfcPropertyEnumeratedValue() : Object("IfcPropertyEnumeratedValue") {} + ListOf< IfcValue, 1, 0 >::Out EnumerationValues; + Maybe< Lazy< NotImplemented > > EnumerationReference; + }; + + // C++ wrapper for IfcPropertyListValue + struct IfcPropertyListValue : IfcSimpleProperty, ObjectHelper { IfcPropertyListValue() : Object("IfcPropertyListValue") {} + ListOf< IfcValue, 1, 0 >::Out ListValues; + Maybe< IfcUnit::Out > Unit; + }; + + // C++ wrapper for IfcPropertyReferenceValue + struct IfcPropertyReferenceValue : IfcSimpleProperty, ObjectHelper { IfcPropertyReferenceValue() : Object("IfcPropertyReferenceValue") {} + Maybe< IfcLabel::Out > UsageName; + IfcObjectReferenceSelect::Out PropertyReference; + }; + + // C++ wrapper for IfcPropertySet + struct IfcPropertySet : IfcPropertySetDefinition, ObjectHelper { IfcPropertySet() : Object("IfcPropertySet") {} + ListOf< Lazy< IfcProperty >, 1, 0 > HasProperties; + }; + + // C++ wrapper for IfcPropertySingleValue + struct IfcPropertySingleValue : IfcSimpleProperty, ObjectHelper { IfcPropertySingleValue() : Object("IfcPropertySingleValue") {} + Maybe< IfcValue::Out > NominalValue; + Maybe< IfcUnit::Out > Unit; + }; + + // C++ wrapper for IfcPropertyTableValue + struct IfcPropertyTableValue : IfcSimpleProperty, ObjectHelper { IfcPropertyTableValue() : Object("IfcPropertyTableValue") {} + ListOf< IfcValue, 1, 0 >::Out DefiningValues; + ListOf< IfcValue, 1, 0 >::Out DefinedValues; + Maybe< IfcText::Out > Expression; + Maybe< IfcUnit::Out > DefiningUnit; + Maybe< IfcUnit::Out > DefinedUnit; + }; + + // C++ wrapper for IfcProtectiveDeviceType + struct IfcProtectiveDeviceType : IfcFlowControllerType, ObjectHelper { IfcProtectiveDeviceType() : Object("IfcProtectiveDeviceType") {} + IfcProtectiveDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProxy + struct IfcProxy : IfcProduct, ObjectHelper { IfcProxy() : Object("IfcProxy") {} + IfcObjectTypeEnum::Out ProxyType; + Maybe< IfcLabel::Out > Tag; + }; + + // C++ wrapper for IfcPumpType + struct IfcPumpType : IfcFlowMovingDeviceType, ObjectHelper { IfcPumpType() : Object("IfcPumpType") {} + IfcPumpTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRadiusDimension + struct IfcRadiusDimension : IfcDimensionCurveDirectedCallout, ObjectHelper { IfcRadiusDimension() : Object("IfcRadiusDimension") {} + + }; + + // C++ wrapper for IfcRailing + struct IfcRailing : IfcBuildingElement, ObjectHelper { IfcRailing() : Object("IfcRailing") {} + Maybe< IfcRailingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcRailingType + struct IfcRailingType : IfcBuildingElementType, ObjectHelper { IfcRailingType() : Object("IfcRailingType") {} + IfcRailingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRamp + struct IfcRamp : IfcBuildingElement, ObjectHelper { IfcRamp() : Object("IfcRamp") {} + IfcRampTypeEnum::Out ShapeType; + }; + + // C++ wrapper for IfcRampFlight + struct IfcRampFlight : IfcBuildingElement, ObjectHelper { IfcRampFlight() : Object("IfcRampFlight") {} + + }; + + // C++ wrapper for IfcRampFlightType + struct IfcRampFlightType : IfcBuildingElementType, ObjectHelper { IfcRampFlightType() : Object("IfcRampFlightType") {} + IfcRampFlightTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRationalBezierCurve + struct IfcRationalBezierCurve : IfcBezierCurve, ObjectHelper { IfcRationalBezierCurve() : Object("IfcRationalBezierCurve") {} + ListOf< REAL, 2, 0 >::Out WeightsData; + }; + + // C++ wrapper for IfcRectangleProfileDef + struct IfcRectangleProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcRectangleProfileDef() : Object("IfcRectangleProfileDef") {} + IfcPositiveLengthMeasure::Out XDim; + IfcPositiveLengthMeasure::Out YDim; + }; + + // C++ wrapper for IfcRectangleHollowProfileDef + struct IfcRectangleHollowProfileDef : IfcRectangleProfileDef, ObjectHelper { IfcRectangleHollowProfileDef() : Object("IfcRectangleHollowProfileDef") {} + IfcPositiveLengthMeasure::Out WallThickness; + Maybe< IfcPositiveLengthMeasure::Out > InnerFilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > OuterFilletRadius; + }; + + // C++ wrapper for IfcRectangularPyramid + struct IfcRectangularPyramid : IfcCsgPrimitive3D, ObjectHelper { IfcRectangularPyramid() : Object("IfcRectangularPyramid") {} + IfcPositiveLengthMeasure::Out XLength; + IfcPositiveLengthMeasure::Out YLength; + IfcPositiveLengthMeasure::Out Height; + }; + + // C++ wrapper for IfcRectangularTrimmedSurface + struct IfcRectangularTrimmedSurface : IfcBoundedSurface, ObjectHelper { IfcRectangularTrimmedSurface() : Object("IfcRectangularTrimmedSurface") {} + Lazy< IfcSurface > BasisSurface; + IfcParameterValue::Out U1; + IfcParameterValue::Out V1; + IfcParameterValue::Out U2; + IfcParameterValue::Out V2; + BOOLEAN::Out Usense; + BOOLEAN::Out Vsense; + }; + + // C++ wrapper for IfcReinforcingElement + struct IfcReinforcingElement : IfcBuildingElementComponent, ObjectHelper { IfcReinforcingElement() : Object("IfcReinforcingElement") {} + Maybe< IfcLabel::Out > SteelGrade; + }; + + // C++ wrapper for IfcReinforcingBar + struct IfcReinforcingBar : IfcReinforcingElement, ObjectHelper { IfcReinforcingBar() : Object("IfcReinforcingBar") {} + IfcPositiveLengthMeasure::Out NominalDiameter; + IfcAreaMeasure::Out CrossSectionArea; + Maybe< IfcPositiveLengthMeasure::Out > BarLength; + IfcReinforcingBarRoleEnum::Out BarRole; + Maybe< IfcReinforcingBarSurfaceEnum::Out > BarSurface; + }; + + // C++ wrapper for IfcReinforcingMesh + struct IfcReinforcingMesh : IfcReinforcingElement, ObjectHelper { IfcReinforcingMesh() : Object("IfcReinforcingMesh") {} + Maybe< IfcPositiveLengthMeasure::Out > MeshLength; + Maybe< IfcPositiveLengthMeasure::Out > MeshWidth; + IfcPositiveLengthMeasure::Out LongitudinalBarNominalDiameter; + IfcPositiveLengthMeasure::Out TransverseBarNominalDiameter; + IfcAreaMeasure::Out LongitudinalBarCrossSectionArea; + IfcAreaMeasure::Out TransverseBarCrossSectionArea; + IfcPositiveLengthMeasure::Out LongitudinalBarSpacing; + IfcPositiveLengthMeasure::Out TransverseBarSpacing; + }; + + // C++ wrapper for IfcRelationship + struct IfcRelationship : IfcRoot, ObjectHelper { IfcRelationship() : Object("IfcRelationship") {} + + }; + + // C++ wrapper for IfcRelDecomposes + struct IfcRelDecomposes : IfcRelationship, ObjectHelper { IfcRelDecomposes() : Object("IfcRelDecomposes") {} + Lazy< IfcObjectDefinition > RelatingObject; + ListOf< Lazy< IfcObjectDefinition >, 1, 0 > RelatedObjects; + }; + + // C++ wrapper for IfcRelAggregates + struct IfcRelAggregates : IfcRelDecomposes, ObjectHelper { IfcRelAggregates() : Object("IfcRelAggregates") {} + + }; + + // C++ wrapper for IfcRelConnects + struct IfcRelConnects : IfcRelationship, ObjectHelper { IfcRelConnects() : Object("IfcRelConnects") {} + + }; + + // C++ wrapper for IfcRelContainedInSpatialStructure + struct IfcRelContainedInSpatialStructure : IfcRelConnects, ObjectHelper { IfcRelContainedInSpatialStructure() : Object("IfcRelContainedInSpatialStructure") {} + ListOf< Lazy< IfcProduct >, 1, 0 > RelatedElements; + Lazy< IfcSpatialStructureElement > RelatingStructure; + }; + + // C++ wrapper for IfcRelDefines + struct IfcRelDefines : IfcRelationship, ObjectHelper { IfcRelDefines() : Object("IfcRelDefines") {} + ListOf< Lazy< IfcObject >, 1, 0 > RelatedObjects; + }; + + // C++ wrapper for IfcRelDefinesByProperties + struct IfcRelDefinesByProperties : IfcRelDefines, ObjectHelper { IfcRelDefinesByProperties() : Object("IfcRelDefinesByProperties") {} + Lazy< IfcPropertySetDefinition > RelatingPropertyDefinition; + }; + + // C++ wrapper for IfcRelFillsElement + struct IfcRelFillsElement : IfcRelConnects, ObjectHelper { IfcRelFillsElement() : Object("IfcRelFillsElement") {} + Lazy< IfcOpeningElement > RelatingOpeningElement; + Lazy< IfcElement > RelatedBuildingElement; + }; + + // C++ wrapper for IfcRelOverridesProperties + struct IfcRelOverridesProperties : IfcRelDefinesByProperties, ObjectHelper { IfcRelOverridesProperties() : Object("IfcRelOverridesProperties") {} + ListOf< Lazy< IfcProperty >, 1, 0 > OverridingProperties; + }; + + // C++ wrapper for IfcRelVoidsElement + struct IfcRelVoidsElement : IfcRelConnects, ObjectHelper { IfcRelVoidsElement() : Object("IfcRelVoidsElement") {} + Lazy< IfcElement > RelatingBuildingElement; + Lazy< IfcFeatureElementSubtraction > RelatedOpeningElement; + }; + + // C++ wrapper for IfcRepresentation + struct IfcRepresentation : ObjectHelper { IfcRepresentation() : Object("IfcRepresentation") {} + Lazy< IfcRepresentationContext > ContextOfItems; + Maybe< IfcLabel::Out > RepresentationIdentifier; + Maybe< IfcLabel::Out > RepresentationType; + ListOf< Lazy< IfcRepresentationItem >, 1, 0 > Items; + }; + + // C++ wrapper for IfcRepresentationMap + struct IfcRepresentationMap : ObjectHelper { IfcRepresentationMap() : Object("IfcRepresentationMap") {} + IfcAxis2Placement::Out MappingOrigin; + Lazy< IfcRepresentation > MappedRepresentation; + }; + + // C++ wrapper for IfcRevolvedAreaSolid + struct IfcRevolvedAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcRevolvedAreaSolid() : Object("IfcRevolvedAreaSolid") {} + Lazy< IfcAxis1Placement > Axis; + IfcPlaneAngleMeasure::Out Angle; + }; + + // C++ wrapper for IfcRightCircularCone + struct IfcRightCircularCone : IfcCsgPrimitive3D, ObjectHelper { IfcRightCircularCone() : Object("IfcRightCircularCone") {} + IfcPositiveLengthMeasure::Out Height; + IfcPositiveLengthMeasure::Out BottomRadius; + }; + + // C++ wrapper for IfcRightCircularCylinder + struct IfcRightCircularCylinder : IfcCsgPrimitive3D, ObjectHelper { IfcRightCircularCylinder() : Object("IfcRightCircularCylinder") {} + IfcPositiveLengthMeasure::Out Height; + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcRoof + struct IfcRoof : IfcBuildingElement, ObjectHelper { IfcRoof() : Object("IfcRoof") {} + IfcRoofTypeEnum::Out ShapeType; + }; + + // C++ wrapper for IfcRoundedEdgeFeature + struct IfcRoundedEdgeFeature : IfcEdgeFeature, ObjectHelper { IfcRoundedEdgeFeature() : Object("IfcRoundedEdgeFeature") {} + Maybe< IfcPositiveLengthMeasure::Out > Radius; + }; + + // C++ wrapper for IfcRoundedRectangleProfileDef + struct IfcRoundedRectangleProfileDef : IfcRectangleProfileDef, ObjectHelper { IfcRoundedRectangleProfileDef() : Object("IfcRoundedRectangleProfileDef") {} + IfcPositiveLengthMeasure::Out RoundingRadius; + }; + + // C++ wrapper for IfcSIUnit + struct IfcSIUnit : IfcNamedUnit, ObjectHelper { IfcSIUnit() : Object("IfcSIUnit") {} + Maybe< IfcSIPrefix::Out > Prefix; + IfcSIUnitName::Out Name; + }; + + // C++ wrapper for IfcSanitaryTerminalType + struct IfcSanitaryTerminalType : IfcFlowTerminalType, ObjectHelper { IfcSanitaryTerminalType() : Object("IfcSanitaryTerminalType") {} + IfcSanitaryTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcScheduleTimeControl + struct IfcScheduleTimeControl : IfcControl, ObjectHelper { IfcScheduleTimeControl() : Object("IfcScheduleTimeControl") {} + Maybe< IfcDateTimeSelect::Out > ActualStart; + Maybe< IfcDateTimeSelect::Out > EarlyStart; + Maybe< IfcDateTimeSelect::Out > LateStart; + Maybe< IfcDateTimeSelect::Out > ScheduleStart; + Maybe< IfcDateTimeSelect::Out > ActualFinish; + Maybe< IfcDateTimeSelect::Out > EarlyFinish; + Maybe< IfcDateTimeSelect::Out > LateFinish; + Maybe< IfcDateTimeSelect::Out > ScheduleFinish; + Maybe< IfcTimeMeasure::Out > ScheduleDuration; + Maybe< IfcTimeMeasure::Out > ActualDuration; + Maybe< IfcTimeMeasure::Out > RemainingTime; + Maybe< IfcTimeMeasure::Out > FreeFloat; + Maybe< IfcTimeMeasure::Out > TotalFloat; + Maybe< BOOLEAN::Out > IsCritical; + Maybe< IfcDateTimeSelect::Out > StatusTime; + Maybe< IfcTimeMeasure::Out > StartFloat; + Maybe< IfcTimeMeasure::Out > FinishFloat; + Maybe< IfcPositiveRatioMeasure::Out > Completion; + }; + + // C++ wrapper for IfcSectionedSpine + struct IfcSectionedSpine : IfcGeometricRepresentationItem, ObjectHelper { IfcSectionedSpine() : Object("IfcSectionedSpine") {} + Lazy< IfcCompositeCurve > SpineCurve; + ListOf< Lazy< IfcProfileDef >, 2, 0 > CrossSections; + ListOf< Lazy< IfcAxis2Placement3D >, 2, 0 > CrossSectionPositions; + }; + + // C++ wrapper for IfcSensorType + struct IfcSensorType : IfcDistributionControlElementType, ObjectHelper { IfcSensorType() : Object("IfcSensorType") {} + IfcSensorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcServiceLife + struct IfcServiceLife : IfcControl, ObjectHelper { IfcServiceLife() : Object("IfcServiceLife") {} + IfcServiceLifeTypeEnum::Out ServiceLifeType; + IfcTimeMeasure::Out ServiceLifeDuration; + }; + + // C++ wrapper for IfcShapeModel + struct IfcShapeModel : IfcRepresentation, ObjectHelper { IfcShapeModel() : Object("IfcShapeModel") {} + + }; + + // C++ wrapper for IfcShapeRepresentation + struct IfcShapeRepresentation : IfcShapeModel, ObjectHelper { IfcShapeRepresentation() : Object("IfcShapeRepresentation") {} + + }; + + // C++ wrapper for IfcShellBasedSurfaceModel + struct IfcShellBasedSurfaceModel : IfcGeometricRepresentationItem, ObjectHelper { IfcShellBasedSurfaceModel() : Object("IfcShellBasedSurfaceModel") {} + ListOf< IfcShell, 1, 0 >::Out SbsmBoundary; + }; + + // C++ wrapper for IfcSite + struct IfcSite : IfcSpatialStructureElement, ObjectHelper { IfcSite() : Object("IfcSite") {} + Maybe< IfcCompoundPlaneAngleMeasure::Out > RefLatitude; + Maybe< IfcCompoundPlaneAngleMeasure::Out > RefLongitude; + Maybe< IfcLengthMeasure::Out > RefElevation; + Maybe< IfcLabel::Out > LandTitleNumber; + Maybe< Lazy< NotImplemented > > SiteAddress; + }; + + // C++ wrapper for IfcSlab + struct IfcSlab : IfcBuildingElement, ObjectHelper { IfcSlab() : Object("IfcSlab") {} + Maybe< IfcSlabTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSlabType + struct IfcSlabType : IfcBuildingElementType, ObjectHelper { IfcSlabType() : Object("IfcSlabType") {} + IfcSlabTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSpace + struct IfcSpace : IfcSpatialStructureElement, ObjectHelper { IfcSpace() : Object("IfcSpace") {} + IfcInternalOrExternalEnum::Out InteriorOrExteriorSpace; + Maybe< IfcLengthMeasure::Out > ElevationWithFlooring; + }; + + // C++ wrapper for IfcSpaceHeaterType + struct IfcSpaceHeaterType : IfcEnergyConversionDeviceType, ObjectHelper { IfcSpaceHeaterType() : Object("IfcSpaceHeaterType") {} + IfcSpaceHeaterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSpaceProgram + struct IfcSpaceProgram : IfcControl, ObjectHelper { IfcSpaceProgram() : Object("IfcSpaceProgram") {} + IfcIdentifier::Out SpaceProgramIdentifier; + Maybe< IfcAreaMeasure::Out > MaxRequiredArea; + Maybe< IfcAreaMeasure::Out > MinRequiredArea; + Maybe< Lazy< IfcSpatialStructureElement > > RequestedLocation; + IfcAreaMeasure::Out StandardRequiredArea; + }; + + // C++ wrapper for IfcSpatialStructureElementType + struct IfcSpatialStructureElementType : IfcElementType, ObjectHelper { IfcSpatialStructureElementType() : Object("IfcSpatialStructureElementType") {} + + }; + + // C++ wrapper for IfcSpaceType + struct IfcSpaceType : IfcSpatialStructureElementType, ObjectHelper { IfcSpaceType() : Object("IfcSpaceType") {} + IfcSpaceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSphere + struct IfcSphere : IfcCsgPrimitive3D, ObjectHelper { IfcSphere() : Object("IfcSphere") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcStackTerminalType + struct IfcStackTerminalType : IfcFlowTerminalType, ObjectHelper { IfcStackTerminalType() : Object("IfcStackTerminalType") {} + IfcStackTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStair + struct IfcStair : IfcBuildingElement, ObjectHelper { IfcStair() : Object("IfcStair") {} + IfcStairTypeEnum::Out ShapeType; + }; + + // C++ wrapper for IfcStairFlight + struct IfcStairFlight : IfcBuildingElement, ObjectHelper { IfcStairFlight() : Object("IfcStairFlight") {} + Maybe< INTEGER::Out > NumberOfRiser; + Maybe< INTEGER::Out > NumberOfTreads; + Maybe< IfcPositiveLengthMeasure::Out > RiserHeight; + Maybe< IfcPositiveLengthMeasure::Out > TreadLength; + }; + + // C++ wrapper for IfcStairFlightType + struct IfcStairFlightType : IfcBuildingElementType, ObjectHelper { IfcStairFlightType() : Object("IfcStairFlightType") {} + IfcStairFlightTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStructuralActivity + struct IfcStructuralActivity : IfcProduct, ObjectHelper { IfcStructuralActivity() : Object("IfcStructuralActivity") {} + Lazy< NotImplemented > AppliedLoad; + IfcGlobalOrLocalEnum::Out GlobalOrLocal; + }; + + // C++ wrapper for IfcStructuralAction + struct IfcStructuralAction : IfcStructuralActivity, ObjectHelper { IfcStructuralAction() : Object("IfcStructuralAction") {} + BOOLEAN::Out DestabilizingLoad; + Maybe< Lazy< IfcStructuralReaction > > CausedBy; + }; + + // C++ wrapper for IfcStructuralAnalysisModel + struct IfcStructuralAnalysisModel : IfcSystem, ObjectHelper { IfcStructuralAnalysisModel() : Object("IfcStructuralAnalysisModel") {} + IfcAnalysisModelTypeEnum::Out PredefinedType; + Maybe< Lazy< IfcAxis2Placement3D > > OrientationOf2DPlane; + Maybe< ListOf< Lazy< IfcStructuralLoadGroup >, 1, 0 > > LoadedBy; + Maybe< ListOf< Lazy< IfcStructuralResultGroup >, 1, 0 > > HasResults; + }; + + // C++ wrapper for IfcStructuralItem + struct IfcStructuralItem : IfcProduct, ObjectHelper { IfcStructuralItem() : Object("IfcStructuralItem") {} + + }; + + // C++ wrapper for IfcStructuralConnection + struct IfcStructuralConnection : IfcStructuralItem, ObjectHelper { IfcStructuralConnection() : Object("IfcStructuralConnection") {} + Maybe< Lazy< NotImplemented > > AppliedCondition; + }; + + // C++ wrapper for IfcStructuralCurveConnection + struct IfcStructuralCurveConnection : IfcStructuralConnection, ObjectHelper { IfcStructuralCurveConnection() : Object("IfcStructuralCurveConnection") {} + + }; + + // C++ wrapper for IfcStructuralMember + struct IfcStructuralMember : IfcStructuralItem, ObjectHelper { IfcStructuralMember() : Object("IfcStructuralMember") {} + + }; + + // C++ wrapper for IfcStructuralCurveMember + struct IfcStructuralCurveMember : IfcStructuralMember, ObjectHelper { IfcStructuralCurveMember() : Object("IfcStructuralCurveMember") {} + IfcStructuralCurveTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStructuralCurveMemberVarying + struct IfcStructuralCurveMemberVarying : IfcStructuralCurveMember, ObjectHelper { IfcStructuralCurveMemberVarying() : Object("IfcStructuralCurveMemberVarying") {} + + }; + + // C++ wrapper for IfcStructuralLinearAction + struct IfcStructuralLinearAction : IfcStructuralAction, ObjectHelper { IfcStructuralLinearAction() : Object("IfcStructuralLinearAction") {} + IfcProjectedOrTrueLengthEnum::Out ProjectedOrTrue; + }; + + // C++ wrapper for IfcStructuralLinearActionVarying + struct IfcStructuralLinearActionVarying : IfcStructuralLinearAction, ObjectHelper { IfcStructuralLinearActionVarying() : Object("IfcStructuralLinearActionVarying") {} + Lazy< NotImplemented > VaryingAppliedLoadLocation; + ListOf< Lazy< NotImplemented >, 1, 0 > SubsequentAppliedLoads; + }; + + // C++ wrapper for IfcStructuralLoadGroup + struct IfcStructuralLoadGroup : IfcGroup, ObjectHelper { IfcStructuralLoadGroup() : Object("IfcStructuralLoadGroup") {} + IfcLoadGroupTypeEnum::Out PredefinedType; + IfcActionTypeEnum::Out ActionType; + IfcActionSourceTypeEnum::Out ActionSource; + Maybe< IfcPositiveRatioMeasure::Out > Coefficient; + Maybe< IfcLabel::Out > Purpose; + }; + + // C++ wrapper for IfcStructuralPlanarAction + struct IfcStructuralPlanarAction : IfcStructuralAction, ObjectHelper { IfcStructuralPlanarAction() : Object("IfcStructuralPlanarAction") {} + IfcProjectedOrTrueLengthEnum::Out ProjectedOrTrue; + }; + + // C++ wrapper for IfcStructuralPlanarActionVarying + struct IfcStructuralPlanarActionVarying : IfcStructuralPlanarAction, ObjectHelper { IfcStructuralPlanarActionVarying() : Object("IfcStructuralPlanarActionVarying") {} + Lazy< NotImplemented > VaryingAppliedLoadLocation; + ListOf< Lazy< NotImplemented >, 2, 0 > SubsequentAppliedLoads; + }; + + // C++ wrapper for IfcStructuralPointAction + struct IfcStructuralPointAction : IfcStructuralAction, ObjectHelper { IfcStructuralPointAction() : Object("IfcStructuralPointAction") {} + + }; + + // C++ wrapper for IfcStructuralPointConnection + struct IfcStructuralPointConnection : IfcStructuralConnection, ObjectHelper { IfcStructuralPointConnection() : Object("IfcStructuralPointConnection") {} + + }; + + // C++ wrapper for IfcStructuralReaction + struct IfcStructuralReaction : IfcStructuralActivity, ObjectHelper { IfcStructuralReaction() : Object("IfcStructuralReaction") {} + + }; + + // C++ wrapper for IfcStructuralPointReaction + struct IfcStructuralPointReaction : IfcStructuralReaction, ObjectHelper { IfcStructuralPointReaction() : Object("IfcStructuralPointReaction") {} + + }; + + // C++ wrapper for IfcStructuralResultGroup + struct IfcStructuralResultGroup : IfcGroup, ObjectHelper { IfcStructuralResultGroup() : Object("IfcStructuralResultGroup") {} + IfcAnalysisTheoryTypeEnum::Out TheoryType; + Maybe< Lazy< IfcStructuralLoadGroup > > ResultForLoadGroup; + BOOLEAN::Out IsLinear; + }; + + // C++ wrapper for IfcStructuralSurfaceConnection + struct IfcStructuralSurfaceConnection : IfcStructuralConnection, ObjectHelper { IfcStructuralSurfaceConnection() : Object("IfcStructuralSurfaceConnection") {} + + }; + + // C++ wrapper for IfcStructuralSurfaceMember + struct IfcStructuralSurfaceMember : IfcStructuralMember, ObjectHelper { IfcStructuralSurfaceMember() : Object("IfcStructuralSurfaceMember") {} + IfcStructuralSurfaceTypeEnum::Out PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > Thickness; + }; + + // C++ wrapper for IfcStructuralSurfaceMemberVarying + struct IfcStructuralSurfaceMemberVarying : IfcStructuralSurfaceMember, ObjectHelper { IfcStructuralSurfaceMemberVarying() : Object("IfcStructuralSurfaceMemberVarying") {} + ListOf< IfcPositiveLengthMeasure, 2, 0 >::Out SubsequentThickness; + Lazy< NotImplemented > VaryingThicknessLocation; + }; + + // C++ wrapper for IfcStructuredDimensionCallout + struct IfcStructuredDimensionCallout : IfcDraughtingCallout, ObjectHelper { IfcStructuredDimensionCallout() : Object("IfcStructuredDimensionCallout") {} + + }; + + // C++ wrapper for IfcStyleModel + struct IfcStyleModel : IfcRepresentation, ObjectHelper { IfcStyleModel() : Object("IfcStyleModel") {} + + }; + + // C++ wrapper for IfcStyledRepresentation + struct IfcStyledRepresentation : IfcStyleModel, ObjectHelper { IfcStyledRepresentation() : Object("IfcStyledRepresentation") {} + + }; + + // C++ wrapper for IfcSubContractResource + struct IfcSubContractResource : IfcConstructionResource, ObjectHelper { IfcSubContractResource() : Object("IfcSubContractResource") {} + Maybe< IfcActorSelect::Out > SubContractor; + Maybe< IfcText::Out > JobDescription; + }; + + // C++ wrapper for IfcSubedge + struct IfcSubedge : IfcEdge, ObjectHelper { IfcSubedge() : Object("IfcSubedge") {} + Lazy< IfcEdge > ParentEdge; + }; + + // C++ wrapper for IfcSurfaceCurveSweptAreaSolid + struct IfcSurfaceCurveSweptAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcSurfaceCurveSweptAreaSolid() : Object("IfcSurfaceCurveSweptAreaSolid") {} + Lazy< IfcCurve > Directrix; + IfcParameterValue::Out StartParam; + IfcParameterValue::Out EndParam; + Lazy< IfcSurface > ReferenceSurface; + }; + + // C++ wrapper for IfcSweptSurface + struct IfcSweptSurface : IfcSurface, ObjectHelper { IfcSweptSurface() : Object("IfcSweptSurface") {} + Lazy< IfcProfileDef > SweptCurve; + Lazy< IfcAxis2Placement3D > Position; + }; + + // C++ wrapper for IfcSurfaceOfLinearExtrusion + struct IfcSurfaceOfLinearExtrusion : IfcSweptSurface, ObjectHelper { IfcSurfaceOfLinearExtrusion() : Object("IfcSurfaceOfLinearExtrusion") {} + Lazy< IfcDirection > ExtrudedDirection; + IfcLengthMeasure::Out Depth; + }; + + // C++ wrapper for IfcSurfaceOfRevolution + struct IfcSurfaceOfRevolution : IfcSweptSurface, ObjectHelper { IfcSurfaceOfRevolution() : Object("IfcSurfaceOfRevolution") {} + Lazy< IfcAxis1Placement > AxisPosition; + }; + + // C++ wrapper for IfcSurfaceStyle + struct IfcSurfaceStyle : IfcPresentationStyle, ObjectHelper { IfcSurfaceStyle() : Object("IfcSurfaceStyle") {} + IfcSurfaceSide::Out Side; + ListOf< IfcSurfaceStyleElementSelect, 1, 5 >::Out Styles; + }; + + // C++ wrapper for IfcSurfaceStyleShading + struct IfcSurfaceStyleShading : ObjectHelper { IfcSurfaceStyleShading() : Object("IfcSurfaceStyleShading") {} + Lazy< IfcColourRgb > SurfaceColour; + }; + + // C++ wrapper for IfcSurfaceStyleRendering + struct IfcSurfaceStyleRendering : IfcSurfaceStyleShading, ObjectHelper { IfcSurfaceStyleRendering() : Object("IfcSurfaceStyleRendering") {} + Maybe< IfcNormalisedRatioMeasure::Out > Transparency; + Maybe< IfcColourOrFactor::Out > DiffuseColour; + Maybe< IfcColourOrFactor::Out > TransmissionColour; + Maybe< IfcColourOrFactor::Out > DiffuseTransmissionColour; + Maybe< IfcColourOrFactor::Out > ReflectionColour; + Maybe< IfcColourOrFactor::Out > SpecularColour; + Maybe< IfcSpecularHighlightSelect::Out > SpecularHighlight; + IfcReflectanceMethodEnum::Out ReflectanceMethod; + }; + + // C++ wrapper for IfcSurfaceStyleWithTextures + struct IfcSurfaceStyleWithTextures : ObjectHelper { IfcSurfaceStyleWithTextures() : Object("IfcSurfaceStyleWithTextures") {} + ListOf< Lazy< NotImplemented >, 1, 0 > Textures; + }; + + // C++ wrapper for IfcSweptDiskSolid + struct IfcSweptDiskSolid : IfcSolidModel, ObjectHelper { IfcSweptDiskSolid() : Object("IfcSweptDiskSolid") {} + Lazy< IfcCurve > Directrix; + IfcPositiveLengthMeasure::Out Radius; + Maybe< IfcPositiveLengthMeasure::Out > InnerRadius; + IfcParameterValue::Out StartParam; + IfcParameterValue::Out EndParam; + }; + + // C++ wrapper for IfcSwitchingDeviceType + struct IfcSwitchingDeviceType : IfcFlowControllerType, ObjectHelper { IfcSwitchingDeviceType() : Object("IfcSwitchingDeviceType") {} + IfcSwitchingDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSystemFurnitureElementType + struct IfcSystemFurnitureElementType : IfcFurnishingElementType, ObjectHelper { IfcSystemFurnitureElementType() : Object("IfcSystemFurnitureElementType") {} + + }; + + // C++ wrapper for IfcTShapeProfileDef + struct IfcTShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcTShapeProfileDef() : Object("IfcTShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out FlangeWidth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcPositiveLengthMeasure::Out > FilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > FlangeEdgeRadius; + Maybe< IfcPositiveLengthMeasure::Out > WebEdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > WebSlope; + Maybe< IfcPlaneAngleMeasure::Out > FlangeSlope; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInY; + }; + + // C++ wrapper for IfcTankType + struct IfcTankType : IfcFlowStorageDeviceType, ObjectHelper { IfcTankType() : Object("IfcTankType") {} + IfcTankTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTendon + struct IfcTendon : IfcReinforcingElement, ObjectHelper { IfcTendon() : Object("IfcTendon") {} + IfcTendonTypeEnum::Out PredefinedType; + IfcPositiveLengthMeasure::Out NominalDiameter; + IfcAreaMeasure::Out CrossSectionArea; + Maybe< IfcForceMeasure::Out > TensionForce; + Maybe< IfcPressureMeasure::Out > PreStress; + Maybe< IfcNormalisedRatioMeasure::Out > FrictionCoefficient; + Maybe< IfcPositiveLengthMeasure::Out > AnchorageSlip; + Maybe< IfcPositiveLengthMeasure::Out > MinCurvatureRadius; + }; + + // C++ wrapper for IfcTendonAnchor + struct IfcTendonAnchor : IfcReinforcingElement, ObjectHelper { IfcTendonAnchor() : Object("IfcTendonAnchor") {} + + }; + + // C++ wrapper for IfcTextLiteral + struct IfcTextLiteral : IfcGeometricRepresentationItem, ObjectHelper { IfcTextLiteral() : Object("IfcTextLiteral") {} + IfcPresentableText::Out Literal; + IfcAxis2Placement::Out Placement; + IfcTextPath::Out Path; + }; + + // C++ wrapper for IfcTextLiteralWithExtent + struct IfcTextLiteralWithExtent : IfcTextLiteral, ObjectHelper { IfcTextLiteralWithExtent() : Object("IfcTextLiteralWithExtent") {} + Lazy< IfcPlanarExtent > Extent; + IfcBoxAlignment::Out BoxAlignment; + }; + + // C++ wrapper for IfcTimeSeriesSchedule + struct IfcTimeSeriesSchedule : IfcControl, ObjectHelper { IfcTimeSeriesSchedule() : Object("IfcTimeSeriesSchedule") {} + Maybe< ListOf< IfcDateTimeSelect, 1, 0 >::Out > ApplicableDates; + IfcTimeSeriesScheduleTypeEnum::Out TimeSeriesScheduleType; + Lazy< NotImplemented > TimeSeries; + }; + + // C++ wrapper for IfcTopologyRepresentation + struct IfcTopologyRepresentation : IfcShapeModel, ObjectHelper { IfcTopologyRepresentation() : Object("IfcTopologyRepresentation") {} + + }; + + // C++ wrapper for IfcTransformerType + struct IfcTransformerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcTransformerType() : Object("IfcTransformerType") {} + IfcTransformerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTransportElement + struct IfcTransportElement : IfcElement, ObjectHelper { IfcTransportElement() : Object("IfcTransportElement") {} + Maybe< IfcTransportElementTypeEnum::Out > OperationType; + Maybe< IfcMassMeasure::Out > CapacityByWeight; + Maybe< IfcCountMeasure::Out > CapacityByNumber; + }; + + // C++ wrapper for IfcTransportElementType + struct IfcTransportElementType : IfcElementType, ObjectHelper { IfcTransportElementType() : Object("IfcTransportElementType") {} + IfcTransportElementTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTrapeziumProfileDef + struct IfcTrapeziumProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcTrapeziumProfileDef() : Object("IfcTrapeziumProfileDef") {} + IfcPositiveLengthMeasure::Out BottomXDim; + IfcPositiveLengthMeasure::Out TopXDim; + IfcPositiveLengthMeasure::Out YDim; + IfcLengthMeasure::Out TopXOffset; + }; + + // C++ wrapper for IfcTrimmedCurve + struct IfcTrimmedCurve : IfcBoundedCurve, ObjectHelper { IfcTrimmedCurve() : Object("IfcTrimmedCurve") {} + Lazy< IfcCurve > BasisCurve; + ListOf< IfcTrimmingSelect, 1, 2 >::Out Trim1; + ListOf< IfcTrimmingSelect, 1, 2 >::Out Trim2; + BOOLEAN::Out SenseAgreement; + IfcTrimmingPreference::Out MasterRepresentation; + }; + + // C++ wrapper for IfcTubeBundleType + struct IfcTubeBundleType : IfcEnergyConversionDeviceType, ObjectHelper { IfcTubeBundleType() : Object("IfcTubeBundleType") {} + IfcTubeBundleTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTwoDirectionRepeatFactor + struct IfcTwoDirectionRepeatFactor : IfcOneDirectionRepeatFactor, ObjectHelper { IfcTwoDirectionRepeatFactor() : Object("IfcTwoDirectionRepeatFactor") {} + Lazy< IfcVector > SecondRepeatFactor; + }; + + // C++ wrapper for IfcUShapeProfileDef + struct IfcUShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcUShapeProfileDef() : Object("IfcUShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out FlangeWidth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcPositiveLengthMeasure::Out > FilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > EdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > FlangeSlope; + Maybe< IfcPositiveLengthMeasure::Out > CentreOfGravityInX; + }; + + // C++ wrapper for IfcUnitAssignment + struct IfcUnitAssignment : ObjectHelper { IfcUnitAssignment() : Object("IfcUnitAssignment") {} + ListOf< IfcUnit, 1, 0 >::Out Units; + }; + + // C++ wrapper for IfcUnitaryEquipmentType + struct IfcUnitaryEquipmentType : IfcEnergyConversionDeviceType, ObjectHelper { IfcUnitaryEquipmentType() : Object("IfcUnitaryEquipmentType") {} + IfcUnitaryEquipmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcValveType + struct IfcValveType : IfcFlowControllerType, ObjectHelper { IfcValveType() : Object("IfcValveType") {} + IfcValveTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcVector + struct IfcVector : IfcGeometricRepresentationItem, ObjectHelper { IfcVector() : Object("IfcVector") {} + Lazy< IfcDirection > Orientation; + IfcLengthMeasure::Out Magnitude; + }; + + // C++ wrapper for IfcVertex + struct IfcVertex : IfcTopologicalRepresentationItem, ObjectHelper { IfcVertex() : Object("IfcVertex") {} + + }; + + // C++ wrapper for IfcVertexLoop + struct IfcVertexLoop : IfcLoop, ObjectHelper { IfcVertexLoop() : Object("IfcVertexLoop") {} + Lazy< IfcVertex > LoopVertex; + }; + + // C++ wrapper for IfcVertexPoint + struct IfcVertexPoint : IfcVertex, ObjectHelper { IfcVertexPoint() : Object("IfcVertexPoint") {} + Lazy< IfcPoint > VertexGeometry; + }; + + // C++ wrapper for IfcVibrationIsolatorType + struct IfcVibrationIsolatorType : IfcDiscreteAccessoryType, ObjectHelper { IfcVibrationIsolatorType() : Object("IfcVibrationIsolatorType") {} + IfcVibrationIsolatorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcVirtualElement + struct IfcVirtualElement : IfcElement, ObjectHelper { IfcVirtualElement() : Object("IfcVirtualElement") {} + + }; + + // C++ wrapper for IfcWall + struct IfcWall : IfcBuildingElement, ObjectHelper { IfcWall() : Object("IfcWall") {} + + }; + + // C++ wrapper for IfcWallStandardCase + struct IfcWallStandardCase : IfcWall, ObjectHelper { IfcWallStandardCase() : Object("IfcWallStandardCase") {} + + }; + + // C++ wrapper for IfcWallType + struct IfcWallType : IfcBuildingElementType, ObjectHelper { IfcWallType() : Object("IfcWallType") {} + IfcWallTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcWasteTerminalType + struct IfcWasteTerminalType : IfcFlowTerminalType, ObjectHelper { IfcWasteTerminalType() : Object("IfcWasteTerminalType") {} + IfcWasteTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcWindow + struct IfcWindow : IfcBuildingElement, ObjectHelper { IfcWindow() : Object("IfcWindow") {} + Maybe< IfcPositiveLengthMeasure::Out > OverallHeight; + Maybe< IfcPositiveLengthMeasure::Out > OverallWidth; + }; + + // C++ wrapper for IfcWindowStyle + struct IfcWindowStyle : IfcTypeProduct, ObjectHelper { IfcWindowStyle() : Object("IfcWindowStyle") {} + IfcWindowStyleConstructionEnum::Out ConstructionType; + IfcWindowStyleOperationEnum::Out OperationType; + BOOLEAN::Out ParameterTakesPrecedence; + BOOLEAN::Out Sizeable; + }; + + // C++ wrapper for IfcWorkControl + struct IfcWorkControl : IfcControl, ObjectHelper { IfcWorkControl() : Object("IfcWorkControl") {} + IfcIdentifier::Out Identifier; + IfcDateTimeSelect::Out CreationDate; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > Creators; + Maybe< IfcLabel::Out > Purpose; + Maybe< IfcTimeMeasure::Out > Duration; + Maybe< IfcTimeMeasure::Out > TotalFloat; + IfcDateTimeSelect::Out StartTime; + Maybe< IfcDateTimeSelect::Out > FinishTime; + Maybe< IfcWorkControlTypeEnum::Out > WorkControlType; + Maybe< IfcLabel::Out > UserDefinedControlType; + }; + + // C++ wrapper for IfcWorkPlan + struct IfcWorkPlan : IfcWorkControl, ObjectHelper { IfcWorkPlan() : Object("IfcWorkPlan") {} + + }; + + // C++ wrapper for IfcWorkSchedule + struct IfcWorkSchedule : IfcWorkControl, ObjectHelper { IfcWorkSchedule() : Object("IfcWorkSchedule") {} + + }; + + // C++ wrapper for IfcZShapeProfileDef + struct IfcZShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcZShapeProfileDef() : Object("IfcZShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out FlangeWidth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcPositiveLengthMeasure::Out > FilletRadius; + Maybe< IfcPositiveLengthMeasure::Out > EdgeRadius; + }; + + // C++ wrapper for IfcZone + struct IfcZone : IfcGroup, ObjectHelper { IfcZone() : Object("IfcZone") {} + + }; + + void GetSchema(EXPRESS::ConversionSchema& out); + } //! Schema_2x3 +} //! IFC + +namespace STEP { + + // ****************************************************************************** + // Converter stubs + // ****************************************************************************** + +#define DECL_CONV_STUB(type) template <> size_t GenericFill(const STEP::DB& db, const EXPRESS::LIST& params, IFC::Schema_2x3::type* in) + + DECL_CONV_STUB(IfcRepresentationItem); + DECL_CONV_STUB(IfcGeometricRepresentationItem); + DECL_CONV_STUB(IfcCurve); + DECL_CONV_STUB(IfcBoundedCurve); + DECL_CONV_STUB(IfcCompositeCurve); + DECL_CONV_STUB(Ifc2DCompositeCurve); + DECL_CONV_STUB(IfcRoot); + DECL_CONV_STUB(IfcObjectDefinition); + DECL_CONV_STUB(IfcObject); + DECL_CONV_STUB(IfcControl); + DECL_CONV_STUB(IfcActionRequest); + DECL_CONV_STUB(IfcActor); + DECL_CONV_STUB(IfcTypeObject); + DECL_CONV_STUB(IfcTypeProduct); + DECL_CONV_STUB(IfcElementType); + DECL_CONV_STUB(IfcDistributionElementType); + DECL_CONV_STUB(IfcDistributionControlElementType); + DECL_CONV_STUB(IfcActuatorType); + DECL_CONV_STUB(IfcDistributionFlowElementType); + DECL_CONV_STUB(IfcFlowControllerType); + DECL_CONV_STUB(IfcAirTerminalBoxType); + DECL_CONV_STUB(IfcFlowTerminalType); + DECL_CONV_STUB(IfcAirTerminalType); + DECL_CONV_STUB(IfcEnergyConversionDeviceType); + DECL_CONV_STUB(IfcAirToAirHeatRecoveryType); + DECL_CONV_STUB(IfcAlarmType); + DECL_CONV_STUB(IfcDraughtingCallout); + DECL_CONV_STUB(IfcDimensionCurveDirectedCallout); + DECL_CONV_STUB(IfcAngularDimension); + DECL_CONV_STUB(IfcProduct); + DECL_CONV_STUB(IfcAnnotation); + DECL_CONV_STUB(IfcStyledItem); + DECL_CONV_STUB(IfcAnnotationOccurrence); + DECL_CONV_STUB(IfcAnnotationCurveOccurrence); + DECL_CONV_STUB(IfcAnnotationFillArea); + DECL_CONV_STUB(IfcAnnotationFillAreaOccurrence); + DECL_CONV_STUB(IfcAnnotationSurface); + DECL_CONV_STUB(IfcAnnotationSurfaceOccurrence); + DECL_CONV_STUB(IfcAnnotationSymbolOccurrence); + DECL_CONV_STUB(IfcAnnotationTextOccurrence); + DECL_CONV_STUB(IfcProfileDef); + DECL_CONV_STUB(IfcArbitraryClosedProfileDef); + DECL_CONV_STUB(IfcArbitraryOpenProfileDef); + DECL_CONV_STUB(IfcArbitraryProfileDefWithVoids); + DECL_CONV_STUB(IfcGroup); + DECL_CONV_STUB(IfcAsset); + DECL_CONV_STUB(IfcParameterizedProfileDef); + DECL_CONV_STUB(IfcIShapeProfileDef); + DECL_CONV_STUB(IfcAsymmetricIShapeProfileDef); + DECL_CONV_STUB(IfcPlacement); + DECL_CONV_STUB(IfcAxis1Placement); + DECL_CONV_STUB(IfcAxis2Placement2D); + DECL_CONV_STUB(IfcAxis2Placement3D); + DECL_CONV_STUB(IfcBSplineCurve); + DECL_CONV_STUB(IfcElement); + DECL_CONV_STUB(IfcBuildingElement); + DECL_CONV_STUB(IfcBeam); + DECL_CONV_STUB(IfcBuildingElementType); + DECL_CONV_STUB(IfcBeamType); + DECL_CONV_STUB(IfcBezierCurve); + DECL_CONV_STUB(IfcCsgPrimitive3D); + DECL_CONV_STUB(IfcBlock); + DECL_CONV_STUB(IfcBoilerType); + DECL_CONV_STUB(IfcBooleanResult); + DECL_CONV_STUB(IfcBooleanClippingResult); + DECL_CONV_STUB(IfcSurface); + DECL_CONV_STUB(IfcBoundedSurface); + DECL_CONV_STUB(IfcBoundingBox); + DECL_CONV_STUB(IfcHalfSpaceSolid); + DECL_CONV_STUB(IfcBoxedHalfSpace); + DECL_CONV_STUB(IfcSpatialStructureElement); + DECL_CONV_STUB(IfcBuilding); + DECL_CONV_STUB(IfcBuildingElementComponent); + DECL_CONV_STUB(IfcBuildingElementPart); + DECL_CONV_STUB(IfcBuildingElementProxy); + DECL_CONV_STUB(IfcBuildingElementProxyType); + DECL_CONV_STUB(IfcBuildingStorey); + DECL_CONV_STUB(IfcCShapeProfileDef); + DECL_CONV_STUB(IfcFlowFittingType); + DECL_CONV_STUB(IfcCableCarrierFittingType); + DECL_CONV_STUB(IfcFlowSegmentType); + DECL_CONV_STUB(IfcCableCarrierSegmentType); + DECL_CONV_STUB(IfcCableSegmentType); + DECL_CONV_STUB(IfcPoint); + DECL_CONV_STUB(IfcCartesianPoint); + DECL_CONV_STUB(IfcCartesianTransformationOperator); + DECL_CONV_STUB(IfcCartesianTransformationOperator2D); + DECL_CONV_STUB(IfcCartesianTransformationOperator2DnonUniform); + DECL_CONV_STUB(IfcCartesianTransformationOperator3D); + DECL_CONV_STUB(IfcCartesianTransformationOperator3DnonUniform); + DECL_CONV_STUB(IfcCenterLineProfileDef); + DECL_CONV_STUB(IfcFeatureElement); + DECL_CONV_STUB(IfcFeatureElementSubtraction); + DECL_CONV_STUB(IfcEdgeFeature); + DECL_CONV_STUB(IfcChamferEdgeFeature); + DECL_CONV_STUB(IfcChillerType); + DECL_CONV_STUB(IfcConic); + DECL_CONV_STUB(IfcCircle); + DECL_CONV_STUB(IfcCircleProfileDef); + DECL_CONV_STUB(IfcCircleHollowProfileDef); + DECL_CONV_STUB(IfcTopologicalRepresentationItem); + DECL_CONV_STUB(IfcConnectedFaceSet); + DECL_CONV_STUB(IfcClosedShell); + DECL_CONV_STUB(IfcCoilType); + DECL_CONV_STUB(IfcColourSpecification); + DECL_CONV_STUB(IfcColourRgb); + DECL_CONV_STUB(IfcColumn); + DECL_CONV_STUB(IfcColumnType); + DECL_CONV_STUB(IfcProperty); + DECL_CONV_STUB(IfcComplexProperty); + DECL_CONV_STUB(IfcCompositeCurveSegment); + DECL_CONV_STUB(IfcCompositeProfileDef); + DECL_CONV_STUB(IfcFlowMovingDeviceType); + DECL_CONV_STUB(IfcCompressorType); + DECL_CONV_STUB(IfcCondenserType); + DECL_CONV_STUB(IfcCondition); + DECL_CONV_STUB(IfcConditionCriterion); + DECL_CONV_STUB(IfcResource); + DECL_CONV_STUB(IfcConstructionResource); + DECL_CONV_STUB(IfcConstructionEquipmentResource); + DECL_CONV_STUB(IfcConstructionMaterialResource); + DECL_CONV_STUB(IfcConstructionProductResource); + DECL_CONV_STUB(IfcNamedUnit); + DECL_CONV_STUB(IfcContextDependentUnit); + DECL_CONV_STUB(IfcControllerType); + DECL_CONV_STUB(IfcConversionBasedUnit); + DECL_CONV_STUB(IfcCooledBeamType); + DECL_CONV_STUB(IfcCoolingTowerType); + DECL_CONV_STUB(IfcCostItem); + DECL_CONV_STUB(IfcCostSchedule); + DECL_CONV_STUB(IfcCovering); + DECL_CONV_STUB(IfcCoveringType); + DECL_CONV_STUB(IfcCraneRailAShapeProfileDef); + DECL_CONV_STUB(IfcCraneRailFShapeProfileDef); + DECL_CONV_STUB(IfcCrewResource); + DECL_CONV_STUB(IfcSolidModel); + DECL_CONV_STUB(IfcCsgSolid); + DECL_CONV_STUB(IfcCurtainWall); + DECL_CONV_STUB(IfcCurtainWallType); + DECL_CONV_STUB(IfcCurveBoundedPlane); + DECL_CONV_STUB(IfcPresentationStyle); + DECL_CONV_STUB(IfcDamperType); + DECL_CONV_STUB(IfcDefinedSymbol); + DECL_CONV_STUB(IfcDerivedProfileDef); + DECL_CONV_STUB(IfcDiameterDimension); + DECL_CONV_STUB(IfcDimensionCurve); + DECL_CONV_STUB(IfcTerminatorSymbol); + DECL_CONV_STUB(IfcDimensionCurveTerminator); + DECL_CONV_STUB(IfcDirection); + DECL_CONV_STUB(IfcElementComponent); + DECL_CONV_STUB(IfcDiscreteAccessory); + DECL_CONV_STUB(IfcElementComponentType); + DECL_CONV_STUB(IfcDiscreteAccessoryType); + DECL_CONV_STUB(IfcDistributionElement); + DECL_CONV_STUB(IfcDistributionFlowElement); + DECL_CONV_STUB(IfcDistributionChamberElement); + DECL_CONV_STUB(IfcDistributionChamberElementType); + DECL_CONV_STUB(IfcDistributionControlElement); + DECL_CONV_STUB(IfcPort); + DECL_CONV_STUB(IfcDistributionPort); + DECL_CONV_STUB(IfcDoor); + DECL_CONV_STUB(IfcPropertyDefinition); + DECL_CONV_STUB(IfcPropertySetDefinition); + DECL_CONV_STUB(IfcDoorStyle); + DECL_CONV_STUB(IfcDuctFittingType); + DECL_CONV_STUB(IfcDuctSegmentType); + DECL_CONV_STUB(IfcFlowTreatmentDeviceType); + DECL_CONV_STUB(IfcDuctSilencerType); + DECL_CONV_STUB(IfcEdge); + DECL_CONV_STUB(IfcEdgeCurve); + DECL_CONV_STUB(IfcLoop); + DECL_CONV_STUB(IfcEdgeLoop); + DECL_CONV_STUB(IfcElectricApplianceType); + DECL_CONV_STUB(IfcFlowController); + DECL_CONV_STUB(IfcElectricDistributionPoint); + DECL_CONV_STUB(IfcFlowStorageDeviceType); + DECL_CONV_STUB(IfcElectricFlowStorageDeviceType); + DECL_CONV_STUB(IfcElectricGeneratorType); + DECL_CONV_STUB(IfcElectricHeaterType); + DECL_CONV_STUB(IfcElectricMotorType); + DECL_CONV_STUB(IfcElectricTimeControlType); + DECL_CONV_STUB(IfcSystem); + DECL_CONV_STUB(IfcElectricalCircuit); + DECL_CONV_STUB(IfcElectricalElement); + DECL_CONV_STUB(IfcElementAssembly); + DECL_CONV_STUB(IfcElementQuantity); + DECL_CONV_STUB(IfcElementarySurface); + DECL_CONV_STUB(IfcEllipse); + DECL_CONV_STUB(IfcEllipseProfileDef); + DECL_CONV_STUB(IfcEnergyConversionDevice); + DECL_CONV_STUB(IfcEquipmentElement); + DECL_CONV_STUB(IfcEquipmentStandard); + DECL_CONV_STUB(IfcEvaporativeCoolerType); + DECL_CONV_STUB(IfcEvaporatorType); + DECL_CONV_STUB(IfcSweptAreaSolid); + DECL_CONV_STUB(IfcExtrudedAreaSolid); + DECL_CONV_STUB(IfcFace); + DECL_CONV_STUB(IfcFaceBasedSurfaceModel); + DECL_CONV_STUB(IfcFaceBound); + DECL_CONV_STUB(IfcFaceOuterBound); + DECL_CONV_STUB(IfcFaceSurface); + DECL_CONV_STUB(IfcManifoldSolidBrep); + DECL_CONV_STUB(IfcFacetedBrep); + DECL_CONV_STUB(IfcFacetedBrepWithVoids); + DECL_CONV_STUB(IfcFanType); + DECL_CONV_STUB(IfcFastener); + DECL_CONV_STUB(IfcFastenerType); + DECL_CONV_STUB(IfcFeatureElementAddition); + DECL_CONV_STUB(IfcFillAreaStyleHatching); + DECL_CONV_STUB(IfcFillAreaStyleTileSymbolWithStyle); + DECL_CONV_STUB(IfcFillAreaStyleTiles); + DECL_CONV_STUB(IfcFilterType); + DECL_CONV_STUB(IfcFireSuppressionTerminalType); + DECL_CONV_STUB(IfcFlowFitting); + DECL_CONV_STUB(IfcFlowInstrumentType); + DECL_CONV_STUB(IfcFlowMeterType); + DECL_CONV_STUB(IfcFlowMovingDevice); + DECL_CONV_STUB(IfcFlowSegment); + DECL_CONV_STUB(IfcFlowStorageDevice); + DECL_CONV_STUB(IfcFlowTerminal); + DECL_CONV_STUB(IfcFlowTreatmentDevice); + DECL_CONV_STUB(IfcFooting); + DECL_CONV_STUB(IfcFurnishingElement); + DECL_CONV_STUB(IfcFurnishingElementType); + DECL_CONV_STUB(IfcFurnitureStandard); + DECL_CONV_STUB(IfcFurnitureType); + DECL_CONV_STUB(IfcGasTerminalType); + DECL_CONV_STUB(IfcGeometricSet); + DECL_CONV_STUB(IfcGeometricCurveSet); + DECL_CONV_STUB(IfcRepresentationContext); + DECL_CONV_STUB(IfcGeometricRepresentationContext); + DECL_CONV_STUB(IfcGeometricRepresentationSubContext); + DECL_CONV_STUB(IfcGrid); + DECL_CONV_STUB(IfcObjectPlacement); + DECL_CONV_STUB(IfcGridPlacement); + DECL_CONV_STUB(IfcHeatExchangerType); + DECL_CONV_STUB(IfcHumidifierType); + DECL_CONV_STUB(IfcInventory); + DECL_CONV_STUB(IfcJunctionBoxType); + DECL_CONV_STUB(IfcLShapeProfileDef); + DECL_CONV_STUB(IfcLaborResource); + DECL_CONV_STUB(IfcLampType); + DECL_CONV_STUB(IfcLightFixtureType); + DECL_CONV_STUB(IfcLightSource); + DECL_CONV_STUB(IfcLightSourceAmbient); + DECL_CONV_STUB(IfcLightSourceDirectional); + DECL_CONV_STUB(IfcLightSourceGoniometric); + DECL_CONV_STUB(IfcLightSourcePositional); + DECL_CONV_STUB(IfcLightSourceSpot); + DECL_CONV_STUB(IfcLine); + DECL_CONV_STUB(IfcLinearDimension); + DECL_CONV_STUB(IfcLocalPlacement); + DECL_CONV_STUB(IfcMappedItem); + DECL_CONV_STUB(IfcProductRepresentation); + DECL_CONV_STUB(IfcMaterialDefinitionRepresentation); + DECL_CONV_STUB(IfcMeasureWithUnit); + DECL_CONV_STUB(IfcMechanicalFastener); + DECL_CONV_STUB(IfcMechanicalFastenerType); + DECL_CONV_STUB(IfcMember); + DECL_CONV_STUB(IfcMemberType); + DECL_CONV_STUB(IfcMotorConnectionType); + DECL_CONV_STUB(IfcProcess); + DECL_CONV_STUB(IfcTask); + DECL_CONV_STUB(IfcMove); + DECL_CONV_STUB(IfcOccupant); + DECL_CONV_STUB(IfcOffsetCurve2D); + DECL_CONV_STUB(IfcOffsetCurve3D); + DECL_CONV_STUB(IfcOneDirectionRepeatFactor); + DECL_CONV_STUB(IfcOpenShell); + DECL_CONV_STUB(IfcOpeningElement); + DECL_CONV_STUB(IfcOrderAction); + DECL_CONV_STUB(IfcOrientedEdge); + DECL_CONV_STUB(IfcOutletType); + DECL_CONV_STUB(IfcPath); + DECL_CONV_STUB(IfcPerformanceHistory); + DECL_CONV_STUB(IfcPermit); + DECL_CONV_STUB(IfcPile); + DECL_CONV_STUB(IfcPipeFittingType); + DECL_CONV_STUB(IfcPipeSegmentType); + DECL_CONV_STUB(IfcPlanarExtent); + DECL_CONV_STUB(IfcPlanarBox); + DECL_CONV_STUB(IfcPlane); + DECL_CONV_STUB(IfcPlate); + DECL_CONV_STUB(IfcPlateType); + DECL_CONV_STUB(IfcPointOnCurve); + DECL_CONV_STUB(IfcPointOnSurface); + DECL_CONV_STUB(IfcPolyLoop); + DECL_CONV_STUB(IfcPolygonalBoundedHalfSpace); + DECL_CONV_STUB(IfcPolyline); + DECL_CONV_STUB(IfcPresentationStyleAssignment); + DECL_CONV_STUB(IfcProcedure); + DECL_CONV_STUB(IfcProductDefinitionShape); + DECL_CONV_STUB(IfcProject); + DECL_CONV_STUB(IfcProjectOrder); + DECL_CONV_STUB(IfcProjectOrderRecord); + DECL_CONV_STUB(IfcProjectionCurve); + DECL_CONV_STUB(IfcProjectionElement); + DECL_CONV_STUB(IfcSimpleProperty); + DECL_CONV_STUB(IfcPropertyBoundedValue); + DECL_CONV_STUB(IfcPropertyEnumeratedValue); + DECL_CONV_STUB(IfcPropertyListValue); + DECL_CONV_STUB(IfcPropertyReferenceValue); + DECL_CONV_STUB(IfcPropertySet); + DECL_CONV_STUB(IfcPropertySingleValue); + DECL_CONV_STUB(IfcPropertyTableValue); + DECL_CONV_STUB(IfcProtectiveDeviceType); + DECL_CONV_STUB(IfcProxy); + DECL_CONV_STUB(IfcPumpType); + DECL_CONV_STUB(IfcRadiusDimension); + DECL_CONV_STUB(IfcRailing); + DECL_CONV_STUB(IfcRailingType); + DECL_CONV_STUB(IfcRamp); + DECL_CONV_STUB(IfcRampFlight); + DECL_CONV_STUB(IfcRampFlightType); + DECL_CONV_STUB(IfcRationalBezierCurve); + DECL_CONV_STUB(IfcRectangleProfileDef); + DECL_CONV_STUB(IfcRectangleHollowProfileDef); + DECL_CONV_STUB(IfcRectangularPyramid); + DECL_CONV_STUB(IfcRectangularTrimmedSurface); + DECL_CONV_STUB(IfcReinforcingElement); + DECL_CONV_STUB(IfcReinforcingBar); + DECL_CONV_STUB(IfcReinforcingMesh); + DECL_CONV_STUB(IfcRelationship); + DECL_CONV_STUB(IfcRelDecomposes); + DECL_CONV_STUB(IfcRelAggregates); + DECL_CONV_STUB(IfcRelConnects); + DECL_CONV_STUB(IfcRelContainedInSpatialStructure); + DECL_CONV_STUB(IfcRelDefines); + DECL_CONV_STUB(IfcRelDefinesByProperties); + DECL_CONV_STUB(IfcRelFillsElement); + DECL_CONV_STUB(IfcRelOverridesProperties); + DECL_CONV_STUB(IfcRelVoidsElement); + DECL_CONV_STUB(IfcRepresentation); + DECL_CONV_STUB(IfcRepresentationMap); + DECL_CONV_STUB(IfcRevolvedAreaSolid); + DECL_CONV_STUB(IfcRightCircularCone); + DECL_CONV_STUB(IfcRightCircularCylinder); + DECL_CONV_STUB(IfcRoof); + DECL_CONV_STUB(IfcRoundedEdgeFeature); + DECL_CONV_STUB(IfcRoundedRectangleProfileDef); + DECL_CONV_STUB(IfcSIUnit); + DECL_CONV_STUB(IfcSanitaryTerminalType); + DECL_CONV_STUB(IfcScheduleTimeControl); + DECL_CONV_STUB(IfcSectionedSpine); + DECL_CONV_STUB(IfcSensorType); + DECL_CONV_STUB(IfcServiceLife); + DECL_CONV_STUB(IfcShapeModel); + DECL_CONV_STUB(IfcShapeRepresentation); + DECL_CONV_STUB(IfcShellBasedSurfaceModel); + DECL_CONV_STUB(IfcSite); + DECL_CONV_STUB(IfcSlab); + DECL_CONV_STUB(IfcSlabType); + DECL_CONV_STUB(IfcSpace); + DECL_CONV_STUB(IfcSpaceHeaterType); + DECL_CONV_STUB(IfcSpaceProgram); + DECL_CONV_STUB(IfcSpatialStructureElementType); + DECL_CONV_STUB(IfcSpaceType); + DECL_CONV_STUB(IfcSphere); + DECL_CONV_STUB(IfcStackTerminalType); + DECL_CONV_STUB(IfcStair); + DECL_CONV_STUB(IfcStairFlight); + DECL_CONV_STUB(IfcStairFlightType); + DECL_CONV_STUB(IfcStructuralActivity); + DECL_CONV_STUB(IfcStructuralAction); + DECL_CONV_STUB(IfcStructuralAnalysisModel); + DECL_CONV_STUB(IfcStructuralItem); + DECL_CONV_STUB(IfcStructuralConnection); + DECL_CONV_STUB(IfcStructuralCurveConnection); + DECL_CONV_STUB(IfcStructuralMember); + DECL_CONV_STUB(IfcStructuralCurveMember); + DECL_CONV_STUB(IfcStructuralCurveMemberVarying); + DECL_CONV_STUB(IfcStructuralLinearAction); + DECL_CONV_STUB(IfcStructuralLinearActionVarying); + DECL_CONV_STUB(IfcStructuralLoadGroup); + DECL_CONV_STUB(IfcStructuralPlanarAction); + DECL_CONV_STUB(IfcStructuralPlanarActionVarying); + DECL_CONV_STUB(IfcStructuralPointAction); + DECL_CONV_STUB(IfcStructuralPointConnection); + DECL_CONV_STUB(IfcStructuralReaction); + DECL_CONV_STUB(IfcStructuralPointReaction); + DECL_CONV_STUB(IfcStructuralResultGroup); + DECL_CONV_STUB(IfcStructuralSurfaceConnection); + DECL_CONV_STUB(IfcStructuralSurfaceMember); + DECL_CONV_STUB(IfcStructuralSurfaceMemberVarying); + DECL_CONV_STUB(IfcStructuredDimensionCallout); + DECL_CONV_STUB(IfcStyleModel); + DECL_CONV_STUB(IfcStyledRepresentation); + DECL_CONV_STUB(IfcSubContractResource); + DECL_CONV_STUB(IfcSubedge); + DECL_CONV_STUB(IfcSurfaceCurveSweptAreaSolid); + DECL_CONV_STUB(IfcSweptSurface); + DECL_CONV_STUB(IfcSurfaceOfLinearExtrusion); + DECL_CONV_STUB(IfcSurfaceOfRevolution); + DECL_CONV_STUB(IfcSurfaceStyle); + DECL_CONV_STUB(IfcSurfaceStyleShading); + DECL_CONV_STUB(IfcSurfaceStyleRendering); + DECL_CONV_STUB(IfcSurfaceStyleWithTextures); + DECL_CONV_STUB(IfcSweptDiskSolid); + DECL_CONV_STUB(IfcSwitchingDeviceType); + DECL_CONV_STUB(IfcSystemFurnitureElementType); + DECL_CONV_STUB(IfcTShapeProfileDef); + DECL_CONV_STUB(IfcTankType); + DECL_CONV_STUB(IfcTendon); + DECL_CONV_STUB(IfcTendonAnchor); + DECL_CONV_STUB(IfcTextLiteral); + DECL_CONV_STUB(IfcTextLiteralWithExtent); + DECL_CONV_STUB(IfcTimeSeriesSchedule); + DECL_CONV_STUB(IfcTopologyRepresentation); + DECL_CONV_STUB(IfcTransformerType); + DECL_CONV_STUB(IfcTransportElement); + DECL_CONV_STUB(IfcTransportElementType); + DECL_CONV_STUB(IfcTrapeziumProfileDef); + DECL_CONV_STUB(IfcTrimmedCurve); + DECL_CONV_STUB(IfcTubeBundleType); + DECL_CONV_STUB(IfcTwoDirectionRepeatFactor); + DECL_CONV_STUB(IfcUShapeProfileDef); + DECL_CONV_STUB(IfcUnitAssignment); + DECL_CONV_STUB(IfcUnitaryEquipmentType); + DECL_CONV_STUB(IfcValveType); + DECL_CONV_STUB(IfcVector); + DECL_CONV_STUB(IfcVertex); + DECL_CONV_STUB(IfcVertexLoop); + DECL_CONV_STUB(IfcVertexPoint); + DECL_CONV_STUB(IfcVibrationIsolatorType); + DECL_CONV_STUB(IfcVirtualElement); + DECL_CONV_STUB(IfcWall); + DECL_CONV_STUB(IfcWallStandardCase); + DECL_CONV_STUB(IfcWallType); + DECL_CONV_STUB(IfcWasteTerminalType); + DECL_CONV_STUB(IfcWindow); + DECL_CONV_STUB(IfcWindowStyle); + DECL_CONV_STUB(IfcWorkControl); + DECL_CONV_STUB(IfcWorkPlan); + DECL_CONV_STUB(IfcWorkSchedule); + DECL_CONV_STUB(IfcZShapeProfileDef); + DECL_CONV_STUB(IfcZone); + + +#undef DECL_CONV_STUB + +} //! STEP +} //! Assimp + +#endif // INCLUDED_IFC_READER_GEN_H diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.cpp new file mode 100644 index 000000000..fdefedb18 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.cpp @@ -0,0 +1,6207 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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_IFC_IMPORTER + +#include "AssimpPCH.h" +#include "IFCReaderGen_4.h" + +namespace Assimp { +using namespace IFC; +using namespace ::Assimp::IFC::Schema_4; + +namespace { + + typedef EXPRESS::ConversionSchema::SchemaEntry SchemaEntry; + const SchemaEntry schema_raw[] = { + SchemaEntry("ifcstrippedoptional",NULL ) +, SchemaEntry("ifcabsorbeddosemeasure",NULL ) +, SchemaEntry("ifcaccelerationmeasure",NULL ) +, SchemaEntry("ifcamountofsubstancemeasure",NULL ) +, SchemaEntry("ifcangularvelocitymeasure",NULL ) +, SchemaEntry("ifcarcindex",NULL ) +, SchemaEntry("ifcareadensitymeasure",NULL ) +, SchemaEntry("ifcareameasure",NULL ) +, SchemaEntry("ifcbinary",NULL ) +, SchemaEntry("ifcboolean",NULL ) +, SchemaEntry("ifcboxalignment",NULL ) +, SchemaEntry("ifccardinalpointreference",NULL ) +, SchemaEntry("ifccomplexnumber",NULL ) +, SchemaEntry("ifccompoundplaneanglemeasure",NULL ) +, SchemaEntry("ifccontextdependentmeasure",NULL ) +, SchemaEntry("ifccountmeasure",NULL ) +, SchemaEntry("ifccurvaturemeasure",NULL ) +, SchemaEntry("ifcdate",NULL ) +, SchemaEntry("ifcdatetime",NULL ) +, SchemaEntry("ifcdayinmonthnumber",NULL ) +, SchemaEntry("ifcdayinweeknumber",NULL ) +, SchemaEntry("ifcdescriptivemeasure",NULL ) +, SchemaEntry("ifcdimensioncount",NULL ) +, SchemaEntry("ifcdoseequivalentmeasure",NULL ) +, SchemaEntry("ifcduration",NULL ) +, SchemaEntry("ifcdynamicviscositymeasure",NULL ) +, SchemaEntry("ifcelectriccapacitancemeasure",NULL ) +, SchemaEntry("ifcelectricchargemeasure",NULL ) +, SchemaEntry("ifcelectricconductancemeasure",NULL ) +, SchemaEntry("ifcelectriccurrentmeasure",NULL ) +, SchemaEntry("ifcelectricresistancemeasure",NULL ) +, SchemaEntry("ifcelectricvoltagemeasure",NULL ) +, SchemaEntry("ifcenergymeasure",NULL ) +, SchemaEntry("ifcfontstyle",NULL ) +, SchemaEntry("ifcfontvariant",NULL ) +, SchemaEntry("ifcfontweight",NULL ) +, SchemaEntry("ifcforcemeasure",NULL ) +, SchemaEntry("ifcfrequencymeasure",NULL ) +, SchemaEntry("ifcgloballyuniqueid",NULL ) +, SchemaEntry("ifcheatfluxdensitymeasure",NULL ) +, SchemaEntry("ifcheatingvaluemeasure",NULL ) +, SchemaEntry("ifcidentifier",NULL ) +, SchemaEntry("ifcilluminancemeasure",NULL ) +, SchemaEntry("ifcinductancemeasure",NULL ) +, SchemaEntry("ifcinteger",NULL ) +, SchemaEntry("ifcintegercountratemeasure",NULL ) +, SchemaEntry("ifcionconcentrationmeasure",NULL ) +, SchemaEntry("ifcisothermalmoisturecapacitymeasure",NULL ) +, SchemaEntry("ifckinematicviscositymeasure",NULL ) +, SchemaEntry("ifclabel",NULL ) +, SchemaEntry("ifclanguageid",NULL ) +, SchemaEntry("ifclengthmeasure",NULL ) +, SchemaEntry("ifclineindex",NULL ) +, SchemaEntry("ifclinearforcemeasure",NULL ) +, SchemaEntry("ifclinearmomentmeasure",NULL ) +, SchemaEntry("ifclinearstiffnessmeasure",NULL ) +, SchemaEntry("ifclinearvelocitymeasure",NULL ) +, SchemaEntry("ifclogical",NULL ) +, SchemaEntry("ifcluminousfluxmeasure",NULL ) +, SchemaEntry("ifcluminousintensitydistributionmeasure",NULL ) +, SchemaEntry("ifcluminousintensitymeasure",NULL ) +, SchemaEntry("ifcmagneticfluxdensitymeasure",NULL ) +, SchemaEntry("ifcmagneticfluxmeasure",NULL ) +, SchemaEntry("ifcmassdensitymeasure",NULL ) +, SchemaEntry("ifcmassflowratemeasure",NULL ) +, SchemaEntry("ifcmassmeasure",NULL ) +, SchemaEntry("ifcmassperlengthmeasure",NULL ) +, SchemaEntry("ifcmodulusofelasticitymeasure",NULL ) +, SchemaEntry("ifcmodulusoflinearsubgradereactionmeasure",NULL ) +, SchemaEntry("ifcmodulusofrotationalsubgradereactionmeasure",NULL ) +, SchemaEntry("ifcmodulusofsubgradereactionmeasure",NULL ) +, SchemaEntry("ifcmoisturediffusivitymeasure",NULL ) +, SchemaEntry("ifcmolecularweightmeasure",NULL ) +, SchemaEntry("ifcmomentofinertiameasure",NULL ) +, SchemaEntry("ifcmonetarymeasure",NULL ) +, SchemaEntry("ifcmonthinyearnumber",NULL ) +, SchemaEntry("ifcnonnegativelengthmeasure",NULL ) +, SchemaEntry("ifcnormalisedratiomeasure",NULL ) +, SchemaEntry("ifcnumericmeasure",NULL ) +, SchemaEntry("ifcphmeasure",NULL ) +, SchemaEntry("ifcparametervalue",NULL ) +, SchemaEntry("ifcplanarforcemeasure",NULL ) +, SchemaEntry("ifcplaneanglemeasure",NULL ) +, SchemaEntry("ifcpositiveinteger",NULL ) +, SchemaEntry("ifcpositivelengthmeasure",NULL ) +, SchemaEntry("ifcpositiveplaneanglemeasure",NULL ) +, SchemaEntry("ifcpositiveratiomeasure",NULL ) +, SchemaEntry("ifcpowermeasure",NULL ) +, SchemaEntry("ifcpresentabletext",NULL ) +, SchemaEntry("ifcpressuremeasure",NULL ) +, SchemaEntry("ifcpropertysetdefinitionset",NULL ) +, SchemaEntry("ifcradioactivitymeasure",NULL ) +, SchemaEntry("ifcratiomeasure",NULL ) +, SchemaEntry("ifcreal",NULL ) +, SchemaEntry("ifcrotationalfrequencymeasure",NULL ) +, SchemaEntry("ifcrotationalmassmeasure",NULL ) +, SchemaEntry("ifcrotationalstiffnessmeasure",NULL ) +, SchemaEntry("ifcsectionmodulusmeasure",NULL ) +, SchemaEntry("ifcsectionalareaintegralmeasure",NULL ) +, SchemaEntry("ifcshearmodulusmeasure",NULL ) +, SchemaEntry("ifcsolidanglemeasure",NULL ) +, SchemaEntry("ifcsoundpowerlevelmeasure",NULL ) +, SchemaEntry("ifcsoundpowermeasure",NULL ) +, SchemaEntry("ifcsoundpressurelevelmeasure",NULL ) +, SchemaEntry("ifcsoundpressuremeasure",NULL ) +, SchemaEntry("ifcspecificheatcapacitymeasure",NULL ) +, SchemaEntry("ifcspecularexponent",NULL ) +, SchemaEntry("ifcspecularroughness",NULL ) +, SchemaEntry("ifctemperaturegradientmeasure",NULL ) +, SchemaEntry("ifctemperaturerateofchangemeasure",NULL ) +, SchemaEntry("ifctext",NULL ) +, SchemaEntry("ifctextalignment",NULL ) +, SchemaEntry("ifctextdecoration",NULL ) +, SchemaEntry("ifctextfontname",NULL ) +, SchemaEntry("ifctexttransformation",NULL ) +, SchemaEntry("ifcthermaladmittancemeasure",NULL ) +, SchemaEntry("ifcthermalconductivitymeasure",NULL ) +, SchemaEntry("ifcthermalexpansioncoefficientmeasure",NULL ) +, SchemaEntry("ifcthermalresistancemeasure",NULL ) +, SchemaEntry("ifcthermaltransmittancemeasure",NULL ) +, SchemaEntry("ifcthermodynamictemperaturemeasure",NULL ) +, SchemaEntry("ifctime",NULL ) +, SchemaEntry("ifctimemeasure",NULL ) +, SchemaEntry("ifctimestamp",NULL ) +, SchemaEntry("ifctorquemeasure",NULL ) +, SchemaEntry("ifcurireference",NULL ) +, SchemaEntry("ifcvaporpermeabilitymeasure",NULL ) +, SchemaEntry("ifcvolumemeasure",NULL ) +, SchemaEntry("ifcvolumetricflowratemeasure",NULL ) +, SchemaEntry("ifcwarpingconstantmeasure",NULL ) +, SchemaEntry("ifcwarpingmomentmeasure",NULL ) +, SchemaEntry("ifcactionrequesttypeenum",NULL ) +, SchemaEntry("ifcactionsourcetypeenum",NULL ) +, SchemaEntry("ifcactiontypeenum",NULL ) +, SchemaEntry("ifcactuatortypeenum",NULL ) +, SchemaEntry("ifcaddresstypeenum",NULL ) +, SchemaEntry("ifcairterminalboxtypeenum",NULL ) +, SchemaEntry("ifcairterminaltypeenum",NULL ) +, SchemaEntry("ifcairtoairheatrecoverytypeenum",NULL ) +, SchemaEntry("ifcalarmtypeenum",NULL ) +, SchemaEntry("ifcanalysismodeltypeenum",NULL ) +, SchemaEntry("ifcanalysistheorytypeenum",NULL ) +, SchemaEntry("ifcarithmeticoperatorenum",NULL ) +, SchemaEntry("ifcassemblyplaceenum",NULL ) +, SchemaEntry("ifcaudiovisualappliancetypeenum",NULL ) +, SchemaEntry("ifcbsplinecurveform",NULL ) +, SchemaEntry("ifcbsplinesurfaceform",NULL ) +, SchemaEntry("ifcbeamtypeenum",NULL ) +, SchemaEntry("ifcbenchmarkenum",NULL ) +, SchemaEntry("ifcboilertypeenum",NULL ) +, SchemaEntry("ifcbooleanoperator",NULL ) +, SchemaEntry("ifcbuildingelementparttypeenum",NULL ) +, SchemaEntry("ifcbuildingelementproxytypeenum",NULL ) +, SchemaEntry("ifcbuildingsystemtypeenum",NULL ) +, SchemaEntry("ifcburnertypeenum",NULL ) +, SchemaEntry("ifccablecarrierfittingtypeenum",NULL ) +, SchemaEntry("ifccablecarriersegmenttypeenum",NULL ) +, SchemaEntry("ifccablefittingtypeenum",NULL ) +, SchemaEntry("ifccablesegmenttypeenum",NULL ) +, SchemaEntry("ifcchangeactionenum",NULL ) +, SchemaEntry("ifcchillertypeenum",NULL ) +, SchemaEntry("ifcchimneytypeenum",NULL ) +, SchemaEntry("ifccoiltypeenum",NULL ) +, SchemaEntry("ifccolumntypeenum",NULL ) +, SchemaEntry("ifccommunicationsappliancetypeenum",NULL ) +, SchemaEntry("ifccomplexpropertytemplatetypeenum",NULL ) +, SchemaEntry("ifccompressortypeenum",NULL ) +, SchemaEntry("ifccondensertypeenum",NULL ) +, SchemaEntry("ifcconnectiontypeenum",NULL ) +, SchemaEntry("ifcconstraintenum",NULL ) +, SchemaEntry("ifcconstructionequipmentresourcetypeenum",NULL ) +, SchemaEntry("ifcconstructionmaterialresourcetypeenum",NULL ) +, SchemaEntry("ifcconstructionproductresourcetypeenum",NULL ) +, SchemaEntry("ifccontrollertypeenum",NULL ) +, SchemaEntry("ifccooledbeamtypeenum",NULL ) +, SchemaEntry("ifccoolingtowertypeenum",NULL ) +, SchemaEntry("ifccostitemtypeenum",NULL ) +, SchemaEntry("ifccostscheduletypeenum",NULL ) +, SchemaEntry("ifccoveringtypeenum",NULL ) +, SchemaEntry("ifccrewresourcetypeenum",NULL ) +, SchemaEntry("ifccurtainwalltypeenum",NULL ) +, SchemaEntry("ifccurveinterpolationenum",NULL ) +, SchemaEntry("ifcdampertypeenum",NULL ) +, SchemaEntry("ifcdataoriginenum",NULL ) +, SchemaEntry("ifcderivedunitenum",NULL ) +, SchemaEntry("ifcdirectionsenseenum",NULL ) +, SchemaEntry("ifcdiscreteaccessorytypeenum",NULL ) +, SchemaEntry("ifcdistributionchamberelementtypeenum",NULL ) +, SchemaEntry("ifcdistributionporttypeenum",NULL ) +, SchemaEntry("ifcdistributionsystemenum",NULL ) +, SchemaEntry("ifcdocumentconfidentialityenum",NULL ) +, SchemaEntry("ifcdocumentstatusenum",NULL ) +, SchemaEntry("ifcdoorpaneloperationenum",NULL ) +, SchemaEntry("ifcdoorpanelpositionenum",NULL ) +, SchemaEntry("ifcdoorstyleconstructionenum",NULL ) +, SchemaEntry("ifcdoorstyleoperationenum",NULL ) +, SchemaEntry("ifcdoortypeenum",NULL ) +, SchemaEntry("ifcdoortypeoperationenum",NULL ) +, SchemaEntry("ifcductfittingtypeenum",NULL ) +, SchemaEntry("ifcductsegmenttypeenum",NULL ) +, SchemaEntry("ifcductsilencertypeenum",NULL ) +, SchemaEntry("ifcelectricappliancetypeenum",NULL ) +, SchemaEntry("ifcelectricdistributionboardtypeenum",NULL ) +, SchemaEntry("ifcelectricflowstoragedevicetypeenum",NULL ) +, SchemaEntry("ifcelectricgeneratortypeenum",NULL ) +, SchemaEntry("ifcelectricmotortypeenum",NULL ) +, SchemaEntry("ifcelectrictimecontroltypeenum",NULL ) +, SchemaEntry("ifcelementassemblytypeenum",NULL ) +, SchemaEntry("ifcelementcompositionenum",NULL ) +, SchemaEntry("ifcenginetypeenum",NULL ) +, SchemaEntry("ifcevaporativecoolertypeenum",NULL ) +, SchemaEntry("ifcevaporatortypeenum",NULL ) +, SchemaEntry("ifceventtriggertypeenum",NULL ) +, SchemaEntry("ifceventtypeenum",NULL ) +, SchemaEntry("ifcexternalspatialelementtypeenum",NULL ) +, SchemaEntry("ifcfantypeenum",NULL ) +, SchemaEntry("ifcfastenertypeenum",NULL ) +, SchemaEntry("ifcfiltertypeenum",NULL ) +, SchemaEntry("ifcfiresuppressionterminaltypeenum",NULL ) +, SchemaEntry("ifcflowdirectionenum",NULL ) +, SchemaEntry("ifcflowinstrumenttypeenum",NULL ) +, SchemaEntry("ifcflowmetertypeenum",NULL ) +, SchemaEntry("ifcfootingtypeenum",NULL ) +, SchemaEntry("ifcfurnituretypeenum",NULL ) +, SchemaEntry("ifcgeographicelementtypeenum",NULL ) +, SchemaEntry("ifcgeometricprojectionenum",NULL ) +, SchemaEntry("ifcglobalorlocalenum",NULL ) +, SchemaEntry("ifcgridtypeenum",NULL ) +, SchemaEntry("ifcheatexchangertypeenum",NULL ) +, SchemaEntry("ifchumidifiertypeenum",NULL ) +, SchemaEntry("ifcinterceptortypeenum",NULL ) +, SchemaEntry("ifcinternalorexternalenum",NULL ) +, SchemaEntry("ifcinventorytypeenum",NULL ) +, SchemaEntry("ifcjunctionboxtypeenum",NULL ) +, SchemaEntry("ifcknottype",NULL ) +, SchemaEntry("ifclaborresourcetypeenum",NULL ) +, SchemaEntry("ifclamptypeenum",NULL ) +, SchemaEntry("ifclayersetdirectionenum",NULL ) +, SchemaEntry("ifclightdistributioncurveenum",NULL ) +, SchemaEntry("ifclightemissionsourceenum",NULL ) +, SchemaEntry("ifclightfixturetypeenum",NULL ) +, SchemaEntry("ifcloadgrouptypeenum",NULL ) +, SchemaEntry("ifclogicaloperatorenum",NULL ) +, SchemaEntry("ifcmechanicalfastenertypeenum",NULL ) +, SchemaEntry("ifcmedicaldevicetypeenum",NULL ) +, SchemaEntry("ifcmembertypeenum",NULL ) +, SchemaEntry("ifcmotorconnectiontypeenum",NULL ) +, SchemaEntry("ifcnullstyle",NULL ) +, SchemaEntry("ifcobjecttypeenum",NULL ) +, SchemaEntry("ifcobjectiveenum",NULL ) +, SchemaEntry("ifcoccupanttypeenum",NULL ) +, SchemaEntry("ifcopeningelementtypeenum",NULL ) +, SchemaEntry("ifcoutlettypeenum",NULL ) +, SchemaEntry("ifcperformancehistorytypeenum",NULL ) +, SchemaEntry("ifcpermeablecoveringoperationenum",NULL ) +, SchemaEntry("ifcpermittypeenum",NULL ) +, SchemaEntry("ifcphysicalorvirtualenum",NULL ) +, SchemaEntry("ifcpileconstructionenum",NULL ) +, SchemaEntry("ifcpiletypeenum",NULL ) +, SchemaEntry("ifcpipefittingtypeenum",NULL ) +, SchemaEntry("ifcpipesegmenttypeenum",NULL ) +, SchemaEntry("ifcplatetypeenum",NULL ) +, SchemaEntry("ifcpreferredsurfacecurverepresentation",NULL ) +, SchemaEntry("ifcproceduretypeenum",NULL ) +, SchemaEntry("ifcprofiletypeenum",NULL ) +, SchemaEntry("ifcprojectordertypeenum",NULL ) +, SchemaEntry("ifcprojectedortruelengthenum",NULL ) +, SchemaEntry("ifcprojectionelementtypeenum",NULL ) +, SchemaEntry("ifcpropertysettemplatetypeenum",NULL ) +, SchemaEntry("ifcprotectivedevicetrippingunittypeenum",NULL ) +, SchemaEntry("ifcprotectivedevicetypeenum",NULL ) +, SchemaEntry("ifcpumptypeenum",NULL ) +, SchemaEntry("ifcrailingtypeenum",NULL ) +, SchemaEntry("ifcrampflighttypeenum",NULL ) +, SchemaEntry("ifcramptypeenum",NULL ) +, SchemaEntry("ifcrecurrencetypeenum",NULL ) +, SchemaEntry("ifcreflectancemethodenum",NULL ) +, SchemaEntry("ifcreinforcingbarroleenum",NULL ) +, SchemaEntry("ifcreinforcingbarsurfaceenum",NULL ) +, SchemaEntry("ifcreinforcingbartypeenum",NULL ) +, SchemaEntry("ifcreinforcingmeshtypeenum",NULL ) +, SchemaEntry("ifcroleenum",NULL ) +, SchemaEntry("ifcrooftypeenum",NULL ) +, SchemaEntry("ifcsiprefix",NULL ) +, SchemaEntry("ifcsiunitname",NULL ) +, SchemaEntry("ifcsanitaryterminaltypeenum",NULL ) +, SchemaEntry("ifcsectiontypeenum",NULL ) +, SchemaEntry("ifcsensortypeenum",NULL ) +, SchemaEntry("ifcsequenceenum",NULL ) +, SchemaEntry("ifcshadingdevicetypeenum",NULL ) +, SchemaEntry("ifcsimplepropertytemplatetypeenum",NULL ) +, SchemaEntry("ifcslabtypeenum",NULL ) +, SchemaEntry("ifcsolardevicetypeenum",NULL ) +, SchemaEntry("ifcspaceheatertypeenum",NULL ) +, SchemaEntry("ifcspacetypeenum",NULL ) +, SchemaEntry("ifcspatialzonetypeenum",NULL ) +, SchemaEntry("ifcstackterminaltypeenum",NULL ) +, SchemaEntry("ifcstairflighttypeenum",NULL ) +, SchemaEntry("ifcstairtypeenum",NULL ) +, SchemaEntry("ifcstateenum",NULL ) +, SchemaEntry("ifcstructuralcurveactivitytypeenum",NULL ) +, SchemaEntry("ifcstructuralcurvemembertypeenum",NULL ) +, SchemaEntry("ifcstructuralsurfaceactivitytypeenum",NULL ) +, SchemaEntry("ifcstructuralsurfacemembertypeenum",NULL ) +, SchemaEntry("ifcsubcontractresourcetypeenum",NULL ) +, SchemaEntry("ifcsurfacefeaturetypeenum",NULL ) +, SchemaEntry("ifcsurfaceside",NULL ) +, SchemaEntry("ifcswitchingdevicetypeenum",NULL ) +, SchemaEntry("ifcsystemfurnitureelementtypeenum",NULL ) +, SchemaEntry("ifctanktypeenum",NULL ) +, SchemaEntry("ifctaskdurationenum",NULL ) +, SchemaEntry("ifctasktypeenum",NULL ) +, SchemaEntry("ifctendonanchortypeenum",NULL ) +, SchemaEntry("ifctendontypeenum",NULL ) +, SchemaEntry("ifctextpath",NULL ) +, SchemaEntry("ifctimeseriesdatatypeenum",NULL ) +, SchemaEntry("ifctransformertypeenum",NULL ) +, SchemaEntry("ifctransitioncode",NULL ) +, SchemaEntry("ifctransportelementtypeenum",NULL ) +, SchemaEntry("ifctrimmingpreference",NULL ) +, SchemaEntry("ifctubebundletypeenum",NULL ) +, SchemaEntry("ifcunitenum",NULL ) +, SchemaEntry("ifcunitarycontrolelementtypeenum",NULL ) +, SchemaEntry("ifcunitaryequipmenttypeenum",NULL ) +, SchemaEntry("ifcvalvetypeenum",NULL ) +, SchemaEntry("ifcvibrationisolatortypeenum",NULL ) +, SchemaEntry("ifcvoidingfeaturetypeenum",NULL ) +, SchemaEntry("ifcwalltypeenum",NULL ) +, SchemaEntry("ifcwasteterminaltypeenum",NULL ) +, SchemaEntry("ifcwindowpaneloperationenum",NULL ) +, SchemaEntry("ifcwindowpanelpositionenum",NULL ) +, SchemaEntry("ifcwindowstyleconstructionenum",NULL ) +, SchemaEntry("ifcwindowstyleoperationenum",NULL ) +, SchemaEntry("ifcwindowtypeenum",NULL ) +, SchemaEntry("ifcwindowtypepartitioningenum",NULL ) +, SchemaEntry("ifcworkcalendartypeenum",NULL ) +, SchemaEntry("ifcworkplantypeenum",NULL ) +, SchemaEntry("ifcworkscheduletypeenum",NULL ) +, SchemaEntry("ifcactorselect",NULL ) +, SchemaEntry("ifcappliedvalueselect",NULL ) +, SchemaEntry("ifcaxis2placement",NULL ) +, SchemaEntry("ifcbendingparameterselect",NULL ) +, SchemaEntry("ifcbooleanoperand",NULL ) +, SchemaEntry("ifcclassificationreferenceselect",NULL ) +, SchemaEntry("ifcclassificationselect",NULL ) +, SchemaEntry("ifccolour",NULL ) +, SchemaEntry("ifccolourorfactor",NULL ) +, SchemaEntry("ifccoordinatereferencesystemselect",NULL ) +, SchemaEntry("ifccsgselect",NULL ) +, SchemaEntry("ifccurvefontorscaledcurvefontselect",NULL ) +, SchemaEntry("ifccurveonsurface",NULL ) +, SchemaEntry("ifccurveoredgecurve",NULL ) +, SchemaEntry("ifccurvestylefontselect",NULL ) +, SchemaEntry("ifcdefinitionselect",NULL ) +, SchemaEntry("ifcderivedmeasurevalue",NULL ) +, SchemaEntry("ifcdocumentselect",NULL ) +, SchemaEntry("ifcfillstyleselect",NULL ) +, SchemaEntry("ifcgeometricsetselect",NULL ) +, SchemaEntry("ifcgridplacementdirectionselect",NULL ) +, SchemaEntry("ifchatchlinedistanceselect",NULL ) +, SchemaEntry("ifclayereditem",NULL ) +, SchemaEntry("ifclibraryselect",NULL ) +, SchemaEntry("ifclightdistributiondatasourceselect",NULL ) +, SchemaEntry("ifcmaterialselect",NULL ) +, SchemaEntry("ifcmeasurevalue",NULL ) +, SchemaEntry("ifcmetricvalueselect",NULL ) +, SchemaEntry("ifcmodulusofrotationalsubgradereactionselect",NULL ) +, SchemaEntry("ifcmodulusofsubgradereactionselect",NULL ) +, SchemaEntry("ifcmodulusoftranslationalsubgradereactionselect",NULL ) +, SchemaEntry("ifcobjectreferenceselect",NULL ) +, SchemaEntry("ifcpointorvertexpoint",NULL ) +, SchemaEntry("ifcpresentationstyleselect",NULL ) +, SchemaEntry("ifcprocessselect",NULL ) +, SchemaEntry("ifcproductrepresentationselect",NULL ) +, SchemaEntry("ifcproductselect",NULL ) +, SchemaEntry("ifcpropertysetdefinitionselect",NULL ) +, SchemaEntry("ifcresourceobjectselect",NULL ) +, SchemaEntry("ifcresourceselect",NULL ) +, SchemaEntry("ifcrotationalstiffnessselect",NULL ) +, SchemaEntry("ifcsegmentindexselect",NULL ) +, SchemaEntry("ifcshell",NULL ) +, SchemaEntry("ifcsimplevalue",NULL ) +, SchemaEntry("ifcsizeselect",NULL ) +, SchemaEntry("ifcsolidorshell",NULL ) +, SchemaEntry("ifcspaceboundaryselect",NULL ) +, SchemaEntry("ifcspecularhighlightselect",NULL ) +, SchemaEntry("ifcstructuralactivityassignmentselect",NULL ) +, SchemaEntry("ifcstyleassignmentselect",NULL ) +, SchemaEntry("ifcsurfaceorfacesurface",NULL ) +, SchemaEntry("ifcsurfacestyleelementselect",NULL ) +, SchemaEntry("ifctextfontselect",NULL ) +, SchemaEntry("ifctimeorratioselect",NULL ) +, SchemaEntry("ifctranslationalstiffnessselect",NULL ) +, SchemaEntry("ifctrimmingselect",NULL ) +, SchemaEntry("ifcunit",NULL ) +, SchemaEntry("ifcvalue",NULL ) +, SchemaEntry("ifcvectorordirection",NULL ) +, SchemaEntry("ifcwarpingstiffnessselect",NULL ) +, SchemaEntry("ifcroot",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjectdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactionrequest",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactorrole",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncontrolelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactuator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncontrolelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcactuatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaddress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsolidmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmanifoldsolidbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcadvancedbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcadvancedbrepwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctopologicalrepresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacesurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcadvancedface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionflowelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowcontroller",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminalbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionflowelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowcontrollertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminalboxtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyconversiondevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairtoairheatrecovery",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenergyconversiondevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcairtoairheatrecoverytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcalarm",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcalarmtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcannotationfillarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapplication",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcappliedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapproval",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresourcelevelrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcapprovalrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryclosedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryopenprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcarbitraryprofiledefwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcasset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcparameterizedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcasymmetricishapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaudiovisualappliance",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaudiovisualappliancetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis1placement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis2placement2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcaxis2placement3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundedcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbsplinecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbsplinecurvewithknots",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbsplinesurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbsplinesurfacewithknots",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeam",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeamstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbeamtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacetexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcblobtexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccsgprimitive3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcblock",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboiler",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboilertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbooleanresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbooleanclippingresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarycondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurveonsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarycurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundaryedgecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundaryfacecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarynodecondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundarynodeconditionwarping",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboundingbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchalfspacesolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcboxedhalfspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialstructureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuilding",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementcomponent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementpart",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementcomponenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementparttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementproxy",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingelementproxytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingstorey",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcbuildingsystem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcburner",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcburnertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowfitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarrierfitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarrierfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowsegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarriersegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowsegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablecarriersegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablefitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablefittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablesegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccablesegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesianpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesianpointlist",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesianpointlist2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesianpointlist3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator2dnonuniform",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccartesiantransformationoperator3dnonuniform",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccenterlineprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchiller",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchillertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchimney",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcchimneytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconic",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccircle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccircleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccirclehollowprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccivilelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccivilelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclassificationreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectedfaceset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcclosedshell",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoil",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoiltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourspecification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourrgb",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolourrgblist",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumn",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumnstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccolumntype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccommunicationsappliance",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccommunicationsappliancetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyabstraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccomplexproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertydefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertytemplatedefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertytemplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccomplexpropertytemplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositecurvesegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompositeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmovingdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompressor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmovingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccompressortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccondenser",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccondensertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectiongeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectioncurvegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionpointgeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionpointeccentricity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionsurfacegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconnectionvolumegeometry",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstraint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionequipmentresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctyperesource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionequipmentresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionmaterialresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionmaterialresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionproductresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconstructionproductresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcnamedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontextdependentunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontroller",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccontrollertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconversionbasedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcconversionbasedunitwithoffset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccooledbeam",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccooledbeamtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoolingtower",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoolingtowertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoordinateoperation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoordinatereferencesystem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccostvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccovering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccoveringtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccrewresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccrewresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccsgsolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurrencyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurtainwall",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurtainwalltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurveboundedplane",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurveboundedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefontandscaling",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccurvestylefontpattern",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementarysurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifccylindricalsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdamper",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdampertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcderivedunitelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdimensionalexponents",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdirection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiscreteaccessory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdiscreteaccessorytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionchamberelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionchamberelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionsystem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributioncircuit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcport",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdistributionport",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentinformationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdocumentreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysetdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedpropertyset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorliningproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorpanelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoorstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdoortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefineditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedcolour",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedcolour",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedcurvefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcdraughtingpredefinedcurvefont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductfitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductfittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowtreatmentdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsilencer",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowtreatmentdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcductsilencertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcedgeloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricappliance",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricappliancetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricdistributionboard",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricdistributionboardtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowstoragedevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricflowstoragedevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowstoragedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricflowstoragedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricgenerator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricgeneratortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricmotor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectricmotortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectrictimecontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelectrictimecontroltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementassembly",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementassemblytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcelementquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcellipse",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcellipseprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcengine",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcenginetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporativecooler",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporativecoolertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevaporatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcevent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcschedulingtime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifceventtime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctypeprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifceventtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextendedproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalreferencerelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalspatialstructureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternalspatialelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedhatchstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedsurfacestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcexternallydefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextrudedareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcextrudedareasolidtapered",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacebasedsurfacemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacebound",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfaceouterbound",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacetedbrep",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfacetedbrepwithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfailureconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfan",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfantype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfastener",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfastenertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelementaddition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfeatureelementsubtraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastylehatching",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfillareastyletiles",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfilter",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiltertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiresuppressionterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfiresuppressionterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfixedreferencesweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowinstrument",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowinstrumenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmeter",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcflowmetertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfooting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfootingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnishingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnishingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurniture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcfurnituretype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeographicelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeographicelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometriccurveset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgeometricrepresentationsubcontext",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgrid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgridaxis",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjectplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcgridplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcheatexchanger",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcheatexchangertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchumidifier",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifchumidifiertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcishapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcimagetexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcindexedcolourmap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcindexedpolycurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctessellateditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcindexedpolygonalface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcindexedpolygonalfacewithvoids",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturecoordinate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcindexedtexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcindexedtriangletexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcinterceptor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcinterceptortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacecurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcintersectioncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcinventory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcirregulartimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcirregulartimeseriesvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcjunctionbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcjunctionboxtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclaborresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclaborresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclagtime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclamp",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclamptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclibraryinformation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclibraryreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightdistributiondata",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightfixture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightfixturetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightintensitydistribution",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourceambient",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcedirectional",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcegoniometric",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcepositional",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclightsourcespot",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcline",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifclocalplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmapconversion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmappeditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialdefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterial",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialclassificationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialconstituent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialconstituentset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialdefinitionrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayer",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayerset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialusagedefinition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayersetusage",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallayerwithoffsets",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmateriallist",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialprofile",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialprofileset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialprofilesetusage",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialprofilesetusagetapering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialprofilewithoffsets",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmaterialrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmeasurewithunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalfastener",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmechanicalfastenertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmedicaldevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmedicaldevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmemberstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmembertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmetric",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmirroredprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmonetaryunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmotorconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcmotorconnectiontype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcobjective",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoccupant",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoffsetcurve2d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoffsetcurve3d",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopenshell",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopeningelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcopeningstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorganization",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorganizationrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcorientededge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcouterboundarycurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoutlet",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcoutlettype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcownerhistory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpath",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcperformancehistory",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpermeablecoveringproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpermit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcperson",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpersonandorganization",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalcomplexquantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcphysicalsimplequantity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpile",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpiletype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipefitting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipefittingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipesegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpipesegmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpixeltexture",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplanarextent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplanarbox",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplane",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplatestandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcplatetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpointoncurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpointonsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolyloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolygonalboundedhalfspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctessellatedfaceset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolygonalfaceset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpolyline",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpostaladdress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpredefinedtextfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationlayerassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationlayerwithstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpresentationstyleassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprocedure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproceduretype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproductdefinitionshape",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprofileproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectlibrary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectorder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectedcrs",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprojectionelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsimpleproperty",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyboundedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertydependencyrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyenumeratedvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyenumeration",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertylistvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyreferencevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertyset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysettemplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertysinglevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpropertytablevalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprotectivedevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprotectivedevicetrippingunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprotectivedevicetrippingunittype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcprotectivedevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcproxy",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpump",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcpumptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitycount",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitylength",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantitytime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityvolume",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcquantityweight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrailing",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrailingtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcramp",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrampflight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrampflighttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcramptype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrationalbsplinecurvewithknots",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrationalbsplinesurfacewithknots",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectanglehollowprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangularpyramid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrectangulartrimmedsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrecurrencepattern",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreference",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcregulartimeseries",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcementbarproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcementdefinitionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingbar",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingbartype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingmesh",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreinforcingmeshtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldecomposes",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelaggregates",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassigns",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstocontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstogroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstogroupbyfactor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoprocess",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoproduct",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassignstoresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociates",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesapproval",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesclassification",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesconstraint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesdocument",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociateslibrary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelassociatesmaterial",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnects",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectselements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectspathelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsporttoelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsports",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralactivity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectsstructuralmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectswitheccentricity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelconnectswithrealizingelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcontainedinspatialstructure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcoversbldgelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelcoversspaces",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldeclares",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefines",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbyobject",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbyproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbytemplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreldefinesbytype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelfillselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelflowcontrolelements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelinterfereselements",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelnests",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelprojectselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelreferencedinspatialstructure",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelsequence",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelservicesbuildings",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelspaceboundary",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelspaceboundary1stlevel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelspaceboundary2ndlevel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrelvoidselement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcreparametrisedcompositecurvesegment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrepresentationmap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresourceapprovalrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresourceconstraintrelationship",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcresourcetime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrevolvedareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrevolvedareasolidtapered",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrightcircularcone",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrightcircularcylinder",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroof",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcrooftype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcroundedrectangleprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsiunit",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsanitaryterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsanitaryterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcseamcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionreinforcementproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsectionedspine",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsensor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsensortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshadingdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshadingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshapeaspect",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshapemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshaperepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcshellbasedsurfacemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsimplepropertytemplate",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsite",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslab",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslabelementedcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslabstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslabtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcslippageconnectioncondition",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsolardevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsolardevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspace",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspaceheater",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspaceheatertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialstructureelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspacetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialzone",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcspatialzonetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsphere",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsphericalsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstackterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstackterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstair",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairflight",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairflighttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstairtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralactivity",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralanalysismodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralitem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurveaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurveconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralmember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvemember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvemembervarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralreaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralcurvereaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructurallinearaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralload",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadconfiguration",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadorresult",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadstatic",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadlinearforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadplanarforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingledisplacement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingledisplacementdistortion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingleforce",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadsingleforcewarping",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralloadtemperature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfaceaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralplanaraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralpointreaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralresultgroup",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfaceconnection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacemember",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacemembervarying",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstructuralsurfacereaction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstylemodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstyleditem",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcstyledrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubcontractresource",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubcontractresourcetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsubedge",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacecurvesweptareasolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacefeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfaceoflinearextrusion",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfaceofrevolution",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacereinforcementarea",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylelighting",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylerefraction",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestyleshading",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylerendering",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsurfacestylewithtextures",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptdisksolid",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsweptdisksolidpolygonal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcswitchingdevice",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcswitchingdevicetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystemfurnitureelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcsystemfurnitureelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctable",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctablecolumn",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctablerow",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctank",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctanktype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctask",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctasktime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctasktimerecurring",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctasktype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctelecomaddress",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendon",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendonanchor",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendonanchortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctendontype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextliteral",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextliteralwithextent",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylefontmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstylefordefinedfont",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctextstyletextmodel",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturecoordinategenerator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturemap",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturevertex",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctexturevertexlist",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeperiod",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctimeseriesvalue",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctopologyrepresentation",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctoroidalsurface",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransformer",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransformertype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransportelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctransportelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctrapeziumprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctriangulatedfaceset",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctrimmedcurve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctubebundle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifctubebundletype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcushapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitassignment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitarycontrolelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitarycontrolelementtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitaryequipment",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcunitaryequipmenttype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvalve",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvalvetype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvector",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertex",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexloop",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvertexpoint",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvibrationisolator",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvibrationisolatortype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvirtualelement",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvirtualgridintersection",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcvoidingfeature",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwall",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwallelementedcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwallstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwalltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwasteterminal",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwasteterminaltype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindow",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowliningproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowpanelproperties",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowstandardcase",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowstyle",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcwindowtype",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkcalendar",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkcontrol",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkplan",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworkschedule",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifcworktime",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifczshapeprofiledef",&STEP::ObjectHelper::Construct ) +, SchemaEntry("ifczone",&STEP::ObjectHelper::Construct ) + + }; +} + +// ----------------------------------------------------------------------------------------------------------- +void IFC::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, IfcRoot* in) +{ + size_t base = 0; + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRoot"); } do { // convert the 'GlobalId' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->GlobalId, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRoot to be a `IfcGloballyUniqueId`")); } + } while(0); + do { // convert the 'OwnerHistory' argument + boost::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->OwnerHistory, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRoot to be a `IfcOwnerHistory`")); } + } while(0); + do { // convert the 'Name' argument + boost::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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRoot to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Description' argument + boost::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->Description, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRoot to be a `IfcText`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcObjectDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcObject"); } do { // convert the 'ObjectType' argument + boost::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->ObjectType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcObject to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActionRequest* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProduct* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcProduct"); } do { // convert the 'ObjectPlacement' argument + boost::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->ObjectPlacement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcProduct to be a `IfcObjectPlacement`")); } + } while(0); + do { // convert the 'Representation' argument + boost::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->Representation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcProduct to be a `IfcProductRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcElement"); } do { // convert the 'Tag' argument + boost::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->Tag, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcElement to be a `IfcIdentifier`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActuator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeObject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeProduct* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionControlElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcActuatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationItem* in) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSolidModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcManifoldSolidBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcManifoldSolidBrep"); } do { // convert the 'Outer' argument + boost::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 0 to IfcManifoldSolidBrep to be a `IfcClosedShell`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAdvancedBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAdvancedBrepWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologicalRepresentationItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFace"); } do { // convert the 'Bounds' argument + boost::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 0 to IfcFace to be a `SET [1:?] OF IfcFaceBound`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAdvancedFace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowController* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionFlowElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowControllerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalBoxType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirToAirHeatRecovery* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEnergyConversionDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAirToAirHeatRecoveryType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAlarm* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAlarmType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcAnnotation"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAnnotationFillArea* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProfileDef* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProfileDef"); } do { // convert the 'ProfileType' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ProfileType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProfileDef to be a `IfcProfileTypeEnum`")); } + } while(0); + do { // convert the 'ProfileName' argument + boost::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->ProfileName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcProfileDef to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryClosedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryClosedProfileDef"); } do { // convert the 'OuterCurve' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->OuterCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryClosedProfileDef to be a `IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryOpenProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcArbitraryOpenProfileDef"); } do { // convert the 'Curve' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Curve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcArbitraryOpenProfileDef to be a `IfcBoundedCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcArbitraryProfileDefWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcArbitraryProfileDefWithVoids"); } do { // convert the 'InnerCurves' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->InnerCurves, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcArbitraryProfileDefWithVoids to be a `SET [1:?] OF IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsset* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcParameterizedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcParameterizedProfileDef"); } do { // convert the 'Position' argument + boost::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->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcParameterizedProfileDef to be a `IfcAxis2Placement2D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAsymmetricIShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAudioVisualAppliance* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAudioVisualApplianceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlacement"); } do { // convert the 'Location' argument + boost::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 0 to IfcPlacement to be a `IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis1Placement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis1Placement"); } do { // convert the 'Axis' argument + boost::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 1 to IfcAxis1Placement to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcAxis2Placement2D"); } do { // convert the 'RefDirection' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcAxis2Placement2D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcAxis2Placement3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcAxis2Placement3D"); } do { // convert the 'Axis' argument + boost::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 1 to IfcAxis2Placement3D to be a `IfcDirection`")); } + } while(0); + do { // convert the 'RefDirection' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcAxis2Placement3D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcBSplineCurve"); } do { // convert the 'Degree' argument + boost::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 0 to IfcBSplineCurve to be a `IfcInteger`")); } + } while(0); + do { // convert the 'ControlPointsList' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->ControlPointsList, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBSplineCurve to be a `LIST [2:?] OF IfcCartesianPoint`")); } + } while(0); + do { // convert the 'CurveForm' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->CurveForm, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBSplineCurve to be a `IfcBSplineCurveForm`")); } + } while(0); + do { // convert the 'ClosedCurve' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->ClosedCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBSplineCurve to be a `IfcLogical`")); } + } while(0); + do { // convert the 'SelfIntersect' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[4]=true; break; } + try { GenericConvert( in->SelfIntersect, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcBSplineCurve to be a `IfcLogical`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineCurveWithKnots* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBSplineSurfaceWithKnots* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcBuildingElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeam* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeamStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBeamType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationItem* in) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgPrimitive3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBlock* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoiler* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoilerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanResult* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanResult"); } do { // convert the 'Operator' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->Operator, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcBooleanResult to be a `IfcBooleanOperator`")); } + } while(0); + do { // convert the 'FirstOperand' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->FirstOperand, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBooleanResult to be a `IfcBooleanOperand`")); } + } while(0); + do { // convert the 'SecondOperand' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->SecondOperand, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBooleanResult to be a `IfcBooleanOperand`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBooleanClippingResult* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcBooleanClippingResult"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCompositeCurve"); } do { // convert the 'Segments' argument + boost::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 0 to IfcCompositeCurve to be a `LIST [1:?] OF IfcCompositeCurveSegment`")); } + } while(0); + do { // convert the 'SelfIntersect' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->SelfIntersect, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurve to be a `IfcLogical`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurveOnSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundaryCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoundingBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcBoundingBox"); } do { // convert the 'Corner' argument + boost::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 IfcBoundingBox to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'XDim' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->XDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'YDim' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->YDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'ZDim' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->ZDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcBoundingBox to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHalfSpaceSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcHalfSpaceSolid"); } do { // convert the 'BaseSurface' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->BaseSurface, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcHalfSpaceSolid to be a `IfcSurface`")); } + } while(0); + do { // convert the 'AgreementFlag' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->AgreementFlag, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcHalfSpaceSolid to be a `IfcBoolean`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBoxedHalfSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcSpatialElement"); } do { // convert the 'LongName' argument + boost::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->LongName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSpatialElement to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSpatialStructureElement"); } do { // convert the 'CompositionType' argument + boost::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->CompositionType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSpatialStructureElement to be a `IfcElementCompositionEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuilding* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 12) { throw STEP::TypeError("expected 12 arguments to IfcBuilding"); } do { // convert the 'ElevationOfRefHeight' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationOfRefHeight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcBuilding to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'ElevationOfTerrain' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationOfTerrain, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcBuilding to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'BuildingAddress' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->BuildingAddress, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcBuilding to be a `IfcPostalAddress`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementPart* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementComponentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementPartType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxy* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingElementProxyType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingStorey* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBuildingSystem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBurner* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcBurnerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableCarrierSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCableSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcCartesianPoint"); } do { // convert the 'Coordinates' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Coordinates, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcCartesianPoint to be a `LIST [1:3] OF IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPointList* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPointList2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianPointList3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCartesianTransformationOperator"); } do { // convert the 'Axis1' argument + boost::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 IfcCartesianTransformationOperator to be a `IfcDirection`")); } + } while(0); + do { // convert the 'Axis2' argument + boost::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 IfcCartesianTransformationOperator to be a `IfcDirection`")); } + } while(0); + do { // convert the 'LocalOrigin' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->LocalOrigin, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCartesianTransformationOperator to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'Scale' argument + boost::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 IfcCartesianTransformationOperator to be a `IfcReal`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator2DnonUniform* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCartesianTransformationOperator3D"); } do { // convert the 'Axis3' argument + boost::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->Axis3, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCartesianTransformationOperator3D to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCartesianTransformationOperator3DnonUniform* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 7) { throw STEP::TypeError("expected 7 arguments to IfcCartesianTransformationOperator3DnonUniform"); } do { // convert the 'Scale2' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcCartesianTransformationOperator3DnonUniform to be a `IfcReal`")); } + } while(0); + do { // convert the 'Scale3' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Scale3, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcCartesianTransformationOperator3DnonUniform to be a `IfcReal`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCenterLineProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChiller* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChillerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChimney* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcChimneyType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConic* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConic"); } do { // convert the 'Position' argument + boost::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 0 to IfcConic to be a `IfcAxis2Placement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcCircle"); } do { // convert the 'Radius' argument + boost::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 IfcCircle to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcCircleProfileDef"); } do { // convert the 'Radius' argument + boost::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 3 to IfcCircleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCircleHollowProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcCircleHollowProfileDef"); } do { // convert the 'WallThickness' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->WallThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcCircleHollowProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCivilElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCivilElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConnectedFaceSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcConnectedFaceSet"); } do { // convert the 'CfsFaces' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->CfsFaces, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcConnectedFaceSet to be a `SET [1:?] OF IfcFace`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcClosedShell* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcClosedShell"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoil* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoilType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourSpecification* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcColourSpecification"); } do { // convert the 'Name' argument + boost::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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcColourSpecification to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColourRgb* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcColourRgb"); } do { // convert the 'Red' argument + boost::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 IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + do { // convert the 'Green' argument + boost::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 IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + do { // convert the 'Blue' argument + boost::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 IfcColourRgb to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumn* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumnStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcColumnType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCommunicationsAppliance* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCommunicationsApplianceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyAbstraction* in) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcProperty"); } do { // convert the 'Name' argument + boost::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 IfcProperty to be a `IfcIdentifier`")); } + } while(0); + do { // convert the 'Description' argument + boost::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 IfcProperty to be a `IfcText`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcComplexProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcComplexProperty"); } do { // convert the 'UsageName' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->UsageName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcComplexProperty to be a `IfcIdentifier`")); } + } while(0); + do { // convert the 'HasProperties' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->HasProperties, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcComplexProperty to be a `SET [1:?] OF IfcProperty`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeCurveSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcCompositeCurveSegment"); } do { // convert the 'Transition' argument + boost::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 IfcCompositeCurveSegment to be a `IfcTransitionCode`")); } + } while(0); + do { // convert the 'SameSense' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->SameSense, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcCompositeCurveSegment to be a `IfcBoolean`")); } + } while(0); + do { // convert the 'ParentCurve' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->ParentCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcCompositeCurveSegment to be a `IfcCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompositeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompressor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMovingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCompressorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondenser* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCondenserType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionEquipmentResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionEquipmentResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionMaterialResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionMaterialResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionProductResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConstructionProductResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcContext"); } do { // convert the 'ObjectType' argument + boost::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->ObjectType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcContext to be a `IfcLabel`")); } + } while(0); + do { // convert the 'LongName' argument + boost::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->LongName, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcContext to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Phase' argument + boost::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->Phase, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcContext to be a `IfcLabel`")); } + } while(0); + do { // convert the 'RepresentationContexts' argument + boost::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->RepresentationContexts, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcContext to be a `SET [1:?] OF IfcRepresentationContext`")); } + } while(0); + do { // convert the 'UnitsInContext' argument + boost::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->UnitsInContext, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcContext to be a `IfcUnitAssignment`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcNamedUnit* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcNamedUnit"); } do { // convert the 'Dimensions' argument + boost::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 IfcNamedUnit to be a `IfcDimensionalExponents`")); } + } while(0); + do { // convert the 'UnitType' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->UnitType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcNamedUnit to be a `IfcUnitEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcContextDependentUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcController* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcControllerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConversionBasedUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcConversionBasedUnit"); } do { // convert the 'Name' argument + boost::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 2 to IfcConversionBasedUnit to be a `IfcLabel`")); } + } while(0); + do { // convert the 'ConversionFactor' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->ConversionFactor, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcConversionBasedUnit to be a `IfcMeasureWithUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcConversionBasedUnitWithOffset* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCooledBeam* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCooledBeamType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoolingTower* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoolingTowerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCostSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCovering* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCoveringType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCrewResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCrewResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCsgSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWall* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurtainWallType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurveBoundedPlane* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCurveBoundedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyle* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyle"); } do { // convert the 'Name' argument + boost::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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyle to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementarySurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcElementarySurface"); } do { // convert the 'Position' argument + boost::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 0 to IfcElementarySurface to be a `IfcAxis2Placement3D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcCylindricalSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDamper* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDamperType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDerivedProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDirection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcDirection"); } do { // convert the 'DirectionRatios' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->DirectionRatios, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcDirection to be a `LIST [2:3] OF IfcReal`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDiscreteAccessoryType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionChamberElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionSystem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionCircuit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPort* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDistributionPort* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 13) { throw STEP::TypeError("expected 13 arguments to IfcDoor"); } do { // convert the 'OverallHeight' argument + boost::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->OverallHeight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'OverallWidth' argument + boost::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->OverallWidth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcDoor to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'PredefinedType' argument + boost::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->PredefinedType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcDoor to be a `IfcDoorTypeEnum`")); } + } while(0); + do { // convert the 'OperationType' argument + boost::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->OperationType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcDoor to be a `IfcDoorTypeOperationEnum`")); } + } while(0); + do { // convert the 'UserDefinedOperationType' argument + boost::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->UserDefinedOperationType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcDoor to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySetDefinition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySetDefinition"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoorStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoorStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDoorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSilencer* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowTreatmentDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcDuctSilencerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEdgeLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricAppliance* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricApplianceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricDistributionBoard* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricDistributionBoardType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricFlowStorageDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowStorageDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricFlowStorageDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricGenerator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricGeneratorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricMotor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricMotorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricTimeControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElectricTimeControlType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementAssembly* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementAssemblyType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcQuantitySet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcQuantitySet"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcElementQuantity* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcElementQuantity"); } do { // convert the 'MethodOfMeasurement' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->MethodOfMeasurement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcElementQuantity to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Quantities' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Quantities, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcElementQuantity to be a `SET [1:?] OF IfcPhysicalQuantity`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipse* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcEllipse"); } do { // convert the 'SemiAxis1' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->SemiAxis1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'SemiAxis2' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->SemiAxis2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcEllipse to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEllipseProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEngine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEngineType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporativeCooler* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporativeCoolerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvaporatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcess* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEvent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTypeProcess* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcEventType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcExternalSpatialStructureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcExternalSpatialElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSweptAreaSolid"); } do { // convert the 'SweptArea' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->SweptArea, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSweptAreaSolid to be a `IfcProfileDef`")); } + } while(0); + do { // convert the 'Position' argument + boost::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->Position, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptAreaSolid to be a `IfcAxis2Placement3D`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcExtrudedAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcExtrudedAreaSolid"); } do { // convert the 'ExtrudedDirection' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ExtrudedDirection, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcExtrudedAreaSolid to be a `IfcDirection`")); } + } while(0); + do { // convert the 'Depth' argument + boost::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 IfcExtrudedAreaSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcExtrudedAreaSolidTapered* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBasedSurfaceModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcFaceBasedSurfaceModel"); } do { // convert the 'FbsmFaces' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->FbsmFaces, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcFaceBasedSurfaceModel to be a `SET [1:?] OF IfcConnectedFaceSet`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceBound* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceBound"); } do { // convert the 'Bound' argument + boost::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 0 to IfcFaceBound to be a `IfcLoop`")); } + } while(0); + do { // convert the 'Orientation' argument + boost::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 1 to IfcFaceBound to be a `IfcBoolean`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFaceOuterBound* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcFaceOuterBound"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrep* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFacetedBrepWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFan* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFanType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastener* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFastenerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElement"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementAddition* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFeatureElementSubtraction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 8) { throw STEP::TypeError("expected 8 arguments to IfcFeatureElementSubtraction"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleHatching* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFillAreaStyleTiles* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFilter* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFilterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFireSuppressionTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFireSuppressionTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFixedReferenceSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowInstrument* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowInstrumentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMeter* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFlowMeterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFooting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFootingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnishingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurniture* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcFurnitureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeographicElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeographicElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricCurveSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationContext* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationContext"); } do { // convert the 'ContextIdentifier' argument + boost::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->ContextIdentifier, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationContext to be a `IfcLabel`")); } + } while(0); + do { // convert the 'ContextType' argument + boost::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->ContextType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationContext to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcGeometricRepresentationContext"); } do { // convert the 'CoordinateSpaceDimension' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->CoordinateSpaceDimension, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcGeometricRepresentationContext to be a `IfcDimensionCount`")); } + } while(0); + do { // convert the 'Precision' argument + boost::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->Precision, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcGeometricRepresentationContext to be a `IfcReal`")); } + } while(0); + do { // convert the 'WorldCoordinateSystem' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->WorldCoordinateSystem, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcGeometricRepresentationContext to be a `IfcAxis2Placement`")); } + } while(0); + do { // convert the 'TrueNorth' argument + boost::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->TrueNorth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcGeometricRepresentationContext to be a `IfcDirection`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGeometricRepresentationSubContext* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGrid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcObjectPlacement* in) +{ + size_t base = 0; + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcGridPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHeatExchanger* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHeatExchangerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHumidifier* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcHumidifierType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 10) { throw STEP::TypeError("expected 10 arguments to IfcIShapeProfileDef"); } do { // convert the 'OverallWidth' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->OverallWidth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'OverallDepth' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->OverallDepth, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'WebThickness' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->WebThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'FlangeThickness' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->FlangeThickness, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcIShapeProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'FilletRadius' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->FilletRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcIShapeProfileDef to be a `IfcNonNegativeLengthMeasure`")); } + } while(0); + do { // convert the 'FlangeEdgeRadius' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->FlangeEdgeRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcIShapeProfileDef to be a `IfcNonNegativeLengthMeasure`")); } + } while(0); + do { // convert the 'FlangeSlope' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->FlangeSlope, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcIShapeProfileDef to be a `IfcPlaneAngleMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIndexedPolyCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTessellatedItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIndexedPolygonalFace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIndexedPolygonalFaceWithVoids* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcInterceptor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcInterceptorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcIntersectionCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcInventory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcJunctionBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcJunctionBoxType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLaborResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLaborResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLamp* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLampType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightFixture* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightFixtureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceAmbient* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceDirectional* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceGoniometric* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourcePositional* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLightSourceSpot* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLine"); } do { // convert the 'Pnt' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Pnt, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLine to be a `IfcCartesianPoint`")); } + } while(0); + do { // convert the 'Dir' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Dir, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLine to be a `IfcVector`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcLocalPlacement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcLocalPlacement"); } do { // convert the 'PlacementRelTo' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->PlacementRelTo, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcLocalPlacement to be a `IfcObjectPlacement`")); } + } while(0); + do { // convert the 'RelativePlacement' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelativePlacement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcLocalPlacement to be a `IfcAxis2Placement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMappedItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMappedItem"); } do { // convert the 'MappingSource' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingSource, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMappedItem to be a `IfcRepresentationMap`")); } + } while(0); + do { // convert the 'MappingTarget' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingTarget, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMappedItem to be a `IfcCartesianTransformationOperator`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductRepresentation* in) +{ + size_t base = 0; + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcProductRepresentation"); } do { // convert the 'Name' argument + boost::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->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcProductRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Description' argument + boost::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 IfcProductRepresentation to be a `IfcText`")); } + } while(0); + do { // convert the 'Representations' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[2]=true; break; } + try { GenericConvert( in->Representations, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcProductRepresentation to be a `LIST [1:?] OF IfcRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMaterialDefinitionRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMeasureWithUnit* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcMeasureWithUnit"); } do { // convert the 'ValueComponent' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->ValueComponent, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcMeasureWithUnit to be a `IfcValue`")); } + } while(0); + do { // convert the 'UnitComponent' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->UnitComponent, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcMeasureWithUnit to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastener* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMechanicalFastenerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMedicalDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMedicalDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMemberStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMemberType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMirroredProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMotorConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcMotorConnectionType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOccupant* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve2D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOffsetCurve3D* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpenShell* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpeningElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcOpeningElement"); } do { // convert the 'PredefinedType' argument + boost::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->PredefinedType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcOpeningElement to be a `IfcOpeningElementTypeEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOpeningStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOrientedEdge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOuterBoundaryCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOutlet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcOutletType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPath* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPcurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPerformanceHistory* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPermit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPile* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPileType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeFitting* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeFittingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPipeSegmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarExtent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlanarBox* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlane* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPlane"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlate* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlateStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPlateType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPointOnSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyLoop"); } do { // convert the 'Polygon' argument + boost::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 IfcPolyLoop to be a `LIST [3:?] OF IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolygonalBoundedHalfSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPolygonalBoundedHalfSpace"); } do { // convert the 'Position' argument + boost::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 IfcPolygonalBoundedHalfSpace to be a `IfcAxis2Placement3D`")); } + } while(0); + do { // convert the 'PolygonalBoundary' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->PolygonalBoundary, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPolygonalBoundedHalfSpace to be a `IfcBoundedCurve`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTessellatedFaceSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolygonalFaceSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPolyline* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPolyline"); } do { // convert the 'Points' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Points, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPolyline to be a `LIST [2:?] OF IfcCartesianPoint`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPresentationStyleAssignment* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcPresentationStyleAssignment"); } do { // convert the 'Styles' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Styles, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcPresentationStyleAssignment to be a `SET [1:?] OF IfcPresentationStyleSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcedure* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProcedureType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProductDefinitionShape* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProject* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcProject"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectLibrary* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectOrder* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProjectionElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSimpleProperty* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSimpleProperty"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyBoundedValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyEnumeratedValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyListValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertyListValue"); } do { // convert the 'ListValues' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ListValues, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertyListValue to be a `LIST [1:?] OF IfcValue`")); } + } while(0); + do { // convert the 'Unit' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Unit, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertyListValue to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyReferenceValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcPropertySet"); } do { // convert the 'HasProperties' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->HasProperties, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcPropertySet to be a `SET [1:?] OF IfcProperty`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertySingleValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcPropertySingleValue"); } do { // convert the 'NominalValue' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->NominalValue, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcPropertySingleValue to be a `IfcValue`")); } + } while(0); + do { // convert the 'Unit' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Unit, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcPropertySingleValue to be a `IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPropertyTableValue* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDeviceTrippingUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDeviceTrippingUnitType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProtectiveDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcProxy* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPump* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcPumpType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailing* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRailingType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRamp* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlight* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampFlightType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRampType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRationalBSplineCurveWithKnots* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRationalBSplineSurfaceWithKnots* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcRectangleProfileDef"); } do { // convert the 'XDim' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->XDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'YDim' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->YDim, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRectangleProfileDef to be a `IfcPositiveLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangleHollowProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularPyramid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRectangularTrimmedSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingBar* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingBarType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingMesh* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReinforcingMeshType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelationship* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelationship"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDecomposes* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelDecomposes"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelAggregates* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelAggregates"); } do { // convert the 'RelatingObject' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingObject, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelAggregates to be a `IfcObjectDefinition`")); } + } while(0); + do { // convert the 'RelatedObjects' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedObjects, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelAggregates to be a `SET [1:?] OF IfcObjectDefinition`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelConnects* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelConnects"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelContainedInSpatialStructure* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelContainedInSpatialStructure"); } do { // convert the 'RelatedElements' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedElements, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelContainedInSpatialStructure to be a `SET [1:?] OF IfcProduct`")); } + } while(0); + do { // convert the 'RelatingStructure' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingStructure, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelContainedInSpatialStructure to be a `IfcSpatialElement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefines* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRelDefines"); } return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelDefinesByProperties* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelDefinesByProperties"); } do { // convert the 'RelatedObjects' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedObjects, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelDefinesByProperties to be a `SET [1:?] OF IfcObjectDefinition`")); } + } while(0); + do { // convert the 'RelatingPropertyDefinition' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingPropertyDefinition, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelDefinesByProperties to be a `IfcPropertySetDefinitionSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelFillsElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelFillsElement"); } do { // convert the 'RelatingOpeningElement' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingOpeningElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelFillsElement to be a `IfcOpeningElement`")); } + } while(0); + do { // convert the 'RelatedBuildingElement' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedBuildingElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelFillsElement to be a `IfcElement`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRelVoidsElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 6) { throw STEP::TypeError("expected 6 arguments to IfcRelVoidsElement"); } do { // convert the 'RelatingBuildingElement' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatingBuildingElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcRelVoidsElement to be a `IfcElement`")); } + } while(0); + do { // convert the 'RelatedOpeningElement' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->RelatedOpeningElement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcRelVoidsElement to be a `IfcFeatureElementSubtraction`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcReparametrisedCompositeCurveSegment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentation* in) +{ + size_t base = 0; + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRepresentation"); } do { // convert the 'ContextOfItems' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->ContextOfItems, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentation to be a `IfcRepresentationContext`")); } + } while(0); + do { // convert the 'RepresentationIdentifier' argument + boost::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->RepresentationIdentifier, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'RepresentationType' argument + boost::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->RepresentationType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcRepresentation to be a `IfcLabel`")); } + } while(0); + do { // convert the 'Items' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[3]=true; break; } + try { GenericConvert( in->Items, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcRepresentation to be a `SET [1:?] OF IfcRepresentationItem`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRepresentationMap* in) +{ + size_t base = 0; + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcRepresentationMap"); } do { // convert the 'MappingOrigin' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappingOrigin, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcRepresentationMap to be a `IfcAxis2Placement`")); } + } while(0); + do { // convert the 'MappedRepresentation' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->MappedRepresentation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcRepresentationMap to be a `IfcRepresentation`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRevolvedAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcRevolvedAreaSolid"); } do { // convert the 'Axis' argument + boost::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 IfcRevolvedAreaSolid to be a `IfcAxis1Placement`")); } + } while(0); + do { // convert the 'Angle' argument + boost::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 IfcRevolvedAreaSolid to be a `IfcPlaneAngleMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRevolvedAreaSolidTapered* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRightCircularCylinder* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoof* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoofType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcRoundedRectangleProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSIUnit* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 4) { throw STEP::TypeError("expected 4 arguments to IfcSIUnit"); } do { // convert the 'Prefix' argument + boost::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 2 to IfcSIUnit to be a `IfcSIPrefix`")); } + } while(0); + do { // convert the 'Name' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSIUnit to be a `IfcSIUnitName`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSanitaryTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSanitaryTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSeamCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSectionedSpine* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSensor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSensorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShadingDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShadingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShapeRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcShellBasedSurfaceModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcShellBasedSurfaceModel"); } do { // convert the 'SbsmBoundary' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->SbsmBoundary, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcShellBasedSurfaceModel to be a `SET [1:?] OF IfcShell`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSite* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 14) { throw STEP::TypeError("expected 14 arguments to IfcSite"); } do { // convert the 'RefLatitude' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefLatitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } + } while(0); + do { // convert the 'RefLongitude' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefLongitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSite to be a `IfcCompoundPlaneAngleMeasure`")); } + } while(0); + do { // convert the 'RefElevation' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->RefElevation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 11 to IfcSite to be a `IfcLengthMeasure`")); } + } while(0); + do { // convert the 'LandTitleNumber' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->LandTitleNumber, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 12 to IfcSite to be a `IfcLabel`")); } + } while(0); + do { // convert the 'SiteAddress' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SiteAddress, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 13 to IfcSite to be a `IfcPostalAddress`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlab* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlabElementedCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlabStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSlabType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSolarDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSolarDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpace* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 11) { throw STEP::TypeError("expected 11 arguments to IfcSpace"); } do { // convert the 'PredefinedType' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->PredefinedType, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 9 to IfcSpace to be a `IfcSpaceTypeEnum`")); } + } while(0); + do { // convert the 'ElevationWithFlooring' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ElevationWithFlooring, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 10 to IfcSpace to be a `IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceHeater* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceHeaterType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialStructureElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpaceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialZone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSpatialZoneType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSphere* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSphericalSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStackTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStackTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStair* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlight* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairFlightType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStairType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralActivity* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralAnalysisModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveMemberVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralCurveReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLinearAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLoadGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralLoadCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPlanarAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointAction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralPointReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralResultGroup* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceConnection* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMember* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceMemberVarying* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStructuralSurfaceReaction* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyleModel* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledItem* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcStyledItem"); } do { // convert the 'Item' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Item, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcStyledItem to be a `IfcRepresentationItem`")); } + } while(0); + do { // convert the 'Styles' argument + boost::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 IfcStyledItem to be a `SET [1:?] OF IfcStyleAssignmentSelect`")); } + } while(0); + do { // convert the 'Name' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->Name, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcStyledItem to be a `IfcLabel`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcStyledRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubContractResource* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubContractResourceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSubedge* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceCurveSweptAreaSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfLinearExtrusion* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceOfRevolution* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 3) { throw STEP::TypeError("expected 3 arguments to IfcSurfaceStyle"); } do { // convert the 'Side' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Side, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyle to be a `IfcSurfaceSide`")); } + } while(0); + do { // convert the 'Styles' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Styles, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyle to be a `SET [1:5] OF IfcSurfaceStyleElementSelect`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleShading* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcSurfaceStyleShading"); } do { // convert the 'SurfaceColour' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[0]=true; break; } + try { GenericConvert( in->SurfaceColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleShading to be a `IfcColourRgb`")); } + } while(0); + do { // convert the 'Transparency' argument + boost::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->Transparency, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSurfaceStyleShading to be a `IfcNormalisedRatioMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleRendering* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 9) { throw STEP::TypeError("expected 9 arguments to IfcSurfaceStyleRendering"); } do { // convert the 'DiffuseColour' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->DiffuseColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'TransmissionColour' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->TransmissionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'DiffuseTransmissionColour' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->DiffuseTransmissionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'ReflectionColour' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->ReflectionColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 5 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'SpecularColour' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SpecularColour, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 6 to IfcSurfaceStyleRendering to be a `IfcColourOrFactor`")); } + } while(0); + do { // convert the 'SpecularHighlight' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) break; + try { GenericConvert( in->SpecularHighlight, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 7 to IfcSurfaceStyleRendering to be a `IfcSpecularHighlightSelect`")); } + } while(0); + do { // convert the 'ReflectanceMethod' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->ReflectanceMethod, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 8 to IfcSurfaceStyleRendering to be a `IfcReflectanceMethodEnum`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSurfaceStyleWithTextures* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcSurfaceStyleWithTextures"); } do { // convert the 'Textures' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Textures, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcSurfaceStyleWithTextures to be a `LIST [1:?] OF IfcSurfaceTexture`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptDiskSolid* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcSweptDiskSolid"); } do { // convert the 'Directrix' argument + boost::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 0 to IfcSweptDiskSolid to be a `IfcCurve`")); } + } while(0); + do { // convert the 'Radius' argument + boost::shared_ptr arg = params[base++]; + if (dynamic_cast(&*arg)) { in->ObjectHelper::aux_is_derived[1]=true; break; } + try { GenericConvert( in->Radius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'InnerRadius' argument + boost::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->InnerRadius, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcSweptDiskSolid to be a `IfcPositiveLengthMeasure`")); } + } while(0); + do { // convert the 'StartParam' argument + boost::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->StartParam, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } + } while(0); + do { // convert the 'EndParam' argument + boost::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->EndParam, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcSweptDiskSolid to be a `IfcParameterValue`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSweptDiskSolidPolygonal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSwitchingDevice* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSwitchingDeviceType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystemFurnitureElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcSystemFurnitureElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTank* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTankType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTask* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTaskType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendon* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendonAnchor* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendonAnchorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTendonType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteral* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTextLiteralWithExtent* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTopologyRepresentation* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcToroidalSurface* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransformer* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransformerType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTransportElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrapeziumProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTriangulatedFaceSet* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTrimmedCurve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 5) { throw STEP::TypeError("expected 5 arguments to IfcTrimmedCurve"); } do { // convert the 'BasisCurve' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->BasisCurve, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcTrimmedCurve to be a `IfcCurve`")); } + } while(0); + do { // convert the 'Trim1' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Trim1, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } + } while(0); + do { // convert the 'Trim2' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Trim2, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 2 to IfcTrimmedCurve to be a `SET [1:2] OF IfcTrimmingSelect`")); } + } while(0); + do { // convert the 'SenseAgreement' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->SenseAgreement, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 3 to IfcTrimmedCurve to be a `IfcBoolean`")); } + } while(0); + do { // convert the 'MasterRepresentation' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->MasterRepresentation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 4 to IfcTrimmedCurve to be a `IfcTrimmingPreference`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTubeBundle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcTubeBundleType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitAssignment* in) +{ + size_t base = 0; + if (params.GetSize() < 1) { throw STEP::TypeError("expected 1 arguments to IfcUnitAssignment"); } do { // convert the 'Units' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Units, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcUnitAssignment to be a `SET [1:?] OF IfcUnit`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryControlElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryControlElementType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryEquipment* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcUnitaryEquipmentType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcValve* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcValveType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVector* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); + if (params.GetSize() < 2) { throw STEP::TypeError("expected 2 arguments to IfcVector"); } do { // convert the 'Orientation' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Orientation, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 0 to IfcVector to be a `IfcDirection`")); } + } while(0); + do { // convert the 'Magnitude' argument + boost::shared_ptr arg = params[base++]; + try { GenericConvert( in->Magnitude, arg, db ); break; } + catch (const TypeError& t) { throw TypeError(t.what() + std::string(" - expected argument 1 to IfcVector to be a `IfcLengthMeasure`")); } + } while(0); + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertex* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexLoop* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVertexPoint* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVibrationIsolator* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVibrationIsolatorType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVirtualElement* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcVoidingFeature* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWall* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallElementedCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWallType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWasteTerminal* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWasteTerminalType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindow* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindowStandardCase* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindowStyle* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWindowType* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkCalendar* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkControl* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkPlan* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcWorkSchedule* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcZShapeProfileDef* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} +// ----------------------------------------------------------------------------------------------------------- +template <> size_t GenericFill(const DB& db, const LIST& params, IfcZone* in) +{ + size_t base = GenericFill(db,params,static_cast(in)); +// this data structure is not used yet, so there is no code generated to fill its members + return base; +} + +} // ! STEP +} // ! Assimp + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.h b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.h new file mode 100644 index 000000000..ccfcb6ea0 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCReaderGen_4.h @@ -0,0 +1,5452 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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_IFC_READER_GEN_H +#define INCLUDED_IFC_READER_GEN_H + +#include "STEPFile.h" + +namespace Assimp { +namespace IFC { +namespace Schema_4 { + + using namespace STEP; + using namespace STEP::EXPRESS; + + + struct NotImplemented : public ObjectHelper { + + }; + + + // ****************************************************************************** + // IFC Custom data types + // ****************************************************************************** + + + // C++ wrapper type for IfcStrippedOptional + typedef BOOLEAN IfcStrippedOptional; + // C++ wrapper type for IfcAbsorbedDoseMeasure + typedef REAL IfcAbsorbedDoseMeasure; + // C++ wrapper type for IfcAccelerationMeasure + typedef REAL IfcAccelerationMeasure; + // C++ wrapper type for IfcAmountOfSubstanceMeasure + typedef REAL IfcAmountOfSubstanceMeasure; + // C++ wrapper type for IfcAngularVelocityMeasure + typedef REAL IfcAngularVelocityMeasure; + // C++ wrapper type for IfcArcIndex + typedef ListOf< INTEGER, 3, 3 > IfcArcIndex; + // C++ wrapper type for IfcAreaDensityMeasure + typedef REAL IfcAreaDensityMeasure; + // C++ wrapper type for IfcAreaMeasure + typedef REAL IfcAreaMeasure; + // C++ wrapper type for IfcBoolean + typedef BOOLEAN IfcBoolean; + // C++ wrapper type for IfcBoxAlignment + typedef STRING IfcBoxAlignment; + // C++ wrapper type for IfcCardinalPointReference + typedef INTEGER IfcCardinalPointReference; + // C++ wrapper type for IfcCompoundPlaneAngleMeasure + typedef ListOf< INTEGER, 3, 4 > IfcCompoundPlaneAngleMeasure; + // C++ wrapper type for IfcContextDependentMeasure + typedef REAL IfcContextDependentMeasure; + // C++ wrapper type for IfcCountMeasure + typedef NUMBER IfcCountMeasure; + // C++ wrapper type for IfcCurvatureMeasure + typedef REAL IfcCurvatureMeasure; + // C++ wrapper type for IfcDate + typedef STRING IfcDate; + // C++ wrapper type for IfcDateTime + typedef STRING IfcDateTime; + // C++ wrapper type for IfcDayInMonthNumber + typedef INTEGER IfcDayInMonthNumber; + // C++ wrapper type for IfcDayInWeekNumber + typedef INTEGER IfcDayInWeekNumber; + // C++ wrapper type for IfcDescriptiveMeasure + typedef STRING IfcDescriptiveMeasure; + // C++ wrapper type for IfcDimensionCount + typedef INTEGER IfcDimensionCount; + // C++ wrapper type for IfcDoseEquivalentMeasure + typedef REAL IfcDoseEquivalentMeasure; + // C++ wrapper type for IfcDuration + typedef STRING IfcDuration; + // C++ wrapper type for IfcDynamicViscosityMeasure + typedef REAL IfcDynamicViscosityMeasure; + // C++ wrapper type for IfcElectricCapacitanceMeasure + typedef REAL IfcElectricCapacitanceMeasure; + // C++ wrapper type for IfcElectricChargeMeasure + typedef REAL IfcElectricChargeMeasure; + // C++ wrapper type for IfcElectricConductanceMeasure + typedef REAL IfcElectricConductanceMeasure; + // C++ wrapper type for IfcElectricCurrentMeasure + typedef REAL IfcElectricCurrentMeasure; + // C++ wrapper type for IfcElectricResistanceMeasure + typedef REAL IfcElectricResistanceMeasure; + // C++ wrapper type for IfcElectricVoltageMeasure + typedef REAL IfcElectricVoltageMeasure; + // C++ wrapper type for IfcEnergyMeasure + typedef REAL IfcEnergyMeasure; + // C++ wrapper type for IfcFontStyle + typedef STRING IfcFontStyle; + // C++ wrapper type for IfcFontVariant + typedef STRING IfcFontVariant; + // C++ wrapper type for IfcFontWeight + typedef STRING IfcFontWeight; + // C++ wrapper type for IfcForceMeasure + typedef REAL IfcForceMeasure; + // C++ wrapper type for IfcFrequencyMeasure + typedef REAL IfcFrequencyMeasure; + // C++ wrapper type for IfcGloballyUniqueId + typedef STRING IfcGloballyUniqueId; + // C++ wrapper type for IfcHeatFluxDensityMeasure + typedef REAL IfcHeatFluxDensityMeasure; + // C++ wrapper type for IfcHeatingValueMeasure + typedef REAL IfcHeatingValueMeasure; + // C++ wrapper type for IfcIdentifier + typedef STRING IfcIdentifier; + // C++ wrapper type for IfcIlluminanceMeasure + typedef REAL IfcIlluminanceMeasure; + // C++ wrapper type for IfcInductanceMeasure + typedef REAL IfcInductanceMeasure; + // C++ wrapper type for IfcInteger + typedef INTEGER IfcInteger; + // C++ wrapper type for IfcIntegerCountRateMeasure + typedef INTEGER IfcIntegerCountRateMeasure; + // C++ wrapper type for IfcIonConcentrationMeasure + typedef REAL IfcIonConcentrationMeasure; + // C++ wrapper type for IfcIsothermalMoistureCapacityMeasure + typedef REAL IfcIsothermalMoistureCapacityMeasure; + // C++ wrapper type for IfcKinematicViscosityMeasure + typedef REAL IfcKinematicViscosityMeasure; + // C++ wrapper type for IfcLabel + typedef STRING IfcLabel; + // C++ wrapper type for IfcLanguageId + typedef STRING IfcLanguageId; + // C++ wrapper type for IfcLengthMeasure + typedef REAL IfcLengthMeasure; + // C++ wrapper type for IfcLineIndex + typedef ListOf< INTEGER, 2, 0 > IfcLineIndex; + // C++ wrapper type for IfcLinearForceMeasure + typedef REAL IfcLinearForceMeasure; + // C++ wrapper type for IfcLinearMomentMeasure + typedef REAL IfcLinearMomentMeasure; + // C++ wrapper type for IfcLinearStiffnessMeasure + typedef REAL IfcLinearStiffnessMeasure; + // C++ wrapper type for IfcLinearVelocityMeasure + typedef REAL IfcLinearVelocityMeasure; + // C++ wrapper type for IfcLogical + typedef LOGICAL IfcLogical; + // C++ wrapper type for IfcLuminousFluxMeasure + typedef REAL IfcLuminousFluxMeasure; + // C++ wrapper type for IfcLuminousIntensityDistributionMeasure + typedef REAL IfcLuminousIntensityDistributionMeasure; + // C++ wrapper type for IfcLuminousIntensityMeasure + typedef REAL IfcLuminousIntensityMeasure; + // C++ wrapper type for IfcMagneticFluxDensityMeasure + typedef REAL IfcMagneticFluxDensityMeasure; + // C++ wrapper type for IfcMagneticFluxMeasure + typedef REAL IfcMagneticFluxMeasure; + // C++ wrapper type for IfcMassDensityMeasure + typedef REAL IfcMassDensityMeasure; + // C++ wrapper type for IfcMassFlowRateMeasure + typedef REAL IfcMassFlowRateMeasure; + // C++ wrapper type for IfcMassMeasure + typedef REAL IfcMassMeasure; + // C++ wrapper type for IfcMassPerLengthMeasure + typedef REAL IfcMassPerLengthMeasure; + // C++ wrapper type for IfcModulusOfElasticityMeasure + typedef REAL IfcModulusOfElasticityMeasure; + // C++ wrapper type for IfcModulusOfLinearSubgradeReactionMeasure + typedef REAL IfcModulusOfLinearSubgradeReactionMeasure; + // C++ wrapper type for IfcModulusOfRotationalSubgradeReactionMeasure + typedef REAL IfcModulusOfRotationalSubgradeReactionMeasure; + // C++ wrapper type for IfcModulusOfSubgradeReactionMeasure + typedef REAL IfcModulusOfSubgradeReactionMeasure; + // C++ wrapper type for IfcMoistureDiffusivityMeasure + typedef REAL IfcMoistureDiffusivityMeasure; + // C++ wrapper type for IfcMolecularWeightMeasure + typedef REAL IfcMolecularWeightMeasure; + // C++ wrapper type for IfcMomentOfInertiaMeasure + typedef REAL IfcMomentOfInertiaMeasure; + // C++ wrapper type for IfcMonetaryMeasure + typedef REAL IfcMonetaryMeasure; + // C++ wrapper type for IfcMonthInYearNumber + typedef INTEGER IfcMonthInYearNumber; + // C++ wrapper type for IfcNonNegativeLengthMeasure + typedef REAL IfcNonNegativeLengthMeasure; + // C++ wrapper type for IfcNormalisedRatioMeasure + typedef REAL IfcNormalisedRatioMeasure; + // C++ wrapper type for IfcNumericMeasure + typedef NUMBER IfcNumericMeasure; + // C++ wrapper type for IfcPHMeasure + typedef REAL IfcPHMeasure; + // C++ wrapper type for IfcParameterValue + typedef REAL IfcParameterValue; + // C++ wrapper type for IfcPlanarForceMeasure + typedef REAL IfcPlanarForceMeasure; + // C++ wrapper type for IfcPlaneAngleMeasure + typedef REAL IfcPlaneAngleMeasure; + // C++ wrapper type for IfcPositiveInteger + typedef INTEGER IfcPositiveInteger; + // C++ wrapper type for IfcPositiveLengthMeasure + typedef REAL IfcPositiveLengthMeasure; + // C++ wrapper type for IfcPositivePlaneAngleMeasure + typedef REAL IfcPositivePlaneAngleMeasure; + // C++ wrapper type for IfcPositiveRatioMeasure + typedef REAL IfcPositiveRatioMeasure; + // C++ wrapper type for IfcPowerMeasure + typedef REAL IfcPowerMeasure; + // C++ wrapper type for IfcPresentableText + typedef STRING IfcPresentableText; + // C++ wrapper type for IfcPressureMeasure + typedef REAL IfcPressureMeasure; + // C++ wrapper type for IfcRadioActivityMeasure + typedef REAL IfcRadioActivityMeasure; + // C++ wrapper type for IfcRatioMeasure + typedef REAL IfcRatioMeasure; + // C++ wrapper type for IfcReal + typedef REAL IfcReal; + // C++ wrapper type for IfcRotationalFrequencyMeasure + typedef REAL IfcRotationalFrequencyMeasure; + // C++ wrapper type for IfcRotationalMassMeasure + typedef REAL IfcRotationalMassMeasure; + // C++ wrapper type for IfcRotationalStiffnessMeasure + typedef REAL IfcRotationalStiffnessMeasure; + // C++ wrapper type for IfcSectionModulusMeasure + typedef REAL IfcSectionModulusMeasure; + // C++ wrapper type for IfcSectionalAreaIntegralMeasure + typedef REAL IfcSectionalAreaIntegralMeasure; + // C++ wrapper type for IfcShearModulusMeasure + typedef REAL IfcShearModulusMeasure; + // C++ wrapper type for IfcSolidAngleMeasure + typedef REAL IfcSolidAngleMeasure; + // C++ wrapper type for IfcSoundPowerLevelMeasure + typedef REAL IfcSoundPowerLevelMeasure; + // C++ wrapper type for IfcSoundPowerMeasure + typedef REAL IfcSoundPowerMeasure; + // C++ wrapper type for IfcSoundPressureLevelMeasure + typedef REAL IfcSoundPressureLevelMeasure; + // C++ wrapper type for IfcSoundPressureMeasure + typedef REAL IfcSoundPressureMeasure; + // C++ wrapper type for IfcSpecificHeatCapacityMeasure + typedef REAL IfcSpecificHeatCapacityMeasure; + // C++ wrapper type for IfcSpecularExponent + typedef REAL IfcSpecularExponent; + // C++ wrapper type for IfcSpecularRoughness + typedef REAL IfcSpecularRoughness; + // C++ wrapper type for IfcTemperatureGradientMeasure + typedef REAL IfcTemperatureGradientMeasure; + // C++ wrapper type for IfcTemperatureRateOfChangeMeasure + typedef REAL IfcTemperatureRateOfChangeMeasure; + // C++ wrapper type for IfcText + typedef STRING IfcText; + // C++ wrapper type for IfcTextAlignment + typedef STRING IfcTextAlignment; + // C++ wrapper type for IfcTextDecoration + typedef STRING IfcTextDecoration; + // C++ wrapper type for IfcTextFontName + typedef STRING IfcTextFontName; + // C++ wrapper type for IfcTextTransformation + typedef STRING IfcTextTransformation; + // C++ wrapper type for IfcThermalAdmittanceMeasure + typedef REAL IfcThermalAdmittanceMeasure; + // C++ wrapper type for IfcThermalConductivityMeasure + typedef REAL IfcThermalConductivityMeasure; + // C++ wrapper type for IfcThermalExpansionCoefficientMeasure + typedef REAL IfcThermalExpansionCoefficientMeasure; + // C++ wrapper type for IfcThermalResistanceMeasure + typedef REAL IfcThermalResistanceMeasure; + // C++ wrapper type for IfcThermalTransmittanceMeasure + typedef REAL IfcThermalTransmittanceMeasure; + // C++ wrapper type for IfcThermodynamicTemperatureMeasure + typedef REAL IfcThermodynamicTemperatureMeasure; + // C++ wrapper type for IfcTime + typedef STRING IfcTime; + // C++ wrapper type for IfcTimeMeasure + typedef REAL IfcTimeMeasure; + // C++ wrapper type for IfcTimeStamp + typedef INTEGER IfcTimeStamp; + // C++ wrapper type for IfcTorqueMeasure + typedef REAL IfcTorqueMeasure; + // C++ wrapper type for IfcURIReference + typedef STRING IfcURIReference; + // C++ wrapper type for IfcVaporPermeabilityMeasure + typedef REAL IfcVaporPermeabilityMeasure; + // C++ wrapper type for IfcVolumeMeasure + typedef REAL IfcVolumeMeasure; + // C++ wrapper type for IfcVolumetricFlowRateMeasure + typedef REAL IfcVolumetricFlowRateMeasure; + // C++ wrapper type for IfcWarpingConstantMeasure + typedef REAL IfcWarpingConstantMeasure; + // C++ wrapper type for IfcWarpingMomentMeasure + typedef REAL IfcWarpingMomentMeasure; + // C++ wrapper type for IfcActionRequestTypeEnum + typedef ENUMERATION IfcActionRequestTypeEnum; + // C++ wrapper type for IfcActionSourceTypeEnum + typedef ENUMERATION IfcActionSourceTypeEnum; + // C++ wrapper type for IfcActionTypeEnum + typedef ENUMERATION IfcActionTypeEnum; + // C++ wrapper type for IfcActuatorTypeEnum + typedef ENUMERATION IfcActuatorTypeEnum; + // C++ wrapper type for IfcAddressTypeEnum + typedef ENUMERATION IfcAddressTypeEnum; + // C++ wrapper type for IfcAirTerminalBoxTypeEnum + typedef ENUMERATION IfcAirTerminalBoxTypeEnum; + // C++ wrapper type for IfcAirTerminalTypeEnum + typedef ENUMERATION IfcAirTerminalTypeEnum; + // C++ wrapper type for IfcAirToAirHeatRecoveryTypeEnum + typedef ENUMERATION IfcAirToAirHeatRecoveryTypeEnum; + // C++ wrapper type for IfcAlarmTypeEnum + typedef ENUMERATION IfcAlarmTypeEnum; + // C++ wrapper type for IfcAnalysisModelTypeEnum + typedef ENUMERATION IfcAnalysisModelTypeEnum; + // C++ wrapper type for IfcAnalysisTheoryTypeEnum + typedef ENUMERATION IfcAnalysisTheoryTypeEnum; + // C++ wrapper type for IfcArithmeticOperatorEnum + typedef ENUMERATION IfcArithmeticOperatorEnum; + // C++ wrapper type for IfcAssemblyPlaceEnum + typedef ENUMERATION IfcAssemblyPlaceEnum; + // C++ wrapper type for IfcAudioVisualApplianceTypeEnum + typedef ENUMERATION IfcAudioVisualApplianceTypeEnum; + // C++ wrapper type for IfcBSplineCurveForm + typedef ENUMERATION IfcBSplineCurveForm; + // C++ wrapper type for IfcBSplineSurfaceForm + typedef ENUMERATION IfcBSplineSurfaceForm; + // C++ wrapper type for IfcBeamTypeEnum + typedef ENUMERATION IfcBeamTypeEnum; + // C++ wrapper type for IfcBenchmarkEnum + typedef ENUMERATION IfcBenchmarkEnum; + // C++ wrapper type for IfcBoilerTypeEnum + typedef ENUMERATION IfcBoilerTypeEnum; + // C++ wrapper type for IfcBooleanOperator + typedef ENUMERATION IfcBooleanOperator; + // C++ wrapper type for IfcBuildingElementPartTypeEnum + typedef ENUMERATION IfcBuildingElementPartTypeEnum; + // C++ wrapper type for IfcBuildingElementProxyTypeEnum + typedef ENUMERATION IfcBuildingElementProxyTypeEnum; + // C++ wrapper type for IfcBuildingSystemTypeEnum + typedef ENUMERATION IfcBuildingSystemTypeEnum; + // C++ wrapper type for IfcBurnerTypeEnum + typedef ENUMERATION IfcBurnerTypeEnum; + // C++ wrapper type for IfcCableCarrierFittingTypeEnum + typedef ENUMERATION IfcCableCarrierFittingTypeEnum; + // C++ wrapper type for IfcCableCarrierSegmentTypeEnum + typedef ENUMERATION IfcCableCarrierSegmentTypeEnum; + // C++ wrapper type for IfcCableFittingTypeEnum + typedef ENUMERATION IfcCableFittingTypeEnum; + // C++ wrapper type for IfcCableSegmentTypeEnum + typedef ENUMERATION IfcCableSegmentTypeEnum; + // C++ wrapper type for IfcChangeActionEnum + typedef ENUMERATION IfcChangeActionEnum; + // C++ wrapper type for IfcChillerTypeEnum + typedef ENUMERATION IfcChillerTypeEnum; + // C++ wrapper type for IfcChimneyTypeEnum + typedef ENUMERATION IfcChimneyTypeEnum; + // C++ wrapper type for IfcCoilTypeEnum + typedef ENUMERATION IfcCoilTypeEnum; + // C++ wrapper type for IfcColumnTypeEnum + typedef ENUMERATION IfcColumnTypeEnum; + // C++ wrapper type for IfcCommunicationsApplianceTypeEnum + typedef ENUMERATION IfcCommunicationsApplianceTypeEnum; + // C++ wrapper type for IfcComplexPropertyTemplateTypeEnum + typedef ENUMERATION IfcComplexPropertyTemplateTypeEnum; + // C++ wrapper type for IfcCompressorTypeEnum + typedef ENUMERATION IfcCompressorTypeEnum; + // C++ wrapper type for IfcCondenserTypeEnum + typedef ENUMERATION IfcCondenserTypeEnum; + // C++ wrapper type for IfcConnectionTypeEnum + typedef ENUMERATION IfcConnectionTypeEnum; + // C++ wrapper type for IfcConstraintEnum + typedef ENUMERATION IfcConstraintEnum; + // C++ wrapper type for IfcConstructionEquipmentResourceTypeEnum + typedef ENUMERATION IfcConstructionEquipmentResourceTypeEnum; + // C++ wrapper type for IfcConstructionMaterialResourceTypeEnum + typedef ENUMERATION IfcConstructionMaterialResourceTypeEnum; + // C++ wrapper type for IfcConstructionProductResourceTypeEnum + typedef ENUMERATION IfcConstructionProductResourceTypeEnum; + // C++ wrapper type for IfcControllerTypeEnum + typedef ENUMERATION IfcControllerTypeEnum; + // C++ wrapper type for IfcCooledBeamTypeEnum + typedef ENUMERATION IfcCooledBeamTypeEnum; + // C++ wrapper type for IfcCoolingTowerTypeEnum + typedef ENUMERATION IfcCoolingTowerTypeEnum; + // C++ wrapper type for IfcCostItemTypeEnum + typedef ENUMERATION IfcCostItemTypeEnum; + // C++ wrapper type for IfcCostScheduleTypeEnum + typedef ENUMERATION IfcCostScheduleTypeEnum; + // C++ wrapper type for IfcCoveringTypeEnum + typedef ENUMERATION IfcCoveringTypeEnum; + // C++ wrapper type for IfcCrewResourceTypeEnum + typedef ENUMERATION IfcCrewResourceTypeEnum; + // C++ wrapper type for IfcCurtainWallTypeEnum + typedef ENUMERATION IfcCurtainWallTypeEnum; + // C++ wrapper type for IfcCurveInterpolationEnum + typedef ENUMERATION IfcCurveInterpolationEnum; + // C++ wrapper type for IfcDamperTypeEnum + typedef ENUMERATION IfcDamperTypeEnum; + // C++ wrapper type for IfcDataOriginEnum + typedef ENUMERATION IfcDataOriginEnum; + // C++ wrapper type for IfcDerivedUnitEnum + typedef ENUMERATION IfcDerivedUnitEnum; + // C++ wrapper type for IfcDirectionSenseEnum + typedef ENUMERATION IfcDirectionSenseEnum; + // C++ wrapper type for IfcDiscreteAccessoryTypeEnum + typedef ENUMERATION IfcDiscreteAccessoryTypeEnum; + // C++ wrapper type for IfcDistributionChamberElementTypeEnum + typedef ENUMERATION IfcDistributionChamberElementTypeEnum; + // C++ wrapper type for IfcDistributionPortTypeEnum + typedef ENUMERATION IfcDistributionPortTypeEnum; + // C++ wrapper type for IfcDistributionSystemEnum + typedef ENUMERATION IfcDistributionSystemEnum; + // C++ wrapper type for IfcDocumentConfidentialityEnum + typedef ENUMERATION IfcDocumentConfidentialityEnum; + // C++ wrapper type for IfcDocumentStatusEnum + typedef ENUMERATION IfcDocumentStatusEnum; + // C++ wrapper type for IfcDoorPanelOperationEnum + typedef ENUMERATION IfcDoorPanelOperationEnum; + // C++ wrapper type for IfcDoorPanelPositionEnum + typedef ENUMERATION IfcDoorPanelPositionEnum; + // C++ wrapper type for IfcDoorStyleConstructionEnum + typedef ENUMERATION IfcDoorStyleConstructionEnum; + // C++ wrapper type for IfcDoorStyleOperationEnum + typedef ENUMERATION IfcDoorStyleOperationEnum; + // C++ wrapper type for IfcDoorTypeEnum + typedef ENUMERATION IfcDoorTypeEnum; + // C++ wrapper type for IfcDoorTypeOperationEnum + typedef ENUMERATION IfcDoorTypeOperationEnum; + // C++ wrapper type for IfcDuctFittingTypeEnum + typedef ENUMERATION IfcDuctFittingTypeEnum; + // C++ wrapper type for IfcDuctSegmentTypeEnum + typedef ENUMERATION IfcDuctSegmentTypeEnum; + // C++ wrapper type for IfcDuctSilencerTypeEnum + typedef ENUMERATION IfcDuctSilencerTypeEnum; + // C++ wrapper type for IfcElectricApplianceTypeEnum + typedef ENUMERATION IfcElectricApplianceTypeEnum; + // C++ wrapper type for IfcElectricDistributionBoardTypeEnum + typedef ENUMERATION IfcElectricDistributionBoardTypeEnum; + // C++ wrapper type for IfcElectricFlowStorageDeviceTypeEnum + typedef ENUMERATION IfcElectricFlowStorageDeviceTypeEnum; + // C++ wrapper type for IfcElectricGeneratorTypeEnum + typedef ENUMERATION IfcElectricGeneratorTypeEnum; + // C++ wrapper type for IfcElectricMotorTypeEnum + typedef ENUMERATION IfcElectricMotorTypeEnum; + // C++ wrapper type for IfcElectricTimeControlTypeEnum + typedef ENUMERATION IfcElectricTimeControlTypeEnum; + // C++ wrapper type for IfcElementAssemblyTypeEnum + typedef ENUMERATION IfcElementAssemblyTypeEnum; + // C++ wrapper type for IfcElementCompositionEnum + typedef ENUMERATION IfcElementCompositionEnum; + // C++ wrapper type for IfcEngineTypeEnum + typedef ENUMERATION IfcEngineTypeEnum; + // C++ wrapper type for IfcEvaporativeCoolerTypeEnum + typedef ENUMERATION IfcEvaporativeCoolerTypeEnum; + // C++ wrapper type for IfcEvaporatorTypeEnum + typedef ENUMERATION IfcEvaporatorTypeEnum; + // C++ wrapper type for IfcEventTriggerTypeEnum + typedef ENUMERATION IfcEventTriggerTypeEnum; + // C++ wrapper type for IfcEventTypeEnum + typedef ENUMERATION IfcEventTypeEnum; + // C++ wrapper type for IfcExternalSpatialElementTypeEnum + typedef ENUMERATION IfcExternalSpatialElementTypeEnum; + // C++ wrapper type for IfcFanTypeEnum + typedef ENUMERATION IfcFanTypeEnum; + // C++ wrapper type for IfcFastenerTypeEnum + typedef ENUMERATION IfcFastenerTypeEnum; + // C++ wrapper type for IfcFilterTypeEnum + typedef ENUMERATION IfcFilterTypeEnum; + // C++ wrapper type for IfcFireSuppressionTerminalTypeEnum + typedef ENUMERATION IfcFireSuppressionTerminalTypeEnum; + // C++ wrapper type for IfcFlowDirectionEnum + typedef ENUMERATION IfcFlowDirectionEnum; + // C++ wrapper type for IfcFlowInstrumentTypeEnum + typedef ENUMERATION IfcFlowInstrumentTypeEnum; + // C++ wrapper type for IfcFlowMeterTypeEnum + typedef ENUMERATION IfcFlowMeterTypeEnum; + // C++ wrapper type for IfcFootingTypeEnum + typedef ENUMERATION IfcFootingTypeEnum; + // C++ wrapper type for IfcFurnitureTypeEnum + typedef ENUMERATION IfcFurnitureTypeEnum; + // C++ wrapper type for IfcGeographicElementTypeEnum + typedef ENUMERATION IfcGeographicElementTypeEnum; + // C++ wrapper type for IfcGeometricProjectionEnum + typedef ENUMERATION IfcGeometricProjectionEnum; + // C++ wrapper type for IfcGlobalOrLocalEnum + typedef ENUMERATION IfcGlobalOrLocalEnum; + // C++ wrapper type for IfcGridTypeEnum + typedef ENUMERATION IfcGridTypeEnum; + // C++ wrapper type for IfcHeatExchangerTypeEnum + typedef ENUMERATION IfcHeatExchangerTypeEnum; + // C++ wrapper type for IfcHumidifierTypeEnum + typedef ENUMERATION IfcHumidifierTypeEnum; + // C++ wrapper type for IfcInterceptorTypeEnum + typedef ENUMERATION IfcInterceptorTypeEnum; + // C++ wrapper type for IfcInternalOrExternalEnum + typedef ENUMERATION IfcInternalOrExternalEnum; + // C++ wrapper type for IfcInventoryTypeEnum + typedef ENUMERATION IfcInventoryTypeEnum; + // C++ wrapper type for IfcJunctionBoxTypeEnum + typedef ENUMERATION IfcJunctionBoxTypeEnum; + // C++ wrapper type for IfcKnotType + typedef ENUMERATION IfcKnotType; + // C++ wrapper type for IfcLaborResourceTypeEnum + typedef ENUMERATION IfcLaborResourceTypeEnum; + // C++ wrapper type for IfcLampTypeEnum + typedef ENUMERATION IfcLampTypeEnum; + // C++ wrapper type for IfcLayerSetDirectionEnum + typedef ENUMERATION IfcLayerSetDirectionEnum; + // C++ wrapper type for IfcLightDistributionCurveEnum + typedef ENUMERATION IfcLightDistributionCurveEnum; + // C++ wrapper type for IfcLightEmissionSourceEnum + typedef ENUMERATION IfcLightEmissionSourceEnum; + // C++ wrapper type for IfcLightFixtureTypeEnum + typedef ENUMERATION IfcLightFixtureTypeEnum; + // C++ wrapper type for IfcLoadGroupTypeEnum + typedef ENUMERATION IfcLoadGroupTypeEnum; + // C++ wrapper type for IfcLogicalOperatorEnum + typedef ENUMERATION IfcLogicalOperatorEnum; + // C++ wrapper type for IfcMechanicalFastenerTypeEnum + typedef ENUMERATION IfcMechanicalFastenerTypeEnum; + // C++ wrapper type for IfcMedicalDeviceTypeEnum + typedef ENUMERATION IfcMedicalDeviceTypeEnum; + // C++ wrapper type for IfcMemberTypeEnum + typedef ENUMERATION IfcMemberTypeEnum; + // C++ wrapper type for IfcMotorConnectionTypeEnum + typedef ENUMERATION IfcMotorConnectionTypeEnum; + // C++ wrapper type for IfcNullStyle + typedef ENUMERATION IfcNullStyle; + // C++ wrapper type for IfcObjectTypeEnum + typedef ENUMERATION IfcObjectTypeEnum; + // C++ wrapper type for IfcObjectiveEnum + typedef ENUMERATION IfcObjectiveEnum; + // C++ wrapper type for IfcOccupantTypeEnum + typedef ENUMERATION IfcOccupantTypeEnum; + // C++ wrapper type for IfcOpeningElementTypeEnum + typedef ENUMERATION IfcOpeningElementTypeEnum; + // C++ wrapper type for IfcOutletTypeEnum + typedef ENUMERATION IfcOutletTypeEnum; + // C++ wrapper type for IfcPerformanceHistoryTypeEnum + typedef ENUMERATION IfcPerformanceHistoryTypeEnum; + // C++ wrapper type for IfcPermeableCoveringOperationEnum + typedef ENUMERATION IfcPermeableCoveringOperationEnum; + // C++ wrapper type for IfcPermitTypeEnum + typedef ENUMERATION IfcPermitTypeEnum; + // C++ wrapper type for IfcPhysicalOrVirtualEnum + typedef ENUMERATION IfcPhysicalOrVirtualEnum; + // C++ wrapper type for IfcPileConstructionEnum + typedef ENUMERATION IfcPileConstructionEnum; + // C++ wrapper type for IfcPileTypeEnum + typedef ENUMERATION IfcPileTypeEnum; + // C++ wrapper type for IfcPipeFittingTypeEnum + typedef ENUMERATION IfcPipeFittingTypeEnum; + // C++ wrapper type for IfcPipeSegmentTypeEnum + typedef ENUMERATION IfcPipeSegmentTypeEnum; + // C++ wrapper type for IfcPlateTypeEnum + typedef ENUMERATION IfcPlateTypeEnum; + // C++ wrapper type for IfcPreferredSurfaceCurveRepresentation + typedef ENUMERATION IfcPreferredSurfaceCurveRepresentation; + // C++ wrapper type for IfcProcedureTypeEnum + typedef ENUMERATION IfcProcedureTypeEnum; + // C++ wrapper type for IfcProfileTypeEnum + typedef ENUMERATION IfcProfileTypeEnum; + // C++ wrapper type for IfcProjectOrderTypeEnum + typedef ENUMERATION IfcProjectOrderTypeEnum; + // C++ wrapper type for IfcProjectedOrTrueLengthEnum + typedef ENUMERATION IfcProjectedOrTrueLengthEnum; + // C++ wrapper type for IfcProjectionElementTypeEnum + typedef ENUMERATION IfcProjectionElementTypeEnum; + // C++ wrapper type for IfcPropertySetTemplateTypeEnum + typedef ENUMERATION IfcPropertySetTemplateTypeEnum; + // C++ wrapper type for IfcProtectiveDeviceTrippingUnitTypeEnum + typedef ENUMERATION IfcProtectiveDeviceTrippingUnitTypeEnum; + // C++ wrapper type for IfcProtectiveDeviceTypeEnum + typedef ENUMERATION IfcProtectiveDeviceTypeEnum; + // C++ wrapper type for IfcPumpTypeEnum + typedef ENUMERATION IfcPumpTypeEnum; + // C++ wrapper type for IfcRailingTypeEnum + typedef ENUMERATION IfcRailingTypeEnum; + // C++ wrapper type for IfcRampFlightTypeEnum + typedef ENUMERATION IfcRampFlightTypeEnum; + // C++ wrapper type for IfcRampTypeEnum + typedef ENUMERATION IfcRampTypeEnum; + // C++ wrapper type for IfcRecurrenceTypeEnum + typedef ENUMERATION IfcRecurrenceTypeEnum; + // C++ wrapper type for IfcReflectanceMethodEnum + typedef ENUMERATION IfcReflectanceMethodEnum; + // C++ wrapper type for IfcReinforcingBarRoleEnum + typedef ENUMERATION IfcReinforcingBarRoleEnum; + // C++ wrapper type for IfcReinforcingBarSurfaceEnum + typedef ENUMERATION IfcReinforcingBarSurfaceEnum; + // C++ wrapper type for IfcReinforcingBarTypeEnum + typedef ENUMERATION IfcReinforcingBarTypeEnum; + // C++ wrapper type for IfcReinforcingMeshTypeEnum + typedef ENUMERATION IfcReinforcingMeshTypeEnum; + // C++ wrapper type for IfcRoleEnum + typedef ENUMERATION IfcRoleEnum; + // C++ wrapper type for IfcRoofTypeEnum + typedef ENUMERATION IfcRoofTypeEnum; + // C++ wrapper type for IfcSIPrefix + typedef ENUMERATION IfcSIPrefix; + // C++ wrapper type for IfcSIUnitName + typedef ENUMERATION IfcSIUnitName; + // C++ wrapper type for IfcSanitaryTerminalTypeEnum + typedef ENUMERATION IfcSanitaryTerminalTypeEnum; + // C++ wrapper type for IfcSectionTypeEnum + typedef ENUMERATION IfcSectionTypeEnum; + // C++ wrapper type for IfcSensorTypeEnum + typedef ENUMERATION IfcSensorTypeEnum; + // C++ wrapper type for IfcSequenceEnum + typedef ENUMERATION IfcSequenceEnum; + // C++ wrapper type for IfcShadingDeviceTypeEnum + typedef ENUMERATION IfcShadingDeviceTypeEnum; + // C++ wrapper type for IfcSimplePropertyTemplateTypeEnum + typedef ENUMERATION IfcSimplePropertyTemplateTypeEnum; + // C++ wrapper type for IfcSlabTypeEnum + typedef ENUMERATION IfcSlabTypeEnum; + // C++ wrapper type for IfcSolarDeviceTypeEnum + typedef ENUMERATION IfcSolarDeviceTypeEnum; + // C++ wrapper type for IfcSpaceHeaterTypeEnum + typedef ENUMERATION IfcSpaceHeaterTypeEnum; + // C++ wrapper type for IfcSpaceTypeEnum + typedef ENUMERATION IfcSpaceTypeEnum; + // C++ wrapper type for IfcSpatialZoneTypeEnum + typedef ENUMERATION IfcSpatialZoneTypeEnum; + // C++ wrapper type for IfcStackTerminalTypeEnum + typedef ENUMERATION IfcStackTerminalTypeEnum; + // C++ wrapper type for IfcStairFlightTypeEnum + typedef ENUMERATION IfcStairFlightTypeEnum; + // C++ wrapper type for IfcStairTypeEnum + typedef ENUMERATION IfcStairTypeEnum; + // C++ wrapper type for IfcStateEnum + typedef ENUMERATION IfcStateEnum; + // C++ wrapper type for IfcStructuralCurveActivityTypeEnum + typedef ENUMERATION IfcStructuralCurveActivityTypeEnum; + // C++ wrapper type for IfcStructuralCurveMemberTypeEnum + typedef ENUMERATION IfcStructuralCurveMemberTypeEnum; + // C++ wrapper type for IfcStructuralSurfaceActivityTypeEnum + typedef ENUMERATION IfcStructuralSurfaceActivityTypeEnum; + // C++ wrapper type for IfcStructuralSurfaceMemberTypeEnum + typedef ENUMERATION IfcStructuralSurfaceMemberTypeEnum; + // C++ wrapper type for IfcSubContractResourceTypeEnum + typedef ENUMERATION IfcSubContractResourceTypeEnum; + // C++ wrapper type for IfcSurfaceFeatureTypeEnum + typedef ENUMERATION IfcSurfaceFeatureTypeEnum; + // C++ wrapper type for IfcSurfaceSide + typedef ENUMERATION IfcSurfaceSide; + // C++ wrapper type for IfcSwitchingDeviceTypeEnum + typedef ENUMERATION IfcSwitchingDeviceTypeEnum; + // C++ wrapper type for IfcSystemFurnitureElementTypeEnum + typedef ENUMERATION IfcSystemFurnitureElementTypeEnum; + // C++ wrapper type for IfcTankTypeEnum + typedef ENUMERATION IfcTankTypeEnum; + // C++ wrapper type for IfcTaskDurationEnum + typedef ENUMERATION IfcTaskDurationEnum; + // C++ wrapper type for IfcTaskTypeEnum + typedef ENUMERATION IfcTaskTypeEnum; + // C++ wrapper type for IfcTendonAnchorTypeEnum + typedef ENUMERATION IfcTendonAnchorTypeEnum; + // C++ wrapper type for IfcTendonTypeEnum + typedef ENUMERATION IfcTendonTypeEnum; + // C++ wrapper type for IfcTextPath + typedef ENUMERATION IfcTextPath; + // C++ wrapper type for IfcTimeSeriesDataTypeEnum + typedef ENUMERATION IfcTimeSeriesDataTypeEnum; + // C++ wrapper type for IfcTransformerTypeEnum + typedef ENUMERATION IfcTransformerTypeEnum; + // C++ wrapper type for IfcTransitionCode + typedef ENUMERATION IfcTransitionCode; + // C++ wrapper type for IfcTransportElementTypeEnum + typedef ENUMERATION IfcTransportElementTypeEnum; + // C++ wrapper type for IfcTrimmingPreference + typedef ENUMERATION IfcTrimmingPreference; + // C++ wrapper type for IfcTubeBundleTypeEnum + typedef ENUMERATION IfcTubeBundleTypeEnum; + // C++ wrapper type for IfcUnitEnum + typedef ENUMERATION IfcUnitEnum; + // C++ wrapper type for IfcUnitaryControlElementTypeEnum + typedef ENUMERATION IfcUnitaryControlElementTypeEnum; + // C++ wrapper type for IfcUnitaryEquipmentTypeEnum + typedef ENUMERATION IfcUnitaryEquipmentTypeEnum; + // C++ wrapper type for IfcValveTypeEnum + typedef ENUMERATION IfcValveTypeEnum; + // C++ wrapper type for IfcVibrationIsolatorTypeEnum + typedef ENUMERATION IfcVibrationIsolatorTypeEnum; + // C++ wrapper type for IfcVoidingFeatureTypeEnum + typedef ENUMERATION IfcVoidingFeatureTypeEnum; + // C++ wrapper type for IfcWallTypeEnum + typedef ENUMERATION IfcWallTypeEnum; + // C++ wrapper type for IfcWasteTerminalTypeEnum + typedef ENUMERATION IfcWasteTerminalTypeEnum; + // C++ wrapper type for IfcWindowPanelOperationEnum + typedef ENUMERATION IfcWindowPanelOperationEnum; + // C++ wrapper type for IfcWindowPanelPositionEnum + typedef ENUMERATION IfcWindowPanelPositionEnum; + // C++ wrapper type for IfcWindowStyleConstructionEnum + typedef ENUMERATION IfcWindowStyleConstructionEnum; + // C++ wrapper type for IfcWindowStyleOperationEnum + typedef ENUMERATION IfcWindowStyleOperationEnum; + // C++ wrapper type for IfcWindowTypeEnum + typedef ENUMERATION IfcWindowTypeEnum; + // C++ wrapper type for IfcWindowTypePartitioningEnum + typedef ENUMERATION IfcWindowTypePartitioningEnum; + // C++ wrapper type for IfcWorkCalendarTypeEnum + typedef ENUMERATION IfcWorkCalendarTypeEnum; + // C++ wrapper type for IfcWorkPlanTypeEnum + typedef ENUMERATION IfcWorkPlanTypeEnum; + // C++ wrapper type for IfcWorkScheduleTypeEnum + typedef ENUMERATION IfcWorkScheduleTypeEnum; + // C++ wrapper type for IfcActorSelect + typedef SELECT IfcActorSelect; + // C++ wrapper type for IfcAppliedValueSelect + typedef SELECT IfcAppliedValueSelect; + // C++ wrapper type for IfcAxis2Placement + typedef SELECT IfcAxis2Placement; + // C++ wrapper type for IfcBendingParameterSelect + typedef SELECT IfcBendingParameterSelect; + // C++ wrapper type for IfcBooleanOperand + typedef SELECT IfcBooleanOperand; + // C++ wrapper type for IfcClassificationReferenceSelect + typedef SELECT IfcClassificationReferenceSelect; + // C++ wrapper type for IfcClassificationSelect + typedef SELECT IfcClassificationSelect; + // C++ wrapper type for IfcColour + typedef SELECT IfcColour; + // C++ wrapper type for IfcColourOrFactor + typedef SELECT IfcColourOrFactor; + // C++ wrapper type for IfcCoordinateReferenceSystemSelect + typedef SELECT IfcCoordinateReferenceSystemSelect; + // C++ wrapper type for IfcCsgSelect + typedef SELECT IfcCsgSelect; + // C++ wrapper type for IfcCurveFontOrScaledCurveFontSelect + typedef SELECT IfcCurveFontOrScaledCurveFontSelect; + // C++ wrapper type for IfcCurveOnSurface + typedef SELECT IfcCurveOnSurface; + // C++ wrapper type for IfcCurveOrEdgeCurve + typedef SELECT IfcCurveOrEdgeCurve; + // C++ wrapper type for IfcCurveStyleFontSelect + typedef SELECT IfcCurveStyleFontSelect; + // C++ wrapper type for IfcDefinitionSelect + typedef SELECT IfcDefinitionSelect; + // C++ wrapper type for IfcDerivedMeasureValue + typedef SELECT IfcDerivedMeasureValue; + // C++ wrapper type for IfcDocumentSelect + typedef SELECT IfcDocumentSelect; + // C++ wrapper type for IfcFillStyleSelect + typedef SELECT IfcFillStyleSelect; + // C++ wrapper type for IfcGeometricSetSelect + typedef SELECT IfcGeometricSetSelect; + // C++ wrapper type for IfcGridPlacementDirectionSelect + typedef SELECT IfcGridPlacementDirectionSelect; + // C++ wrapper type for IfcHatchLineDistanceSelect + typedef SELECT IfcHatchLineDistanceSelect; + // C++ wrapper type for IfcLayeredItem + typedef SELECT IfcLayeredItem; + // C++ wrapper type for IfcLibrarySelect + typedef SELECT IfcLibrarySelect; + // C++ wrapper type for IfcLightDistributionDataSourceSelect + typedef SELECT IfcLightDistributionDataSourceSelect; + // C++ wrapper type for IfcMaterialSelect + typedef SELECT IfcMaterialSelect; + // C++ wrapper type for IfcMeasureValue + typedef SELECT IfcMeasureValue; + // C++ wrapper type for IfcMetricValueSelect + typedef SELECT IfcMetricValueSelect; + // C++ wrapper type for IfcModulusOfRotationalSubgradeReactionSelect + typedef SELECT IfcModulusOfRotationalSubgradeReactionSelect; + // C++ wrapper type for IfcModulusOfSubgradeReactionSelect + typedef SELECT IfcModulusOfSubgradeReactionSelect; + // C++ wrapper type for IfcModulusOfTranslationalSubgradeReactionSelect + typedef SELECT IfcModulusOfTranslationalSubgradeReactionSelect; + // C++ wrapper type for IfcObjectReferenceSelect + typedef SELECT IfcObjectReferenceSelect; + // C++ wrapper type for IfcPointOrVertexPoint + typedef SELECT IfcPointOrVertexPoint; + // C++ wrapper type for IfcPresentationStyleSelect + typedef SELECT IfcPresentationStyleSelect; + // C++ wrapper type for IfcProcessSelect + typedef SELECT IfcProcessSelect; + // C++ wrapper type for IfcProductRepresentationSelect + typedef SELECT IfcProductRepresentationSelect; + // C++ wrapper type for IfcProductSelect + typedef SELECT IfcProductSelect; + // C++ wrapper type for IfcPropertySetDefinitionSelect + typedef SELECT IfcPropertySetDefinitionSelect; + // C++ wrapper type for IfcResourceObjectSelect + typedef SELECT IfcResourceObjectSelect; + // C++ wrapper type for IfcResourceSelect + typedef SELECT IfcResourceSelect; + // C++ wrapper type for IfcRotationalStiffnessSelect + typedef SELECT IfcRotationalStiffnessSelect; + // C++ wrapper type for IfcSegmentIndexSelect + typedef SELECT IfcSegmentIndexSelect; + // C++ wrapper type for IfcShell + typedef SELECT IfcShell; + // C++ wrapper type for IfcSimpleValue + typedef SELECT IfcSimpleValue; + // C++ wrapper type for IfcSizeSelect + typedef SELECT IfcSizeSelect; + // C++ wrapper type for IfcSolidOrShell + typedef SELECT IfcSolidOrShell; + // C++ wrapper type for IfcSpaceBoundarySelect + typedef SELECT IfcSpaceBoundarySelect; + // C++ wrapper type for IfcSpecularHighlightSelect + typedef SELECT IfcSpecularHighlightSelect; + // C++ wrapper type for IfcStructuralActivityAssignmentSelect + typedef SELECT IfcStructuralActivityAssignmentSelect; + // C++ wrapper type for IfcStyleAssignmentSelect + typedef SELECT IfcStyleAssignmentSelect; + // C++ wrapper type for IfcSurfaceOrFaceSurface + typedef SELECT IfcSurfaceOrFaceSurface; + // C++ wrapper type for IfcSurfaceStyleElementSelect + typedef SELECT IfcSurfaceStyleElementSelect; + // C++ wrapper type for IfcTextFontSelect + typedef SELECT IfcTextFontSelect; + // C++ wrapper type for IfcTimeOrRatioSelect + typedef SELECT IfcTimeOrRatioSelect; + // C++ wrapper type for IfcTranslationalStiffnessSelect + typedef SELECT IfcTranslationalStiffnessSelect; + // C++ wrapper type for IfcTrimmingSelect + typedef SELECT IfcTrimmingSelect; + // C++ wrapper type for IfcUnit + typedef SELECT IfcUnit; + // C++ wrapper type for IfcValue + typedef SELECT IfcValue; + // C++ wrapper type for IfcVectorOrDirection + typedef SELECT IfcVectorOrDirection; + // C++ wrapper type for IfcWarpingStiffnessSelect + typedef SELECT IfcWarpingStiffnessSelect; + + + // ****************************************************************************** + // IFC Entities + // ****************************************************************************** + + struct IfcRoot; + struct IfcObjectDefinition; + struct IfcObject; + struct IfcControl; + struct IfcActionRequest; + struct IfcActor; + typedef NotImplemented IfcActorRole; // (not currently used by Assimp) + struct IfcProduct; + struct IfcElement; + struct IfcDistributionElement; + struct IfcDistributionControlElement; + struct IfcActuator; + struct IfcTypeObject; + struct IfcTypeProduct; + struct IfcElementType; + struct IfcDistributionElementType; + struct IfcDistributionControlElementType; + struct IfcActuatorType; + typedef NotImplemented IfcAddress; // (not currently used by Assimp) + struct IfcRepresentationItem; + struct IfcGeometricRepresentationItem; + struct IfcSolidModel; + struct IfcManifoldSolidBrep; + struct IfcAdvancedBrep; + struct IfcAdvancedBrepWithVoids; + struct IfcTopologicalRepresentationItem; + struct IfcFace; + struct IfcFaceSurface; + struct IfcAdvancedFace; + struct IfcDistributionFlowElement; + struct IfcFlowTerminal; + struct IfcAirTerminal; + struct IfcFlowController; + struct IfcAirTerminalBox; + struct IfcDistributionFlowElementType; + struct IfcFlowControllerType; + struct IfcAirTerminalBoxType; + struct IfcFlowTerminalType; + struct IfcAirTerminalType; + struct IfcEnergyConversionDevice; + struct IfcAirToAirHeatRecovery; + struct IfcEnergyConversionDeviceType; + struct IfcAirToAirHeatRecoveryType; + struct IfcAlarm; + struct IfcAlarmType; + struct IfcAnnotation; + struct IfcAnnotationFillArea; + typedef NotImplemented IfcApplication; // (not currently used by Assimp) + typedef NotImplemented IfcAppliedValue; // (not currently used by Assimp) + typedef NotImplemented IfcApproval; // (not currently used by Assimp) + typedef NotImplemented IfcResourceLevelRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcApprovalRelationship; // (not currently used by Assimp) + struct IfcProfileDef; + struct IfcArbitraryClosedProfileDef; + struct IfcArbitraryOpenProfileDef; + struct IfcArbitraryProfileDefWithVoids; + struct IfcGroup; + struct IfcAsset; + struct IfcParameterizedProfileDef; + struct IfcAsymmetricIShapeProfileDef; + struct IfcAudioVisualAppliance; + struct IfcAudioVisualApplianceType; + struct IfcPlacement; + struct IfcAxis1Placement; + struct IfcAxis2Placement2D; + struct IfcAxis2Placement3D; + struct IfcCurve; + struct IfcBoundedCurve; + struct IfcBSplineCurve; + struct IfcBSplineCurveWithKnots; + struct IfcSurface; + struct IfcBoundedSurface; + struct IfcBSplineSurface; + struct IfcBSplineSurfaceWithKnots; + struct IfcBuildingElement; + struct IfcBeam; + struct IfcBeamStandardCase; + struct IfcBuildingElementType; + struct IfcBeamType; + struct IfcPresentationItem; + typedef NotImplemented IfcSurfaceTexture; // (not currently used by Assimp) + typedef NotImplemented IfcBlobTexture; // (not currently used by Assimp) + struct IfcCsgPrimitive3D; + struct IfcBlock; + struct IfcBoiler; + struct IfcBoilerType; + struct IfcBooleanResult; + struct IfcBooleanClippingResult; + typedef NotImplemented IfcBoundaryCondition; // (not currently used by Assimp) + struct IfcCompositeCurve; + struct IfcCompositeCurveOnSurface; + struct IfcBoundaryCurve; + typedef NotImplemented IfcBoundaryEdgeCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryFaceCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryNodeCondition; // (not currently used by Assimp) + typedef NotImplemented IfcBoundaryNodeConditionWarping; // (not currently used by Assimp) + struct IfcBoundingBox; + struct IfcHalfSpaceSolid; + struct IfcBoxedHalfSpace; + struct IfcSpatialElement; + struct IfcSpatialStructureElement; + struct IfcBuilding; + struct IfcElementComponent; + struct IfcBuildingElementPart; + struct IfcElementComponentType; + struct IfcBuildingElementPartType; + struct IfcBuildingElementProxy; + struct IfcBuildingElementProxyType; + struct IfcBuildingStorey; + struct IfcSystem; + struct IfcBuildingSystem; + struct IfcBurner; + struct IfcBurnerType; + struct IfcCShapeProfileDef; + struct IfcFlowFitting; + struct IfcCableCarrierFitting; + struct IfcFlowFittingType; + struct IfcCableCarrierFittingType; + struct IfcFlowSegment; + struct IfcCableCarrierSegment; + struct IfcFlowSegmentType; + struct IfcCableCarrierSegmentType; + struct IfcCableFitting; + struct IfcCableFittingType; + struct IfcCableSegment; + struct IfcCableSegmentType; + struct IfcPoint; + struct IfcCartesianPoint; + struct IfcCartesianPointList; + struct IfcCartesianPointList2D; + struct IfcCartesianPointList3D; + struct IfcCartesianTransformationOperator; + struct IfcCartesianTransformationOperator2D; + struct IfcCartesianTransformationOperator2DnonUniform; + struct IfcCartesianTransformationOperator3D; + struct IfcCartesianTransformationOperator3DnonUniform; + struct IfcCenterLineProfileDef; + struct IfcChiller; + struct IfcChillerType; + struct IfcChimney; + struct IfcChimneyType; + struct IfcConic; + struct IfcCircle; + struct IfcCircleProfileDef; + struct IfcCircleHollowProfileDef; + struct IfcCivilElement; + struct IfcCivilElementType; + typedef NotImplemented IfcExternalInformation; // (not currently used by Assimp) + typedef NotImplemented IfcClassification; // (not currently used by Assimp) + typedef NotImplemented IfcExternalReference; // (not currently used by Assimp) + typedef NotImplemented IfcClassificationReference; // (not currently used by Assimp) + struct IfcConnectedFaceSet; + struct IfcClosedShell; + struct IfcCoil; + struct IfcCoilType; + struct IfcColourSpecification; + struct IfcColourRgb; + typedef NotImplemented IfcColourRgbList; // (not currently used by Assimp) + struct IfcColumn; + struct IfcColumnStandardCase; + struct IfcColumnType; + struct IfcCommunicationsAppliance; + struct IfcCommunicationsApplianceType; + struct IfcPropertyAbstraction; + struct IfcProperty; + struct IfcComplexProperty; + struct IfcPropertyDefinition; + typedef NotImplemented IfcPropertyTemplateDefinition; // (not currently used by Assimp) + typedef NotImplemented IfcPropertyTemplate; // (not currently used by Assimp) + typedef NotImplemented IfcComplexPropertyTemplate; // (not currently used by Assimp) + struct IfcCompositeCurveSegment; + struct IfcCompositeProfileDef; + struct IfcFlowMovingDevice; + struct IfcCompressor; + struct IfcFlowMovingDeviceType; + struct IfcCompressorType; + struct IfcCondenser; + struct IfcCondenserType; + typedef NotImplemented IfcConnectionGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionCurveGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionPointGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionPointEccentricity; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionSurfaceGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConnectionVolumeGeometry; // (not currently used by Assimp) + typedef NotImplemented IfcConstraint; // (not currently used by Assimp) + struct IfcResource; + struct IfcConstructionResource; + struct IfcConstructionEquipmentResource; + struct IfcTypeResource; + struct IfcConstructionResourceType; + struct IfcConstructionEquipmentResourceType; + struct IfcConstructionMaterialResource; + struct IfcConstructionMaterialResourceType; + struct IfcConstructionProductResource; + struct IfcConstructionProductResourceType; + struct IfcContext; + struct IfcNamedUnit; + struct IfcContextDependentUnit; + struct IfcController; + struct IfcControllerType; + struct IfcConversionBasedUnit; + struct IfcConversionBasedUnitWithOffset; + struct IfcCooledBeam; + struct IfcCooledBeamType; + struct IfcCoolingTower; + struct IfcCoolingTowerType; + typedef NotImplemented IfcCoordinateOperation; // (not currently used by Assimp) + typedef NotImplemented IfcCoordinateReferenceSystem; // (not currently used by Assimp) + struct IfcCostItem; + struct IfcCostSchedule; + typedef NotImplemented IfcCostValue; // (not currently used by Assimp) + struct IfcCovering; + struct IfcCoveringType; + struct IfcCrewResource; + struct IfcCrewResourceType; + struct IfcCsgSolid; + typedef NotImplemented IfcCurrencyRelationship; // (not currently used by Assimp) + struct IfcCurtainWall; + struct IfcCurtainWallType; + struct IfcCurveBoundedPlane; + struct IfcCurveBoundedSurface; + struct IfcPresentationStyle; + typedef NotImplemented IfcCurveStyle; // (not currently used by Assimp) + typedef NotImplemented IfcCurveStyleFont; // (not currently used by Assimp) + typedef NotImplemented IfcCurveStyleFontAndScaling; // (not currently used by Assimp) + typedef NotImplemented IfcCurveStyleFontPattern; // (not currently used by Assimp) + struct IfcElementarySurface; + struct IfcCylindricalSurface; + struct IfcDamper; + struct IfcDamperType; + struct IfcDerivedProfileDef; + typedef NotImplemented IfcDerivedUnit; // (not currently used by Assimp) + typedef NotImplemented IfcDerivedUnitElement; // (not currently used by Assimp) + typedef NotImplemented IfcDimensionalExponents; // (not currently used by Assimp) + struct IfcDirection; + struct IfcDiscreteAccessory; + struct IfcDiscreteAccessoryType; + struct IfcDistributionChamberElement; + struct IfcDistributionChamberElementType; + struct IfcDistributionSystem; + struct IfcDistributionCircuit; + struct IfcPort; + struct IfcDistributionPort; + typedef NotImplemented IfcDocumentInformation; // (not currently used by Assimp) + typedef NotImplemented IfcDocumentInformationRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcDocumentReference; // (not currently used by Assimp) + struct IfcDoor; + struct IfcPropertySetDefinition; + typedef NotImplemented IfcPreDefinedPropertySet; // (not currently used by Assimp) + typedef NotImplemented IfcDoorLiningProperties; // (not currently used by Assimp) + typedef NotImplemented IfcDoorPanelProperties; // (not currently used by Assimp) + struct IfcDoorStandardCase; + struct IfcDoorStyle; + struct IfcDoorType; + typedef NotImplemented IfcPreDefinedItem; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedColour; // (not currently used by Assimp) + typedef NotImplemented IfcDraughtingPreDefinedColour; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedCurveFont; // (not currently used by Assimp) + typedef NotImplemented IfcDraughtingPreDefinedCurveFont; // (not currently used by Assimp) + struct IfcDuctFitting; + struct IfcDuctFittingType; + struct IfcDuctSegment; + struct IfcDuctSegmentType; + struct IfcFlowTreatmentDevice; + struct IfcDuctSilencer; + struct IfcFlowTreatmentDeviceType; + struct IfcDuctSilencerType; + struct IfcEdge; + struct IfcEdgeCurve; + struct IfcLoop; + struct IfcEdgeLoop; + struct IfcElectricAppliance; + struct IfcElectricApplianceType; + struct IfcElectricDistributionBoard; + struct IfcElectricDistributionBoardType; + struct IfcFlowStorageDevice; + struct IfcElectricFlowStorageDevice; + struct IfcFlowStorageDeviceType; + struct IfcElectricFlowStorageDeviceType; + struct IfcElectricGenerator; + struct IfcElectricGeneratorType; + struct IfcElectricMotor; + struct IfcElectricMotorType; + struct IfcElectricTimeControl; + struct IfcElectricTimeControlType; + struct IfcElementAssembly; + struct IfcElementAssemblyType; + struct IfcQuantitySet; + struct IfcElementQuantity; + struct IfcEllipse; + struct IfcEllipseProfileDef; + struct IfcEngine; + struct IfcEngineType; + struct IfcEvaporativeCooler; + struct IfcEvaporativeCoolerType; + struct IfcEvaporator; + struct IfcEvaporatorType; + struct IfcProcess; + struct IfcEvent; + typedef NotImplemented IfcSchedulingTime; // (not currently used by Assimp) + typedef NotImplemented IfcEventTime; // (not currently used by Assimp) + struct IfcTypeProcess; + struct IfcEventType; + typedef NotImplemented IfcExtendedProperties; // (not currently used by Assimp) + typedef NotImplemented IfcExternalReferenceRelationship; // (not currently used by Assimp) + struct IfcExternalSpatialStructureElement; + struct IfcExternalSpatialElement; + typedef NotImplemented IfcExternallyDefinedHatchStyle; // (not currently used by Assimp) + typedef NotImplemented IfcExternallyDefinedSurfaceStyle; // (not currently used by Assimp) + typedef NotImplemented IfcExternallyDefinedTextFont; // (not currently used by Assimp) + struct IfcSweptAreaSolid; + struct IfcExtrudedAreaSolid; + struct IfcExtrudedAreaSolidTapered; + struct IfcFaceBasedSurfaceModel; + struct IfcFaceBound; + struct IfcFaceOuterBound; + struct IfcFacetedBrep; + struct IfcFacetedBrepWithVoids; + typedef NotImplemented IfcStructuralConnectionCondition; // (not currently used by Assimp) + typedef NotImplemented IfcFailureConnectionCondition; // (not currently used by Assimp) + struct IfcFan; + struct IfcFanType; + struct IfcFastener; + struct IfcFastenerType; + struct IfcFeatureElement; + struct IfcFeatureElementAddition; + struct IfcFeatureElementSubtraction; + typedef NotImplemented IfcFillAreaStyle; // (not currently used by Assimp) + struct IfcFillAreaStyleHatching; + struct IfcFillAreaStyleTiles; + struct IfcFilter; + struct IfcFilterType; + struct IfcFireSuppressionTerminal; + struct IfcFireSuppressionTerminalType; + struct IfcFixedReferenceSweptAreaSolid; + struct IfcFlowInstrument; + struct IfcFlowInstrumentType; + struct IfcFlowMeter; + struct IfcFlowMeterType; + struct IfcFooting; + struct IfcFootingType; + struct IfcFurnishingElement; + struct IfcFurnishingElementType; + struct IfcFurniture; + struct IfcFurnitureType; + struct IfcGeographicElement; + struct IfcGeographicElementType; + struct IfcGeometricSet; + struct IfcGeometricCurveSet; + struct IfcRepresentationContext; + struct IfcGeometricRepresentationContext; + struct IfcGeometricRepresentationSubContext; + struct IfcGrid; + typedef NotImplemented IfcGridAxis; // (not currently used by Assimp) + struct IfcObjectPlacement; + struct IfcGridPlacement; + struct IfcHeatExchanger; + struct IfcHeatExchangerType; + struct IfcHumidifier; + struct IfcHumidifierType; + struct IfcIShapeProfileDef; + typedef NotImplemented IfcImageTexture; // (not currently used by Assimp) + typedef NotImplemented IfcIndexedColourMap; // (not currently used by Assimp) + struct IfcIndexedPolyCurve; + struct IfcTessellatedItem; + struct IfcIndexedPolygonalFace; + struct IfcIndexedPolygonalFaceWithVoids; + typedef NotImplemented IfcTextureCoordinate; // (not currently used by Assimp) + typedef NotImplemented IfcIndexedTextureMap; // (not currently used by Assimp) + typedef NotImplemented IfcIndexedTriangleTextureMap; // (not currently used by Assimp) + struct IfcInterceptor; + struct IfcInterceptorType; + struct IfcSurfaceCurve; + struct IfcIntersectionCurve; + struct IfcInventory; + typedef NotImplemented IfcTimeSeries; // (not currently used by Assimp) + typedef NotImplemented IfcIrregularTimeSeries; // (not currently used by Assimp) + typedef NotImplemented IfcIrregularTimeSeriesValue; // (not currently used by Assimp) + struct IfcJunctionBox; + struct IfcJunctionBoxType; + struct IfcLShapeProfileDef; + struct IfcLaborResource; + struct IfcLaborResourceType; + typedef NotImplemented IfcLagTime; // (not currently used by Assimp) + struct IfcLamp; + struct IfcLampType; + typedef NotImplemented IfcLibraryInformation; // (not currently used by Assimp) + typedef NotImplemented IfcLibraryReference; // (not currently used by Assimp) + typedef NotImplemented IfcLightDistributionData; // (not currently used by Assimp) + struct IfcLightFixture; + struct IfcLightFixtureType; + typedef NotImplemented IfcLightIntensityDistribution; // (not currently used by Assimp) + struct IfcLightSource; + struct IfcLightSourceAmbient; + struct IfcLightSourceDirectional; + struct IfcLightSourceGoniometric; + struct IfcLightSourcePositional; + struct IfcLightSourceSpot; + struct IfcLine; + struct IfcLocalPlacement; + typedef NotImplemented IfcMapConversion; // (not currently used by Assimp) + struct IfcMappedItem; + typedef NotImplemented IfcMaterialDefinition; // (not currently used by Assimp) + typedef NotImplemented IfcMaterial; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialClassificationRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialConstituent; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialConstituentSet; // (not currently used by Assimp) + struct IfcProductRepresentation; + struct IfcMaterialDefinitionRepresentation; + typedef NotImplemented IfcMaterialLayer; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialLayerSet; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialUsageDefinition; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialLayerSetUsage; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialLayerWithOffsets; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialList; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialProfile; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialProfileSet; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialProfileSetUsage; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialProfileSetUsageTapering; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialProfileWithOffsets; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialProperties; // (not currently used by Assimp) + typedef NotImplemented IfcMaterialRelationship; // (not currently used by Assimp) + struct IfcMeasureWithUnit; + struct IfcMechanicalFastener; + struct IfcMechanicalFastenerType; + struct IfcMedicalDevice; + struct IfcMedicalDeviceType; + struct IfcMember; + struct IfcMemberStandardCase; + struct IfcMemberType; + typedef NotImplemented IfcMetric; // (not currently used by Assimp) + struct IfcMirroredProfileDef; + typedef NotImplemented IfcMonetaryUnit; // (not currently used by Assimp) + struct IfcMotorConnection; + struct IfcMotorConnectionType; + typedef NotImplemented IfcObjective; // (not currently used by Assimp) + struct IfcOccupant; + struct IfcOffsetCurve2D; + struct IfcOffsetCurve3D; + struct IfcOpenShell; + struct IfcOpeningElement; + struct IfcOpeningStandardCase; + typedef NotImplemented IfcOrganization; // (not currently used by Assimp) + typedef NotImplemented IfcOrganizationRelationship; // (not currently used by Assimp) + struct IfcOrientedEdge; + struct IfcOuterBoundaryCurve; + struct IfcOutlet; + struct IfcOutletType; + typedef NotImplemented IfcOwnerHistory; // (not currently used by Assimp) + struct IfcPath; + struct IfcPcurve; + struct IfcPerformanceHistory; + typedef NotImplemented IfcPermeableCoveringProperties; // (not currently used by Assimp) + struct IfcPermit; + typedef NotImplemented IfcPerson; // (not currently used by Assimp) + typedef NotImplemented IfcPersonAndOrganization; // (not currently used by Assimp) + typedef NotImplemented IfcPhysicalQuantity; // (not currently used by Assimp) + typedef NotImplemented IfcPhysicalComplexQuantity; // (not currently used by Assimp) + typedef NotImplemented IfcPhysicalSimpleQuantity; // (not currently used by Assimp) + struct IfcPile; + struct IfcPileType; + struct IfcPipeFitting; + struct IfcPipeFittingType; + struct IfcPipeSegment; + struct IfcPipeSegmentType; + typedef NotImplemented IfcPixelTexture; // (not currently used by Assimp) + struct IfcPlanarExtent; + struct IfcPlanarBox; + struct IfcPlane; + struct IfcPlate; + struct IfcPlateStandardCase; + struct IfcPlateType; + struct IfcPointOnCurve; + struct IfcPointOnSurface; + struct IfcPolyLoop; + struct IfcPolygonalBoundedHalfSpace; + struct IfcTessellatedFaceSet; + struct IfcPolygonalFaceSet; + struct IfcPolyline; + typedef NotImplemented IfcPostalAddress; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedProperties; // (not currently used by Assimp) + typedef NotImplemented IfcPreDefinedTextFont; // (not currently used by Assimp) + typedef NotImplemented IfcPresentationLayerAssignment; // (not currently used by Assimp) + typedef NotImplemented IfcPresentationLayerWithStyle; // (not currently used by Assimp) + struct IfcPresentationStyleAssignment; + struct IfcProcedure; + struct IfcProcedureType; + struct IfcProductDefinitionShape; + typedef NotImplemented IfcProfileProperties; // (not currently used by Assimp) + struct IfcProject; + struct IfcProjectLibrary; + struct IfcProjectOrder; + typedef NotImplemented IfcProjectedCRS; // (not currently used by Assimp) + struct IfcProjectionElement; + struct IfcSimpleProperty; + struct IfcPropertyBoundedValue; + typedef NotImplemented IfcPropertyDependencyRelationship; // (not currently used by Assimp) + struct IfcPropertyEnumeratedValue; + typedef NotImplemented IfcPropertyEnumeration; // (not currently used by Assimp) + struct IfcPropertyListValue; + struct IfcPropertyReferenceValue; + struct IfcPropertySet; + typedef NotImplemented IfcPropertySetTemplate; // (not currently used by Assimp) + struct IfcPropertySingleValue; + struct IfcPropertyTableValue; + struct IfcProtectiveDevice; + struct IfcProtectiveDeviceTrippingUnit; + struct IfcProtectiveDeviceTrippingUnitType; + struct IfcProtectiveDeviceType; + struct IfcProxy; + struct IfcPump; + struct IfcPumpType; + typedef NotImplemented IfcQuantityArea; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityCount; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityLength; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityTime; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityVolume; // (not currently used by Assimp) + typedef NotImplemented IfcQuantityWeight; // (not currently used by Assimp) + struct IfcRailing; + struct IfcRailingType; + struct IfcRamp; + struct IfcRampFlight; + struct IfcRampFlightType; + struct IfcRampType; + struct IfcRationalBSplineCurveWithKnots; + struct IfcRationalBSplineSurfaceWithKnots; + struct IfcRectangleProfileDef; + struct IfcRectangleHollowProfileDef; + struct IfcRectangularPyramid; + struct IfcRectangularTrimmedSurface; + typedef NotImplemented IfcRecurrencePattern; // (not currently used by Assimp) + typedef NotImplemented IfcReference; // (not currently used by Assimp) + typedef NotImplemented IfcRegularTimeSeries; // (not currently used by Assimp) + typedef NotImplemented IfcReinforcementBarProperties; // (not currently used by Assimp) + typedef NotImplemented IfcReinforcementDefinitionProperties; // (not currently used by Assimp) + struct IfcReinforcingElement; + struct IfcReinforcingBar; + struct IfcReinforcingElementType; + struct IfcReinforcingBarType; + struct IfcReinforcingMesh; + struct IfcReinforcingMeshType; + struct IfcRelationship; + struct IfcRelDecomposes; + struct IfcRelAggregates; + typedef NotImplemented IfcRelAssigns; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToActor; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToControl; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToGroup; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToGroupByFactor; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToProcess; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToProduct; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssignsToResource; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociates; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesApproval; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesClassification; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesConstraint; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesDocument; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesLibrary; // (not currently used by Assimp) + typedef NotImplemented IfcRelAssociatesMaterial; // (not currently used by Assimp) + struct IfcRelConnects; + typedef NotImplemented IfcRelConnectsElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsPathElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsPortToElement; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsPorts; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsStructuralActivity; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsStructuralMember; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsWithEccentricity; // (not currently used by Assimp) + typedef NotImplemented IfcRelConnectsWithRealizingElements; // (not currently used by Assimp) + struct IfcRelContainedInSpatialStructure; + typedef NotImplemented IfcRelCoversBldgElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelCoversSpaces; // (not currently used by Assimp) + typedef NotImplemented IfcRelDeclares; // (not currently used by Assimp) + struct IfcRelDefines; + typedef NotImplemented IfcRelDefinesByObject; // (not currently used by Assimp) + struct IfcRelDefinesByProperties; + typedef NotImplemented IfcRelDefinesByTemplate; // (not currently used by Assimp) + typedef NotImplemented IfcRelDefinesByType; // (not currently used by Assimp) + struct IfcRelFillsElement; + typedef NotImplemented IfcRelFlowControlElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelInterferesElements; // (not currently used by Assimp) + typedef NotImplemented IfcRelNests; // (not currently used by Assimp) + typedef NotImplemented IfcRelProjectsElement; // (not currently used by Assimp) + typedef NotImplemented IfcRelReferencedInSpatialStructure; // (not currently used by Assimp) + typedef NotImplemented IfcRelSequence; // (not currently used by Assimp) + typedef NotImplemented IfcRelServicesBuildings; // (not currently used by Assimp) + typedef NotImplemented IfcRelSpaceBoundary; // (not currently used by Assimp) + typedef NotImplemented IfcRelSpaceBoundary1stLevel; // (not currently used by Assimp) + typedef NotImplemented IfcRelSpaceBoundary2ndLevel; // (not currently used by Assimp) + struct IfcRelVoidsElement; + struct IfcReparametrisedCompositeCurveSegment; + struct IfcRepresentation; + struct IfcRepresentationMap; + typedef NotImplemented IfcResourceApprovalRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcResourceConstraintRelationship; // (not currently used by Assimp) + typedef NotImplemented IfcResourceTime; // (not currently used by Assimp) + struct IfcRevolvedAreaSolid; + struct IfcRevolvedAreaSolidTapered; + struct IfcRightCircularCone; + struct IfcRightCircularCylinder; + struct IfcRoof; + struct IfcRoofType; + struct IfcRoundedRectangleProfileDef; + struct IfcSIUnit; + struct IfcSanitaryTerminal; + struct IfcSanitaryTerminalType; + struct IfcSeamCurve; + typedef NotImplemented IfcSectionProperties; // (not currently used by Assimp) + typedef NotImplemented IfcSectionReinforcementProperties; // (not currently used by Assimp) + struct IfcSectionedSpine; + struct IfcSensor; + struct IfcSensorType; + struct IfcShadingDevice; + struct IfcShadingDeviceType; + typedef NotImplemented IfcShapeAspect; // (not currently used by Assimp) + struct IfcShapeModel; + struct IfcShapeRepresentation; + struct IfcShellBasedSurfaceModel; + typedef NotImplemented IfcSimplePropertyTemplate; // (not currently used by Assimp) + struct IfcSite; + struct IfcSlab; + struct IfcSlabElementedCase; + struct IfcSlabStandardCase; + struct IfcSlabType; + typedef NotImplemented IfcSlippageConnectionCondition; // (not currently used by Assimp) + struct IfcSolarDevice; + struct IfcSolarDeviceType; + struct IfcSpace; + struct IfcSpaceHeater; + struct IfcSpaceHeaterType; + struct IfcSpatialElementType; + struct IfcSpatialStructureElementType; + struct IfcSpaceType; + struct IfcSpatialZone; + struct IfcSpatialZoneType; + struct IfcSphere; + struct IfcSphericalSurface; + struct IfcStackTerminal; + struct IfcStackTerminalType; + struct IfcStair; + struct IfcStairFlight; + struct IfcStairFlightType; + struct IfcStairType; + struct IfcStructuralActivity; + struct IfcStructuralAction; + struct IfcStructuralAnalysisModel; + struct IfcStructuralItem; + struct IfcStructuralConnection; + struct IfcStructuralCurveAction; + struct IfcStructuralCurveConnection; + struct IfcStructuralMember; + struct IfcStructuralCurveMember; + struct IfcStructuralCurveMemberVarying; + struct IfcStructuralReaction; + struct IfcStructuralCurveReaction; + struct IfcStructuralLinearAction; + typedef NotImplemented IfcStructuralLoad; // (not currently used by Assimp) + struct IfcStructuralLoadGroup; + struct IfcStructuralLoadCase; + typedef NotImplemented IfcStructuralLoadConfiguration; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadOrResult; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadStatic; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadLinearForce; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadPlanarForce; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleDisplacement; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleDisplacementDistortion; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleForce; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadSingleForceWarping; // (not currently used by Assimp) + typedef NotImplemented IfcStructuralLoadTemperature; // (not currently used by Assimp) + struct IfcStructuralSurfaceAction; + struct IfcStructuralPlanarAction; + struct IfcStructuralPointAction; + struct IfcStructuralPointConnection; + struct IfcStructuralPointReaction; + struct IfcStructuralResultGroup; + struct IfcStructuralSurfaceConnection; + struct IfcStructuralSurfaceMember; + struct IfcStructuralSurfaceMemberVarying; + struct IfcStructuralSurfaceReaction; + struct IfcStyleModel; + struct IfcStyledItem; + struct IfcStyledRepresentation; + struct IfcSubContractResource; + struct IfcSubContractResourceType; + struct IfcSubedge; + struct IfcSurfaceCurveSweptAreaSolid; + struct IfcSurfaceFeature; + struct IfcSweptSurface; + struct IfcSurfaceOfLinearExtrusion; + struct IfcSurfaceOfRevolution; + typedef NotImplemented IfcSurfaceReinforcementArea; // (not currently used by Assimp) + struct IfcSurfaceStyle; + typedef NotImplemented IfcSurfaceStyleLighting; // (not currently used by Assimp) + typedef NotImplemented IfcSurfaceStyleRefraction; // (not currently used by Assimp) + struct IfcSurfaceStyleShading; + struct IfcSurfaceStyleRendering; + struct IfcSurfaceStyleWithTextures; + struct IfcSweptDiskSolid; + struct IfcSweptDiskSolidPolygonal; + struct IfcSwitchingDevice; + struct IfcSwitchingDeviceType; + struct IfcSystemFurnitureElement; + struct IfcSystemFurnitureElementType; + struct IfcTShapeProfileDef; + typedef NotImplemented IfcTable; // (not currently used by Assimp) + typedef NotImplemented IfcTableColumn; // (not currently used by Assimp) + typedef NotImplemented IfcTableRow; // (not currently used by Assimp) + struct IfcTank; + struct IfcTankType; + struct IfcTask; + typedef NotImplemented IfcTaskTime; // (not currently used by Assimp) + typedef NotImplemented IfcTaskTimeRecurring; // (not currently used by Assimp) + struct IfcTaskType; + typedef NotImplemented IfcTelecomAddress; // (not currently used by Assimp) + struct IfcTendon; + struct IfcTendonAnchor; + struct IfcTendonAnchorType; + struct IfcTendonType; + struct IfcTextLiteral; + struct IfcTextLiteralWithExtent; + typedef NotImplemented IfcTextStyle; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleFontModel; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleForDefinedFont; // (not currently used by Assimp) + typedef NotImplemented IfcTextStyleTextModel; // (not currently used by Assimp) + typedef NotImplemented IfcTextureCoordinateGenerator; // (not currently used by Assimp) + typedef NotImplemented IfcTextureMap; // (not currently used by Assimp) + typedef NotImplemented IfcTextureVertex; // (not currently used by Assimp) + typedef NotImplemented IfcTextureVertexList; // (not currently used by Assimp) + typedef NotImplemented IfcTimePeriod; // (not currently used by Assimp) + typedef NotImplemented IfcTimeSeriesValue; // (not currently used by Assimp) + struct IfcTopologyRepresentation; + struct IfcToroidalSurface; + struct IfcTransformer; + struct IfcTransformerType; + struct IfcTransportElement; + struct IfcTransportElementType; + struct IfcTrapeziumProfileDef; + struct IfcTriangulatedFaceSet; + struct IfcTrimmedCurve; + struct IfcTubeBundle; + struct IfcTubeBundleType; + struct IfcUShapeProfileDef; + struct IfcUnitAssignment; + struct IfcUnitaryControlElement; + struct IfcUnitaryControlElementType; + struct IfcUnitaryEquipment; + struct IfcUnitaryEquipmentType; + struct IfcValve; + struct IfcValveType; + struct IfcVector; + struct IfcVertex; + struct IfcVertexLoop; + struct IfcVertexPoint; + struct IfcVibrationIsolator; + struct IfcVibrationIsolatorType; + struct IfcVirtualElement; + typedef NotImplemented IfcVirtualGridIntersection; // (not currently used by Assimp) + struct IfcVoidingFeature; + struct IfcWall; + struct IfcWallElementedCase; + struct IfcWallStandardCase; + struct IfcWallType; + struct IfcWasteTerminal; + struct IfcWasteTerminalType; + struct IfcWindow; + typedef NotImplemented IfcWindowLiningProperties; // (not currently used by Assimp) + typedef NotImplemented IfcWindowPanelProperties; // (not currently used by Assimp) + struct IfcWindowStandardCase; + struct IfcWindowStyle; + struct IfcWindowType; + struct IfcWorkCalendar; + struct IfcWorkControl; + struct IfcWorkPlan; + struct IfcWorkSchedule; + typedef NotImplemented IfcWorkTime; // (not currently used by Assimp) + struct IfcZShapeProfileDef; + struct IfcZone; + + + + // C++ wrapper for IfcRoot + struct IfcRoot : ObjectHelper { IfcRoot() : Object("IfcRoot") {} + IfcGloballyUniqueId::Out GlobalId; + Maybe< Lazy< NotImplemented > > OwnerHistory; + Maybe< IfcLabel::Out > Name; + Maybe< IfcText::Out > Description; + }; + + // C++ wrapper for IfcObjectDefinition + struct IfcObjectDefinition : IfcRoot, ObjectHelper { IfcObjectDefinition() : Object("IfcObjectDefinition") {} + + }; + + // C++ wrapper for IfcObject + struct IfcObject : IfcObjectDefinition, ObjectHelper { IfcObject() : Object("IfcObject") {} + Maybe< IfcLabel::Out > ObjectType; + }; + + // C++ wrapper for IfcControl + struct IfcControl : IfcObject, ObjectHelper { IfcControl() : Object("IfcControl") {} + Maybe< IfcIdentifier::Out > Identification; + }; + + // C++ wrapper for IfcActionRequest + struct IfcActionRequest : IfcControl, ObjectHelper { IfcActionRequest() : Object("IfcActionRequest") {} + Maybe< IfcActionRequestTypeEnum::Out > PredefinedType; + Maybe< IfcLabel::Out > Status; + Maybe< IfcText::Out > LongDescription; + }; + + // C++ wrapper for IfcActor + struct IfcActor : IfcObject, ObjectHelper { IfcActor() : Object("IfcActor") {} + IfcActorSelect::Out TheActor; + }; + + // C++ wrapper for IfcProduct + struct IfcProduct : IfcObject, ObjectHelper { IfcProduct() : Object("IfcProduct") {} + Maybe< Lazy< IfcObjectPlacement > > ObjectPlacement; + Maybe< Lazy< IfcProductRepresentation > > Representation; + }; + + // C++ wrapper for IfcElement + struct IfcElement : IfcProduct, ObjectHelper { IfcElement() : Object("IfcElement") {} + Maybe< IfcIdentifier::Out > Tag; + }; + + // C++ wrapper for IfcDistributionElement + struct IfcDistributionElement : IfcElement, ObjectHelper { IfcDistributionElement() : Object("IfcDistributionElement") {} + + }; + + // C++ wrapper for IfcDistributionControlElement + struct IfcDistributionControlElement : IfcDistributionElement, ObjectHelper { IfcDistributionControlElement() : Object("IfcDistributionControlElement") {} + + }; + + // C++ wrapper for IfcActuator + struct IfcActuator : IfcDistributionControlElement, ObjectHelper { IfcActuator() : Object("IfcActuator") {} + Maybe< IfcActuatorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTypeObject + struct IfcTypeObject : IfcObjectDefinition, ObjectHelper { IfcTypeObject() : Object("IfcTypeObject") {} + Maybe< IfcIdentifier::Out > ApplicableOccurrence; + Maybe< ListOf< Lazy< IfcPropertySetDefinition >, 1, 0 > > HasPropertySets; + }; + + // C++ wrapper for IfcTypeProduct + struct IfcTypeProduct : IfcTypeObject, ObjectHelper { IfcTypeProduct() : Object("IfcTypeProduct") {} + Maybe< ListOf< Lazy< IfcRepresentationMap >, 1, 0 > > RepresentationMaps; + Maybe< IfcLabel::Out > Tag; + }; + + // C++ wrapper for IfcElementType + struct IfcElementType : IfcTypeProduct, ObjectHelper { IfcElementType() : Object("IfcElementType") {} + Maybe< IfcLabel::Out > ElementType; + }; + + // C++ wrapper for IfcDistributionElementType + struct IfcDistributionElementType : IfcElementType, ObjectHelper { IfcDistributionElementType() : Object("IfcDistributionElementType") {} + + }; + + // C++ wrapper for IfcDistributionControlElementType + struct IfcDistributionControlElementType : IfcDistributionElementType, ObjectHelper { IfcDistributionControlElementType() : Object("IfcDistributionControlElementType") {} + + }; + + // C++ wrapper for IfcActuatorType + struct IfcActuatorType : IfcDistributionControlElementType, ObjectHelper { IfcActuatorType() : Object("IfcActuatorType") {} + IfcActuatorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRepresentationItem + struct IfcRepresentationItem : ObjectHelper { IfcRepresentationItem() : Object("IfcRepresentationItem") {} + + }; + + // C++ wrapper for IfcGeometricRepresentationItem + struct IfcGeometricRepresentationItem : IfcRepresentationItem, ObjectHelper { IfcGeometricRepresentationItem() : Object("IfcGeometricRepresentationItem") {} + + }; + + // C++ wrapper for IfcSolidModel + struct IfcSolidModel : IfcGeometricRepresentationItem, ObjectHelper { IfcSolidModel() : Object("IfcSolidModel") {} + + }; + + // C++ wrapper for IfcManifoldSolidBrep + struct IfcManifoldSolidBrep : IfcSolidModel, ObjectHelper { IfcManifoldSolidBrep() : Object("IfcManifoldSolidBrep") {} + Lazy< IfcClosedShell > Outer; + }; + + // C++ wrapper for IfcAdvancedBrep + struct IfcAdvancedBrep : IfcManifoldSolidBrep, ObjectHelper { IfcAdvancedBrep() : Object("IfcAdvancedBrep") {} + + }; + + // C++ wrapper for IfcAdvancedBrepWithVoids + struct IfcAdvancedBrepWithVoids : IfcAdvancedBrep, ObjectHelper { IfcAdvancedBrepWithVoids() : Object("IfcAdvancedBrepWithVoids") {} + ListOf< Lazy< IfcClosedShell >, 1, 0 > Voids; + }; + + // C++ wrapper for IfcTopologicalRepresentationItem + struct IfcTopologicalRepresentationItem : IfcRepresentationItem, ObjectHelper { IfcTopologicalRepresentationItem() : Object("IfcTopologicalRepresentationItem") {} + + }; + + // C++ wrapper for IfcFace + struct IfcFace : IfcTopologicalRepresentationItem, ObjectHelper { IfcFace() : Object("IfcFace") {} + ListOf< Lazy< IfcFaceBound >, 1, 0 > Bounds; + }; + + // C++ wrapper for IfcFaceSurface + struct IfcFaceSurface : IfcFace, ObjectHelper { IfcFaceSurface() : Object("IfcFaceSurface") {} + Lazy< IfcSurface > FaceSurface; + IfcBoolean::Out SameSense; + }; + + // C++ wrapper for IfcAdvancedFace + struct IfcAdvancedFace : IfcFaceSurface, ObjectHelper { IfcAdvancedFace() : Object("IfcAdvancedFace") {} + + }; + + // C++ wrapper for IfcDistributionFlowElement + struct IfcDistributionFlowElement : IfcDistributionElement, ObjectHelper { IfcDistributionFlowElement() : Object("IfcDistributionFlowElement") {} + + }; + + // C++ wrapper for IfcFlowTerminal + struct IfcFlowTerminal : IfcDistributionFlowElement, ObjectHelper { IfcFlowTerminal() : Object("IfcFlowTerminal") {} + + }; + + // C++ wrapper for IfcAirTerminal + struct IfcAirTerminal : IfcFlowTerminal, ObjectHelper { IfcAirTerminal() : Object("IfcAirTerminal") {} + Maybe< IfcAirTerminalTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowController + struct IfcFlowController : IfcDistributionFlowElement, ObjectHelper { IfcFlowController() : Object("IfcFlowController") {} + + }; + + // C++ wrapper for IfcAirTerminalBox + struct IfcAirTerminalBox : IfcFlowController, ObjectHelper { IfcAirTerminalBox() : Object("IfcAirTerminalBox") {} + Maybe< IfcAirTerminalBoxTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDistributionFlowElementType + struct IfcDistributionFlowElementType : IfcDistributionElementType, ObjectHelper { IfcDistributionFlowElementType() : Object("IfcDistributionFlowElementType") {} + + }; + + // C++ wrapper for IfcFlowControllerType + struct IfcFlowControllerType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowControllerType() : Object("IfcFlowControllerType") {} + + }; + + // C++ wrapper for IfcAirTerminalBoxType + struct IfcAirTerminalBoxType : IfcFlowControllerType, ObjectHelper { IfcAirTerminalBoxType() : Object("IfcAirTerminalBoxType") {} + IfcAirTerminalBoxTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowTerminalType + struct IfcFlowTerminalType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowTerminalType() : Object("IfcFlowTerminalType") {} + + }; + + // C++ wrapper for IfcAirTerminalType + struct IfcAirTerminalType : IfcFlowTerminalType, ObjectHelper { IfcAirTerminalType() : Object("IfcAirTerminalType") {} + IfcAirTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEnergyConversionDevice + struct IfcEnergyConversionDevice : IfcDistributionFlowElement, ObjectHelper { IfcEnergyConversionDevice() : Object("IfcEnergyConversionDevice") {} + + }; + + // C++ wrapper for IfcAirToAirHeatRecovery + struct IfcAirToAirHeatRecovery : IfcEnergyConversionDevice, ObjectHelper { IfcAirToAirHeatRecovery() : Object("IfcAirToAirHeatRecovery") {} + Maybe< IfcAirToAirHeatRecoveryTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcEnergyConversionDeviceType + struct IfcEnergyConversionDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcEnergyConversionDeviceType() : Object("IfcEnergyConversionDeviceType") {} + + }; + + // C++ wrapper for IfcAirToAirHeatRecoveryType + struct IfcAirToAirHeatRecoveryType : IfcEnergyConversionDeviceType, ObjectHelper { IfcAirToAirHeatRecoveryType() : Object("IfcAirToAirHeatRecoveryType") {} + IfcAirToAirHeatRecoveryTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcAlarm + struct IfcAlarm : IfcDistributionControlElement, ObjectHelper { IfcAlarm() : Object("IfcAlarm") {} + Maybe< IfcAlarmTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcAlarmType + struct IfcAlarmType : IfcDistributionControlElementType, ObjectHelper { IfcAlarmType() : Object("IfcAlarmType") {} + IfcAlarmTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcAnnotation + struct IfcAnnotation : IfcProduct, ObjectHelper { IfcAnnotation() : Object("IfcAnnotation") {} + + }; + + // C++ wrapper for IfcAnnotationFillArea + struct IfcAnnotationFillArea : IfcGeometricRepresentationItem, ObjectHelper { IfcAnnotationFillArea() : Object("IfcAnnotationFillArea") {} + Lazy< IfcCurve > OuterBoundary; + Maybe< ListOf< Lazy< IfcCurve >, 1, 0 > > InnerBoundaries; + }; + + // C++ wrapper for IfcProfileDef + struct IfcProfileDef : ObjectHelper { IfcProfileDef() : Object("IfcProfileDef") {} + IfcProfileTypeEnum::Out ProfileType; + Maybe< IfcLabel::Out > ProfileName; + }; + + // C++ wrapper for IfcArbitraryClosedProfileDef + struct IfcArbitraryClosedProfileDef : IfcProfileDef, ObjectHelper { IfcArbitraryClosedProfileDef() : Object("IfcArbitraryClosedProfileDef") {} + Lazy< IfcCurve > OuterCurve; + }; + + // C++ wrapper for IfcArbitraryOpenProfileDef + struct IfcArbitraryOpenProfileDef : IfcProfileDef, ObjectHelper { IfcArbitraryOpenProfileDef() : Object("IfcArbitraryOpenProfileDef") {} + Lazy< IfcBoundedCurve > Curve; + }; + + // C++ wrapper for IfcArbitraryProfileDefWithVoids + struct IfcArbitraryProfileDefWithVoids : IfcArbitraryClosedProfileDef, ObjectHelper { IfcArbitraryProfileDefWithVoids() : Object("IfcArbitraryProfileDefWithVoids") {} + ListOf< Lazy< IfcCurve >, 1, 0 > InnerCurves; + }; + + // C++ wrapper for IfcGroup + struct IfcGroup : IfcObject, ObjectHelper { IfcGroup() : Object("IfcGroup") {} + + }; + + // C++ wrapper for IfcAsset + struct IfcAsset : IfcGroup, ObjectHelper { IfcAsset() : Object("IfcAsset") {} + Maybe< IfcIdentifier::Out > Identification; + Maybe< Lazy< NotImplemented > > OriginalValue; + Maybe< Lazy< NotImplemented > > CurrentValue; + Maybe< Lazy< NotImplemented > > TotalReplacementCost; + Maybe< IfcActorSelect::Out > Owner; + Maybe< IfcActorSelect::Out > User; + Maybe< Lazy< NotImplemented > > ResponsiblePerson; + Maybe< IfcDate::Out > IncorporationDate; + Maybe< Lazy< NotImplemented > > DepreciatedValue; + }; + + // C++ wrapper for IfcParameterizedProfileDef + struct IfcParameterizedProfileDef : IfcProfileDef, ObjectHelper { IfcParameterizedProfileDef() : Object("IfcParameterizedProfileDef") {} + Maybe< Lazy< IfcAxis2Placement2D > > Position; + }; + + // C++ wrapper for IfcAsymmetricIShapeProfileDef + struct IfcAsymmetricIShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcAsymmetricIShapeProfileDef() : Object("IfcAsymmetricIShapeProfileDef") {} + IfcPositiveLengthMeasure::Out BottomFlangeWidth; + IfcPositiveLengthMeasure::Out OverallDepth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out BottomFlangeThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > BottomFlangeFilletRadius; + IfcPositiveLengthMeasure::Out TopFlangeWidth; + Maybe< IfcPositiveLengthMeasure::Out > TopFlangeThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > TopFlangeFilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > BottomFlangeEdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > BottomFlangeSlope; + Maybe< IfcNonNegativeLengthMeasure::Out > TopFlangeEdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > TopFlangeSlope; + }; + + // C++ wrapper for IfcAudioVisualAppliance + struct IfcAudioVisualAppliance : IfcFlowTerminal, ObjectHelper { IfcAudioVisualAppliance() : Object("IfcAudioVisualAppliance") {} + Maybe< IfcAudioVisualApplianceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcAudioVisualApplianceType + struct IfcAudioVisualApplianceType : IfcFlowTerminalType, ObjectHelper { IfcAudioVisualApplianceType() : Object("IfcAudioVisualApplianceType") {} + IfcAudioVisualApplianceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPlacement + struct IfcPlacement : IfcGeometricRepresentationItem, ObjectHelper { IfcPlacement() : Object("IfcPlacement") {} + Lazy< IfcCartesianPoint > Location; + }; + + // C++ wrapper for IfcAxis1Placement + struct IfcAxis1Placement : IfcPlacement, ObjectHelper { IfcAxis1Placement() : Object("IfcAxis1Placement") {} + Maybe< Lazy< IfcDirection > > Axis; + }; + + // C++ wrapper for IfcAxis2Placement2D + struct IfcAxis2Placement2D : IfcPlacement, ObjectHelper { IfcAxis2Placement2D() : Object("IfcAxis2Placement2D") {} + Maybe< Lazy< IfcDirection > > RefDirection; + }; + + // C++ wrapper for IfcAxis2Placement3D + struct IfcAxis2Placement3D : IfcPlacement, ObjectHelper { IfcAxis2Placement3D() : Object("IfcAxis2Placement3D") {} + Maybe< Lazy< IfcDirection > > Axis; + Maybe< Lazy< IfcDirection > > RefDirection; + }; + + // C++ wrapper for IfcCurve + struct IfcCurve : IfcGeometricRepresentationItem, ObjectHelper { IfcCurve() : Object("IfcCurve") {} + + }; + + // C++ wrapper for IfcBoundedCurve + struct IfcBoundedCurve : IfcCurve, ObjectHelper { IfcBoundedCurve() : Object("IfcBoundedCurve") {} + + }; + + // C++ wrapper for IfcBSplineCurve + struct IfcBSplineCurve : IfcBoundedCurve, ObjectHelper { IfcBSplineCurve() : Object("IfcBSplineCurve") {} + IfcInteger::Out Degree; + ListOf< Lazy< IfcCartesianPoint >, 2, 0 > ControlPointsList; + IfcBSplineCurveForm::Out CurveForm; + IfcLogical::Out ClosedCurve; + IfcLogical::Out SelfIntersect; + }; + + // C++ wrapper for IfcBSplineCurveWithKnots + struct IfcBSplineCurveWithKnots : IfcBSplineCurve, ObjectHelper { IfcBSplineCurveWithKnots() : Object("IfcBSplineCurveWithKnots") {} + ListOf< IfcInteger, 2, 0 >::Out KnotMultiplicities; + ListOf< IfcParameterValue, 2, 0 >::Out Knots; + IfcKnotType::Out KnotSpec; + }; + + // C++ wrapper for IfcSurface + struct IfcSurface : IfcGeometricRepresentationItem, ObjectHelper { IfcSurface() : Object("IfcSurface") {} + + }; + + // C++ wrapper for IfcBoundedSurface + struct IfcBoundedSurface : IfcSurface, ObjectHelper { IfcBoundedSurface() : Object("IfcBoundedSurface") {} + + }; + + // C++ wrapper for IfcBSplineSurface + struct IfcBSplineSurface : IfcBoundedSurface, ObjectHelper { IfcBSplineSurface() : Object("IfcBSplineSurface") {} + IfcInteger::Out UDegree; + IfcInteger::Out VDegree; + IfcBSplineSurfaceForm::Out SurfaceForm; + IfcLogical::Out UClosed; + IfcLogical::Out VClosed; + IfcLogical::Out SelfIntersect; + }; + + // C++ wrapper for IfcBSplineSurfaceWithKnots + struct IfcBSplineSurfaceWithKnots : IfcBSplineSurface, ObjectHelper { IfcBSplineSurfaceWithKnots() : Object("IfcBSplineSurfaceWithKnots") {} + ListOf< IfcInteger, 2, 0 >::Out UMultiplicities; + ListOf< IfcInteger, 2, 0 >::Out VMultiplicities; + ListOf< IfcParameterValue, 2, 0 >::Out UKnots; + ListOf< IfcParameterValue, 2, 0 >::Out VKnots; + IfcKnotType::Out KnotSpec; + }; + + // C++ wrapper for IfcBuildingElement + struct IfcBuildingElement : IfcElement, ObjectHelper { IfcBuildingElement() : Object("IfcBuildingElement") {} + + }; + + // C++ wrapper for IfcBeam + struct IfcBeam : IfcBuildingElement, ObjectHelper { IfcBeam() : Object("IfcBeam") {} + Maybe< IfcBeamTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcBeamStandardCase + struct IfcBeamStandardCase : IfcBeam, ObjectHelper { IfcBeamStandardCase() : Object("IfcBeamStandardCase") {} + + }; + + // C++ wrapper for IfcBuildingElementType + struct IfcBuildingElementType : IfcElementType, ObjectHelper { IfcBuildingElementType() : Object("IfcBuildingElementType") {} + + }; + + // C++ wrapper for IfcBeamType + struct IfcBeamType : IfcBuildingElementType, ObjectHelper { IfcBeamType() : Object("IfcBeamType") {} + IfcBeamTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPresentationItem + struct IfcPresentationItem : ObjectHelper { IfcPresentationItem() : Object("IfcPresentationItem") {} + + }; + + // C++ wrapper for IfcCsgPrimitive3D + struct IfcCsgPrimitive3D : IfcGeometricRepresentationItem, ObjectHelper { IfcCsgPrimitive3D() : Object("IfcCsgPrimitive3D") {} + Lazy< IfcAxis2Placement3D > Position; + }; + + // C++ wrapper for IfcBlock + struct IfcBlock : IfcCsgPrimitive3D, ObjectHelper { IfcBlock() : Object("IfcBlock") {} + IfcPositiveLengthMeasure::Out XLength; + IfcPositiveLengthMeasure::Out YLength; + IfcPositiveLengthMeasure::Out ZLength; + }; + + // C++ wrapper for IfcBoiler + struct IfcBoiler : IfcEnergyConversionDevice, ObjectHelper { IfcBoiler() : Object("IfcBoiler") {} + Maybe< IfcBoilerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcBoilerType + struct IfcBoilerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcBoilerType() : Object("IfcBoilerType") {} + IfcBoilerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcBooleanResult + struct IfcBooleanResult : IfcGeometricRepresentationItem, ObjectHelper { IfcBooleanResult() : Object("IfcBooleanResult") {} + IfcBooleanOperator::Out Operator; + IfcBooleanOperand::Out FirstOperand; + IfcBooleanOperand::Out SecondOperand; + }; + + // C++ wrapper for IfcBooleanClippingResult + struct IfcBooleanClippingResult : IfcBooleanResult, ObjectHelper { IfcBooleanClippingResult() : Object("IfcBooleanClippingResult") {} + + }; + + // C++ wrapper for IfcCompositeCurve + struct IfcCompositeCurve : IfcBoundedCurve, ObjectHelper { IfcCompositeCurve() : Object("IfcCompositeCurve") {} + ListOf< Lazy< IfcCompositeCurveSegment >, 1, 0 > Segments; + IfcLogical::Out SelfIntersect; + }; + + // C++ wrapper for IfcCompositeCurveOnSurface + struct IfcCompositeCurveOnSurface : IfcCompositeCurve, ObjectHelper { IfcCompositeCurveOnSurface() : Object("IfcCompositeCurveOnSurface") {} + + }; + + // C++ wrapper for IfcBoundaryCurve + struct IfcBoundaryCurve : IfcCompositeCurveOnSurface, ObjectHelper { IfcBoundaryCurve() : Object("IfcBoundaryCurve") {} + + }; + + // C++ wrapper for IfcBoundingBox + struct IfcBoundingBox : IfcGeometricRepresentationItem, ObjectHelper { IfcBoundingBox() : Object("IfcBoundingBox") {} + Lazy< IfcCartesianPoint > Corner; + IfcPositiveLengthMeasure::Out XDim; + IfcPositiveLengthMeasure::Out YDim; + IfcPositiveLengthMeasure::Out ZDim; + }; + + // C++ wrapper for IfcHalfSpaceSolid + struct IfcHalfSpaceSolid : IfcGeometricRepresentationItem, ObjectHelper { IfcHalfSpaceSolid() : Object("IfcHalfSpaceSolid") {} + Lazy< IfcSurface > BaseSurface; + IfcBoolean::Out AgreementFlag; + }; + + // C++ wrapper for IfcBoxedHalfSpace + struct IfcBoxedHalfSpace : IfcHalfSpaceSolid, ObjectHelper { IfcBoxedHalfSpace() : Object("IfcBoxedHalfSpace") {} + Lazy< IfcBoundingBox > Enclosure; + }; + + // C++ wrapper for IfcSpatialElement + struct IfcSpatialElement : IfcProduct, ObjectHelper { IfcSpatialElement() : Object("IfcSpatialElement") {} + Maybe< IfcLabel::Out > LongName; + }; + + // C++ wrapper for IfcSpatialStructureElement + struct IfcSpatialStructureElement : IfcSpatialElement, ObjectHelper { IfcSpatialStructureElement() : Object("IfcSpatialStructureElement") {} + Maybe< IfcElementCompositionEnum::Out > CompositionType; + }; + + // C++ wrapper for IfcBuilding + struct IfcBuilding : IfcSpatialStructureElement, ObjectHelper { IfcBuilding() : Object("IfcBuilding") {} + Maybe< IfcLengthMeasure::Out > ElevationOfRefHeight; + Maybe< IfcLengthMeasure::Out > ElevationOfTerrain; + Maybe< Lazy< NotImplemented > > BuildingAddress; + }; + + // C++ wrapper for IfcElementComponent + struct IfcElementComponent : IfcElement, ObjectHelper { IfcElementComponent() : Object("IfcElementComponent") {} + + }; + + // C++ wrapper for IfcBuildingElementPart + struct IfcBuildingElementPart : IfcElementComponent, ObjectHelper { IfcBuildingElementPart() : Object("IfcBuildingElementPart") {} + Maybe< IfcBuildingElementPartTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElementComponentType + struct IfcElementComponentType : IfcElementType, ObjectHelper { IfcElementComponentType() : Object("IfcElementComponentType") {} + + }; + + // C++ wrapper for IfcBuildingElementPartType + struct IfcBuildingElementPartType : IfcElementComponentType, ObjectHelper { IfcBuildingElementPartType() : Object("IfcBuildingElementPartType") {} + IfcBuildingElementPartTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcBuildingElementProxy + struct IfcBuildingElementProxy : IfcBuildingElement, ObjectHelper { IfcBuildingElementProxy() : Object("IfcBuildingElementProxy") {} + Maybe< IfcBuildingElementProxyTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcBuildingElementProxyType + struct IfcBuildingElementProxyType : IfcBuildingElementType, ObjectHelper { IfcBuildingElementProxyType() : Object("IfcBuildingElementProxyType") {} + IfcBuildingElementProxyTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcBuildingStorey + struct IfcBuildingStorey : IfcSpatialStructureElement, ObjectHelper { IfcBuildingStorey() : Object("IfcBuildingStorey") {} + Maybe< IfcLengthMeasure::Out > Elevation; + }; + + // C++ wrapper for IfcSystem + struct IfcSystem : IfcGroup, ObjectHelper { IfcSystem() : Object("IfcSystem") {} + + }; + + // C++ wrapper for IfcBuildingSystem + struct IfcBuildingSystem : IfcSystem, ObjectHelper { IfcBuildingSystem() : Object("IfcBuildingSystem") {} + Maybe< IfcBuildingSystemTypeEnum::Out > PredefinedType; + Maybe< IfcLabel::Out > LongName; + }; + + // C++ wrapper for IfcBurner + struct IfcBurner : IfcEnergyConversionDevice, ObjectHelper { IfcBurner() : Object("IfcBurner") {} + Maybe< IfcBurnerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcBurnerType + struct IfcBurnerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcBurnerType() : Object("IfcBurnerType") {} + IfcBurnerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCShapeProfileDef + struct IfcCShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcCShapeProfileDef() : Object("IfcCShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out Width; + IfcPositiveLengthMeasure::Out WallThickness; + IfcPositiveLengthMeasure::Out Girth; + Maybe< IfcNonNegativeLengthMeasure::Out > InternalFilletRadius; + }; + + // C++ wrapper for IfcFlowFitting + struct IfcFlowFitting : IfcDistributionFlowElement, ObjectHelper { IfcFlowFitting() : Object("IfcFlowFitting") {} + + }; + + // C++ wrapper for IfcCableCarrierFitting + struct IfcCableCarrierFitting : IfcFlowFitting, ObjectHelper { IfcCableCarrierFitting() : Object("IfcCableCarrierFitting") {} + Maybe< IfcCableCarrierFittingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowFittingType + struct IfcFlowFittingType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowFittingType() : Object("IfcFlowFittingType") {} + + }; + + // C++ wrapper for IfcCableCarrierFittingType + struct IfcCableCarrierFittingType : IfcFlowFittingType, ObjectHelper { IfcCableCarrierFittingType() : Object("IfcCableCarrierFittingType") {} + IfcCableCarrierFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowSegment + struct IfcFlowSegment : IfcDistributionFlowElement, ObjectHelper { IfcFlowSegment() : Object("IfcFlowSegment") {} + + }; + + // C++ wrapper for IfcCableCarrierSegment + struct IfcCableCarrierSegment : IfcFlowSegment, ObjectHelper { IfcCableCarrierSegment() : Object("IfcCableCarrierSegment") {} + Maybe< IfcCableCarrierSegmentTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowSegmentType + struct IfcFlowSegmentType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowSegmentType() : Object("IfcFlowSegmentType") {} + + }; + + // C++ wrapper for IfcCableCarrierSegmentType + struct IfcCableCarrierSegmentType : IfcFlowSegmentType, ObjectHelper { IfcCableCarrierSegmentType() : Object("IfcCableCarrierSegmentType") {} + IfcCableCarrierSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCableFitting + struct IfcCableFitting : IfcFlowFitting, ObjectHelper { IfcCableFitting() : Object("IfcCableFitting") {} + Maybe< IfcCableFittingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCableFittingType + struct IfcCableFittingType : IfcFlowFittingType, ObjectHelper { IfcCableFittingType() : Object("IfcCableFittingType") {} + IfcCableFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCableSegment + struct IfcCableSegment : IfcFlowSegment, ObjectHelper { IfcCableSegment() : Object("IfcCableSegment") {} + Maybe< IfcCableSegmentTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCableSegmentType + struct IfcCableSegmentType : IfcFlowSegmentType, ObjectHelper { IfcCableSegmentType() : Object("IfcCableSegmentType") {} + IfcCableSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPoint + struct IfcPoint : IfcGeometricRepresentationItem, ObjectHelper { IfcPoint() : Object("IfcPoint") {} + + }; + + // C++ wrapper for IfcCartesianPoint + struct IfcCartesianPoint : IfcPoint, ObjectHelper { IfcCartesianPoint() : Object("IfcCartesianPoint") {} + ListOf< IfcLengthMeasure, 1, 3 >::Out Coordinates; + }; + + // C++ wrapper for IfcCartesianPointList + struct IfcCartesianPointList : IfcGeometricRepresentationItem, ObjectHelper { IfcCartesianPointList() : Object("IfcCartesianPointList") {} + + }; + + // C++ wrapper for IfcCartesianPointList2D + struct IfcCartesianPointList2D : IfcCartesianPointList, ObjectHelper { IfcCartesianPointList2D() : Object("IfcCartesianPointList2D") {} + + }; + + // C++ wrapper for IfcCartesianPointList3D + struct IfcCartesianPointList3D : IfcCartesianPointList, ObjectHelper { IfcCartesianPointList3D() : Object("IfcCartesianPointList3D") {} + + }; + + // C++ wrapper for IfcCartesianTransformationOperator + struct IfcCartesianTransformationOperator : IfcGeometricRepresentationItem, ObjectHelper { IfcCartesianTransformationOperator() : Object("IfcCartesianTransformationOperator") {} + Maybe< Lazy< IfcDirection > > Axis1; + Maybe< Lazy< IfcDirection > > Axis2; + Lazy< IfcCartesianPoint > LocalOrigin; + Maybe< IfcReal::Out > Scale; + }; + + // C++ wrapper for IfcCartesianTransformationOperator2D + struct IfcCartesianTransformationOperator2D : IfcCartesianTransformationOperator, ObjectHelper { IfcCartesianTransformationOperator2D() : Object("IfcCartesianTransformationOperator2D") {} + + }; + + // C++ wrapper for IfcCartesianTransformationOperator2DnonUniform + struct IfcCartesianTransformationOperator2DnonUniform : IfcCartesianTransformationOperator2D, ObjectHelper { IfcCartesianTransformationOperator2DnonUniform() : Object("IfcCartesianTransformationOperator2DnonUniform") {} + Maybe< IfcReal::Out > Scale2; + }; + + // C++ wrapper for IfcCartesianTransformationOperator3D + struct IfcCartesianTransformationOperator3D : IfcCartesianTransformationOperator, ObjectHelper { IfcCartesianTransformationOperator3D() : Object("IfcCartesianTransformationOperator3D") {} + Maybe< Lazy< IfcDirection > > Axis3; + }; + + // C++ wrapper for IfcCartesianTransformationOperator3DnonUniform + struct IfcCartesianTransformationOperator3DnonUniform : IfcCartesianTransformationOperator3D, ObjectHelper { IfcCartesianTransformationOperator3DnonUniform() : Object("IfcCartesianTransformationOperator3DnonUniform") {} + Maybe< IfcReal::Out > Scale2; + Maybe< IfcReal::Out > Scale3; + }; + + // C++ wrapper for IfcCenterLineProfileDef + struct IfcCenterLineProfileDef : IfcArbitraryOpenProfileDef, ObjectHelper { IfcCenterLineProfileDef() : Object("IfcCenterLineProfileDef") {} + IfcPositiveLengthMeasure::Out Thickness; + }; + + // C++ wrapper for IfcChiller + struct IfcChiller : IfcEnergyConversionDevice, ObjectHelper { IfcChiller() : Object("IfcChiller") {} + Maybe< IfcChillerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcChillerType + struct IfcChillerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcChillerType() : Object("IfcChillerType") {} + IfcChillerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcChimney + struct IfcChimney : IfcBuildingElement, ObjectHelper { IfcChimney() : Object("IfcChimney") {} + Maybe< IfcChimneyTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcChimneyType + struct IfcChimneyType : IfcBuildingElementType, ObjectHelper { IfcChimneyType() : Object("IfcChimneyType") {} + IfcChimneyTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcConic + struct IfcConic : IfcCurve, ObjectHelper { IfcConic() : Object("IfcConic") {} + IfcAxis2Placement::Out Position; + }; + + // C++ wrapper for IfcCircle + struct IfcCircle : IfcConic, ObjectHelper { IfcCircle() : Object("IfcCircle") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcCircleProfileDef + struct IfcCircleProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcCircleProfileDef() : Object("IfcCircleProfileDef") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcCircleHollowProfileDef + struct IfcCircleHollowProfileDef : IfcCircleProfileDef, ObjectHelper { IfcCircleHollowProfileDef() : Object("IfcCircleHollowProfileDef") {} + IfcPositiveLengthMeasure::Out WallThickness; + }; + + // C++ wrapper for IfcCivilElement + struct IfcCivilElement : IfcElement, ObjectHelper { IfcCivilElement() : Object("IfcCivilElement") {} + + }; + + // C++ wrapper for IfcCivilElementType + struct IfcCivilElementType : IfcElementType, ObjectHelper { IfcCivilElementType() : Object("IfcCivilElementType") {} + + }; + + // C++ wrapper for IfcConnectedFaceSet + struct IfcConnectedFaceSet : IfcTopologicalRepresentationItem, ObjectHelper { IfcConnectedFaceSet() : Object("IfcConnectedFaceSet") {} + ListOf< Lazy< IfcFace >, 1, 0 > CfsFaces; + }; + + // C++ wrapper for IfcClosedShell + struct IfcClosedShell : IfcConnectedFaceSet, ObjectHelper { IfcClosedShell() : Object("IfcClosedShell") {} + + }; + + // C++ wrapper for IfcCoil + struct IfcCoil : IfcEnergyConversionDevice, ObjectHelper { IfcCoil() : Object("IfcCoil") {} + Maybe< IfcCoilTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCoilType + struct IfcCoilType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCoilType() : Object("IfcCoilType") {} + IfcCoilTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcColourSpecification + struct IfcColourSpecification : IfcPresentationItem, ObjectHelper { IfcColourSpecification() : Object("IfcColourSpecification") {} + Maybe< IfcLabel::Out > Name; + }; + + // C++ wrapper for IfcColourRgb + struct IfcColourRgb : IfcColourSpecification, ObjectHelper { IfcColourRgb() : Object("IfcColourRgb") {} + IfcNormalisedRatioMeasure::Out Red; + IfcNormalisedRatioMeasure::Out Green; + IfcNormalisedRatioMeasure::Out Blue; + }; + + // C++ wrapper for IfcColumn + struct IfcColumn : IfcBuildingElement, ObjectHelper { IfcColumn() : Object("IfcColumn") {} + Maybe< IfcColumnTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcColumnStandardCase + struct IfcColumnStandardCase : IfcColumn, ObjectHelper { IfcColumnStandardCase() : Object("IfcColumnStandardCase") {} + + }; + + // C++ wrapper for IfcColumnType + struct IfcColumnType : IfcBuildingElementType, ObjectHelper { IfcColumnType() : Object("IfcColumnType") {} + IfcColumnTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCommunicationsAppliance + struct IfcCommunicationsAppliance : IfcFlowTerminal, ObjectHelper { IfcCommunicationsAppliance() : Object("IfcCommunicationsAppliance") {} + Maybe< IfcCommunicationsApplianceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCommunicationsApplianceType + struct IfcCommunicationsApplianceType : IfcFlowTerminalType, ObjectHelper { IfcCommunicationsApplianceType() : Object("IfcCommunicationsApplianceType") {} + IfcCommunicationsApplianceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPropertyAbstraction + struct IfcPropertyAbstraction : ObjectHelper { IfcPropertyAbstraction() : Object("IfcPropertyAbstraction") {} + + }; + + // C++ wrapper for IfcProperty + struct IfcProperty : IfcPropertyAbstraction, ObjectHelper { IfcProperty() : Object("IfcProperty") {} + IfcIdentifier::Out Name; + Maybe< IfcText::Out > Description; + }; + + // C++ wrapper for IfcComplexProperty + struct IfcComplexProperty : IfcProperty, ObjectHelper { IfcComplexProperty() : Object("IfcComplexProperty") {} + IfcIdentifier::Out UsageName; + ListOf< Lazy< IfcProperty >, 1, 0 > HasProperties; + }; + + // C++ wrapper for IfcPropertyDefinition + struct IfcPropertyDefinition : IfcRoot, ObjectHelper { IfcPropertyDefinition() : Object("IfcPropertyDefinition") {} + + }; + + // C++ wrapper for IfcCompositeCurveSegment + struct IfcCompositeCurveSegment : IfcGeometricRepresentationItem, ObjectHelper { IfcCompositeCurveSegment() : Object("IfcCompositeCurveSegment") {} + IfcTransitionCode::Out Transition; + IfcBoolean::Out SameSense; + Lazy< IfcCurve > ParentCurve; + }; + + // C++ wrapper for IfcCompositeProfileDef + struct IfcCompositeProfileDef : IfcProfileDef, ObjectHelper { IfcCompositeProfileDef() : Object("IfcCompositeProfileDef") {} + ListOf< Lazy< IfcProfileDef >, 2, 0 > Profiles; + Maybe< IfcLabel::Out > Label; + }; + + // C++ wrapper for IfcFlowMovingDevice + struct IfcFlowMovingDevice : IfcDistributionFlowElement, ObjectHelper { IfcFlowMovingDevice() : Object("IfcFlowMovingDevice") {} + + }; + + // C++ wrapper for IfcCompressor + struct IfcCompressor : IfcFlowMovingDevice, ObjectHelper { IfcCompressor() : Object("IfcCompressor") {} + Maybe< IfcCompressorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowMovingDeviceType + struct IfcFlowMovingDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowMovingDeviceType() : Object("IfcFlowMovingDeviceType") {} + + }; + + // C++ wrapper for IfcCompressorType + struct IfcCompressorType : IfcFlowMovingDeviceType, ObjectHelper { IfcCompressorType() : Object("IfcCompressorType") {} + IfcCompressorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCondenser + struct IfcCondenser : IfcEnergyConversionDevice, ObjectHelper { IfcCondenser() : Object("IfcCondenser") {} + Maybe< IfcCondenserTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCondenserType + struct IfcCondenserType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCondenserType() : Object("IfcCondenserType") {} + IfcCondenserTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcResource + struct IfcResource : IfcObject, ObjectHelper { IfcResource() : Object("IfcResource") {} + Maybe< IfcIdentifier::Out > Identification; + Maybe< IfcText::Out > LongDescription; + }; + + // C++ wrapper for IfcConstructionResource + struct IfcConstructionResource : IfcResource, ObjectHelper { IfcConstructionResource() : Object("IfcConstructionResource") {} + Maybe< Lazy< NotImplemented > > Usage; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > BaseCosts; + Maybe< Lazy< NotImplemented > > BaseQuantity; + }; + + // C++ wrapper for IfcConstructionEquipmentResource + struct IfcConstructionEquipmentResource : IfcConstructionResource, ObjectHelper { IfcConstructionEquipmentResource() : Object("IfcConstructionEquipmentResource") {} + Maybe< IfcConstructionEquipmentResourceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTypeResource + struct IfcTypeResource : IfcTypeObject, ObjectHelper { IfcTypeResource() : Object("IfcTypeResource") {} + Maybe< IfcIdentifier::Out > Identification; + Maybe< IfcText::Out > LongDescription; + Maybe< IfcLabel::Out > ResourceType; + }; + + // C++ wrapper for IfcConstructionResourceType + struct IfcConstructionResourceType : IfcTypeResource, ObjectHelper { IfcConstructionResourceType() : Object("IfcConstructionResourceType") {} + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > BaseCosts; + Maybe< Lazy< NotImplemented > > BaseQuantity; + }; + + // C++ wrapper for IfcConstructionEquipmentResourceType + struct IfcConstructionEquipmentResourceType : IfcConstructionResourceType, ObjectHelper { IfcConstructionEquipmentResourceType() : Object("IfcConstructionEquipmentResourceType") {} + IfcConstructionEquipmentResourceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcConstructionMaterialResource + struct IfcConstructionMaterialResource : IfcConstructionResource, ObjectHelper { IfcConstructionMaterialResource() : Object("IfcConstructionMaterialResource") {} + Maybe< IfcConstructionMaterialResourceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcConstructionMaterialResourceType + struct IfcConstructionMaterialResourceType : IfcConstructionResourceType, ObjectHelper { IfcConstructionMaterialResourceType() : Object("IfcConstructionMaterialResourceType") {} + IfcConstructionMaterialResourceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcConstructionProductResource + struct IfcConstructionProductResource : IfcConstructionResource, ObjectHelper { IfcConstructionProductResource() : Object("IfcConstructionProductResource") {} + Maybe< IfcConstructionProductResourceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcConstructionProductResourceType + struct IfcConstructionProductResourceType : IfcConstructionResourceType, ObjectHelper { IfcConstructionProductResourceType() : Object("IfcConstructionProductResourceType") {} + IfcConstructionProductResourceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcContext + struct IfcContext : IfcObjectDefinition, ObjectHelper { IfcContext() : Object("IfcContext") {} + Maybe< IfcLabel::Out > ObjectType; + Maybe< IfcLabel::Out > LongName; + Maybe< IfcLabel::Out > Phase; + Maybe< ListOf< Lazy< IfcRepresentationContext >, 1, 0 > > RepresentationContexts; + Maybe< Lazy< IfcUnitAssignment > > UnitsInContext; + }; + + // C++ wrapper for IfcNamedUnit + struct IfcNamedUnit : ObjectHelper { IfcNamedUnit() : Object("IfcNamedUnit") {} + Lazy< NotImplemented > Dimensions; + IfcUnitEnum::Out UnitType; + }; + + // C++ wrapper for IfcContextDependentUnit + struct IfcContextDependentUnit : IfcNamedUnit, ObjectHelper { IfcContextDependentUnit() : Object("IfcContextDependentUnit") {} + IfcLabel::Out Name; + }; + + // C++ wrapper for IfcController + struct IfcController : IfcDistributionControlElement, ObjectHelper { IfcController() : Object("IfcController") {} + Maybe< IfcControllerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcControllerType + struct IfcControllerType : IfcDistributionControlElementType, ObjectHelper { IfcControllerType() : Object("IfcControllerType") {} + IfcControllerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcConversionBasedUnit + struct IfcConversionBasedUnit : IfcNamedUnit, ObjectHelper { IfcConversionBasedUnit() : Object("IfcConversionBasedUnit") {} + IfcLabel::Out Name; + Lazy< IfcMeasureWithUnit > ConversionFactor; + }; + + // C++ wrapper for IfcConversionBasedUnitWithOffset + struct IfcConversionBasedUnitWithOffset : IfcConversionBasedUnit, ObjectHelper { IfcConversionBasedUnitWithOffset() : Object("IfcConversionBasedUnitWithOffset") {} + IfcReal::Out ConversionOffset; + }; + + // C++ wrapper for IfcCooledBeam + struct IfcCooledBeam : IfcEnergyConversionDevice, ObjectHelper { IfcCooledBeam() : Object("IfcCooledBeam") {} + Maybe< IfcCooledBeamTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCooledBeamType + struct IfcCooledBeamType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCooledBeamType() : Object("IfcCooledBeamType") {} + IfcCooledBeamTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCoolingTower + struct IfcCoolingTower : IfcEnergyConversionDevice, ObjectHelper { IfcCoolingTower() : Object("IfcCoolingTower") {} + Maybe< IfcCoolingTowerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCoolingTowerType + struct IfcCoolingTowerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcCoolingTowerType() : Object("IfcCoolingTowerType") {} + IfcCoolingTowerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCostItem + struct IfcCostItem : IfcControl, ObjectHelper { IfcCostItem() : Object("IfcCostItem") {} + Maybe< IfcCostItemTypeEnum::Out > PredefinedType; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > CostValues; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > CostQuantities; + }; + + // C++ wrapper for IfcCostSchedule + struct IfcCostSchedule : IfcControl, ObjectHelper { IfcCostSchedule() : Object("IfcCostSchedule") {} + Maybe< IfcCostScheduleTypeEnum::Out > PredefinedType; + Maybe< IfcLabel::Out > Status; + Maybe< IfcDateTime::Out > SubmittedOn; + Maybe< IfcDateTime::Out > UpdateDate; + }; + + // C++ wrapper for IfcCovering + struct IfcCovering : IfcBuildingElement, ObjectHelper { IfcCovering() : Object("IfcCovering") {} + Maybe< IfcCoveringTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCoveringType + struct IfcCoveringType : IfcBuildingElementType, ObjectHelper { IfcCoveringType() : Object("IfcCoveringType") {} + IfcCoveringTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCrewResource + struct IfcCrewResource : IfcConstructionResource, ObjectHelper { IfcCrewResource() : Object("IfcCrewResource") {} + Maybe< IfcCrewResourceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCrewResourceType + struct IfcCrewResourceType : IfcConstructionResourceType, ObjectHelper { IfcCrewResourceType() : Object("IfcCrewResourceType") {} + IfcCrewResourceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCsgSolid + struct IfcCsgSolid : IfcSolidModel, ObjectHelper { IfcCsgSolid() : Object("IfcCsgSolid") {} + IfcCsgSelect::Out TreeRootExpression; + }; + + // C++ wrapper for IfcCurtainWall + struct IfcCurtainWall : IfcBuildingElement, ObjectHelper { IfcCurtainWall() : Object("IfcCurtainWall") {} + Maybe< IfcCurtainWallTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcCurtainWallType + struct IfcCurtainWallType : IfcBuildingElementType, ObjectHelper { IfcCurtainWallType() : Object("IfcCurtainWallType") {} + IfcCurtainWallTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcCurveBoundedPlane + struct IfcCurveBoundedPlane : IfcBoundedSurface, ObjectHelper { IfcCurveBoundedPlane() : Object("IfcCurveBoundedPlane") {} + Lazy< IfcPlane > BasisSurface; + Lazy< IfcCurve > OuterBoundary; + ListOf< Lazy< IfcCurve >, 0, 0 > InnerBoundaries; + }; + + // C++ wrapper for IfcCurveBoundedSurface + struct IfcCurveBoundedSurface : IfcBoundedSurface, ObjectHelper { IfcCurveBoundedSurface() : Object("IfcCurveBoundedSurface") {} + Lazy< IfcSurface > BasisSurface; + ListOf< Lazy< IfcBoundaryCurve >, 1, 0 > Boundaries; + IfcBoolean::Out ImplicitOuter; + }; + + // C++ wrapper for IfcPresentationStyle + struct IfcPresentationStyle : ObjectHelper { IfcPresentationStyle() : Object("IfcPresentationStyle") {} + Maybe< IfcLabel::Out > Name; + }; + + // C++ wrapper for IfcElementarySurface + struct IfcElementarySurface : IfcSurface, ObjectHelper { IfcElementarySurface() : Object("IfcElementarySurface") {} + Lazy< IfcAxis2Placement3D > Position; + }; + + // C++ wrapper for IfcCylindricalSurface + struct IfcCylindricalSurface : IfcElementarySurface, ObjectHelper { IfcCylindricalSurface() : Object("IfcCylindricalSurface") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcDamper + struct IfcDamper : IfcFlowController, ObjectHelper { IfcDamper() : Object("IfcDamper") {} + Maybe< IfcDamperTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDamperType + struct IfcDamperType : IfcFlowControllerType, ObjectHelper { IfcDamperType() : Object("IfcDamperType") {} + IfcDamperTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDerivedProfileDef + struct IfcDerivedProfileDef : IfcProfileDef, ObjectHelper { IfcDerivedProfileDef() : Object("IfcDerivedProfileDef") {} + Lazy< IfcProfileDef > ParentProfile; + Lazy< IfcCartesianTransformationOperator2D > Operator; + Maybe< IfcLabel::Out > Label; + }; + + // C++ wrapper for IfcDirection + struct IfcDirection : IfcGeometricRepresentationItem, ObjectHelper { IfcDirection() : Object("IfcDirection") {} + ListOf< IfcReal, 2, 3 >::Out DirectionRatios; + }; + + // C++ wrapper for IfcDiscreteAccessory + struct IfcDiscreteAccessory : IfcElementComponent, ObjectHelper { IfcDiscreteAccessory() : Object("IfcDiscreteAccessory") {} + Maybe< IfcDiscreteAccessoryTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDiscreteAccessoryType + struct IfcDiscreteAccessoryType : IfcElementComponentType, ObjectHelper { IfcDiscreteAccessoryType() : Object("IfcDiscreteAccessoryType") {} + IfcDiscreteAccessoryTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDistributionChamberElement + struct IfcDistributionChamberElement : IfcDistributionFlowElement, ObjectHelper { IfcDistributionChamberElement() : Object("IfcDistributionChamberElement") {} + Maybe< IfcDistributionChamberElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDistributionChamberElementType + struct IfcDistributionChamberElementType : IfcDistributionFlowElementType, ObjectHelper { IfcDistributionChamberElementType() : Object("IfcDistributionChamberElementType") {} + IfcDistributionChamberElementTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDistributionSystem + struct IfcDistributionSystem : IfcSystem, ObjectHelper { IfcDistributionSystem() : Object("IfcDistributionSystem") {} + Maybe< IfcLabel::Out > LongName; + Maybe< IfcDistributionSystemEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDistributionCircuit + struct IfcDistributionCircuit : IfcDistributionSystem, ObjectHelper { IfcDistributionCircuit() : Object("IfcDistributionCircuit") {} + + }; + + // C++ wrapper for IfcPort + struct IfcPort : IfcProduct, ObjectHelper { IfcPort() : Object("IfcPort") {} + + }; + + // C++ wrapper for IfcDistributionPort + struct IfcDistributionPort : IfcPort, ObjectHelper { IfcDistributionPort() : Object("IfcDistributionPort") {} + Maybe< IfcFlowDirectionEnum::Out > FlowDirection; + Maybe< IfcDistributionPortTypeEnum::Out > PredefinedType; + Maybe< IfcDistributionSystemEnum::Out > SystemType; + }; + + // C++ wrapper for IfcDoor + struct IfcDoor : IfcBuildingElement, ObjectHelper { IfcDoor() : Object("IfcDoor") {} + Maybe< IfcPositiveLengthMeasure::Out > OverallHeight; + Maybe< IfcPositiveLengthMeasure::Out > OverallWidth; + Maybe< IfcDoorTypeEnum::Out > PredefinedType; + Maybe< IfcDoorTypeOperationEnum::Out > OperationType; + Maybe< IfcLabel::Out > UserDefinedOperationType; + }; + + // C++ wrapper for IfcPropertySetDefinition + struct IfcPropertySetDefinition : IfcPropertyDefinition, ObjectHelper { IfcPropertySetDefinition() : Object("IfcPropertySetDefinition") {} + + }; + + // C++ wrapper for IfcDoorStandardCase + struct IfcDoorStandardCase : IfcDoor, ObjectHelper { IfcDoorStandardCase() : Object("IfcDoorStandardCase") {} + + }; + + // C++ wrapper for IfcDoorStyle + struct IfcDoorStyle : IfcTypeProduct, ObjectHelper { IfcDoorStyle() : Object("IfcDoorStyle") {} + IfcDoorStyleOperationEnum::Out OperationType; + IfcDoorStyleConstructionEnum::Out ConstructionType; + IfcBoolean::Out ParameterTakesPrecedence; + IfcBoolean::Out Sizeable; + }; + + // C++ wrapper for IfcDoorType + struct IfcDoorType : IfcBuildingElementType, ObjectHelper { IfcDoorType() : Object("IfcDoorType") {} + IfcDoorTypeEnum::Out PredefinedType; + IfcDoorTypeOperationEnum::Out OperationType; + Maybe< IfcBoolean::Out > ParameterTakesPrecedence; + Maybe< IfcLabel::Out > UserDefinedOperationType; + }; + + // C++ wrapper for IfcDuctFitting + struct IfcDuctFitting : IfcFlowFitting, ObjectHelper { IfcDuctFitting() : Object("IfcDuctFitting") {} + Maybe< IfcDuctFittingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDuctFittingType + struct IfcDuctFittingType : IfcFlowFittingType, ObjectHelper { IfcDuctFittingType() : Object("IfcDuctFittingType") {} + IfcDuctFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcDuctSegment + struct IfcDuctSegment : IfcFlowSegment, ObjectHelper { IfcDuctSegment() : Object("IfcDuctSegment") {} + Maybe< IfcDuctSegmentTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcDuctSegmentType + struct IfcDuctSegmentType : IfcFlowSegmentType, ObjectHelper { IfcDuctSegmentType() : Object("IfcDuctSegmentType") {} + IfcDuctSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowTreatmentDevice + struct IfcFlowTreatmentDevice : IfcDistributionFlowElement, ObjectHelper { IfcFlowTreatmentDevice() : Object("IfcFlowTreatmentDevice") {} + + }; + + // C++ wrapper for IfcDuctSilencer + struct IfcDuctSilencer : IfcFlowTreatmentDevice, ObjectHelper { IfcDuctSilencer() : Object("IfcDuctSilencer") {} + Maybe< IfcDuctSilencerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowTreatmentDeviceType + struct IfcFlowTreatmentDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowTreatmentDeviceType() : Object("IfcFlowTreatmentDeviceType") {} + + }; + + // C++ wrapper for IfcDuctSilencerType + struct IfcDuctSilencerType : IfcFlowTreatmentDeviceType, ObjectHelper { IfcDuctSilencerType() : Object("IfcDuctSilencerType") {} + IfcDuctSilencerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEdge + struct IfcEdge : IfcTopologicalRepresentationItem, ObjectHelper { IfcEdge() : Object("IfcEdge") {} + Lazy< IfcVertex > EdgeStart; + Lazy< IfcVertex > EdgeEnd; + }; + + // C++ wrapper for IfcEdgeCurve + struct IfcEdgeCurve : IfcEdge, ObjectHelper { IfcEdgeCurve() : Object("IfcEdgeCurve") {} + Lazy< IfcCurve > EdgeGeometry; + IfcBoolean::Out SameSense; + }; + + // C++ wrapper for IfcLoop + struct IfcLoop : IfcTopologicalRepresentationItem, ObjectHelper { IfcLoop() : Object("IfcLoop") {} + + }; + + // C++ wrapper for IfcEdgeLoop + struct IfcEdgeLoop : IfcLoop, ObjectHelper { IfcEdgeLoop() : Object("IfcEdgeLoop") {} + ListOf< Lazy< IfcOrientedEdge >, 1, 0 > EdgeList; + }; + + // C++ wrapper for IfcElectricAppliance + struct IfcElectricAppliance : IfcFlowTerminal, ObjectHelper { IfcElectricAppliance() : Object("IfcElectricAppliance") {} + Maybe< IfcElectricApplianceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElectricApplianceType + struct IfcElectricApplianceType : IfcFlowTerminalType, ObjectHelper { IfcElectricApplianceType() : Object("IfcElectricApplianceType") {} + IfcElectricApplianceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricDistributionBoard + struct IfcElectricDistributionBoard : IfcFlowController, ObjectHelper { IfcElectricDistributionBoard() : Object("IfcElectricDistributionBoard") {} + Maybe< IfcElectricDistributionBoardTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElectricDistributionBoardType + struct IfcElectricDistributionBoardType : IfcFlowControllerType, ObjectHelper { IfcElectricDistributionBoardType() : Object("IfcElectricDistributionBoardType") {} + IfcElectricDistributionBoardTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowStorageDevice + struct IfcFlowStorageDevice : IfcDistributionFlowElement, ObjectHelper { IfcFlowStorageDevice() : Object("IfcFlowStorageDevice") {} + + }; + + // C++ wrapper for IfcElectricFlowStorageDevice + struct IfcElectricFlowStorageDevice : IfcFlowStorageDevice, ObjectHelper { IfcElectricFlowStorageDevice() : Object("IfcElectricFlowStorageDevice") {} + Maybe< IfcElectricFlowStorageDeviceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowStorageDeviceType + struct IfcFlowStorageDeviceType : IfcDistributionFlowElementType, ObjectHelper { IfcFlowStorageDeviceType() : Object("IfcFlowStorageDeviceType") {} + + }; + + // C++ wrapper for IfcElectricFlowStorageDeviceType + struct IfcElectricFlowStorageDeviceType : IfcFlowStorageDeviceType, ObjectHelper { IfcElectricFlowStorageDeviceType() : Object("IfcElectricFlowStorageDeviceType") {} + IfcElectricFlowStorageDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricGenerator + struct IfcElectricGenerator : IfcEnergyConversionDevice, ObjectHelper { IfcElectricGenerator() : Object("IfcElectricGenerator") {} + Maybe< IfcElectricGeneratorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElectricGeneratorType + struct IfcElectricGeneratorType : IfcEnergyConversionDeviceType, ObjectHelper { IfcElectricGeneratorType() : Object("IfcElectricGeneratorType") {} + IfcElectricGeneratorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricMotor + struct IfcElectricMotor : IfcEnergyConversionDevice, ObjectHelper { IfcElectricMotor() : Object("IfcElectricMotor") {} + Maybe< IfcElectricMotorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElectricMotorType + struct IfcElectricMotorType : IfcEnergyConversionDeviceType, ObjectHelper { IfcElectricMotorType() : Object("IfcElectricMotorType") {} + IfcElectricMotorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElectricTimeControl + struct IfcElectricTimeControl : IfcFlowController, ObjectHelper { IfcElectricTimeControl() : Object("IfcElectricTimeControl") {} + Maybe< IfcElectricTimeControlTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElectricTimeControlType + struct IfcElectricTimeControlType : IfcFlowControllerType, ObjectHelper { IfcElectricTimeControlType() : Object("IfcElectricTimeControlType") {} + IfcElectricTimeControlTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcElementAssembly + struct IfcElementAssembly : IfcElement, ObjectHelper { IfcElementAssembly() : Object("IfcElementAssembly") {} + Maybe< IfcAssemblyPlaceEnum::Out > AssemblyPlace; + Maybe< IfcElementAssemblyTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcElementAssemblyType + struct IfcElementAssemblyType : IfcElementType, ObjectHelper { IfcElementAssemblyType() : Object("IfcElementAssemblyType") {} + IfcElementAssemblyTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcQuantitySet + struct IfcQuantitySet : IfcPropertySetDefinition, ObjectHelper { IfcQuantitySet() : Object("IfcQuantitySet") {} + + }; + + // C++ wrapper for IfcElementQuantity + struct IfcElementQuantity : IfcQuantitySet, ObjectHelper { IfcElementQuantity() : Object("IfcElementQuantity") {} + Maybe< IfcLabel::Out > MethodOfMeasurement; + ListOf< Lazy< NotImplemented >, 1, 0 > Quantities; + }; + + // C++ wrapper for IfcEllipse + struct IfcEllipse : IfcConic, ObjectHelper { IfcEllipse() : Object("IfcEllipse") {} + IfcPositiveLengthMeasure::Out SemiAxis1; + IfcPositiveLengthMeasure::Out SemiAxis2; + }; + + // C++ wrapper for IfcEllipseProfileDef + struct IfcEllipseProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcEllipseProfileDef() : Object("IfcEllipseProfileDef") {} + IfcPositiveLengthMeasure::Out SemiAxis1; + IfcPositiveLengthMeasure::Out SemiAxis2; + }; + + // C++ wrapper for IfcEngine + struct IfcEngine : IfcEnergyConversionDevice, ObjectHelper { IfcEngine() : Object("IfcEngine") {} + Maybe< IfcEngineTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcEngineType + struct IfcEngineType : IfcEnergyConversionDeviceType, ObjectHelper { IfcEngineType() : Object("IfcEngineType") {} + IfcEngineTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEvaporativeCooler + struct IfcEvaporativeCooler : IfcEnergyConversionDevice, ObjectHelper { IfcEvaporativeCooler() : Object("IfcEvaporativeCooler") {} + Maybe< IfcEvaporativeCoolerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcEvaporativeCoolerType + struct IfcEvaporativeCoolerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcEvaporativeCoolerType() : Object("IfcEvaporativeCoolerType") {} + IfcEvaporativeCoolerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcEvaporator + struct IfcEvaporator : IfcEnergyConversionDevice, ObjectHelper { IfcEvaporator() : Object("IfcEvaporator") {} + Maybe< IfcEvaporatorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcEvaporatorType + struct IfcEvaporatorType : IfcEnergyConversionDeviceType, ObjectHelper { IfcEvaporatorType() : Object("IfcEvaporatorType") {} + IfcEvaporatorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProcess + struct IfcProcess : IfcObject, ObjectHelper { IfcProcess() : Object("IfcProcess") {} + Maybe< IfcIdentifier::Out > Identification; + Maybe< IfcText::Out > LongDescription; + }; + + // C++ wrapper for IfcEvent + struct IfcEvent : IfcProcess, ObjectHelper { IfcEvent() : Object("IfcEvent") {} + Maybe< IfcEventTypeEnum::Out > PredefinedType; + Maybe< IfcEventTriggerTypeEnum::Out > EventTriggerType; + Maybe< IfcLabel::Out > UserDefinedEventTriggerType; + Maybe< Lazy< NotImplemented > > EventOccurenceTime; + }; + + // C++ wrapper for IfcTypeProcess + struct IfcTypeProcess : IfcTypeObject, ObjectHelper { IfcTypeProcess() : Object("IfcTypeProcess") {} + Maybe< IfcIdentifier::Out > Identification; + Maybe< IfcText::Out > LongDescription; + Maybe< IfcLabel::Out > ProcessType; + }; + + // C++ wrapper for IfcEventType + struct IfcEventType : IfcTypeProcess, ObjectHelper { IfcEventType() : Object("IfcEventType") {} + IfcEventTypeEnum::Out PredefinedType; + IfcEventTriggerTypeEnum::Out EventTriggerType; + Maybe< IfcLabel::Out > UserDefinedEventTriggerType; + }; + + // C++ wrapper for IfcExternalSpatialStructureElement + struct IfcExternalSpatialStructureElement : IfcSpatialElement, ObjectHelper { IfcExternalSpatialStructureElement() : Object("IfcExternalSpatialStructureElement") {} + + }; + + // C++ wrapper for IfcExternalSpatialElement + struct IfcExternalSpatialElement : IfcExternalSpatialStructureElement, ObjectHelper { IfcExternalSpatialElement() : Object("IfcExternalSpatialElement") {} + Maybe< IfcExternalSpatialElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSweptAreaSolid + struct IfcSweptAreaSolid : IfcSolidModel, ObjectHelper { IfcSweptAreaSolid() : Object("IfcSweptAreaSolid") {} + Lazy< IfcProfileDef > SweptArea; + Maybe< Lazy< IfcAxis2Placement3D > > Position; + }; + + // C++ wrapper for IfcExtrudedAreaSolid + struct IfcExtrudedAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcExtrudedAreaSolid() : Object("IfcExtrudedAreaSolid") {} + Lazy< IfcDirection > ExtrudedDirection; + IfcPositiveLengthMeasure::Out Depth; + }; + + // C++ wrapper for IfcExtrudedAreaSolidTapered + struct IfcExtrudedAreaSolidTapered : IfcExtrudedAreaSolid, ObjectHelper { IfcExtrudedAreaSolidTapered() : Object("IfcExtrudedAreaSolidTapered") {} + Lazy< IfcProfileDef > EndSweptArea; + }; + + // C++ wrapper for IfcFaceBasedSurfaceModel + struct IfcFaceBasedSurfaceModel : IfcGeometricRepresentationItem, ObjectHelper { IfcFaceBasedSurfaceModel() : Object("IfcFaceBasedSurfaceModel") {} + ListOf< Lazy< IfcConnectedFaceSet >, 1, 0 > FbsmFaces; + }; + + // C++ wrapper for IfcFaceBound + struct IfcFaceBound : IfcTopologicalRepresentationItem, ObjectHelper { IfcFaceBound() : Object("IfcFaceBound") {} + Lazy< IfcLoop > Bound; + IfcBoolean::Out Orientation; + }; + + // C++ wrapper for IfcFaceOuterBound + struct IfcFaceOuterBound : IfcFaceBound, ObjectHelper { IfcFaceOuterBound() : Object("IfcFaceOuterBound") {} + + }; + + // C++ wrapper for IfcFacetedBrep + struct IfcFacetedBrep : IfcManifoldSolidBrep, ObjectHelper { IfcFacetedBrep() : Object("IfcFacetedBrep") {} + + }; + + // C++ wrapper for IfcFacetedBrepWithVoids + struct IfcFacetedBrepWithVoids : IfcFacetedBrep, ObjectHelper { IfcFacetedBrepWithVoids() : Object("IfcFacetedBrepWithVoids") {} + ListOf< Lazy< IfcClosedShell >, 1, 0 > Voids; + }; + + // C++ wrapper for IfcFan + struct IfcFan : IfcFlowMovingDevice, ObjectHelper { IfcFan() : Object("IfcFan") {} + Maybe< IfcFanTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFanType + struct IfcFanType : IfcFlowMovingDeviceType, ObjectHelper { IfcFanType() : Object("IfcFanType") {} + IfcFanTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFastener + struct IfcFastener : IfcElementComponent, ObjectHelper { IfcFastener() : Object("IfcFastener") {} + Maybe< IfcFastenerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFastenerType + struct IfcFastenerType : IfcElementComponentType, ObjectHelper { IfcFastenerType() : Object("IfcFastenerType") {} + IfcFastenerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFeatureElement + struct IfcFeatureElement : IfcElement, ObjectHelper { IfcFeatureElement() : Object("IfcFeatureElement") {} + + }; + + // C++ wrapper for IfcFeatureElementAddition + struct IfcFeatureElementAddition : IfcFeatureElement, ObjectHelper { IfcFeatureElementAddition() : Object("IfcFeatureElementAddition") {} + + }; + + // C++ wrapper for IfcFeatureElementSubtraction + struct IfcFeatureElementSubtraction : IfcFeatureElement, ObjectHelper { IfcFeatureElementSubtraction() : Object("IfcFeatureElementSubtraction") {} + + }; + + // C++ wrapper for IfcFillAreaStyleHatching + struct IfcFillAreaStyleHatching : IfcGeometricRepresentationItem, ObjectHelper { IfcFillAreaStyleHatching() : Object("IfcFillAreaStyleHatching") {} + Lazy< NotImplemented > HatchLineAppearance; + IfcHatchLineDistanceSelect::Out StartOfNextHatchLine; + Maybe< Lazy< IfcCartesianPoint > > PointOfReferenceHatchLine; + Maybe< Lazy< IfcCartesianPoint > > PatternStart; + IfcPlaneAngleMeasure::Out HatchLineAngle; + }; + + // C++ wrapper for IfcFillAreaStyleTiles + struct IfcFillAreaStyleTiles : IfcGeometricRepresentationItem, ObjectHelper { IfcFillAreaStyleTiles() : Object("IfcFillAreaStyleTiles") {} + ListOf< Lazy< IfcVector >, 2, 2 > TilingPattern; + ListOf< Lazy< IfcStyledItem >, 1, 0 > Tiles; + IfcPositiveRatioMeasure::Out TilingScale; + }; + + // C++ wrapper for IfcFilter + struct IfcFilter : IfcFlowTreatmentDevice, ObjectHelper { IfcFilter() : Object("IfcFilter") {} + Maybe< IfcFilterTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFilterType + struct IfcFilterType : IfcFlowTreatmentDeviceType, ObjectHelper { IfcFilterType() : Object("IfcFilterType") {} + IfcFilterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFireSuppressionTerminal + struct IfcFireSuppressionTerminal : IfcFlowTerminal, ObjectHelper { IfcFireSuppressionTerminal() : Object("IfcFireSuppressionTerminal") {} + Maybe< IfcFireSuppressionTerminalTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFireSuppressionTerminalType + struct IfcFireSuppressionTerminalType : IfcFlowTerminalType, ObjectHelper { IfcFireSuppressionTerminalType() : Object("IfcFireSuppressionTerminalType") {} + IfcFireSuppressionTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFixedReferenceSweptAreaSolid + struct IfcFixedReferenceSweptAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcFixedReferenceSweptAreaSolid() : Object("IfcFixedReferenceSweptAreaSolid") {} + Lazy< IfcCurve > Directrix; + Maybe< IfcParameterValue::Out > StartParam; + Maybe< IfcParameterValue::Out > EndParam; + Lazy< IfcDirection > FixedReference; + }; + + // C++ wrapper for IfcFlowInstrument + struct IfcFlowInstrument : IfcDistributionControlElement, ObjectHelper { IfcFlowInstrument() : Object("IfcFlowInstrument") {} + Maybe< IfcFlowInstrumentTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowInstrumentType + struct IfcFlowInstrumentType : IfcDistributionControlElementType, ObjectHelper { IfcFlowInstrumentType() : Object("IfcFlowInstrumentType") {} + IfcFlowInstrumentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFlowMeter + struct IfcFlowMeter : IfcFlowController, ObjectHelper { IfcFlowMeter() : Object("IfcFlowMeter") {} + Maybe< IfcFlowMeterTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFlowMeterType + struct IfcFlowMeterType : IfcFlowControllerType, ObjectHelper { IfcFlowMeterType() : Object("IfcFlowMeterType") {} + IfcFlowMeterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFooting + struct IfcFooting : IfcBuildingElement, ObjectHelper { IfcFooting() : Object("IfcFooting") {} + Maybe< IfcFootingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFootingType + struct IfcFootingType : IfcBuildingElementType, ObjectHelper { IfcFootingType() : Object("IfcFootingType") {} + IfcFootingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcFurnishingElement + struct IfcFurnishingElement : IfcElement, ObjectHelper { IfcFurnishingElement() : Object("IfcFurnishingElement") {} + + }; + + // C++ wrapper for IfcFurnishingElementType + struct IfcFurnishingElementType : IfcElementType, ObjectHelper { IfcFurnishingElementType() : Object("IfcFurnishingElementType") {} + + }; + + // C++ wrapper for IfcFurniture + struct IfcFurniture : IfcFurnishingElement, ObjectHelper { IfcFurniture() : Object("IfcFurniture") {} + Maybe< IfcFurnitureTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcFurnitureType + struct IfcFurnitureType : IfcFurnishingElementType, ObjectHelper { IfcFurnitureType() : Object("IfcFurnitureType") {} + IfcAssemblyPlaceEnum::Out AssemblyPlace; + Maybe< IfcFurnitureTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcGeographicElement + struct IfcGeographicElement : IfcElement, ObjectHelper { IfcGeographicElement() : Object("IfcGeographicElement") {} + Maybe< IfcGeographicElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcGeographicElementType + struct IfcGeographicElementType : IfcElementType, ObjectHelper { IfcGeographicElementType() : Object("IfcGeographicElementType") {} + IfcGeographicElementTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcGeometricSet + struct IfcGeometricSet : IfcGeometricRepresentationItem, ObjectHelper { IfcGeometricSet() : Object("IfcGeometricSet") {} + ListOf< IfcGeometricSetSelect, 1, 0 >::Out Elements; + }; + + // C++ wrapper for IfcGeometricCurveSet + struct IfcGeometricCurveSet : IfcGeometricSet, ObjectHelper { IfcGeometricCurveSet() : Object("IfcGeometricCurveSet") {} + + }; + + // C++ wrapper for IfcRepresentationContext + struct IfcRepresentationContext : ObjectHelper { IfcRepresentationContext() : Object("IfcRepresentationContext") {} + Maybe< IfcLabel::Out > ContextIdentifier; + Maybe< IfcLabel::Out > ContextType; + }; + + // C++ wrapper for IfcGeometricRepresentationContext + struct IfcGeometricRepresentationContext : IfcRepresentationContext, ObjectHelper { IfcGeometricRepresentationContext() : Object("IfcGeometricRepresentationContext") {} + IfcDimensionCount::Out CoordinateSpaceDimension; + Maybe< IfcReal::Out > Precision; + IfcAxis2Placement::Out WorldCoordinateSystem; + Maybe< Lazy< IfcDirection > > TrueNorth; + }; + + // C++ wrapper for IfcGeometricRepresentationSubContext + struct IfcGeometricRepresentationSubContext : IfcGeometricRepresentationContext, ObjectHelper { IfcGeometricRepresentationSubContext() : Object("IfcGeometricRepresentationSubContext") {} + Lazy< IfcGeometricRepresentationContext > ParentContext; + Maybe< IfcPositiveRatioMeasure::Out > TargetScale; + IfcGeometricProjectionEnum::Out TargetView; + Maybe< IfcLabel::Out > UserDefinedTargetView; + }; + + // C++ wrapper for IfcGrid + struct IfcGrid : IfcProduct, ObjectHelper { IfcGrid() : Object("IfcGrid") {} + ListOf< Lazy< NotImplemented >, 1, 0 > UAxes; + ListOf< Lazy< NotImplemented >, 1, 0 > VAxes; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > WAxes; + Maybe< IfcGridTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcObjectPlacement + struct IfcObjectPlacement : ObjectHelper { IfcObjectPlacement() : Object("IfcObjectPlacement") {} + + }; + + // C++ wrapper for IfcGridPlacement + struct IfcGridPlacement : IfcObjectPlacement, ObjectHelper { IfcGridPlacement() : Object("IfcGridPlacement") {} + Lazy< NotImplemented > PlacementLocation; + Maybe< IfcGridPlacementDirectionSelect::Out > PlacementRefDirection; + }; + + // C++ wrapper for IfcHeatExchanger + struct IfcHeatExchanger : IfcEnergyConversionDevice, ObjectHelper { IfcHeatExchanger() : Object("IfcHeatExchanger") {} + Maybe< IfcHeatExchangerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcHeatExchangerType + struct IfcHeatExchangerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcHeatExchangerType() : Object("IfcHeatExchangerType") {} + IfcHeatExchangerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcHumidifier + struct IfcHumidifier : IfcEnergyConversionDevice, ObjectHelper { IfcHumidifier() : Object("IfcHumidifier") {} + Maybe< IfcHumidifierTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcHumidifierType + struct IfcHumidifierType : IfcEnergyConversionDeviceType, ObjectHelper { IfcHumidifierType() : Object("IfcHumidifierType") {} + IfcHumidifierTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcIShapeProfileDef + struct IfcIShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcIShapeProfileDef() : Object("IfcIShapeProfileDef") {} + IfcPositiveLengthMeasure::Out OverallWidth; + IfcPositiveLengthMeasure::Out OverallDepth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > FilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > FlangeEdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > FlangeSlope; + }; + + // C++ wrapper for IfcIndexedPolyCurve + struct IfcIndexedPolyCurve : IfcBoundedCurve, ObjectHelper { IfcIndexedPolyCurve() : Object("IfcIndexedPolyCurve") {} + Lazy< IfcCartesianPointList > Points; + Maybe< ListOf< IfcSegmentIndexSelect, 1, 0 >::Out > Segments; + Maybe< IfcBoolean::Out > SelfIntersect; + }; + + // C++ wrapper for IfcTessellatedItem + struct IfcTessellatedItem : IfcGeometricRepresentationItem, ObjectHelper { IfcTessellatedItem() : Object("IfcTessellatedItem") {} + + }; + + // C++ wrapper for IfcIndexedPolygonalFace + struct IfcIndexedPolygonalFace : IfcTessellatedItem, ObjectHelper { IfcIndexedPolygonalFace() : Object("IfcIndexedPolygonalFace") {} + ListOf< IfcPositiveInteger, 3, 0 >::Out CoordIndex; + }; + + // C++ wrapper for IfcIndexedPolygonalFaceWithVoids + struct IfcIndexedPolygonalFaceWithVoids : IfcIndexedPolygonalFace, ObjectHelper { IfcIndexedPolygonalFaceWithVoids() : Object("IfcIndexedPolygonalFaceWithVoids") {} + + }; + + // C++ wrapper for IfcInterceptor + struct IfcInterceptor : IfcFlowTreatmentDevice, ObjectHelper { IfcInterceptor() : Object("IfcInterceptor") {} + Maybe< IfcInterceptorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcInterceptorType + struct IfcInterceptorType : IfcFlowTreatmentDeviceType, ObjectHelper { IfcInterceptorType() : Object("IfcInterceptorType") {} + IfcInterceptorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSurfaceCurve + struct IfcSurfaceCurve : IfcCurve, ObjectHelper { IfcSurfaceCurve() : Object("IfcSurfaceCurve") {} + Lazy< IfcCurve > Curve3D; + ListOf< Lazy< IfcPcurve >, 1, 2 > AssociatedGeometry; + IfcPreferredSurfaceCurveRepresentation::Out MasterRepresentation; + }; + + // C++ wrapper for IfcIntersectionCurve + struct IfcIntersectionCurve : IfcSurfaceCurve, ObjectHelper { IfcIntersectionCurve() : Object("IfcIntersectionCurve") {} + + }; + + // C++ wrapper for IfcInventory + struct IfcInventory : IfcGroup, ObjectHelper { IfcInventory() : Object("IfcInventory") {} + Maybe< IfcInventoryTypeEnum::Out > PredefinedType; + Maybe< IfcActorSelect::Out > Jurisdiction; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > ResponsiblePersons; + Maybe< IfcDate::Out > LastUpdateDate; + Maybe< Lazy< NotImplemented > > CurrentValue; + Maybe< Lazy< NotImplemented > > OriginalValue; + }; + + // C++ wrapper for IfcJunctionBox + struct IfcJunctionBox : IfcFlowFitting, ObjectHelper { IfcJunctionBox() : Object("IfcJunctionBox") {} + Maybe< IfcJunctionBoxTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcJunctionBoxType + struct IfcJunctionBoxType : IfcFlowFittingType, ObjectHelper { IfcJunctionBoxType() : Object("IfcJunctionBoxType") {} + IfcJunctionBoxTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLShapeProfileDef + struct IfcLShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcLShapeProfileDef() : Object("IfcLShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + Maybe< IfcPositiveLengthMeasure::Out > Width; + IfcPositiveLengthMeasure::Out Thickness; + Maybe< IfcNonNegativeLengthMeasure::Out > FilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > EdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > LegSlope; + }; + + // C++ wrapper for IfcLaborResource + struct IfcLaborResource : IfcConstructionResource, ObjectHelper { IfcLaborResource() : Object("IfcLaborResource") {} + Maybe< IfcLaborResourceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcLaborResourceType + struct IfcLaborResourceType : IfcConstructionResourceType, ObjectHelper { IfcLaborResourceType() : Object("IfcLaborResourceType") {} + IfcLaborResourceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLamp + struct IfcLamp : IfcFlowTerminal, ObjectHelper { IfcLamp() : Object("IfcLamp") {} + Maybe< IfcLampTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcLampType + struct IfcLampType : IfcFlowTerminalType, ObjectHelper { IfcLampType() : Object("IfcLampType") {} + IfcLampTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLightFixture + struct IfcLightFixture : IfcFlowTerminal, ObjectHelper { IfcLightFixture() : Object("IfcLightFixture") {} + Maybe< IfcLightFixtureTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcLightFixtureType + struct IfcLightFixtureType : IfcFlowTerminalType, ObjectHelper { IfcLightFixtureType() : Object("IfcLightFixtureType") {} + IfcLightFixtureTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcLightSource + struct IfcLightSource : IfcGeometricRepresentationItem, ObjectHelper { IfcLightSource() : Object("IfcLightSource") {} + Maybe< IfcLabel::Out > Name; + Lazy< IfcColourRgb > LightColour; + Maybe< IfcNormalisedRatioMeasure::Out > AmbientIntensity; + Maybe< IfcNormalisedRatioMeasure::Out > Intensity; + }; + + // C++ wrapper for IfcLightSourceAmbient + struct IfcLightSourceAmbient : IfcLightSource, ObjectHelper { IfcLightSourceAmbient() : Object("IfcLightSourceAmbient") {} + + }; + + // C++ wrapper for IfcLightSourceDirectional + struct IfcLightSourceDirectional : IfcLightSource, ObjectHelper { IfcLightSourceDirectional() : Object("IfcLightSourceDirectional") {} + Lazy< IfcDirection > Orientation; + }; + + // C++ wrapper for IfcLightSourceGoniometric + struct IfcLightSourceGoniometric : IfcLightSource, ObjectHelper { IfcLightSourceGoniometric() : Object("IfcLightSourceGoniometric") {} + Lazy< IfcAxis2Placement3D > Position; + Maybe< Lazy< IfcColourRgb > > ColourAppearance; + IfcThermodynamicTemperatureMeasure::Out ColourTemperature; + IfcLuminousFluxMeasure::Out LuminousFlux; + IfcLightEmissionSourceEnum::Out LightEmissionSource; + IfcLightDistributionDataSourceSelect::Out LightDistributionDataSource; + }; + + // C++ wrapper for IfcLightSourcePositional + struct IfcLightSourcePositional : IfcLightSource, ObjectHelper { IfcLightSourcePositional() : Object("IfcLightSourcePositional") {} + Lazy< IfcCartesianPoint > Position; + IfcPositiveLengthMeasure::Out Radius; + IfcReal::Out ConstantAttenuation; + IfcReal::Out DistanceAttenuation; + IfcReal::Out QuadricAttenuation; + }; + + // C++ wrapper for IfcLightSourceSpot + struct IfcLightSourceSpot : IfcLightSourcePositional, ObjectHelper { IfcLightSourceSpot() : Object("IfcLightSourceSpot") {} + Lazy< IfcDirection > Orientation; + Maybe< IfcReal::Out > ConcentrationExponent; + IfcPositivePlaneAngleMeasure::Out SpreadAngle; + IfcPositivePlaneAngleMeasure::Out BeamWidthAngle; + }; + + // C++ wrapper for IfcLine + struct IfcLine : IfcCurve, ObjectHelper { IfcLine() : Object("IfcLine") {} + Lazy< IfcCartesianPoint > Pnt; + Lazy< IfcVector > Dir; + }; + + // C++ wrapper for IfcLocalPlacement + struct IfcLocalPlacement : IfcObjectPlacement, ObjectHelper { IfcLocalPlacement() : Object("IfcLocalPlacement") {} + Maybe< Lazy< IfcObjectPlacement > > PlacementRelTo; + IfcAxis2Placement::Out RelativePlacement; + }; + + // C++ wrapper for IfcMappedItem + struct IfcMappedItem : IfcRepresentationItem, ObjectHelper { IfcMappedItem() : Object("IfcMappedItem") {} + Lazy< IfcRepresentationMap > MappingSource; + Lazy< IfcCartesianTransformationOperator > MappingTarget; + }; + + // C++ wrapper for IfcProductRepresentation + struct IfcProductRepresentation : ObjectHelper { IfcProductRepresentation() : Object("IfcProductRepresentation") {} + Maybe< IfcLabel::Out > Name; + Maybe< IfcText::Out > Description; + ListOf< Lazy< IfcRepresentation >, 1, 0 > Representations; + }; + + // C++ wrapper for IfcMaterialDefinitionRepresentation + struct IfcMaterialDefinitionRepresentation : IfcProductRepresentation, ObjectHelper { IfcMaterialDefinitionRepresentation() : Object("IfcMaterialDefinitionRepresentation") {} + Lazy< NotImplemented > RepresentedMaterial; + }; + + // C++ wrapper for IfcMeasureWithUnit + struct IfcMeasureWithUnit : ObjectHelper { IfcMeasureWithUnit() : Object("IfcMeasureWithUnit") {} + IfcValue::Out ValueComponent; + IfcUnit::Out UnitComponent; + }; + + // C++ wrapper for IfcMechanicalFastener + struct IfcMechanicalFastener : IfcElementComponent, ObjectHelper { IfcMechanicalFastener() : Object("IfcMechanicalFastener") {} + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcPositiveLengthMeasure::Out > NominalLength; + Maybe< IfcMechanicalFastenerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcMechanicalFastenerType + struct IfcMechanicalFastenerType : IfcElementComponentType, ObjectHelper { IfcMechanicalFastenerType() : Object("IfcMechanicalFastenerType") {} + IfcMechanicalFastenerTypeEnum::Out PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcPositiveLengthMeasure::Out > NominalLength; + }; + + // C++ wrapper for IfcMedicalDevice + struct IfcMedicalDevice : IfcFlowTerminal, ObjectHelper { IfcMedicalDevice() : Object("IfcMedicalDevice") {} + Maybe< IfcMedicalDeviceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcMedicalDeviceType + struct IfcMedicalDeviceType : IfcFlowTerminalType, ObjectHelper { IfcMedicalDeviceType() : Object("IfcMedicalDeviceType") {} + IfcMedicalDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcMember + struct IfcMember : IfcBuildingElement, ObjectHelper { IfcMember() : Object("IfcMember") {} + Maybe< IfcMemberTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcMemberStandardCase + struct IfcMemberStandardCase : IfcMember, ObjectHelper { IfcMemberStandardCase() : Object("IfcMemberStandardCase") {} + + }; + + // C++ wrapper for IfcMemberType + struct IfcMemberType : IfcBuildingElementType, ObjectHelper { IfcMemberType() : Object("IfcMemberType") {} + IfcMemberTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcMirroredProfileDef + struct IfcMirroredProfileDef : IfcDerivedProfileDef, ObjectHelper { IfcMirroredProfileDef() : Object("IfcMirroredProfileDef") {} + + }; + + // C++ wrapper for IfcMotorConnection + struct IfcMotorConnection : IfcEnergyConversionDevice, ObjectHelper { IfcMotorConnection() : Object("IfcMotorConnection") {} + Maybe< IfcMotorConnectionTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcMotorConnectionType + struct IfcMotorConnectionType : IfcEnergyConversionDeviceType, ObjectHelper { IfcMotorConnectionType() : Object("IfcMotorConnectionType") {} + IfcMotorConnectionTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcOccupant + struct IfcOccupant : IfcActor, ObjectHelper { IfcOccupant() : Object("IfcOccupant") {} + Maybe< IfcOccupantTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcOffsetCurve2D + struct IfcOffsetCurve2D : IfcCurve, ObjectHelper { IfcOffsetCurve2D() : Object("IfcOffsetCurve2D") {} + Lazy< IfcCurve > BasisCurve; + IfcLengthMeasure::Out Distance; + IfcLogical::Out SelfIntersect; + }; + + // C++ wrapper for IfcOffsetCurve3D + struct IfcOffsetCurve3D : IfcCurve, ObjectHelper { IfcOffsetCurve3D() : Object("IfcOffsetCurve3D") {} + Lazy< IfcCurve > BasisCurve; + IfcLengthMeasure::Out Distance; + IfcLogical::Out SelfIntersect; + Lazy< IfcDirection > RefDirection; + }; + + // C++ wrapper for IfcOpenShell + struct IfcOpenShell : IfcConnectedFaceSet, ObjectHelper { IfcOpenShell() : Object("IfcOpenShell") {} + + }; + + // C++ wrapper for IfcOpeningElement + struct IfcOpeningElement : IfcFeatureElementSubtraction, ObjectHelper { IfcOpeningElement() : Object("IfcOpeningElement") {} + Maybe< IfcOpeningElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcOpeningStandardCase + struct IfcOpeningStandardCase : IfcOpeningElement, ObjectHelper { IfcOpeningStandardCase() : Object("IfcOpeningStandardCase") {} + + }; + + // C++ wrapper for IfcOrientedEdge + struct IfcOrientedEdge : IfcEdge, ObjectHelper { IfcOrientedEdge() : Object("IfcOrientedEdge") {} + Lazy< IfcEdge > EdgeElement; + IfcBoolean::Out Orientation; + }; + + // C++ wrapper for IfcOuterBoundaryCurve + struct IfcOuterBoundaryCurve : IfcBoundaryCurve, ObjectHelper { IfcOuterBoundaryCurve() : Object("IfcOuterBoundaryCurve") {} + + }; + + // C++ wrapper for IfcOutlet + struct IfcOutlet : IfcFlowTerminal, ObjectHelper { IfcOutlet() : Object("IfcOutlet") {} + Maybe< IfcOutletTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcOutletType + struct IfcOutletType : IfcFlowTerminalType, ObjectHelper { IfcOutletType() : Object("IfcOutletType") {} + IfcOutletTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPath + struct IfcPath : IfcTopologicalRepresentationItem, ObjectHelper { IfcPath() : Object("IfcPath") {} + ListOf< Lazy< IfcOrientedEdge >, 1, 0 > EdgeList; + }; + + // C++ wrapper for IfcPcurve + struct IfcPcurve : IfcCurve, ObjectHelper { IfcPcurve() : Object("IfcPcurve") {} + Lazy< IfcSurface > BasisSurface; + Lazy< IfcCurve > ReferenceCurve; + }; + + // C++ wrapper for IfcPerformanceHistory + struct IfcPerformanceHistory : IfcControl, ObjectHelper { IfcPerformanceHistory() : Object("IfcPerformanceHistory") {} + IfcLabel::Out LifeCyclePhase; + Maybe< IfcPerformanceHistoryTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcPermit + struct IfcPermit : IfcControl, ObjectHelper { IfcPermit() : Object("IfcPermit") {} + Maybe< IfcPermitTypeEnum::Out > PredefinedType; + Maybe< IfcLabel::Out > Status; + Maybe< IfcText::Out > LongDescription; + }; + + // C++ wrapper for IfcPile + struct IfcPile : IfcBuildingElement, ObjectHelper { IfcPile() : Object("IfcPile") {} + Maybe< IfcPileTypeEnum::Out > PredefinedType; + Maybe< IfcPileConstructionEnum::Out > ConstructionType; + }; + + // C++ wrapper for IfcPileType + struct IfcPileType : IfcBuildingElementType, ObjectHelper { IfcPileType() : Object("IfcPileType") {} + IfcPileTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPipeFitting + struct IfcPipeFitting : IfcFlowFitting, ObjectHelper { IfcPipeFitting() : Object("IfcPipeFitting") {} + Maybe< IfcPipeFittingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcPipeFittingType + struct IfcPipeFittingType : IfcFlowFittingType, ObjectHelper { IfcPipeFittingType() : Object("IfcPipeFittingType") {} + IfcPipeFittingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPipeSegment + struct IfcPipeSegment : IfcFlowSegment, ObjectHelper { IfcPipeSegment() : Object("IfcPipeSegment") {} + Maybe< IfcPipeSegmentTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcPipeSegmentType + struct IfcPipeSegmentType : IfcFlowSegmentType, ObjectHelper { IfcPipeSegmentType() : Object("IfcPipeSegmentType") {} + IfcPipeSegmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPlanarExtent + struct IfcPlanarExtent : IfcGeometricRepresentationItem, ObjectHelper { IfcPlanarExtent() : Object("IfcPlanarExtent") {} + IfcLengthMeasure::Out SizeInX; + IfcLengthMeasure::Out SizeInY; + }; + + // C++ wrapper for IfcPlanarBox + struct IfcPlanarBox : IfcPlanarExtent, ObjectHelper { IfcPlanarBox() : Object("IfcPlanarBox") {} + IfcAxis2Placement::Out Placement; + }; + + // C++ wrapper for IfcPlane + struct IfcPlane : IfcElementarySurface, ObjectHelper { IfcPlane() : Object("IfcPlane") {} + + }; + + // C++ wrapper for IfcPlate + struct IfcPlate : IfcBuildingElement, ObjectHelper { IfcPlate() : Object("IfcPlate") {} + Maybe< IfcPlateTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcPlateStandardCase + struct IfcPlateStandardCase : IfcPlate, ObjectHelper { IfcPlateStandardCase() : Object("IfcPlateStandardCase") {} + + }; + + // C++ wrapper for IfcPlateType + struct IfcPlateType : IfcBuildingElementType, ObjectHelper { IfcPlateType() : Object("IfcPlateType") {} + IfcPlateTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcPointOnCurve + struct IfcPointOnCurve : IfcPoint, ObjectHelper { IfcPointOnCurve() : Object("IfcPointOnCurve") {} + Lazy< IfcCurve > BasisCurve; + IfcParameterValue::Out PointParameter; + }; + + // C++ wrapper for IfcPointOnSurface + struct IfcPointOnSurface : IfcPoint, ObjectHelper { IfcPointOnSurface() : Object("IfcPointOnSurface") {} + Lazy< IfcSurface > BasisSurface; + IfcParameterValue::Out PointParameterU; + IfcParameterValue::Out PointParameterV; + }; + + // C++ wrapper for IfcPolyLoop + struct IfcPolyLoop : IfcLoop, ObjectHelper { IfcPolyLoop() : Object("IfcPolyLoop") {} + ListOf< Lazy< IfcCartesianPoint >, 3, 0 > Polygon; + }; + + // C++ wrapper for IfcPolygonalBoundedHalfSpace + struct IfcPolygonalBoundedHalfSpace : IfcHalfSpaceSolid, ObjectHelper { IfcPolygonalBoundedHalfSpace() : Object("IfcPolygonalBoundedHalfSpace") {} + Lazy< IfcAxis2Placement3D > Position; + Lazy< IfcBoundedCurve > PolygonalBoundary; + }; + + // C++ wrapper for IfcTessellatedFaceSet + struct IfcTessellatedFaceSet : IfcTessellatedItem, ObjectHelper { IfcTessellatedFaceSet() : Object("IfcTessellatedFaceSet") {} + Lazy< IfcCartesianPointList3D > Coordinates; + }; + + // C++ wrapper for IfcPolygonalFaceSet + struct IfcPolygonalFaceSet : IfcTessellatedFaceSet, ObjectHelper { IfcPolygonalFaceSet() : Object("IfcPolygonalFaceSet") {} + Maybe< IfcBoolean::Out > Closed; + ListOf< Lazy< IfcIndexedPolygonalFace >, 1, 0 > Faces; + Maybe< ListOf< IfcPositiveInteger, 1, 0 >::Out > PnIndex; + }; + + // C++ wrapper for IfcPolyline + struct IfcPolyline : IfcBoundedCurve, ObjectHelper { IfcPolyline() : Object("IfcPolyline") {} + ListOf< Lazy< IfcCartesianPoint >, 2, 0 > Points; + }; + + // C++ wrapper for IfcPresentationStyleAssignment + struct IfcPresentationStyleAssignment : ObjectHelper { IfcPresentationStyleAssignment() : Object("IfcPresentationStyleAssignment") {} + ListOf< IfcPresentationStyleSelect, 1, 0 >::Out Styles; + }; + + // C++ wrapper for IfcProcedure + struct IfcProcedure : IfcProcess, ObjectHelper { IfcProcedure() : Object("IfcProcedure") {} + Maybe< IfcProcedureTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcProcedureType + struct IfcProcedureType : IfcTypeProcess, ObjectHelper { IfcProcedureType() : Object("IfcProcedureType") {} + IfcProcedureTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProductDefinitionShape + struct IfcProductDefinitionShape : IfcProductRepresentation, ObjectHelper { IfcProductDefinitionShape() : Object("IfcProductDefinitionShape") {} + + }; + + // C++ wrapper for IfcProject + struct IfcProject : IfcContext, ObjectHelper { IfcProject() : Object("IfcProject") {} + + }; + + // C++ wrapper for IfcProjectLibrary + struct IfcProjectLibrary : IfcContext, ObjectHelper { IfcProjectLibrary() : Object("IfcProjectLibrary") {} + + }; + + // C++ wrapper for IfcProjectOrder + struct IfcProjectOrder : IfcControl, ObjectHelper { IfcProjectOrder() : Object("IfcProjectOrder") {} + Maybe< IfcProjectOrderTypeEnum::Out > PredefinedType; + Maybe< IfcLabel::Out > Status; + Maybe< IfcText::Out > LongDescription; + }; + + // C++ wrapper for IfcProjectionElement + struct IfcProjectionElement : IfcFeatureElementAddition, ObjectHelper { IfcProjectionElement() : Object("IfcProjectionElement") {} + Maybe< IfcProjectionElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSimpleProperty + struct IfcSimpleProperty : IfcProperty, ObjectHelper { IfcSimpleProperty() : Object("IfcSimpleProperty") {} + + }; + + // C++ wrapper for IfcPropertyBoundedValue + struct IfcPropertyBoundedValue : IfcSimpleProperty, ObjectHelper { IfcPropertyBoundedValue() : Object("IfcPropertyBoundedValue") {} + Maybe< IfcValue::Out > UpperBoundValue; + Maybe< IfcValue::Out > LowerBoundValue; + Maybe< IfcUnit::Out > Unit; + Maybe< IfcValue::Out > SetPointValue; + }; + + // C++ wrapper for IfcPropertyEnumeratedValue + struct IfcPropertyEnumeratedValue : IfcSimpleProperty, ObjectHelper { IfcPropertyEnumeratedValue() : Object("IfcPropertyEnumeratedValue") {} + Maybe< ListOf< IfcValue, 1, 0 >::Out > EnumerationValues; + Maybe< Lazy< NotImplemented > > EnumerationReference; + }; + + // C++ wrapper for IfcPropertyListValue + struct IfcPropertyListValue : IfcSimpleProperty, ObjectHelper { IfcPropertyListValue() : Object("IfcPropertyListValue") {} + Maybe< ListOf< IfcValue, 1, 0 >::Out > ListValues; + Maybe< IfcUnit::Out > Unit; + }; + + // C++ wrapper for IfcPropertyReferenceValue + struct IfcPropertyReferenceValue : IfcSimpleProperty, ObjectHelper { IfcPropertyReferenceValue() : Object("IfcPropertyReferenceValue") {} + Maybe< IfcText::Out > UsageName; + Maybe< IfcObjectReferenceSelect::Out > PropertyReference; + }; + + // C++ wrapper for IfcPropertySet + struct IfcPropertySet : IfcPropertySetDefinition, ObjectHelper { IfcPropertySet() : Object("IfcPropertySet") {} + ListOf< Lazy< IfcProperty >, 1, 0 > HasProperties; + }; + + // C++ wrapper for IfcPropertySingleValue + struct IfcPropertySingleValue : IfcSimpleProperty, ObjectHelper { IfcPropertySingleValue() : Object("IfcPropertySingleValue") {} + Maybe< IfcValue::Out > NominalValue; + Maybe< IfcUnit::Out > Unit; + }; + + // C++ wrapper for IfcPropertyTableValue + struct IfcPropertyTableValue : IfcSimpleProperty, ObjectHelper { IfcPropertyTableValue() : Object("IfcPropertyTableValue") {} + Maybe< ListOf< IfcValue, 1, 0 >::Out > DefiningValues; + Maybe< ListOf< IfcValue, 1, 0 >::Out > DefinedValues; + Maybe< IfcText::Out > Expression; + Maybe< IfcUnit::Out > DefiningUnit; + Maybe< IfcUnit::Out > DefinedUnit; + Maybe< IfcCurveInterpolationEnum::Out > CurveInterpolation; + }; + + // C++ wrapper for IfcProtectiveDevice + struct IfcProtectiveDevice : IfcFlowController, ObjectHelper { IfcProtectiveDevice() : Object("IfcProtectiveDevice") {} + Maybe< IfcProtectiveDeviceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcProtectiveDeviceTrippingUnit + struct IfcProtectiveDeviceTrippingUnit : IfcDistributionControlElement, ObjectHelper { IfcProtectiveDeviceTrippingUnit() : Object("IfcProtectiveDeviceTrippingUnit") {} + Maybe< IfcProtectiveDeviceTrippingUnitTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcProtectiveDeviceTrippingUnitType + struct IfcProtectiveDeviceTrippingUnitType : IfcDistributionControlElementType, ObjectHelper { IfcProtectiveDeviceTrippingUnitType() : Object("IfcProtectiveDeviceTrippingUnitType") {} + IfcProtectiveDeviceTrippingUnitTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProtectiveDeviceType + struct IfcProtectiveDeviceType : IfcFlowControllerType, ObjectHelper { IfcProtectiveDeviceType() : Object("IfcProtectiveDeviceType") {} + IfcProtectiveDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcProxy + struct IfcProxy : IfcProduct, ObjectHelper { IfcProxy() : Object("IfcProxy") {} + IfcObjectTypeEnum::Out ProxyType; + Maybe< IfcLabel::Out > Tag; + }; + + // C++ wrapper for IfcPump + struct IfcPump : IfcFlowMovingDevice, ObjectHelper { IfcPump() : Object("IfcPump") {} + Maybe< IfcPumpTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcPumpType + struct IfcPumpType : IfcFlowMovingDeviceType, ObjectHelper { IfcPumpType() : Object("IfcPumpType") {} + IfcPumpTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRailing + struct IfcRailing : IfcBuildingElement, ObjectHelper { IfcRailing() : Object("IfcRailing") {} + Maybe< IfcRailingTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcRailingType + struct IfcRailingType : IfcBuildingElementType, ObjectHelper { IfcRailingType() : Object("IfcRailingType") {} + IfcRailingTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRamp + struct IfcRamp : IfcBuildingElement, ObjectHelper { IfcRamp() : Object("IfcRamp") {} + Maybe< IfcRampTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcRampFlight + struct IfcRampFlight : IfcBuildingElement, ObjectHelper { IfcRampFlight() : Object("IfcRampFlight") {} + Maybe< IfcRampFlightTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcRampFlightType + struct IfcRampFlightType : IfcBuildingElementType, ObjectHelper { IfcRampFlightType() : Object("IfcRampFlightType") {} + IfcRampFlightTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRampType + struct IfcRampType : IfcBuildingElementType, ObjectHelper { IfcRampType() : Object("IfcRampType") {} + IfcRampTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRationalBSplineCurveWithKnots + struct IfcRationalBSplineCurveWithKnots : IfcBSplineCurveWithKnots, ObjectHelper { IfcRationalBSplineCurveWithKnots() : Object("IfcRationalBSplineCurveWithKnots") {} + ListOf< IfcReal, 2, 0 >::Out WeightsData; + }; + + // C++ wrapper for IfcRationalBSplineSurfaceWithKnots + struct IfcRationalBSplineSurfaceWithKnots : IfcBSplineSurfaceWithKnots, ObjectHelper { IfcRationalBSplineSurfaceWithKnots() : Object("IfcRationalBSplineSurfaceWithKnots") {} + + }; + + // C++ wrapper for IfcRectangleProfileDef + struct IfcRectangleProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcRectangleProfileDef() : Object("IfcRectangleProfileDef") {} + IfcPositiveLengthMeasure::Out XDim; + IfcPositiveLengthMeasure::Out YDim; + }; + + // C++ wrapper for IfcRectangleHollowProfileDef + struct IfcRectangleHollowProfileDef : IfcRectangleProfileDef, ObjectHelper { IfcRectangleHollowProfileDef() : Object("IfcRectangleHollowProfileDef") {} + IfcPositiveLengthMeasure::Out WallThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > InnerFilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > OuterFilletRadius; + }; + + // C++ wrapper for IfcRectangularPyramid + struct IfcRectangularPyramid : IfcCsgPrimitive3D, ObjectHelper { IfcRectangularPyramid() : Object("IfcRectangularPyramid") {} + IfcPositiveLengthMeasure::Out XLength; + IfcPositiveLengthMeasure::Out YLength; + IfcPositiveLengthMeasure::Out Height; + }; + + // C++ wrapper for IfcRectangularTrimmedSurface + struct IfcRectangularTrimmedSurface : IfcBoundedSurface, ObjectHelper { IfcRectangularTrimmedSurface() : Object("IfcRectangularTrimmedSurface") {} + Lazy< IfcSurface > BasisSurface; + IfcParameterValue::Out U1; + IfcParameterValue::Out V1; + IfcParameterValue::Out U2; + IfcParameterValue::Out V2; + IfcBoolean::Out Usense; + IfcBoolean::Out Vsense; + }; + + // C++ wrapper for IfcReinforcingElement + struct IfcReinforcingElement : IfcElementComponent, ObjectHelper { IfcReinforcingElement() : Object("IfcReinforcingElement") {} + Maybe< IfcLabel::Out > SteelGrade; + }; + + // C++ wrapper for IfcReinforcingBar + struct IfcReinforcingBar : IfcReinforcingElement, ObjectHelper { IfcReinforcingBar() : Object("IfcReinforcingBar") {} + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcAreaMeasure::Out > CrossSectionArea; + Maybe< IfcPositiveLengthMeasure::Out > BarLength; + Maybe< IfcReinforcingBarTypeEnum::Out > PredefinedType; + Maybe< IfcReinforcingBarSurfaceEnum::Out > BarSurface; + }; + + // C++ wrapper for IfcReinforcingElementType + struct IfcReinforcingElementType : IfcElementComponentType, ObjectHelper { IfcReinforcingElementType() : Object("IfcReinforcingElementType") {} + + }; + + // C++ wrapper for IfcReinforcingBarType + struct IfcReinforcingBarType : IfcReinforcingElementType, ObjectHelper { IfcReinforcingBarType() : Object("IfcReinforcingBarType") {} + IfcReinforcingBarTypeEnum::Out PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcAreaMeasure::Out > CrossSectionArea; + Maybe< IfcPositiveLengthMeasure::Out > BarLength; + Maybe< IfcReinforcingBarSurfaceEnum::Out > BarSurface; + Maybe< IfcLabel::Out > BendingShapeCode; + Maybe< ListOf< IfcBendingParameterSelect, 1, 0 >::Out > BendingParameters; + }; + + // C++ wrapper for IfcReinforcingMesh + struct IfcReinforcingMesh : IfcReinforcingElement, ObjectHelper { IfcReinforcingMesh() : Object("IfcReinforcingMesh") {} + Maybe< IfcPositiveLengthMeasure::Out > MeshLength; + Maybe< IfcPositiveLengthMeasure::Out > MeshWidth; + Maybe< IfcPositiveLengthMeasure::Out > LongitudinalBarNominalDiameter; + Maybe< IfcPositiveLengthMeasure::Out > TransverseBarNominalDiameter; + Maybe< IfcAreaMeasure::Out > LongitudinalBarCrossSectionArea; + Maybe< IfcAreaMeasure::Out > TransverseBarCrossSectionArea; + Maybe< IfcPositiveLengthMeasure::Out > LongitudinalBarSpacing; + Maybe< IfcPositiveLengthMeasure::Out > TransverseBarSpacing; + Maybe< IfcReinforcingMeshTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcReinforcingMeshType + struct IfcReinforcingMeshType : IfcReinforcingElementType, ObjectHelper { IfcReinforcingMeshType() : Object("IfcReinforcingMeshType") {} + IfcReinforcingMeshTypeEnum::Out PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > MeshLength; + Maybe< IfcPositiveLengthMeasure::Out > MeshWidth; + Maybe< IfcPositiveLengthMeasure::Out > LongitudinalBarNominalDiameter; + Maybe< IfcPositiveLengthMeasure::Out > TransverseBarNominalDiameter; + Maybe< IfcAreaMeasure::Out > LongitudinalBarCrossSectionArea; + Maybe< IfcAreaMeasure::Out > TransverseBarCrossSectionArea; + Maybe< IfcPositiveLengthMeasure::Out > LongitudinalBarSpacing; + Maybe< IfcPositiveLengthMeasure::Out > TransverseBarSpacing; + Maybe< IfcLabel::Out > BendingShapeCode; + Maybe< ListOf< IfcBendingParameterSelect, 1, 0 >::Out > BendingParameters; + }; + + // C++ wrapper for IfcRelationship + struct IfcRelationship : IfcRoot, ObjectHelper { IfcRelationship() : Object("IfcRelationship") {} + + }; + + // C++ wrapper for IfcRelDecomposes + struct IfcRelDecomposes : IfcRelationship, ObjectHelper { IfcRelDecomposes() : Object("IfcRelDecomposes") {} + + }; + + // C++ wrapper for IfcRelAggregates + struct IfcRelAggregates : IfcRelDecomposes, ObjectHelper { IfcRelAggregates() : Object("IfcRelAggregates") {} + Lazy< IfcObjectDefinition > RelatingObject; + ListOf< Lazy< IfcObjectDefinition >, 1, 0 > RelatedObjects; + }; + + // C++ wrapper for IfcRelConnects + struct IfcRelConnects : IfcRelationship, ObjectHelper { IfcRelConnects() : Object("IfcRelConnects") {} + + }; + + // C++ wrapper for IfcRelContainedInSpatialStructure + struct IfcRelContainedInSpatialStructure : IfcRelConnects, ObjectHelper { IfcRelContainedInSpatialStructure() : Object("IfcRelContainedInSpatialStructure") {} + ListOf< Lazy< IfcProduct >, 1, 0 > RelatedElements; + Lazy< IfcSpatialElement > RelatingStructure; + }; + + // C++ wrapper for IfcRelDefines + struct IfcRelDefines : IfcRelationship, ObjectHelper { IfcRelDefines() : Object("IfcRelDefines") {} + + }; + + // C++ wrapper for IfcRelDefinesByProperties + struct IfcRelDefinesByProperties : IfcRelDefines, ObjectHelper { IfcRelDefinesByProperties() : Object("IfcRelDefinesByProperties") {} + ListOf< Lazy< IfcObjectDefinition >, 1, 0 > RelatedObjects; + IfcPropertySetDefinitionSelect::Out RelatingPropertyDefinition; + }; + + // C++ wrapper for IfcRelFillsElement + struct IfcRelFillsElement : IfcRelConnects, ObjectHelper { IfcRelFillsElement() : Object("IfcRelFillsElement") {} + Lazy< IfcOpeningElement > RelatingOpeningElement; + Lazy< IfcElement > RelatedBuildingElement; + }; + + // C++ wrapper for IfcRelVoidsElement + struct IfcRelVoidsElement : IfcRelDecomposes, ObjectHelper { IfcRelVoidsElement() : Object("IfcRelVoidsElement") {} + Lazy< IfcElement > RelatingBuildingElement; + Lazy< IfcFeatureElementSubtraction > RelatedOpeningElement; + }; + + // C++ wrapper for IfcReparametrisedCompositeCurveSegment + struct IfcReparametrisedCompositeCurveSegment : IfcCompositeCurveSegment, ObjectHelper { IfcReparametrisedCompositeCurveSegment() : Object("IfcReparametrisedCompositeCurveSegment") {} + IfcParameterValue::Out ParamLength; + }; + + // C++ wrapper for IfcRepresentation + struct IfcRepresentation : ObjectHelper { IfcRepresentation() : Object("IfcRepresentation") {} + Lazy< IfcRepresentationContext > ContextOfItems; + Maybe< IfcLabel::Out > RepresentationIdentifier; + Maybe< IfcLabel::Out > RepresentationType; + ListOf< Lazy< IfcRepresentationItem >, 1, 0 > Items; + }; + + // C++ wrapper for IfcRepresentationMap + struct IfcRepresentationMap : ObjectHelper { IfcRepresentationMap() : Object("IfcRepresentationMap") {} + IfcAxis2Placement::Out MappingOrigin; + Lazy< IfcRepresentation > MappedRepresentation; + }; + + // C++ wrapper for IfcRevolvedAreaSolid + struct IfcRevolvedAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcRevolvedAreaSolid() : Object("IfcRevolvedAreaSolid") {} + Lazy< IfcAxis1Placement > Axis; + IfcPlaneAngleMeasure::Out Angle; + }; + + // C++ wrapper for IfcRevolvedAreaSolidTapered + struct IfcRevolvedAreaSolidTapered : IfcRevolvedAreaSolid, ObjectHelper { IfcRevolvedAreaSolidTapered() : Object("IfcRevolvedAreaSolidTapered") {} + Lazy< IfcProfileDef > EndSweptArea; + }; + + // C++ wrapper for IfcRightCircularCone + struct IfcRightCircularCone : IfcCsgPrimitive3D, ObjectHelper { IfcRightCircularCone() : Object("IfcRightCircularCone") {} + IfcPositiveLengthMeasure::Out Height; + IfcPositiveLengthMeasure::Out BottomRadius; + }; + + // C++ wrapper for IfcRightCircularCylinder + struct IfcRightCircularCylinder : IfcCsgPrimitive3D, ObjectHelper { IfcRightCircularCylinder() : Object("IfcRightCircularCylinder") {} + IfcPositiveLengthMeasure::Out Height; + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcRoof + struct IfcRoof : IfcBuildingElement, ObjectHelper { IfcRoof() : Object("IfcRoof") {} + Maybe< IfcRoofTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcRoofType + struct IfcRoofType : IfcBuildingElementType, ObjectHelper { IfcRoofType() : Object("IfcRoofType") {} + IfcRoofTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcRoundedRectangleProfileDef + struct IfcRoundedRectangleProfileDef : IfcRectangleProfileDef, ObjectHelper { IfcRoundedRectangleProfileDef() : Object("IfcRoundedRectangleProfileDef") {} + IfcPositiveLengthMeasure::Out RoundingRadius; + }; + + // C++ wrapper for IfcSIUnit + struct IfcSIUnit : IfcNamedUnit, ObjectHelper { IfcSIUnit() : Object("IfcSIUnit") {} + Maybe< IfcSIPrefix::Out > Prefix; + IfcSIUnitName::Out Name; + }; + + // C++ wrapper for IfcSanitaryTerminal + struct IfcSanitaryTerminal : IfcFlowTerminal, ObjectHelper { IfcSanitaryTerminal() : Object("IfcSanitaryTerminal") {} + Maybe< IfcSanitaryTerminalTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSanitaryTerminalType + struct IfcSanitaryTerminalType : IfcFlowTerminalType, ObjectHelper { IfcSanitaryTerminalType() : Object("IfcSanitaryTerminalType") {} + IfcSanitaryTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSeamCurve + struct IfcSeamCurve : IfcSurfaceCurve, ObjectHelper { IfcSeamCurve() : Object("IfcSeamCurve") {} + + }; + + // C++ wrapper for IfcSectionedSpine + struct IfcSectionedSpine : IfcGeometricRepresentationItem, ObjectHelper { IfcSectionedSpine() : Object("IfcSectionedSpine") {} + Lazy< IfcCompositeCurve > SpineCurve; + ListOf< Lazy< IfcProfileDef >, 2, 0 > CrossSections; + ListOf< Lazy< IfcAxis2Placement3D >, 2, 0 > CrossSectionPositions; + }; + + // C++ wrapper for IfcSensor + struct IfcSensor : IfcDistributionControlElement, ObjectHelper { IfcSensor() : Object("IfcSensor") {} + Maybe< IfcSensorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSensorType + struct IfcSensorType : IfcDistributionControlElementType, ObjectHelper { IfcSensorType() : Object("IfcSensorType") {} + IfcSensorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcShadingDevice + struct IfcShadingDevice : IfcBuildingElement, ObjectHelper { IfcShadingDevice() : Object("IfcShadingDevice") {} + Maybe< IfcShadingDeviceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcShadingDeviceType + struct IfcShadingDeviceType : IfcBuildingElementType, ObjectHelper { IfcShadingDeviceType() : Object("IfcShadingDeviceType") {} + IfcShadingDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcShapeModel + struct IfcShapeModel : IfcRepresentation, ObjectHelper { IfcShapeModel() : Object("IfcShapeModel") {} + + }; + + // C++ wrapper for IfcShapeRepresentation + struct IfcShapeRepresentation : IfcShapeModel, ObjectHelper { IfcShapeRepresentation() : Object("IfcShapeRepresentation") {} + + }; + + // C++ wrapper for IfcShellBasedSurfaceModel + struct IfcShellBasedSurfaceModel : IfcGeometricRepresentationItem, ObjectHelper { IfcShellBasedSurfaceModel() : Object("IfcShellBasedSurfaceModel") {} + ListOf< IfcShell, 1, 0 >::Out SbsmBoundary; + }; + + // C++ wrapper for IfcSite + struct IfcSite : IfcSpatialStructureElement, ObjectHelper { IfcSite() : Object("IfcSite") {} + Maybe< IfcCompoundPlaneAngleMeasure::Out > RefLatitude; + Maybe< IfcCompoundPlaneAngleMeasure::Out > RefLongitude; + Maybe< IfcLengthMeasure::Out > RefElevation; + Maybe< IfcLabel::Out > LandTitleNumber; + Maybe< Lazy< NotImplemented > > SiteAddress; + }; + + // C++ wrapper for IfcSlab + struct IfcSlab : IfcBuildingElement, ObjectHelper { IfcSlab() : Object("IfcSlab") {} + Maybe< IfcSlabTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSlabElementedCase + struct IfcSlabElementedCase : IfcSlab, ObjectHelper { IfcSlabElementedCase() : Object("IfcSlabElementedCase") {} + + }; + + // C++ wrapper for IfcSlabStandardCase + struct IfcSlabStandardCase : IfcSlab, ObjectHelper { IfcSlabStandardCase() : Object("IfcSlabStandardCase") {} + + }; + + // C++ wrapper for IfcSlabType + struct IfcSlabType : IfcBuildingElementType, ObjectHelper { IfcSlabType() : Object("IfcSlabType") {} + IfcSlabTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSolarDevice + struct IfcSolarDevice : IfcEnergyConversionDevice, ObjectHelper { IfcSolarDevice() : Object("IfcSolarDevice") {} + Maybe< IfcSolarDeviceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSolarDeviceType + struct IfcSolarDeviceType : IfcEnergyConversionDeviceType, ObjectHelper { IfcSolarDeviceType() : Object("IfcSolarDeviceType") {} + IfcSolarDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSpace + struct IfcSpace : IfcSpatialStructureElement, ObjectHelper { IfcSpace() : Object("IfcSpace") {} + Maybe< IfcSpaceTypeEnum::Out > PredefinedType; + Maybe< IfcLengthMeasure::Out > ElevationWithFlooring; + }; + + // C++ wrapper for IfcSpaceHeater + struct IfcSpaceHeater : IfcFlowTerminal, ObjectHelper { IfcSpaceHeater() : Object("IfcSpaceHeater") {} + Maybe< IfcSpaceHeaterTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSpaceHeaterType + struct IfcSpaceHeaterType : IfcFlowTerminalType, ObjectHelper { IfcSpaceHeaterType() : Object("IfcSpaceHeaterType") {} + IfcSpaceHeaterTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSpatialElementType + struct IfcSpatialElementType : IfcTypeProduct, ObjectHelper { IfcSpatialElementType() : Object("IfcSpatialElementType") {} + Maybe< IfcLabel::Out > ElementType; + }; + + // C++ wrapper for IfcSpatialStructureElementType + struct IfcSpatialStructureElementType : IfcSpatialElementType, ObjectHelper { IfcSpatialStructureElementType() : Object("IfcSpatialStructureElementType") {} + + }; + + // C++ wrapper for IfcSpaceType + struct IfcSpaceType : IfcSpatialStructureElementType, ObjectHelper { IfcSpaceType() : Object("IfcSpaceType") {} + IfcSpaceTypeEnum::Out PredefinedType; + Maybe< IfcLabel::Out > LongName; + }; + + // C++ wrapper for IfcSpatialZone + struct IfcSpatialZone : IfcSpatialElement, ObjectHelper { IfcSpatialZone() : Object("IfcSpatialZone") {} + Maybe< IfcSpatialZoneTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSpatialZoneType + struct IfcSpatialZoneType : IfcSpatialElementType, ObjectHelper { IfcSpatialZoneType() : Object("IfcSpatialZoneType") {} + IfcSpatialZoneTypeEnum::Out PredefinedType; + Maybe< IfcLabel::Out > LongName; + }; + + // C++ wrapper for IfcSphere + struct IfcSphere : IfcCsgPrimitive3D, ObjectHelper { IfcSphere() : Object("IfcSphere") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcSphericalSurface + struct IfcSphericalSurface : IfcElementarySurface, ObjectHelper { IfcSphericalSurface() : Object("IfcSphericalSurface") {} + IfcPositiveLengthMeasure::Out Radius; + }; + + // C++ wrapper for IfcStackTerminal + struct IfcStackTerminal : IfcFlowTerminal, ObjectHelper { IfcStackTerminal() : Object("IfcStackTerminal") {} + Maybe< IfcStackTerminalTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcStackTerminalType + struct IfcStackTerminalType : IfcFlowTerminalType, ObjectHelper { IfcStackTerminalType() : Object("IfcStackTerminalType") {} + IfcStackTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStair + struct IfcStair : IfcBuildingElement, ObjectHelper { IfcStair() : Object("IfcStair") {} + Maybe< IfcStairTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcStairFlight + struct IfcStairFlight : IfcBuildingElement, ObjectHelper { IfcStairFlight() : Object("IfcStairFlight") {} + Maybe< IfcInteger::Out > NumberOfRisers; + Maybe< IfcInteger::Out > NumberOfTreads; + Maybe< IfcPositiveLengthMeasure::Out > RiserHeight; + Maybe< IfcPositiveLengthMeasure::Out > TreadLength; + Maybe< IfcStairFlightTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcStairFlightType + struct IfcStairFlightType : IfcBuildingElementType, ObjectHelper { IfcStairFlightType() : Object("IfcStairFlightType") {} + IfcStairFlightTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStairType + struct IfcStairType : IfcBuildingElementType, ObjectHelper { IfcStairType() : Object("IfcStairType") {} + IfcStairTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStructuralActivity + struct IfcStructuralActivity : IfcProduct, ObjectHelper { IfcStructuralActivity() : Object("IfcStructuralActivity") {} + Lazy< NotImplemented > AppliedLoad; + IfcGlobalOrLocalEnum::Out GlobalOrLocal; + }; + + // C++ wrapper for IfcStructuralAction + struct IfcStructuralAction : IfcStructuralActivity, ObjectHelper { IfcStructuralAction() : Object("IfcStructuralAction") {} + Maybe< IfcBoolean::Out > DestabilizingLoad; + }; + + // C++ wrapper for IfcStructuralAnalysisModel + struct IfcStructuralAnalysisModel : IfcSystem, ObjectHelper { IfcStructuralAnalysisModel() : Object("IfcStructuralAnalysisModel") {} + IfcAnalysisModelTypeEnum::Out PredefinedType; + Maybe< Lazy< IfcAxis2Placement3D > > OrientationOf2DPlane; + Maybe< ListOf< Lazy< IfcStructuralLoadGroup >, 1, 0 > > LoadedBy; + Maybe< ListOf< Lazy< IfcStructuralResultGroup >, 1, 0 > > HasResults; + Maybe< Lazy< IfcObjectPlacement > > SharedPlacement; + }; + + // C++ wrapper for IfcStructuralItem + struct IfcStructuralItem : IfcProduct, ObjectHelper { IfcStructuralItem() : Object("IfcStructuralItem") {} + + }; + + // C++ wrapper for IfcStructuralConnection + struct IfcStructuralConnection : IfcStructuralItem, ObjectHelper { IfcStructuralConnection() : Object("IfcStructuralConnection") {} + Maybe< Lazy< NotImplemented > > AppliedCondition; + }; + + // C++ wrapper for IfcStructuralCurveAction + struct IfcStructuralCurveAction : IfcStructuralAction, ObjectHelper { IfcStructuralCurveAction() : Object("IfcStructuralCurveAction") {} + Maybe< IfcProjectedOrTrueLengthEnum::Out > ProjectedOrTrue; + IfcStructuralCurveActivityTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStructuralCurveConnection + struct IfcStructuralCurveConnection : IfcStructuralConnection, ObjectHelper { IfcStructuralCurveConnection() : Object("IfcStructuralCurveConnection") {} + Lazy< IfcDirection > Axis; + }; + + // C++ wrapper for IfcStructuralMember + struct IfcStructuralMember : IfcStructuralItem, ObjectHelper { IfcStructuralMember() : Object("IfcStructuralMember") {} + + }; + + // C++ wrapper for IfcStructuralCurveMember + struct IfcStructuralCurveMember : IfcStructuralMember, ObjectHelper { IfcStructuralCurveMember() : Object("IfcStructuralCurveMember") {} + IfcStructuralCurveMemberTypeEnum::Out PredefinedType; + Lazy< IfcDirection > Axis; + }; + + // C++ wrapper for IfcStructuralCurveMemberVarying + struct IfcStructuralCurveMemberVarying : IfcStructuralCurveMember, ObjectHelper { IfcStructuralCurveMemberVarying() : Object("IfcStructuralCurveMemberVarying") {} + + }; + + // C++ wrapper for IfcStructuralReaction + struct IfcStructuralReaction : IfcStructuralActivity, ObjectHelper { IfcStructuralReaction() : Object("IfcStructuralReaction") {} + + }; + + // C++ wrapper for IfcStructuralCurveReaction + struct IfcStructuralCurveReaction : IfcStructuralReaction, ObjectHelper { IfcStructuralCurveReaction() : Object("IfcStructuralCurveReaction") {} + IfcStructuralCurveActivityTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStructuralLinearAction + struct IfcStructuralLinearAction : IfcStructuralCurveAction, ObjectHelper { IfcStructuralLinearAction() : Object("IfcStructuralLinearAction") {} + + }; + + // C++ wrapper for IfcStructuralLoadGroup + struct IfcStructuralLoadGroup : IfcGroup, ObjectHelper { IfcStructuralLoadGroup() : Object("IfcStructuralLoadGroup") {} + IfcLoadGroupTypeEnum::Out PredefinedType; + IfcActionTypeEnum::Out ActionType; + IfcActionSourceTypeEnum::Out ActionSource; + Maybe< IfcRatioMeasure::Out > Coefficient; + Maybe< IfcLabel::Out > Purpose; + }; + + // C++ wrapper for IfcStructuralLoadCase + struct IfcStructuralLoadCase : IfcStructuralLoadGroup, ObjectHelper { IfcStructuralLoadCase() : Object("IfcStructuralLoadCase") {} + Maybe< ListOf< IfcRatioMeasure, 3, 3 >::Out > SelfWeightCoefficients; + }; + + // C++ wrapper for IfcStructuralSurfaceAction + struct IfcStructuralSurfaceAction : IfcStructuralAction, ObjectHelper { IfcStructuralSurfaceAction() : Object("IfcStructuralSurfaceAction") {} + Maybe< IfcProjectedOrTrueLengthEnum::Out > ProjectedOrTrue; + IfcStructuralSurfaceActivityTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStructuralPlanarAction + struct IfcStructuralPlanarAction : IfcStructuralSurfaceAction, ObjectHelper { IfcStructuralPlanarAction() : Object("IfcStructuralPlanarAction") {} + + }; + + // C++ wrapper for IfcStructuralPointAction + struct IfcStructuralPointAction : IfcStructuralAction, ObjectHelper { IfcStructuralPointAction() : Object("IfcStructuralPointAction") {} + + }; + + // C++ wrapper for IfcStructuralPointConnection + struct IfcStructuralPointConnection : IfcStructuralConnection, ObjectHelper { IfcStructuralPointConnection() : Object("IfcStructuralPointConnection") {} + Maybe< Lazy< IfcAxis2Placement3D > > ConditionCoordinateSystem; + }; + + // C++ wrapper for IfcStructuralPointReaction + struct IfcStructuralPointReaction : IfcStructuralReaction, ObjectHelper { IfcStructuralPointReaction() : Object("IfcStructuralPointReaction") {} + + }; + + // C++ wrapper for IfcStructuralResultGroup + struct IfcStructuralResultGroup : IfcGroup, ObjectHelper { IfcStructuralResultGroup() : Object("IfcStructuralResultGroup") {} + IfcAnalysisTheoryTypeEnum::Out TheoryType; + Maybe< Lazy< IfcStructuralLoadGroup > > ResultForLoadGroup; + IfcBoolean::Out IsLinear; + }; + + // C++ wrapper for IfcStructuralSurfaceConnection + struct IfcStructuralSurfaceConnection : IfcStructuralConnection, ObjectHelper { IfcStructuralSurfaceConnection() : Object("IfcStructuralSurfaceConnection") {} + + }; + + // C++ wrapper for IfcStructuralSurfaceMember + struct IfcStructuralSurfaceMember : IfcStructuralMember, ObjectHelper { IfcStructuralSurfaceMember() : Object("IfcStructuralSurfaceMember") {} + IfcStructuralSurfaceMemberTypeEnum::Out PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > Thickness; + }; + + // C++ wrapper for IfcStructuralSurfaceMemberVarying + struct IfcStructuralSurfaceMemberVarying : IfcStructuralSurfaceMember, ObjectHelper { IfcStructuralSurfaceMemberVarying() : Object("IfcStructuralSurfaceMemberVarying") {} + + }; + + // C++ wrapper for IfcStructuralSurfaceReaction + struct IfcStructuralSurfaceReaction : IfcStructuralReaction, ObjectHelper { IfcStructuralSurfaceReaction() : Object("IfcStructuralSurfaceReaction") {} + IfcStructuralSurfaceActivityTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcStyleModel + struct IfcStyleModel : IfcRepresentation, ObjectHelper { IfcStyleModel() : Object("IfcStyleModel") {} + + }; + + // C++ wrapper for IfcStyledItem + struct IfcStyledItem : IfcRepresentationItem, ObjectHelper { IfcStyledItem() : Object("IfcStyledItem") {} + Maybe< Lazy< IfcRepresentationItem > > Item; + ListOf< IfcStyleAssignmentSelect, 1, 0 >::Out Styles; + Maybe< IfcLabel::Out > Name; + }; + + // C++ wrapper for IfcStyledRepresentation + struct IfcStyledRepresentation : IfcStyleModel, ObjectHelper { IfcStyledRepresentation() : Object("IfcStyledRepresentation") {} + + }; + + // C++ wrapper for IfcSubContractResource + struct IfcSubContractResource : IfcConstructionResource, ObjectHelper { IfcSubContractResource() : Object("IfcSubContractResource") {} + Maybe< IfcSubContractResourceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSubContractResourceType + struct IfcSubContractResourceType : IfcConstructionResourceType, ObjectHelper { IfcSubContractResourceType() : Object("IfcSubContractResourceType") {} + IfcSubContractResourceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSubedge + struct IfcSubedge : IfcEdge, ObjectHelper { IfcSubedge() : Object("IfcSubedge") {} + Lazy< IfcEdge > ParentEdge; + }; + + // C++ wrapper for IfcSurfaceCurveSweptAreaSolid + struct IfcSurfaceCurveSweptAreaSolid : IfcSweptAreaSolid, ObjectHelper { IfcSurfaceCurveSweptAreaSolid() : Object("IfcSurfaceCurveSweptAreaSolid") {} + Lazy< IfcCurve > Directrix; + Maybe< IfcParameterValue::Out > StartParam; + Maybe< IfcParameterValue::Out > EndParam; + Lazy< IfcSurface > ReferenceSurface; + }; + + // C++ wrapper for IfcSurfaceFeature + struct IfcSurfaceFeature : IfcFeatureElement, ObjectHelper { IfcSurfaceFeature() : Object("IfcSurfaceFeature") {} + Maybe< IfcSurfaceFeatureTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSweptSurface + struct IfcSweptSurface : IfcSurface, ObjectHelper { IfcSweptSurface() : Object("IfcSweptSurface") {} + Lazy< IfcProfileDef > SweptCurve; + Maybe< Lazy< IfcAxis2Placement3D > > Position; + }; + + // C++ wrapper for IfcSurfaceOfLinearExtrusion + struct IfcSurfaceOfLinearExtrusion : IfcSweptSurface, ObjectHelper { IfcSurfaceOfLinearExtrusion() : Object("IfcSurfaceOfLinearExtrusion") {} + Lazy< IfcDirection > ExtrudedDirection; + IfcLengthMeasure::Out Depth; + }; + + // C++ wrapper for IfcSurfaceOfRevolution + struct IfcSurfaceOfRevolution : IfcSweptSurface, ObjectHelper { IfcSurfaceOfRevolution() : Object("IfcSurfaceOfRevolution") {} + Lazy< IfcAxis1Placement > AxisPosition; + }; + + // C++ wrapper for IfcSurfaceStyle + struct IfcSurfaceStyle : IfcPresentationStyle, ObjectHelper { IfcSurfaceStyle() : Object("IfcSurfaceStyle") {} + IfcSurfaceSide::Out Side; + ListOf< IfcSurfaceStyleElementSelect, 1, 5 >::Out Styles; + }; + + // C++ wrapper for IfcSurfaceStyleShading + struct IfcSurfaceStyleShading : IfcPresentationItem, ObjectHelper { IfcSurfaceStyleShading() : Object("IfcSurfaceStyleShading") {} + Lazy< IfcColourRgb > SurfaceColour; + Maybe< IfcNormalisedRatioMeasure::Out > Transparency; + }; + + // C++ wrapper for IfcSurfaceStyleRendering + struct IfcSurfaceStyleRendering : IfcSurfaceStyleShading, ObjectHelper { IfcSurfaceStyleRendering() : Object("IfcSurfaceStyleRendering") {} + Maybe< IfcColourOrFactor::Out > DiffuseColour; + Maybe< IfcColourOrFactor::Out > TransmissionColour; + Maybe< IfcColourOrFactor::Out > DiffuseTransmissionColour; + Maybe< IfcColourOrFactor::Out > ReflectionColour; + Maybe< IfcColourOrFactor::Out > SpecularColour; + Maybe< IfcSpecularHighlightSelect::Out > SpecularHighlight; + IfcReflectanceMethodEnum::Out ReflectanceMethod; + }; + + // C++ wrapper for IfcSurfaceStyleWithTextures + struct IfcSurfaceStyleWithTextures : IfcPresentationItem, ObjectHelper { IfcSurfaceStyleWithTextures() : Object("IfcSurfaceStyleWithTextures") {} + ListOf< Lazy< NotImplemented >, 1, 0 > Textures; + }; + + // C++ wrapper for IfcSweptDiskSolid + struct IfcSweptDiskSolid : IfcSolidModel, ObjectHelper { IfcSweptDiskSolid() : Object("IfcSweptDiskSolid") {} + Lazy< IfcCurve > Directrix; + IfcPositiveLengthMeasure::Out Radius; + Maybe< IfcPositiveLengthMeasure::Out > InnerRadius; + Maybe< IfcParameterValue::Out > StartParam; + Maybe< IfcParameterValue::Out > EndParam; + }; + + // C++ wrapper for IfcSweptDiskSolidPolygonal + struct IfcSweptDiskSolidPolygonal : IfcSweptDiskSolid, ObjectHelper { IfcSweptDiskSolidPolygonal() : Object("IfcSweptDiskSolidPolygonal") {} + Maybe< IfcPositiveLengthMeasure::Out > FilletRadius; + }; + + // C++ wrapper for IfcSwitchingDevice + struct IfcSwitchingDevice : IfcFlowController, ObjectHelper { IfcSwitchingDevice() : Object("IfcSwitchingDevice") {} + Maybe< IfcSwitchingDeviceTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSwitchingDeviceType + struct IfcSwitchingDeviceType : IfcFlowControllerType, ObjectHelper { IfcSwitchingDeviceType() : Object("IfcSwitchingDeviceType") {} + IfcSwitchingDeviceTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcSystemFurnitureElement + struct IfcSystemFurnitureElement : IfcFurnishingElement, ObjectHelper { IfcSystemFurnitureElement() : Object("IfcSystemFurnitureElement") {} + Maybe< IfcSystemFurnitureElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcSystemFurnitureElementType + struct IfcSystemFurnitureElementType : IfcFurnishingElementType, ObjectHelper { IfcSystemFurnitureElementType() : Object("IfcSystemFurnitureElementType") {} + Maybe< IfcSystemFurnitureElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTShapeProfileDef + struct IfcTShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcTShapeProfileDef() : Object("IfcTShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out FlangeWidth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > FilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > FlangeEdgeRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > WebEdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > WebSlope; + Maybe< IfcPlaneAngleMeasure::Out > FlangeSlope; + }; + + // C++ wrapper for IfcTank + struct IfcTank : IfcFlowStorageDevice, ObjectHelper { IfcTank() : Object("IfcTank") {} + Maybe< IfcTankTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTankType + struct IfcTankType : IfcFlowStorageDeviceType, ObjectHelper { IfcTankType() : Object("IfcTankType") {} + IfcTankTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTask + struct IfcTask : IfcProcess, ObjectHelper { IfcTask() : Object("IfcTask") {} + Maybe< IfcLabel::Out > Status; + Maybe< IfcLabel::Out > WorkMethod; + IfcBoolean::Out IsMilestone; + Maybe< IfcInteger::Out > Priority; + Maybe< Lazy< NotImplemented > > TaskTime; + Maybe< IfcTaskTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTaskType + struct IfcTaskType : IfcTypeProcess, ObjectHelper { IfcTaskType() : Object("IfcTaskType") {} + IfcTaskTypeEnum::Out PredefinedType; + Maybe< IfcLabel::Out > WorkMethod; + }; + + // C++ wrapper for IfcTendon + struct IfcTendon : IfcReinforcingElement, ObjectHelper { IfcTendon() : Object("IfcTendon") {} + Maybe< IfcTendonTypeEnum::Out > PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcAreaMeasure::Out > CrossSectionArea; + Maybe< IfcForceMeasure::Out > TensionForce; + Maybe< IfcPressureMeasure::Out > PreStress; + Maybe< IfcNormalisedRatioMeasure::Out > FrictionCoefficient; + Maybe< IfcPositiveLengthMeasure::Out > AnchorageSlip; + Maybe< IfcPositiveLengthMeasure::Out > MinCurvatureRadius; + }; + + // C++ wrapper for IfcTendonAnchor + struct IfcTendonAnchor : IfcReinforcingElement, ObjectHelper { IfcTendonAnchor() : Object("IfcTendonAnchor") {} + Maybe< IfcTendonAnchorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTendonAnchorType + struct IfcTendonAnchorType : IfcReinforcingElementType, ObjectHelper { IfcTendonAnchorType() : Object("IfcTendonAnchorType") {} + IfcTendonAnchorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTendonType + struct IfcTendonType : IfcReinforcingElementType, ObjectHelper { IfcTendonType() : Object("IfcTendonType") {} + IfcTendonTypeEnum::Out PredefinedType; + Maybe< IfcPositiveLengthMeasure::Out > NominalDiameter; + Maybe< IfcAreaMeasure::Out > CrossSectionArea; + Maybe< IfcPositiveLengthMeasure::Out > SheathDiameter; + }; + + // C++ wrapper for IfcTextLiteral + struct IfcTextLiteral : IfcGeometricRepresentationItem, ObjectHelper { IfcTextLiteral() : Object("IfcTextLiteral") {} + IfcPresentableText::Out Literal; + IfcAxis2Placement::Out Placement; + IfcTextPath::Out Path; + }; + + // C++ wrapper for IfcTextLiteralWithExtent + struct IfcTextLiteralWithExtent : IfcTextLiteral, ObjectHelper { IfcTextLiteralWithExtent() : Object("IfcTextLiteralWithExtent") {} + Lazy< IfcPlanarExtent > Extent; + IfcBoxAlignment::Out BoxAlignment; + }; + + // C++ wrapper for IfcTopologyRepresentation + struct IfcTopologyRepresentation : IfcShapeModel, ObjectHelper { IfcTopologyRepresentation() : Object("IfcTopologyRepresentation") {} + + }; + + // C++ wrapper for IfcToroidalSurface + struct IfcToroidalSurface : IfcElementarySurface, ObjectHelper { IfcToroidalSurface() : Object("IfcToroidalSurface") {} + IfcPositiveLengthMeasure::Out MajorRadius; + IfcPositiveLengthMeasure::Out MinorRadius; + }; + + // C++ wrapper for IfcTransformer + struct IfcTransformer : IfcEnergyConversionDevice, ObjectHelper { IfcTransformer() : Object("IfcTransformer") {} + Maybe< IfcTransformerTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTransformerType + struct IfcTransformerType : IfcEnergyConversionDeviceType, ObjectHelper { IfcTransformerType() : Object("IfcTransformerType") {} + IfcTransformerTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTransportElement + struct IfcTransportElement : IfcElement, ObjectHelper { IfcTransportElement() : Object("IfcTransportElement") {} + Maybe< IfcTransportElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTransportElementType + struct IfcTransportElementType : IfcElementType, ObjectHelper { IfcTransportElementType() : Object("IfcTransportElementType") {} + IfcTransportElementTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcTrapeziumProfileDef + struct IfcTrapeziumProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcTrapeziumProfileDef() : Object("IfcTrapeziumProfileDef") {} + IfcPositiveLengthMeasure::Out BottomXDim; + IfcPositiveLengthMeasure::Out TopXDim; + IfcPositiveLengthMeasure::Out YDim; + IfcLengthMeasure::Out TopXOffset; + }; + + // C++ wrapper for IfcTriangulatedFaceSet + struct IfcTriangulatedFaceSet : IfcTessellatedFaceSet, ObjectHelper { IfcTriangulatedFaceSet() : Object("IfcTriangulatedFaceSet") {} + Maybe< IfcBoolean::Out > Closed; + Maybe< ListOf< IfcPositiveInteger, 1, 0 >::Out > PnIndex; + }; + + // C++ wrapper for IfcTrimmedCurve + struct IfcTrimmedCurve : IfcBoundedCurve, ObjectHelper { IfcTrimmedCurve() : Object("IfcTrimmedCurve") {} + Lazy< IfcCurve > BasisCurve; + ListOf< IfcTrimmingSelect, 1, 2 >::Out Trim1; + ListOf< IfcTrimmingSelect, 1, 2 >::Out Trim2; + IfcBoolean::Out SenseAgreement; + IfcTrimmingPreference::Out MasterRepresentation; + }; + + // C++ wrapper for IfcTubeBundle + struct IfcTubeBundle : IfcEnergyConversionDevice, ObjectHelper { IfcTubeBundle() : Object("IfcTubeBundle") {} + Maybe< IfcTubeBundleTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcTubeBundleType + struct IfcTubeBundleType : IfcEnergyConversionDeviceType, ObjectHelper { IfcTubeBundleType() : Object("IfcTubeBundleType") {} + IfcTubeBundleTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcUShapeProfileDef + struct IfcUShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcUShapeProfileDef() : Object("IfcUShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out FlangeWidth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > FilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > EdgeRadius; + Maybe< IfcPlaneAngleMeasure::Out > FlangeSlope; + }; + + // C++ wrapper for IfcUnitAssignment + struct IfcUnitAssignment : ObjectHelper { IfcUnitAssignment() : Object("IfcUnitAssignment") {} + ListOf< IfcUnit, 1, 0 >::Out Units; + }; + + // C++ wrapper for IfcUnitaryControlElement + struct IfcUnitaryControlElement : IfcDistributionControlElement, ObjectHelper { IfcUnitaryControlElement() : Object("IfcUnitaryControlElement") {} + Maybe< IfcUnitaryControlElementTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcUnitaryControlElementType + struct IfcUnitaryControlElementType : IfcDistributionControlElementType, ObjectHelper { IfcUnitaryControlElementType() : Object("IfcUnitaryControlElementType") {} + IfcUnitaryControlElementTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcUnitaryEquipment + struct IfcUnitaryEquipment : IfcEnergyConversionDevice, ObjectHelper { IfcUnitaryEquipment() : Object("IfcUnitaryEquipment") {} + Maybe< IfcUnitaryEquipmentTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcUnitaryEquipmentType + struct IfcUnitaryEquipmentType : IfcEnergyConversionDeviceType, ObjectHelper { IfcUnitaryEquipmentType() : Object("IfcUnitaryEquipmentType") {} + IfcUnitaryEquipmentTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcValve + struct IfcValve : IfcFlowController, ObjectHelper { IfcValve() : Object("IfcValve") {} + Maybe< IfcValveTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcValveType + struct IfcValveType : IfcFlowControllerType, ObjectHelper { IfcValveType() : Object("IfcValveType") {} + IfcValveTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcVector + struct IfcVector : IfcGeometricRepresentationItem, ObjectHelper { IfcVector() : Object("IfcVector") {} + Lazy< IfcDirection > Orientation; + IfcLengthMeasure::Out Magnitude; + }; + + // C++ wrapper for IfcVertex + struct IfcVertex : IfcTopologicalRepresentationItem, ObjectHelper { IfcVertex() : Object("IfcVertex") {} + + }; + + // C++ wrapper for IfcVertexLoop + struct IfcVertexLoop : IfcLoop, ObjectHelper { IfcVertexLoop() : Object("IfcVertexLoop") {} + Lazy< IfcVertex > LoopVertex; + }; + + // C++ wrapper for IfcVertexPoint + struct IfcVertexPoint : IfcVertex, ObjectHelper { IfcVertexPoint() : Object("IfcVertexPoint") {} + Lazy< IfcPoint > VertexGeometry; + }; + + // C++ wrapper for IfcVibrationIsolator + struct IfcVibrationIsolator : IfcElementComponent, ObjectHelper { IfcVibrationIsolator() : Object("IfcVibrationIsolator") {} + Maybe< IfcVibrationIsolatorTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcVibrationIsolatorType + struct IfcVibrationIsolatorType : IfcElementComponentType, ObjectHelper { IfcVibrationIsolatorType() : Object("IfcVibrationIsolatorType") {} + IfcVibrationIsolatorTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcVirtualElement + struct IfcVirtualElement : IfcElement, ObjectHelper { IfcVirtualElement() : Object("IfcVirtualElement") {} + + }; + + // C++ wrapper for IfcVoidingFeature + struct IfcVoidingFeature : IfcFeatureElementSubtraction, ObjectHelper { IfcVoidingFeature() : Object("IfcVoidingFeature") {} + Maybe< IfcVoidingFeatureTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcWall + struct IfcWall : IfcBuildingElement, ObjectHelper { IfcWall() : Object("IfcWall") {} + Maybe< IfcWallTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcWallElementedCase + struct IfcWallElementedCase : IfcWall, ObjectHelper { IfcWallElementedCase() : Object("IfcWallElementedCase") {} + + }; + + // C++ wrapper for IfcWallStandardCase + struct IfcWallStandardCase : IfcWall, ObjectHelper { IfcWallStandardCase() : Object("IfcWallStandardCase") {} + + }; + + // C++ wrapper for IfcWallType + struct IfcWallType : IfcBuildingElementType, ObjectHelper { IfcWallType() : Object("IfcWallType") {} + IfcWallTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcWasteTerminal + struct IfcWasteTerminal : IfcFlowTerminal, ObjectHelper { IfcWasteTerminal() : Object("IfcWasteTerminal") {} + Maybe< IfcWasteTerminalTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcWasteTerminalType + struct IfcWasteTerminalType : IfcFlowTerminalType, ObjectHelper { IfcWasteTerminalType() : Object("IfcWasteTerminalType") {} + IfcWasteTerminalTypeEnum::Out PredefinedType; + }; + + // C++ wrapper for IfcWindow + struct IfcWindow : IfcBuildingElement, ObjectHelper { IfcWindow() : Object("IfcWindow") {} + Maybe< IfcPositiveLengthMeasure::Out > OverallHeight; + Maybe< IfcPositiveLengthMeasure::Out > OverallWidth; + Maybe< IfcWindowTypeEnum::Out > PredefinedType; + Maybe< IfcWindowTypePartitioningEnum::Out > PartitioningType; + Maybe< IfcLabel::Out > UserDefinedPartitioningType; + }; + + // C++ wrapper for IfcWindowStandardCase + struct IfcWindowStandardCase : IfcWindow, ObjectHelper { IfcWindowStandardCase() : Object("IfcWindowStandardCase") {} + + }; + + // C++ wrapper for IfcWindowStyle + struct IfcWindowStyle : IfcTypeProduct, ObjectHelper { IfcWindowStyle() : Object("IfcWindowStyle") {} + IfcWindowStyleConstructionEnum::Out ConstructionType; + IfcWindowStyleOperationEnum::Out OperationType; + IfcBoolean::Out ParameterTakesPrecedence; + IfcBoolean::Out Sizeable; + }; + + // C++ wrapper for IfcWindowType + struct IfcWindowType : IfcBuildingElementType, ObjectHelper { IfcWindowType() : Object("IfcWindowType") {} + IfcWindowTypeEnum::Out PredefinedType; + IfcWindowTypePartitioningEnum::Out PartitioningType; + Maybe< IfcBoolean::Out > ParameterTakesPrecedence; + Maybe< IfcLabel::Out > UserDefinedPartitioningType; + }; + + // C++ wrapper for IfcWorkCalendar + struct IfcWorkCalendar : IfcControl, ObjectHelper { IfcWorkCalendar() : Object("IfcWorkCalendar") {} + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > WorkingTimes; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > ExceptionTimes; + Maybe< IfcWorkCalendarTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcWorkControl + struct IfcWorkControl : IfcControl, ObjectHelper { IfcWorkControl() : Object("IfcWorkControl") {} + IfcDateTime::Out CreationDate; + Maybe< ListOf< Lazy< NotImplemented >, 1, 0 > > Creators; + Maybe< IfcLabel::Out > Purpose; + Maybe< IfcDuration::Out > Duration; + Maybe< IfcDuration::Out > TotalFloat; + IfcDateTime::Out StartTime; + Maybe< IfcDateTime::Out > FinishTime; + }; + + // C++ wrapper for IfcWorkPlan + struct IfcWorkPlan : IfcWorkControl, ObjectHelper { IfcWorkPlan() : Object("IfcWorkPlan") {} + Maybe< IfcWorkPlanTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcWorkSchedule + struct IfcWorkSchedule : IfcWorkControl, ObjectHelper { IfcWorkSchedule() : Object("IfcWorkSchedule") {} + Maybe< IfcWorkScheduleTypeEnum::Out > PredefinedType; + }; + + // C++ wrapper for IfcZShapeProfileDef + struct IfcZShapeProfileDef : IfcParameterizedProfileDef, ObjectHelper { IfcZShapeProfileDef() : Object("IfcZShapeProfileDef") {} + IfcPositiveLengthMeasure::Out Depth; + IfcPositiveLengthMeasure::Out FlangeWidth; + IfcPositiveLengthMeasure::Out WebThickness; + IfcPositiveLengthMeasure::Out FlangeThickness; + Maybe< IfcNonNegativeLengthMeasure::Out > FilletRadius; + Maybe< IfcNonNegativeLengthMeasure::Out > EdgeRadius; + }; + + // C++ wrapper for IfcZone + struct IfcZone : IfcSystem, ObjectHelper { IfcZone() : Object("IfcZone") {} + Maybe< IfcLabel::Out > LongName; + }; + + void GetSchema(EXPRESS::ConversionSchema& out); + +} //! IFC +namespace STEP { + + // ****************************************************************************** + // Converter stubs + // ****************************************************************************** + +#define DECL_CONV_STUB(type) template <> size_t GenericFill(const STEP::DB& db, const EXPRESS::LIST& params, IFC::type* in) + + DECL_CONV_STUB( IfcRoot ); + DECL_CONV_STUB( IfcObjectDefinition ); + DECL_CONV_STUB( IfcObject ); + DECL_CONV_STUB( IfcControl ); + DECL_CONV_STUB( IfcActionRequest ); + DECL_CONV_STUB( IfcActor ); + DECL_CONV_STUB( IfcProduct ); + DECL_CONV_STUB( IfcElement ); + DECL_CONV_STUB( IfcDistributionElement ); + DECL_CONV_STUB( IfcDistributionControlElement ); + DECL_CONV_STUB( IfcActuator ); + DECL_CONV_STUB( IfcTypeObject ); + DECL_CONV_STUB( IfcTypeProduct ); + DECL_CONV_STUB( IfcElementType ); + DECL_CONV_STUB( IfcDistributionElementType ); + DECL_CONV_STUB( IfcDistributionControlElementType ); + DECL_CONV_STUB( IfcActuatorType ); + DECL_CONV_STUB( IfcRepresentationItem ); + DECL_CONV_STUB( IfcGeometricRepresentationItem ); + DECL_CONV_STUB( IfcSolidModel ); + DECL_CONV_STUB( IfcManifoldSolidBrep ); + DECL_CONV_STUB( IfcAdvancedBrep ); + DECL_CONV_STUB( IfcAdvancedBrepWithVoids ); + DECL_CONV_STUB( IfcTopologicalRepresentationItem ); + DECL_CONV_STUB( IfcFace ); + DECL_CONV_STUB( IfcFaceSurface ); + DECL_CONV_STUB( IfcAdvancedFace ); + DECL_CONV_STUB( IfcDistributionFlowElement ); + DECL_CONV_STUB( IfcFlowTerminal ); + DECL_CONV_STUB( IfcAirTerminal ); + DECL_CONV_STUB( IfcFlowController ); + DECL_CONV_STUB( IfcAirTerminalBox ); + DECL_CONV_STUB( IfcDistributionFlowElementType ); + DECL_CONV_STUB( IfcFlowControllerType ); + DECL_CONV_STUB( IfcAirTerminalBoxType ); + DECL_CONV_STUB( IfcFlowTerminalType ); + DECL_CONV_STUB( IfcAirTerminalType ); + DECL_CONV_STUB( IfcEnergyConversionDevice ); + DECL_CONV_STUB( IfcAirToAirHeatRecovery ); + DECL_CONV_STUB( IfcEnergyConversionDeviceType ); + DECL_CONV_STUB( IfcAirToAirHeatRecoveryType ); + DECL_CONV_STUB( IfcAlarm ); + DECL_CONV_STUB( IfcAlarmType ); + DECL_CONV_STUB( IfcAnnotation ); + DECL_CONV_STUB( IfcAnnotationFillArea ); + DECL_CONV_STUB( IfcProfileDef ); + DECL_CONV_STUB( IfcArbitraryClosedProfileDef ); + DECL_CONV_STUB( IfcArbitraryOpenProfileDef ); + DECL_CONV_STUB( IfcArbitraryProfileDefWithVoids ); + DECL_CONV_STUB( IfcGroup ); + DECL_CONV_STUB( IfcAsset ); + DECL_CONV_STUB( IfcParameterizedProfileDef ); + DECL_CONV_STUB( IfcAsymmetricIShapeProfileDef ); + DECL_CONV_STUB( IfcAudioVisualAppliance ); + DECL_CONV_STUB( IfcAudioVisualApplianceType ); + DECL_CONV_STUB( IfcPlacement ); + DECL_CONV_STUB( IfcAxis1Placement ); + DECL_CONV_STUB( IfcAxis2Placement2D ); + DECL_CONV_STUB( IfcAxis2Placement3D ); + DECL_CONV_STUB( IfcCurve ); + DECL_CONV_STUB( IfcBoundedCurve ); + DECL_CONV_STUB( IfcBSplineCurve ); + DECL_CONV_STUB( IfcBSplineCurveWithKnots ); + DECL_CONV_STUB( IfcSurface ); + DECL_CONV_STUB( IfcBoundedSurface ); + DECL_CONV_STUB( IfcBSplineSurface ); + DECL_CONV_STUB( IfcBSplineSurfaceWithKnots ); + DECL_CONV_STUB( IfcBuildingElement ); + DECL_CONV_STUB( IfcBeam ); + DECL_CONV_STUB( IfcBeamStandardCase ); + DECL_CONV_STUB( IfcBuildingElementType ); + DECL_CONV_STUB( IfcBeamType ); + DECL_CONV_STUB( IfcPresentationItem ); + DECL_CONV_STUB( IfcCsgPrimitive3D ); + DECL_CONV_STUB( IfcBlock ); + DECL_CONV_STUB( IfcBoiler ); + DECL_CONV_STUB( IfcBoilerType ); + DECL_CONV_STUB( IfcBooleanResult ); + DECL_CONV_STUB( IfcBooleanClippingResult ); + DECL_CONV_STUB( IfcCompositeCurve ); + DECL_CONV_STUB( IfcCompositeCurveOnSurface ); + DECL_CONV_STUB( IfcBoundaryCurve ); + DECL_CONV_STUB( IfcBoundingBox ); + DECL_CONV_STUB( IfcHalfSpaceSolid ); + DECL_CONV_STUB( IfcBoxedHalfSpace ); + DECL_CONV_STUB( IfcSpatialElement ); + DECL_CONV_STUB( IfcSpatialStructureElement ); + DECL_CONV_STUB( IfcBuilding ); + DECL_CONV_STUB( IfcElementComponent ); + DECL_CONV_STUB( IfcBuildingElementPart ); + DECL_CONV_STUB( IfcElementComponentType ); + DECL_CONV_STUB( IfcBuildingElementPartType ); + DECL_CONV_STUB( IfcBuildingElementProxy ); + DECL_CONV_STUB( IfcBuildingElementProxyType ); + DECL_CONV_STUB( IfcBuildingStorey ); + DECL_CONV_STUB( IfcSystem ); + DECL_CONV_STUB( IfcBuildingSystem ); + DECL_CONV_STUB( IfcBurner ); + DECL_CONV_STUB( IfcBurnerType ); + DECL_CONV_STUB( IfcCShapeProfileDef ); + DECL_CONV_STUB( IfcFlowFitting ); + DECL_CONV_STUB( IfcCableCarrierFitting ); + DECL_CONV_STUB( IfcFlowFittingType ); + DECL_CONV_STUB( IfcCableCarrierFittingType ); + DECL_CONV_STUB( IfcFlowSegment ); + DECL_CONV_STUB( IfcCableCarrierSegment ); + DECL_CONV_STUB( IfcFlowSegmentType ); + DECL_CONV_STUB( IfcCableCarrierSegmentType ); + DECL_CONV_STUB( IfcCableFitting ); + DECL_CONV_STUB( IfcCableFittingType ); + DECL_CONV_STUB( IfcCableSegment ); + DECL_CONV_STUB( IfcCableSegmentType ); + DECL_CONV_STUB( IfcPoint ); + DECL_CONV_STUB( IfcCartesianPoint ); + DECL_CONV_STUB( IfcCartesianPointList ); + DECL_CONV_STUB( IfcCartesianPointList2D ); + DECL_CONV_STUB( IfcCartesianPointList3D ); + DECL_CONV_STUB( IfcCartesianTransformationOperator ); + DECL_CONV_STUB( IfcCartesianTransformationOperator2D ); + DECL_CONV_STUB( IfcCartesianTransformationOperator2DnonUniform ); + DECL_CONV_STUB( IfcCartesianTransformationOperator3D ); + DECL_CONV_STUB( IfcCartesianTransformationOperator3DnonUniform ); + DECL_CONV_STUB( IfcCenterLineProfileDef ); + DECL_CONV_STUB( IfcChiller ); + DECL_CONV_STUB( IfcChillerType ); + DECL_CONV_STUB( IfcChimney ); + DECL_CONV_STUB( IfcChimneyType ); + DECL_CONV_STUB( IfcConic ); + DECL_CONV_STUB( IfcCircle ); + DECL_CONV_STUB( IfcCircleProfileDef ); + DECL_CONV_STUB( IfcCircleHollowProfileDef ); + DECL_CONV_STUB( IfcCivilElement ); + DECL_CONV_STUB( IfcCivilElementType ); + DECL_CONV_STUB( IfcConnectedFaceSet ); + DECL_CONV_STUB( IfcClosedShell ); + DECL_CONV_STUB( IfcCoil ); + DECL_CONV_STUB( IfcCoilType ); + DECL_CONV_STUB( IfcColourSpecification ); + DECL_CONV_STUB( IfcColourRgb ); + DECL_CONV_STUB( IfcColumn ); + DECL_CONV_STUB( IfcColumnStandardCase ); + DECL_CONV_STUB( IfcColumnType ); + DECL_CONV_STUB( IfcCommunicationsAppliance ); + DECL_CONV_STUB( IfcCommunicationsApplianceType ); + DECL_CONV_STUB( IfcPropertyAbstraction ); + DECL_CONV_STUB( IfcProperty ); + DECL_CONV_STUB( IfcComplexProperty ); + DECL_CONV_STUB( IfcPropertyDefinition ); + DECL_CONV_STUB( IfcCompositeCurveSegment ); + DECL_CONV_STUB( IfcCompositeProfileDef ); + DECL_CONV_STUB( IfcFlowMovingDevice ); + DECL_CONV_STUB( IfcCompressor ); + DECL_CONV_STUB( IfcFlowMovingDeviceType ); + DECL_CONV_STUB( IfcCompressorType ); + DECL_CONV_STUB( IfcCondenser ); + DECL_CONV_STUB( IfcCondenserType ); + DECL_CONV_STUB( IfcResource ); + DECL_CONV_STUB( IfcConstructionResource ); + DECL_CONV_STUB( IfcConstructionEquipmentResource ); + DECL_CONV_STUB( IfcTypeResource ); + DECL_CONV_STUB( IfcConstructionResourceType ); + DECL_CONV_STUB( IfcConstructionEquipmentResourceType ); + DECL_CONV_STUB( IfcConstructionMaterialResource ); + DECL_CONV_STUB( IfcConstructionMaterialResourceType ); + DECL_CONV_STUB( IfcConstructionProductResource ); + DECL_CONV_STUB( IfcConstructionProductResourceType ); + DECL_CONV_STUB( IfcContext ); + DECL_CONV_STUB( IfcNamedUnit ); + DECL_CONV_STUB( IfcContextDependentUnit ); + DECL_CONV_STUB( IfcController ); + DECL_CONV_STUB( IfcControllerType ); + DECL_CONV_STUB( IfcConversionBasedUnit ); + DECL_CONV_STUB( IfcConversionBasedUnitWithOffset ); + DECL_CONV_STUB( IfcCooledBeam ); + DECL_CONV_STUB( IfcCooledBeamType ); + DECL_CONV_STUB( IfcCoolingTower ); + DECL_CONV_STUB( IfcCoolingTowerType ); + DECL_CONV_STUB( IfcCostItem ); + DECL_CONV_STUB( IfcCostSchedule ); + DECL_CONV_STUB( IfcCovering ); + DECL_CONV_STUB( IfcCoveringType ); + DECL_CONV_STUB( IfcCrewResource ); + DECL_CONV_STUB( IfcCrewResourceType ); + DECL_CONV_STUB( IfcCsgSolid ); + DECL_CONV_STUB( IfcCurtainWall ); + DECL_CONV_STUB( IfcCurtainWallType ); + DECL_CONV_STUB( IfcCurveBoundedPlane ); + DECL_CONV_STUB( IfcCurveBoundedSurface ); + DECL_CONV_STUB( IfcPresentationStyle ); + DECL_CONV_STUB( IfcElementarySurface ); + DECL_CONV_STUB( IfcCylindricalSurface ); + DECL_CONV_STUB( IfcDamper ); + DECL_CONV_STUB( IfcDamperType ); + DECL_CONV_STUB( IfcDerivedProfileDef ); + DECL_CONV_STUB( IfcDirection ); + DECL_CONV_STUB( IfcDiscreteAccessory ); + DECL_CONV_STUB( IfcDiscreteAccessoryType ); + DECL_CONV_STUB( IfcDistributionChamberElement ); + DECL_CONV_STUB( IfcDistributionChamberElementType ); + DECL_CONV_STUB( IfcDistributionSystem ); + DECL_CONV_STUB( IfcDistributionCircuit ); + DECL_CONV_STUB( IfcPort ); + DECL_CONV_STUB( IfcDistributionPort ); + DECL_CONV_STUB( IfcDoor ); + DECL_CONV_STUB( IfcPropertySetDefinition ); + DECL_CONV_STUB( IfcDoorStandardCase ); + DECL_CONV_STUB( IfcDoorStyle ); + DECL_CONV_STUB( IfcDoorType ); + DECL_CONV_STUB( IfcDuctFitting ); + DECL_CONV_STUB( IfcDuctFittingType ); + DECL_CONV_STUB( IfcDuctSegment ); + DECL_CONV_STUB( IfcDuctSegmentType ); + DECL_CONV_STUB( IfcFlowTreatmentDevice ); + DECL_CONV_STUB( IfcDuctSilencer ); + DECL_CONV_STUB( IfcFlowTreatmentDeviceType ); + DECL_CONV_STUB( IfcDuctSilencerType ); + DECL_CONV_STUB( IfcEdge ); + DECL_CONV_STUB( IfcEdgeCurve ); + DECL_CONV_STUB( IfcLoop ); + DECL_CONV_STUB( IfcEdgeLoop ); + DECL_CONV_STUB( IfcElectricAppliance ); + DECL_CONV_STUB( IfcElectricApplianceType ); + DECL_CONV_STUB( IfcElectricDistributionBoard ); + DECL_CONV_STUB( IfcElectricDistributionBoardType ); + DECL_CONV_STUB( IfcFlowStorageDevice ); + DECL_CONV_STUB( IfcElectricFlowStorageDevice ); + DECL_CONV_STUB( IfcFlowStorageDeviceType ); + DECL_CONV_STUB( IfcElectricFlowStorageDeviceType ); + DECL_CONV_STUB( IfcElectricGenerator ); + DECL_CONV_STUB( IfcElectricGeneratorType ); + DECL_CONV_STUB( IfcElectricMotor ); + DECL_CONV_STUB( IfcElectricMotorType ); + DECL_CONV_STUB( IfcElectricTimeControl ); + DECL_CONV_STUB( IfcElectricTimeControlType ); + DECL_CONV_STUB( IfcElementAssembly ); + DECL_CONV_STUB( IfcElementAssemblyType ); + DECL_CONV_STUB( IfcQuantitySet ); + DECL_CONV_STUB( IfcElementQuantity ); + DECL_CONV_STUB( IfcEllipse ); + DECL_CONV_STUB( IfcEllipseProfileDef ); + DECL_CONV_STUB( IfcEngine ); + DECL_CONV_STUB( IfcEngineType ); + DECL_CONV_STUB( IfcEvaporativeCooler ); + DECL_CONV_STUB( IfcEvaporativeCoolerType ); + DECL_CONV_STUB( IfcEvaporator ); + DECL_CONV_STUB( IfcEvaporatorType ); + DECL_CONV_STUB( IfcProcess ); + DECL_CONV_STUB( IfcEvent ); + DECL_CONV_STUB( IfcTypeProcess ); + DECL_CONV_STUB( IfcEventType ); + DECL_CONV_STUB( IfcExternalSpatialStructureElement ); + DECL_CONV_STUB( IfcExternalSpatialElement ); + DECL_CONV_STUB( IfcSweptAreaSolid ); + DECL_CONV_STUB( IfcExtrudedAreaSolid ); + DECL_CONV_STUB( IfcExtrudedAreaSolidTapered ); + DECL_CONV_STUB( IfcFaceBasedSurfaceModel ); + DECL_CONV_STUB( IfcFaceBound ); + DECL_CONV_STUB( IfcFaceOuterBound ); + DECL_CONV_STUB( IfcFacetedBrep ); + DECL_CONV_STUB( IfcFacetedBrepWithVoids ); + DECL_CONV_STUB( IfcFan ); + DECL_CONV_STUB( IfcFanType ); + DECL_CONV_STUB( IfcFastener ); + DECL_CONV_STUB( IfcFastenerType ); + DECL_CONV_STUB( IfcFeatureElement ); + DECL_CONV_STUB( IfcFeatureElementAddition ); + DECL_CONV_STUB( IfcFeatureElementSubtraction ); + DECL_CONV_STUB( IfcFillAreaStyleHatching ); + DECL_CONV_STUB( IfcFillAreaStyleTiles ); + DECL_CONV_STUB( IfcFilter ); + DECL_CONV_STUB( IfcFilterType ); + DECL_CONV_STUB( IfcFireSuppressionTerminal ); + DECL_CONV_STUB( IfcFireSuppressionTerminalType ); + DECL_CONV_STUB( IfcFixedReferenceSweptAreaSolid ); + DECL_CONV_STUB( IfcFlowInstrument ); + DECL_CONV_STUB( IfcFlowInstrumentType ); + DECL_CONV_STUB( IfcFlowMeter ); + DECL_CONV_STUB( IfcFlowMeterType ); + DECL_CONV_STUB( IfcFooting ); + DECL_CONV_STUB( IfcFootingType ); + DECL_CONV_STUB( IfcFurnishingElement ); + DECL_CONV_STUB( IfcFurnishingElementType ); + DECL_CONV_STUB( IfcFurniture ); + DECL_CONV_STUB( IfcFurnitureType ); + DECL_CONV_STUB( IfcGeographicElement ); + DECL_CONV_STUB( IfcGeographicElementType ); + DECL_CONV_STUB( IfcGeometricSet ); + DECL_CONV_STUB( IfcGeometricCurveSet ); + DECL_CONV_STUB( IfcRepresentationContext ); + DECL_CONV_STUB( IfcGeometricRepresentationContext ); + DECL_CONV_STUB( IfcGeometricRepresentationSubContext ); + DECL_CONV_STUB( IfcGrid ); + DECL_CONV_STUB( IfcObjectPlacement ); + DECL_CONV_STUB( IfcGridPlacement ); + DECL_CONV_STUB( IfcHeatExchanger ); + DECL_CONV_STUB( IfcHeatExchangerType ); + DECL_CONV_STUB( IfcHumidifier ); + DECL_CONV_STUB( IfcHumidifierType ); + DECL_CONV_STUB( IfcIShapeProfileDef ); + DECL_CONV_STUB( IfcIndexedPolyCurve ); + DECL_CONV_STUB( IfcTessellatedItem ); + DECL_CONV_STUB( IfcIndexedPolygonalFace ); + DECL_CONV_STUB( IfcIndexedPolygonalFaceWithVoids ); + DECL_CONV_STUB( IfcInterceptor ); + DECL_CONV_STUB( IfcInterceptorType ); + DECL_CONV_STUB( IfcSurfaceCurve ); + DECL_CONV_STUB( IfcIntersectionCurve ); + DECL_CONV_STUB( IfcInventory ); + DECL_CONV_STUB( IfcJunctionBox ); + DECL_CONV_STUB( IfcJunctionBoxType ); + DECL_CONV_STUB( IfcLShapeProfileDef ); + DECL_CONV_STUB( IfcLaborResource ); + DECL_CONV_STUB( IfcLaborResourceType ); + DECL_CONV_STUB( IfcLamp ); + DECL_CONV_STUB( IfcLampType ); + DECL_CONV_STUB( IfcLightFixture ); + DECL_CONV_STUB( IfcLightFixtureType ); + DECL_CONV_STUB( IfcLightSource ); + DECL_CONV_STUB( IfcLightSourceAmbient ); + DECL_CONV_STUB( IfcLightSourceDirectional ); + DECL_CONV_STUB( IfcLightSourceGoniometric ); + DECL_CONV_STUB( IfcLightSourcePositional ); + DECL_CONV_STUB( IfcLightSourceSpot ); + DECL_CONV_STUB( IfcLine ); + DECL_CONV_STUB( IfcLocalPlacement ); + DECL_CONV_STUB( IfcMappedItem ); + DECL_CONV_STUB( IfcProductRepresentation ); + DECL_CONV_STUB( IfcMaterialDefinitionRepresentation ); + DECL_CONV_STUB( IfcMeasureWithUnit ); + DECL_CONV_STUB( IfcMechanicalFastener ); + DECL_CONV_STUB( IfcMechanicalFastenerType ); + DECL_CONV_STUB( IfcMedicalDevice ); + DECL_CONV_STUB( IfcMedicalDeviceType ); + DECL_CONV_STUB( IfcMember ); + DECL_CONV_STUB( IfcMemberStandardCase ); + DECL_CONV_STUB( IfcMemberType ); + DECL_CONV_STUB( IfcMirroredProfileDef ); + DECL_CONV_STUB( IfcMotorConnection ); + DECL_CONV_STUB( IfcMotorConnectionType ); + DECL_CONV_STUB( IfcOccupant ); + DECL_CONV_STUB( IfcOffsetCurve2D ); + DECL_CONV_STUB( IfcOffsetCurve3D ); + DECL_CONV_STUB( IfcOpenShell ); + DECL_CONV_STUB( IfcOpeningElement ); + DECL_CONV_STUB( IfcOpeningStandardCase ); + DECL_CONV_STUB( IfcOrientedEdge ); + DECL_CONV_STUB( IfcOuterBoundaryCurve ); + DECL_CONV_STUB( IfcOutlet ); + DECL_CONV_STUB( IfcOutletType ); + DECL_CONV_STUB( IfcPath ); + DECL_CONV_STUB( IfcPcurve ); + DECL_CONV_STUB( IfcPerformanceHistory ); + DECL_CONV_STUB( IfcPermit ); + DECL_CONV_STUB( IfcPile ); + DECL_CONV_STUB( IfcPileType ); + DECL_CONV_STUB( IfcPipeFitting ); + DECL_CONV_STUB( IfcPipeFittingType ); + DECL_CONV_STUB( IfcPipeSegment ); + DECL_CONV_STUB( IfcPipeSegmentType ); + DECL_CONV_STUB( IfcPlanarExtent ); + DECL_CONV_STUB( IfcPlanarBox ); + DECL_CONV_STUB( IfcPlane ); + DECL_CONV_STUB( IfcPlate ); + DECL_CONV_STUB( IfcPlateStandardCase ); + DECL_CONV_STUB( IfcPlateType ); + DECL_CONV_STUB( IfcPointOnCurve ); + DECL_CONV_STUB( IfcPointOnSurface ); + DECL_CONV_STUB( IfcPolyLoop ); + DECL_CONV_STUB( IfcPolygonalBoundedHalfSpace ); + DECL_CONV_STUB( IfcTessellatedFaceSet ); + DECL_CONV_STUB( IfcPolygonalFaceSet ); + DECL_CONV_STUB( IfcPolyline ); + DECL_CONV_STUB( IfcPresentationStyleAssignment ); + DECL_CONV_STUB( IfcProcedure ); + DECL_CONV_STUB( IfcProcedureType ); + DECL_CONV_STUB( IfcProductDefinitionShape ); + DECL_CONV_STUB( IfcProject ); + DECL_CONV_STUB( IfcProjectLibrary ); + DECL_CONV_STUB( IfcProjectOrder ); + DECL_CONV_STUB( IfcProjectionElement ); + DECL_CONV_STUB( IfcSimpleProperty ); + DECL_CONV_STUB( IfcPropertyBoundedValue ); + DECL_CONV_STUB( IfcPropertyEnumeratedValue ); + DECL_CONV_STUB( IfcPropertyListValue ); + DECL_CONV_STUB( IfcPropertyReferenceValue ); + DECL_CONV_STUB( IfcPropertySet ); + DECL_CONV_STUB( IfcPropertySingleValue ); + DECL_CONV_STUB( IfcPropertyTableValue ); + DECL_CONV_STUB( IfcProtectiveDevice ); + DECL_CONV_STUB( IfcProtectiveDeviceTrippingUnit ); + DECL_CONV_STUB( IfcProtectiveDeviceTrippingUnitType ); + DECL_CONV_STUB( IfcProtectiveDeviceType ); + DECL_CONV_STUB( IfcProxy ); + DECL_CONV_STUB( IfcPump ); + DECL_CONV_STUB( IfcPumpType ); + DECL_CONV_STUB( IfcRailing ); + DECL_CONV_STUB( IfcRailingType ); + DECL_CONV_STUB( IfcRamp ); + DECL_CONV_STUB( IfcRampFlight ); + DECL_CONV_STUB( IfcRampFlightType ); + DECL_CONV_STUB( IfcRampType ); + DECL_CONV_STUB( IfcRationalBSplineCurveWithKnots ); + DECL_CONV_STUB( IfcRationalBSplineSurfaceWithKnots ); + DECL_CONV_STUB( IfcRectangleProfileDef ); + DECL_CONV_STUB( IfcRectangleHollowProfileDef ); + DECL_CONV_STUB( IfcRectangularPyramid ); + DECL_CONV_STUB( IfcRectangularTrimmedSurface ); + DECL_CONV_STUB( IfcReinforcingElement ); + DECL_CONV_STUB( IfcReinforcingBar ); + DECL_CONV_STUB( IfcReinforcingElementType ); + DECL_CONV_STUB( IfcReinforcingBarType ); + DECL_CONV_STUB( IfcReinforcingMesh ); + DECL_CONV_STUB( IfcReinforcingMeshType ); + DECL_CONV_STUB( IfcRelationship ); + DECL_CONV_STUB( IfcRelDecomposes ); + DECL_CONV_STUB( IfcRelAggregates ); + DECL_CONV_STUB( IfcRelConnects ); + DECL_CONV_STUB( IfcRelContainedInSpatialStructure ); + DECL_CONV_STUB( IfcRelDefines ); + DECL_CONV_STUB( IfcRelDefinesByProperties ); + DECL_CONV_STUB( IfcRelFillsElement ); + DECL_CONV_STUB( IfcRelVoidsElement ); + DECL_CONV_STUB( IfcReparametrisedCompositeCurveSegment ); + DECL_CONV_STUB( IfcRepresentation ); + DECL_CONV_STUB( IfcRepresentationMap ); + DECL_CONV_STUB( IfcRevolvedAreaSolid ); + DECL_CONV_STUB( IfcRevolvedAreaSolidTapered ); + DECL_CONV_STUB( IfcRightCircularCone ); + DECL_CONV_STUB( IfcRightCircularCylinder ); + DECL_CONV_STUB( IfcRoof ); + DECL_CONV_STUB( IfcRoofType ); + DECL_CONV_STUB( IfcRoundedRectangleProfileDef ); + DECL_CONV_STUB( IfcSIUnit ); + DECL_CONV_STUB( IfcSanitaryTerminal ); + DECL_CONV_STUB( IfcSanitaryTerminalType ); + DECL_CONV_STUB( IfcSeamCurve ); + DECL_CONV_STUB( IfcSectionedSpine ); + DECL_CONV_STUB( IfcSensor ); + DECL_CONV_STUB( IfcSensorType ); + DECL_CONV_STUB( IfcShadingDevice ); + DECL_CONV_STUB( IfcShadingDeviceType ); + DECL_CONV_STUB( IfcShapeModel ); + DECL_CONV_STUB( IfcShapeRepresentation ); + DECL_CONV_STUB( IfcShellBasedSurfaceModel ); + DECL_CONV_STUB( IfcSite ); + DECL_CONV_STUB( IfcSlab ); + DECL_CONV_STUB( IfcSlabElementedCase ); + DECL_CONV_STUB( IfcSlabStandardCase ); + DECL_CONV_STUB( IfcSlabType ); + DECL_CONV_STUB( IfcSolarDevice ); + DECL_CONV_STUB( IfcSolarDeviceType ); + DECL_CONV_STUB( IfcSpace ); + DECL_CONV_STUB( IfcSpaceHeater ); + DECL_CONV_STUB( IfcSpaceHeaterType ); + DECL_CONV_STUB( IfcSpatialElementType ); + DECL_CONV_STUB( IfcSpatialStructureElementType ); + DECL_CONV_STUB( IfcSpaceType ); + DECL_CONV_STUB( IfcSpatialZone ); + DECL_CONV_STUB( IfcSpatialZoneType ); + DECL_CONV_STUB( IfcSphere ); + DECL_CONV_STUB( IfcSphericalSurface ); + DECL_CONV_STUB( IfcStackTerminal ); + DECL_CONV_STUB( IfcStackTerminalType ); + DECL_CONV_STUB( IfcStair ); + DECL_CONV_STUB( IfcStairFlight ); + DECL_CONV_STUB( IfcStairFlightType ); + DECL_CONV_STUB( IfcStairType ); + DECL_CONV_STUB( IfcStructuralActivity ); + DECL_CONV_STUB( IfcStructuralAction ); + DECL_CONV_STUB( IfcStructuralAnalysisModel ); + DECL_CONV_STUB( IfcStructuralItem ); + DECL_CONV_STUB( IfcStructuralConnection ); + DECL_CONV_STUB( IfcStructuralCurveAction ); + DECL_CONV_STUB( IfcStructuralCurveConnection ); + DECL_CONV_STUB( IfcStructuralMember ); + DECL_CONV_STUB( IfcStructuralCurveMember ); + DECL_CONV_STUB( IfcStructuralCurveMemberVarying ); + DECL_CONV_STUB( IfcStructuralReaction ); + DECL_CONV_STUB( IfcStructuralCurveReaction ); + DECL_CONV_STUB( IfcStructuralLinearAction ); + DECL_CONV_STUB( IfcStructuralLoadGroup ); + DECL_CONV_STUB( IfcStructuralLoadCase ); + DECL_CONV_STUB( IfcStructuralSurfaceAction ); + DECL_CONV_STUB( IfcStructuralPlanarAction ); + DECL_CONV_STUB( IfcStructuralPointAction ); + DECL_CONV_STUB( IfcStructuralPointConnection ); + DECL_CONV_STUB( IfcStructuralPointReaction ); + DECL_CONV_STUB( IfcStructuralResultGroup ); + DECL_CONV_STUB( IfcStructuralSurfaceConnection ); + DECL_CONV_STUB( IfcStructuralSurfaceMember ); + DECL_CONV_STUB( IfcStructuralSurfaceMemberVarying ); + DECL_CONV_STUB( IfcStructuralSurfaceReaction ); + DECL_CONV_STUB( IfcStyleModel ); + DECL_CONV_STUB( IfcStyledItem ); + DECL_CONV_STUB( IfcStyledRepresentation ); + DECL_CONV_STUB( IfcSubContractResource ); + DECL_CONV_STUB( IfcSubContractResourceType ); + DECL_CONV_STUB( IfcSubedge ); + DECL_CONV_STUB( IfcSurfaceCurveSweptAreaSolid ); + DECL_CONV_STUB( IfcSurfaceFeature ); + DECL_CONV_STUB( IfcSweptSurface ); + DECL_CONV_STUB( IfcSurfaceOfLinearExtrusion ); + DECL_CONV_STUB( IfcSurfaceOfRevolution ); + DECL_CONV_STUB( IfcSurfaceStyle ); + DECL_CONV_STUB( IfcSurfaceStyleShading ); + DECL_CONV_STUB( IfcSurfaceStyleRendering ); + DECL_CONV_STUB( IfcSurfaceStyleWithTextures ); + DECL_CONV_STUB( IfcSweptDiskSolid ); + DECL_CONV_STUB( IfcSweptDiskSolidPolygonal ); + DECL_CONV_STUB( IfcSwitchingDevice ); + DECL_CONV_STUB( IfcSwitchingDeviceType ); + DECL_CONV_STUB( IfcSystemFurnitureElement ); + DECL_CONV_STUB( IfcSystemFurnitureElementType ); + DECL_CONV_STUB( IfcTShapeProfileDef ); + DECL_CONV_STUB( IfcTank ); + DECL_CONV_STUB( IfcTankType ); + DECL_CONV_STUB( IfcTask ); + DECL_CONV_STUB( IfcTaskType ); + DECL_CONV_STUB( IfcTendon ); + DECL_CONV_STUB( IfcTendonAnchor ); + DECL_CONV_STUB( IfcTendonAnchorType ); + DECL_CONV_STUB( IfcTendonType ); + DECL_CONV_STUB( IfcTextLiteral ); + DECL_CONV_STUB( IfcTextLiteralWithExtent ); + DECL_CONV_STUB( IfcTopologyRepresentation ); + DECL_CONV_STUB( IfcToroidalSurface ); + DECL_CONV_STUB( IfcTransformer ); + DECL_CONV_STUB( IfcTransformerType ); + DECL_CONV_STUB( IfcTransportElement ); + DECL_CONV_STUB( IfcTransportElementType ); + DECL_CONV_STUB( IfcTrapeziumProfileDef ); + DECL_CONV_STUB( IfcTriangulatedFaceSet ); + DECL_CONV_STUB( IfcTrimmedCurve ); + DECL_CONV_STUB( IfcTubeBundle ); + DECL_CONV_STUB( IfcTubeBundleType ); + DECL_CONV_STUB( IfcUShapeProfileDef ); + DECL_CONV_STUB( IfcUnitAssignment ); + DECL_CONV_STUB( IfcUnitaryControlElement ); + DECL_CONV_STUB( IfcUnitaryControlElementType ); + DECL_CONV_STUB( IfcUnitaryEquipment ); + DECL_CONV_STUB( IfcUnitaryEquipmentType ); + DECL_CONV_STUB( IfcValve ); + DECL_CONV_STUB( IfcValveType ); + DECL_CONV_STUB( IfcVector ); + DECL_CONV_STUB( IfcVertex ); + DECL_CONV_STUB( IfcVertexLoop ); + DECL_CONV_STUB( IfcVertexPoint ); + DECL_CONV_STUB( IfcVibrationIsolator ); + DECL_CONV_STUB( IfcVibrationIsolatorType ); + DECL_CONV_STUB( IfcVirtualElement ); + DECL_CONV_STUB( IfcVoidingFeature ); + DECL_CONV_STUB( IfcWall ); + DECL_CONV_STUB( IfcWallElementedCase ); + DECL_CONV_STUB( IfcWallStandardCase ); + DECL_CONV_STUB( IfcWallType ); + DECL_CONV_STUB( IfcWasteTerminal ); + DECL_CONV_STUB( IfcWasteTerminalType ); + DECL_CONV_STUB( IfcWindow ); + DECL_CONV_STUB( IfcWindowStandardCase ); + DECL_CONV_STUB( IfcWindowStyle ); + DECL_CONV_STUB( IfcWindowType ); + DECL_CONV_STUB( IfcWorkCalendar ); + DECL_CONV_STUB( IfcWorkControl ); + DECL_CONV_STUB( IfcWorkPlan ); + DECL_CONV_STUB( IfcWorkSchedule ); + DECL_CONV_STUB( IfcZShapeProfileDef ); + DECL_CONV_STUB( IfcZone ); + + +#undef DECL_CONV_STUB + +} //! Schema_4 +} //! STEP +} //! Assimp + +#endif // INCLUDED_IFC_READER_GEN_H diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCUtil.cpp b/Engine/lib/assimp/code/Importer/IFC/IFCUtil.cpp new file mode 100644 index 000000000..f6bca91f5 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCUtil.cpp @@ -0,0 +1,703 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFCUtil.cpp + * @brief Implementation of conversion routines for some common Ifc helper entities. + */ + +#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER + +#include "Importer/IFC/IFCUtil.h" +#include "Common/PolyTools.h" +#include "PostProcessing/ProcessHelper.h" +#include + +namespace Assimp { +namespace IFC { + +// ------------------------------------------------------------------------------------------------ +void TempOpening::Transform(const IfcMatrix4& mat) { + if(profileMesh) { + profileMesh->Transform(mat); + } + if(profileMesh2D) { + profileMesh2D->Transform(mat); + } + extrusionDir *= IfcMatrix3(mat); +} + +// ------------------------------------------------------------------------------------------------ +aiMesh* TempMesh::ToMesh() +{ + ai_assert(mVerts.size() == std::accumulate(mVertcnt.begin(),mVertcnt.end(),size_t(0))); + + if (mVerts.empty()) { + return NULL; + } + + std::unique_ptr mesh(new aiMesh()); + + // copy vertices + mesh->mNumVertices = static_cast(mVerts.size()); + mesh->mVertices = new aiVector3D[mesh->mNumVertices]; + std::copy(mVerts.begin(),mVerts.end(),mesh->mVertices); + + // and build up faces + mesh->mNumFaces = static_cast(mVertcnt.size()); + mesh->mFaces = new aiFace[mesh->mNumFaces]; + + for(unsigned int i = 0,n=0, acc = 0; i < mesh->mNumFaces; ++n) { + aiFace& f = mesh->mFaces[i]; + if (!mVertcnt[n]) { + --mesh->mNumFaces; + continue; + } + + f.mNumIndices = mVertcnt[n]; + f.mIndices = new unsigned int[f.mNumIndices]; + for(unsigned int a = 0; a < f.mNumIndices; ++a) { + f.mIndices[a] = acc++; + } + + ++i; + } + + return mesh.release(); +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::Clear() +{ + mVerts.clear(); + mVertcnt.clear(); +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::Transform(const IfcMatrix4& mat) +{ + for(IfcVector3& v : mVerts) { + v *= mat; + } +} + +// ------------------------------------------------------------------------------ +IfcVector3 TempMesh::Center() const +{ + return (mVerts.size() == 0) ? IfcVector3(0.0f, 0.0f, 0.0f) : (std::accumulate(mVerts.begin(),mVerts.end(),IfcVector3()) / static_cast(mVerts.size())); +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::Append(const TempMesh& other) +{ + mVerts.insert(mVerts.end(),other.mVerts.begin(),other.mVerts.end()); + mVertcnt.insert(mVertcnt.end(),other.mVertcnt.begin(),other.mVertcnt.end()); +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::RemoveDegenerates() +{ + // The strategy is simple: walk the mesh and compute normals using + // Newell's algorithm. The length of the normals gives the area + // of the polygons, which is close to zero for lines. + + std::vector normals; + ComputePolygonNormals(normals, false); + + bool drop = false; + size_t inor = 0; + + std::vector::iterator vit = mVerts.begin(); + for (std::vector::iterator it = mVertcnt.begin(); it != mVertcnt.end(); ++inor) { + const unsigned int pcount = *it; + + if (normals[inor].SquareLength() < 1e-10f) { + it = mVertcnt.erase(it); + vit = mVerts.erase(vit, vit + pcount); + + drop = true; + continue; + } + + vit += pcount; + ++it; + } + + if(drop) { + IFCImporter::LogDebug("removing degenerate faces"); + } +} + +// ------------------------------------------------------------------------------------------------ +IfcVector3 TempMesh::ComputePolygonNormal(const IfcVector3* vtcs, size_t cnt, bool normalize) +{ + std::vector temp((cnt+2)*3); + for( size_t vofs = 0, i = 0; vofs < cnt; ++vofs ) + { + const IfcVector3& v = vtcs[vofs]; + temp[i++] = v.x; + temp[i++] = v.y; + temp[i++] = v.z; + } + + IfcVector3 nor; + NewellNormal<3, 3, 3>(nor, static_cast(cnt), &temp[0], &temp[1], &temp[2]); + return normalize ? nor.Normalize() : nor; +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::ComputePolygonNormals(std::vector& normals, + bool normalize, + size_t ofs) const +{ + size_t max_vcount = 0; + std::vector::const_iterator begin = mVertcnt.begin()+ofs, end = mVertcnt.end(), iit; + for(iit = begin; iit != end; ++iit) { + max_vcount = std::max(max_vcount,static_cast(*iit)); + } + + std::vector temp((max_vcount+2)*4); + normals.reserve( normals.size() + mVertcnt.size()-ofs ); + + // `NewellNormal()` currently has a relatively strange interface and need to + // re-structure things a bit to meet them. + size_t vidx = std::accumulate(mVertcnt.begin(),begin,0); + for(iit = begin; iit != end; vidx += *iit++) { + if (!*iit) { + normals.push_back(IfcVector3()); + continue; + } + for(size_t vofs = 0, cnt = 0; vofs < *iit; ++vofs) { + const IfcVector3& v = mVerts[vidx+vofs]; + temp[cnt++] = v.x; + temp[cnt++] = v.y; + temp[cnt++] = v.z; +#ifdef ASSIMP_BUILD_DEBUG + temp[cnt] = std::numeric_limits::quiet_NaN(); +#endif + ++cnt; + } + + normals.push_back(IfcVector3()); + NewellNormal<4,4,4>(normals.back(),*iit,&temp[0],&temp[1],&temp[2]); + } + + if(normalize) { + for(IfcVector3& n : normals) { + n.Normalize(); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Compute the normal of the last polygon in the given mesh +IfcVector3 TempMesh::ComputeLastPolygonNormal(bool normalize) const +{ + return ComputePolygonNormal(&mVerts[mVerts.size() - mVertcnt.back()], mVertcnt.back(), normalize); +} + +struct CompareVector +{ + bool operator () (const IfcVector3& a, const IfcVector3& b) const + { + IfcVector3 d = a - b; + IfcFloat eps = 1e-6; + return d.x < -eps || (std::abs(d.x) < eps && d.y < -eps) || (std::abs(d.x) < eps && std::abs(d.y) < eps && d.z < -eps); + } +}; +struct FindVector +{ + IfcVector3 v; + FindVector(const IfcVector3& p) : v(p) { } + bool operator () (const IfcVector3& p) { return FuzzyVectorCompare(1e-6)(p, v); } +}; + +// ------------------------------------------------------------------------------------------------ +void TempMesh::FixupFaceOrientation() +{ + const IfcVector3 vavg = Center(); + + // create a list of start indices for all faces to allow random access to faces + std::vector faceStartIndices(mVertcnt.size()); + for( size_t i = 0, a = 0; a < mVertcnt.size(); i += mVertcnt[a], ++a ) + faceStartIndices[a] = i; + + // list all faces on a vertex + std::map, CompareVector> facesByVertex; + for( size_t a = 0; a < mVertcnt.size(); ++a ) + { + for( size_t b = 0; b < mVertcnt[a]; ++b ) + facesByVertex[mVerts[faceStartIndices[a] + b]].push_back(a); + } + // determine neighbourhood for all polys + std::vector neighbour(mVerts.size(), SIZE_MAX); + std::vector tempIntersect(10); + for( size_t a = 0; a < mVertcnt.size(); ++a ) + { + for( size_t b = 0; b < mVertcnt[a]; ++b ) + { + size_t ib = faceStartIndices[a] + b, nib = faceStartIndices[a] + (b + 1) % mVertcnt[a]; + const std::vector& facesOnB = facesByVertex[mVerts[ib]]; + const std::vector& facesOnNB = facesByVertex[mVerts[nib]]; + // there should be exactly one or two faces which appear in both lists. Our face and the other side + std::vector::iterator sectstart = tempIntersect.begin(); + std::vector::iterator sectend = std::set_intersection( + facesOnB.begin(), facesOnB.end(), facesOnNB.begin(), facesOnNB.end(), sectstart); + + if( std::distance(sectstart, sectend) != 2 ) + continue; + if( *sectstart == a ) + ++sectstart; + neighbour[ib] = *sectstart; + } + } + + // now we're getting started. We take the face which is the farthest away from the center. This face is most probably + // facing outwards. So we reverse this face to point outwards in relation to the center. Then we adapt neighbouring + // faces to have the same winding until all faces have been tested. + std::vector faceDone(mVertcnt.size(), false); + while( std::count(faceDone.begin(), faceDone.end(), false) != 0 ) + { + // find the farthest of the remaining faces + size_t farthestIndex = SIZE_MAX; + IfcFloat farthestDistance = -1.0; + for( size_t a = 0; a < mVertcnt.size(); ++a ) + { + if( faceDone[a] ) + continue; + IfcVector3 faceCenter = std::accumulate(mVerts.begin() + faceStartIndices[a], + mVerts.begin() + faceStartIndices[a] + mVertcnt[a], IfcVector3(0.0)) / IfcFloat(mVertcnt[a]); + IfcFloat dst = (faceCenter - vavg).SquareLength(); + if( dst > farthestDistance ) { farthestDistance = dst; farthestIndex = a; } + } + + // calculate its normal and reverse the poly if its facing towards the mesh center + IfcVector3 farthestNormal = ComputePolygonNormal(mVerts.data() + faceStartIndices[farthestIndex], mVertcnt[farthestIndex]); + IfcVector3 farthestCenter = std::accumulate(mVerts.begin() + faceStartIndices[farthestIndex], + mVerts.begin() + faceStartIndices[farthestIndex] + mVertcnt[farthestIndex], IfcVector3(0.0)) + / IfcFloat(mVertcnt[farthestIndex]); + // We accept a bit of negative orientation without reversing. In case of doubt, prefer the orientation given in + // the file. + if( (farthestNormal * (farthestCenter - vavg).Normalize()) < -0.4 ) + { + size_t fsi = faceStartIndices[farthestIndex], fvc = mVertcnt[farthestIndex]; + std::reverse(mVerts.begin() + fsi, mVerts.begin() + fsi + fvc); + std::reverse(neighbour.begin() + fsi, neighbour.begin() + fsi + fvc); + // because of the neighbour index belonging to the edge starting with the point at the same index, we need to + // cycle the neighbours through to match the edges again. + // Before: points A - B - C - D with edge neighbour p - q - r - s + // After: points D - C - B - A, reversed neighbours are s - r - q - p, but the should be + // r q p s + for( size_t a = 0; a < fvc - 1; ++a ) + std::swap(neighbour[fsi + a], neighbour[fsi + a + 1]); + } + faceDone[farthestIndex] = true; + std::vector todo; + todo.push_back(farthestIndex); + + // go over its neighbour faces recursively and adapt their winding order to match the farthest face + while( !todo.empty() ) + { + size_t tdf = todo.back(); + size_t vsi = faceStartIndices[tdf], vc = mVertcnt[tdf]; + todo.pop_back(); + + // check its neighbours + for( size_t a = 0; a < vc; ++a ) + { + // ignore neighbours if we already checked them + size_t nbi = neighbour[vsi + a]; + if( nbi == SIZE_MAX || faceDone[nbi] ) + continue; + + const IfcVector3& vp = mVerts[vsi + a]; + size_t nbvsi = faceStartIndices[nbi], nbvc = mVertcnt[nbi]; + std::vector::iterator it = std::find_if(mVerts.begin() + nbvsi, mVerts.begin() + nbvsi + nbvc, FindVector(vp)); + ai_assert(it != mVerts.begin() + nbvsi + nbvc); + size_t nb_vidx = std::distance(mVerts.begin() + nbvsi, it); + // two faces winded in the same direction should have a crossed edge, where one face has p0->p1 and the other + // has p1'->p0'. If the next point on the neighbouring face is also the next on the current face, we need + // to reverse the neighbour + nb_vidx = (nb_vidx + 1) % nbvc; + size_t oursideidx = (a + 1) % vc; + if( FuzzyVectorCompare(1e-6)(mVerts[vsi + oursideidx], mVerts[nbvsi + nb_vidx]) ) + { + std::reverse(mVerts.begin() + nbvsi, mVerts.begin() + nbvsi + nbvc); + std::reverse(neighbour.begin() + nbvsi, neighbour.begin() + nbvsi + nbvc); + for( size_t a = 0; a < nbvc - 1; ++a ) + std::swap(neighbour[nbvsi + a], neighbour[nbvsi + a + 1]); + } + + // either way we're done with the neighbour. Mark it as done and continue checking from there recursively + faceDone[nbi] = true; + todo.push_back(nbi); + } + } + + // no more faces reachable from this part of the surface, start over with a disjunct part and its farthest face + } +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::RemoveAdjacentDuplicates() { + bool drop = false; + std::vector::iterator base = mVerts.begin(); + for(unsigned int& cnt : mVertcnt) { + if (cnt < 2){ + base += cnt; + continue; + } + + IfcVector3 vmin,vmax; + ArrayBounds(&*base, cnt ,vmin,vmax); + + + const IfcFloat epsilon = (vmax-vmin).SquareLength() / static_cast(1e9); + //const IfcFloat dotepsilon = 1e-9; + + //// look for vertices that lie directly on the line between their predecessor and their + //// successor and replace them with either of them. + + //for(size_t i = 0; i < cnt; ++i) { + // IfcVector3& v1 = *(base+i), &v0 = *(base+(i?i-1:cnt-1)), &v2 = *(base+(i+1)%cnt); + // const IfcVector3& d0 = (v1-v0), &d1 = (v2-v1); + // const IfcFloat l0 = d0.SquareLength(), l1 = d1.SquareLength(); + // if (!l0 || !l1) { + // continue; + // } + + // const IfcFloat d = (d0/std::sqrt(l0))*(d1/std::sqrt(l1)); + + // if ( d >= 1.f-dotepsilon ) { + // v1 = v0; + // } + // else if ( d < -1.f+dotepsilon ) { + // v2 = v1; + // continue; + // } + //} + + // drop any identical, adjacent vertices. this pass will collect the dropouts + // of the previous pass as a side-effect. + FuzzyVectorCompare fz(epsilon); + std::vector::iterator end = base+cnt, e = std::unique( base, end, fz ); + if (e != end) { + cnt -= static_cast(std::distance(e, end)); + mVerts.erase(e,end); + drop = true; + } + + // check front and back vertices for this polygon + if (cnt > 1 && fz(*base,*(base+cnt-1))) { + mVerts.erase(base+ --cnt); + drop = true; + } + + // removing adjacent duplicates shouldn't erase everything :-) + ai_assert(cnt>0); + base += cnt; + } + if(drop) { + IFCImporter::LogDebug("removing duplicate vertices"); + } +} + +// ------------------------------------------------------------------------------------------------ +void TempMesh::Swap(TempMesh& other) +{ + mVertcnt.swap(other.mVertcnt); + mVerts.swap(other.mVerts); +} + +// ------------------------------------------------------------------------------------------------ +bool IsTrue(const ::Assimp::STEP::EXPRESS::BOOLEAN& in) +{ + return (std::string)in == "TRUE" || (std::string)in == "T"; +} + +// ------------------------------------------------------------------------------------------------ +IfcFloat ConvertSIPrefix(const std::string& prefix) +{ + if (prefix == "EXA") { + return 1e18f; + } + else if (prefix == "PETA") { + return 1e15f; + } + else if (prefix == "TERA") { + return 1e12f; + } + else if (prefix == "GIGA") { + return 1e9f; + } + else if (prefix == "MEGA") { + return 1e6f; + } + else if (prefix == "KILO") { + return 1e3f; + } + else if (prefix == "HECTO") { + return 1e2f; + } + else if (prefix == "DECA") { + return 1e-0f; + } + else if (prefix == "DECI") { + return 1e-1f; + } + else if (prefix == "CENTI") { + return 1e-2f; + } + else if (prefix == "MILLI") { + return 1e-3f; + } + else if (prefix == "MICRO") { + return 1e-6f; + } + else if (prefix == "NANO") { + return 1e-9f; + } + else if (prefix == "PICO") { + return 1e-12f; + } + else if (prefix == "FEMTO") { + return 1e-15f; + } + else if (prefix == "ATTO") { + return 1e-18f; + } + else { + IFCImporter::LogError("Unrecognized SI prefix: " + prefix); + return 1; + } +} + +// ------------------------------------------------------------------------------------------------ +void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourRgb& in) +{ + out.r = static_cast( in.Red ); + out.g = static_cast( in.Green ); + out.b = static_cast( in.Blue ); + out.a = static_cast( 1.f ); +} + +// ------------------------------------------------------------------------------------------------ +void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourOrFactor& in,ConversionData& conv,const aiColor4D* base) +{ + if (const ::Assimp::STEP::EXPRESS::REAL* const r = in.ToPtr<::Assimp::STEP::EXPRESS::REAL>()) { + out.r = out.g = out.b = static_cast(*r); + if(base) { + out.r *= static_cast( base->r ); + out.g *= static_cast( base->g ); + out.b *= static_cast( base->b ); + out.a = static_cast( base->a ); + } + else out.a = 1.0; + } + else if (const Schema_2x3::IfcColourRgb* const rgb = in.ResolveSelectPtr(conv.db)) { + ConvertColor(out,*rgb); + } + else { + IFCImporter::LogWarn("skipping unknown IfcColourOrFactor entity"); + } +} + +// ------------------------------------------------------------------------------------------------ +void ConvertCartesianPoint(IfcVector3& out, const Schema_2x3::IfcCartesianPoint& in) +{ + out = IfcVector3(); + for(size_t i = 0; i < in.Coordinates.size(); ++i) { + out[static_cast(i)] = in.Coordinates[i]; + } +} + +// ------------------------------------------------------------------------------------------------ +void ConvertVector(IfcVector3& out, const Schema_2x3::IfcVector& in) +{ + ConvertDirection(out,in.Orientation); + out *= in.Magnitude; +} + +// ------------------------------------------------------------------------------------------------ +void ConvertDirection(IfcVector3& out, const Schema_2x3::IfcDirection& in) +{ + out = IfcVector3(); + for(size_t i = 0; i < in.DirectionRatios.size(); ++i) { + out[static_cast(i)] = in.DirectionRatios[i]; + } + const IfcFloat len = out.Length(); + if (len<1e-6) { + IFCImporter::LogWarn("direction vector magnitude too small, normalization would result in a division by zero"); + return; + } + out /= len; +} + +// ------------------------------------------------------------------------------------------------ +void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y, const IfcVector3& z) +{ + out.a1 = x.x; + out.b1 = x.y; + out.c1 = x.z; + + out.a2 = y.x; + out.b2 = y.y; + out.c2 = y.z; + + out.a3 = z.x; + out.b3 = z.y; + out.c3 = z.z; +} + +// ------------------------------------------------------------------------------------------------ +void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement3D& in) +{ + IfcVector3 loc; + ConvertCartesianPoint(loc,in.Location); + + IfcVector3 z(0.f,0.f,1.f),r(1.f,0.f,0.f),x; + + if (in.Axis) { + ConvertDirection(z,*in.Axis.Get()); + } + if (in.RefDirection) { + ConvertDirection(r,*in.RefDirection.Get()); + } + + IfcVector3 v = r.Normalize(); + IfcVector3 tmpx = z * (v*z); + + x = (v-tmpx).Normalize(); + IfcVector3 y = (z^x); + + IfcMatrix4::Translation(loc,out); + AssignMatrixAxes(out,x,y,z); +} + +// ------------------------------------------------------------------------------------------------ +void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement2D& in) +{ + IfcVector3 loc; + ConvertCartesianPoint(loc,in.Location); + + IfcVector3 x(1.f,0.f,0.f); + if (in.RefDirection) { + ConvertDirection(x,*in.RefDirection.Get()); + } + + const IfcVector3 y = IfcVector3(x.y,-x.x,0.f); + + IfcMatrix4::Translation(loc,out); + AssignMatrixAxes(out,x,y,IfcVector3(0.f,0.f,1.f)); +} + +// ------------------------------------------------------------------------------------------------ +void ConvertAxisPlacement(IfcVector3& axis, IfcVector3& pos, const Schema_2x3::IfcAxis1Placement& in) +{ + ConvertCartesianPoint(pos,in.Location); + if (in.Axis) { + ConvertDirection(axis,in.Axis.Get()); + } + else { + axis = IfcVector3(0.f,0.f,1.f); + } +} + +// ------------------------------------------------------------------------------------------------ +void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement& in, ConversionData& conv) +{ + if(const Schema_2x3::IfcAxis2Placement3D* pl3 = in.ResolveSelectPtr(conv.db)) { + ConvertAxisPlacement(out,*pl3); + } + else if(const Schema_2x3::IfcAxis2Placement2D* pl2 = in.ResolveSelectPtr(conv.db)) { + ConvertAxisPlacement(out,*pl2); + } + else { + IFCImporter::LogWarn("skipping unknown IfcAxis2Placement entity"); + } +} + +// ------------------------------------------------------------------------------------------------ +void ConvertTransformOperator(IfcMatrix4& out, const Schema_2x3::IfcCartesianTransformationOperator& op) +{ + IfcVector3 loc; + ConvertCartesianPoint(loc,op.LocalOrigin); + + IfcVector3 x(1.f,0.f,0.f),y(0.f,1.f,0.f),z(0.f,0.f,1.f); + if (op.Axis1) { + ConvertDirection(x,*op.Axis1.Get()); + } + if (op.Axis2) { + ConvertDirection(y,*op.Axis2.Get()); + } + if (const Schema_2x3::IfcCartesianTransformationOperator3D* op2 = op.ToPtr()) { + if(op2->Axis3) { + ConvertDirection(z,*op2->Axis3.Get()); + } + } + + IfcMatrix4 locm; + IfcMatrix4::Translation(loc,locm); + AssignMatrixAxes(out,x,y,z); + + + IfcVector3 vscale; + if (const Schema_2x3::IfcCartesianTransformationOperator3DnonUniform* nuni = op.ToPtr()) { + vscale.x = nuni->Scale?op.Scale.Get():1.f; + vscale.y = nuni->Scale2?nuni->Scale2.Get():1.f; + vscale.z = nuni->Scale3?nuni->Scale3.Get():1.f; + } + else { + const IfcFloat sc = op.Scale?op.Scale.Get():1.f; + vscale = IfcVector3(sc,sc,sc); + } + + IfcMatrix4 s; + IfcMatrix4::Scaling(vscale,s); + + out = locm * out * s; +} + + +} // ! IFC +} // ! Assimp + +#endif diff --git a/Engine/lib/assimp/code/Importer/IFC/IFCUtil.h b/Engine/lib/assimp/code/Importer/IFC/IFCUtil.h new file mode 100644 index 000000000..32ae1e07f --- /dev/null +++ b/Engine/lib/assimp/code/Importer/IFC/IFCUtil.h @@ -0,0 +1,413 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IFC.cpp + * @brief Implementation of the Industry Foundation Classes loader. + */ + +#ifndef INCLUDED_IFCUTIL_H +#define INCLUDED_IFCUTIL_H + +#include "IFCReaderGen_2x3.h" +#include "IFCLoader.h" +#include "code/Step/STEPFile.h" +#include +#include + +struct aiNode; + +namespace Assimp { +namespace IFC { + + typedef double IfcFloat; + + // IfcFloat-precision math data types + typedef aiVector2t IfcVector2; + typedef aiVector3t IfcVector3; + typedef aiMatrix4x4t IfcMatrix4; + typedef aiMatrix3x3t IfcMatrix3; + typedef aiColor4t IfcColor4; + + +// ------------------------------------------------------------------------------------------------ +// Helper for std::for_each to delete all heap-allocated items in a container +// ------------------------------------------------------------------------------------------------ +template +struct delete_fun { + void operator()(T* del) { + delete del; + } +}; + + + +// ------------------------------------------------------------------------------------------------ +// Helper used during mesh construction. Aids at creating aiMesh'es out of relatively few polygons. +// ------------------------------------------------------------------------------------------------ +struct TempMesh { + std::vector mVerts; + std::vector mVertcnt; + + // utilities + aiMesh* ToMesh(); + void Clear(); + void Transform(const IfcMatrix4& mat); + IfcVector3 Center() const; + void Append(const TempMesh& other); + bool IsEmpty() const; + void RemoveAdjacentDuplicates(); + void RemoveDegenerates(); + void FixupFaceOrientation(); + static IfcVector3 ComputePolygonNormal(const IfcVector3* vtcs, size_t cnt, bool normalize = true); + IfcVector3 ComputeLastPolygonNormal(bool normalize = true) const; + void ComputePolygonNormals(std::vector& normals, bool normalize = true, size_t ofs = 0) const; + void Swap(TempMesh& other); +}; + +inline +bool TempMesh::IsEmpty() const { + return mVerts.empty() && mVertcnt.empty(); +} + + +// ------------------------------------------------------------------------------------------------ +// Temporary representation of an opening in a wall or a floor +// ------------------------------------------------------------------------------------------------ +struct TempOpening +{ + const IFC::Schema_2x3::IfcSolidModel *solid; + IfcVector3 extrusionDir; + + std::shared_ptr profileMesh; + std::shared_ptr profileMesh2D; + + // list of points generated for this opening. This is used to + // create connections between two opposing holes created + // from a single opening instance (two because walls tend to + // have two sides). If !empty(), the other side of the wall + // has already been processed. + std::vector wallPoints; + + // ------------------------------------------------------------------------------ + TempOpening() + : solid() + , extrusionDir() + , profileMesh() + { + } + + // ------------------------------------------------------------------------------ + TempOpening(const IFC::Schema_2x3::IfcSolidModel* solid,IfcVector3 extrusionDir, + std::shared_ptr profileMesh, + std::shared_ptr profileMesh2D) + : solid(solid) + , extrusionDir(extrusionDir) + , profileMesh(profileMesh) + , profileMesh2D(profileMesh2D) + { + } + + // ------------------------------------------------------------------------------ + void Transform(const IfcMatrix4& mat); // defined later since TempMesh is not complete yet + + + + // ------------------------------------------------------------------------------ + // Helper to sort openings by distance from a given base point + struct DistanceSorter { + + DistanceSorter(const IfcVector3& base) : base(base) {} + + bool operator () (const TempOpening& a, const TempOpening& b) const { + return (a.profileMesh->Center()-base).SquareLength() < (b.profileMesh->Center()-base).SquareLength(); + } + + IfcVector3 base; + }; +}; + + +// ------------------------------------------------------------------------------------------------ +// Intermediate data storage during conversion. Keeps everything and a bit more. +// ------------------------------------------------------------------------------------------------ +struct ConversionData +{ + ConversionData(const STEP::DB& db, const IFC::Schema_2x3::IfcProject& proj, aiScene* out,const IFCImporter::Settings& settings) + : len_scale(1.0) + , angle_scale(-1.0) + , db(db) + , proj(proj) + , out(out) + , settings(settings) + , apply_openings() + , collect_openings() + {} + + ~ConversionData() { + std::for_each(meshes.begin(),meshes.end(),delete_fun()); + std::for_each(materials.begin(),materials.end(),delete_fun()); + } + + IfcFloat len_scale, angle_scale; + bool plane_angle_in_radians; + + const STEP::DB& db; + const IFC::Schema_2x3::IfcProject& proj; + aiScene* out; + + IfcMatrix4 wcs; + std::vector meshes; + std::vector materials; + + struct MeshCacheIndex { + const IFC::Schema_2x3::IfcRepresentationItem* item; unsigned int matindex; + MeshCacheIndex() : item(NULL), matindex(0) { } + MeshCacheIndex(const IFC::Schema_2x3::IfcRepresentationItem* i, unsigned int mi) : item(i), matindex(mi) { } + bool operator == (const MeshCacheIndex& o) const { return item == o.item && matindex == o.matindex; } + bool operator < (const MeshCacheIndex& o) const { return item < o.item || (item == o.item && matindex < o.matindex); } + }; + typedef std::map > MeshCache; + MeshCache cached_meshes; + + typedef std::map MaterialCache; + MaterialCache cached_materials; + + const IFCImporter::Settings& settings; + + // Intermediate arrays used to resolve openings in walls: only one of them + // can be given at a time. apply_openings if present if the current element + // is a wall and needs its openings to be poured into its geometry while + // collect_openings is present only if the current element is an + // IfcOpeningElement, for which all the geometry needs to be preserved + // for later processing by a parent, which is a wall. + std::vector* apply_openings; + std::vector* collect_openings; + + std::set already_processed; +}; + + +// ------------------------------------------------------------------------------------------------ +// Binary predicate to compare vectors with a given, quadratic epsilon. +// ------------------------------------------------------------------------------------------------ +struct FuzzyVectorCompare { + + FuzzyVectorCompare(IfcFloat epsilon) : epsilon(epsilon) {} + bool operator()(const IfcVector3& a, const IfcVector3& b) { + return std::abs((a-b).SquareLength()) < epsilon; + } + + const IfcFloat epsilon; +}; + + +// ------------------------------------------------------------------------------------------------ +// Ordering predicate to totally order R^2 vectors first by x and then by y +// ------------------------------------------------------------------------------------------------ +struct XYSorter { + + // sort first by X coordinates, then by Y coordinates + bool operator () (const IfcVector2&a, const IfcVector2& b) const { + if (a.x == b.x) { + return a.y < b.y; + } + return a.x < b.x; + } +}; + + + +// conversion routines for common IFC entities, implemented in IFCUtil.cpp +void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourRgb& in); +void ConvertColor(aiColor4D& out, const Schema_2x3::IfcColourOrFactor& in,ConversionData& conv,const aiColor4D* base); +void ConvertCartesianPoint(IfcVector3& out, const Schema_2x3::IfcCartesianPoint& in); +void ConvertDirection(IfcVector3& out, const Schema_2x3::IfcDirection& in); +void ConvertVector(IfcVector3& out, const Schema_2x3::IfcVector& in); +void AssignMatrixAxes(IfcMatrix4& out, const IfcVector3& x, const IfcVector3& y, const IfcVector3& z); +void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement3D& in); +void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement2D& in); +void ConvertAxisPlacement(IfcVector3& axis, IfcVector3& pos, const IFC::Schema_2x3::IfcAxis1Placement& in); +void ConvertAxisPlacement(IfcMatrix4& out, const Schema_2x3::IfcAxis2Placement& in, ConversionData& conv); +void ConvertTransformOperator(IfcMatrix4& out, const Schema_2x3::IfcCartesianTransformationOperator& op); +bool IsTrue(const Assimp::STEP::EXPRESS::BOOLEAN& in); +IfcFloat ConvertSIPrefix(const std::string& prefix); + + +// IFCProfile.cpp +bool ProcessProfile(const Schema_2x3::IfcProfileDef& prof, TempMesh& meshout, ConversionData& conv); +bool ProcessCurve(const Schema_2x3::IfcCurve& curve, TempMesh& meshout, ConversionData& conv); + +// IFCMaterial.cpp +unsigned int ProcessMaterials(uint64_t id, unsigned int prevMatId, ConversionData& conv, bool forceDefaultMat); + +// IFCGeometry.cpp +IfcMatrix3 DerivePlaneCoordinateSpace(const TempMesh& curmesh, bool& ok, IfcVector3& norOut); +bool ProcessRepresentationItem(const Schema_2x3::IfcRepresentationItem& item, unsigned int matid, std::set& mesh_indices, ConversionData& conv); +void AssignAddedMeshes(std::set& mesh_indices,aiNode* nd,ConversionData& /*conv*/); + +void ProcessSweptAreaSolid(const Schema_2x3::IfcSweptAreaSolid& swept, TempMesh& meshout, + ConversionData& conv); + +void ProcessExtrudedAreaSolid(const Schema_2x3::IfcExtrudedAreaSolid& solid, TempMesh& result, + ConversionData& conv, bool collect_openings); + +// IFCBoolean.cpp + +void ProcessBoolean(const Schema_2x3::IfcBooleanResult& boolean, TempMesh& result, ConversionData& conv); +void ProcessBooleanHalfSpaceDifference(const Schema_2x3::IfcHalfSpaceSolid* hs, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv); + +void ProcessPolygonalBoundedBooleanHalfSpaceDifference(const Schema_2x3::IfcPolygonalBoundedHalfSpace* hs, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv); +void ProcessBooleanExtrudedAreaSolidDifference(const Schema_2x3::IfcExtrudedAreaSolid* as, TempMesh& result, + const TempMesh& first_operand, + ConversionData& conv); + + +// IFCOpenings.cpp + +bool GenerateOpenings(std::vector& openings, + const std::vector& nors, + TempMesh& curmesh, + bool check_intersection, + bool generate_connection_geometry, + const IfcVector3& wall_extrusion_axis = IfcVector3(0,1,0)); + + + +// IFCCurve.cpp + +// ------------------------------------------------------------------------------------------------ +// Custom exception for use by members of the Curve class +// ------------------------------------------------------------------------------------------------ +class CurveError { +public: + CurveError(const std::string& s) + : mStr(s) { + // empty + } + + std::string mStr; +}; + +// ------------------------------------------------------------------------------------------------ +// Temporary representation for an arbitrary sub-class of IfcCurve. Used to sample the curves +// to obtain a list of line segments. +// ------------------------------------------------------------------------------------------------ +class Curve { +protected: + Curve(const Schema_2x3::IfcCurve& base_entity, ConversionData& conv) + : base_entity(base_entity) + , conv(conv) { + // empty + } + +public: + typedef std::pair ParamRange; + + virtual ~Curve() {} + + + // check if a curve is closed + virtual bool IsClosed() const = 0; + + // evaluate the curve at the given parametric position + virtual IfcVector3 Eval(IfcFloat p) const = 0; + + // try to match a point on the curve to a given parameter + // for self-intersecting curves, the result is not ambiguous and + // it is undefined which parameter is returned. + virtual bool ReverseEval(const IfcVector3& val, IfcFloat& paramOut) const; + + // get the range of the curve (both inclusive). + // +inf and -inf are valid return values, the curve is not bounded in such a case. + virtual std::pair GetParametricRange() const = 0; + IfcFloat GetParametricRangeDelta() const; + + // estimate the number of sample points that this curve will require + virtual size_t EstimateSampleCount(IfcFloat start,IfcFloat end) const; + + // intelligently sample the curve based on the current settings + // and append the result to the mesh + virtual void SampleDiscrete(TempMesh& out,IfcFloat start,IfcFloat end) const; + +#ifdef ASSIMP_BUILD_DEBUG + // check if a particular parameter value lies within the well-defined range + bool InRange(IfcFloat) const; +#endif + static Curve* Convert(const IFC::Schema_2x3::IfcCurve&,ConversionData& conv); + +protected: + const Schema_2x3::IfcCurve& base_entity; + ConversionData& conv; +}; + + +// -------------------------------------------------------------------------------- +// A BoundedCurve always holds the invariant that GetParametricRange() +// never returns infinite values. +// -------------------------------------------------------------------------------- +class BoundedCurve : public Curve { +public: + BoundedCurve(const Schema_2x3::IfcBoundedCurve& entity, ConversionData& conv) + : Curve(entity,conv) + {} + +public: + + bool IsClosed() const; + +public: + + // sample the entire curve + void SampleDiscrete(TempMesh& out) const; + using Curve::SampleDiscrete; +}; + +// IfcProfile.cpp +bool ProcessCurve(const Schema_2x3::IfcCurve& curve, TempMesh& meshout, ConversionData& conv); +} +} + +#endif diff --git a/Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.cpp b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.cpp new file mode 100644 index 000000000..101dcdfd7 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.cpp @@ -0,0 +1,432 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 STEPFileEncoding.cpp + * @brief STEP character handling, string un-escaping + */ +#include "STEPFileEncoding.h" +#include +#ifdef ASSIMP_USE_HUNTER +# include +#else +# include +#endif + +#include + +using namespace Assimp; + +// roman1 to utf16 table +static const uint16_t mac_codetable[] = { + // 0x20 unassig./nonprint. slots + 0x0020 , + 0x0021 , + 0x0022 , + 0x0023 , + 0x0024 , + 0x0025 , + 0x0026 , + 0x0027 , + 0x0028 , + 0x0029 , + 0x002A , + 0x002B , + 0x002C , + 0x002D , + 0x002E , + 0x002F , + 0x0030 , + 0x0031 , + 0x0032 , + 0x0033 , + 0x0034 , + 0x0035 , + 0x0036 , + 0x0037 , + 0x0038 , + 0x0039 , + 0x003A , + 0x003B , + 0x003C , + 0x003D , + 0x003E , + 0x003F , + 0x0040 , + 0x0041 , + 0x0042 , + 0x0043 , + 0x0044 , + 0x0045 , + 0x0046 , + 0x0047 , + 0x0048 , + 0x0049 , + 0x004A , + 0x004B , + 0x004C , + 0x004D , + 0x004E , + 0x004F , + 0x0050 , + 0x0051 , + 0x0052 , + 0x0053 , + 0x0054 , + 0x0055 , + 0x0056 , + 0x0057 , + 0x0058 , + 0x0059 , + 0x005A , + 0x005B , + 0x005C , + 0x005D , + 0x005E , + 0x005F , + 0x0060 , + 0x0061 , + 0x0062 , + 0x0063 , + 0x0064 , + 0x0065 , + 0x0066 , + 0x0067 , + 0x0068 , + 0x0069 , + 0x006A , + 0x006B , + 0x006C , + 0x006D , + 0x006E , + 0x006F , + 0x0070 , + 0x0071 , + 0x0072 , + 0x0073 , + 0x0074 , + 0x0075 , + 0x0076 , + 0x0077 , + 0x0078 , + 0x0079 , + 0x007A , + 0x007B , + 0x007C , + 0x007D , + 0x007E , + 0x0000 , // unassig. + 0x00C4 , + 0x00C5 , + 0x00C7 , + 0x00C9 , + 0x00D1 , + 0x00D6 , + 0x00DC , + 0x00E1 , + 0x00E0 , + 0x00E2 , + 0x00E4 , + 0x00E3 , + 0x00E5 , + 0x00E7 , + 0x00E9 , + 0x00E8 , + 0x00EA , + 0x00EB , + 0x00ED , + 0x00EC , + 0x00EE , + 0x00EF , + 0x00F1 , + 0x00F3 , + 0x00F2 , + 0x00F4 , + 0x00F6 , + 0x00F5 , + 0x00FA , + 0x00F9 , + 0x00FB , + 0x00FC , + 0x2020 , + 0x00B0 , + 0x00A2 , + 0x00A3 , + 0x00A7 , + 0x2022 , + 0x00B6 , + 0x00DF , + 0x00AE , + 0x00A9 , + 0x2122 , + 0x00B4 , + 0x00A8 , + 0x2260 , + 0x00C6 , + 0x00D8 , + 0x221E , + 0x00B1 , + 0x2264 , + 0x2265 , + 0x00A5 , + 0x00B5 , + 0x2202 , + 0x2211 , + 0x220F , + 0x03C0 , + 0x222B , + 0x00AA , + 0x00BA , + 0x03A9 , + 0x00E6 , + 0x00F8 , + 0x00BF , + 0x00A1 , + 0x00AC , + 0x221A , + 0x0192 , + 0x2248 , + 0x2206 , + 0x00AB , + 0x00BB , + 0x2026 , + 0x00A0 , + 0x00C0 , + 0x00C3 , + 0x00D5 , + 0x0152 , + 0x0153 , + 0x2013 , + 0x2014 , + 0x201C , + 0x201D , + 0x2018 , + 0x2019 , + 0x00F7 , + 0x25CA , + 0x00FF , + 0x0178 , + 0x2044 , + 0x20AC , + 0x2039 , + 0x203A , + 0xFB01 , + 0xFB02 , + 0x2021 , + 0x00B7 , + 0x201A , + 0x201E , + 0x2030 , + 0x00C2 , + 0x00CA , + 0x00C1 , + 0x00CB , + 0x00C8 , + 0x00CD , + 0x00CE , + 0x00CF , + 0x00CC , + 0x00D3 , + 0x00D4 , + 0xF8FF , + 0x00D2 , + 0x00DA , + 0x00DB , + 0x00D9 , + 0x0131 , + 0x02C6 , + 0x02DC , + 0x00AF , + 0x02D8 , + 0x02D9 , + 0x02DA , + 0x00B8 , + 0x02DD , + 0x02DB , + 0x02C7 +}; + +// ------------------------------------------------------------------------------------------------ +bool STEP::StringToUTF8(std::string& s) +{ + // very basic handling for escaped string sequences + // http://doc.spatial.com/index.php?title=InterOp:Connect/STEP&redirect=no + + for (size_t i = 0; i < s.size(); ) { + if (s[i] == '\\') { + // \S\X - cp1252 (X is the character remapped to [0,127]) + if (i+3 < s.size() && s[i+1] == 'S' && s[i+2] == '\\') { + // http://stackoverflow.com/questions/5586214/how-to-convert-char-from-iso-8859-1-to-utf-8-in-c-multiplatformly + ai_assert((uint8_t)s[i+3] < 0x80); + const uint8_t ch = s[i+3] + 0x80; + + s[i] = 0xc0 | (ch & 0xc0) >> 6; + s[i+1] = 0x80 | (ch & 0x3f); + + s.erase(i + 2,2); + ++i; + } + // \X\xx - mac/roman (xx is a hex sequence) + else if (i+4 < s.size() && s[i+1] == 'X' && s[i+2] == '\\') { + + const uint8_t macval = HexOctetToDecimal(s.c_str() + i + 3); + if(macval < 0x20) { + return false; + } + + ai_assert(sizeof(mac_codetable) / sizeof(mac_codetable[0]) == 0x100-0x20); + + const uint32_t unival = mac_codetable[macval - 0x20], *univalp = &unival; + + unsigned char temp[5], *tempp = temp; + ai_assert(sizeof( unsigned char ) == 1); + + utf8::utf32to8( univalp, univalp + 1, tempp ); + + const size_t outcount = static_cast(tempp-temp); + + s.erase(i,5); + s.insert(i, reinterpret_cast(temp), outcount); + i += outcount; + } + // \Xn\ .. \X0\ - various unicode encodings (n=2: utf16; n=4: utf32) + else if (i+3 < s.size() && s[i+1] == 'X' && s[i+2] >= '0' && s[i+2] <= '9') { + switch(s[i+2]) { + // utf16 + case '2': + // utf32 + case '4': + if (s[i+3] == '\\') { + const size_t basei = i+4; + size_t j = basei, jend = s.size()-3; + + for (; j < jend; ++j) { + if (s[j] == '\\' && s[j+1] == 'X' && s[j+2] == '0' && s[j+3] == '\\') { + break; + } + } + if (j == jend) { + return false; + } + + if (j == basei) { + s.erase(i,8); + continue; + } + + if (s[i+2] == '2') { + if (((j - basei) % 4) != 0) { + return false; + } + + const size_t count = (j-basei)/4; + std::unique_ptr src(new uint16_t[count]); + + const char* cur = s.c_str() + basei; + for (size_t k = 0; k < count; ++k, cur += 4) { + src[k] = (static_cast(HexOctetToDecimal(cur)) << 8u) | + static_cast(HexOctetToDecimal(cur+2)); + } + + const size_t dcount = count * 3; // this is enough to hold all possible outputs + std::unique_ptr dest(new unsigned char[dcount]); + + const uint16_t* srct = src.get(); + unsigned char* destt = dest.get(); + utf8::utf16to8( srct, srct + count, destt ); + + const size_t outcount = static_cast(destt-dest.get()); + + s.erase(i,(j+4-i)); + + ai_assert(sizeof(unsigned char) == 1); + s.insert(i, reinterpret_cast(dest.get()), outcount); + + i += outcount; + continue; + } + else if (s[i+2] == '4') { + if (((j - basei) % 8) != 0) { + return false; + } + + const size_t count = (j-basei)/8; + std::unique_ptr src(new uint32_t[count]); + + const char* cur = s.c_str() + basei; + for (size_t k = 0; k < count; ++k, cur += 8) { + src[k] = (static_cast(HexOctetToDecimal(cur )) << 24u) | + (static_cast(HexOctetToDecimal(cur+2)) << 16u) | + (static_cast(HexOctetToDecimal(cur+4)) << 8u) | + (static_cast(HexOctetToDecimal(cur+6))); + } + + const size_t dcount = count * 5; // this is enough to hold all possible outputs + std::unique_ptr dest(new unsigned char[dcount]); + + const uint32_t* srct = src.get(); + unsigned char* destt = dest.get(); + utf8::utf32to8( srct, srct + count, destt ); + + const size_t outcount = static_cast(destt-dest.get()); + + s.erase(i,(j+4-i)); + + ai_assert(sizeof(unsigned char) == 1); + s.insert(i, reinterpret_cast(dest.get()), outcount); + + i += outcount; + continue; + } + } + break; + + // TODO: other encoding patterns? + + default: + return false; + } + } + } + ++i; + } + return true; +} diff --git a/Engine/lib/assimp/code/CreateAnimMesh.h b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.h similarity index 72% rename from Engine/lib/assimp/code/CreateAnimMesh.h rename to Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.h index 84cab8932..09f16ba33 100644 --- a/Engine/lib/assimp/code/CreateAnimMesh.h +++ b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileEncoding.h @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2019, assimp team + All rights reserved. @@ -39,19 +40,26 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -/** @file CreateAnimMesh.h - * Create AnimMesh from Mesh - */ -#ifndef INCLUDED_AI_CREATE_ANIM_MESH_H -#define INCLUDED_AI_CREATE_ANIM_MESH_H +#ifndef INCLUDED_AI_STEPFILEENCODING_H +#define INCLUDED_AI_STEPFILEENCODING_H -#include +#include -namespace Assimp { +namespace Assimp { +namespace STEP { -/** Create aiAnimMesh from aiMesh. */ -aiAnimMesh *aiCreateAnimMesh(const aiMesh *mesh); -} // end of namespace Assimp -#endif // INCLUDED_AI_CREATE_ANIM_MESH_H + // -------------------------------------------------------------------------- + // Convert an ASCII STEP identifier with possibly escaped character + // sequences using foreign encodings to plain UTF8. + // + // Return false if an error occurs, s may or may not be modified in + // this case and could still contain escape sequences (even partly + // escaped ones). + bool StringToUTF8(std::string& s); + +} // ! STEP +} // ! Assimp + +#endif diff --git a/Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.cpp b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.cpp new file mode 100644 index 000000000..f099d2be7 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.cpp @@ -0,0 +1,559 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 STEPFileReader.cpp + * @brief Implementation of the STEP file parser, which fills a + * STEP::DB with data read from a file. + */ + +#include "STEPFileReader.h" +#include "STEPFileEncoding.h" +#include +#include +#include + + +using namespace Assimp; +namespace EXPRESS = STEP::EXPRESS; + +#include + +// ------------------------------------------------------------------------------------------------ +std::string AddLineNumber(const std::string& s,uint64_t line /*= LINE_NOT_SPECIFIED*/, const std::string& prefix = "") +{ + return line == STEP::SyntaxError::LINE_NOT_SPECIFIED ? prefix+s : static_cast( (Formatter::format(),prefix,"(line ",line,") ",s) ); +} + +// ------------------------------------------------------------------------------------------------ +std::string AddEntityID(const std::string& s,uint64_t entity /*= ENTITY_NOT_SPECIFIED*/, const std::string& prefix = "") +{ + return entity == STEP::TypeError::ENTITY_NOT_SPECIFIED ? prefix+s : static_cast( (Formatter::format(),prefix,"(entity #",entity,") ",s)); +} + + +// ------------------------------------------------------------------------------------------------ +STEP::SyntaxError::SyntaxError (const std::string& s,uint64_t line /* = LINE_NOT_SPECIFIED */) +: DeadlyImportError(AddLineNumber(s,line)) +{ + +} + +// ------------------------------------------------------------------------------------------------ +STEP::TypeError::TypeError (const std::string& s,uint64_t entity /* = ENTITY_NOT_SPECIFIED */,uint64_t line /*= LINE_NOT_SPECIFIED*/) +: DeadlyImportError(AddLineNumber(AddEntityID(s,entity),line)) +{ + +} + +static const char *ISO_Token = "ISO-10303-21;"; +static const char *FILE_SCHEMA_Token = "FILE_SCHEMA"; +// ------------------------------------------------------------------------------------------------ +STEP::DB* STEP::ReadFileHeader(std::shared_ptr stream) { + std::shared_ptr reader = std::shared_ptr(new StreamReaderLE(stream)); + std::unique_ptr db = std::unique_ptr(new STEP::DB(reader)); + + LineSplitter &splitter = db->GetSplitter(); + if (!splitter || *splitter != ISO_Token ) { + throw STEP::SyntaxError("expected magic token: " + std::string( ISO_Token ), 1); + } + + HeaderInfo& head = db->GetHeader(); + for(++splitter; splitter; ++splitter) { + const std::string& s = *splitter; + if (s == "DATA;") { + // here we go, header done, start of data section + ++splitter; + break; + } + + // want one-based line numbers for human readers, so +1 + const uint64_t line = splitter.get_index()+1; + + if (s.substr(0,11) == FILE_SCHEMA_Token) { + const char* sz = s.c_str()+11; + SkipSpaces(sz,&sz); + std::shared_ptr< const EXPRESS::DataType > schema = EXPRESS::DataType::Parse(sz); + + // the file schema should be a regular list entity, although it usually contains exactly one entry + // since the list itself is contained in a regular parameter list, we actually have + // two nested lists. + const EXPRESS::LIST* list = dynamic_cast(schema.get()); + if (list && list->GetSize()) { + list = dynamic_cast( (*list)[0].get() ); + if (!list) { + throw STEP::SyntaxError("expected FILE_SCHEMA to be a list",line); + } + + // XXX need support for multiple schemas? + if (list->GetSize() > 1) { + ASSIMP_LOG_WARN(AddLineNumber("multiple schemas currently not supported",line)); + } + const EXPRESS::STRING* string( nullptr ); + if (!list->GetSize() || !(string=dynamic_cast( (*list)[0].get() ))) { + throw STEP::SyntaxError("expected FILE_SCHEMA to contain a single string literal",line); + } + head.fileSchema = *string; + } + } + + // XXX handle more header fields + } + + return db.release(); +} + + +namespace { + +// ------------------------------------------------------------------------------------------------ +// check whether the given line contains an entity definition (i.e. starts with "#=") +bool IsEntityDef(const std::string& snext) +{ + if (snext[0] == '#') { + // it is only a new entity if it has a '=' after the + // entity ID. + for(std::string::const_iterator it = snext.begin()+1; it != snext.end(); ++it) { + if (*it == '=') { + return true; + } + if ((*it < '0' || *it > '9') && *it != ' ') { + break; + } + } + } + return false; +} + +} + + +// ------------------------------------------------------------------------------------------------ +void STEP::ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, + const char* const* types_to_track, size_t len, + const char* const* inverse_indices_to_track, size_t len2) +{ + db.SetSchema(scheme); + db.SetTypesToTrack(types_to_track,len); + db.SetInverseIndicesToTrack(inverse_indices_to_track,len2); + + const DB::ObjectMap& map = db.GetObjects(); + LineSplitter& splitter = db.GetSplitter(); + + while (splitter) { + bool has_next = false; + std::string s = *splitter; + if (s == "ENDSEC;") { + break; + } + s.erase(std::remove(s.begin(), s.end(), ' '), s.end()); + + // want one-based line numbers for human readers, so +1 + const uint64_t line = splitter.get_index()+1; + // LineSplitter already ignores empty lines + ai_assert(s.length()); + if (s[0] != '#') { + ASSIMP_LOG_WARN(AddLineNumber("expected token \'#\'",line)); + ++splitter; + continue; + } + // --- + // extract id, entity class name and argument string, + // but don't create the actual object yet. + // --- + const std::string::size_type n0 = s.find_first_of('='); + if (n0 == std::string::npos) { + ASSIMP_LOG_WARN(AddLineNumber("expected token \'=\'",line)); + ++splitter; + continue; + } + + const uint64_t id = strtoul10_64(s.substr(1,n0-1).c_str()); + if (!id) { + ASSIMP_LOG_WARN(AddLineNumber("expected positive, numeric entity id",line)); + ++splitter; + continue; + } + std::string::size_type n1 = s.find_first_of('(',n0); + if (n1 == std::string::npos) { + has_next = true; + bool ok = false; + for( ++splitter; splitter; ++splitter) { + const std::string& snext = *splitter; + if (snext.empty()) { + continue; + } + + // the next line doesn't start an entity, so maybe it is + // just a continuation for this line, keep going + if (!IsEntityDef(snext)) { + s.append(snext); + n1 = s.find_first_of('(',n0); + ok = (n1 != std::string::npos); + } + else { + break; + } + } + + if(!ok) { + ASSIMP_LOG_WARN(AddLineNumber("expected token \'(\'",line)); + continue; + } + } + + std::string::size_type n2 = s.find_last_of(')'); + if (n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';') { + has_next = true; + bool ok = false; + for( ++splitter; splitter; ++splitter) { + const std::string& snext = *splitter; + if (snext.empty()) { + continue; + } + + // the next line doesn't start an entity, so maybe it is + // just a continuation for this line, keep going + if (!IsEntityDef(snext)) { + s.append(snext); + n2 = s.find_last_of(')'); + ok = !(n2 == std::string::npos || n2 < n1 || n2 == s.length() - 1 || s[n2 + 1] != ';'); + } else { + break; + } + } + if(!ok) { + ASSIMP_LOG_WARN(AddLineNumber("expected token \')\'",line)); + continue; + } + } + + if (map.find(id) != map.end()) { + ASSIMP_LOG_WARN(AddLineNumber((Formatter::format(),"an object with the id #",id," already exists"),line)); + } + + std::string::size_type ns = n0; + do ++ns; while( IsSpace(s.at(ns))); + std::string::size_type ne = n1; + do --ne; while( IsSpace(s.at(ne))); + std::string type = s.substr(ns,ne-ns+1); + std::transform( type.begin(), type.end(), type.begin(), &Assimp::ToLower ); + const char* sz = scheme.GetStaticStringForToken(type); + if(sz) { + const std::string::size_type szLen = n2-n1+1; + char* const copysz = new char[szLen+1]; + std::copy(s.c_str()+n1,s.c_str()+n2+1,copysz); + copysz[szLen] = '\0'; + db.InternInsert(new LazyObject(db,id,line,sz,copysz)); + } + if(!has_next) { + ++splitter; + } + } + + if (!splitter) { + ASSIMP_LOG_WARN("STEP: ignoring unexpected EOF"); + } + + if ( !DefaultLogger::isNullLogger()){ + ASSIMP_LOG_DEBUG((Formatter::format(),"STEP: got ",map.size()," object records with ", + db.GetRefs().size()," inverse index entries")); + } +} + +// ------------------------------------------------------------------------------------------------ +std::shared_ptr EXPRESS::DataType::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/) +{ + const char* cur = inout; + SkipSpaces(&cur); + if (*cur == ',' || IsSpaceOrNewLine(*cur)) { + throw STEP::SyntaxError("unexpected token, expected parameter",line); + } + + // just skip over constructions such as IFCPLANEANGLEMEASURE(0.01) and read only the value + if (schema) { + bool ok = false; + for(const char* t = cur; *t && *t != ')' && *t != ','; ++t) { + if (*t=='(') { + if (!ok) { + break; + } + for(--t;IsSpace(*t);--t); + std::string s(cur,static_cast(t-cur+1)); + std::transform(s.begin(),s.end(),s.begin(),&ToLower ); + if (schema->IsKnownToken(s)) { + for(cur = t+1;*cur++ != '(';); + const std::shared_ptr dt = Parse(cur); + inout = *cur ? cur+1 : cur; + return dt; + } + break; + } + else if (!IsSpace(*t)) { + ok = true; + } + } + } + + if (*cur == '*' ) { + inout = cur+1; + return std::make_shared(); + } + else if (*cur == '$' ) { + inout = cur+1; + return std::make_shared(); + } + else if (*cur == '(' ) { + // start of an aggregate, further parsing is done by the LIST factory constructor + inout = cur; + return EXPRESS::LIST::Parse(inout,line,schema); + } + else if (*cur == '.' ) { + // enum (includes boolean) + const char* start = ++cur; + for(;*cur != '.';++cur) { + if (*cur == '\0') { + throw STEP::SyntaxError("enum not closed",line); + } + } + inout = cur+1; + return std::make_shared(std::string(start, static_cast(cur-start) )); + } + else if (*cur == '#' ) { + // object reference + return std::make_shared(strtoul10_64(++cur,&inout)); + } + else if (*cur == '\'' ) { + // string literal + const char* start = ++cur; + + for(;*cur != '\'';++cur) { + if (*cur == '\0') { + throw STEP::SyntaxError("string literal not closed",line); + } + } + + if (cur[1] == '\'') { + // Vesanen: more than 2 escaped ' in one literal! + do { + for(cur += 2;*cur != '\'';++cur) { + if (*cur == '\0') { + throw STEP::SyntaxError("string literal not closed",line); + } + } + } + while(cur[1] == '\''); + } + + inout = cur + 1; + + // assimp is supposed to output UTF8 strings, so we have to deal + // with foreign encodings. + std::string stemp = std::string(start, static_cast(cur - start)); + if(!StringToUTF8(stemp)) { + // TODO: route this to a correct logger with line numbers etc., better error messages + ASSIMP_LOG_ERROR("an error occurred reading escape sequences in ASCII text"); + } + + return std::make_shared(stemp); + } + else if (*cur == '\"' ) { + throw STEP::SyntaxError("binary data not supported yet",line); + } + + // else -- must be a number. if there is a decimal dot in it, + // parse it as real value, otherwise as integer. + const char* start = cur; + for(;*cur && *cur != ',' && *cur != ')' && !IsSpace(*cur);++cur) { + if (*cur == '.') { + double f; + inout = fast_atoreal_move(start,f); + return std::make_shared(f); + } + } + + bool neg = false; + if (*start == '-') { + neg = true; + ++start; + } + else if (*start == '+') { + ++start; + } + int64_t num = static_cast( strtoul10_64(start,&inout) ); + return std::make_shared(neg?-num:num); +} + +// ------------------------------------------------------------------------------------------------ +std::shared_ptr EXPRESS::LIST::Parse(const char*& inout,uint64_t line, const EXPRESS::ConversionSchema* schema /*= NULL*/) { + const std::shared_ptr list = std::make_shared(); + EXPRESS::LIST::MemberList& members = list->members; + + const char* cur = inout; + if (*cur++ != '(') { + throw STEP::SyntaxError("unexpected token, expected \'(\' token at beginning of list",line); + } + + // estimate the number of items upfront - lists can grow large + size_t count = 1; + for(const char* c=cur; *c && *c != ')'; ++c) { + count += (*c == ',' ? 1 : 0); + } + + members.reserve(count); + + for(;;++cur) { + if (!*cur) { + throw STEP::SyntaxError("unexpected end of line while reading list"); + } + SkipSpaces(cur,&cur); + if (*cur == ')') { + break; + } + + members.push_back( EXPRESS::DataType::Parse(cur,line,schema)); + SkipSpaces(cur,&cur); + + if (*cur != ',') { + if (*cur == ')') { + break; + } + throw STEP::SyntaxError("unexpected token, expected \',\' or \')\' token after list element",line); + } + } + + inout = cur+1; + return list; +} + +// ------------------------------------------------------------------------------------------------ +static void handleSkippedDepthFromToken(const char *a, int64_t &skip_depth ) { + if (*a == '(') { + ++skip_depth; + } else if (*a == ')') { + --skip_depth; + } +} + +// ------------------------------------------------------------------------------------------------ +static int64_t getIdFromToken(const char *a) { + const char *tmp; + const int64_t num = static_cast(strtoul10_64(a + 1, &tmp)); + + return num; +} + +// ------------------------------------------------------------------------------------------------ +STEP::LazyObject::LazyObject(DB& db, uint64_t id,uint64_t /*line*/, const char* const type,const char* args) +: id(id) +, type(type) +, db(db) +, args(args) +, obj() { + // find any external references and store them in the database. + // this helps us emulate STEPs INVERSE fields. + if (!db.KeepInverseIndicesForType(type)) { + return; + } + + // do a quick scan through the argument tuple and watch out for entity references + const char *a( args ); + int64_t skip_depth( 0 ); + while ( *a ) { + handleSkippedDepthFromToken(a, skip_depth); + /*if (*a == '(') { + ++skip_depth; + } else if (*a == ')') { + --skip_depth; + }*/ + + if (skip_depth >= 1 && *a=='#') { + if (*(a + 1) != '#') { + /*const char *tmp; + const int64_t num = static_cast(strtoul10_64(a + 1, &tmp)); + db.MarkRef(num, id);*/ + db.MarkRef(getIdFromToken(a), id); + } else { + ++a; + } + } + ++a; + } +} + +// ------------------------------------------------------------------------------------------------ +STEP::LazyObject::~LazyObject() { + // make sure the right dtor/operator delete get called + if (obj) { + delete obj; + } else { + delete[] args; + } +} + +// ------------------------------------------------------------------------------------------------ +void STEP::LazyObject::LazyInit() const { + const EXPRESS::ConversionSchema& schema = db.GetSchema(); + STEP::ConvertObjectProc proc = schema.GetConverterProc(type); + + if (!proc) { + throw STEP::TypeError("unknown object type: " + std::string(type),id); + } + + const char* acopy = args; + std::shared_ptr conv_args = EXPRESS::LIST::Parse(acopy,STEP::SyntaxError::LINE_NOT_SPECIFIED,&db.GetSchema()); + delete[] args; + args = NULL; + + // if the converter fails, it should throw an exception, but it should never return NULL + try { + obj = proc(db,*conv_args); + } + catch(const TypeError& t) { + // augment line and entity information + throw TypeError(t.what(),id); + } + ++db.evaluated_count; + ai_assert(obj); + + // store the original id in the object instance + obj->SetID(id); +} diff --git a/Engine/lib/assimp/code/XMLTools.h b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.h similarity index 58% rename from Engine/lib/assimp/code/XMLTools.h rename to Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.h index 5d31f885e..9c4b77241 100644 --- a/Engine/lib/assimp/code/XMLTools.h +++ b/Engine/lib/assimp/code/Importer/STEPParser/STEPFileReader.h @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2019, assimp team + All rights reserved. @@ -39,44 +40,32 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -#ifndef INCLUDED_ASSIMP_XML_TOOLS_H -#define INCLUDED_ASSIMP_XML_TOOLS_H +#ifndef INCLUDED_AI_STEPFILEREADER_H +#define INCLUDED_AI_STEPFILEREADER_H -#include +#include "code/Step/STEPFile.h" namespace Assimp { - // XML escape the 5 XML special characters (",',<,> and &) in |data| - // Based on http://stackoverflow.com/questions/5665231 - std::string XMLEscape(const std::string& data) { - std::string buffer; +namespace STEP { - const size_t size = data.size(); - buffer.reserve(size + size / 8); - for(size_t i = 0; i < size; ++i) { - const char c = data[i]; - switch(c) { - case '&' : - buffer.append("&"); - break; - case '\"': - buffer.append("""); - break; - case '\'': - buffer.append("'"); - break; - case '<' : - buffer.append("<"); - break; - case '>' : - buffer.append(">"); - break; - default: - buffer.append(&c, 1); - break; - } - } - return buffer; - } +// -------------------------------------------------------------------------- +/// @brief Parsing a STEP file is a twofold procedure. +/// 1) read file header and return to caller, who checks if the +/// file is of a supported schema .. +DB* ReadFileHeader(std::shared_ptr stream); + +/// 2) read the actual file contents using a user-supplied set of +/// conversion functions to interpret the data. +void ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const char* const* types_to_track, size_t len, const char* const* inverse_indices_to_track, size_t len2); + +/// @brief Helper to read a file. +template +inline +void ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, const char* const (&arr)[N], const char* const (&arr2)[N2]) { + return ReadFile(db,scheme,arr,N,arr2,N2); } -#endif // INCLUDED_ASSIMP_XML_TOOLS_H +} // ! STEP +} // ! Assimp + +#endif // INCLUDED_AI_STEPFILEREADER_H diff --git a/Engine/lib/assimp/code/Importer/StepFile/StepFileGen1.cpp b/Engine/lib/assimp/code/Importer/StepFile/StepFileGen1.cpp new file mode 100644 index 000000000..50c54818e --- /dev/null +++ b/Engine/lib/assimp/code/Importer/StepFile/StepFileGen1.cpp @@ -0,0 +1,2195 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2018, 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& db, const LIST& params, abstract_variable* in) +{ + 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& db, const LIST& params, angle_direction_reference* in) +{ + 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/Engine/lib/assimp/code/Importer/StepFile/StepFileGen2.cpp b/Engine/lib/assimp/code/Importer/StepFile/StepFileGen2.cpp new file mode 100644 index 000000000..eca09e4e1 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/StepFile/StepFileGen2.cpp @@ -0,0 +1,3067 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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/Engine/lib/assimp/code/Importer/StepFile/StepFileGen3.cpp b/Engine/lib/assimp/code/Importer/StepFile/StepFileGen3.cpp new file mode 100644 index 000000000..d8d81141f --- /dev/null +++ b/Engine/lib/assimp/code/Importer/StepFile/StepFileGen3.cpp @@ -0,0 +1,5746 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2010, 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& db, const LIST& params, logical_representation_item* in) +{ + 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/Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.cpp b/Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.cpp new file mode 100644 index 000000000..26c456ac9 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.cpp @@ -0,0 +1,114 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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* pScene, 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/Engine/lib/assimp/include/assimp/Macros.h b/Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.h similarity index 75% rename from Engine/lib/assimp/include/assimp/Macros.h rename to Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.h index 651530337..70f65fdcf 100644 --- a/Engine/lib/assimp/include/assimp/Macros.h +++ b/Engine/lib/assimp/code/Importer/StepFile/StepFileImporter.h @@ -5,6 +5,8 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team + + All rights reserved. Redistribution and use of this software in source and binary forms, @@ -39,11 +41,29 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ -/* Helper macro to set a pointer to NULL in debug builds - */ -#if (defined ASSIMP_BUILD_DEBUG) -# define AI_DEBUG_INVALIDATE_PTR(x) x = NULL; -#else -# define AI_DEBUG_INVALIDATE_PTR(x) -#endif +#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/Engine/lib/assimp/code/Importer/StepFile/StepReaderGen.h b/Engine/lib/assimp/code/Importer/StepFile/StepReaderGen.h new file mode 100644 index 000000000..9eb86c332 --- /dev/null +++ b/Engine/lib/assimp/code/Importer/StepFile/StepReaderGen.h @@ -0,0 +1,7288 @@ +/* +Open Asset Import Library (ASSIMP) +---------------------------------------------------------------------- + +Copyright (c) 2006-2018, 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" + +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/Engine/lib/assimp/code/Irr/IRRLoader.cpp b/Engine/lib/assimp/code/Irr/IRRLoader.cpp new file mode 100644 index 000000000..e94fd85a4 --- /dev/null +++ b/Engine/lib/assimp/code/Irr/IRRLoader.cpp @@ -0,0 +1,1488 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IRRLoader.cpp + * @brief Implementation of the Irr importer class + */ + + + +#ifndef ASSIMP_BUILD_NO_IRR_IMPORTER + +#include "Irr/IRRLoader.h" +#include "Common/Importer.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace Assimp; +using namespace irr; +using namespace irr::io; + +static const aiImporterDesc desc = { + "Irrlicht Scene Reader", + "", + "", + "http://irrlicht.sourceforge.net/", + aiImporterFlags_SupportTextFlavour, + 0, + 0, + 0, + 0, + "irr xml" +}; + +// ------------------------------------------------------------------------------------------------ +// Constructor to be privately used by Importer +IRRImporter::IRRImporter() +: fps() +, configSpeedFlag(){ + // empty +} + +// ------------------------------------------------------------------------------------------------ +// Destructor, private as well +IRRImporter::~IRRImporter() { + // empty +} + +// ------------------------------------------------------------------------------------------------ +// Returns whether the class can handle the format of the given file. +bool IRRImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const { + const std::string extension = GetExtension(pFile); + if ( extension == "irr" ) { + return true; + } else if (extension == "xml" || checkSig) { + /* If CanRead() is called in order to check whether we + * support a specific file extension in general pIOHandler + * might be nullptr and it's our duty to return true here. + */ + if (nullptr == pIOHandler ) { + return true; + } + const char* tokens[] = {"irr_scene"}; + return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1); + } + + return false; +} + +// ------------------------------------------------------------------------------------------------ +const aiImporterDesc* IRRImporter::GetInfo () const +{ + return &desc; +} + +// ------------------------------------------------------------------------------------------------ +void IRRImporter::SetupProperties(const Importer* pImp) +{ + // read the output frame rate of all node animation channels + fps = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_IRR_ANIM_FPS,100); + if (fps < 10.) { + ASSIMP_LOG_ERROR("IRR: Invalid FPS configuration"); + fps = 100; + } + + // AI_CONFIG_FAVOUR_SPEED + configSpeedFlag = (0 != pImp->GetPropertyInteger(AI_CONFIG_FAVOUR_SPEED,0)); +} + +// ------------------------------------------------------------------------------------------------ +// Build a mesh tha consists of a single squad (a side of a skybox) +aiMesh* IRRImporter::BuildSingleQuadMesh(const SkyboxVertex& v1, + const SkyboxVertex& v2, + const SkyboxVertex& v3, + const SkyboxVertex& v4) +{ + // allocate and prepare the mesh + aiMesh* out = new aiMesh(); + + out->mPrimitiveTypes = aiPrimitiveType_POLYGON; + out->mNumFaces = 1; + + // build the face + out->mFaces = new aiFace[1]; + aiFace& face = out->mFaces[0]; + + face.mNumIndices = 4; + face.mIndices = new unsigned int[4]; + for (unsigned int i = 0; i < 4;++i) + face.mIndices[i] = i; + + out->mNumVertices = 4; + + // copy vertex positions + aiVector3D* vec = out->mVertices = new aiVector3D[4]; + *vec++ = v1.position; + *vec++ = v2.position; + *vec++ = v3.position; + *vec = v4.position; + + // copy vertex normals + vec = out->mNormals = new aiVector3D[4]; + *vec++ = v1.normal; + *vec++ = v2.normal; + *vec++ = v3.normal; + *vec = v4.normal; + + // copy texture coordinates + vec = out->mTextureCoords[0] = new aiVector3D[4]; + *vec++ = v1.uv; + *vec++ = v2.uv; + *vec++ = v3.uv; + *vec = v4.uv; + return out; +} + +// ------------------------------------------------------------------------------------------------ +void IRRImporter::BuildSkybox(std::vector& meshes, std::vector materials) +{ + // Update the material of the skybox - replace the name and disable shading for skyboxes. + for (unsigned int i = 0; i < 6;++i) { + aiMaterial* out = ( aiMaterial* ) (*(materials.end()-(6-i))); + + aiString s; + s.length = ::ai_snprintf( s.data, MAXLEN, "SkyboxSide_%u",i ); + out->AddProperty(&s,AI_MATKEY_NAME); + + int shading = aiShadingMode_NoShading; + out->AddProperty(&shading,1,AI_MATKEY_SHADING_MODEL); + } + + // Skyboxes are much more difficult. They are represented + // by six single planes with different textures, so we'll + // need to build six meshes. + + const ai_real l = 10.0; // the size used by Irrlicht + + // FRONT SIDE + meshes.push_back( BuildSingleQuadMesh( + SkyboxVertex(-l,-l,-l, 0, 0, 1, 1.0,1.0), + SkyboxVertex( l,-l,-l, 0, 0, 1, 0.0,1.0), + SkyboxVertex( l, l,-l, 0, 0, 1, 0.0,0.0), + SkyboxVertex(-l, l,-l, 0, 0, 1, 1.0,0.0)) ); + meshes.back()->mMaterialIndex = static_cast(materials.size()-6u); + + // LEFT SIDE + meshes.push_back( BuildSingleQuadMesh( + SkyboxVertex( l,-l,-l, -1, 0, 0, 1.0,1.0), + SkyboxVertex( l,-l, l, -1, 0, 0, 0.0,1.0), + SkyboxVertex( l, l, l, -1, 0, 0, 0.0,0.0), + SkyboxVertex( l, l,-l, -1, 0, 0, 1.0,0.0)) ); + meshes.back()->mMaterialIndex = static_cast(materials.size()-5u); + + // BACK SIDE + meshes.push_back( BuildSingleQuadMesh( + SkyboxVertex( l,-l, l, 0, 0, -1, 1.0,1.0), + SkyboxVertex(-l,-l, l, 0, 0, -1, 0.0,1.0), + SkyboxVertex(-l, l, l, 0, 0, -1, 0.0,0.0), + SkyboxVertex( l, l, l, 0, 0, -1, 1.0,0.0)) ); + meshes.back()->mMaterialIndex = static_cast(materials.size()-4u); + + // RIGHT SIDE + meshes.push_back( BuildSingleQuadMesh( + SkyboxVertex(-l,-l, l, 1, 0, 0, 1.0,1.0), + SkyboxVertex(-l,-l,-l, 1, 0, 0, 0.0,1.0), + SkyboxVertex(-l, l,-l, 1, 0, 0, 0.0,0.0), + SkyboxVertex(-l, l, l, 1, 0, 0, 1.0,0.0)) ); + meshes.back()->mMaterialIndex = static_cast(materials.size()-3u); + + // TOP SIDE + meshes.push_back( BuildSingleQuadMesh( + SkyboxVertex( l, l,-l, 0, -1, 0, 1.0,1.0), + SkyboxVertex( l, l, l, 0, -1, 0, 0.0,1.0), + SkyboxVertex(-l, l, l, 0, -1, 0, 0.0,0.0), + SkyboxVertex(-l, l,-l, 0, -1, 0, 1.0,0.0)) ); + meshes.back()->mMaterialIndex = static_cast(materials.size()-2u); + + // BOTTOM SIDE + meshes.push_back( BuildSingleQuadMesh( + SkyboxVertex( l,-l, l, 0, 1, 0, 0.0,0.0), + SkyboxVertex( l,-l,-l, 0, 1, 0, 1.0,0.0), + SkyboxVertex(-l,-l,-l, 0, 1, 0, 1.0,1.0), + SkyboxVertex(-l,-l, l, 0, 1, 0, 0.0,1.0)) ); + meshes.back()->mMaterialIndex = static_cast(materials.size()-1u); +} + +// ------------------------------------------------------------------------------------------------ +void IRRImporter::CopyMaterial(std::vector& materials, + std::vector< std::pair >& inmaterials, + unsigned int& defMatIdx, + aiMesh* mesh) +{ + if (inmaterials.empty()) { + // Do we have a default material? If not we need to create one + if (UINT_MAX == defMatIdx) + { + defMatIdx = (unsigned int)materials.size(); + //TODO: add this materials to someone? + /*aiMaterial* mat = new aiMaterial(); + + aiString s; + s.Set(AI_DEFAULT_MATERIAL_NAME); + mat->AddProperty(&s,AI_MATKEY_NAME); + + aiColor3D c(0.6f,0.6f,0.6f); + mat->AddProperty(&c,1,AI_MATKEY_COLOR_DIFFUSE);*/ + } + mesh->mMaterialIndex = defMatIdx; + return; + } + else if (inmaterials.size() > 1) { + ASSIMP_LOG_INFO("IRR: Skipping additional materials"); + } + + mesh->mMaterialIndex = (unsigned int)materials.size(); + materials.push_back(inmaterials[0].first); +} + + +// ------------------------------------------------------------------------------------------------ +inline +int ClampSpline(int idx, int size) { + return ( idx<0 ? size+idx : ( idx>=size ? idx-size : idx ) ); +} + +// ------------------------------------------------------------------------------------------------ +inline void FindSuitableMultiple(int& angle) +{ + if (angle < 3) angle = 3; + else if (angle < 10) angle = 10; + else if (angle < 20) angle = 20; + else if (angle < 30) angle = 30; +} + +// ------------------------------------------------------------------------------------------------ +void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector& anims) +{ + ai_assert(nullptr != root && nullptr != real); + + // XXX totally WIP - doesn't produce proper results, need to evaluate + // whether there's any use for Irrlicht's proprietary scene format + // outside Irrlicht ... + // This also applies to the above function of FindSuitableMultiple and ClampSpline which are + // solely used in this function + + if (root->animators.empty()) { + return; + } + unsigned int total( 0 ); + for (std::list::iterator it = root->animators.begin();it != root->animators.end(); ++it) { + if ((*it).type == Animator::UNKNOWN || (*it).type == Animator::OTHER) { + ASSIMP_LOG_WARN("IRR: Skipping unknown or unsupported animator"); + continue; + } + ++total; + } + if (!total) { + return; + } else if (1 == total) { + ASSIMP_LOG_WARN("IRR: Adding dummy nodes to simulate multiple animators"); + } + + // NOTE: 1 tick == i millisecond + + unsigned int cur = 0; + for (std::list::iterator it = root->animators.begin(); + it != root->animators.end(); ++it) + { + if ((*it).type == Animator::UNKNOWN || (*it).type == Animator::OTHER)continue; + + Animator& in = *it ; + aiNodeAnim* anim = new aiNodeAnim(); + + if (cur != total-1) { + // Build a new name - a prefix instead of a suffix because it is + // easier to check against + anim->mNodeName.length = ::ai_snprintf(anim->mNodeName.data, MAXLEN, + "$INST_DUMMY_%i_%s",total-1, + (root->name.length() ? root->name.c_str() : "")); + + // we'll also need to insert a dummy in the node hierarchy. + aiNode* dummy = new aiNode(); + + for (unsigned int i = 0; i < real->mParent->mNumChildren;++i) + if (real->mParent->mChildren[i] == real) + real->mParent->mChildren[i] = dummy; + + dummy->mParent = real->mParent; + dummy->mName = anim->mNodeName; + + dummy->mNumChildren = 1; + dummy->mChildren = new aiNode*[dummy->mNumChildren]; + dummy->mChildren[0] = real; + + // the transformation matrix of the dummy node is the identity + + real->mParent = dummy; + } + else anim->mNodeName.Set(root->name); + ++cur; + + switch (in.type) { + case Animator::ROTATION: + { + // ----------------------------------------------------- + // find out how long a full rotation will take + // This is the least common multiple of 360.f and all + // three euler angles. Although we'll surely find a + // possible multiple (haha) it could be somewhat large + // for our purposes. So we need to modify the angles + // here in order to get good results. + // ----------------------------------------------------- + int angles[3]; + angles[0] = (int)(in.direction.x*100); + angles[1] = (int)(in.direction.y*100); + angles[2] = (int)(in.direction.z*100); + + angles[0] %= 360; + angles[1] %= 360; + angles[2] %= 360; + + if ( (angles[0]*angles[1]) != 0 && (angles[1]*angles[2]) != 0 ) + { + FindSuitableMultiple(angles[0]); + FindSuitableMultiple(angles[1]); + FindSuitableMultiple(angles[2]); + } + + int lcm = 360; + + if (angles[0]) + lcm = Math::lcm(lcm,angles[0]); + + if (angles[1]) + lcm = Math::lcm(lcm,angles[1]); + + if (angles[2]) + lcm = Math::lcm(lcm,angles[2]); + + if (360 == lcm) + break; + +#if 0 + // This can be a division through zero, but we don't care + float f1 = (float)lcm / angles[0]; + float f2 = (float)lcm / angles[1]; + float f3 = (float)lcm / angles[2]; +#endif + + // find out how many time units we'll need for the finest + // track (in seconds) - this defines the number of output + // keys (fps * seconds) + float max = 0.f; + if (angles[0]) + max = (float)lcm / angles[0]; + if (angles[1]) + max = std::max(max, (float)lcm / angles[1]); + if (angles[2]) + max = std::max(max, (float)lcm / angles[2]); + + anim->mNumRotationKeys = (unsigned int)(max*fps); + anim->mRotationKeys = new aiQuatKey[anim->mNumRotationKeys]; + + // begin with a zero angle + aiVector3D angle; + for (unsigned int i = 0; i < anim->mNumRotationKeys;++i) + { + // build the quaternion for the given euler angles + aiQuatKey& q = anim->mRotationKeys[i]; + + q.mValue = aiQuaternion(angle.x, angle.y, angle.z); + q.mTime = (double)i; + + // increase the angle + angle += in.direction; + } + + // This animation is repeated and repeated ... + anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT; + } + break; + + case Animator::FLY_CIRCLE: + { + // ----------------------------------------------------- + // Find out how much time we'll need to perform a + // full circle. + // ----------------------------------------------------- + const double seconds = (1. / in.speed) / 1000.; + const double tdelta = 1000. / fps; + + anim->mNumPositionKeys = (unsigned int) (fps * seconds); + anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys]; + + // from Irrlicht, what else should we do than copying it? + aiVector3D vecU,vecV; + if (in.direction.y) { + vecV = aiVector3D(50,0,0) ^ in.direction; + } + else vecV = aiVector3D(0,50,00) ^ in.direction; + vecV.Normalize(); + vecU = (vecV ^ in.direction).Normalize(); + + // build the output keys + for (unsigned int i = 0; i < anim->mNumPositionKeys;++i) { + aiVectorKey& key = anim->mPositionKeys[i]; + key.mTime = i * tdelta; + + const ai_real t = (ai_real) ( in.speed * key.mTime ); + key.mValue = in.circleCenter + in.circleRadius * ((vecU * std::cos(t)) + (vecV * std::sin(t))); + } + + // This animation is repeated and repeated ... + anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT; + } + break; + + case Animator::FLY_STRAIGHT: + { + anim->mPostState = anim->mPreState = (in.loop ? aiAnimBehaviour_REPEAT : aiAnimBehaviour_CONSTANT); + const double seconds = in.timeForWay / 1000.; + const double tdelta = 1000. / fps; + + anim->mNumPositionKeys = (unsigned int) (fps * seconds); + anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys]; + + aiVector3D diff = in.direction - in.circleCenter; + const ai_real lengthOfWay = diff.Length(); + diff.Normalize(); + + const double timeFactor = lengthOfWay / in.timeForWay; + + // build the output keys + for (unsigned int i = 0; i < anim->mNumPositionKeys;++i) { + aiVectorKey& key = anim->mPositionKeys[i]; + key.mTime = i * tdelta; + key.mValue = in.circleCenter + diff * ai_real(timeFactor * key.mTime); + } + } + break; + + case Animator::FOLLOW_SPLINE: + { + // repeat outside the defined time range + anim->mPostState = anim->mPreState = aiAnimBehaviour_REPEAT; + const int size = (int)in.splineKeys.size(); + if (!size) { + // We have no point in the spline. That's bad. Really bad. + ASSIMP_LOG_WARN("IRR: Spline animators with no points defined"); + + delete anim; + anim = nullptr; + break; + } + else if (size == 1) { + // We have just one point in the spline so we don't need the full calculation + anim->mNumPositionKeys = 1; + anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys]; + + anim->mPositionKeys[0].mValue = in.splineKeys[0].mValue; + anim->mPositionKeys[0].mTime = 0.f; + break; + } + + unsigned int ticksPerFull = 15; + anim->mNumPositionKeys = (unsigned int) ( ticksPerFull * fps ); + anim->mPositionKeys = new aiVectorKey[anim->mNumPositionKeys]; + + for (unsigned int i = 0; i < anim->mNumPositionKeys;++i) + { + aiVectorKey& key = anim->mPositionKeys[i]; + + const ai_real dt = (i * in.speed * ai_real( 0.001 ) ); + const ai_real u = dt - std::floor(dt); + const int idx = (int)std::floor(dt) % size; + + // get the 4 current points to evaluate the spline + const aiVector3D& p0 = in.splineKeys[ ClampSpline( idx - 1, size ) ].mValue; + const aiVector3D& p1 = in.splineKeys[ ClampSpline( idx + 0, size ) ].mValue; + const aiVector3D& p2 = in.splineKeys[ ClampSpline( idx + 1, size ) ].mValue; + const aiVector3D& p3 = in.splineKeys[ ClampSpline( idx + 2, size ) ].mValue; + + // compute polynomials + const ai_real u2 = u*u; + const ai_real u3 = u2*2; + + const ai_real h1 = ai_real( 2.0 ) * u3 - ai_real( 3.0 ) * u2 + ai_real( 1.0 ); + const ai_real h2 = ai_real( -2.0 ) * u3 + ai_real( 3.0 ) * u3; + const ai_real h3 = u3 - ai_real( 2.0 ) * u3; + const ai_real h4 = u3 - u2; + + // compute the spline tangents + const aiVector3D t1 = ( p2 - p0 ) * in.tightness; + aiVector3D t2 = ( p3 - p1 ) * in.tightness; + + // and use them to get the interpolated point + t2 = (h1 * p1 + p2 * h2 + t1 * h3 + h4 * t2); + + // build a simple translation matrix from it + key.mValue = t2; + key.mTime = (double) i; + } + } + break; + default: + // UNKNOWN , OTHER + break; + }; + if (anim) { + anims.push_back(anim); + ++total; + } + } +} + +// ------------------------------------------------------------------------------------------------ +// This function is maybe more generic than we'd need it here +void SetupMapping (aiMaterial* mat, aiTextureMapping mode, const aiVector3D& axis = aiVector3D(0.f,0.f,-1.f)) +{ + // Check whether there are texture properties defined - setup + // the desired texture mapping mode for all of them and ignore + // all UV settings we might encounter. WE HAVE NO UVS! + + std::vector p; + p.reserve(mat->mNumProperties+1); + + for (unsigned int i = 0; i < mat->mNumProperties;++i) + { + aiMaterialProperty* prop = mat->mProperties[i]; + if (!::strcmp( prop->mKey.data, "$tex.file")) { + // Setup the mapping key + aiMaterialProperty* m = new aiMaterialProperty(); + m->mKey.Set("$tex.mapping"); + m->mIndex = prop->mIndex; + m->mSemantic = prop->mSemantic; + m->mType = aiPTI_Integer; + + m->mDataLength = 4; + m->mData = new char[4]; + *((int*)m->mData) = mode; + + p.push_back(prop); + p.push_back(m); + + // Setup the mapping axis + if (mode == aiTextureMapping_CYLINDER || mode == aiTextureMapping_PLANE || mode == aiTextureMapping_SPHERE) { + m = new aiMaterialProperty(); + m->mKey.Set("$tex.mapaxis"); + m->mIndex = prop->mIndex; + m->mSemantic = prop->mSemantic; + m->mType = aiPTI_Float; + + m->mDataLength = 12; + m->mData = new char[12]; + *((aiVector3D*)m->mData) = axis; + p.push_back(m); + } + } + else if (! ::strcmp( prop->mKey.data, "$tex.uvwsrc")) { + delete mat->mProperties[i]; + } + else p.push_back(prop); + } + + if (p.empty())return; + + // rebuild the output array + if (p.size() > mat->mNumAllocated) { + delete[] mat->mProperties; + mat->mProperties = new aiMaterialProperty*[p.size()*2]; + + mat->mNumAllocated = static_cast(p.size()*2); + } + mat->mNumProperties = (unsigned int)p.size(); + ::memcpy(mat->mProperties,&p[0],sizeof(void*)*mat->mNumProperties); +} + +// ------------------------------------------------------------------------------------------------ +void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene, + BatchLoader& batch, + std::vector& meshes, + std::vector& anims, + std::vector& attach, + std::vector& materials, + unsigned int& defMatIdx) +{ + unsigned int oldMeshSize = (unsigned int)meshes.size(); + //unsigned int meshTrafoAssign = 0; + + // Now determine the type of the node + switch (root->type) + { + case Node::ANIMMESH: + case Node::MESH: + { + if (!root->meshPath.length()) + break; + + // Get the loaded mesh from the scene and add it to + // the list of all scenes to be attached to the + // graph we're currently building + aiScene* localScene = batch.GetImport(root->id); + if (!localScene) { + ASSIMP_LOG_ERROR("IRR: Unable to load external file: " + root->meshPath); + break; + } + attach.push_back(AttachmentInfo(localScene,rootOut)); + + // Now combine the material we've loaded for this mesh + // with the real materials we got from the file. As we + // don't execute any pp-steps on the file, the numbers + // should be equal. If they are not, we can impossibly + // do this ... + if (root->materials.size() != (unsigned int)localScene->mNumMaterials) { + ASSIMP_LOG_WARN("IRR: Failed to match imported materials " + "with the materials found in the IRR scene file"); + + break; + } + for (unsigned int i = 0; i < localScene->mNumMaterials;++i) { + // Delete the old material, we don't need it anymore + delete localScene->mMaterials[i]; + + std::pair& src = root->materials[i]; + localScene->mMaterials[i] = src.first; + } + + // NOTE: Each mesh should have exactly one material assigned, + // but we do it in a separate loop if this behaviour changes + // in future. + for (unsigned int i = 0; i < localScene->mNumMeshes;++i) { + // Process material flags + aiMesh* mesh = localScene->mMeshes[i]; + + + // If "trans_vertex_alpha" mode is enabled, search all vertex colors + // and check whether they have a common alpha value. This is quite + // often the case so we can simply extract it to a shared oacity + // value. + std::pair& src = root->materials[mesh->mMaterialIndex]; + aiMaterial* mat = (aiMaterial*)src.first; + + if (mesh->HasVertexColors(0) && src.second & AI_IRRMESH_MAT_trans_vertex_alpha) + { + bool bdo = true; + for (unsigned int a = 1; a < mesh->mNumVertices;++a) { + + if (mesh->mColors[0][a].a != mesh->mColors[0][a-1].a) { + bdo = false; + break; + } + } + if (bdo) { + ASSIMP_LOG_INFO("IRR: Replacing mesh vertex alpha with common opacity"); + + for (unsigned int a = 0; a < mesh->mNumVertices;++a) + mesh->mColors[0][a].a = 1.f; + + mat->AddProperty(& mesh->mColors[0][0].a, 1, AI_MATKEY_OPACITY); + } + } + + // If we have a second texture coordinate set and a second texture + // (either lightmap, normalmap, 2layered material) we need to + // setup the correct UV index for it. The texture can either + // be diffuse (lightmap & 2layer) or a normal map (normal & parallax) + if (mesh->HasTextureCoords(1)) { + + int idx = 1; + if (src.second & (AI_IRRMESH_MAT_solid_2layer | AI_IRRMESH_MAT_lightmap)) { + mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_DIFFUSE(0)); + } + else if (src.second & AI_IRRMESH_MAT_normalmap_solid) { + mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_NORMALS(0)); + } + } + } + } + break; + + case Node::LIGHT: + case Node::CAMERA: + + // We're already finished with lights and cameras + break; + + + case Node::SPHERE: + { + // Generate the sphere model. Our input parameter to + // the sphere generation algorithm is the number of + // subdivisions of each triangle - but here we have + // the number of poylgons on a specific axis. Just + // use some hardcoded limits to approximate this ... + unsigned int mul = root->spherePolyCountX*root->spherePolyCountY; + if (mul < 100)mul = 2; + else if (mul < 300)mul = 3; + else mul = 4; + + meshes.push_back(StandardShapes::MakeMesh(mul, + &StandardShapes::MakeSphere)); + + // Adjust scaling + root->scaling *= root->sphereRadius/2; + + // Copy one output material + CopyMaterial(materials, root->materials, defMatIdx, meshes.back()); + + // Now adjust this output material - if there is a first texture + // set, setup spherical UV mapping around the Y axis. + SetupMapping ( (aiMaterial*) materials.back(), aiTextureMapping_SPHERE); + } + break; + + case Node::CUBE: + { + // Generate an unit cube first + meshes.push_back(StandardShapes::MakeMesh( + &StandardShapes::MakeHexahedron)); + + // Adjust scaling + root->scaling *= root->sphereRadius; + + // Copy one output material + CopyMaterial(materials, root->materials, defMatIdx, meshes.back()); + + // Now adjust this output material - if there is a first texture + // set, setup cubic UV mapping + SetupMapping ( (aiMaterial*) materials.back(), aiTextureMapping_BOX ); + } + break; + + + case Node::SKYBOX: + { + // A skybox is defined by six materials + if (root->materials.size() < 6) { + ASSIMP_LOG_ERROR("IRR: There should be six materials for a skybox"); + break; + } + + // copy those materials and generate 6 meshes for our new skybox + materials.reserve(materials.size() + 6); + for (unsigned int i = 0; i < 6;++i) + materials.insert(materials.end(),root->materials[i].first); + + BuildSkybox(meshes,materials); + + // ************************************************************* + // Skyboxes will require a different code path for rendering, + // so there must be a way for the user to add special support + // for IRR skyboxes. We add a 'IRR.SkyBox_' prefix to the node. + // ************************************************************* + root->name = "IRR.SkyBox_" + root->name; + ASSIMP_LOG_INFO("IRR: Loading skybox, this will " + "require special handling to be displayed correctly"); + } + break; + + case Node::TERRAIN: + { + // to support terrains, we'd need to have a texture decoder + ASSIMP_LOG_ERROR("IRR: Unsupported node - TERRAIN"); + } + break; + default: + // DUMMY + break; + }; + + // Check whether we added a mesh (or more than one ...). In this case + // we'll also need to attach it to the node + if (oldMeshSize != (unsigned int) meshes.size()) { + + rootOut->mNumMeshes = (unsigned int)meshes.size() - oldMeshSize; + rootOut->mMeshes = new unsigned int[rootOut->mNumMeshes]; + + for (unsigned int a = 0; a < rootOut->mNumMeshes;++a) { + rootOut->mMeshes[a] = oldMeshSize+a; + } + } + + // Setup the name of this node + rootOut->mName.Set(root->name); + + // Now compute the final local transformation matrix of the + // node from the given translation, rotation and scaling values. + // (the rotation is given in Euler angles, XYZ order) + //std::swap((float&)root->rotation.z,(float&)root->rotation.y); + rootOut->mTransformation.FromEulerAnglesXYZ(AI_DEG_TO_RAD(root->rotation) ); + + // apply scaling + aiMatrix4x4& mat = rootOut->mTransformation; + mat.a1 *= root->scaling.x; + mat.b1 *= root->scaling.x; + mat.c1 *= root->scaling.x; + mat.a2 *= root->scaling.y; + mat.b2 *= root->scaling.y; + mat.c2 *= root->scaling.y; + mat.a3 *= root->scaling.z; + mat.b3 *= root->scaling.z; + mat.c3 *= root->scaling.z; + + // apply translation + mat.a4 += root->position.x; + mat.b4 += root->position.y; + mat.c4 += root->position.z; + + // now compute animations for the node + ComputeAnimations(root,rootOut, anims); + + // Add all children recursively. First allocate enough storage + // for them, then call us again + rootOut->mNumChildren = (unsigned int)root->children.size(); + if (rootOut->mNumChildren) { + + rootOut->mChildren = new aiNode*[rootOut->mNumChildren]; + for (unsigned int i = 0; i < rootOut->mNumChildren;++i) { + + aiNode* node = rootOut->mChildren[i] = new aiNode(); + node->mParent = rootOut; + GenerateGraph(root->children[i],node,scene,batch,meshes, + anims,attach,materials,defMatIdx); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Imports the given file into the given scene structure. +void IRRImporter::InternReadFile( const std::string& pFile, + aiScene* pScene, IOSystem* pIOHandler) +{ + std::unique_ptr file( pIOHandler->Open( pFile)); + + // Check whether we can read from the file + if (file.get() == nullptr) { + throw DeadlyImportError("Failed to open IRR file " + pFile + ""); + } + + // Construct the irrXML parser + CIrrXML_IOStreamReader st(file.get()); + reader = createIrrXMLReader((IFileReadCallBack*) &st); + + // The root node of the scene + Node* root = new Node(Node::DUMMY); + root->parent = nullptr; + root->name = ""; + + // Current node parent + Node* curParent = root; + + // Scenegraph node we're currently working on + Node* curNode = nullptr; + + // List of output cameras + std::vector cameras; + + // List of output lights + std::vector lights; + + // Batch loader used to load external models + BatchLoader batch(pIOHandler); +// batch.SetBasePath(pFile); + + cameras.reserve(5); + lights.reserve(5); + + bool inMaterials = false, inAnimator = false; + unsigned int guessedAnimCnt = 0, guessedMeshCnt = 0, guessedMatCnt = 0; + + // Parse the XML file + while (reader->read()) { + switch (reader->getNodeType()) { + case EXN_ELEMENT: + + if (!ASSIMP_stricmp(reader->getNodeName(),"node")) { + // *********************************************************************** + /* What we're going to do with the node depends + * on its type: + * + * "mesh" - Load a mesh from an external file + * "cube" - Generate a cube + * "skybox" - Generate a skybox + * "light" - A light source + * "sphere" - Generate a sphere mesh + * "animatedMesh" - Load an animated mesh from an external file + * and join its animation channels with ours. + * "empty" - A dummy node + * "camera" - A camera + * "terrain" - a terrain node (data comes from a heightmap) + * "billboard", "" + * + * Each of these nodes can be animated and all can have multiple + * materials assigned (except lights, cameras and dummies, of course). + */ + // *********************************************************************** + const char* sz = reader->getAttributeValueSafe("type"); + Node* nd; + if (!ASSIMP_stricmp(sz,"mesh") || !ASSIMP_stricmp(sz,"octTree")) { + // OctTree's and meshes are treated equally + nd = new Node(Node::MESH); + } + else if (!ASSIMP_stricmp(sz,"cube")) { + nd = new Node(Node::CUBE); + ++guessedMeshCnt; + // meshes.push_back(StandardShapes::MakeMesh(&StandardShapes::MakeHexahedron)); + } + else if (!ASSIMP_stricmp(sz,"skybox")) { + nd = new Node(Node::SKYBOX); + guessedMeshCnt += 6; + } + else if (!ASSIMP_stricmp(sz,"camera")) { + nd = new Node(Node::CAMERA); + + // Setup a temporary name for the camera + aiCamera* cam = new aiCamera(); + cam->mName.Set( nd->name ); + cameras.push_back(cam); + } + else if (!ASSIMP_stricmp(sz,"light")) { + nd = new Node(Node::LIGHT); + + // Setup a temporary name for the light + aiLight* cam = new aiLight(); + cam->mName.Set( nd->name ); + lights.push_back(cam); + } + else if (!ASSIMP_stricmp(sz,"sphere")) { + nd = new Node(Node::SPHERE); + ++guessedMeshCnt; + } + else if (!ASSIMP_stricmp(sz,"animatedMesh")) { + nd = new Node(Node::ANIMMESH); + } + else if (!ASSIMP_stricmp(sz,"empty")) { + nd = new Node(Node::DUMMY); + } + else if (!ASSIMP_stricmp(sz,"terrain")) { + nd = new Node(Node::TERRAIN); + } + else if (!ASSIMP_stricmp(sz,"billBoard")) { + // We don't support billboards, so ignore them + ASSIMP_LOG_ERROR("IRR: Billboards are not supported by Assimp"); + nd = new Node(Node::DUMMY); + } + else { + ASSIMP_LOG_WARN("IRR: Found unknown node: " + std::string(sz)); + + /* We skip the contents of nodes we don't know. + * We parse the transformation and all animators + * and skip the rest. + */ + nd = new Node(Node::DUMMY); + } + + /* Attach the newly created node to the scenegraph + */ + curNode = nd; + nd->parent = curParent; + curParent->children.push_back(nd); + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"materials")) { + inMaterials = true; + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"animators")) { + inAnimator = true; + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"attributes")) { + /* We should have a valid node here + * FIX: no ... the scene root node is also contained in an attributes block + */ + if (!curNode) { +#if 0 + ASSIMP_LOG_ERROR("IRR: Encountered element, but " + "there is no node active"); +#endif + continue; + } + + Animator* curAnim = nullptr; + + // Materials can occur for nearly any type of node + if (inMaterials && curNode->type != Node::DUMMY) { + /* This is a material description - parse it! + */ + curNode->materials.push_back(std::pair< aiMaterial*, unsigned int > () ); + std::pair< aiMaterial*, unsigned int >& p = curNode->materials.back(); + + p.first = ParseMaterial(p.second); + + ++guessedMatCnt; + continue; + } + else if (inAnimator) { + /* This is an animation path - add a new animator + * to the list. + */ + curNode->animators.push_back(Animator()); + curAnim = & curNode->animators.back(); + + ++guessedAnimCnt; + } + + /* Parse all elements in the attributes block + * and process them. + */ + while (reader->read()) { + if (reader->getNodeType() == EXN_ELEMENT) { + if (!ASSIMP_stricmp(reader->getNodeName(),"vector3d")) { + VectorProperty prop; + ReadVectorProperty(prop); + + if (inAnimator) { + if (curAnim->type == Animator::ROTATION && prop.name == "Rotation") { + // We store the rotation euler angles in 'direction' + curAnim->direction = prop.value; + } + else if (curAnim->type == Animator::FOLLOW_SPLINE) { + // Check whether the vector follows the PointN naming scheme, + // here N is the ONE-based index of the point + if (prop.name.length() >= 6 && prop.name.substr(0,5) == "Point") { + // Add a new key to the list + curAnim->splineKeys.push_back(aiVectorKey()); + aiVectorKey& key = curAnim->splineKeys.back(); + + // and parse its properties + key.mValue = prop.value; + key.mTime = strtoul10(&prop.name[5]); + } + } + else if (curAnim->type == Animator::FLY_CIRCLE) { + if (prop.name == "Center") { + curAnim->circleCenter = prop.value; + } + else if (prop.name == "Direction") { + curAnim->direction = prop.value; + + // From Irrlicht's source - a workaround for backward compatibility with Irrlicht 1.1 + if (curAnim->direction == aiVector3D()) { + curAnim->direction = aiVector3D(0.f,1.f,0.f); + } + else curAnim->direction.Normalize(); + } + } + else if (curAnim->type == Animator::FLY_STRAIGHT) { + if (prop.name == "Start") { + // We reuse the field here + curAnim->circleCenter = prop.value; + } + else if (prop.name == "End") { + // We reuse the field here + curAnim->direction = prop.value; + } + } + } + else { + if (prop.name == "Position") { + curNode->position = prop.value; + } + else if (prop.name == "Rotation") { + curNode->rotation = prop.value; + } + else if (prop.name == "Scale") { + curNode->scaling = prop.value; + } + else if (Node::CAMERA == curNode->type) + { + aiCamera* cam = cameras.back(); + if (prop.name == "Target") { + cam->mLookAt = prop.value; + } + else if (prop.name == "UpVector") { + cam->mUp = prop.value; + } + } + } + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"bool")) { + BoolProperty prop; + ReadBoolProperty(prop); + + if (inAnimator && curAnim->type == Animator::FLY_CIRCLE && prop.name == "Loop") { + curAnim->loop = prop.value; + } + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"float")) { + FloatProperty prop; + ReadFloatProperty(prop); + + if (inAnimator) { + // The speed property exists for several animators + if (prop.name == "Speed") { + curAnim->speed = prop.value; + } + else if (curAnim->type == Animator::FLY_CIRCLE && prop.name == "Radius") { + curAnim->circleRadius = prop.value; + } + else if (curAnim->type == Animator::FOLLOW_SPLINE && prop.name == "Tightness") { + curAnim->tightness = prop.value; + } + } + else { + if (prop.name == "FramesPerSecond" && Node::ANIMMESH == curNode->type) { + curNode->framesPerSecond = prop.value; + } + else if (Node::CAMERA == curNode->type) { + /* This is the vertical, not the horizontal FOV. + * We need to compute the right FOV from the + * screen aspect which we don't know yet. + */ + if (prop.name == "Fovy") { + cameras.back()->mHorizontalFOV = prop.value; + } + else if (prop.name == "Aspect") { + cameras.back()->mAspect = prop.value; + } + else if (prop.name == "ZNear") { + cameras.back()->mClipPlaneNear = prop.value; + } + else if (prop.name == "ZFar") { + cameras.back()->mClipPlaneFar = prop.value; + } + } + else if (Node::LIGHT == curNode->type) { + /* Additional light information + */ + if (prop.name == "Attenuation") { + lights.back()->mAttenuationLinear = prop.value; + } + else if (prop.name == "OuterCone") { + lights.back()->mAngleOuterCone = AI_DEG_TO_RAD( prop.value ); + } + else if (prop.name == "InnerCone") { + lights.back()->mAngleInnerCone = AI_DEG_TO_RAD( prop.value ); + } + } + // radius of the sphere to be generated - + // or alternatively, size of the cube + else if ((Node::SPHERE == curNode->type && prop.name == "Radius") + || (Node::CUBE == curNode->type && prop.name == "Size" )) { + + curNode->sphereRadius = prop.value; + } + } + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"int")) { + IntProperty prop; + ReadIntProperty(prop); + + if (inAnimator) { + if (curAnim->type == Animator::FLY_STRAIGHT && prop.name == "TimeForWay") { + curAnim->timeForWay = prop.value; + } + } + else { + // sphere polgon numbers in each direction + if (Node::SPHERE == curNode->type) { + + if (prop.name == "PolyCountX") { + curNode->spherePolyCountX = prop.value; + } + else if (prop.name == "PolyCountY") { + curNode->spherePolyCountY = prop.value; + } + } + } + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"string") ||!ASSIMP_stricmp(reader->getNodeName(),"enum")) { + StringProperty prop; + ReadStringProperty(prop); + if (prop.value.length()) { + if (prop.name == "Name") { + curNode->name = prop.value; + + /* If we're either a camera or a light source + * we need to update the name in the aiLight/ + * aiCamera structure, too. + */ + if (Node::CAMERA == curNode->type) { + cameras.back()->mName.Set(prop.value); + } + else if (Node::LIGHT == curNode->type) { + lights.back()->mName.Set(prop.value); + } + } + else if (Node::LIGHT == curNode->type && "LightType" == prop.name) + { + if (prop.value == "Spot") + lights.back()->mType = aiLightSource_SPOT; + else if (prop.value == "Point") + lights.back()->mType = aiLightSource_POINT; + else if (prop.value == "Directional") + lights.back()->mType = aiLightSource_DIRECTIONAL; + else + { + // We won't pass the validation with aiLightSourceType_UNDEFINED, + // so we remove the light and replace it with a silly dummy node + delete lights.back(); + lights.pop_back(); + curNode->type = Node::DUMMY; + + ASSIMP_LOG_ERROR("Ignoring light of unknown type: " + prop.value); + } + } + else if ((prop.name == "Mesh" && Node::MESH == curNode->type) || + Node::ANIMMESH == curNode->type) + { + /* This is the file name of the mesh - either + * animated or not. We need to make sure we setup + * the correct post-processing settings here. + */ + unsigned int pp = 0; + BatchLoader::PropertyMap map; + + /* If the mesh is a static one remove all animations from the impor data + */ + if (Node::ANIMMESH != curNode->type) { + pp |= aiProcess_RemoveComponent; + SetGenericProperty(map.ints,AI_CONFIG_PP_RVC_FLAGS, + aiComponent_ANIMATIONS | aiComponent_BONEWEIGHTS); + } + + /* TODO: maybe implement the protection against recursive + * loading calls directly in BatchLoader? The current + * implementation is not absolutely safe. A LWS and an IRR + * file referencing each other *could* cause the system to + * recurse forever. + */ + + const std::string extension = GetExtension(prop.value); + if ("irr" == extension) { + ASSIMP_LOG_ERROR("IRR: Can't load another IRR file recursively"); + } + else + { + curNode->id = batch.AddLoadRequest(prop.value,pp,&map); + curNode->meshPath = prop.value; + } + } + else if (inAnimator && prop.name == "Type") + { + // type of the animator + if (prop.value == "rotation") { + curAnim->type = Animator::ROTATION; + } + else if (prop.value == "flyCircle") { + curAnim->type = Animator::FLY_CIRCLE; + } + else if (prop.value == "flyStraight") { + curAnim->type = Animator::FLY_CIRCLE; + } + else if (prop.value == "followSpline") { + curAnim->type = Animator::FOLLOW_SPLINE; + } + else { + ASSIMP_LOG_WARN("IRR: Ignoring unknown animator: " + + prop.value); + + curAnim->type = Animator::UNKNOWN; + } + } + } + } + } + else if (reader->getNodeType() == EXN_ELEMENT_END && !ASSIMP_stricmp(reader->getNodeName(),"attributes")) { + break; + } + } + } + break; + + case EXN_ELEMENT_END: + + // If we reached the end of a node, we need to continue processing its parent + if (!ASSIMP_stricmp(reader->getNodeName(),"node")) { + if (!curNode) { + // currently is no node set. We need to go + // back in the node hierarchy + if (!curParent) { + curParent = root; + ASSIMP_LOG_ERROR("IRR: Too many closing elements"); + } + else curParent = curParent->parent; + } + else curNode = nullptr; + } + // clear all flags + else if (!ASSIMP_stricmp(reader->getNodeName(),"materials")) { + inMaterials = false; + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"animators")) { + inAnimator = false; + } + break; + + default: + // GCC complains that not all enumeration values are handled + break; + } + } + + // Now iterate through all cameras and compute their final (horizontal) FOV + for (aiCamera *cam : cameras) { + // screen aspect could be missing + if (cam->mAspect) { + cam->mHorizontalFOV *= cam->mAspect; + } else { + ASSIMP_LOG_WARN("IRR: Camera aspect is not given, can't compute horizontal FOV"); + } + } + + batch.LoadAll(); + + /* Allocate a tempoary scene data structure + */ + aiScene* tempScene = new aiScene(); + tempScene->mRootNode = new aiNode(); + tempScene->mRootNode->mName.Set(""); + + /* Copy the cameras to the output array + */ + if (!cameras.empty()) { + tempScene->mNumCameras = (unsigned int)cameras.size(); + tempScene->mCameras = new aiCamera*[tempScene->mNumCameras]; + ::memcpy(tempScene->mCameras,&cameras[0],sizeof(void*)*tempScene->mNumCameras); + } + + /* Copy the light sources to the output array + */ + if (!lights.empty()) { + tempScene->mNumLights = (unsigned int)lights.size(); + tempScene->mLights = new aiLight*[tempScene->mNumLights]; + ::memcpy(tempScene->mLights,&lights[0],sizeof(void*)*tempScene->mNumLights); + } + + // temporary data + std::vector< aiNodeAnim*> anims; + std::vector< aiMaterial*> materials; + std::vector< AttachmentInfo > attach; + std::vector meshes; + + // try to guess how much storage we'll need + anims.reserve (guessedAnimCnt + (guessedAnimCnt >> 2)); + meshes.reserve (guessedMeshCnt + (guessedMeshCnt >> 2)); + materials.reserve (guessedMatCnt + (guessedMatCnt >> 2)); + + /* Now process our scenegraph recursively: generate final + * meshes and generate animation channels for all nodes. + */ + unsigned int defMatIdx = UINT_MAX; + GenerateGraph(root,tempScene->mRootNode, tempScene, + batch, meshes, anims, attach, materials, defMatIdx); + + if (!anims.empty()) + { + tempScene->mNumAnimations = 1; + tempScene->mAnimations = new aiAnimation*[tempScene->mNumAnimations]; + aiAnimation* an = tempScene->mAnimations[0] = new aiAnimation(); + + // *********************************************************** + // This is only the global animation channel of the scene. + // If there are animated models, they will have separate + // animation channels in the scene. To display IRR scenes + // correctly, users will need to combine the global anim + // channel with all the local animations they want to play + // *********************************************************** + an->mName.Set("Irr_GlobalAnimChannel"); + + // copy all node animation channels to the global channel + an->mNumChannels = (unsigned int)anims.size(); + an->mChannels = new aiNodeAnim*[an->mNumChannels]; + ::memcpy(an->mChannels, & anims [0], sizeof(void*)*an->mNumChannels); + } + if (!meshes.empty()) { + // copy all meshes to the temporary scene + tempScene->mNumMeshes = (unsigned int)meshes.size(); + tempScene->mMeshes = new aiMesh*[tempScene->mNumMeshes]; + ::memcpy(tempScene->mMeshes,&meshes[0],tempScene->mNumMeshes* + sizeof(void*)); + } + + /* Copy all materials to the output array + */ + if (!materials.empty()) { + tempScene->mNumMaterials = (unsigned int)materials.size(); + tempScene->mMaterials = new aiMaterial*[tempScene->mNumMaterials]; + ::memcpy(tempScene->mMaterials,&materials[0],sizeof(void*)* + tempScene->mNumMaterials); + } + + /* Now merge all sub scenes and attach them to the correct + * attachment points in the scenegraph. + */ + SceneCombiner::MergeScenes(&pScene,tempScene,attach, + AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES | (!configSpeedFlag ? ( + AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY | AI_INT_MERGE_SCENE_GEN_UNIQUE_MATNAMES) : 0)); + + + /* If we have no meshes | no materials now set the INCOMPLETE + * scene flag. This is necessary if we failed to load all + * models from external files + */ + if (!pScene->mNumMeshes || !pScene->mNumMaterials) { + ASSIMP_LOG_WARN("IRR: No meshes loaded, setting AI_SCENE_FLAGS_INCOMPLETE"); + pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE; + } + + /* Finished ... everything destructs automatically and all + * temporary scenes have already been deleted by MergeScenes() + */ + + delete root; +} + +#endif // !! ASSIMP_BUILD_NO_IRR_IMPORTER diff --git a/Engine/lib/assimp/code/Irr/IRRLoader.h b/Engine/lib/assimp/code/Irr/IRRLoader.h new file mode 100644 index 000000000..b3ad81a7d --- /dev/null +++ b/Engine/lib/assimp/code/Irr/IRRLoader.h @@ -0,0 +1,296 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IRRLoader.h + * @brief Declaration of the .irrMesh (Irrlight Engine Mesh Format) + * importer class. + */ +#ifndef AI_IRRLOADER_H_INCLUDED +#define AI_IRRLOADER_H_INCLUDED + +#include "Irr/IRRShared.h" +#include "Common/Importer.h" + +#include +#include +#include + +namespace Assimp { + +// --------------------------------------------------------------------------- +/** Irr importer class. + * + * Irr is the native scene file format of the Irrlight engine and its editor + * irrEdit. As IrrEdit itself is capable of importing quite many file formats, + * it might be a good file format for data exchange. + */ +class IRRImporter : public BaseImporter, public IrrlichtBase { +public: + IRRImporter(); + ~IRRImporter(); + + // ------------------------------------------------------------------- + /** Returns whether the class can handle the format of the given file. + * See BaseImporter::CanRead() for details. + */ + bool CanRead( const std::string& pFile, IOSystem* pIOHandler, + bool checkSig) const; + +protected: + const aiImporterDesc* GetInfo () const; + void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); + void SetupProperties(const Importer* pImp); + +private: + + /** Data structure for a scenegraph node animator + */ + struct Animator { + // Type of the animator + enum AT { + UNKNOWN = 0x0, + ROTATION = 0x1, + FLY_CIRCLE = 0x2, + FLY_STRAIGHT = 0x3, + FOLLOW_SPLINE = 0x4, + OTHER = 0x5 + + } type; + + explicit Animator(AT t = UNKNOWN) + : type (t) + , speed ( ai_real( 0.001 ) ) + , direction ( ai_real( 0.0 ), ai_real( 1.0 ), ai_real( 0.0 ) ) + , circleRadius ( ai_real( 1.0) ) + , tightness ( ai_real( 0.5 ) ) + , loop (true) + , timeForWay (100) + { + } + + + // common parameters + ai_real speed; + aiVector3D direction; + + // FLY_CIRCLE + aiVector3D circleCenter; + ai_real circleRadius; + + // FOLLOW_SPLINE + ai_real tightness; + std::vector splineKeys; + + // ROTATION (angles given in direction) + + // FLY STRAIGHT + // circleCenter = start, direction = end + bool loop; + int timeForWay; + }; + + /** Data structure for a scenegraph node in an IRR file + */ + struct Node + { + // Type of the node + enum ET + { + LIGHT, + CUBE, + MESH, + SKYBOX, + DUMMY, + CAMERA, + TERRAIN, + SPHERE, + ANIMMESH + } type; + + explicit Node(ET t) + : type (t) + , scaling (1.0,1.0,1.0) // assume uniform scaling by default + , parent() + , framesPerSecond (0.0) + , id() + , sphereRadius (1.0) + , spherePolyCountX (100) + , spherePolyCountY (100) + { + + // Generate a default name for the node + char buffer[128]; + static int cnt; + ai_snprintf(buffer, 128, "IrrNode_%i",cnt++); + name = std::string(buffer); + + // reserve space for up to 5 materials + materials.reserve(5); + + // reserve space for up to 5 children + children.reserve(5); + } + + // Transformation of the node + aiVector3D position, rotation, scaling; + + // Name of the node + std::string name; + + // List of all child nodes + std::vector children; + + // Parent node + Node* parent; + + // Animated meshes: frames per second + // 0.f if not specified + ai_real framesPerSecond; + + // Meshes: path to the mesh to be loaded + std::string meshPath; + unsigned int id; + + // Meshes: List of materials to be assigned + // along with their corresponding material flags + std::vector< std::pair > materials; + + // Spheres: radius of the sphere to be generates + ai_real sphereRadius; + + // Spheres: Number of polygons in the x,y direction + unsigned int spherePolyCountX,spherePolyCountY; + + // List of all animators assigned to the node + std::list animators; + }; + + /** Data structure for a vertex in an IRR skybox + */ + struct SkyboxVertex + { + SkyboxVertex() + {} + + //! Construction from single vertex components + SkyboxVertex(ai_real px, ai_real py, ai_real pz, + ai_real nx, ai_real ny, ai_real nz, + ai_real uvx, ai_real uvy) + + : position (px,py,pz) + , normal (nx,ny,nz) + , uv (uvx,uvy,0.0) + {} + + aiVector3D position, normal, uv; + }; + + + // ------------------------------------------------------------------- + /** Fill the scenegraph recursively + */ + void GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene, + BatchLoader& batch, + std::vector& meshes, + std::vector& anims, + std::vector& attach, + std::vector& materials, + unsigned int& defaultMatIdx); + + + // ------------------------------------------------------------------- + /** Generate a mesh that consists of just a single quad + */ + aiMesh* BuildSingleQuadMesh(const SkyboxVertex& v1, + const SkyboxVertex& v2, + const SkyboxVertex& v3, + const SkyboxVertex& v4); + + + // ------------------------------------------------------------------- + /** Build a skybox + * + * @param meshes Receives 6 output meshes + * @param materials The last 6 materials are assigned to the newly + * created meshes. The names of the materials are adjusted. + */ + void BuildSkybox(std::vector& meshes, + std::vector materials); + + + // ------------------------------------------------------------------- + /** Copy a material for a mesh to the output material list + * + * @param materials Receives an output material + * @param inmaterials List of input materials + * @param defMatIdx Default material index - UINT_MAX if not present + * @param mesh Mesh to work on + */ + void CopyMaterial(std::vector& materials, + std::vector< std::pair >& inmaterials, + unsigned int& defMatIdx, + aiMesh* mesh); + + + // ------------------------------------------------------------------- + /** Compute animations for a specific node + * + * @param root Node to be processed + * @param anims The list of output animations + */ + void ComputeAnimations(Node* root, aiNode* real, + std::vector& anims); + + +private: + + /** Configuration option: desired output FPS */ + double fps; + + /** Configuration option: speed flag was set? */ + bool configSpeedFlag; +}; + +} // end of namespace Assimp + +#endif // AI_IRRIMPORTER_H_INC diff --git a/Engine/lib/assimp/code/Irr/IRRMeshLoader.cpp b/Engine/lib/assimp/code/Irr/IRRMeshLoader.cpp new file mode 100644 index 000000000..057218464 --- /dev/null +++ b/Engine/lib/assimp/code/Irr/IRRMeshLoader.cpp @@ -0,0 +1,535 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 Implementation of the IrrMesh importer class */ + + + +#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER + +#include "IRRMeshLoader.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace Assimp; +using namespace irr; +using namespace irr::io; + +static const aiImporterDesc desc = { + "Irrlicht Mesh Reader", + "", + "", + "http://irrlicht.sourceforge.net/", + aiImporterFlags_SupportTextFlavour, + 0, + 0, + 0, + 0, + "xml irrmesh" +}; + +// ------------------------------------------------------------------------------------------------ +// Constructor to be privately used by Importer +IRRMeshImporter::IRRMeshImporter() +{} + +// ------------------------------------------------------------------------------------------------ +// Destructor, private as well +IRRMeshImporter::~IRRMeshImporter() +{} + +// ------------------------------------------------------------------------------------------------ +// Returns whether the class can handle the format of the given file. +bool IRRMeshImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const +{ + /* NOTE: A simple check for the file extension is not enough + * here. Irrmesh and irr are easy, but xml is too generic + * and could be collada, too. So we need to open the file and + * search for typical tokens. + */ + const std::string extension = GetExtension(pFile); + + if (extension == "irrmesh")return true; + else if (extension == "xml" || checkSig) + { + /* If CanRead() is called to check whether the loader + * supports a specific file extension in general we + * must return true here. + */ + if (!pIOHandler)return true; + const char* tokens[] = {"irrmesh"}; + return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1); + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +// Get a list of all file extensions which are handled by this class +const aiImporterDesc* IRRMeshImporter::GetInfo () const +{ + return &desc; +} + +static void releaseMaterial( aiMaterial **mat ) { + if(*mat!= nullptr) { + delete *mat; + *mat = nullptr; + } +} + +static void releaseMesh( aiMesh **mesh ) { + if (*mesh != nullptr){ + delete *mesh; + *mesh = nullptr; + } +} + +// ------------------------------------------------------------------------------------------------ +// Imports the given file into the given scene structure. +void IRRMeshImporter::InternReadFile( const std::string& pFile, + aiScene* pScene, IOSystem* pIOHandler) +{ + 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 + ""); + + // Construct the irrXML parser + CIrrXML_IOStreamReader st(file.get()); + reader = createIrrXMLReader((IFileReadCallBack*) &st); + + // final data + std::vector materials; + std::vector meshes; + materials.reserve (5); + meshes.reserve(5); + + // temporary data - current mesh buffer + aiMaterial* curMat = nullptr; + aiMesh* curMesh = nullptr; + unsigned int curMatFlags = 0; + + std::vector curVertices,curNormals,curTangents,curBitangents; + std::vector curColors; + std::vector curUVs,curUV2s; + + // some temporary variables + int textMeaning = 0; + int vertexFormat = 0; // 0 = normal; 1 = 2 tcoords, 2 = tangents + bool useColors = false; + + // Parse the XML file + while (reader->read()) { + switch (reader->getNodeType()) { + case EXN_ELEMENT: + + if (!ASSIMP_stricmp(reader->getNodeName(),"buffer") && (curMat || curMesh)) { + // end of previous buffer. A material and a mesh should be there + if ( !curMat || !curMesh) { + ASSIMP_LOG_ERROR("IRRMESH: A buffer must contain a mesh and a material"); + releaseMaterial( &curMat ); + releaseMesh( &curMesh ); + } else { + materials.push_back(curMat); + meshes.push_back(curMesh); + } + curMat = nullptr; + curMesh = nullptr; + + curVertices.clear(); + curColors.clear(); + curNormals.clear(); + curUV2s.clear(); + curUVs.clear(); + curTangents.clear(); + curBitangents.clear(); + } + + + if (!ASSIMP_stricmp(reader->getNodeName(),"material")) { + if (curMat) { + ASSIMP_LOG_WARN("IRRMESH: Only one material description per buffer, please"); + releaseMaterial( &curMat ); + } + curMat = ParseMaterial(curMatFlags); + } + /* no else here! */ if (!ASSIMP_stricmp(reader->getNodeName(),"vertices")) + { + int num = reader->getAttributeValueAsInt("vertexCount"); + + if (!num) { + // This is possible ... remove the mesh from the list and skip further reading + ASSIMP_LOG_WARN("IRRMESH: Found mesh with zero vertices"); + + releaseMaterial( &curMat ); + releaseMesh( &curMesh ); + textMeaning = 0; + continue; + } + + curVertices.reserve(num); + curNormals.reserve(num); + curColors.reserve(num); + curUVs.reserve(num); + + // Determine the file format + const char* t = reader->getAttributeValueSafe("type"); + if (!ASSIMP_stricmp("2tcoords", t)) { + curUV2s.reserve (num); + vertexFormat = 1; + + if (curMatFlags & AI_IRRMESH_EXTRA_2ND_TEXTURE) { + // ********************************************************* + // We have a second texture! So use this UV channel + // for it. The 2nd texture can be either a normal + // texture (solid_2layer or lightmap_xxx) or a normal + // map (normal_..., parallax_...) + // ********************************************************* + int idx = 1; + aiMaterial* mat = ( aiMaterial* ) curMat; + + if (curMatFlags & AI_IRRMESH_MAT_lightmap){ + mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_LIGHTMAP(0)); + } + else if (curMatFlags & AI_IRRMESH_MAT_normalmap_solid){ + mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_NORMALS(0)); + } + else if (curMatFlags & AI_IRRMESH_MAT_solid_2layer) { + mat->AddProperty(&idx,1,AI_MATKEY_UVWSRC_DIFFUSE(1)); + } + } + } + else if (!ASSIMP_stricmp("tangents", t)) { + curTangents.reserve (num); + curBitangents.reserve (num); + vertexFormat = 2; + } + else if (ASSIMP_stricmp("standard", t)) { + releaseMaterial( &curMat ); + ASSIMP_LOG_WARN("IRRMESH: Unknown vertex format"); + } + else vertexFormat = 0; + textMeaning = 1; + } + else if (!ASSIMP_stricmp(reader->getNodeName(),"indices")) { + if (curVertices.empty() && curMat) { + releaseMaterial( &curMat ); + throw DeadlyImportError("IRRMESH: indices must come after vertices"); + } + + textMeaning = 2; + + // start a new mesh + curMesh = new aiMesh(); + + // allocate storage for all faces + curMesh->mNumVertices = reader->getAttributeValueAsInt("indexCount"); + if (!curMesh->mNumVertices) { + // This is possible ... remove the mesh from the list and skip further reading + ASSIMP_LOG_WARN("IRRMESH: Found mesh with zero indices"); + + // mesh - away + releaseMesh( &curMesh ); + + // material - away + releaseMaterial( &curMat ); + + textMeaning = 0; + continue; + } + + if (curMesh->mNumVertices % 3) { + ASSIMP_LOG_WARN("IRRMESH: Number if indices isn't divisible by 3"); + } + + curMesh->mNumFaces = curMesh->mNumVertices / 3; + curMesh->mFaces = new aiFace[curMesh->mNumFaces]; + + // setup some members + curMesh->mMaterialIndex = (unsigned int)materials.size(); + curMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; + + // allocate storage for all vertices + curMesh->mVertices = new aiVector3D[curMesh->mNumVertices]; + + if (curNormals.size() == curVertices.size()) { + curMesh->mNormals = new aiVector3D[curMesh->mNumVertices]; + } + if (curTangents.size() == curVertices.size()) { + curMesh->mTangents = new aiVector3D[curMesh->mNumVertices]; + } + if (curBitangents.size() == curVertices.size()) { + curMesh->mBitangents = new aiVector3D[curMesh->mNumVertices]; + } + if (curColors.size() == curVertices.size() && useColors) { + curMesh->mColors[0] = new aiColor4D[curMesh->mNumVertices]; + } + if (curUVs.size() == curVertices.size()) { + curMesh->mTextureCoords[0] = new aiVector3D[curMesh->mNumVertices]; + } + if (curUV2s.size() == curVertices.size()) { + curMesh->mTextureCoords[1] = new aiVector3D[curMesh->mNumVertices]; + } + } + break; + + case EXN_TEXT: + { + const char* sz = reader->getNodeData(); + if (textMeaning == 1) { + textMeaning = 0; + + // read vertices + do { + SkipSpacesAndLineEnd(&sz); + aiVector3D temp;aiColor4D c; + + // Read the vertex position + sz = fast_atoreal_move(sz,(float&)temp.x); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.y); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.z); + SkipSpaces(&sz); + curVertices.push_back(temp); + + // Read the vertex normals + sz = fast_atoreal_move(sz,(float&)temp.x); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.y); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.z); + SkipSpaces(&sz); + curNormals.push_back(temp); + + // read the vertex colors + uint32_t clr = strtoul16(sz,&sz); + ColorFromARGBPacked(clr,c); + + if (!curColors.empty() && c != *(curColors.end()-1)) + useColors = true; + + curColors.push_back(c); + SkipSpaces(&sz); + + + // read the first UV coordinate set + sz = fast_atoreal_move(sz,(float&)temp.x); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.y); + SkipSpaces(&sz); + temp.z = 0.f; + temp.y = 1.f - temp.y; // DX to OGL + curUVs.push_back(temp); + + // read the (optional) second UV coordinate set + if (vertexFormat == 1) { + sz = fast_atoreal_move(sz,(float&)temp.x); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.y); + temp.y = 1.f - temp.y; // DX to OGL + curUV2s.push_back(temp); + } + // read optional tangent and bitangent vectors + else if (vertexFormat == 2) { + // tangents + sz = fast_atoreal_move(sz,(float&)temp.x); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.z); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.y); + SkipSpaces(&sz); + temp.y *= -1.0f; + curTangents.push_back(temp); + + // bitangents + sz = fast_atoreal_move(sz,(float&)temp.x); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.z); + SkipSpaces(&sz); + + sz = fast_atoreal_move(sz,(float&)temp.y); + SkipSpaces(&sz); + temp.y *= -1.0f; + curBitangents.push_back(temp); + } + } + + /* IMPORTANT: We assume that each vertex is specified in one + line. So we can skip the rest of the line - unknown vertex + elements are ignored. + */ + + while (SkipLine(&sz)); + } + else if (textMeaning == 2) { + textMeaning = 0; + + // read indices + aiFace* curFace = curMesh->mFaces; + aiFace* const faceEnd = curMesh->mFaces + curMesh->mNumFaces; + + aiVector3D* pcV = curMesh->mVertices; + aiVector3D* pcN = curMesh->mNormals; + aiVector3D* pcT = curMesh->mTangents; + aiVector3D* pcB = curMesh->mBitangents; + aiColor4D* pcC0 = curMesh->mColors[0]; + aiVector3D* pcT0 = curMesh->mTextureCoords[0]; + aiVector3D* pcT1 = curMesh->mTextureCoords[1]; + + unsigned int curIdx = 0; + unsigned int total = 0; + while(SkipSpacesAndLineEnd(&sz)) { + if (curFace >= faceEnd) { + ASSIMP_LOG_ERROR("IRRMESH: Too many indices"); + break; + } + if (!curIdx) { + curFace->mNumIndices = 3; + curFace->mIndices = new unsigned int[3]; + } + + unsigned int idx = strtoul10(sz,&sz); + if (idx >= curVertices.size()) { + ASSIMP_LOG_ERROR("IRRMESH: Index out of range"); + idx = 0; + } + + curFace->mIndices[curIdx] = total++; + + *pcV++ = curVertices[idx]; + if (pcN)*pcN++ = curNormals[idx]; + if (pcT)*pcT++ = curTangents[idx]; + if (pcB)*pcB++ = curBitangents[idx]; + if (pcC0)*pcC0++ = curColors[idx]; + if (pcT0)*pcT0++ = curUVs[idx]; + if (pcT1)*pcT1++ = curUV2s[idx]; + + if (++curIdx == 3) { + ++curFace; + curIdx = 0; + } + } + + if (curFace != faceEnd) + ASSIMP_LOG_ERROR("IRRMESH: Not enough indices"); + + // Finish processing the mesh - do some small material workarounds + if (curMatFlags & AI_IRRMESH_MAT_trans_vertex_alpha && !useColors) { + // Take the opacity value of the current material + // from the common vertex color alpha + aiMaterial* mat = (aiMaterial*)curMat; + mat->AddProperty(&curColors[0].a,1,AI_MATKEY_OPACITY); + } + }} + break; + + default: + // GCC complains here ... + break; + + }; + } + + // End of the last buffer. A material and a mesh should be there + if (curMat || curMesh) { + if ( !curMat || !curMesh) { + ASSIMP_LOG_ERROR("IRRMESH: A buffer must contain a mesh and a material"); + releaseMaterial( &curMat ); + releaseMesh( &curMesh ); + } + else { + materials.push_back(curMat); + meshes.push_back(curMesh); + } + } + + if (materials.empty()) + throw DeadlyImportError("IRRMESH: Unable to read a mesh from this file"); + + + // now generate the output scene + pScene->mNumMeshes = (unsigned int)meshes.size(); + pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; + for (unsigned int i = 0; i < pScene->mNumMeshes;++i) { + pScene->mMeshes[i] = meshes[i]; + + // clean this value ... + pScene->mMeshes[i]->mNumUVComponents[3] = 0; + } + + pScene->mNumMaterials = (unsigned int)materials.size(); + pScene->mMaterials = new aiMaterial*[pScene->mNumMaterials]; + ::memcpy(pScene->mMaterials,&materials[0],sizeof(void*)*pScene->mNumMaterials); + + pScene->mRootNode = new aiNode(); + pScene->mRootNode->mName.Set(""); + pScene->mRootNode->mNumMeshes = pScene->mNumMeshes; + pScene->mRootNode->mMeshes = new unsigned int[pScene->mNumMeshes]; + + for (unsigned int i = 0; i < pScene->mNumMeshes;++i) + pScene->mRootNode->mMeshes[i] = i; + + // clean up and return + delete reader; + AI_DEBUG_INVALIDATE_PTR(reader); +} + +#endif // !! ASSIMP_BUILD_NO_IRRMESH_IMPORTER diff --git a/Engine/lib/assimp/code/Profiler.h b/Engine/lib/assimp/code/Irr/IRRMeshLoader.h similarity index 51% rename from Engine/lib/assimp/code/Profiler.h rename to Engine/lib/assimp/code/Irr/IRRMeshLoader.h index 1c9ca60b5..d8b42d78d 100644 --- a/Engine/lib/assimp/code/Profiler.h +++ b/Engine/lib/assimp/code/Irr/IRRMeshLoader.h @@ -2,7 +2,8 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- -Copyright (c) 2006-2017, assimp team +Copyright (c) 2006-2019, assimp team + All rights reserved. @@ -39,60 +40,62 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -/** @file Profiler.h - * @brief Utility to measure the respective runtime of each import step +/** @file IRRMeshLoader.h + * @brief Declaration of the .irrMesh (Irrlight Engine Mesh Format) + * importer class. */ -#ifndef INCLUDED_PROFILER_H -#define INCLUDED_PROFILER_H +#ifndef AI_IRRMESHLOADER_H_INCLUDED +#define AI_IRRMESHLOADER_H_INCLUDED -#include -#include -#include "TinyFormatter.h" +#include +#include "IRRShared.h" -#include +#ifndef ASSIMP_BUILD_NO_IRRMESH_IMPORTER -namespace Assimp { -namespace Profiling { +namespace Assimp { -using namespace Formatter; - -// ------------------------------------------------------------------------------------------------ -/** Simple wrapper around boost::timer to simplify reporting. Timings are automatically - * dumped to the log file. +// --------------------------------------------------------------------------- +/** IrrMesh importer class. + * + * IrrMesh is the native file format of the Irrlight engine and its editor + * irrEdit. As IrrEdit itself is capable of importing quite many file formats, + * it might be a good file format for data exchange. */ -class Profiler { +class IRRMeshImporter : public BaseImporter, public IrrlichtBase +{ public: - Profiler() { - // empty - } + IRRMeshImporter(); + ~IRRMeshImporter(); + public: - /** Start a named timer */ - void BeginRegion(const std::string& region) { - regions[region] = std::chrono::system_clock::now(); - DefaultLogger::get()->debug((format("START `"),region,"`")); - } + // ------------------------------------------------------------------- + /** Returns whether the class can handle the format of the given file. + * See BaseImporter::CanRead() for details. + */ + bool CanRead( const std::string& pFile, IOSystem* pIOHandler, + bool checkSig) const; +protected: - /** End a specific named timer and write its end time to the log */ - void EndRegion(const std::string& region) { - RegionMap::const_iterator it = regions.find(region); - if (it == regions.end()) { - return; - } + // ------------------------------------------------------------------- + /** Return importer meta information. + * See #BaseImporter::GetInfo for the details + */ + const aiImporterDesc* GetInfo () const; - std::chrono::duration elapsedSeconds = std::chrono::system_clock::now() - regions[region]; - DefaultLogger::get()->debug((format("END `"),region,"`, dt= ", elapsedSeconds.count()," s")); - } + // ------------------------------------------------------------------- + /** Imports the given file into the given scene structure. + * See BaseImporter::InternReadFile() for details + */ + void InternReadFile( const std::string& pFile, aiScene* pScene, + IOSystem* pIOHandler); -private: - typedef std::map> RegionMap; - RegionMap regions; }; -} -} +} // end of namespace Assimp -#endif +#endif // ASSIMP_BUILD_NO_IRRMESH_IMPORTER +#endif // AI_IRRMESHIMPORTER_H_INC diff --git a/Engine/lib/assimp/code/Irr/IRRShared.cpp b/Engine/lib/assimp/code/Irr/IRRShared.cpp new file mode 100644 index 000000000..ecac031ab --- /dev/null +++ b/Engine/lib/assimp/code/Irr/IRRShared.cpp @@ -0,0 +1,501 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 IRRShared.cpp + * @brief Shared utilities for the IRR and IRRMESH loaders + */ + + + +//This section should be excluded only if both the Irrlicht AND the Irrlicht Mesh importers were omitted. +#if !(defined(ASSIMP_BUILD_NO_IRR_IMPORTER) && defined(ASSIMP_BUILD_NO_IRRMESH_IMPORTER)) + +#include "IRRShared.h" +#include +#include +#include +#include + + +using namespace Assimp; +using namespace irr; +using namespace irr::io; + +// Transformation matrix to convert from Assimp to IRR space +const aiMatrix4x4 Assimp::AI_TO_IRR_MATRIX = aiMatrix4x4 ( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + +// ------------------------------------------------------------------------------------------------ +// read a property in hexadecimal format (i.e. ffffffff) +void IrrlichtBase::ReadHexProperty (HexProperty& out) +{ + for (int i = 0; i < reader->getAttributeCount();++i) + { + if (!ASSIMP_stricmp(reader->getAttributeName(i),"name")) + { + out.name = std::string( reader->getAttributeValue(i) ); + } + else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value")) + { + // parse the hexadecimal value + out.value = strtoul16(reader->getAttributeValue(i)); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// read a decimal property +void IrrlichtBase::ReadIntProperty (IntProperty& out) +{ + for (int i = 0; i < reader->getAttributeCount();++i) + { + if (!ASSIMP_stricmp(reader->getAttributeName(i),"name")) + { + out.name = std::string( reader->getAttributeValue(i) ); + } + else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value")) + { + // parse the ecimal value + out.value = strtol10(reader->getAttributeValue(i)); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// read a string property +void IrrlichtBase::ReadStringProperty (StringProperty& out) +{ + for (int i = 0; i < reader->getAttributeCount();++i) + { + if (!ASSIMP_stricmp(reader->getAttributeName(i),"name")) + { + out.name = std::string( reader->getAttributeValue(i) ); + } + else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value")) + { + // simple copy the string + out.value = std::string (reader->getAttributeValue(i)); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// read a boolean property +void IrrlichtBase::ReadBoolProperty (BoolProperty& out) +{ + for (int i = 0; i < reader->getAttributeCount();++i) + { + if (!ASSIMP_stricmp(reader->getAttributeName(i),"name")) + { + out.name = std::string( reader->getAttributeValue(i) ); + } + else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value")) + { + // true or false, case insensitive + out.value = (ASSIMP_stricmp( reader->getAttributeValue(i), + "true") ? false : true); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// read a float property +void IrrlichtBase::ReadFloatProperty (FloatProperty& out) +{ + for (int i = 0; i < reader->getAttributeCount();++i) + { + if (!ASSIMP_stricmp(reader->getAttributeName(i),"name")) + { + out.name = std::string( reader->getAttributeValue(i) ); + } + else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value")) + { + // just parse the float + out.value = fast_atof( reader->getAttributeValue(i) ); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// read a vector property +void IrrlichtBase::ReadVectorProperty (VectorProperty& out) +{ + for (int i = 0; i < reader->getAttributeCount();++i) + { + if (!ASSIMP_stricmp(reader->getAttributeName(i),"name")) + { + out.name = std::string( reader->getAttributeValue(i) ); + } + else if (!ASSIMP_stricmp(reader->getAttributeName(i),"value")) + { + // three floats, separated with commas + const char* ptr = reader->getAttributeValue(i); + + SkipSpaces(&ptr); + ptr = fast_atoreal_move( ptr,(float&)out.value.x ); + SkipSpaces(&ptr); + if (',' != *ptr) + { + ASSIMP_LOG_ERROR("IRR(MESH): Expected comma in vector definition"); + } + else SkipSpaces(ptr+1,&ptr); + ptr = fast_atoreal_move( ptr,(float&)out.value.y ); + SkipSpaces(&ptr); + if (',' != *ptr) + { + ASSIMP_LOG_ERROR("IRR(MESH): Expected comma in vector definition"); + } + else SkipSpaces(ptr+1,&ptr); + ptr = fast_atoreal_move( ptr,(float&)out.value.z ); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Convert a string to a proper aiMappingMode +int ConvertMappingMode(const std::string& mode) +{ + if (mode == "texture_clamp_repeat") + { + return aiTextureMapMode_Wrap; + } + else if (mode == "texture_clamp_mirror") + return aiTextureMapMode_Mirror; + + return aiTextureMapMode_Clamp; +} + +// ------------------------------------------------------------------------------------------------ +// Parse a material from the XML file +aiMaterial* IrrlichtBase::ParseMaterial(unsigned int& matFlags) +{ + aiMaterial* mat = new aiMaterial(); + aiColor4D clr; + aiString s; + + matFlags = 0; // zero output flags + int cnt = 0; // number of used texture channels + unsigned int nd = 0; + + // Continue reading from the file + while (reader->read()) + { + switch (reader->getNodeType()) + { + case EXN_ELEMENT: + + // Hex properties + if (!ASSIMP_stricmp(reader->getNodeName(),"color")) + { + HexProperty prop; + ReadHexProperty(prop); + if (prop.name == "Diffuse") + { + ColorFromARGBPacked(prop.value,clr); + mat->AddProperty(&clr,1,AI_MATKEY_COLOR_DIFFUSE); + } + else if (prop.name == "Ambient") + { + ColorFromARGBPacked(prop.value,clr); + mat->AddProperty(&clr,1,AI_MATKEY_COLOR_AMBIENT); + } + else if (prop.name == "Specular") + { + ColorFromARGBPacked(prop.value,clr); + mat->AddProperty(&clr,1,AI_MATKEY_COLOR_SPECULAR); + } + + // NOTE: The 'emissive' property causes problems. It is + // often != 0, even if there is obviously no light + // emitted by the described surface. In fact I think + // IRRLICHT ignores this property, too. +#if 0 + else if (prop.name == "Emissive") + { + ColorFromARGBPacked(prop.value,clr); + mat->AddProperty(&clr,1,AI_MATKEY_COLOR_EMISSIVE); + } +#endif + } + // Float properties + else if (!ASSIMP_stricmp(reader->getNodeName(),"float")) + { + FloatProperty prop; + ReadFloatProperty(prop); + if (prop.name == "Shininess") + { + mat->AddProperty(&prop.value,1,AI_MATKEY_SHININESS); + } + } + // Bool properties + else if (!ASSIMP_stricmp(reader->getNodeName(),"bool")) + { + BoolProperty prop; + ReadBoolProperty(prop); + if (prop.name == "Wireframe") + { + int val = (prop.value ? true : false); + mat->AddProperty(&val,1,AI_MATKEY_ENABLE_WIREFRAME); + } + else if (prop.name == "GouraudShading") + { + int val = (prop.value ? aiShadingMode_Gouraud + : aiShadingMode_NoShading); + mat->AddProperty(&val,1,AI_MATKEY_SHADING_MODEL); + } + else if (prop.name == "BackfaceCulling") + { + int val = (!prop.value); + mat->AddProperty(&val,1,AI_MATKEY_TWOSIDED); + } + } + // String properties - textures and texture related properties + else if (!ASSIMP_stricmp(reader->getNodeName(),"texture") || + !ASSIMP_stricmp(reader->getNodeName(),"enum")) + { + StringProperty prop; + ReadStringProperty(prop); + if (prop.value.length()) + { + // material type (shader) + if (prop.name == "Type") + { + if (prop.value == "solid") + { + // default material ... + } + else if (prop.value == "trans_vertex_alpha") + { + matFlags = AI_IRRMESH_MAT_trans_vertex_alpha; + } + else if (prop.value == "lightmap") + { + matFlags = AI_IRRMESH_MAT_lightmap; + } + else if (prop.value == "solid_2layer") + { + matFlags = AI_IRRMESH_MAT_solid_2layer; + } + else if (prop.value == "lightmap_m2") + { + matFlags = AI_IRRMESH_MAT_lightmap_m2; + } + else if (prop.value == "lightmap_m4") + { + matFlags = AI_IRRMESH_MAT_lightmap_m4; + } + else if (prop.value == "lightmap_light") + { + matFlags = AI_IRRMESH_MAT_lightmap_light; + } + else if (prop.value == "lightmap_light_m2") + { + matFlags = AI_IRRMESH_MAT_lightmap_light_m2; + } + else if (prop.value == "lightmap_light_m4") + { + matFlags = AI_IRRMESH_MAT_lightmap_light_m4; + } + else if (prop.value == "lightmap_add") + { + matFlags = AI_IRRMESH_MAT_lightmap_add; + } + // Normal and parallax maps are treated equally + else if (prop.value == "normalmap_solid" || + prop.value == "parallaxmap_solid") + { + matFlags = AI_IRRMESH_MAT_normalmap_solid; + } + else if (prop.value == "normalmap_trans_vertex_alpha" || + prop.value == "parallaxmap_trans_vertex_alpha") + { + matFlags = AI_IRRMESH_MAT_normalmap_tva; + } + else if (prop.value == "normalmap_trans_add" || + prop.value == "parallaxmap_trans_add") + { + matFlags = AI_IRRMESH_MAT_normalmap_ta; + } + else { + ASSIMP_LOG_WARN("IRRMat: Unrecognized material type: " + prop.value); + } + } + + // Up to 4 texture channels are supported + if (prop.name == "Texture1") + { + // Always accept the primary texture channel + ++cnt; + s.Set(prop.value); + mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(0)); + } + else if (prop.name == "Texture2" && cnt == 1) + { + // 2-layer material lightmapped? + if (matFlags & AI_IRRMESH_MAT_lightmap) { + ++cnt; + s.Set(prop.value); + mat->AddProperty(&s,AI_MATKEY_TEXTURE_LIGHTMAP(0)); + + // set the corresponding material flag + matFlags |= AI_IRRMESH_EXTRA_2ND_TEXTURE; + } + // alternatively: normal or parallax mapping + else if (matFlags & AI_IRRMESH_MAT_normalmap_solid) { + ++cnt; + s.Set(prop.value); + mat->AddProperty(&s,AI_MATKEY_TEXTURE_NORMALS(0)); + + // set the corresponding material flag + matFlags |= AI_IRRMESH_EXTRA_2ND_TEXTURE; + } else if (matFlags & AI_IRRMESH_MAT_solid_2layer) {// or just as second diffuse texture + ++cnt; + s.Set(prop.value); + mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(1)); + ++nd; + + // set the corresponding material flag + matFlags |= AI_IRRMESH_EXTRA_2ND_TEXTURE; + } else { + ASSIMP_LOG_WARN("IRRmat: Skipping second texture"); + } + } else if (prop.name == "Texture3" && cnt == 2) { + // Irrlicht does not seem to use these channels. + ++cnt; + s.Set(prop.value); + mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(nd+1)); + } else if (prop.name == "Texture4" && cnt == 3) { + // Irrlicht does not seem to use these channels. + ++cnt; + s.Set(prop.value); + mat->AddProperty(&s,AI_MATKEY_TEXTURE_DIFFUSE(nd+2)); + } + + // Texture mapping options + if (prop.name == "TextureWrap1" && cnt >= 1) + { + int map = ConvertMappingMode(prop.value); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(0)); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(0)); + } + else if (prop.name == "TextureWrap2" && cnt >= 2) + { + int map = ConvertMappingMode(prop.value); + if (matFlags & AI_IRRMESH_MAT_lightmap) { + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_LIGHTMAP(0)); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_LIGHTMAP(0)); + } + else if (matFlags & (AI_IRRMESH_MAT_normalmap_solid)) { + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_NORMALS(0)); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_NORMALS(0)); + } + else if (matFlags & AI_IRRMESH_MAT_solid_2layer) { + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(1)); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(1)); + } + } + else if (prop.name == "TextureWrap3" && cnt >= 3) + { + int map = ConvertMappingMode(prop.value); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(nd+1)); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(nd+1)); + } + else if (prop.name == "TextureWrap4" && cnt >= 4) + { + int map = ConvertMappingMode(prop.value); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_U_DIFFUSE(nd+2)); + mat->AddProperty(&map,1,AI_MATKEY_MAPPINGMODE_V_DIFFUSE(nd+2)); + } + } + } + break; + case EXN_ELEMENT_END: + + /* Assume there are no further nested nodes in elements + */ + if (/* IRRMESH */ !ASSIMP_stricmp(reader->getNodeName(),"material") || + /* IRR */ !ASSIMP_stricmp(reader->getNodeName(),"attributes")) + { + // Now process lightmapping flags + // We should have at least one textur to do that .. + if (cnt && matFlags & AI_IRRMESH_MAT_lightmap) + { + float f = 1.f; + unsigned int unmasked = matFlags&~AI_IRRMESH_MAT_lightmap; + + // Additive lightmap? + int op = (unmasked & AI_IRRMESH_MAT_lightmap_add + ? aiTextureOp_Add : aiTextureOp_Multiply); + + // Handle Irrlicht's lightmapping scaling factor + if (unmasked & AI_IRRMESH_MAT_lightmap_m2 || + unmasked & AI_IRRMESH_MAT_lightmap_light_m2) + { + f = 2.f; + } + else if (unmasked & AI_IRRMESH_MAT_lightmap_m4 || + unmasked & AI_IRRMESH_MAT_lightmap_light_m4) + { + f = 4.f; + } + mat->AddProperty( &f, 1, AI_MATKEY_TEXBLEND_LIGHTMAP(0)); + mat->AddProperty( &op,1, AI_MATKEY_TEXOP_LIGHTMAP(0)); + } + + return mat; + } + default: + + // GCC complains here ... + break; + } + } + ASSIMP_LOG_ERROR("IRRMESH: Unexpected end of file. Material is not complete"); + + return mat; +} + +#endif // !(defined(ASSIMP_BUILD_NO_IRR_IMPORTER) && defined(ASSIMP_BUILD_NO_IRRMESH_IMPORTER)) diff --git a/Engine/lib/assimp/code/Irr/IRRShared.h b/Engine/lib/assimp/code/Irr/IRRShared.h new file mode 100644 index 000000000..2f6f87405 --- /dev/null +++ b/Engine/lib/assimp/code/Irr/IRRShared.h @@ -0,0 +1,118 @@ + + +/** @file IRRShared.h + * @brief Shared utilities for the IRR and IRRMESH loaders + */ + +#ifndef INCLUDED_AI_IRRSHARED_H +#define INCLUDED_AI_IRRSHARED_H + +#include +#include +#include + +struct aiMaterial; + +namespace Assimp { + + +/** @brief Matrix to convert from Assimp to IRR and backwards + */ +extern const aiMatrix4x4 AI_TO_IRR_MATRIX; + + +// Default: 0 = solid, one texture +#define AI_IRRMESH_MAT_solid_2layer 0x10000 + +// Transparency flags +#define AI_IRRMESH_MAT_trans_vertex_alpha 0x1 +#define AI_IRRMESH_MAT_trans_add 0x2 + +// Lightmapping flags +#define AI_IRRMESH_MAT_lightmap 0x2 +#define AI_IRRMESH_MAT_lightmap_m2 (AI_IRRMESH_MAT_lightmap|0x4) +#define AI_IRRMESH_MAT_lightmap_m4 (AI_IRRMESH_MAT_lightmap|0x8) +#define AI_IRRMESH_MAT_lightmap_light (AI_IRRMESH_MAT_lightmap|0x10) +#define AI_IRRMESH_MAT_lightmap_light_m2 (AI_IRRMESH_MAT_lightmap|0x20) +#define AI_IRRMESH_MAT_lightmap_light_m4 (AI_IRRMESH_MAT_lightmap|0x40) +#define AI_IRRMESH_MAT_lightmap_add (AI_IRRMESH_MAT_lightmap|0x80) + +// Standard NormalMap (or Parallax map, they're treated equally) +#define AI_IRRMESH_MAT_normalmap_solid (0x100) + +// Normal map combined with vertex alpha +#define AI_IRRMESH_MAT_normalmap_tva \ + (AI_IRRMESH_MAT_normalmap_solid | AI_IRRMESH_MAT_trans_vertex_alpha) + +// Normal map combined with additive transparency +#define AI_IRRMESH_MAT_normalmap_ta \ + (AI_IRRMESH_MAT_normalmap_solid | AI_IRRMESH_MAT_trans_add) + +// Special flag. It indicates a second texture has been found +// Its type depends ... either a normal textue or a normal map +#define AI_IRRMESH_EXTRA_2ND_TEXTURE 0x100000 + +// --------------------------------------------------------------------------- +/** Base class for the Irr and IrrMesh importers. + * + * Declares some irrlight-related xml parsing utilities and provides tools + * to load materials from IRR and IRRMESH files. + */ +class IrrlichtBase +{ +protected: + + /** @brief Data structure for a simple name-value property + */ + template + struct Property + { + std::string name; + T value; + }; + + typedef Property HexProperty; + typedef Property StringProperty; + typedef Property BoolProperty; + typedef Property FloatProperty; + typedef Property VectorProperty; + typedef Property IntProperty; + + /** XML reader instance + */ + irr::io::IrrXMLReader* reader; + + // ------------------------------------------------------------------- + /** Parse a material description from the XML + * @return The created material + * @param matFlags Receives AI_IRRMESH_MAT_XX flags + */ + aiMaterial* ParseMaterial(unsigned int& matFlags); + + // ------------------------------------------------------------------- + /** Read a property of the specified type from the current XML element. + * @param out Receives output data + */ + void ReadHexProperty (HexProperty& out); + void ReadStringProperty (StringProperty& out); + void ReadBoolProperty (BoolProperty& out); + void ReadFloatProperty (FloatProperty& out); + void ReadVectorProperty (VectorProperty& out); + void ReadIntProperty (IntProperty& out); +}; + + +// ------------------------------------------------------------------------------------------------ +// Unpack a hex color, e.g. 0xdcdedfff +inline void ColorFromARGBPacked(uint32_t in, aiColor4D& clr) +{ + clr.a = ((in >> 24) & 0xff) / 255.f; + clr.r = ((in >> 16) & 0xff) / 255.f; + clr.g = ((in >> 8) & 0xff) / 255.f; + clr.b = ((in ) & 0xff) / 255.f; +} + + +} // end namespace Assimp + +#endif // !! INCLUDED_AI_IRRSHARED_H diff --git a/Engine/lib/assimp/code/LWOAnimation.cpp b/Engine/lib/assimp/code/LWO/LWOAnimation.cpp similarity index 100% rename from Engine/lib/assimp/code/LWOAnimation.cpp rename to Engine/lib/assimp/code/LWO/LWOAnimation.cpp diff --git a/Engine/lib/assimp/code/LWOAnimation.h b/Engine/lib/assimp/code/LWO/LWOAnimation.h similarity index 100% rename from Engine/lib/assimp/code/LWOAnimation.h rename to Engine/lib/assimp/code/LWO/LWOAnimation.h diff --git a/Engine/lib/assimp/code/LWOBLoader.cpp b/Engine/lib/assimp/code/LWO/LWOBLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/LWOBLoader.cpp rename to Engine/lib/assimp/code/LWO/LWOBLoader.cpp diff --git a/Engine/lib/assimp/code/LWOFileData.h b/Engine/lib/assimp/code/LWO/LWOFileData.h similarity index 99% rename from Engine/lib/assimp/code/LWOFileData.h rename to Engine/lib/assimp/code/LWO/LWOFileData.h index a702d9363..7d1f6b1df 100644 --- a/Engine/lib/assimp/code/LWOFileData.h +++ b/Engine/lib/assimp/code/LWO/LWOFileData.h @@ -57,8 +57,8 @@ The chunks are taken from the official LightWave SDK headers. #include // internal headers -#include "IFF.h" -#include "LWOAnimation.h" +#include "Common/IFF.h" +#include "LWO/LWOAnimation.h" namespace Assimp { namespace LWO { diff --git a/Engine/lib/assimp/code/LWOLoader.cpp b/Engine/lib/assimp/code/LWO/LWOLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/LWOLoader.cpp rename to Engine/lib/assimp/code/LWO/LWOLoader.cpp index d1c2641e8..1e5b92c32 100644 --- a/Engine/lib/assimp/code/LWOLoader.cpp +++ b/Engine/lib/assimp/code/LWO/LWOLoader.cpp @@ -49,14 +49,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_LWO_IMPORTER // internal headers -#include "LWOLoader.h" +#include "LWO/LWOLoader.h" +#include "PostProcessing/ProcessHelper.h" +#include "PostProcessing/ConvertToLHProcess.h" + #include #include #include -#include "ProcessHelper.h" -#include "ConvertToLHProcess.h" #include #include + #include #include #include @@ -1326,6 +1328,7 @@ void LWOImporter::LoadLWO2File() bool skip = false; LE_NCONST uint8_t* const end = mFileBuffer + fileSize; + unsigned int iUnnamed = 0; while (true) { if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)break; @@ -1337,7 +1340,6 @@ void LWOImporter::LoadLWO2File() break; } uint8_t* const next = mFileBuffer+head.length; - unsigned int iUnnamed = 0; if(!head.length) { mFileBuffer = next; diff --git a/Engine/lib/assimp/code/LWOLoader.h b/Engine/lib/assimp/code/LWO/LWOLoader.h similarity index 100% rename from Engine/lib/assimp/code/LWOLoader.h rename to Engine/lib/assimp/code/LWO/LWOLoader.h diff --git a/Engine/lib/assimp/code/LWOMaterial.cpp b/Engine/lib/assimp/code/LWO/LWOMaterial.cpp similarity index 99% rename from Engine/lib/assimp/code/LWOMaterial.cpp rename to Engine/lib/assimp/code/LWO/LWOMaterial.cpp index 55d0e23f1..b54c21c26 100644 --- a/Engine/lib/assimp/code/LWOMaterial.cpp +++ b/Engine/lib/assimp/code/LWO/LWOMaterial.cpp @@ -320,13 +320,10 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,aiMaterial* pcMat) // opacity ... either additive or default-blended, please if (0.0 != surf.mAdditiveTransparency) { - const int add = aiBlendMode_Additive; pcMat->AddProperty(&surf.mAdditiveTransparency,1,AI_MATKEY_OPACITY); pcMat->AddProperty(&add,1,AI_MATKEY_BLEND_FUNC); - } - - else if (10e10f != surf.mTransparency) { + } else if (10e10f != surf.mTransparency) { const int def = aiBlendMode_Default; const float f = 1.0f-surf.mTransparency; pcMat->AddProperty(&f,1,AI_MATKEY_OPACITY); diff --git a/Engine/lib/assimp/code/LWSLoader.cpp b/Engine/lib/assimp/code/LWS/LWSLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/LWSLoader.cpp rename to Engine/lib/assimp/code/LWS/LWSLoader.cpp index d0811625c..b52cafa6d 100644 --- a/Engine/lib/assimp/code/LWSLoader.cpp +++ b/Engine/lib/assimp/code/LWS/LWSLoader.cpp @@ -48,19 +48,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_LWS_IMPORTER -#include "LWSLoader.h" +#include "LWS/LWSLoader.h" +#include "PostProcessing/ConvertToLHProcess.h" +#include "Common/Importer.h" + #include #include - #include #include #include -#include "ConvertToLHProcess.h" -#include "Importer.h" #include #include #include #include + #include using namespace Assimp; diff --git a/Engine/lib/assimp/code/LWSLoader.h b/Engine/lib/assimp/code/LWS/LWSLoader.h similarity index 99% rename from Engine/lib/assimp/code/LWSLoader.h rename to Engine/lib/assimp/code/LWS/LWSLoader.h index 3c24b59ea..eed0491f3 100644 --- a/Engine/lib/assimp/code/LWSLoader.h +++ b/Engine/lib/assimp/code/LWS/LWSLoader.h @@ -46,7 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_LWSLOADER_H_INCLUDED #define AI_LWSLOADER_H_INCLUDED -#include "LWOFileData.h" +#include "LWO/LWOFileData.h" + #include #include diff --git a/Engine/lib/assimp/code/LineSplitter.h b/Engine/lib/assimp/code/LineSplitter.h deleted file mode 100644 index 003b42d52..000000000 --- a/Engine/lib/assimp/code/LineSplitter.h +++ /dev/null @@ -1,243 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file LineSplitter.h - * @brief LineSplitter, a helper class to iterate through all lines - * of a file easily. Works with StreamReader. - */ -#ifndef INCLUDED_LINE_SPLITTER_H -#define INCLUDED_LINE_SPLITTER_H - -#include - -#include "StreamReader.h" -#include "ParsingUtils.h" - -namespace Assimp { - -// ------------------------------------------------------------------------------------------------ -/** Usage: -@code -for(LineSplitter splitter(stream);splitter;++splitter) { - - if (*splitter == "hi!") { - ... - } - else if (splitter->substr(0,5) == "hello") { - ... - // access the third token in the line (tokens are space-separated) - if (strtol(splitter[2]) > 5) { .. } - } - - std::cout << "Current line is: " << splitter.get_index() << std::endl; -} -@endcode -*/ -// ------------------------------------------------------------------------------------------------ -class LineSplitter { -public: - typedef size_t line_idx; - - // ----------------------------------------- - /** construct from existing stream reader - note: trim is *always* assumed true if skyp_empty_lines==true - */ - LineSplitter(StreamReaderLE& stream, bool skip_empty_lines = true, bool trim = true) - : idx( 0 ) - , stream(stream) - , swallow() - , skip_empty_lines(skip_empty_lines) - , trim(trim) { - cur.reserve(1024); - operator++(); - - idx = 0; - } - - ~LineSplitter() { - // empty - } - -public: - - // ----------------------------------------- - /** pseudo-iterator increment */ - LineSplitter& operator++() { - if(swallow) { - swallow = false; - return *this; - } - if (!*this) { - throw std::logic_error("End of file, no more lines to be retrieved."); - } - char s; - cur.clear(); - while(stream.GetRemainingSize() && (s = stream.GetI1(),1)) { - if (s == '\n' || s == '\r') { - if (skip_empty_lines) { - while (stream.GetRemainingSize() && ((s = stream.GetI1()) == ' ' || s == '\r' || s == '\n')); - if (stream.GetRemainingSize()) { - stream.IncPtr(-1); - } - } - else { - // skip both potential line terminators but don't read past this line. - if (stream.GetRemainingSize() && (s == '\r' && stream.GetI1() != '\n')) { - stream.IncPtr(-1); - } - if (trim) { - while (stream.GetRemainingSize() && ((s = stream.GetI1()) == ' ' || s == '\t')); - if (stream.GetRemainingSize()) { - stream.IncPtr(-1); - } - } - } - break; - } - cur += s; - } - ++idx; - return *this; - } - - // ----------------------------------------- - LineSplitter& operator++(int) { - return ++(*this); - } - - // ----------------------------------------- - /** get a pointer to the beginning of a particular token */ - const char* operator[] (size_t idx) const { - const char* s = operator->()->c_str(); - - SkipSpaces(&s); - for(size_t i = 0; i < idx; ++i) { - - for(;!IsSpace(*s); ++s) { - if(IsLineEnd(*s)) { - throw std::range_error("Token index out of range, EOL reached"); - } - } - SkipSpaces(&s); - } - return s; - } - - // ----------------------------------------- - /** extract the start positions of N tokens from the current line*/ - template - void get_tokens(const char* (&tokens)[N]) const { - const char* s = operator->()->c_str(); - - SkipSpaces(&s); - for(size_t i = 0; i < N; ++i) { - if(IsLineEnd(*s)) { - - throw std::range_error("Token count out of range, EOL reached"); - - } - tokens[i] = s; - - for(;*s && !IsSpace(*s); ++s); - SkipSpaces(&s); - } - } - - // ----------------------------------------- - /** member access */ - const std::string* operator -> () const { - return &cur; - } - - std::string operator* () const { - return cur; - } - - // ----------------------------------------- - /** boolean context */ - operator bool() const { - return stream.GetRemainingSize()>0; - } - - // ----------------------------------------- - /** line indices are zero-based, empty lines are included */ - operator line_idx() const { - return idx; - } - - line_idx get_index() const { - return idx; - } - - // ----------------------------------------- - /** access the underlying stream object */ - StreamReaderLE& get_stream() { - return stream; - } - - // ----------------------------------------- - /** !strcmp((*this)->substr(0,strlen(check)),check) */ - bool match_start(const char* check) { - const size_t len = strlen(check); - - return len <= cur.length() && std::equal(check,check+len,cur.begin()); - } - - - // ----------------------------------------- - /** swallow the next call to ++, return the previous value. */ - void swallow_next_increment() { - swallow = true; - } - -private: - LineSplitter( const LineSplitter & ); - LineSplitter &operator = ( const LineSplitter & ); - -private: - line_idx idx; - std::string cur; - StreamReaderLE& stream; - bool swallow, skip_empty_lines, trim; -}; - -} -#endif // INCLUDED_LINE_SPLITTER_H diff --git a/Engine/lib/assimp/code/LogAux.h b/Engine/lib/assimp/code/LogAux.h deleted file mode 100644 index f2bc14d54..000000000 --- a/Engine/lib/assimp/code/LogAux.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file LogAux.h - * @brief Common logging usage patterns for importer implementations - */ -#ifndef INCLUDED_AI_LOGAUX_H -#define INCLUDED_AI_LOGAUX_H - -#include "TinyFormatter.h" -#include "Exceptional.h" -#include - -namespace Assimp { - -template -class LogFunctions -{ - -public: - - // ------------------------------------------------------------------------------------------------ - static void ThrowException(const std::string& msg) - { - throw DeadlyImportError(Prefix()+msg); - } - - // ------------------------------------------------------------------------------------------------ - static void LogWarn(const Formatter::format& message) { - if (!DefaultLogger::isNullLogger()) { - DefaultLogger::get()->warn(Prefix()+(std::string)message); - } - } - - // ------------------------------------------------------------------------------------------------ - static void LogError(const Formatter::format& message) { - if (!DefaultLogger::isNullLogger()) { - DefaultLogger::get()->error(Prefix()+(std::string)message); - } - } - - // ------------------------------------------------------------------------------------------------ - static void LogInfo(const Formatter::format& message) { - if (!DefaultLogger::isNullLogger()) { - DefaultLogger::get()->info(Prefix()+(std::string)message); - } - } - - // ------------------------------------------------------------------------------------------------ - static void LogDebug(const Formatter::format& message) { - if (!DefaultLogger::isNullLogger()) { - DefaultLogger::get()->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) - - // ------------------------------------------------------------------------------------------------ - static void LogWarn (const char* message) { - if (!DefaultLogger::isNullLogger()) { - LogWarn(Formatter::format(message)); - } - } - - // ------------------------------------------------------------------------------------------------ - static void LogError (const char* message) { - if (!DefaultLogger::isNullLogger()) { - LogError(Formatter::format(message)); - } - } - - // ------------------------------------------------------------------------------------------------ - static void LogInfo (const char* message) { - if (!DefaultLogger::isNullLogger()) { - LogInfo(Formatter::format(message)); - } - } - - // ------------------------------------------------------------------------------------------------ - static void LogDebug (const char* message) { - if (!DefaultLogger::isNullLogger()) { - LogDebug(Formatter::format(message)); - } - } - -#endif - -private: - static const char* Prefix(); - -}; - -} // ! Assimp -#endif diff --git a/Engine/lib/assimp/code/M3D/M3DExporter.cpp b/Engine/lib/assimp/code/M3D/M3DExporter.cpp new file mode 100644 index 000000000..c22943396 --- /dev/null +++ b/Engine/lib/assimp/code/M3D/M3DExporter.cpp @@ -0,0 +1,395 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, assimp team +Copyright (c) 2019 bzt + +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_M3D_EXPORTER + +#define M3D_IMPLEMENTATION +#define M3D_NOIMPORTER +#define M3D_EXPORTER +#define M3D_ASCII +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER +#define M3D_NODUP +#endif + +// Header files, standard library. +#include // shared_ptr +#include +#include + +#include // aiGetVersion +#include +#include +#include +#include // StreamWriterLE +#include // DeadlyExportError +#include // aiTextureType +#include +#include +#include "M3DExporter.h" +#include "M3DMaterials.h" + +// RESOURCES: +// https://gitlab.com/bztsrc/model3d/blob/master/docs/m3d_format.md +// https://gitlab.com/bztsrc/model3d/blob/master/docs/a3d_format.md + +/* + * Currently supports static meshes, vertex colors, materials, textures + * + * For animation, it would require the following conversions: + * - aiNode (bones) -> m3d_t.bone (with parent id, position vector and oriantation quaternion) + * - aiMesh.aiBone -> m3d_t.skin (per vertex, with bone id, weight pairs) + * - aiAnimation -> m3d_action (frame with timestamp and list of bone id, position, orientation + * triplets, instead of per bone timestamp + lists) + */ +using namespace Assimp; + +namespace Assimp { + + // --------------------------------------------------------------------- + // Worker function for exporting a scene to binary M3D. + // Prototyped and registered in Exporter.cpp + void ExportSceneM3D ( + const char* pFile, + IOSystem* pIOSystem, + const aiScene* pScene, + const ExportProperties* pProperties + ){ + // initialize the exporter + M3DExporter exporter(pScene, pProperties); + + // perform binary export + exporter.doExport(pFile, pIOSystem, false); + } + + // --------------------------------------------------------------------- + // Worker function for exporting a scene to ASCII A3D. + // Prototyped and registered in Exporter.cpp + void ExportSceneA3D ( + const char* pFile, + IOSystem* pIOSystem, + const aiScene* pScene, + const ExportProperties* pProperties + + ){ + // initialize the exporter + M3DExporter exporter(pScene, pProperties); + + // perform ascii export + exporter.doExport(pFile, pIOSystem, true); + } + +} // end of namespace Assimp + +// ------------------------------------------------------------------------------------------------ +M3DExporter::M3DExporter ( const aiScene* pScene, const ExportProperties* pProperties ) +: mScene(pScene) +, mProperties(pProperties) +, outfile() +, m3d(nullptr) { } + +// ------------------------------------------------------------------------------------------------ +void M3DExporter::doExport ( + const char* pFile, + IOSystem* pIOSystem, + bool toAscii +){ + // TODO: convert mProperties into M3D_EXP_* flags + (void)mProperties; + + // open the indicated file for writing (in binary / ASCII mode) + outfile.reset(pIOSystem->Open(pFile, toAscii ? "wt" : "wb")); + if (!outfile) { + throw DeadlyExportError( "could not open output .m3d file: " + std::string(pFile) ); + } + + // use malloc() here because m3d_free() will call free() + m3d = (m3d_t*)calloc(1, sizeof(m3d_t)); + if(!m3d) { + throw DeadlyExportError( "memory allocation error" ); + } + m3d->name = _m3d_safestr((char*)&mScene->mRootNode->mName.data, 2); + + // Create a model from assimp structures + aiMatrix4x4 m; + NodeWalk(mScene->mRootNode, m); + + // serialize the structures + unsigned int size; + unsigned char *output = m3d_save(m3d, M3D_EXP_FLOAT, + M3D_EXP_EXTRA | (toAscii ? M3D_EXP_ASCII : 0), &size); + m3d_free(m3d); + if(!output || size < 8) { + throw DeadlyExportError( "unable to serialize into Model 3D" ); + } + + // Write out serialized model + outfile->Write(output, size, 1); + + // explicitly release file pointer, + // so we don't have to rely on class destruction. + outfile.reset(); +} + +// ------------------------------------------------------------------------------------------------ +// recursive node walker +void M3DExporter::NodeWalk(const aiNode* pNode, aiMatrix4x4 m) +{ + aiMatrix4x4 nm = m * pNode->mTransformation; + + for(unsigned int i = 0; i < pNode->mNumMeshes; i++) { + const aiMesh *mesh = mScene->mMeshes[pNode->mMeshes[i]]; + unsigned int mi = (M3D_INDEX)-1U; + if(mScene->mMaterials) { + // get the material for this mesh + mi = addMaterial(mScene->mMaterials[mesh->mMaterialIndex]); + } + // iterate through the mesh faces + for(unsigned int j = 0; j < mesh->mNumFaces; j++) { + unsigned int n; + const aiFace* face = &(mesh->mFaces[j]); + // only triangle meshes supported for now + if(face->mNumIndices != 3) { + throw DeadlyExportError( "use aiProcess_Triangulate before export" ); + } + // add triangle to the output + n = m3d->numface++; + m3d->face = (m3df_t*)M3D_REALLOC(m3d->face, + m3d->numface * sizeof(m3df_t)); + if(!m3d->face) { + throw DeadlyExportError( "memory allocation error" ); + } + /* set all index to -1 by default */ + m3d->face[n].vertex[0] = m3d->face[n].vertex[1] = m3d->face[n].vertex[2] = + m3d->face[n].normal[0] = m3d->face[n].normal[1] = m3d->face[n].normal[2] = + m3d->face[n].texcoord[0] = m3d->face[n].texcoord[1] = m3d->face[n].texcoord[2] = -1U; + m3d->face[n].materialid = mi; + for(unsigned int k = 0; k < face->mNumIndices; k++) { + // get the vertex's index + unsigned int l = face->mIndices[k]; + unsigned int idx; + m3dv_t vertex; + m3dti_t ti; + // multiply the position vector by the transformation matrix + aiVector3D v = mesh->mVertices[l]; + v *= nm; + vertex.x = v.x; + vertex.y = v.y; + vertex.z = v.z; + vertex.w = 1.0; + vertex.color = 0; + vertex.skinid = -1U; + // add color if defined + if(mesh->HasVertexColors(0)) + vertex.color = mkColor(&mesh->mColors[0][l]); + // save the vertex to the output + m3d->vertex = _m3d_addvrtx(m3d->vertex, &m3d->numvertex, + &vertex, &idx); + m3d->face[n].vertex[k] = (M3D_INDEX)idx; + // do we have texture coordinates? + if(mesh->HasTextureCoords(0)) { + ti.u = mesh->mTextureCoords[0][l].x; + ti.v = mesh->mTextureCoords[0][l].y; + m3d->tmap = _m3d_addtmap(m3d->tmap, &m3d->numtmap, &ti, + &idx); + m3d->face[n].texcoord[k] = (M3D_INDEX)idx; + } + // do we have normal vectors? + if(mesh->HasNormals()) { + vertex.color = 0; + vertex.x = mesh->mNormals[l].x; + vertex.y = mesh->mNormals[l].y; + vertex.z = mesh->mNormals[l].z; + m3d->vertex = _m3d_addnorm(m3d->vertex, &m3d->numvertex, + &vertex, &idx); + m3d->face[n].normal[k] = (M3D_INDEX)idx; + } + } + } + } + // repeat for the children nodes + for (unsigned int i = 0; i < pNode->mNumChildren; i++) { + NodeWalk(pNode->mChildren[i], nm); + } +} + +// ------------------------------------------------------------------------------------------------ +// convert aiColor4D into uint32_t +uint32_t M3DExporter::mkColor(aiColor4D* c) +{ + return ((uint8_t)(c->a*255) << 24L) | + ((uint8_t)(c->b*255) << 16L) | + ((uint8_t)(c->g*255) << 8L) | + ((uint8_t)(c->r*255) << 0L); +} + +// ------------------------------------------------------------------------------------------------ +// add a material to the output +M3D_INDEX M3DExporter::addMaterial(const aiMaterial *mat) +{ + unsigned int mi = -1U; + aiColor4D c; + aiString name; + ai_real f; + char *fn; + + if(mat && mat->Get(AI_MATKEY_NAME, name) == AI_SUCCESS && name.length && + strcmp((char*)&name.data, AI_DEFAULT_MATERIAL_NAME)) { + // check if we have saved a material by this name. This has to be done + // because only the referenced materials should be added to the output + for(unsigned int i = 0; i < m3d->nummaterial; i++) + if(!strcmp((char*)&name.data, m3d->material[i].name)) { + mi = i; + break; + } + // if not found, add the material to the output + if(mi == -1U) { + unsigned int k; + mi = m3d->nummaterial++; + m3d->material = (m3dm_t*)M3D_REALLOC(m3d->material, m3d->nummaterial + * sizeof(m3dm_t)); + if(!m3d->material) { + throw DeadlyExportError( "memory allocation error" ); + } + m3d->material[mi].name = _m3d_safestr((char*)&name.data, 0); + m3d->material[mi].numprop = 0; + m3d->material[mi].prop = NULL; + // iterate through the material property table and see what we got + for(k = 0; k < 15; k++) { + unsigned int j; + if(m3d_propertytypes[k].format == m3dpf_map) + continue; + if(aiProps[k].pKey) { + switch(m3d_propertytypes[k].format) { + case m3dpf_color: + if(mat->Get(aiProps[k].pKey, aiProps[k].type, + aiProps[k].index, c) == AI_SUCCESS) + addProp(&m3d->material[mi], + m3d_propertytypes[k].id, mkColor(&c)); + break; + case m3dpf_float: + if(mat->Get(aiProps[k].pKey, aiProps[k].type, + aiProps[k].index, f) == AI_SUCCESS) + addProp(&m3d->material[mi], + m3d_propertytypes[k].id, + /* not (uint32_t)f, because we don't want to convert + * it, we want to see it as 32 bits of memory */ + *((uint32_t*)&f)); + break; + case m3dpf_uint8: + if(mat->Get(aiProps[k].pKey, aiProps[k].type, + aiProps[k].index, j) == AI_SUCCESS) { + // special conversion for illumination model property + if(m3d_propertytypes[k].id == m3dp_il) { + switch(j) { + case aiShadingMode_NoShading: j = 0; break; + case aiShadingMode_Phong: j = 2; break; + default: j = 1; break; + } + } + addProp(&m3d->material[mi], + m3d_propertytypes[k].id, j); + } + break; + default: + if(mat->Get(aiProps[k].pKey, aiProps[k].type, + aiProps[k].index, j) == AI_SUCCESS) + addProp(&m3d->material[mi], + m3d_propertytypes[k].id, j); + break; + } + } + if(aiTxProps[k].pKey && + mat->GetTexture((aiTextureType)aiTxProps[k].type, + aiTxProps[k].index, &name, NULL, NULL, NULL, + NULL, NULL) == AI_SUCCESS) { + unsigned int i; + for(j = name.length-1; j > 0 && name.data[j]!='.'; j++); + if(j && name.data[j]=='.' && + (name.data[j+1]=='p' || name.data[j+1]=='P') && + (name.data[j+1]=='n' || name.data[j+1]=='N') && + (name.data[j+1]=='g' || name.data[j+1]=='G')) + name.data[j]=0; + // do we have this texture saved already? + fn = _m3d_safestr((char*)&name.data, 0); + for(j = 0, i = -1U; j < m3d->numtexture; j++) + if(!strcmp(fn, m3d->texture[j].name)) { + i = j; + free(fn); + break; + } + if(i == -1U) { + i = m3d->numtexture++; + m3d->texture = (m3dtx_t*)M3D_REALLOC( + m3d->texture, + m3d->numtexture * sizeof(m3dtx_t)); + if(!m3d->texture) { + throw DeadlyExportError( "memory allocation error" ); + } + // we don't need the texture itself, only its name + m3d->texture[i].name = fn; + m3d->texture[i].w = 0; + m3d->texture[i].h = 0; + m3d->texture[i].d = NULL; + } + addProp(&m3d->material[mi], + m3d_propertytypes[k].id + 128, i); + } + } + } + } + return mi; +} + +// ------------------------------------------------------------------------------------------------ +// add a material property to the output +void M3DExporter::addProp(m3dm_t *m, uint8_t type, uint32_t value) +{ + unsigned int i; + i = m->numprop++; + m->prop = (m3dp_t*)M3D_REALLOC(m->prop, m->numprop * sizeof(m3dp_t)); + if(!m->prop) { throw DeadlyExportError( "memory allocation error" ); } + m->prop[i].type = type; + m->prop[i].value.num = value; +} + +#endif // ASSIMP_BUILD_NO_M3D_EXPORTER +#endif // ASSIMP_BUILD_NO_EXPORT diff --git a/Engine/lib/assimp/code/ScaleProcess.cpp b/Engine/lib/assimp/code/M3D/M3DExporter.h similarity index 50% rename from Engine/lib/assimp/code/ScaleProcess.cpp rename to Engine/lib/assimp/code/M3D/M3DExporter.h index 6d458c4b1..dfcff8bc9 100644 --- a/Engine/lib/assimp/code/ScaleProcess.cpp +++ b/Engine/lib/assimp/code/M3D/M3DExporter.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) ---------------------------------------------------------------------- Copyright (c) 2006-2019, assimp team - +Copyright (c) 2019 bzt All rights reserved. @@ -39,65 +39,60 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -#ifndef ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS -#include "ScaleProcess.h" +/** @file M3DExporter.h +* @brief Declares the exporter class to write a scene to a Model 3D file +*/ +#ifndef AI_M3DEXPORTER_H_INC +#define AI_M3DEXPORTER_H_INC -#include -#include +#ifndef ASSIMP_BUILD_NO_M3D_EXPORTER -namespace Assimp { +#include "m3d.h" -ScaleProcess::ScaleProcess() -: BaseProcess() -, mScale( AI_CONFIG_GLOBAL_SCALE_FACTOR_DEFAULT ) { - // empty +#include +//#include +#include // StreamWriterLE +#include // DeadlyExportError + +#include // shared_ptr + +struct aiScene; +struct aiNode; +struct aiMaterial; +struct aiFace; + +namespace Assimp +{ + class IOSystem; + class IOStream; + class ExportProperties; + + // --------------------------------------------------------------------- + /** Helper class to export a given scene to an M3D file. */ + // --------------------------------------------------------------------- + class M3DExporter + { + public: + /// Constructor for a specific scene to export + M3DExporter(const aiScene* pScene, const ExportProperties* pProperties); + // call this to do the actual export + void doExport(const char* pFile, IOSystem* pIOSystem, bool toAscii); + + private: + const aiScene* mScene; // the scene to export + const ExportProperties* mProperties; // currently unused + std::shared_ptr outfile; // file to write to + m3d_t *m3d; // model for the C library to convert to + + // helper to do the recursive walking + void NodeWalk(const aiNode* pNode, aiMatrix4x4 m); + uint32_t mkColor(aiColor4D* c); + M3D_INDEX addMaterial(const aiMaterial *mat); + void addProp(m3dm_t *m, uint8_t type, uint32_t value); + }; } -ScaleProcess::~ScaleProcess() { - // empty -} +#endif // ASSIMP_BUILD_NO_M3D_EXPORTER -void ScaleProcess::setScale( ai_real scale ) { - mScale = scale; -} - -ai_real ScaleProcess::getScale() const { - return mScale; -} - -bool ScaleProcess::IsActive( unsigned int pFlags ) const { - return ( pFlags & aiProcess_GlobalScale ) != 0; -} - -void ScaleProcess::SetupProperties( const Importer* pImp ) { - mScale = pImp->GetPropertyFloat( AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY, 0 ); -} - -void ScaleProcess::Execute( aiScene* pScene ) { - if ( nullptr == pScene ) { - return; - } - - if ( nullptr == pScene->mRootNode ) { - return; - } - - traverseNodes( pScene->mRootNode ); -} - -void ScaleProcess::traverseNodes( aiNode *node ) { - applyScaling( node ); -} - -void ScaleProcess::applyScaling( aiNode *currentNode ) { - if ( nullptr != currentNode ) { - currentNode->mTransformation.a1 = currentNode->mTransformation.a1 * mScale; - currentNode->mTransformation.b2 = currentNode->mTransformation.b2 * mScale; - currentNode->mTransformation.c3 = currentNode->mTransformation.c3 * mScale; - } -} - -} // Namespace Assimp - -#endif // !! ASSIMP_BUILD_NO_GLOBALSCALE_PROCESS +#endif // AI_M3DEXPORTER_H_INC diff --git a/Engine/lib/assimp/code/M3D/M3DImporter.cpp b/Engine/lib/assimp/code/M3D/M3DImporter.cpp new file mode 100644 index 000000000..fcff49df7 --- /dev/null +++ b/Engine/lib/assimp/code/M3D/M3DImporter.cpp @@ -0,0 +1,737 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, assimp team +Copyright (c) 2019 bzt + +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_M3D_IMPORTER + +#define M3D_IMPLEMENTATION +#define M3D_ASCII + +#include +#include +#include +#include +#include +#include +#include +#include +#include "M3DImporter.h" +#include "M3DMaterials.h" + +// RESOURCES: +// https://gitlab.com/bztsrc/model3d/blob/master/docs/m3d_format.md +// https://gitlab.com/bztsrc/model3d/blob/master/docs/a3d_format.md + +/* + Unfortunately aiNode has bone structures and meshes too, yet we can't assign + the mesh to a bone aiNode as a skin may refer to several aiNodes. Therefore + I've decided to import into this structure: + + aiScene->mRootNode + | |->mMeshes (all the meshes) + | \->children (empty if there's no skeleton imported, no meshes) + | \->skeleton root aiNode* + | |->bone aiNode + | | \->subbone aiNode + | |->bone aiNode + | | ... + | \->bone aiNode + \->mMeshes[] + \->aiBone, referencing mesh-less aiNodes from above + + * - normally one, but if a model has several skeleton roots, then all of them + are listed in aiScene->mRootNode->children, but all without meshes +*/ + +static const aiImporterDesc desc = { + "Model 3D Importer", + "", + "", + "", + aiImporterFlags_SupportBinaryFlavour, + 0, + 0, + 0, + 0, + "m3d a3d" +}; + +// workaround: the SDK expects a C callback, but we want to use Assimp::IOSystem to implement that +extern "C" { + void* m3dimporter_pIOHandler; + + unsigned char *m3dimporter_readfile(char *fn, unsigned int *size) { + ai_assert( nullptr != fn ); + ai_assert( nullptr != size ); + std::string file(fn); + std::unique_ptr pStream( + (reinterpret_cast(m3dimporter_pIOHandler))->Open( file, "rb")); + size_t fileSize = pStream->FileSize(); + // should be allocated with malloc(), because the library will call free() to deallocate + unsigned char *data = (unsigned char*)malloc(fileSize); + if( !data || !pStream.get() || !fileSize || fileSize != pStream->Read(data,1,fileSize)) { + pStream.reset(); + *size = 0; + // don't throw a deadly exception, it's not fatal if we can't read an external asset + return nullptr; + } + pStream.reset(); + *size = (int)fileSize; + return data; + } +} + +namespace Assimp { + +using namespace std; + +// ------------------------------------------------------------------------------------------------ +// Default constructor +M3DImporter::M3DImporter() +: mScene(nullptr) +, m3d(nullptr) { } + +// ------------------------------------------------------------------------------------------------ +// Destructor. +M3DImporter::~M3DImporter() {} + +// ------------------------------------------------------------------------------------------------ +// Returns true, if file is a binary or ASCII Model 3D file. +bool M3DImporter::CanRead(const std::string& pFile, IOSystem* pIOHandler , bool checkSig) const { + const std::string extension = GetExtension(pFile); + + if (extension == "m3d" || extension == "a3d") + return true; + else if (!extension.length() || checkSig) { + if (!pIOHandler) { + return true; + } + /* + * don't use CheckMagicToken because that checks with swapped bytes too, leading to false + * positives. This magic is not uint32_t, but char[4], so memcmp is the best way + + const char* tokens[] = {"3DMO", "3dmo"}; + return CheckMagicToken(pIOHandler,pFile,tokens,2,0,4); + */ + std::unique_ptr pStream (pIOHandler->Open(pFile, "rb")); + unsigned char data[4]; + if(4 != pStream->Read(data,1,4)) { + return false; + } + return !memcmp(data, "3DMO", 4) /* bin */ || !memcmp(data, "3dmo", 4) /* ASCII */; + } + return false; +} + +// ------------------------------------------------------------------------------------------------ +const aiImporterDesc* M3DImporter::GetInfo() const { + return &desc; +} + +// ------------------------------------------------------------------------------------------------ +// Model 3D import implementation +void M3DImporter::InternReadFile( const std::string &file, aiScene* pScene, IOSystem* pIOHandler) { + // Read file into memory + std::unique_ptr pStream( pIOHandler->Open( file, "rb")); + if( !pStream.get() ) { + throw DeadlyImportError( "Failed to open file " + file + "." ); + } + + // Get the file-size and validate it, throwing an exception when fails + size_t fileSize = pStream->FileSize(); + if( fileSize < 8 ) { + throw DeadlyImportError( "M3D-file " + file + " is too small." ); + } + std::unique_ptr _buffer (new unsigned char[fileSize]); + unsigned char *data( _buffer.get() ); + if(fileSize != pStream->Read(data,1,fileSize)) { + throw DeadlyImportError( "Failed to read the file " + file + "." ); + } + + // Get the path for external assets + std::string folderName( "./" ); + std::string::size_type pos = file.find_last_of( "\\/" ); + if ( pos != std::string::npos ) { + folderName = file.substr( 0, pos ); + if ( !folderName.empty() ) { + pIOHandler->PushDirectory( folderName ); + } + } + // pass this IOHandler to the C callback + m3dimporter_pIOHandler = pIOHandler; + + //DefaultLogger::create("/dev/stderr", Logger::VERBOSE); + ASSIMP_LOG_DEBUG_F("M3D: loading ", file); + + // let the C SDK do the hard work for us + m3d = m3d_load(&data[0], m3dimporter_readfile, free, nullptr); + m3dimporter_pIOHandler = nullptr; + if( !m3d ) { + throw DeadlyImportError( "Unable to parse " + file + " as M3D." ); + } + + // create the root node + pScene->mRootNode = new aiNode; + pScene->mRootNode->mName = aiString(std::string(std::string(m3d->name))); + pScene->mRootNode->mTransformation = aiMatrix4x4(); + pScene->mRootNode->mNumChildren = 0; + mScene = pScene; + + ASSIMP_LOG_DEBUG("M3D: root node " + std::string(m3d->name)); + + // now we just have to fill up the Assimp structures in pScene + importMaterials(); + importTextures(); + importBones(-1U, pScene->mRootNode); + importMeshes(); + importAnimations(); + + // we don't need the SDK's version any more + m3d_free(m3d); + + // Pop directory stack + if ( pIOHandler->StackSize() > 0 ) { + pIOHandler->PopDirectory(); + } +} + +// ------------------------------------------------------------------------------------------------ +// convert materials. properties are converted using a static table in M3DMaterials.h +void M3DImporter::importMaterials() +{ + unsigned int i, j, k, l, n; + m3dm_t *m; + aiString name = aiString(AI_DEFAULT_MATERIAL_NAME); + aiColor4D c; + ai_real f; + + ai_assert(mScene != nullptr); + ai_assert(m3d != nullptr); + + mScene->mNumMaterials = m3d->nummaterial + 1; + mScene->mMaterials = new aiMaterial*[ m3d->nummaterial + 1 ]; + + ASSIMP_LOG_DEBUG_F("M3D: importMaterials ", mScene->mNumMaterials); + + // add a default material as first + aiMaterial* mat = new aiMaterial; + mat->AddProperty( &name, AI_MATKEY_NAME ); + c.a = 1.0; c.b = c.g = c.r = 0.6; + mat->AddProperty( &c, 1, AI_MATKEY_COLOR_DIFFUSE); + mScene->mMaterials[0] = mat; + + for(i = 0; i < m3d->nummaterial; i++) { + m = &m3d->material[i]; + aiMaterial* mat = new aiMaterial; + name.Set(std::string(m->name)); + mat->AddProperty( &name, AI_MATKEY_NAME ); + for(j = 0; j < m->numprop; j++) { + // look up property type + // 0 - 127 scalar values, + // 128 - 255 the same properties but for texture maps + k = 256; + for(l = 0; l < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); l++) + if(m->prop[j].type == m3d_propertytypes[l].id || + m->prop[j].type == m3d_propertytypes[l].id + 128) { + k = l; + break; + } + // should never happen, but be safe than sorry + if(k == 256) continue; + + // scalar properties + if(m->prop[j].type < 128 && aiProps[k].pKey) { + switch(m3d_propertytypes[k].format) { + case m3dpf_color: + c = mkColor(m->prop[j].value.color); + mat->AddProperty(&c, 1, aiProps[k].pKey, aiProps[k].type, aiProps[k].index); + break; + case m3dpf_float: + f = m->prop[j].value.fnum; + mat->AddProperty(&f, 1, aiProps[k].pKey, aiProps[k].type, aiProps[k].index); + break; + default: + n = m->prop[j].value.num; + if(m->prop[j].type == m3dp_il) { + switch(n) { + case 0: n = aiShadingMode_NoShading; break; + case 2: n = aiShadingMode_Phong; break; + default: n = aiShadingMode_Gouraud; break; + } + } + mat->AddProperty(&n, 1, aiProps[k].pKey, aiProps[k].type, aiProps[k].index); + break; + } + } + // texture map properties + if(m->prop[j].type >= 128 && aiTxProps[k].pKey && + // extra check, should never happen, do we have the refered texture? + m->prop[j].value.textureid < m3d->numtexture && + m3d->texture[m->prop[j].value.textureid].name) { + name.Set(std::string(std::string(m3d->texture[m->prop[j].value.textureid].name) + ".png")); + mat->AddProperty(&name, aiProps[k].pKey, aiProps[k].type, aiProps[k].index); + n = 0; + mat->AddProperty(&n, 1, _AI_MATKEY_UVWSRC_BASE, aiProps[k].type, aiProps[k].index); + } + } + mScene->mMaterials[i + 1] = mat; + } +} + +// ------------------------------------------------------------------------------------------------ +// import textures, this is the simplest of all +void M3DImporter::importTextures() +{ + unsigned int i; + m3dtx_t *t; + + ai_assert(mScene != nullptr); + ai_assert(m3d != nullptr); + + mScene->mNumTextures = m3d->numtexture; + ASSIMP_LOG_DEBUG_F("M3D: importTextures ", mScene->mNumTextures); + + if(!m3d->numtexture) + return; + + mScene->mTextures = new aiTexture*[m3d->numtexture]; + for(i = 0; i < m3d->numtexture; i++) { + t = &m3d->texture[i]; + aiTexture *tx = new aiTexture; + strcpy(tx->achFormatHint, "rgba8888"); + tx->mFilename = aiString(std::string(t->name) + ".png"); + tx->mWidth = t->w; + tx->mHeight = t->h; + tx->pcData = new aiTexel[ tx->mWidth*tx->mHeight ]; + memcpy(tx->pcData, t->d, tx->mWidth*tx->mHeight*4); + mScene->mTextures[i] = tx; + } +} + +// ------------------------------------------------------------------------------------------------ +// this is tricky. M3D has a global vertex and UV list, and faces are indexing them +// individually. In assimp there're per mesh vertex and UV lists, and they must be +// indexed simultaneously. +void M3DImporter::importMeshes() +{ + unsigned int i, j, k, l, numpoly = 3, lastMat = -2U; + std::vector *meshes = new std::vector(); + std::vector *faces = nullptr; + std::vector *vertices = nullptr; + std::vector *normals = nullptr; + std::vector *texcoords = nullptr; + std::vector *colors = nullptr; + std::vector *vertexids = nullptr; + aiMesh *pMesh = nullptr; + + ai_assert(mScene != nullptr); + ai_assert(m3d != nullptr); + ai_assert(mScene->mRootNode != nullptr); + + ASSIMP_LOG_DEBUG_F("M3D: importMeshes ", m3d->numface); + + for(i = 0; i < m3d->numface; i++) { + // we must switch mesh if material changes + if(lastMat != m3d->face[i].materialid) { + lastMat = m3d->face[i].materialid; + if(pMesh && vertices->size() && faces->size()) { + populateMesh(pMesh, faces, vertices, normals, texcoords, colors, vertexids); + meshes->push_back(pMesh); + delete vertexids; // this is not stored in pMesh, just to collect bone vertices + } + pMesh = new aiMesh; + pMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE; + pMesh->mMaterialIndex = lastMat + 1; + faces = new std::vector(); + vertices = new std::vector(); + normals = new std::vector(); + texcoords = new std::vector(); + colors = new std::vector(); + vertexids = new std::vector(); + } + // add a face to temporary vector + aiFace *pFace = new aiFace; + pFace->mNumIndices = numpoly; + pFace->mIndices = new unsigned int[numpoly]; + for(j = 0; j < numpoly; j++) { + aiVector3D pos, uv, norm; + k = vertices->size(); + pFace->mIndices[j] = k; + l = m3d->face[i].vertex[j]; + pos.x = m3d->vertex[l].x; + pos.y = m3d->vertex[l].y; + pos.z = m3d->vertex[l].z; + vertices->push_back(pos); + colors->push_back(mkColor(m3d->vertex[l].color)); + // add a bone to temporary vector + if(m3d->vertex[l].skinid != -1U &&m3d->vertex[l].skinid != -2U && m3d->skin && m3d->bone) { + // this is complicated, because M3D stores a list of bone id / weight pairs per + // vertex but assimp uses lists of local vertex id/weight pairs per local bone list + vertexids->push_back(l); + } + l = m3d->face[i].texcoord[j]; + if(l != -1U) { + uv.x = m3d->tmap[l].u; + uv.y = m3d->tmap[l].v; + uv.z = 0.0; + texcoords->push_back(uv); + } + l = m3d->face[i].normal[j]; + if(l != -1U) { + norm.x = m3d->vertex[l].x; + norm.y = m3d->vertex[l].y; + norm.z = m3d->vertex[l].z; + normals->push_back(norm); + } + } + faces->push_back(*pFace); + delete pFace; + } + // if there's data left in the temporary vectors, flush them + if(pMesh && vertices->size() && faces->size()) { + populateMesh(pMesh, faces, vertices, normals, texcoords, colors, vertexids); + meshes->push_back(pMesh); + } + + // create global mesh list in scene + mScene->mNumMeshes = meshes->size(); + mScene->mMeshes = new aiMesh*[mScene->mNumMeshes]; + std::copy(meshes->begin(), meshes->end(), mScene->mMeshes); + + // create mesh indeces in root node + mScene->mRootNode->mNumMeshes = meshes->size(); + mScene->mRootNode->mMeshes = new unsigned int[meshes->size()]; + for(i = 0; i < meshes->size(); i++) { + mScene->mRootNode->mMeshes[i] = i; + } + + delete meshes; + if(faces) delete faces; + if(vertices) delete vertices; + if(normals) delete normals; + if(texcoords) delete texcoords; + if(colors) delete colors; + if(vertexids) delete vertexids; +} + +// ------------------------------------------------------------------------------------------------ +// a reentrant node parser. Otherwise this is simple +void M3DImporter::importBones(unsigned int parentid, aiNode *pParent) +{ + unsigned int i, n; + + ai_assert(pParent != nullptr); + ai_assert(mScene != nullptr); + ai_assert(m3d != nullptr); + + ASSIMP_LOG_DEBUG_F("M3D: importBones ", m3d->numbone, " parentid ", (int)parentid); + + for(n = 0, i = parentid + 1; i < m3d->numbone; i++) + if(m3d->bone[i].parent == parentid) n++; + pParent->mChildren = new aiNode*[n]; + + for(i = parentid + 1; i < m3d->numbone; i++) { + if(m3d->bone[i].parent == parentid) { + aiNode *pChild = new aiNode; + pChild->mParent = pParent; + pChild->mName = aiString(std::string(m3d->bone[i].name)); + convertPose(&pChild->mTransformation, m3d->bone[i].pos, m3d->bone[i].ori); + pChild->mNumChildren = 0; + pParent->mChildren[pParent->mNumChildren] = pChild; + pParent->mNumChildren++; + importBones(i, pChild); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// this is another headache. M3D stores list of changed bone id/position/orientation triplets and +// a timestamp per frame, but assimp needs timestamp and lists of position, orientation lists per +// bone, so we have to convert between the two conceptually different representation forms +void M3DImporter::importAnimations() +{ + unsigned int i, j, k, l, pos, ori; + double t; + m3da_t *a; + + ai_assert(mScene != nullptr); + ai_assert(m3d != nullptr); + + mScene->mNumAnimations = m3d->numaction; + + ASSIMP_LOG_DEBUG_F("M3D: importAnimations ", mScene->mNumAnimations); + + if(!m3d->numaction || !m3d->numbone) + return; + + mScene->mAnimations = new aiAnimation*[m3d->numaction]; + for(i = 0; i < m3d->numaction; i++) { + a = &m3d->action[i]; + aiAnimation *pAnim = new aiAnimation; + pAnim->mName = aiString(std::string(a->name)); + pAnim->mDuration = ((double)a->durationmsec) / 10; + pAnim->mTicksPerSecond = 100; + // now we know how many bones are referenced in this animation + pAnim->mNumChannels = m3d->numbone; + pAnim->mChannels = new aiNodeAnim*[pAnim->mNumChannels]; + for(l = 0; l < m3d->numbone; l++) { + unsigned int n; + pAnim->mChannels[l] = new aiNodeAnim; + pAnim->mChannels[l]->mNodeName = aiString(std::string(m3d->bone[l].name)); + // now n is the size of positions / orientations arrays + pAnim->mChannels[l]->mNumPositionKeys = pAnim->mChannels[l]->mNumRotationKeys = a->numframe; + pAnim->mChannels[l]->mPositionKeys = new aiVectorKey[a->numframe]; + pAnim->mChannels[l]->mRotationKeys = new aiQuatKey[a->numframe]; + pos = m3d->bone[l].pos; + ori = m3d->bone[l].ori; + for(j = n = 0; j < a->numframe; j++) { + t = ((double)a->frame[j].msec) / 10; + for(k = 0; k < a->frame[j].numtransform; k++) { + if(a->frame[j].transform[k].boneid == l) { + pos = a->frame[j].transform[k].pos; + ori = a->frame[j].transform[k].ori; + } + } + m3dv_t *v = &m3d->vertex[pos]; + m3dv_t *q = &m3d->vertex[ori]; + pAnim->mChannels[l]->mPositionKeys[j].mTime = t; + pAnim->mChannels[l]->mPositionKeys[j].mValue.x = v->x; + pAnim->mChannels[l]->mPositionKeys[j].mValue.y = v->y; + pAnim->mChannels[l]->mPositionKeys[j].mValue.z = v->z; + pAnim->mChannels[l]->mRotationKeys[j].mTime = t; + pAnim->mChannels[l]->mRotationKeys[j].mValue.w = q->w; + pAnim->mChannels[l]->mRotationKeys[j].mValue.x = q->x; + pAnim->mChannels[l]->mRotationKeys[j].mValue.y = q->y; + pAnim->mChannels[l]->mRotationKeys[j].mValue.z = q->z; + }// foreach frame + }// foreach bones + mScene->mAnimations[i] = pAnim; + } +} + +// ------------------------------------------------------------------------------------------------ +// convert uint32_t into aiColor4D +aiColor4D M3DImporter::mkColor(uint32_t c) { + aiColor4D color; + color.a = ((float)((c >> 24)&0xff)) / 255; + color.b = ((float)((c >> 16)&0xff)) / 255; + color.g = ((float)((c >> 8)&0xff)) / 255; + color.r = ((float)((c >> 0)&0xff)) / 255; + return color; +} + +// ------------------------------------------------------------------------------------------------ +// convert a position id and orientation id into a 4 x 4 transformation matrix +void M3DImporter::convertPose(aiMatrix4x4 *m, unsigned int posid, unsigned int orientid) +{ + ai_assert(m != nullptr); + ai_assert(m3d != nullptr); + ai_assert(posid != -1U && posid < m3d->numvertex); + ai_assert(orientid != -1U && orientid < m3d->numvertex); + m3dv_t *p = &m3d->vertex[posid]; + m3dv_t *q = &m3d->vertex[orientid]; + + /* quaternion to matrix. Do NOT use aiQuaternion to aiMatrix3x3, gives bad results */ + if(q->x == 0.0 && q->y == 0.0 && q->z >= 0.7071065 && q->z <= 0.7071075 && q->w == 0.0) { + m->a2 = m->a3 = m->b1 = m->b3 = m->c1 = m->c2 = 0.0; + m->a1 = m->b2 = m->c3 = -1.0; + } else { + m->a1 = 1 - 2 * (q->y * q->y + q->z * q->z); if(m->a1 > -1e-7 && m->a1 < 1e-7) m->a1 = 0.0; + m->a2 = 2 * (q->x * q->y - q->z * q->w); if(m->a2 > -1e-7 && m->a2 < 1e-7) m->a2 = 0.0; + m->a3 = 2 * (q->x * q->z + q->y * q->w); if(m->a3 > -1e-7 && m->a3 < 1e-7) m->a3 = 0.0; + m->b1 = 2 * (q->x * q->y + q->z * q->w); if(m->b1 > -1e-7 && m->b1 < 1e-7) m->b1 = 0.0; + m->b2 = 1 - 2 * (q->x * q->x + q->z * q->z); if(m->b2 > -1e-7 && m->b2 < 1e-7) m->b2 = 0.0; + m->b3 = 2 * (q->y * q->z - q->x * q->w); if(m->b3 > -1e-7 && m->b3 < 1e-7) m->b3 = 0.0; + m->c1 = 2 * (q->x * q->z - q->y * q->w); if(m->c1 > -1e-7 && m->c1 < 1e-7) m->c1 = 0.0; + m->c2 = 2 * (q->y * q->z + q->x * q->w); if(m->c2 > -1e-7 && m->c2 < 1e-7) m->c2 = 0.0; + m->c3 = 1 - 2 * (q->x * q->x + q->y * q->y); if(m->c3 > -1e-7 && m->c3 < 1e-7) m->c3 = 0.0; + } + + /* set translation */ + m->a4 = p->x; m->b4 = p->y; m->c4 = p->z; + + m->d1 = 0; m->d2 = 0; m->d3 = 0; m->d4 = 1; +} + +// ------------------------------------------------------------------------------------------------ +// find a node by name +aiNode *M3DImporter::findNode(aiNode *pNode, aiString name) +{ + unsigned int i; + + ai_assert(pNode != nullptr); + ai_assert(mScene != nullptr); + + if(pNode->mName == name) + return pNode; + for(i = 0; i < pNode->mNumChildren; i++) { + aiNode *pChild = findNode(pNode->mChildren[i], name); + if(pChild) return pChild; + } + return nullptr; +} + +// ------------------------------------------------------------------------------------------------ +// fills up offsetmatrix in mBones +void M3DImporter::calculateOffsetMatrix(aiNode *pNode, aiMatrix4x4 *m) +{ + ai_assert(pNode != nullptr); + ai_assert(mScene != nullptr); + + if(pNode->mParent) { + calculateOffsetMatrix(pNode->mParent, m); + *m *= pNode->mTransformation; + } else { + *m = pNode->mTransformation; + } +} + +// ------------------------------------------------------------------------------------------------ +// because M3D has a global mesh, global vertex ids and stores materialid on the face, we need +// temporary lists to collect data for an aiMesh, which requires local arrays and local indeces +// this function fills up an aiMesh with those temporary lists +void M3DImporter::populateMesh(aiMesh *pMesh, std::vector *faces, std::vector *vertices, + std::vector *normals, std::vector *texcoords, std::vector *colors, + std::vector *vertexids) { + + ai_assert(pMesh != nullptr); + ai_assert(faces != nullptr); + ai_assert(vertices != nullptr); + ai_assert(normals != nullptr); + ai_assert(texcoords != nullptr); + ai_assert(colors != nullptr); + ai_assert(vertexids != nullptr); + ai_assert(m3d != nullptr); + + ASSIMP_LOG_DEBUG_F("M3D: populateMesh numvertices ", vertices->size(), " numfaces ", faces->size(), + " numnormals ", normals->size(), " numtexcoord ", texcoords->size(), " numbones ", m3d->numbone); + + if(vertices->size() && faces->size()) { + pMesh->mNumFaces = faces->size(); + pMesh->mFaces = new aiFace[pMesh->mNumFaces]; + std::copy(faces->begin(), faces->end(), pMesh->mFaces); + pMesh->mNumVertices = vertices->size(); + pMesh->mVertices = new aiVector3D[pMesh->mNumVertices]; + std::copy(vertices->begin(), vertices->end(), pMesh->mVertices); + if(normals->size() == vertices->size()) { + pMesh->mNormals = new aiVector3D[pMesh->mNumVertices]; + std::copy(normals->begin(), normals->end(), pMesh->mNormals); + } + if(texcoords->size() == vertices->size()) { + pMesh->mTextureCoords[0] = new aiVector3D[pMesh->mNumVertices]; + std::copy(texcoords->begin(), texcoords->end(), pMesh->mTextureCoords[0]); + pMesh->mNumUVComponents[0] = 2; + } + if(colors->size() == vertices->size()) { + pMesh->mColors[0] = new aiColor4D[pMesh->mNumVertices]; + std::copy(colors->begin(), colors->end(), pMesh->mColors[0]); + } + // this is complicated, because M3D stores a list of bone id / weight pairs per + // vertex but assimp uses lists of local vertex id/weight pairs per local bone list + pMesh->mNumBones = m3d->numbone; + /* we need aiBone with mOffsetMatrix for bones without weights as well */ + if(pMesh->mNumBones) { + pMesh->mBones = new aiBone*[pMesh->mNumBones]; + for(unsigned int i = 0; i < m3d->numbone; i++) { + aiNode *pNode; + pMesh->mBones[i] = new aiBone; + pMesh->mBones[i]->mName = aiString(std::string(m3d->bone[i].name)); + pMesh->mBones[i]->mNumWeights = 0; + pNode = findNode(mScene->mRootNode, pMesh->mBones[i]->mName); + if(pNode) { + calculateOffsetMatrix(pNode, &pMesh->mBones[i]->mOffsetMatrix); + pMesh->mBones[i]->mOffsetMatrix.Inverse(); + } else + pMesh->mBones[i]->mOffsetMatrix = aiMatrix4x4(); + } + if(vertexids->size()) { + unsigned int i, j; + // first count how many vertices we have per bone + for(i = 0; i < vertexids->size(); i++) { + unsigned int s = m3d->vertex[vertexids->at(i)].skinid; + if(s != -1U && s!= -2U) { + for(unsigned int k = 0; k < M3D_NUMBONE && m3d->skin[s].weight[k] > 0.0; k++) { + aiString name = aiString(std::string(m3d->bone[m3d->skin[s].boneid[k]].name)); + for(j = 0; j < pMesh->mNumBones; j++) { + if(pMesh->mBones[j]->mName == name) { + pMesh->mBones[j]->mNumWeights++; + break; + } + } + } + } + } + // allocate mWeights + for(j = 0; j < pMesh->mNumBones; j++) { + aiBone *pBone = pMesh->mBones[j]; + if(pBone->mNumWeights) { + pBone->mWeights = new aiVertexWeight[pBone->mNumWeights]; + pBone->mNumWeights = 0; + } + } + // fill up with data + for(i = 0; i < vertexids->size(); i++) { + unsigned int s = m3d->vertex[vertexids->at(i)].skinid; + if(s != -1U && s!= -2U) { + for(unsigned int k = 0; k < M3D_NUMBONE && m3d->skin[s].weight[k] > 0.0; k++) { + aiString name = aiString(std::string(m3d->bone[m3d->skin[s].boneid[k]].name)); + for(j = 0; j < pMesh->mNumBones; j++) { + if(pMesh->mBones[j]->mName == name) { + aiBone *pBone = pMesh->mBones[j]; + pBone->mWeights[pBone->mNumWeights].mVertexId = i; + pBone->mWeights[pBone->mNumWeights].mWeight = m3d->skin[s].weight[k]; + pBone->mNumWeights++; + break; + } + } + } // foreach skin + } + } // foreach vertexids + } + } + } +} + +// ------------------------------------------------------------------------------------------------ + +} // Namespace Assimp + +#endif // !! ASSIMP_BUILD_NO_M3D_IMPORTER diff --git a/Engine/lib/assimp/code/M3D/M3DImporter.h b/Engine/lib/assimp/code/M3D/M3DImporter.h new file mode 100644 index 000000000..06cc757b6 --- /dev/null +++ b/Engine/lib/assimp/code/M3D/M3DImporter.h @@ -0,0 +1,106 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, assimp team +Copyright (c) 2019 bzt + +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 M3DImporter.h +* @brief Declares the importer class to read a scene from a Model 3D file +*/ +#ifndef AI_M3DIMPORTER_H_INC +#define AI_M3DIMPORTER_H_INC + +#ifndef ASSIMP_BUILD_NO_M3D_IMPORTER + +#include "m3d.h" +#include +#include +#include + +struct aiMesh; +struct aiNode; +struct aiMaterial; +struct aiFace; + +namespace Assimp { + +class M3DImporter : public BaseImporter { +public: + /// \brief Default constructor + M3DImporter(); + + /// \brief Destructor + ~M3DImporter(); + +public: + /// \brief Returns whether the class can handle the format of the given file. + /// \remark See BaseImporter::CanRead() for details. + bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const; + +private: + aiScene* mScene; // the scene to import to + m3d_t *m3d; // model for the C library to convert from + + //! \brief Appends the supported extension. + const aiImporterDesc* GetInfo () const; + + //! \brief File import implementation. + void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); + + void importMaterials(); + void importTextures(); + void importMeshes(); + void importBones(unsigned int parentid, aiNode *pParent); + void importAnimations(); + + // helper functions + aiColor4D mkColor(uint32_t c); + void convertPose(aiMatrix4x4 *m, unsigned int posid, unsigned int orientid); + aiNode *findNode(aiNode *pNode, aiString name); + void calculateOffsetMatrix(aiNode *pNode, aiMatrix4x4 *m); + void populateMesh(aiMesh *pMesh, std::vector *faces, std::vector *verteces, + std::vector *normals, std::vector *texcoords, std::vector *colors, + std::vector *vertexids); +}; + +} // Namespace Assimp + +#endif // ASSIMP_BUILD_NO_M3D_IMPORTER + +#endif // AI_M3DIMPORTER_H_INC diff --git a/Engine/lib/assimp/code/M3D/M3DMaterials.h b/Engine/lib/assimp/code/M3D/M3DMaterials.h new file mode 100644 index 000000000..fa02cf42b --- /dev/null +++ b/Engine/lib/assimp/code/M3D/M3DMaterials.h @@ -0,0 +1,106 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, assimp team +Copyright (c) 2019 bzt + +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 M3DMaterials.h +* @brief Declares the Assimp and Model 3D file material type relations +*/ +#ifndef AI_M3DMATERIALS_H_INC +#define AI_M3DMATERIALS_H_INC + +/* + * In the m3d.h header, there's a static array which defines the material + * properties, called m3d_propertytypes. These must have the same size, and + * list the matching Assimp materials for those properties. Used by both the + * M3DImporter and the M3DExporter, so you have to define these relations + * only once. D.R.Y. and K.I.S.S. + */ +typedef struct { + const char *pKey; + unsigned int type; + unsigned int index; +} aiMatProp; + +/* --- Scalar Properties --- !!!!! must match m3d_propertytypes !!!!! */ +static const aiMatProp aiProps[] = { + { AI_MATKEY_COLOR_DIFFUSE }, /* m3dp_Kd */ + { AI_MATKEY_COLOR_AMBIENT }, /* m3dp_Ka */ + { AI_MATKEY_COLOR_SPECULAR }, /* m3dp_Ks */ + { AI_MATKEY_SHININESS }, /* m3dp_Ns */ + { AI_MATKEY_COLOR_EMISSIVE }, /* m3dp_Ke */ + { AI_MATKEY_COLOR_REFLECTIVE }, /* m3dp_Tf */ + { AI_MATKEY_BUMPSCALING }, /* m3dp_Km */ + { AI_MATKEY_OPACITY }, /* m3dp_d */ + { AI_MATKEY_SHADING_MODEL }, /* m3dp_il */ + + { NULL, 0, 0 }, /* m3dp_Pr */ + { AI_MATKEY_REFLECTIVITY }, /* m3dp_Pm */ + { NULL, 0, 0 }, /* m3dp_Ps */ + { AI_MATKEY_REFRACTI }, /* m3dp_Ni */ + { NULL, 0, 0 }, + { NULL, 0, 0 }, + { NULL, 0, 0 }, + { NULL, 0, 0 } +}; + +/* --- Texture Map Properties --- !!!!! must match m3d_propertytypes !!!!! */ +static const aiMatProp aiTxProps[] = { + { AI_MATKEY_TEXTURE_DIFFUSE(0) }, /* m3dp_map_Kd */ + { AI_MATKEY_TEXTURE_AMBIENT(0) }, /* m3dp_map_Ka */ + { AI_MATKEY_TEXTURE_SPECULAR(0) }, /* m3dp_map_Ks */ + { AI_MATKEY_TEXTURE_SHININESS(0) }, /* m3dp_map_Ns */ + { AI_MATKEY_TEXTURE_EMISSIVE(0) }, /* m3dp_map_Ke */ + { NULL, 0, 0 }, /* m3dp_map_Tf */ + { AI_MATKEY_TEXTURE_HEIGHT(0) }, /* m3dp_bump */ + { AI_MATKEY_TEXTURE_OPACITY(0) }, /* m3dp_map_d */ + { AI_MATKEY_TEXTURE_REFLECTION(0) }, /* m3dp_refl */ + + { AI_MATKEY_TEXTURE(aiTextureType_DIFFUSE_ROUGHNESS,0) },/* m3dp_map_Pr */ + { AI_MATKEY_TEXTURE(aiTextureType_METALNESS,0) }, /* m3dp_map_Pm */ + { NULL, 0, 0 }, /* m3dp_map_Ps */ + { AI_MATKEY_TEXTURE(aiTextureType_AMBIENT_OCCLUSION,0) },/* m3dp_map_Ni */ + { NULL, 0, 0 }, + { NULL, 0, 0 }, + { NULL, 0, 0 }, + { NULL, 0, 0 } +}; + +#endif // AI_M3DMATERIALS_H_INC diff --git a/Engine/lib/assimp/code/M3D/m3d.h b/Engine/lib/assimp/code/M3D/m3d.h new file mode 100644 index 000000000..9ace802ef --- /dev/null +++ b/Engine/lib/assimp/code/M3D/m3d.h @@ -0,0 +1,4565 @@ +/* + * m3d.h + * + * Copyright (C) 2019 bzt (bztsrc@gitlab) + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, 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. + * + * @brief ANSI C89 / C++11 single header importer / exporter SDK for the Model 3D (.M3D) format + * https://gitlab.com/bztsrc/model3d + * + * PNG decompressor included from (with minor modifications to make it C89 valid): + * stb_image - v2.13 - public domain image loader - http://nothings.org/stb_image.h + * + * @version: 1.0.0 + */ + +#ifndef _M3D_H_ +#define _M3D_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/*** configuration ***/ +#ifndef M3D_MALLOC +# define M3D_MALLOC(sz) malloc(sz) +#endif +#ifndef M3D_REALLOC +# define M3D_REALLOC(p,nsz) realloc(p,nsz) +#endif +#ifndef M3D_FREE +# define M3D_FREE(p) free(p) +#endif +#ifndef M3D_LOG +# define M3D_LOG(x) +#endif +#ifndef M3D_APIVERSION +#define M3D_APIVERSION 0x0100 +#ifndef M3D_DOUBLE +typedef float M3D_FLOAT; +#else +typedef double M3D_FLOAT; +#endif +#if !defined(M3D_SMALLINDEX) +typedef uint32_t M3D_INDEX; +#define M3D_INDEXMAX 0xfffffffe +#else +typedef uint16_t M3D_INDEX; +#define M3D_INDEXMAX 0xfffe +#endif +#ifndef M3D_NUMBONE +#define M3D_NUMBONE 4 +#endif +#ifndef M3D_BONEMAXLEVEL +#define M3D_BONEMAXLEVEL 8 +#endif +#ifndef _MSC_VER +#define _inline __inline__ +#define _pack __attribute__((packed)) +#define _unused __attribute__((unused)) +#else +#define _inline +#define _pack +#define _unused +#endif +#ifndef __cplusplus +#define _register register +#else +#define _register +#endif + +/*** File format structures ***/ + +/** + * M3D file format structure + * 3DMO m3dchunk_t file header chunk, may followed by compressed data + * HEAD m3dhdr_t model header chunk + * n x m3dchunk_t more chunks follow + * CMAP color map chunk (optional) + * TMAP texture map chunk (optional) + * VRTS vertex data chunk (optional if it's a material library) + * BONE bind-pose skeleton, bone hierarchy chunk (optional) + * n x m3db_t contains propably more, but at least one bone + * MTRL* material chunk(s), can be more (optional) + * n x m3dp_t each material contains propapbly more, but at least one property + * the properties are configurable with a static array, see m3d_propertytypes + * n x m3dchunk_t at least one, but maybe more face chunks + * PROC* procedural face, or + * MESH* triangle mesh (vertex index list) + * ACTN* action chunk(s), animation-pose skeletons, can be more (optional) + * n x m3dfr_t each action contains probably more, but at least one frame + * n x m3dtr_t each frame contains probably more, but at least one transformation + * ASET* inlined asset chunk(s), can be more (optional) + * OMD3 end chunk + */ +typedef struct { + char magic[4]; + uint32_t length; + float scale; /* deliberately not M3D_FLOAT */ + uint32_t types; +} _pack m3dhdr_t; + +typedef struct { + char magic[4]; + uint32_t length; +} _pack m3dchunk_t; + +/*** in-memory model structure ***/ + +/* textmap entry */ +typedef struct { + M3D_FLOAT u; + M3D_FLOAT v; +} m3dti_t; + +/* texture */ +typedef struct { + char *name; /* texture name */ + uint32_t *d; /* pixels data */ + uint16_t w; /* width */ + uint16_t h; /* height */ +} _pack m3dtx_t; + +typedef struct { + M3D_INDEX vertexid; + M3D_FLOAT weight; +} m3dw_t; + +/* bone entry */ +typedef struct { + M3D_INDEX parent; /* parent bone index */ + char *name; /* name for this bone */ + M3D_INDEX pos; /* vertex index position */ + M3D_INDEX ori; /* vertex index orientation (quaternion) */ + M3D_INDEX numweight; /* number of controlled vertices */ + m3dw_t *weight; /* weights for those vertices */ + M3D_FLOAT mat4[16]; /* transformation matrix */ +} m3db_t; + +/* skin: bone per vertex entry */ +typedef struct { + M3D_INDEX boneid[M3D_NUMBONE]; + M3D_FLOAT weight[M3D_NUMBONE]; +} m3ds_t; + +/* vertex entry */ +typedef struct { + M3D_FLOAT x; /* 3D coordinates and weight */ + M3D_FLOAT y; + M3D_FLOAT z; + M3D_FLOAT w; + uint32_t color; /* default vertex color */ + M3D_INDEX skinid; /* skin index */ +} m3dv_t; + +/* material property formats */ +enum { + m3dpf_color, + m3dpf_uint8, + m3dpf_uint16, + m3dpf_uint32, + m3dpf_float, + m3dpf_map +}; +typedef struct { + uint8_t format; + uint8_t id; +#ifdef M3D_ASCII +#define M3D_PROPERTYDEF(f,i,n) { (f), (i), (char*)(n) } + char *key; +#else +#define M3D_PROPERTYDEF(f,i,n) { (f), (i) } +#endif +} m3dpd_t; + +/* material property types */ +/* You shouldn't change the first 8 display and first 4 physical property. Assign the rest as you like. */ +enum { + m3dp_Kd = 0, /* scalar display properties */ + m3dp_Ka, + m3dp_Ks, + m3dp_Ns, + m3dp_Ke, + m3dp_Tf, + m3dp_Km, + m3dp_d, + m3dp_il, + + m3dp_Pr = 64, /* scalar physical properties */ + m3dp_Pm, + m3dp_Ps, + m3dp_Ni, + + m3dp_map_Kd = 128, /* textured display map properties */ + m3dp_map_Ka, + m3dp_map_Ks, + m3dp_map_Ns, + m3dp_map_Ke, + m3dp_map_Tf, + m3dp_map_Km, /* bump map */ + m3dp_map_D, + m3dp_map_il, /* reflection map */ + + m3dp_map_Pr = 192, /* textured physical map properties */ + m3dp_map_Pm, + m3dp_map_Ps, + m3dp_map_Ni +}; +enum { /* aliases */ + m3dp_bump = m3dp_map_Km, + m3dp_refl = m3dp_map_Pm +}; + +/* material property */ +typedef struct { + uint8_t type; /* property type, see "m3dp_*" enumeration */ + union { + uint32_t color; /* if value is a color, m3dpf_color */ + uint32_t num; /* if value is a number, m3dpf_uint8, m3pf_uint16, m3dpf_uint32 */ + float fnum; /* if value is a floating point number, m3dpf_float */ + M3D_INDEX textureid; /* if value is a texture, m3dpf_map */ + } value; +} m3dp_t; + +/* material entry */ +typedef struct { + char *name; /* name of the material */ + uint8_t numprop; /* number of properties */ + m3dp_t *prop; /* properties array */ +} m3dm_t; + +/* face entry */ +typedef struct { + M3D_INDEX materialid; /* material index */ + M3D_INDEX vertex[3]; /* 3D points of the triangle in CCW order */ + M3D_INDEX normal[3]; /* normal vectors */ + M3D_INDEX texcoord[3]; /* UV coordinates */ +} m3df_t; + +/* frame transformations / working copy skeleton entry */ +typedef struct { + M3D_INDEX boneid; /* selects a node in bone hierarchy */ + M3D_INDEX pos; /* vertex index new position */ + M3D_INDEX ori; /* vertex index new orientation (quaternion) */ +} m3dtr_t; + +/* animation frame entry */ +typedef struct { + uint32_t msec; /* frame's position on the timeline, timestamp */ + M3D_INDEX numtransform; /* number of transformations in this frame */ + m3dtr_t *transform; /* transformations */ +} m3dfr_t; + +/* model action entry */ +typedef struct { + char *name; /* name of the action */ + uint32_t durationmsec; /* duration in millisec (1/1000 sec) */ + M3D_INDEX numframe; /* number of frames in this animation */ + m3dfr_t *frame; /* frames array */ +} m3da_t; + +/* inlined asset */ +typedef struct { + char *name; /* asset name (same pointer as in texture[].name) */ + uint8_t *data; /* compressed asset data */ + uint32_t length; /* compressed data length */ +} m3di_t; + +/*** in-memory model structure ***/ +#define M3D_FLG_FREERAW (1<<0) +#define M3D_FLG_FREESTR (1<<1) +#define M3D_FLG_MTLLIB (1<<2) + +typedef struct { + m3dhdr_t *raw; /* pointer to raw data */ + char flags; /* internal flags */ + char errcode; /* returned error code */ + char vc_s, vi_s, si_s, ci_s, ti_s, bi_s, nb_s, sk_s, fi_s; /* decoded sizes for types */ + char *name; /* name of the model, like "Utah teapot" */ + char *license; /* usage condition or license, like "MIT", "LGPL" or "BSD-3clause" */ + char *author; /* nickname, email, homepage or github URL etc. */ + char *desc; /* comments, descriptions. May contain '\n' newline character */ + M3D_FLOAT scale; /* the model's bounding cube's size in SI meters */ + M3D_INDEX numcmap; + uint32_t *cmap; /* color map */ + M3D_INDEX numtmap; + m3dti_t *tmap; /* texture map indices */ + M3D_INDEX numtexture; + m3dtx_t *texture; /* uncompressed textures */ + M3D_INDEX numbone; + m3db_t *bone; /* bone hierarchy */ + M3D_INDEX numvertex; + m3dv_t *vertex; /* vertex data */ + M3D_INDEX numskin; + m3ds_t *skin; /* skin data */ + M3D_INDEX nummaterial; + m3dm_t *material; /* material list */ + M3D_INDEX numface; + m3df_t *face; /* model face, triangle mesh */ + M3D_INDEX numaction; + m3da_t *action; /* action animations */ + M3D_INDEX numinlined; + m3di_t *inlined; /* inlined assets */ + M3D_INDEX numunknown; + m3dchunk_t **unknown; /* unknown chunks, application / engine specific data probably */ +} m3d_t; + +/*** export parameters ***/ +#define M3D_EXP_INT8 0 +#define M3D_EXP_INT16 1 +#define M3D_EXP_FLOAT 2 +#define M3D_EXP_DOUBLE 3 + +#define M3D_EXP_NOCMAP (1<<0) +#define M3D_EXP_NOMATERIAL (1<<1) +#define M3D_EXP_NOFACE (1<<2) +#define M3D_EXP_NONORMAL (1<<3) +#define M3D_EXP_NOTXTCRD (1<<4) +#define M3D_EXP_FLIPTXTCRD (1<<5) +#define M3D_EXP_NORECALC (1<<6) +#define M3D_EXP_IDOSUCK (1<<7) +#define M3D_EXP_NOBONE (1<<8) +#define M3D_EXP_NOACTION (1<<9) +#define M3D_EXP_INLINE (1<<10) +#define M3D_EXP_EXTRA (1<<11) +#define M3D_EXP_NOZLIB (1<<14) +#define M3D_EXP_ASCII (1<<15) + +/*** error codes ***/ +#define M3D_SUCCESS 0 +#define M3D_ERR_ALLOC -1 +#define M3D_ERR_BADFILE -2 +#define M3D_ERR_UNIMPL -65 +#define M3D_ERR_UNKPROP -66 +#define M3D_ERR_UNKMESH -67 +#define M3D_ERR_UNKIMG -68 +#define M3D_ERR_UNKFRAME -69 +#define M3D_ERR_TRUNC -70 +#define M3D_ERR_CMAP -71 +#define M3D_ERR_TMAP -72 +#define M3D_ERR_VRTS -73 +#define M3D_ERR_BONE -74 +#define M3D_ERR_MTRL -75 + +#define M3D_ERR_ISFATAL(x) ((x) < 0 && (x) > -65) + +/* callbacks */ +typedef unsigned char *(*m3dread_t)(char *filename, unsigned int *size); /* read file contents into buffer */ +typedef void (*m3dfree_t)(void *buffer); /* free file contents buffer */ +typedef int (*m3dtxsc_t)(const char *name, const void *script, uint32_t len, m3dtx_t *output); /* interpret texture script */ +typedef int (*m3dprsc_t)(const char *name, const void *script, uint32_t len, m3d_t *model); /* interpret surface script */ +#endif /* ifndef M3D_APIVERSION */ + +/*** C prototypes ***/ +/* import / export */ +m3d_t *m3d_load(unsigned char *data, m3dread_t readfilecb, m3dfree_t freecb, m3d_t *mtllib); +unsigned char *m3d_save(m3d_t *model, int quality, int flags, unsigned int *size); +void m3d_free(m3d_t *model); +/* generate animation pose skeleton */ +m3dtr_t *m3d_frame(m3d_t *model, M3D_INDEX actionid, M3D_INDEX frameid, m3dtr_t *skeleton); +m3db_t *m3d_pose(m3d_t *model, M3D_INDEX actionid, uint32_t msec); + +/* private prototypes used by both importer and exporter */ +m3ds_t *_m3d_addskin(m3ds_t *skin, uint32_t *numskin, m3ds_t *s, uint32_t *idx); +m3dv_t *_m3d_addnorm(m3dv_t *vrtx, uint32_t *numvrtx, m3dv_t *v, uint32_t *idx); +char *_m3d_safestr(char *in, int morelines); + +/*** C implementation ***/ +#ifdef M3D_IMPLEMENTATION +#if !defined(M3D_NOIMPORTER) || defined(M3D_EXPORTER) +/* material property definitions */ +static m3dpd_t m3d_propertytypes[] = { + M3D_PROPERTYDEF(m3dpf_color, m3dp_Kd, "Kd"), /* diffuse color */ + M3D_PROPERTYDEF(m3dpf_color, m3dp_Ka, "Ka"), /* ambient color */ + M3D_PROPERTYDEF(m3dpf_color, m3dp_Ks, "Ks"), /* specular color */ + M3D_PROPERTYDEF(m3dpf_float, m3dp_Ns, "Ns"), /* specular exponent */ + M3D_PROPERTYDEF(m3dpf_color, m3dp_Ke, "Ke"), /* emissive (emitting light of this color) */ + M3D_PROPERTYDEF(m3dpf_color, m3dp_Tf, "Tf"), /* transmission color */ + M3D_PROPERTYDEF(m3dpf_float, m3dp_Km, "Km"), /* bump strength */ + M3D_PROPERTYDEF(m3dpf_float, m3dp_d, "d"), /* dissolve (transparency) */ + M3D_PROPERTYDEF(m3dpf_uint8, m3dp_il, "il"), /* illumination model (informational, ignored by PBR-shaders) */ + + M3D_PROPERTYDEF(m3dpf_float, m3dp_Pr, "Pr"), /* roughness */ + M3D_PROPERTYDEF(m3dpf_float, m3dp_Pm, "Pm"), /* metallic, also reflection */ + M3D_PROPERTYDEF(m3dpf_float, m3dp_Ps, "Ps"), /* sheen */ + M3D_PROPERTYDEF(m3dpf_float, m3dp_Ni, "Ni"), /* index of refraction (optical density) */ + + /* aliases, note that "map_*" aliases are handled automatically */ + M3D_PROPERTYDEF(m3dpf_map, m3dp_map_Km, "bump"), + M3D_PROPERTYDEF(m3dpf_map, m3dp_map_Pm, "refl") +}; +#endif + +#include +#include + +#if !defined(M3D_NOIMPORTER) && !defined(STBI_INCLUDE_STB_IMAGE_H) +/* PNG decompressor from + + stb_image - v2.23 - public domain image loader - http://nothings.org/stb_image.h +*/ +static const char *stbi__g_failure_reason; + +enum +{ + STBI_default = 0, + + STBI_grey = 1, + STBI_grey_alpha = 2, + STBI_rgb = 3, + STBI_rgb_alpha = 4 +}; + +enum +{ + STBI__SCAN_load=0, + STBI__SCAN_type, + STBI__SCAN_header +}; + +typedef unsigned char stbi_uc; +typedef unsigned short stbi_us; + +typedef uint16_t stbi__uint16; +typedef int16_t stbi__int16; +typedef uint32_t stbi__uint32; +typedef int32_t stbi__int32; + +typedef struct +{ + stbi__uint32 img_x, img_y; + int img_n, img_out_n; + + void *io_user_data; + + int read_from_callbacks; + int buflen; + stbi_uc buffer_start[128]; + + stbi_uc *img_buffer, *img_buffer_end; + stbi_uc *img_buffer_original, *img_buffer_original_end; +} stbi__context; + +typedef struct +{ + int bits_per_channel; + int num_channels; + int channel_order; +} stbi__result_info; + +#define STBI_ASSERT(v) +#define STBI_NOTUSED(v) (void)sizeof(v) +#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) +#define STBI_MALLOC(sz) M3D_MALLOC(sz) +#define STBI_REALLOC(p,newsz) M3D_REALLOC(p,newsz) +#define STBI_FREE(p) M3D_FREE(p) +#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz) + +_inline static stbi_uc stbi__get8(stbi__context *s) +{ + if (s->img_buffer < s->img_buffer_end) + return *s->img_buffer++; + return 0; +} + +_inline static int stbi__at_eof(stbi__context *s) +{ + return s->img_buffer >= s->img_buffer_end; +} + +static void stbi__skip(stbi__context *s, int n) +{ + if (n < 0) { + s->img_buffer = s->img_buffer_end; + return; + } + s->img_buffer += n; +} + +static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) +{ + if (s->img_buffer+n <= s->img_buffer_end) { + memcpy(buffer, s->img_buffer, n); + s->img_buffer += n; + return 1; + } else + return 0; +} + +static int stbi__get16be(stbi__context *s) +{ + int z = stbi__get8(s); + return (z << 8) + stbi__get8(s); +} + +static stbi__uint32 stbi__get32be(stbi__context *s) +{ + stbi__uint32 z = stbi__get16be(s); + return (z << 16) + stbi__get16be(s); +} + +#define stbi__err(x,y) stbi__errstr(y) +static int stbi__errstr(const char *str) +{ + stbi__g_failure_reason = str; + return 0; +} + +_inline static void *stbi__malloc(size_t size) +{ + return STBI_MALLOC(size); +} + +static int stbi__addsizes_valid(int a, int b) +{ + if (b < 0) return 0; + return a <= 2147483647 - b; +} + +static int stbi__mul2sizes_valid(int a, int b) +{ + if (a < 0 || b < 0) return 0; + if (b == 0) return 1; + return a <= 2147483647/b; +} + +static int stbi__mad2sizes_valid(int a, int b, int add) +{ + return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add); +} + +static int stbi__mad3sizes_valid(int a, int b, int c, int add) +{ + return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) && + stbi__addsizes_valid(a*b*c, add); +} + +static void *stbi__malloc_mad2(int a, int b, int add) +{ + if (!stbi__mad2sizes_valid(a, b, add)) return NULL; + return stbi__malloc(a*b + add); +} + +static void *stbi__malloc_mad3(int a, int b, int c, int add) +{ + if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL; + return stbi__malloc(a*b*c + add); +} + +static stbi_uc stbi__compute_y(int r, int g, int b) +{ + return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8); +} + +static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) +{ + int i,j; + unsigned char *good; + + if (req_comp == img_n) return data; + STBI_ASSERT(req_comp >= 1 && req_comp <= 4); + + good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0); + if (good == NULL) { + STBI_FREE(data); + stbi__err("outofmem", "Out of memory"); + return NULL; + } + + for (j=0; j < (int) y; ++j) { + unsigned char *src = data + j * x * img_n ; + unsigned char *dest = good + j * x * req_comp; + + #define STBI__COMBO(a,b) ((a)*8+(b)) + #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) + switch (STBI__COMBO(img_n, req_comp)) { + STBI__CASE(1,2) { dest[0]=src[0], dest[1]=255; } break; + STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break; + STBI__CASE(2,1) { dest[0]=src[0]; } break; + STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; + STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break; + STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; + STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break; + STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; + STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break; + STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; + default: STBI_ASSERT(0); + } + #undef STBI__CASE + } + + STBI_FREE(data); + return good; +} + +static stbi__uint16 stbi__compute_y_16(int r, int g, int b) +{ + return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8); +} + +static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y) +{ + int i,j; + stbi__uint16 *good; + + if (req_comp == img_n) return data; + STBI_ASSERT(req_comp >= 1 && req_comp <= 4); + + good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2); + if (good == NULL) { + STBI_FREE(data); + stbi__err("outofmem", "Out of memory"); + return NULL; + } + + for (j=0; j < (int) y; ++j) { + stbi__uint16 *src = data + j * x * img_n ; + stbi__uint16 *dest = good + j * x * req_comp; + + #define STBI__COMBO(a,b) ((a)*8+(b)) + #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) + switch (STBI__COMBO(img_n, req_comp)) { + STBI__CASE(1,2) { dest[0]=src[0], dest[1]=0xffff; } break; + STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=0xffff; } break; + STBI__CASE(2,1) { dest[0]=src[0]; } break; + STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; + STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; + STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=0xffff; } break; + STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; + STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = 0xffff; } break; + STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; + STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = src[3]; } break; + STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; + default: STBI_ASSERT(0); + } + #undef STBI__CASE + } + + STBI_FREE(data); + return good; +} + +#define STBI__ZFAST_BITS 9 +#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1) + +typedef struct +{ + stbi__uint16 fast[1 << STBI__ZFAST_BITS]; + stbi__uint16 firstcode[16]; + int maxcode[17]; + stbi__uint16 firstsymbol[16]; + stbi_uc size[288]; + stbi__uint16 value[288]; +} stbi__zhuffman; + +_inline static int stbi__bitreverse16(int n) +{ + n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); + n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); + n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); + n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); + return n; +} + +_inline static int stbi__bit_reverse(int v, int bits) +{ + STBI_ASSERT(bits <= 16); + return stbi__bitreverse16(v) >> (16-bits); +} + +static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num) +{ + int i,k=0; + int code, next_code[16], sizes[17]; + + memset(sizes, 0, sizeof(sizes)); + memset(z->fast, 0, sizeof(z->fast)); + for (i=0; i < num; ++i) + ++sizes[sizelist[i]]; + sizes[0] = 0; + for (i=1; i < 16; ++i) + if (sizes[i] > (1 << i)) + return stbi__err("bad sizes", "Corrupt PNG"); + code = 0; + for (i=1; i < 16; ++i) { + next_code[i] = code; + z->firstcode[i] = (stbi__uint16) code; + z->firstsymbol[i] = (stbi__uint16) k; + code = (code + sizes[i]); + if (sizes[i]) + if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG"); + z->maxcode[i] = code << (16-i); + code <<= 1; + k += sizes[i]; + } + z->maxcode[16] = 0x10000; + for (i=0; i < num; ++i) { + int s = sizelist[i]; + if (s) { + int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; + stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i); + z->size [c] = (stbi_uc ) s; + z->value[c] = (stbi__uint16) i; + if (s <= STBI__ZFAST_BITS) { + int j = stbi__bit_reverse(next_code[s],s); + while (j < (1 << STBI__ZFAST_BITS)) { + z->fast[j] = fastv; + j += (1 << s); + } + } + ++next_code[s]; + } + } + return 1; +} + +typedef struct +{ + stbi_uc *zbuffer, *zbuffer_end; + int num_bits; + stbi__uint32 code_buffer; + + char *zout; + char *zout_start; + char *zout_end; + int z_expandable; + + stbi__zhuffman z_length, z_distance; +} stbi__zbuf; + +_inline static stbi_uc stbi__zget8(stbi__zbuf *z) +{ + if (z->zbuffer >= z->zbuffer_end) return 0; + return *z->zbuffer++; +} + +static void stbi__fill_bits(stbi__zbuf *z) +{ + do { + STBI_ASSERT(z->code_buffer < (1U << z->num_bits)); + z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits; + z->num_bits += 8; + } while (z->num_bits <= 24); +} + +_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n) +{ + unsigned int k; + if (z->num_bits < n) stbi__fill_bits(z); + k = z->code_buffer & ((1 << n) - 1); + z->code_buffer >>= n; + z->num_bits -= n; + return k; +} + +static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) +{ + int b,s,k; + k = stbi__bit_reverse(a->code_buffer, 16); + for (s=STBI__ZFAST_BITS+1; ; ++s) + if (k < z->maxcode[s]) + break; + if (s == 16) return -1; + b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; + STBI_ASSERT(z->size[b] == s); + a->code_buffer >>= s; + a->num_bits -= s; + return z->value[b]; +} + +_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) +{ + int b,s; + if (a->num_bits < 16) stbi__fill_bits(a); + b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; + if (b) { + s = b >> 9; + a->code_buffer >>= s; + a->num_bits -= s; + return b & 511; + } + return stbi__zhuffman_decode_slowpath(a, z); +} + +static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) +{ + char *q; + int cur, limit, old_limit; + z->zout = zout; + if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG"); + cur = (int) (z->zout - z->zout_start); + limit = old_limit = (int) (z->zout_end - z->zout_start); + while (cur + n > limit) + limit *= 2; + q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); + STBI_NOTUSED(old_limit); + if (q == NULL) return stbi__err("outofmem", "Out of memory"); + z->zout_start = q; + z->zout = q + cur; + z->zout_end = q + limit; + return 1; +} + +static int stbi__zlength_base[31] = { + 3,4,5,6,7,8,9,10,11,13, + 15,17,19,23,27,31,35,43,51,59, + 67,83,99,115,131,163,195,227,258,0,0 }; + +static int stbi__zlength_extra[31]= +{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + +static int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, +257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + +static int stbi__zdist_extra[32] = +{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +static int stbi__parse_huffman_block(stbi__zbuf *a) +{ + char *zout = a->zout; + for(;;) { + int z = stbi__zhuffman_decode(a, &a->z_length); + if (z < 256) { + if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); + if (zout >= a->zout_end) { + if (!stbi__zexpand(a, zout, 1)) return 0; + zout = a->zout; + } + *zout++ = (char) z; + } else { + stbi_uc *p; + int len,dist; + if (z == 256) { + a->zout = zout; + return 1; + } + z -= 257; + len = stbi__zlength_base[z]; + if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]); + z = stbi__zhuffman_decode(a, &a->z_distance); + if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); + dist = stbi__zdist_base[z]; + if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); + if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); + if (zout + len > a->zout_end) { + if (!stbi__zexpand(a, zout, len)) return 0; + zout = a->zout; + } + p = (stbi_uc *) (zout - dist); + if (dist == 1) { + stbi_uc v = *p; + if (len) { do *zout++ = v; while (--len); } + } else { + if (len) { do *zout++ = *p++; while (--len); } + } + } + } +} + +static int stbi__compute_huffman_codes(stbi__zbuf *a) +{ + static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + stbi__zhuffman z_codelength; + stbi_uc lencodes[286+32+137]; + stbi_uc codelength_sizes[19]; + int i,n; + + int hlit = stbi__zreceive(a,5) + 257; + int hdist = stbi__zreceive(a,5) + 1; + int hclen = stbi__zreceive(a,4) + 4; + int ntot = hlit + hdist; + + memset(codelength_sizes, 0, sizeof(codelength_sizes)); + for (i=0; i < hclen; ++i) { + int s = stbi__zreceive(a,3); + codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; + } + if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; + + n = 0; + while (n < ntot) { + int c = stbi__zhuffman_decode(a, &z_codelength); + if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); + if (c < 16) + lencodes[n++] = (stbi_uc) c; + else { + stbi_uc fill = 0; + if (c == 16) { + c = stbi__zreceive(a,2)+3; + if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG"); + fill = lencodes[n-1]; + } else if (c == 17) + c = stbi__zreceive(a,3)+3; + else { + STBI_ASSERT(c == 18); + c = stbi__zreceive(a,7)+11; + } + if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG"); + memset(lencodes+n, fill, c); + n += c; + } + } + if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG"); + if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; + if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; + return 1; +} + +_inline static int stbi__parse_uncompressed_block(stbi__zbuf *a) +{ + stbi_uc header[4]; + int len,nlen,k; + if (a->num_bits & 7) + stbi__zreceive(a, a->num_bits & 7); + k = 0; + while (a->num_bits > 0) { + header[k++] = (stbi_uc) (a->code_buffer & 255); + a->code_buffer >>= 8; + a->num_bits -= 8; + } + STBI_ASSERT(a->num_bits == 0); + while (k < 4) + header[k++] = stbi__zget8(a); + len = header[1] * 256 + header[0]; + nlen = header[3] * 256 + header[2]; + if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG"); + if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG"); + if (a->zout + len > a->zout_end) + if (!stbi__zexpand(a, a->zout, len)) return 0; + memcpy(a->zout, a->zbuffer, len); + a->zbuffer += len; + a->zout += len; + return 1; +} + +static int stbi__parse_zlib_header(stbi__zbuf *a) +{ + int cmf = stbi__zget8(a); + int cm = cmf & 15; + /* int cinfo = cmf >> 4; */ + int flg = stbi__zget8(a); + if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); + if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); + if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); + return 1; +} + +static stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32]; +static void stbi__init_zdefaults(void) +{ + int i; + for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8; + for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9; + for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7; + for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8; + + for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5; +} + +static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) +{ + int final, type; + if (parse_header) + if (!stbi__parse_zlib_header(a)) return 0; + a->num_bits = 0; + a->code_buffer = 0; + do { + final = stbi__zreceive(a,1); + type = stbi__zreceive(a,2); + if (type == 0) { + if (!stbi__parse_uncompressed_block(a)) return 0; + } else if (type == 3) { + return 0; + } else { + if (type == 1) { + if (!stbi__zdefault_distance[31]) stbi__init_zdefaults(); + if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0; + if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0; + } else { + if (!stbi__compute_huffman_codes(a)) return 0; + } + if (!stbi__parse_huffman_block(a)) return 0; + } + } while (!final); + return 1; +} + +static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header) +{ + a->zout_start = obuf; + a->zout = obuf; + a->zout_end = obuf + olen; + a->z_expandable = exp; + + return stbi__parse_zlib(a, parse_header); +} + +char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header) +{ + stbi__zbuf a; + char *p = (char *) stbi__malloc(initial_size); + if (p == NULL) return NULL; + a.zbuffer = (stbi_uc *) buffer; + a.zbuffer_end = (stbi_uc *) buffer + len; + if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) { + if (outlen) *outlen = (int) (a.zout - a.zout_start); + return a.zout_start; + } else { + STBI_FREE(a.zout_start); + return NULL; + } +} + +typedef struct +{ + stbi__uint32 length; + stbi__uint32 type; +} stbi__pngchunk; + +static stbi__pngchunk stbi__get_chunk_header(stbi__context *s) +{ + stbi__pngchunk c; + c.length = stbi__get32be(s); + c.type = stbi__get32be(s); + return c; +} + +_inline static int stbi__check_png_header(stbi__context *s) +{ + static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 }; + int i; + for (i=0; i < 8; ++i) + if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG"); + return 1; +} + +typedef struct +{ + stbi__context *s; + stbi_uc *idata, *expanded, *out; + int depth; +} stbi__png; + + +enum { + STBI__F_none=0, + STBI__F_sub=1, + STBI__F_up=2, + STBI__F_avg=3, + STBI__F_paeth=4, + STBI__F_avg_first, + STBI__F_paeth_first +}; + +static stbi_uc first_row_filter[5] = +{ + STBI__F_none, + STBI__F_sub, + STBI__F_none, + STBI__F_avg_first, + STBI__F_paeth_first +}; + +static int stbi__paeth(int a, int b, int c) +{ + int p = a + b - c; + int pa = abs(p-a); + int pb = abs(p-b); + int pc = abs(p-c); + if (pa <= pb && pa <= pc) return a; + if (pb <= pc) return b; + return c; +} + +static stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; + +static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) +{ + int bytes = (depth == 16? 2 : 1); + stbi__context *s = a->s; + stbi__uint32 i,j,stride = x*out_n*bytes; + stbi__uint32 img_len, img_width_bytes; + int k; + int img_n = s->img_n; + + int output_bytes = out_n*bytes; + int filter_bytes = img_n*bytes; + int width = x; + + STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); + a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); + if (!a->out) return stbi__err("outofmem", "Out of memory"); + + img_width_bytes = (((img_n * x * depth) + 7) >> 3); + img_len = (img_width_bytes + 1) * y; + if (s->img_x == x && s->img_y == y) { + if (raw_len != img_len) return stbi__err("not enough pixels","Corrupt PNG"); + } else { + if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); + } + + for (j=0; j < y; ++j) { + stbi_uc *cur = a->out + stride*j; + stbi_uc *prior = cur - stride; + int filter = *raw++; + + if (filter > 4) + return stbi__err("invalid filter","Corrupt PNG"); + + if (depth < 8) { + STBI_ASSERT(img_width_bytes <= x); + cur += x*out_n - img_width_bytes; + filter_bytes = 1; + width = img_width_bytes; + } + + if (j == 0) filter = first_row_filter[filter]; + + for (k=0; k < filter_bytes; ++k) { + switch (filter) { + case STBI__F_none : cur[k] = raw[k]; break; + case STBI__F_sub : cur[k] = raw[k]; break; + case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; + case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; + case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; + case STBI__F_avg_first : cur[k] = raw[k]; break; + case STBI__F_paeth_first: cur[k] = raw[k]; break; + } + } + + if (depth == 8) { + if (img_n != out_n) + cur[img_n] = 255; + raw += img_n; + cur += out_n; + prior += out_n; + } else if (depth == 16) { + if (img_n != out_n) { + cur[filter_bytes] = 255; + cur[filter_bytes+1] = 255; + } + raw += filter_bytes; + cur += output_bytes; + prior += output_bytes; + } else { + raw += 1; + cur += 1; + prior += 1; + } + + if (depth < 8 || img_n == out_n) { + int nk = (width - 1)*filter_bytes; + #define STBI__CASE(f) \ + case f: \ + for (k=0; k < nk; ++k) + switch (filter) { + case STBI__F_none: memcpy(cur, raw, nk); break; + STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break; + STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; + STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break; + STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break; + STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break; + STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break; + } + #undef STBI__CASE + raw += nk; + } else { + STBI_ASSERT(img_n+1 == out_n); + #define STBI__CASE(f) \ + case f: \ + for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ + for (k=0; k < filter_bytes; ++k) + switch (filter) { + STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break; + STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break; + STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; + STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break; + STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break; + STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break; + STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break; + } + #undef STBI__CASE + + if (depth == 16) { + cur = a->out + stride*j; + for (i=0; i < x; ++i,cur+=output_bytes) { + cur[filter_bytes+1] = 255; + } + } + } + } + + if (depth < 8) { + for (j=0; j < y; ++j) { + stbi_uc *cur = a->out + stride*j; + stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; + stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; + + if (depth == 4) { + for (k=x*img_n; k >= 2; k-=2, ++in) { + *cur++ = scale * ((*in >> 4) ); + *cur++ = scale * ((*in ) & 0x0f); + } + if (k > 0) *cur++ = scale * ((*in >> 4) ); + } else if (depth == 2) { + for (k=x*img_n; k >= 4; k-=4, ++in) { + *cur++ = scale * ((*in >> 6) ); + *cur++ = scale * ((*in >> 4) & 0x03); + *cur++ = scale * ((*in >> 2) & 0x03); + *cur++ = scale * ((*in ) & 0x03); + } + if (k > 0) *cur++ = scale * ((*in >> 6) ); + if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); + if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); + } else if (depth == 1) { + for (k=x*img_n; k >= 8; k-=8, ++in) { + *cur++ = scale * ((*in >> 7) ); + *cur++ = scale * ((*in >> 6) & 0x01); + *cur++ = scale * ((*in >> 5) & 0x01); + *cur++ = scale * ((*in >> 4) & 0x01); + *cur++ = scale * ((*in >> 3) & 0x01); + *cur++ = scale * ((*in >> 2) & 0x01); + *cur++ = scale * ((*in >> 1) & 0x01); + *cur++ = scale * ((*in ) & 0x01); + } + if (k > 0) *cur++ = scale * ((*in >> 7) ); + if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); + if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); + if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); + if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); + if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); + if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); + } + if (img_n != out_n) { + int q; + cur = a->out + stride*j; + if (img_n == 1) { + for (q=x-1; q >= 0; --q) { + cur[q*2+1] = 255; + cur[q*2+0] = cur[q]; + } + } else { + STBI_ASSERT(img_n == 3); + for (q=x-1; q >= 0; --q) { + cur[q*4+3] = 255; + cur[q*4+2] = cur[q*3+2]; + cur[q*4+1] = cur[q*3+1]; + cur[q*4+0] = cur[q*3+0]; + } + } + } + } + } else if (depth == 16) { + stbi_uc *cur = a->out; + stbi__uint16 *cur16 = (stbi__uint16*)cur; + + for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { + *cur16 = (cur[0] << 8) | cur[1]; + } + } + + return 1; +} + +static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced) +{ + int bytes = (depth == 16 ? 2 : 1); + int out_bytes = out_n * bytes; + stbi_uc *final; + int p; + if (!interlaced) + return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); + + final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0); + for (p=0; p < 7; ++p) { + int xorig[] = { 0,4,0,2,0,1,0 }; + int yorig[] = { 0,0,4,0,2,0,1 }; + int xspc[] = { 8,8,4,4,2,2,1 }; + int yspc[] = { 8,8,8,4,4,2,2 }; + int i,j,x,y; + x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p]; + y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; + if (x && y) { + stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y; + if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) { + STBI_FREE(final); + return 0; + } + for (j=0; j < y; ++j) { + for (i=0; i < x; ++i) { + int out_y = j*yspc[p]+yorig[p]; + int out_x = i*xspc[p]+xorig[p]; + memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes, + a->out + (j*x+i)*out_bytes, out_bytes); + } + } + STBI_FREE(a->out); + image_data += img_len; + image_data_len -= img_len; + } + } + a->out = final; + + return 1; +} + +static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi_uc *p = z->out; + + STBI_ASSERT(out_n == 2 || out_n == 4); + + if (out_n == 2) { + for (i=0; i < pixel_count; ++i) { + p[1] = (p[0] == tc[0] ? 0 : 255); + p += 2; + } + } else { + for (i=0; i < pixel_count; ++i) { + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) + p[3] = 0; + p += 4; + } + } + return 1; +} + +static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi__uint16 *p = (stbi__uint16*) z->out; + + STBI_ASSERT(out_n == 2 || out_n == 4); + + if (out_n == 2) { + for (i = 0; i < pixel_count; ++i) { + p[1] = (p[0] == tc[0] ? 0 : 65535); + p += 2; + } + } else { + for (i = 0; i < pixel_count; ++i) { + if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) + p[3] = 0; + p += 4; + } + } + return 1; +} + +static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n) +{ + stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; + stbi_uc *p, *temp_out, *orig = a->out; + + p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0); + if (p == NULL) return stbi__err("outofmem", "Out of memory"); + + temp_out = p; + + if (pal_img_n == 3) { + for (i=0; i < pixel_count; ++i) { + int n = orig[i]*4; + p[0] = palette[n ]; + p[1] = palette[n+1]; + p[2] = palette[n+2]; + p += 3; + } + } else { + for (i=0; i < pixel_count; ++i) { + int n = orig[i]*4; + p[0] = palette[n ]; + p[1] = palette[n+1]; + p[2] = palette[n+2]; + p[3] = palette[n+3]; + p += 4; + } + } + STBI_FREE(a->out); + a->out = temp_out; + + STBI_NOTUSED(len); + + return 1; +} + +static int stbi__unpremultiply_on_load = 0; +static int stbi__de_iphone_flag = 0; + +void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) +{ + stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply; +} + +void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) +{ + stbi__de_iphone_flag = flag_true_if_should_convert; +} + +static void stbi__de_iphone(stbi__png *z) +{ + stbi__context *s = z->s; + stbi__uint32 i, pixel_count = s->img_x * s->img_y; + stbi_uc *p = z->out; + + if (s->img_out_n == 3) { + for (i=0; i < pixel_count; ++i) { + stbi_uc t = p[0]; + p[0] = p[2]; + p[2] = t; + p += 3; + } + } else { + STBI_ASSERT(s->img_out_n == 4); + if (stbi__unpremultiply_on_load) { + for (i=0; i < pixel_count; ++i) { + stbi_uc a = p[3]; + stbi_uc t = p[0]; + if (a) { + p[0] = p[2] * 255 / a; + p[1] = p[1] * 255 / a; + p[2] = t * 255 / a; + } else { + p[0] = p[2]; + p[2] = t; + } + p += 4; + } + } else { + for (i=0; i < pixel_count; ++i) { + stbi_uc t = p[0]; + p[0] = p[2]; + p[2] = t; + p += 4; + } + } + } +} + +#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d)) + +static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) +{ + stbi_uc palette[1024], pal_img_n=0; + stbi_uc has_trans=0, tc[3]; + stbi__uint16 tc16[3]; + stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; + int first=1,k,interlace=0, color=0, is_iphone=0; + stbi__context *s = z->s; + + z->expanded = NULL; + z->idata = NULL; + z->out = NULL; + + if (!stbi__check_png_header(s)) return 0; + + if (scan == STBI__SCAN_type) return 1; + + for (;;) { + stbi__pngchunk c = stbi__get_chunk_header(s); + switch (c.type) { + case STBI__PNG_TYPE('C','g','B','I'): + is_iphone = 1; + stbi__skip(s, c.length); + break; + case STBI__PNG_TYPE('I','H','D','R'): { + int comp,filter; + if (!first) return stbi__err("multiple IHDR","Corrupt PNG"); + first = 0; + if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); + s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); + s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); + z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); + color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); + if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); + if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG"); + comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG"); + filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG"); + interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG"); + if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG"); + if (!pal_img_n) { + s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); + if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); + if (scan == STBI__SCAN_header) return 1; + } else { + s->img_n = 1; + if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG"); + } + break; + } + + case STBI__PNG_TYPE('P','L','T','E'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG"); + pal_len = c.length / 3; + if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG"); + for (i=0; i < pal_len; ++i) { + palette[i*4+0] = stbi__get8(s); + palette[i*4+1] = stbi__get8(s); + palette[i*4+2] = stbi__get8(s); + palette[i*4+3] = 255; + } + break; + } + + case STBI__PNG_TYPE('t','R','N','S'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG"); + if (pal_img_n) { + if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; } + if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG"); + if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG"); + pal_img_n = 4; + for (i=0; i < c.length; ++i) + palette[i*4+3] = stbi__get8(s); + } else { + if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); + if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); + has_trans = 1; + if (z->depth == 16) { + for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); + } else { + for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; + } + } + break; + } + + case STBI__PNG_TYPE('I','D','A','T'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); + if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; } + if ((int)(ioff + c.length) < (int)ioff) return 0; + if (ioff + c.length > idata_limit) { + stbi__uint32 idata_limit_old = idata_limit; + stbi_uc *p; + if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; + while (ioff + c.length > idata_limit) + idata_limit *= 2; + STBI_NOTUSED(idata_limit_old); + p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); + z->idata = p; + } + if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG"); + ioff += c.length; + break; + } + + case STBI__PNG_TYPE('I','E','N','D'): { + stbi__uint32 raw_len, bpl; + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (scan != STBI__SCAN_load) return 1; + if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG"); + bpl = (s->img_x * z->depth + 7) / 8; + raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; + z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); + if (z->expanded == NULL) return 0; + STBI_FREE(z->idata); z->idata = NULL; + if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) + s->img_out_n = s->img_n+1; + else + s->img_out_n = s->img_n; + if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0; + if (has_trans) { + if (z->depth == 16) { + if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0; + } else { + if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; + } + } + if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) + stbi__de_iphone(z); + if (pal_img_n) { + s->img_n = pal_img_n; + s->img_out_n = pal_img_n; + if (req_comp >= 3) s->img_out_n = req_comp; + if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) + return 0; + } + STBI_FREE(z->expanded); z->expanded = NULL; + return 1; + } + + default: + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if ((c.type & (1 << 29)) == 0) { + return stbi__err("invalid_chunk", "PNG not supported: unknown PNG chunk type"); + } + stbi__skip(s, c.length); + break; + } + stbi__get32be(s); + } +} + +static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri) +{ + void *result=NULL; + if (req_comp < 0 || req_comp > 4) { stbi__err("bad req_comp", "Internal error"); return NULL; } + if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { + ri->bits_per_channel = p->depth; + result = p->out; + p->out = NULL; + if (req_comp && req_comp != p->s->img_out_n) { + if (ri->bits_per_channel == 8) + result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); + else + result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); + p->s->img_out_n = req_comp; + if (result == NULL) return result; + } + *x = p->s->img_x; + *y = p->s->img_y; + if (n) *n = p->s->img_n; + } + STBI_FREE(p->out); p->out = NULL; + STBI_FREE(p->expanded); p->expanded = NULL; + STBI_FREE(p->idata); p->idata = NULL; + + return result; +} + +static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) +{ + stbi__png p; + p.s = s; + return stbi__do_png(&p, x,y,comp,req_comp, ri); +} +#endif + +#if defined(M3D_EXPORTER) && !defined(INCLUDE_STB_IMAGE_WRITE_H) +/* zlib_compressor from + + stb_image_write - v1.13 - public domain - http://nothings.org/stb/stb_image_write.h +*/ +typedef unsigned char stbiw_uc; +typedef unsigned short stbiw_us; + +typedef uint16_t stbiw_uint16; +typedef int16_t stbiw_int16; +typedef uint32_t stbiw_uint32; +typedef int32_t stbiw_int32; + +#define STBIW_MALLOC(s) M3D_MALLOC(s) +#define STBIW_REALLOC(p,ns) M3D_REALLOC(p,ns) +#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) +#define STBIW_FREE M3D_FREE +#define STBIW_MEMMOVE memmove +#define STBIW_UCHAR (uint8_t) +#define STBIW_ASSERT(x) +#define stbiw__sbraw(a) ((int *) (a) - 2) +#define stbiw__sbm(a) stbiw__sbraw(a)[0] +#define stbiw__sbn(a) stbiw__sbraw(a)[1] + +#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) +#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) +#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) + +#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) +#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) +#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) + +static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) +{ + int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; + void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); + STBIW_ASSERT(p); + if (p) { + if (!*arr) ((int *) p)[1] = 0; + *arr = (void *) ((int *) p + 2); + stbiw__sbm(*arr) = m; + } + return *arr; +} + +static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) +{ + while (*bitcount >= 8) { + stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); + *bitbuffer >>= 8; + *bitcount -= 8; + } + return data; +} + +static int stbiw__zlib_bitrev(int code, int codebits) +{ + int res=0; + while (codebits--) { + res = (res << 1) | (code & 1); + code >>= 1; + } + return res; +} + +static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) +{ + int i; + for (i=0; i < limit && i < 258; ++i) + if (a[i] != b[i]) break; + return i; +} + +static unsigned int stbiw__zhash(unsigned char *data) +{ + stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + return hash; +} + +#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) +#define stbiw__zlib_add(code,codebits) \ + (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) +#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) +#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) +#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) +#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) +#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) +#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) +#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) + +#define stbiw__ZHASH 16384 + +unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) +{ + static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; + static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; + static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; + static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; + unsigned int bitbuf=0; + int i,j, bitcount=0; + unsigned char *out = NULL; + unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); + if (quality < 5) quality = 5; + + stbiw__sbpush(out, 0x78); + stbiw__sbpush(out, 0x5e); + stbiw__zlib_add(1,1); + stbiw__zlib_add(1,2); + + for (i=0; i < stbiw__ZHASH; ++i) + hash_table[i] = NULL; + + i=0; + while (i < data_len-3) { + int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; + unsigned char *bestloc = 0; + unsigned char **hlist = hash_table[h]; + int n = stbiw__sbcount(hlist); + for (j=0; j < n; ++j) { + if (hlist[j]-data > i-32768) { + int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); + if (d >= best) best=d,bestloc=hlist[j]; + } + } + if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { + STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); + stbiw__sbn(hash_table[h]) = quality; + } + stbiw__sbpush(hash_table[h],data+i); + + if (bestloc) { + h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); + hlist = hash_table[h]; + n = stbiw__sbcount(hlist); + for (j=0; j < n; ++j) { + if (hlist[j]-data > i-32767) { + int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); + if (e > best) { + bestloc = NULL; + break; + } + } + } + } + + if (bestloc) { + int d = (int) (data+i - bestloc); + STBIW_ASSERT(d <= 32767 && best <= 258); + for (j=0; best > lengthc[j+1]-1; ++j); + stbiw__zlib_huff(j+257); + if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); + for (j=0; d > distc[j+1]-1; ++j); + stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); + if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); + i += best; + } else { + stbiw__zlib_huffb(data[i]); + ++i; + } + } + for (;i < data_len; ++i) + stbiw__zlib_huffb(data[i]); + stbiw__zlib_huff(256); + while (bitcount) + stbiw__zlib_add(0,1); + + for (i=0; i < stbiw__ZHASH; ++i) + (void) stbiw__sbfree(hash_table[i]); + STBIW_FREE(hash_table); + + { + unsigned int s1=1, s2=0; + int blocklen = (int) (data_len % 5552); + j=0; + while (j < data_len) { + for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1; + s1 %= 65521, s2 %= 65521; + j += blocklen; + blocklen = 5552; + } + stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(s2)); + stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(s1)); + } + *out_len = stbiw__sbn(out); + STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); + return (unsigned char *) stbiw__sbraw(out); +} +#endif + +#define M3D_CHUNKMAGIC(m, a,b,c,d) ((m)[0]==(a) && (m)[1]==(b) && (m)[2]==(c) && (m)[3]==(d)) + +#ifdef M3D_ASCII +#include /* get sprintf */ +#include /* sprintf and strtod cares about number locale */ +#endif + +#if !defined(M3D_NOIMPORTER) && defined(M3D_ASCII) +/* helper functions for the ASCII parser */ +static char *_m3d_findarg(char *s) { + while(s && *s && *s != ' ' && *s != '\t' && *s != '\r' && *s != '\n') s++; + while(s && *s && (*s == ' ' || *s == '\t')) s++; + return s; +} +static char *_m3d_findnl(char *s) { + while(s && *s && *s != '\r' && *s != '\n') s++; + if(*s == '\r') s++; + if(*s == '\n') s++; + return s; +} +static char *_m3d_gethex(char *s, uint32_t *ret) +{ + if(*s == '#') s++; + *ret = 0; + for(; *s; s++) { + if(*s >= '0' && *s <= '9') { *ret <<= 4; *ret += (uint32_t)(*s-'0'); } + else if(*s >= 'a' && *s <= 'f') { *ret <<= 4; *ret += (uint32_t)(*s-'a'+10); } + else if(*s >= 'A' && *s <= 'F') { *ret <<= 4; *ret += (uint32_t)(*s-'A'+10); } + else break; + } + return _m3d_findarg(s); +} +static char *_m3d_getint(char *s, uint32_t *ret) +{ + char *e = s; + if(!s || !*s) return s; + for(; *e >= '0' && *e <= '9'; e++); + *ret = atoi(s); + return e; +} +static char *_m3d_getfloat(char *s, M3D_FLOAT *ret) +{ + char *e = s; + if(!s || !*s) return s; + for(; *e == '-' || *e == '+' || *e == '.' || (*e >= '0' && *e <= '9') || *e == 'e' || *e == 'E'; e++); + *ret = (M3D_FLOAT)strtod(s, NULL); + return _m3d_findarg(e); +} +#endif +#if !defined(M3D_NODUP) && (!defined(M3D_NONORMALS) || defined(M3D_EXPORTER)) +/* add vertex to list, only compare x,y,z */ +m3dv_t *_m3d_addnorm(m3dv_t *vrtx, uint32_t *numvrtx, m3dv_t *v, uint32_t *idx) +{ + uint32_t i; + if(v->x == (M3D_FLOAT)-0.0) v->x = (M3D_FLOAT)0.0; + if(v->y == (M3D_FLOAT)-0.0) v->y = (M3D_FLOAT)0.0; + if(v->z == (M3D_FLOAT)-0.0) v->z = (M3D_FLOAT)0.0; + if(v->w == (M3D_FLOAT)-0.0) v->w = (M3D_FLOAT)0.0; + if(vrtx) { + for(i = 0; i < *numvrtx; i++) + if(vrtx[i].x == v->x && vrtx[i].y == v->y && vrtx[i].z == v->z) { *idx = i; return vrtx; } + } + vrtx = (m3dv_t*)M3D_REALLOC(vrtx, ((*numvrtx) + 1) * sizeof(m3dv_t)); + memcpy(&vrtx[*numvrtx], v, sizeof(m3dv_t)); + vrtx[*numvrtx].color = 0; + vrtx[*numvrtx].w = (M3D_FLOAT)1.0; + *idx = *numvrtx; + (*numvrtx)++; + return vrtx; +} +#endif +#if !defined(M3D_NODUP) && (defined(M3D_ASCII) || defined(M3D_EXPORTER)) +m3ds_t *_m3d_addskin(m3ds_t *skin, uint32_t *numskin, m3ds_t *s, uint32_t *idx) +{ + uint32_t i; + M3D_FLOAT w = (M3D_FLOAT)0.0; + for(i = 0; i < M3D_NUMBONE && s->weight[i] > (M3D_FLOAT)0.0; i++) + w += s->weight[i]; + if(w != (M3D_FLOAT)1.0 && w != (M3D_FLOAT)0.0) + for(i = 0; i < M3D_NUMBONE && s->weight[i] > (M3D_FLOAT)0.0; i++) + s->weight[i] /= w; + if(skin) { + for(i = 0; i < *numskin; i++) + if(!memcmp(&skin[i], s, sizeof(m3ds_t))) { *idx = i; return skin; } + } + skin = (m3ds_t*)M3D_REALLOC(skin, ((*numskin) + 1) * sizeof(m3ds_t)); + memcpy(&skin[*numskin], s, sizeof(m3ds_t)); + *idx = *numskin; + (*numskin)++; + return skin; +} +/* helper function to create safe strings */ +char *_m3d_safestr(char *in, int morelines) +{ + char *out, *o, *i = in; + int l; + if(!in || !*in) { + out = (char*)M3D_MALLOC(1); + if(!out) return NULL; + out[0] =0; + } else { + for(o = in, l = 0; *o && ((morelines & 1) || (*o != '\r' && *o != '\n')) && l < 256; o++, l++); + out = o = (char*)M3D_MALLOC(l+1); + if(!out) return NULL; + while(*i == ' ' || *i == '\t' || *i == '\r' || (morelines && *i == '\n')) i++; + for(; *i && (morelines || (*i != '\r' && *i != '\n')); i++) { + if(*i == '\r') continue; + if(*i == '\n') { + if(morelines >= 3 && o > out && *(o-1) == '\n') break; + if(i > in && *(i-1) == '\n') continue; + if(morelines & 1) { + if(morelines == 1) *o++ = '\r'; + *o++ = '\n'; + } else + break; + } else + if(*i == ' ' || *i == '\t') { + *o++ = morelines? ' ' : '_'; + } else + *o++ = !morelines && (*i == '/' || *i == '\\') ? '_' : *i; + } + for(; o > out && (*(o-1) == ' ' || *(o-1) == '\t' || *(o-1) == '\r' || *(o-1) == '\n'); o--); + *o = 0; + out = (char*)M3D_REALLOC(out, (uint64_t)o - (uint64_t)out + 1); + } + return out; +} +#endif +#ifndef M3D_NOIMPORTER +/* helper function to load and decode/generate a texture */ +M3D_INDEX _m3d_gettx(m3d_t *model, m3dread_t readfilecb, m3dfree_t freecb, char *fn) +{ + unsigned int i, len = 0, w, h; + unsigned char *buff = NULL; + char *fn2; + stbi__context s; + stbi__result_info ri; + + for(i = 0; i < model->numtexture; i++) + if(!strcmp(fn, model->texture[i].name)) return i; + if(readfilecb) { + i = strlen(fn); + if(i < 5 || fn[i - 4] != '.') { + fn2 = (char*)M3D_MALLOC(i + 5); + if(!fn2) { model->errcode = M3D_ERR_ALLOC; return (M3D_INDEX)-1U; } + memcpy(fn2, fn, i); + memcpy(fn2+i, ".png", 5); + buff = (*readfilecb)(fn2, &len); + M3D_FREE(fn2); + } + if(!buff) + buff = (*readfilecb)(fn, &len); + } + if(!buff && model->inlined) { + for(i = 0; i < model->numinlined; i++) + if(!strcmp(fn, model->inlined[i].name)) { + buff = model->inlined[i].data; + len = model->inlined[i].length; + freecb = NULL; + break; + } + } + if(!buff) return (M3D_INDEX)-1U; + i = model->numtexture++; + model->texture = (m3dtx_t*)M3D_REALLOC(model->texture, model->numtexture * sizeof(m3dtx_t)); + if(!model->texture) { + if(freecb) (*freecb)(buff); + model->errcode = M3D_ERR_ALLOC; return (M3D_INDEX)-1U; + } + model->texture[i].w = model->texture[i].h = 0; model->texture[i].d = NULL; + if(buff[0] == 0x89 && buff[1] == 'P' && buff[2] == 'N' && buff[3] == 'G') { + s.read_from_callbacks = 0; + s.img_buffer = s.img_buffer_original = (stbi_uc *) buff; + s.img_buffer_end = s.img_buffer_original_end = (stbi_uc *) buff+len; + /* don't use model->texture[i].w directly, it's a uint16_t */ + w = h = 0; + model->texture[i].d = (uint32_t*)stbi__png_load(&s, (int*)&w, (int*)&h, (int*)&len, STBI_rgb_alpha, &ri); + model->texture[i].w = w; + model->texture[i].h = h; + } else { +#ifdef M3D_TX_INTERP + if((model->errcode = M3D_TX_INTERP(fn, buff, len, &model->texture[i])) != M3D_SUCCESS) { + M3D_LOG("Unable to generate texture"); + M3D_LOG(fn); + } +#else + M3D_LOG("Unimplemented interpreter"); + M3D_LOG(fn); +#endif + } + if(freecb) (*freecb)(buff); + if(!model->texture[i].d) { + M3D_FREE(model->texture[i].d); + model->errcode = M3D_ERR_UNKIMG; + model->numtexture--; + return (M3D_INDEX)-1U; + } + model->texture[i].name = fn; + return i; +} + +/* helper function to load and generate a procedural surface */ +void _m3d_getpr(m3d_t *model, _unused m3dread_t readfilecb, _unused m3dfree_t freecb, _unused char *fn) +{ +#ifdef M3D_PR_INTERP + unsigned int i, len = 0; + unsigned char *buff = readfilecb ? (*readfilecb)(fn, &len) : NULL; + + if(!buff && model->inlined) { + for(i = 0; i < model->numinlined; i++) + if(!strcmp(fn, model->inlined[i].name)) { + buff = model->inlined[i].data; + len = model->inlined[i].length; + freecb = NULL; + break; + } + } + if(!buff || !len || (model->errcode = M3D_PR_INTERP(fn, buff, len, model)) != M3D_SUCCESS) { + M3D_LOG("Unable to generate procedural surface"); + M3D_LOG(fn); + model->errcode = M3D_ERR_UNKIMG; + } + if(freecb && buff) (*freecb)(buff); +#else + M3D_LOG("Unimplemented interpreter"); + M3D_LOG(fn); + model->errcode = M3D_ERR_UNIMPL; +#endif +} +/* helpers to read indices from data stream */ +#define M3D_GETSTR(x) do{offs=0;data=_m3d_getidx(data,model->si_s,&offs);x=offs?((char*)model->raw+16+offs):NULL;}while(0) +_inline static unsigned char *_m3d_getidx(unsigned char *data, char type, M3D_INDEX *idx) +{ + switch(type) { + case 1: *idx = data[0] > 253 ? (int8_t)data[0] : data[0]; data++; break; + case 2: *idx = (uint16_t)((data[1]<<8)|data[0]) > 65533 ? (int16_t)((data[1]<<8)|data[0]) : (uint16_t)((data[1]<<8)|data[0]); data += 2; break; + case 4: *idx = (int32_t)((data[3]<<24)|(data[2]<<16)|(data[1]<<8)|data[0]); data += 4; break; + } + return data; +} + +#ifndef M3D_NOANIMATION +/* multiply 4 x 4 matrices. Do not use float *r[16] as argument, because some compilers misinterpret that as + * 16 pointers each pointing to a float, but we need a single pointer to 16 floats. */ +void _m3d_mul(M3D_FLOAT *r, M3D_FLOAT *a, M3D_FLOAT *b) +{ + r[ 0] = b[ 0] * a[ 0] + b[ 4] * a[ 1] + b[ 8] * a[ 2] + b[12] * a[ 3]; + r[ 1] = b[ 1] * a[ 0] + b[ 5] * a[ 1] + b[ 9] * a[ 2] + b[13] * a[ 3]; + r[ 2] = b[ 2] * a[ 0] + b[ 6] * a[ 1] + b[10] * a[ 2] + b[14] * a[ 3]; + r[ 3] = b[ 3] * a[ 0] + b[ 7] * a[ 1] + b[11] * a[ 2] + b[15] * a[ 3]; + r[ 4] = b[ 0] * a[ 4] + b[ 4] * a[ 5] + b[ 8] * a[ 6] + b[12] * a[ 7]; + r[ 5] = b[ 1] * a[ 4] + b[ 5] * a[ 5] + b[ 9] * a[ 6] + b[13] * a[ 7]; + r[ 6] = b[ 2] * a[ 4] + b[ 6] * a[ 5] + b[10] * a[ 6] + b[14] * a[ 7]; + r[ 7] = b[ 3] * a[ 4] + b[ 7] * a[ 5] + b[11] * a[ 6] + b[15] * a[ 7]; + r[ 8] = b[ 0] * a[ 8] + b[ 4] * a[ 9] + b[ 8] * a[10] + b[12] * a[11]; + r[ 9] = b[ 1] * a[ 8] + b[ 5] * a[ 9] + b[ 9] * a[10] + b[13] * a[11]; + r[10] = b[ 2] * a[ 8] + b[ 6] * a[ 9] + b[10] * a[10] + b[14] * a[11]; + r[11] = b[ 3] * a[ 8] + b[ 7] * a[ 9] + b[11] * a[10] + b[15] * a[11]; + r[12] = b[ 0] * a[12] + b[ 4] * a[13] + b[ 8] * a[14] + b[12] * a[15]; + r[13] = b[ 1] * a[12] + b[ 5] * a[13] + b[ 9] * a[14] + b[13] * a[15]; + r[14] = b[ 2] * a[12] + b[ 6] * a[13] + b[10] * a[14] + b[14] * a[15]; + r[15] = b[ 3] * a[12] + b[ 7] * a[13] + b[11] * a[14] + b[15] * a[15]; +} +/* calculate 4 x 4 matrix inverse */ +void _m3d_inv(M3D_FLOAT *m) +{ + M3D_FLOAT r[16]; + M3D_FLOAT det = + m[ 0]*m[ 5]*m[10]*m[15] - m[ 0]*m[ 5]*m[11]*m[14] + m[ 0]*m[ 6]*m[11]*m[13] - m[ 0]*m[ 6]*m[ 9]*m[15] + + m[ 0]*m[ 7]*m[ 9]*m[14] - m[ 0]*m[ 7]*m[10]*m[13] - m[ 1]*m[ 6]*m[11]*m[12] + m[ 1]*m[ 6]*m[ 8]*m[15] + - m[ 1]*m[ 7]*m[ 8]*m[14] + m[ 1]*m[ 7]*m[10]*m[12] - m[ 1]*m[ 4]*m[10]*m[15] + m[ 1]*m[ 4]*m[11]*m[14] + + m[ 2]*m[ 7]*m[ 8]*m[13] - m[ 2]*m[ 7]*m[ 9]*m[12] + m[ 2]*m[ 4]*m[ 9]*m[15] - m[ 2]*m[ 4]*m[11]*m[13] + + m[ 2]*m[ 5]*m[11]*m[12] - m[ 2]*m[ 5]*m[ 8]*m[15] - m[ 3]*m[ 4]*m[ 9]*m[14] + m[ 3]*m[ 4]*m[10]*m[13] + - m[ 3]*m[ 5]*m[10]*m[12] + m[ 3]*m[ 5]*m[ 8]*m[14] - m[ 3]*m[ 6]*m[ 8]*m[13] + m[ 3]*m[ 6]*m[ 9]*m[12]; + if(det == (M3D_FLOAT)0.0 || det == (M3D_FLOAT)-0.0) det = (M3D_FLOAT)1.0; else det = (M3D_FLOAT)1.0 / det; + r[ 0] = det *(m[ 5]*(m[10]*m[15] - m[11]*m[14]) + m[ 6]*(m[11]*m[13] - m[ 9]*m[15]) + m[ 7]*(m[ 9]*m[14] - m[10]*m[13])); + r[ 1] = -det*(m[ 1]*(m[10]*m[15] - m[11]*m[14]) + m[ 2]*(m[11]*m[13] - m[ 9]*m[15]) + m[ 3]*(m[ 9]*m[14] - m[10]*m[13])); + r[ 2] = det *(m[ 1]*(m[ 6]*m[15] - m[ 7]*m[14]) + m[ 2]*(m[ 7]*m[13] - m[ 5]*m[15]) + m[ 3]*(m[ 5]*m[14] - m[ 6]*m[13])); + r[ 3] = -det*(m[ 1]*(m[ 6]*m[11] - m[ 7]*m[10]) + m[ 2]*(m[ 7]*m[ 9] - m[ 5]*m[11]) + m[ 3]*(m[ 5]*m[10] - m[ 6]*m[ 9])); + r[ 4] = -det*(m[ 4]*(m[10]*m[15] - m[11]*m[14]) + m[ 6]*(m[11]*m[12] - m[ 8]*m[15]) + m[ 7]*(m[ 8]*m[14] - m[10]*m[12])); + r[ 5] = det *(m[ 0]*(m[10]*m[15] - m[11]*m[14]) + m[ 2]*(m[11]*m[12] - m[ 8]*m[15]) + m[ 3]*(m[ 8]*m[14] - m[10]*m[12])); + r[ 6] = -det*(m[ 0]*(m[ 6]*m[15] - m[ 7]*m[14]) + m[ 2]*(m[ 7]*m[12] - m[ 4]*m[15]) + m[ 3]*(m[ 4]*m[14] - m[ 6]*m[12])); + r[ 7] = det *(m[ 0]*(m[ 6]*m[11] - m[ 7]*m[10]) + m[ 2]*(m[ 7]*m[ 8] - m[ 4]*m[11]) + m[ 3]*(m[ 4]*m[10] - m[ 6]*m[ 8])); + r[ 8] = det *(m[ 4]*(m[ 9]*m[15] - m[11]*m[13]) + m[ 5]*(m[11]*m[12] - m[ 8]*m[15]) + m[ 7]*(m[ 8]*m[13] - m[ 9]*m[12])); + r[ 9] = -det*(m[ 0]*(m[ 9]*m[15] - m[11]*m[13]) + m[ 1]*(m[11]*m[12] - m[ 8]*m[15]) + m[ 3]*(m[ 8]*m[13] - m[ 9]*m[12])); + r[10] = det *(m[ 0]*(m[ 5]*m[15] - m[ 7]*m[13]) + m[ 1]*(m[ 7]*m[12] - m[ 4]*m[15]) + m[ 3]*(m[ 4]*m[13] - m[ 5]*m[12])); + r[11] = -det*(m[ 0]*(m[ 5]*m[11] - m[ 7]*m[ 9]) + m[ 1]*(m[ 7]*m[ 8] - m[ 4]*m[11]) + m[ 3]*(m[ 4]*m[ 9] - m[ 5]*m[ 8])); + r[12] = -det*(m[ 4]*(m[ 9]*m[14] - m[10]*m[13]) + m[ 5]*(m[10]*m[12] - m[ 8]*m[14]) + m[ 6]*(m[ 8]*m[13] - m[ 9]*m[12])); + r[13] = det *(m[ 0]*(m[ 9]*m[14] - m[10]*m[13]) + m[ 1]*(m[10]*m[12] - m[ 8]*m[14]) + m[ 2]*(m[ 8]*m[13] - m[ 9]*m[12])); + r[14] = -det*(m[ 0]*(m[ 5]*m[14] - m[ 6]*m[13]) + m[ 1]*(m[ 6]*m[12] - m[ 4]*m[14]) + m[ 2]*(m[ 4]*m[13] - m[ 5]*m[12])); + r[15] = det *(m[ 0]*(m[ 5]*m[10] - m[ 6]*m[ 9]) + m[ 1]*(m[ 6]*m[ 8] - m[ 4]*m[10]) + m[ 2]*(m[ 4]*m[ 9] - m[ 5]*m[ 8])); + memcpy(m, &r, sizeof(r)); +} +/* compose a coloumn major 4 x 4 matrix from vec3 position and vec4 orientation/rotation quaternion */ +#ifndef M3D_EPSILON +/* carefully choosen for IEEE 754 don't change */ +#define M3D_EPSILON ((M3D_FLOAT)1e-7) +#endif +void _m3d_mat(M3D_FLOAT *r, m3dv_t *p, m3dv_t *q) +{ + if(q->x == (M3D_FLOAT)0.0 && q->y == (M3D_FLOAT)0.0 && q->z >=(M3D_FLOAT) 0.7071065 && q->z <= (M3D_FLOAT)0.7071075 && + q->w == (M3D_FLOAT)0.0) { + r[ 1] = r[ 2] = r[ 4] = r[ 6] = r[ 8] = r[ 9] = (M3D_FLOAT)0.0; + r[ 0] = r[ 5] = r[10] = (M3D_FLOAT)-1.0; + } else { + r[ 0] = 1 - 2 * (q->y * q->y + q->z * q->z); if(r[ 0]>-M3D_EPSILON && r[ 0]x * q->y - q->z * q->w); if(r[ 1]>-M3D_EPSILON && r[ 1]x * q->z + q->y * q->w); if(r[ 2]>-M3D_EPSILON && r[ 2]x * q->y + q->z * q->w); if(r[ 4]>-M3D_EPSILON && r[ 4]x * q->x + q->z * q->z); if(r[ 5]>-M3D_EPSILON && r[ 5]y * q->z - q->x * q->w); if(r[ 6]>-M3D_EPSILON && r[ 6]x * q->z - q->y * q->w); if(r[ 8]>-M3D_EPSILON && r[ 8]y * q->z + q->x * q->w); if(r[ 9]>-M3D_EPSILON && r[ 9]x * q->x + q->y * q->y); if(r[10]>-M3D_EPSILON && r[10]x; r[ 7] = p->y; r[11] = p->z; + r[12] = 0; r[13] = 0; r[14] = 0; r[15] = 1; +} +#endif +#if !defined(M3D_NOANIMATION) || !defined(M3D_NONORMALS) +/* fast inverse square root calculation. returns 1/sqrt(x) */ +static M3D_FLOAT _m3d_rsq(M3D_FLOAT x) +{ +#ifdef M3D_DOUBLE + return ((M3D_FLOAT)15.0/(M3D_FLOAT)8.0) + ((M3D_FLOAT)-5.0/(M3D_FLOAT)4.0)*x + ((M3D_FLOAT)3.0/(M3D_FLOAT)8.0)*x*x; +#else + /* John Carmack's */ + float x2 = x * 0.5f; + *((uint32_t*)&x) = (0x5f3759df - (*((uint32_t*)&x) >> 1)); + return x * (1.5f - (x2 * x * x)); +#endif +} +#endif + +/** + * Function to decode a Model 3D into in-memory format + */ +m3d_t *m3d_load(unsigned char *data, m3dread_t readfilecb, m3dfree_t freecb, m3d_t *mtllib) +{ + unsigned char *end, *chunk, *buff, weights[8]; + unsigned int i, j, k, n, am, len = 0, reclen, offs; + char *material; +#ifndef M3D_NONORMALS + unsigned int numnorm = 0; + m3dv_t *norm = NULL, *v0, *v1, *v2, va, vb, vn; + M3D_INDEX *ni = NULL, *vi = NULL; +#endif + m3d_t *model; + M3D_INDEX mi; + M3D_FLOAT w; +#ifndef M3D_NOANIMATION + M3D_FLOAT r[16]; +#endif + m3dtx_t *tx; + m3dm_t *m; + m3da_t *a; + m3db_t *b; + m3di_t *t; + m3ds_t *sk; +#ifdef M3D_ASCII + m3ds_t s; + M3D_INDEX bi[M3D_BONEMAXLEVEL+1], level; + const char *ol; + char *ptr, *pe; +#endif + + if(!data || (!M3D_CHUNKMAGIC(data, '3','D','M','O') +#ifdef M3D_ASCII + && !M3D_CHUNKMAGIC(data, '3','d','m','o') +#endif + )) return NULL; + model = (m3d_t*)M3D_MALLOC(sizeof(m3d_t)); + if(!model) { + M3D_LOG("Out of memory"); + return NULL; + } + memset(model, 0, sizeof(m3d_t)); + + if(mtllib) { + model->nummaterial = mtllib->nummaterial; + model->material = mtllib->material; + model->numtexture = mtllib->numtexture; + model->texture = mtllib->texture; + model->flags |= M3D_FLG_MTLLIB; + } +#ifdef M3D_ASCII + /* ASCII variant? */ + if(M3D_CHUNKMAGIC(data, '3','d','m','o')) { + model->errcode = M3D_ERR_BADFILE; + model->flags |= M3D_FLG_FREESTR; + model->raw = (m3dhdr_t*)data; + ptr = (char*)data; + ol = setlocale(LC_NUMERIC, NULL); + setlocale(LC_NUMERIC, "C"); + /* parse header. Don't use sscanf, that's incredibly slow */ + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + pe = _m3d_findnl(ptr); + model->scale = (float)strtod(ptr, NULL); ptr = pe; + if(model->scale <= (M3D_FLOAT)0.0) model->scale = (M3D_FLOAT)1.0; + model->name = _m3d_safestr(ptr, 0); ptr = _m3d_findnl(ptr); + if(!*ptr) goto asciiend; + model->license = _m3d_safestr(ptr, 2); ptr = _m3d_findnl(ptr); + if(!*ptr) goto asciiend; + model->author = _m3d_safestr(ptr, 2); ptr = _m3d_findnl(ptr); + if(!*ptr) goto asciiend; + model->desc = _m3d_safestr(ptr, 3); + while(*ptr) { + while(*ptr && *ptr!='\n') ptr++; + ptr++; if(*ptr=='\r') ptr++; + if(*ptr == '\n') break; + } + + /* the main chunk reader loop */ + while(*ptr) { + while(*ptr && (*ptr == '\r' || *ptr == '\n')) ptr++; + if(!*ptr || (ptr[0]=='E' && ptr[1]=='n' && ptr[2]=='d')) break; + /* make sure there's at least one data row */ + pe = ptr; ptr = _m3d_findnl(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + /* texture map chunk */ + if(!memcmp(pe, "Textmap", 7)) { + if(model->tmap) { M3D_LOG("More texture map chunks, should be unique"); goto asciiend; } + while(*ptr && *ptr != '\r' && *ptr != '\n') { + i = model->numtmap++; + model->tmap = (m3dti_t*)M3D_REALLOC(model->tmap, model->numtmap * sizeof(m3dti_t)); + if(!model->tmap) goto memerr; + ptr = _m3d_getfloat(ptr, &model->tmap[i].u); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + ptr = _m3d_getfloat(ptr, &model->tmap[i].v); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + ptr = _m3d_findnl(ptr); + } + } else + /* vertex chunk */ + if(!memcmp(pe, "Vertex", 6)) { + if(model->vertex) { M3D_LOG("More vertex chunks, should be unique"); goto asciiend; } + while(*ptr && *ptr != '\r' && *ptr != '\n') { + i = model->numvertex++; + model->vertex = (m3dv_t*)M3D_REALLOC(model->vertex, model->numvertex * sizeof(m3dv_t)); + if(!model->vertex) goto memerr; + model->vertex[i].skinid = (M3D_INDEX)-1U; + model->vertex[i].color = 0; + ptr = _m3d_getfloat(ptr, &model->vertex[i].x); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + ptr = _m3d_getfloat(ptr, &model->vertex[i].y); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + ptr = _m3d_getfloat(ptr, &model->vertex[i].z); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + ptr = _m3d_getfloat(ptr, &model->vertex[i].w); + if(model->vertex[i].w != 1.0) model->vertex[i].skinid = (M3D_INDEX)-2U; + if(!*ptr) goto asciiend; + if(*ptr == '#') { + ptr = _m3d_gethex(ptr, &model->vertex[i].color); + if(!*ptr) goto asciiend; + } + /* parse skin */ + memset(&s, 0, sizeof(m3ds_t)); + for(j = 0; j < M3D_NUMBONE && *ptr && *ptr != '\r' && *ptr != '\n'; j++) { + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + ptr = _m3d_getint(ptr, &k); + s.boneid[j] = (M3D_INDEX)k; + if(*ptr == ':') { + ptr++; + ptr = _m3d_getfloat(ptr, &s.weight[j]); + } else if(!j) + s.weight[j] = (M3D_FLOAT)1.0; + if(!*ptr) goto asciiend; + } + if(s.boneid[0] != (M3D_INDEX)-1U && s.weight[0] > (M3D_FLOAT)0.0) { + model->skin = _m3d_addskin(model->skin, &model->numskin, &s, &k); + model->vertex[i].skinid = (M3D_INDEX)k; + } + ptr = _m3d_findnl(ptr); + } + } else + /* Skeleton, bone hierarchy */ + if(!memcmp(pe, "Bones", 5)) { + if(model->bone) { M3D_LOG("More bones chunks, should be unique"); goto asciiend; } + bi[0] = (M3D_INDEX)-1U; + while(*ptr && *ptr != '\r' && *ptr != '\n') { + i = model->numbone++; + model->bone = (m3db_t*)M3D_REALLOC(model->bone, model->numbone * sizeof(m3db_t)); + if(!model->bone) goto memerr; + for(level = 0; *ptr == '/'; ptr++, level++); + if(level > M3D_BONEMAXLEVEL || !*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + bi[level+1] = i; + model->bone[i].numweight = 0; + model->bone[i].weight = NULL; + model->bone[i].parent = bi[level]; + ptr = _m3d_getint(ptr, &k); + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + model->bone[i].pos = (M3D_INDEX)k; + ptr = _m3d_getint(ptr, &k); + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + model->bone[i].ori = (M3D_INDEX)k; + pe = _m3d_safestr(ptr, 0); + if(!pe || !*pe) goto asciiend; + model->bone[i].name = pe; + ptr = _m3d_findnl(ptr); + } + } else + /* material chunk */ + if(!memcmp(pe, "Material", 8)) { + pe = _m3d_findarg(pe); + if(!*pe || *pe == '\r' || *pe == '\n') goto asciiend; + pe = _m3d_safestr(pe, 0); + if(!pe || !*pe) goto asciiend; + for(i = 0; i < model->nummaterial; i++) + if(!strcmp(pe, model->material[i].name)) { + M3D_LOG("Multiple definitions for material"); + M3D_LOG(pe); + M3D_FREE(pe); + pe = NULL; + while(*ptr && *ptr != '\r' && *ptr != '\n') ptr = _m3d_findnl(ptr); + break; + } + if(!pe) continue; + i = model->nummaterial++; + if(model->flags & M3D_FLG_MTLLIB) { + m = model->material; + model->material = (m3dm_t*)M3D_MALLOC(model->nummaterial * sizeof(m3dm_t)); + if(!model->material) goto memerr; + memcpy(model->material, m, (model->nummaterial - 1) * sizeof(m3dm_t)); + if(model->texture) { + tx = model->texture; + model->texture = (m3dtx_t*)M3D_MALLOC(model->numtexture * sizeof(m3dtx_t)); + if(!model->texture) goto memerr; + memcpy(model->texture, tx, model->numtexture * sizeof(m3dm_t)); + } + model->flags &= ~M3D_FLG_MTLLIB; + } else { + model->material = (m3dm_t*)M3D_REALLOC(model->material, model->nummaterial * sizeof(m3dm_t)); + if(!model->material) goto memerr; + } + m = &model->material[i]; + m->name = pe; + m->numprop = 0; + m->prop = NULL; + while(*ptr && *ptr != '\r' && *ptr != '\n') { + k = n = 256; + if(*ptr == 'm' && *(ptr+1) == 'a' && *(ptr+2) == 'p' && *(ptr+3) == '_') { + k = m3dpf_map; + ptr += 4; + } + for(j = 0; j < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); j++) + if(!memcmp(ptr, m3d_propertytypes[j].key, strlen(m3d_propertytypes[j].key))) { + n = m3d_propertytypes[j].id; + if(k != m3dpf_map) k = m3d_propertytypes[j].format; + break; + } + if(n != 256 && k != 256) { + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + j = m->numprop++; + m->prop = (m3dp_t*)M3D_REALLOC(m->prop, m->numprop * sizeof(m3dp_t)); + if(!m->prop) goto memerr; + m->prop[j].type = n; + switch(k) { + case m3dpf_color: ptr = _m3d_gethex(ptr, &m->prop[j].value.color); break; + case m3dpf_uint8: + case m3dpf_uint16: + case m3dpf_uint32: ptr = _m3d_getint(ptr, &m->prop[j].value.num); break; + case m3dpf_float: ptr = _m3d_getfloat(ptr, &m->prop[j].value.fnum); break; + case m3dpf_map: + pe = _m3d_safestr(ptr, 0); + if(!pe || !*pe) goto asciiend; + m->prop[j].value.textureid = _m3d_gettx(model, readfilecb, freecb, pe); + if(model->errcode == M3D_ERR_ALLOC) { M3D_FREE(pe); goto memerr; } + if(m->prop[j].value.textureid == (M3D_INDEX)-1U) { + M3D_LOG("Texture not found"); + M3D_LOG(pe); + m->numprop--; + } + M3D_FREE(pe); + break; + } + } else { + M3D_LOG("Unknown material property in"); + M3D_LOG(m->name); + model->errcode = M3D_ERR_UNKPROP; + } + ptr = _m3d_findnl(ptr); + } + if(!m->numprop) model->nummaterial--; + } else + /* procedural, not implemented yet, skip chunk */ + if(!memcmp(pe, "Procedural", 10)) { + pe = _m3d_safestr(ptr, 0); + _m3d_getpr(model, readfilecb, freecb, pe); + M3D_FREE(pe); + while(*ptr && *ptr != '\r' && *ptr != '\n') ptr = _m3d_findnl(ptr); + } else + /* mesh */ + if(!memcmp(pe, "Mesh", 4)) { + mi = (M3D_INDEX)-1U; + while(*ptr && *ptr != '\r' && *ptr != '\n') { + if(*ptr == 'u') { + ptr = _m3d_findarg(ptr); + if(!*ptr) goto asciiend; + mi = (M3D_INDEX)-1U; + if(*ptr != '\r' && *ptr != '\n') { + pe = _m3d_safestr(ptr, 0); + if(!pe || !*pe) goto asciiend; + for(j = 0; j < model->nummaterial; j++) + if(!strcmp(pe, model->material[j].name)) { + mi = (M3D_INDEX)j; + break; + } + M3D_FREE(pe); + } + } else { + i = model->numface++; + model->face = (m3df_t*)M3D_REALLOC(model->face, model->numface * sizeof(m3df_t)); + if(!model->face) goto memerr; + memset(&model->face[i], 255, sizeof(m3df_t)); /* set all index to -1 by default */ + model->face[i].materialid = mi; + /* hardcoded triangles. */ + for(j = 0; j < 3; j++) { + /* vertex */ + ptr = _m3d_getint(ptr, &k); + model->face[i].vertex[j] = (M3D_INDEX)k; + if(!*ptr) goto asciiend; + if(*ptr == '/') { + ptr++; + if(*ptr != '/') { + /* texcoord */ + ptr = _m3d_getint(ptr, &k); + model->face[i].texcoord[j] = (M3D_INDEX)k; + if(!*ptr) goto asciiend; + } + if(*ptr == '/') { + ptr++; + /* normal */ + ptr = _m3d_getint(ptr, &k); + model->face[i].normal[j] = (M3D_INDEX)k; + if(!*ptr) goto asciiend; + } + } + ptr = _m3d_findarg(ptr); + } + } + ptr = _m3d_findnl(ptr); + } + } else + /* action */ + if(!memcmp(pe, "Action", 6)) { + pe = _m3d_findarg(pe); + if(!*pe || *pe == '\r' || *pe == '\n') goto asciiend; + pe = _m3d_getint(pe, &k); + pe = _m3d_findarg(pe); + if(!*pe || *pe == '\r' || *pe == '\n') goto asciiend; + pe = _m3d_safestr(pe, 0); + if(!pe || !*pe) goto asciiend; + i = model->numaction++; + model->action = (m3da_t*)M3D_REALLOC(model->action, model->numaction * sizeof(m3da_t)); + if(!model->action) goto memerr; + a = &model->action[i]; + a->name = pe; + a->durationmsec = k; + /* skip the first frame marker as there's always at least one frame */ + a->numframe = 1; + a->frame = (m3dfr_t*)M3D_MALLOC(sizeof(m3dfr_t)); + if(!a->frame) goto memerr; + a->frame[0].msec = 0; + a->frame[0].numtransform = 0; + a->frame[0].transform = NULL; + i = 0; + if(*ptr == 'f') + ptr = _m3d_findnl(ptr); + while(*ptr && *ptr != '\r' && *ptr != '\n') { + if(*ptr == 'f') { + i = a->numframe++; + a->frame = (m3dfr_t*)M3D_REALLOC(a->frame, a->numframe * sizeof(m3dfr_t)); + if(!a->frame) goto memerr; + ptr = _m3d_findarg(ptr); + ptr = _m3d_getint(ptr, &a->frame[i].msec); + a->frame[i].numtransform = 0; + a->frame[i].transform = NULL; + } else { + j = a->frame[i].numtransform++; + a->frame[i].transform = (m3dtr_t*)M3D_REALLOC(a->frame[i].transform, + a->frame[i].numtransform * sizeof(m3dtr_t)); + if(!a->frame[i].transform) goto memerr; + ptr = _m3d_getint(ptr, &k); + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + a->frame[i].transform[j].boneid = (M3D_INDEX)k; + ptr = _m3d_getint(ptr, &k); + ptr = _m3d_findarg(ptr); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + a->frame[i].transform[j].pos = (M3D_INDEX)k; + ptr = _m3d_getint(ptr, &k); + if(!*ptr || *ptr == '\r' || *ptr == '\n') goto asciiend; + a->frame[i].transform[j].ori = (M3D_INDEX)k; + } + ptr = _m3d_findnl(ptr); + } + } else + /* extra chunks */ + if(!memcmp(pe, "Extra", 5)) { + pe = _m3d_findarg(pe); + if(!*pe || *pe == '\r' || *pe == '\n') goto asciiend; + buff = (unsigned char*)_m3d_findnl(ptr); + k = ((uint32_t)((uint64_t)buff - (uint64_t)ptr) / 3) + 1; + i = model->numunknown++; + model->unknown = (m3dchunk_t**)M3D_REALLOC(model->unknown, model->numunknown * sizeof(m3dchunk_t*)); + if(!model->unknown) goto memerr; + model->unknown[i] = (m3dchunk_t*)M3D_MALLOC(k + sizeof(m3dchunk_t)); + if(!model->unknown[i]) goto memerr; + memcpy(&model->unknown[i]->magic, pe, 4); + model->unknown[i]->length = sizeof(m3dchunk_t); + pe = (char*)model->unknown[i] + sizeof(m3dchunk_t); + while(*ptr && *ptr != '\r' && *ptr != '\n') { + ptr = _m3d_gethex(ptr, &k); + *pe++ = (uint8_t)k; + model->unknown[i]->length++; + } + } else + goto asciiend; + } + model->errcode = M3D_SUCCESS; +asciiend: + setlocale(LC_NUMERIC, ol); + goto postprocess; + } + /* Binary variant */ +#endif + if(!M3D_CHUNKMAGIC(data + 8, 'H','E','A','D')) { + stbi__g_failure_reason = "Corrupt file"; + buff = (unsigned char *)stbi_zlib_decode_malloc_guesssize_headerflag((const char*)data+8, ((m3dchunk_t*)data)->length-8, + 4096, (int*)&len, 1); + if(!buff || !len || !M3D_CHUNKMAGIC(buff, 'H','E','A','D')) { + M3D_LOG(stbi__g_failure_reason); + if(buff) M3D_FREE(buff); + M3D_FREE(model); + return NULL; + } + buff = (unsigned char*)M3D_REALLOC(buff, len); + model->flags |= M3D_FLG_FREERAW; /* mark that we have to free the raw buffer */ + data = buff; + } else { + len = ((m3dhdr_t*)data)->length; + data += 8; + } + model->raw = (m3dhdr_t*)data; + end = data + len; + + /* parse header */ + data += sizeof(m3dhdr_t); + M3D_LOG(data); + model->name = (char*)data; + for(; data < end && *data; data++) {}; data++; + model->license = (char*)data; + for(; data < end && *data; data++) {}; data++; + model->author = (char*)data; + for(; data < end && *data; data++) {}; data++; + model->desc = (char*)data; + chunk = (unsigned char*)model->raw + model->raw->length; + model->scale = (M3D_FLOAT)model->raw->scale; + if(model->scale <= (M3D_FLOAT)0.0) model->scale = (M3D_FLOAT)1.0; + model->vc_s = 1 << ((model->raw->types >> 0) & 3); /* vertex coordinate size */ + model->vi_s = 1 << ((model->raw->types >> 2) & 3); /* vertex index size */ + model->si_s = 1 << ((model->raw->types >> 4) & 3); /* string offset size */ + model->ci_s = 1 << ((model->raw->types >> 6) & 3); /* color index size */ + model->ti_s = 1 << ((model->raw->types >> 8) & 3); /* tmap index size */ + model->bi_s = 1 << ((model->raw->types >>10) & 3); /* bone index size */ + model->nb_s = 1 << ((model->raw->types >>12) & 3); /* number of bones per vertex */ + model->sk_s = 1 << ((model->raw->types >>14) & 3); /* skin index size */ + model->fi_s = 1 << ((model->raw->types >>16) & 3); /* frame counter size */ + if(model->ci_s == 8) model->ci_s = 0; /* optional indices */ + if(model->ti_s == 8) model->ti_s = 0; + if(model->bi_s == 8) model->bi_s = 0; + if(model->sk_s == 8) model->sk_s = 0; + if(model->fi_s == 8) model->fi_s = 0; + + /* variable limit checks */ + if(sizeof(M3D_FLOAT) == 4 && model->vc_s > 4) { + M3D_LOG("Double precision coordinates not supported, truncating to float..."); + model->errcode = M3D_ERR_TRUNC; + } + if(sizeof(M3D_INDEX) == 2 && (model->vi_s > 2 || model->si_s > 2 || model->ci_s > 2 || model->ti_s > 2 || + model->bi_s > 2 || model->sk_s > 2 || model->fi_s > 2)) { + M3D_LOG("32 bit indices not supported, unable to load model"); + M3D_FREE(model); + return NULL; + } + if(model->vi_s > 4 || model->si_s > 4) { + M3D_LOG("Invalid index size, unable to load model"); + M3D_FREE(model); + return NULL; + } + if(model->nb_s > M3D_NUMBONE) { + M3D_LOG("Model has more bones per vertex than importer supports"); + model->errcode = M3D_ERR_TRUNC; + } + + /* look for inlined assets in advance, material and procedural chunks may need them */ + buff = chunk; + while(buff < end && !M3D_CHUNKMAGIC(buff, 'O','M','D','3')) { + data = buff; + len = ((m3dchunk_t*)data)->length; + if(len < sizeof(m3dchunk_t)) { + M3D_LOG("Invalid chunk size"); + break; + } + buff += len; + len -= sizeof(m3dchunk_t) + model->si_s; + + /* inlined assets */ + if(M3D_CHUNKMAGIC(data, 'A','S','E','T') && len > 0) { + M3D_LOG("Inlined asset"); + i = model->numinlined++; + model->inlined = (m3di_t*)M3D_REALLOC(model->inlined, model->numinlined * sizeof(m3di_t)); + if(!model->inlined) { +memerr: M3D_LOG("Out of memory"); + model->errcode = M3D_ERR_ALLOC; + return model; + } + data += sizeof(m3dchunk_t); + t = &model->inlined[i]; + M3D_GETSTR(t->name); + M3D_LOG(t->name); + t->data = (uint8_t*)data; + t->length = len; + } + } + + /* parse chunks */ + while(chunk < end && !M3D_CHUNKMAGIC(chunk, 'O','M','D','3')) { + data = chunk; + len = ((m3dchunk_t*)chunk)->length; + if(len < sizeof(m3dchunk_t)) { + M3D_LOG("Invalid chunk size"); + break; + } + chunk += len; + len -= sizeof(m3dchunk_t); + + /* color map */ + if(M3D_CHUNKMAGIC(data, 'C','M','A','P')) { + M3D_LOG("Color map"); + if(model->cmap) { M3D_LOG("More color map chunks, should be unique"); model->errcode = M3D_ERR_CMAP; continue; } + if(!model->ci_s) { M3D_LOG("Color map chunk, shouldn't be any"); model->errcode = M3D_ERR_CMAP; continue; } + model->numcmap = len / sizeof(uint32_t); + model->cmap = (uint32_t*)(data + sizeof(m3dchunk_t)); + } else + /* texture map */ + if(M3D_CHUNKMAGIC(data, 'T','M','A','P')) { + M3D_LOG("Texture map"); + if(model->tmap) { M3D_LOG("More texture map chunks, should be unique"); model->errcode = M3D_ERR_TMAP; continue; } + if(!model->ti_s) { M3D_LOG("Texture map chunk, shouldn't be any"); model->errcode = M3D_ERR_TMAP; continue; } + reclen = model->vc_s + model->vc_s; + model->numtmap = len / reclen; + model->tmap = (m3dti_t*)M3D_MALLOC(model->numtmap * sizeof(m3dti_t)); + if(!model->tmap) goto memerr; + for(i = 0, data += sizeof(m3dchunk_t); data < chunk; i++) { + switch(model->vc_s) { + case 1: + model->tmap[i].u = (M3D_FLOAT)(data[0]) / 255; + model->tmap[i].v = (M3D_FLOAT)(data[1]) / 255; + break; + case 2: + model->tmap[i].u = (M3D_FLOAT)(*((int16_t*)(data+0))) / 65535; + model->tmap[i].v = (M3D_FLOAT)(*((int16_t*)(data+2))) / 65535; + break; + case 4: + model->tmap[i].u = (M3D_FLOAT)(*((float*)(data+0))); + model->tmap[i].v = (M3D_FLOAT)(*((float*)(data+4))); + break; + case 8: + model->tmap[i].u = (M3D_FLOAT)(*((double*)(data+0))); + model->tmap[i].v = (M3D_FLOAT)(*((double*)(data+8))); + break; + } + data += reclen; + } + } else + /* vertex list */ + if(M3D_CHUNKMAGIC(data, 'V','R','T','S')) { + M3D_LOG("Vertex list"); + if(model->vertex) { M3D_LOG("More vertex chunks, should be unique"); model->errcode = M3D_ERR_VRTS; continue; } + if(model->ci_s && model->ci_s < 4 && !model->cmap) model->errcode = M3D_ERR_CMAP; + reclen = model->ci_s + model->sk_s + 4 * model->vc_s; + model->numvertex = len / reclen; + model->vertex = (m3dv_t*)M3D_MALLOC(model->numvertex * sizeof(m3dv_t)); + if(!model->vertex) goto memerr; + memset(model->vertex, 0, model->numvertex * sizeof(m3dv_t)); + for(i = 0, data += sizeof(m3dchunk_t); data < chunk && i < model->numvertex; i++) { + switch(model->vc_s) { + case 1: + model->vertex[i].x = (M3D_FLOAT)((int8_t)data[0]) / 127; + model->vertex[i].y = (M3D_FLOAT)((int8_t)data[1]) / 127; + model->vertex[i].z = (M3D_FLOAT)((int8_t)data[2]) / 127; + model->vertex[i].w = (M3D_FLOAT)((int8_t)data[3]) / 127; + data += 4; + break; + case 2: + model->vertex[i].x = (M3D_FLOAT)((int16_t)((data[1]<<8)|data[0])) / 32767; + model->vertex[i].y = (M3D_FLOAT)((int16_t)((data[3]<<8)|data[2])) / 32767; + model->vertex[i].z = (M3D_FLOAT)((int16_t)((data[5]<<8)|data[4])) / 32767; + model->vertex[i].w = (M3D_FLOAT)((int16_t)((data[7]<<8)|data[6])) / 32767; + data += 8; + break; + case 4: + model->vertex[i].x = (M3D_FLOAT)(*((float*)(data+0))); + model->vertex[i].y = (M3D_FLOAT)(*((float*)(data+4))); + model->vertex[i].z = (M3D_FLOAT)(*((float*)(data+8))); + model->vertex[i].w = (M3D_FLOAT)(*((float*)(data+12))); + data += 16; + break; + case 8: + model->vertex[i].x = (M3D_FLOAT)(*((double*)(data+0))); + model->vertex[i].y = (M3D_FLOAT)(*((double*)(data+8))); + model->vertex[i].z = (M3D_FLOAT)(*((double*)(data+16))); + model->vertex[i].w = (M3D_FLOAT)(*((double*)(data+24))); + data += 32; + break; + } + switch(model->ci_s) { + case 1: model->vertex[i].color = model->cmap ? model->cmap[data[0]] : 0; data++; break; + case 2: model->vertex[i].color = model->cmap ? model->cmap[*((uint16_t*)data)] : 0; data += 2; break; + case 4: model->vertex[i].color = *((uint32_t*)data); data += 4; break; + /* case 8: break; */ + } + model->vertex[i].skinid = (M3D_INDEX)-1U; + data = _m3d_getidx(data, model->sk_s, &model->vertex[i].skinid); + } + } else + /* skeleton: bone hierarchy and skin */ + if(M3D_CHUNKMAGIC(data, 'B','O','N','E')) { + M3D_LOG("Skeleton"); + if(model->bone) { M3D_LOG("More bone chunks, should be unique"); model->errcode = M3D_ERR_BONE; continue; } + if(!model->bi_s) { M3D_LOG("Bone chunk, shouldn't be any"); model->errcode=M3D_ERR_BONE; continue; } + if(!model->vertex) { M3D_LOG("No vertex chunk before bones"); model->errcode = M3D_ERR_VRTS; break; } + data += sizeof(m3dchunk_t); + model->numbone = 0; + data = _m3d_getidx(data, model->bi_s, &model->numbone); + if(model->numbone) { + model->bone = (m3db_t*)M3D_MALLOC(model->numbone * sizeof(m3db_t)); + if(!model->bone) goto memerr; + } + model->numskin = 0; + data = _m3d_getidx(data, model->sk_s, &model->numskin); + if(model->numskin) { + model->skin = (m3ds_t*)M3D_MALLOC(model->numskin * sizeof(m3ds_t)); + if(!model->skin) goto memerr; + for(i = 0; i < model->numskin; i++) + for(j = 0; j < M3D_NUMBONE; j++) { + model->skin[i].boneid[j] = (M3D_INDEX)-1U; + model->skin[i].weight[j] = (M3D_FLOAT)0.0; + } + } + /* read bone hierarchy */ + for(i = 0; i < model->numbone; i++) { + data = _m3d_getidx(data, model->bi_s, &model->bone[i].parent); + M3D_GETSTR(model->bone[i].name); + data = _m3d_getidx(data, model->vi_s, &model->bone[i].pos); + data = _m3d_getidx(data, model->vi_s, &model->bone[i].ori); + model->bone[i].numweight = 0; + model->bone[i].weight = NULL; + } + /* read skin definitions */ + for(i = 0; data < chunk && i < model->numskin; i++) { + memset(&weights, 0, sizeof(weights)); + if(model->nb_s == 1) weights[0] = 255; + else { + memcpy(&weights, data, model->nb_s); + data += model->nb_s; + } + for(j = 0; j < (unsigned int)model->nb_s; j++) { + if(weights[j]) { + if(j >= M3D_NUMBONE) + data += model->bi_s; + else { + model->skin[i].weight[j] = (M3D_FLOAT)(weights[j]) / 255; + data = _m3d_getidx(data, model->bi_s, &model->skin[i].boneid[j]); + } + } + } + } + } else + /* material */ + if(M3D_CHUNKMAGIC(data, 'M','T','R','L')) { + data += sizeof(m3dchunk_t); + M3D_GETSTR(material); + M3D_LOG("Material"); + M3D_LOG(material); + if(model->ci_s < 4 && !model->numcmap) model->errcode = M3D_ERR_CMAP; + for(i = 0; i < model->nummaterial; i++) + if(!strcmp(material, model->material[i].name)) { + model->errcode = M3D_ERR_MTRL; + M3D_LOG("Multiple definitions for material"); + M3D_LOG(material); + material = NULL; + break; + } + if(material) { + i = model->nummaterial++; + if(model->flags & M3D_FLG_MTLLIB) { + m = model->material; + model->material = (m3dm_t*)M3D_MALLOC(model->nummaterial * sizeof(m3dm_t)); + if(!model->material) goto memerr; + memcpy(model->material, m, (model->nummaterial - 1) * sizeof(m3dm_t)); + if(model->texture) { + tx = model->texture; + model->texture = (m3dtx_t*)M3D_MALLOC(model->numtexture * sizeof(m3dtx_t)); + if(!model->texture) goto memerr; + memcpy(model->texture, tx, model->numtexture * sizeof(m3dm_t)); + } + model->flags &= ~M3D_FLG_MTLLIB; + } else { + model->material = (m3dm_t*)M3D_REALLOC(model->material, model->nummaterial * sizeof(m3dm_t)); + if(!model->material) goto memerr; + } + m = &model->material[i]; + m->numprop = 0; + m->prop = NULL; + m->name = material; + m->prop = (m3dp_t*)M3D_REALLOC(m->prop, (len / 2) * sizeof(m3dp_t)); + if(!m->prop) goto memerr; + while(data < chunk) { + i = m->numprop++; + m->prop[i].type = *data++; + m->prop[i].value.num = 0; + if(m->prop[i].type >= 128) + k = m3dpf_map; + else { + for(k = 256, j = 0; j < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); j++) + if(m->prop[i].type == m3d_propertytypes[j].id) { k = m3d_propertytypes[j].format; break; } + } + switch(k) { + case m3dpf_color: + switch(model->ci_s) { + case 1: m->prop[i].value.color = model->cmap ? model->cmap[data[0]] : 0; data++; break; + case 2: m->prop[i].value.color = model->cmap ? model->cmap[*((uint16_t*)data)] : 0; data += 2; break; + case 4: m->prop[i].value.color = *((uint32_t*)data); data += 4; break; + } + break; + + case m3dpf_uint8: m->prop[i].value.num = *data++; break; + case m3dpf_uint16:m->prop[i].value.num = *((uint16_t*)data); data += 2; break; + case m3dpf_uint32:m->prop[i].value.num = *((uint32_t*)data); data += 4; break; + case m3dpf_float: m->prop[i].value.fnum = *((float*)data); data += 4; break; + + case m3dpf_map: + M3D_GETSTR(material); + m->prop[i].value.textureid = _m3d_gettx(model, readfilecb, freecb, material); + if(model->errcode == M3D_ERR_ALLOC) goto memerr; + if(m->prop[i].value.textureid == (M3D_INDEX)-1U) { + M3D_LOG("Texture not found"); + M3D_LOG(material); + m->numprop--; + } + break; + + default: + M3D_LOG("Unknown material property in"); + M3D_LOG(m->name); + model->errcode = M3D_ERR_UNKPROP; + data = chunk; + break; + } + } + m->prop = (m3dp_t*)M3D_REALLOC(m->prop, m->numprop * sizeof(m3dp_t)); + if(!m->prop) goto memerr; + } + } else + /* face */ + if(M3D_CHUNKMAGIC(data, 'P','R','O','C')) { + /* procedural surface */ + M3D_GETSTR(material); + M3D_LOG("Procedural surface"); + M3D_LOG(material); + _m3d_getpr(model, readfilecb, freecb, material); + } else + if(M3D_CHUNKMAGIC(data, 'M','E','S','H')) { + M3D_LOG("Mesh data"); + /* mesh */ + data += sizeof(m3dchunk_t); + mi = (M3D_INDEX)-1U; + am = model->numface; + while(data < chunk) { + k = *data++; + n = k >> 4; + k &= 15; + if(!n) { + /* use material */ + mi = (M3D_INDEX)-1U; + M3D_GETSTR(material); + if(material) { + for(j = 0; j < model->nummaterial; j++) + if(!strcmp(material, model->material[j].name)) { + mi = (M3D_INDEX)j; + break; + } + if(mi == (M3D_INDEX)-1U) model->errcode = M3D_ERR_MTRL; + } + continue; + } + if(n != 3) { M3D_LOG("Only triangle mesh supported for now"); model->errcode = M3D_ERR_UNKMESH; return model; } + i = model->numface++; + if(model->numface > am) { + am = model->numface + 4095; + model->face = (m3df_t*)M3D_REALLOC(model->face, am * sizeof(m3df_t)); + if(!model->face) goto memerr; + } + memset(&model->face[i], 255, sizeof(m3df_t)); /* set all index to -1 by default */ + model->face[i].materialid = mi; + for(j = 0; j < n; j++) { + /* vertex */ + data = _m3d_getidx(data, model->vi_s, &model->face[i].vertex[j]); + /* texcoord */ + if(k & 1) + data = _m3d_getidx(data, model->ti_s, &model->face[i].texcoord[j]); + /* normal */ + if(k & 2) + data = _m3d_getidx(data, model->vi_s, &model->face[i].normal[j]); + } + } + model->face = (m3df_t*)M3D_REALLOC(model->face, model->numface * sizeof(m3df_t)); + } else + /* action */ + if(M3D_CHUNKMAGIC(data, 'A','C','T','N')) { + M3D_LOG("Action"); + i = model->numaction++; + model->action = (m3da_t*)M3D_REALLOC(model->action, model->numaction * sizeof(m3da_t)); + if(!model->action) goto memerr; + a = &model->action[i]; + data += sizeof(m3dchunk_t); + M3D_GETSTR(a->name); + M3D_LOG(a->name); + a->numframe = *((uint16_t*)data); data += 2; + if(a->numframe < 1) { + model->numaction--; + } else { + a->durationmsec = *((uint32_t*)data); data += 4; + a->frame = (m3dfr_t*)M3D_MALLOC(a->numframe * sizeof(m3dfr_t)); + if(!a->frame) goto memerr; + for(i = 0; data < chunk && i < a->numframe; i++) { + a->frame[i].msec = *((uint32_t*)data); data += 4; + a->frame[i].numtransform = 0; a->frame[i].transform = NULL; + data = _m3d_getidx(data, model->fi_s, &a->frame[i].numtransform); + if(a->frame[i].numtransform > 0) { + a->frame[i].transform = (m3dtr_t*)M3D_MALLOC(a->frame[i].numtransform * sizeof(m3dtr_t)); + for(j = 0; j < a->frame[i].numtransform; j++) { + data = _m3d_getidx(data, model->bi_s, &a->frame[i].transform[j].boneid); + data = _m3d_getidx(data, model->vi_s, &a->frame[i].transform[j].pos); + data = _m3d_getidx(data, model->vi_s, &a->frame[i].transform[j].ori); + } + } + } + } + } else { + i = model->numunknown++; + model->unknown = (m3dchunk_t**)M3D_REALLOC(model->unknown, model->numunknown * sizeof(m3dchunk_t*)); + if(!model->unknown) goto memerr; + model->unknown[i] = (m3dchunk_t*)data; + } + } + /* calculate normals, normalize skin weights, create bone/vertex cross-references and calculate transform matrices */ +#ifdef M3D_ASCII +postprocess: +#endif + if(model) { +#ifndef M3D_NONORMALS + if(model->numface && model->face) { + memset(&vn, 0, sizeof(m3dv_t)); + /* if they are missing, calculate triangle normals into a temporary buffer */ + for(i = numnorm = 0; i < model->numface; i++) + if(model->face[i].normal[0] == -1U) { + v0 = &model->vertex[model->face[i].vertex[0]]; v1 = &model->vertex[model->face[i].vertex[1]]; + v2 = &model->vertex[model->face[i].vertex[2]]; + va.x = v1->x - v0->x; va.y = v1->y - v0->y; va.z = v1->z - v0->z; + vb.x = v2->x - v0->x; vb.y = v2->y - v0->y; vb.z = v2->z - v0->z; + vn.x = (va.y * vb.z) - (va.z * vb.y); + vn.y = (va.z * vb.x) - (va.x * vb.z); + vn.z = (va.x * vb.y) - (va.y * vb.x); + w = _m3d_rsq((vn.x * vn.x) + (vn.y * vn.y) + (vn.z * vn.z)); + vn.x *= w; vn.y *= w; vn.z *= w; + norm = _m3d_addnorm(norm, &numnorm, &vn, &j); + if(!ni) { + ni = (M3D_INDEX*)M3D_MALLOC(model->numface * sizeof(M3D_INDEX)); + if(!ni) goto memerr; + } + ni[i] = j; + } + if(ni && norm) { + vi = (M3D_INDEX*)M3D_MALLOC(model->numvertex * sizeof(M3D_INDEX)); + if(!vi) goto memerr; + /* for each vertex, take the average of the temporary normals and use that */ + for(i = 0, n = model->numvertex; i < n; i++) { + memset(&vn, 0, sizeof(m3dv_t)); + for(j = 0; j < model->numface; j++) + for(k = 0; k < 3; k++) + if(model->face[j].vertex[k] == i) { + vn.x += norm[ni[j]].x; + vn.y += norm[ni[j]].y; + vn.z += norm[ni[j]].z; + } + w = _m3d_rsq((vn.x * vn.x) + (vn.y * vn.y) + (vn.z * vn.z)); + vn.x *= w; vn.y *= w; vn.z *= w; + vn.skinid = -1U; + model->vertex = _m3d_addnorm(model->vertex, &model->numvertex, &vn, &vi[i]); + } + for(j = 0; j < model->numface; j++) + for(k = 0; k < 3; k++) + model->face[j].normal[k] = vi[model->face[j].vertex[k]]; + M3D_FREE(norm); + M3D_FREE(ni); + M3D_FREE(vi); + } + } +#endif + if(model->numbone && model->bone && model->numskin && model->skin && model->numvertex && model->vertex) { +#ifndef M3D_NOWEIGHTS + for(i = 0; i < model->numvertex; i++) { + if(model->vertex[i].skinid < M3D_INDEXMAX) { + sk = &model->skin[model->vertex[i].skinid]; + w = (M3D_FLOAT)0.0; + for(j = 0; j < M3D_NUMBONE && sk->boneid[j] != (M3D_INDEX)-1U && sk->weight[j] > (M3D_FLOAT)0.0; j++) + w += sk->weight[j]; + for(j = 0; j < M3D_NUMBONE && sk->boneid[j] != (M3D_INDEX)-1U && sk->weight[j] > (M3D_FLOAT)0.0; j++) { + sk->weight[j] /= w; + b = &model->bone[sk->boneid[j]]; + k = b->numweight++; + b->weight = (m3dw_t*)M3D_REALLOC(b->weight, b->numweight * sizeof(m3da_t)); + if(!b->weight) goto memerr; + b->weight[k].vertexid = i; + b->weight[k].weight = sk->weight[j]; + } + } + } +#endif +#ifndef M3D_NOANIMATION + for(i = 0; i < model->numbone; i++) { + b = &model->bone[i]; + if(model->bone[i].parent == (M3D_INDEX)-1U) { + _m3d_mat((M3D_FLOAT*)&b->mat4, &model->vertex[b->pos], &model->vertex[b->ori]); + } else { + _m3d_mat((M3D_FLOAT*)&r, &model->vertex[b->pos], &model->vertex[b->ori]); + _m3d_mul((M3D_FLOAT*)&b->mat4, (M3D_FLOAT*)&model->bone[b->parent].mat4, (M3D_FLOAT*)&r); + } + } + for(i = 0; i < model->numbone; i++) + _m3d_inv((M3D_FLOAT*)&model->bone[i].mat4); +#endif + } + } + return model; +} + +/** + * Calculates skeletons for animation frames, returns a working copy (should be freed after use) + */ +m3dtr_t *m3d_frame(m3d_t *model, M3D_INDEX actionid, M3D_INDEX frameid, m3dtr_t *skeleton) +{ + unsigned int i; + M3D_INDEX s = frameid; + m3dfr_t *fr; + + if(!model || !model->numbone || !model->bone || (actionid != (M3D_INDEX)-1U && (!model->action || + actionid >= model->numaction || frameid >= model->action[actionid].numframe))) { + model->errcode = M3D_ERR_UNKFRAME; + return skeleton; + } + model->errcode = M3D_SUCCESS; + if(!skeleton) { + skeleton = (m3dtr_t*)M3D_MALLOC(model->numbone * sizeof(m3dtr_t)); + if(!skeleton) { + model->errcode = M3D_ERR_ALLOC; + return NULL; + } + goto gen; + } + if(actionid == (M3D_INDEX)-1U || !frameid) { +gen: s = 0; + for(i = 0; i < model->numbone; i++) { + skeleton[i].boneid = i; + skeleton[i].pos = model->bone[i].pos; + skeleton[i].ori = model->bone[i].ori; + } + } + if(actionid < model->numaction && (frameid || !model->action[actionid].frame[0].msec)) { + for(; s <= frameid; s++) { + fr = &model->action[actionid].frame[s]; + for(i = 0; i < fr->numtransform; i++) { + skeleton[fr->transform[i].boneid].pos = fr->transform[i].pos; + skeleton[fr->transform[i].boneid].ori = fr->transform[i].ori; + } + } + } + return skeleton; +} + +#ifndef M3D_NOANIMATION +/** + * Returns interpolated animation-pose, a working copy (should be freed after use) + */ +m3db_t *m3d_pose(m3d_t *model, M3D_INDEX actionid, uint32_t msec) +{ + unsigned int i, j, l; + M3D_FLOAT r[16], t, d; + m3db_t *ret; + m3dv_t *v, *p, *f; + m3dtr_t *tmp; + m3dfr_t *fr; + + if(!model || !model->numbone || !model->bone) { + model->errcode = M3D_ERR_UNKFRAME; + return NULL; + } + ret = (m3db_t*)M3D_MALLOC(model->numbone * sizeof(m3db_t)); + if(!ret) { + model->errcode = M3D_ERR_ALLOC; + return NULL; + } + memcpy(ret, model->bone, model->numbone * sizeof(m3db_t)); + for(i = 0; i < model->numbone; i++) + _m3d_inv((M3D_FLOAT*)&ret[i].mat4); + if(!model->action || actionid >= model->numaction) { + model->errcode = M3D_ERR_UNKFRAME; + return ret; + } + msec %= model->action[actionid].durationmsec; + model->errcode = M3D_SUCCESS; + fr = &model->action[actionid].frame[0]; + for(j = l = 0; j < model->action[actionid].numframe && model->action[actionid].frame[j].msec <= msec; j++) { + fr = &model->action[actionid].frame[j]; + l = fr->msec; + for(i = 0; i < fr->numtransform; i++) { + ret[fr->transform[i].boneid].pos = fr->transform[i].pos; + ret[fr->transform[i].boneid].ori = fr->transform[i].ori; + } + } + if(l != msec) { + model->vertex = (m3dv_t*)M3D_REALLOC(model->vertex, (model->numvertex + 2 * model->numbone) * sizeof(m3dv_t)); + if(!model->vertex) { + free(ret); + model->errcode = M3D_ERR_ALLOC; + return NULL; + } + tmp = (m3dtr_t*)M3D_MALLOC(model->numbone * sizeof(m3dtr_t)); + if(tmp) { + for(i = 0; i < model->numbone; i++) { + tmp[i].pos = ret[i].pos; + tmp[i].ori = ret[i].ori; + } + fr = &model->action[actionid].frame[j % model->action[actionid].numframe]; + t = l >= fr->msec ? (M3D_FLOAT)1.0 : (M3D_FLOAT)(msec - l) / (M3D_FLOAT)(fr->msec - l); + for(i = 0; i < fr->numtransform; i++) { + tmp[fr->transform[i].boneid].pos = fr->transform[i].pos; + tmp[fr->transform[i].boneid].ori = fr->transform[i].ori; + } + for(i = 0, j = model->numvertex; i < model->numbone; i++) { + /* LERP interpolation of position */ + if(ret[i].pos != tmp[i].pos) { + p = &model->vertex[ret[i].pos]; + f = &model->vertex[tmp[i].pos]; + v = &model->vertex[j]; + v->x = p->x + t * (f->x - p->x); + v->y = p->y + t * (f->y - p->y); + v->z = p->z + t * (f->z - p->z); + ret[i].pos = j++; + } + /* NLERP interpolation of orientation (could have used SLERP, that's nicer, but slower) */ + if(ret[i].ori != tmp[i].ori) { + p = &model->vertex[ret[i].ori]; + f = &model->vertex[tmp[i].ori]; + v = &model->vertex[j]; + d = (p->w * f->w + p->x * f->x + p->y * f->y + p->z * f->z < 0) ? (M3D_FLOAT)-1.0 : (M3D_FLOAT)1.0; + v->x = p->x + t * (d*f->x - p->x); + v->y = p->y + t * (d*f->y - p->y); + v->z = p->z + t * (d*f->z - p->z); + v->w = p->w + t * (d*f->w - p->w); + d = _m3d_rsq(v->w * v->w + v->x * v->x + v->y * v->y + v->z * v->z); + v->x *= d; v->y *= d; v->z *= d; v->w *= d; + ret[i].ori = j++; + } + } + M3D_FREE(tmp); + } + } + for(i = 0; i < model->numbone; i++) { + if(ret[i].parent == (M3D_INDEX)-1U) { + _m3d_mat((M3D_FLOAT*)&ret[i].mat4, &model->vertex[ret[i].pos], &model->vertex[ret[i].ori]); + } else { + _m3d_mat((M3D_FLOAT*)&r, &model->vertex[ret[i].pos], &model->vertex[ret[i].ori]); + _m3d_mul((M3D_FLOAT*)&ret[i].mat4, (M3D_FLOAT*)&ret[ret[i].parent].mat4, (M3D_FLOAT*)&r); + } + } + return ret; +} + +#endif /* M3D_NOANIMATION */ + +#endif /* M3D_IMPLEMENTATION */ + +#if !defined(M3D_NODUP) && (!defined(M3D_NOIMPORTER) || defined(M3D_EXPORTER)) +/** + * Free the in-memory model + */ +void m3d_free(m3d_t *model) +{ + unsigned int i, j; + + if(!model) return; +#ifdef M3D_ASCII + /* if model imported from ASCII, we have to free all strings as well */ + if(model->flags & M3D_FLG_FREESTR) { + if(model->name) M3D_FREE(model->name); + if(model->license) M3D_FREE(model->license); + if(model->author) M3D_FREE(model->author); + if(model->desc) M3D_FREE(model->desc); + if(model->bone) + for(i = 0; i < model->numbone; i++) + if(model->bone[i].name) + M3D_FREE(model->bone[i].name); + if(model->material) + for(i = 0; i < model->nummaterial; i++) + if(model->material[i].name) + M3D_FREE(model->material[i].name); + if(model->action) + for(i = 0; i < model->numaction; i++) + if(model->action[i].name) + M3D_FREE(model->action[i].name); + if(model->texture) + for(i = 0; i < model->numtexture; i++) + if(model->texture[i].name) + M3D_FREE(model->texture[i].name); + if(model->unknown) + for(i = 0; i < model->numunknown; i++) + if(model->unknown[i]) + M3D_FREE(model->unknown[i]); + } +#endif + if(model->flags & M3D_FLG_FREERAW) M3D_FREE(model->raw); + + if(model->tmap) M3D_FREE(model->tmap); + if(model->bone) { + for(i = 0; i < model->numbone; i++) + if(model->bone[i].weight) + M3D_FREE(model->bone[i].weight); + M3D_FREE(model->bone); + } + if(model->skin) M3D_FREE(model->skin); + if(model->vertex) M3D_FREE(model->vertex); + if(model->face) M3D_FREE(model->face); + if(model->material && !(model->flags & M3D_FLG_MTLLIB)) { + for(i = 0; i < model->nummaterial; i++) + if(model->material[i].prop) M3D_FREE(model->material[i].prop); + M3D_FREE(model->material); + } + if(model->texture) { + for(i = 0; i < model->numtexture; i++) + if(model->texture[i].d) M3D_FREE(model->texture[i].d); + M3D_FREE(model->texture); + } + if(model->action) { + for(i = 0; i < model->numaction; i++) { + if(model->action[i].frame) { + for(j = 0; j < model->action[i].numframe; j++) + if(model->action[i].frame[j].transform) M3D_FREE(model->action[i].frame[j].transform); + M3D_FREE(model->action[i].frame); + } + } + M3D_FREE(model->action); + } + if(model->inlined) M3D_FREE(model->inlined); + if(model->unknown) M3D_FREE(model->unknown); + free(model); +} +#endif + +#ifdef M3D_EXPORTER +typedef struct { + char *str; + uint32_t offs; +} m3dstr_t; + +/* create unique list of strings */ +static m3dstr_t *_m3d_addstr(m3dstr_t *str, uint32_t *numstr, char *s) +{ + uint32_t i; + if(!s || !*s) return str; + if(str) { + for(i = 0; i < *numstr; i++) + if(str[i].str == s || !strcmp(str[i].str, s)) return str; + } + str = (m3dstr_t*)M3D_REALLOC(str, ((*numstr) + 1) * sizeof(m3dstr_t)); + str[*numstr].str = s; + str[*numstr].offs = 0; + (*numstr)++; + return str; +} + +/* add strings to header */ +m3dhdr_t *_m3d_addhdr(m3dhdr_t *h, m3dstr_t *s) +{ + int i; + char *safe = _m3d_safestr(s->str, 0); + i = strlen(safe); + h = (m3dhdr_t*)M3D_REALLOC(h, h->length + i+1); + if(!h) { M3D_FREE(safe); return NULL; } + memcpy((uint8_t*)h + h->length, safe, i+1); + s->offs = h->length - 16; + h->length += i+1; + M3D_FREE(safe); + return h; +} + +/* return offset of string */ +static uint32_t _m3d_stridx(m3dstr_t *str, uint32_t numstr, char *s) +{ + uint32_t i; + char *safe; + if(!s || !*s) return 0; + if(str) { + safe = _m3d_safestr(s, 0); + if(!safe) return 0; + if(!*safe) { + free(safe); + return 0; + } + for(i = 0; i < numstr; i++) + if(!strcmp(str[i].str, s)) { + free(safe); + return str[i].offs; + } + free(safe); + } + return 0; +} + +/* compare two colors by HSV value */ +_inline static int _m3d_cmapcmp(const void *a, const void *b) +{ + uint8_t *A = (uint8_t*)a, *B = (uint8_t*)b; + _register int m, vA, vB; + /* get HSV value for A */ + m = A[2] < A[1]? A[2] : A[1]; if(A[0] < m) m = A[0]; + vA = A[2] > A[1]? A[2] : A[1]; if(A[0] > vA) vA = A[0]; + /* get HSV value for B */ + m = B[2] < B[1]? B[2] : B[1]; if(B[0] < m) m = B[0]; + vB = B[2] > B[1]? B[2] : B[1]; if(B[0] > vB) vB = B[0]; + return vA - vB; +} + +/* create sorted list of colors */ +static uint32_t *_m3d_addcmap(uint32_t *cmap, uint32_t *numcmap, uint32_t color) +{ + uint32_t i; + if(cmap) { + for(i = 0; i < *numcmap; i++) + if(cmap[i] == color) return cmap; + } + cmap = (uint32_t*)M3D_REALLOC(cmap, ((*numcmap) + 1) * sizeof(uint32_t)); + for(i = 0; i < *numcmap && _m3d_cmapcmp(&color, &cmap[i]) > 0; i++); + if(i < *numcmap) memmove(&cmap[i+1], &cmap[i], ((*numcmap) - i)*sizeof(uint32_t)); + cmap[i] = color; + (*numcmap)++; + return cmap; +} + +/* look up a color and return its index */ +static uint32_t _m3d_cmapidx(uint32_t *cmap, uint32_t numcmap, uint32_t color) +{ + uint32_t i; + for(i = 0; i < numcmap; i++) + if(cmap[i] == color) return i; + return 0; +} + +/* add vertex to list */ +static m3dv_t *_m3d_addvrtx(m3dv_t *vrtx, uint32_t *numvrtx, m3dv_t *v, uint32_t *idx) +{ + uint32_t i; + if(v->x == (M3D_FLOAT)-0.0) v->x = (M3D_FLOAT)0.0; + if(v->y == (M3D_FLOAT)-0.0) v->y = (M3D_FLOAT)0.0; + if(v->z == (M3D_FLOAT)-0.0) v->z = (M3D_FLOAT)0.0; + if(v->w == (M3D_FLOAT)-0.0) v->w = (M3D_FLOAT)0.0; + if(vrtx) { + for(i = 0; i < *numvrtx; i++) + if(!memcmp(&vrtx[i], v, sizeof(m3dv_t))) { *idx = i; return vrtx; } + } + vrtx = (m3dv_t*)M3D_REALLOC(vrtx, ((*numvrtx) + 1) * sizeof(m3dv_t)); + memcpy(&vrtx[*numvrtx], v, sizeof(m3dv_t)); + *idx = *numvrtx; + (*numvrtx)++; + return vrtx; +} + +/* add texture map to list */ +static m3dti_t *_m3d_addtmap(m3dti_t *tmap, uint32_t *numtmap, m3dti_t *t, uint32_t *idx) +{ + uint32_t i; + if(tmap) { + for(i = 0; i < *numtmap; i++) + if(!memcmp(&tmap[i], t, sizeof(m3dti_t))) { *idx = i; return tmap; } + } + tmap = (m3dti_t*)M3D_REALLOC(tmap, ((*numtmap) + 1) * sizeof(m3dti_t)); + memcpy(&tmap[*numtmap], t, sizeof(m3dti_t)); + *idx = *numtmap; + (*numtmap)++; + return tmap; +} + +/* add material to list */ +static m3dm_t **_m3d_addmtrl(m3dm_t **mtrl, uint32_t *nummtrl, m3dm_t *m, uint32_t *idx) +{ + uint32_t i; + if(mtrl) { + for(i = 0; i < *nummtrl; i++) + if(mtrl[i]->name == m->name || !strcmp(mtrl[i]->name, m->name)) { *idx = i; return mtrl; } + } + mtrl = (m3dm_t**)M3D_REALLOC(mtrl, ((*nummtrl) + 1) * sizeof(m3dm_t*)); + mtrl[*nummtrl] = m; + *idx = *nummtrl; + (*nummtrl)++; + return mtrl; +} + +/* add index to output */ +static unsigned char *_m3d_addidx(unsigned char *out, char type, uint32_t idx) { + switch(type) { + case 1: *out++ = (uint8_t)(idx); break; + case 2: *((uint16_t*)out) = (uint16_t)(idx); out += 2; break; + case 4: *((uint32_t*)out) = (uint32_t)(idx); out += 4; break; + /* case 0: case 8: break; */ + } + return out; +} + +/* round a vertex position */ +static void _m3d_round(int quality, m3dv_t *src, m3dv_t *dst) +{ + _register int t; + /* copy additional attributes */ + if(src != dst) memcpy(dst, src, sizeof(m3dv_t)); + /* round according to quality */ + switch(quality) { + case M3D_EXP_INT8: + t = src->x * 127; dst->x = (M3D_FLOAT)t / 127; + t = src->y * 127; dst->y = (M3D_FLOAT)t / 127; + t = src->z * 127; dst->z = (M3D_FLOAT)t / 127; + t = src->w * 127; dst->w = (M3D_FLOAT)t / 127; + break; + case M3D_EXP_INT16: + t = src->x * 32767; dst->x = (M3D_FLOAT)t / 32767; + t = src->y * 32767; dst->y = (M3D_FLOAT)t / 32767; + t = src->z * 32767; dst->z = (M3D_FLOAT)t / 32767; + t = src->w * 32767; dst->w = (M3D_FLOAT)t / 32767; + break; + } +} + +#ifdef M3D_ASCII +/* add a bone to ascii output */ +static char *_m3d_prtbone(char *ptr, m3db_t *bone, M3D_INDEX numbone, M3D_INDEX parent, uint32_t level) +{ + uint32_t i, j; + char *sn; + + if(level > M3D_BONEMAXLEVEL || !bone) return ptr; + for(i = 0; i < numbone; i++) { + if(bone[i].parent == parent) { + for(j = 0; j < level; j++) *ptr++ = '/'; + sn = _m3d_safestr(bone[i].name, 0); + ptr += sprintf(ptr, "%d %d %s\r\n", bone[i].pos, bone[i].ori, sn); + M3D_FREE(sn); + ptr = _m3d_prtbone(ptr, bone, numbone, i, level + 1); + } + } + return ptr; +} +#endif + +/** + * Function to encode an in-memory model into on storage Model 3D format + */ +unsigned char *m3d_save(m3d_t *model, int quality, int flags, unsigned int *size) +{ +#ifdef M3D_ASCII + const char *ol; + char *ptr; +#endif + char vc_s, vi_s, si_s, ci_s, ti_s, bi_s, nb_s, sk_s, fi_s; + char *sn = NULL, *sl = NULL, *sa = NULL, *sd = NULL; + unsigned char *out = NULL, *z = NULL, weights[M3D_NUMBONE]; + unsigned int i, j, k, l, len, chunklen, *length; + float scale = 0.0f, min_x, max_x, min_y, max_y, min_z, max_z; + uint32_t idx, numcmap = 0, *cmap = NULL, numvrtx = 0, numtmap = 0, numbone = 0; + uint32_t numskin = 0, numactn = 0, *actn = NULL, numstr = 0, nummtrl = 0, maxt = 0; + m3dstr_t *str = NULL; + m3dv_t *vrtx = NULL, vertex; + m3dti_t *tmap = NULL, tcoord; + m3db_t *bone = NULL; + m3ds_t *skin = NULL; + m3df_t *face = NULL; + m3dhdr_t *h = NULL; + m3dm_t *m, **mtrl = NULL; + m3da_t *a; + M3D_INDEX last; + + if(!model) { + if(size) *size = 0; + return NULL; + } + model->errcode = M3D_SUCCESS; +#ifdef M3D_ASCII + if(flags & M3D_EXP_ASCII) quality = M3D_EXP_DOUBLE; +#endif + /* collect array elements that are actually referenced */ + if(model->numface && model->face && !(flags & M3D_EXP_NOFACE)) { + face = (m3df_t*)M3D_MALLOC(model->numface * sizeof(m3df_t)); + if(!face) goto memerr; + memset(face, 255, model->numface * sizeof(m3df_t)); + last = (M3D_INDEX)-1U; + for(i = 0; i < model->numface; i++) { + face[i].materialid = (M3D_INDEX)-1U; + if(!(flags & M3D_EXP_NOMATERIAL) && model->face[i].materialid != last) { + last = model->face[i].materialid; + if(last < model->nummaterial) { + mtrl = _m3d_addmtrl(mtrl, &nummtrl, &model->material[last], &face[i].materialid); + if(!mtrl) goto memerr; + } + } + for(j = 0; j < 3; j++) { + k = model->face[i].vertex[j]; + if(quality < M3D_EXP_FLOAT) { + _m3d_round(quality, &model->vertex[k], &vertex); + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &vertex, &idx); + } else + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &model->vertex[k], &idx); + if(!vrtx) goto memerr; + face[i].vertex[j] = (M3D_INDEX)idx; + if(!(flags & M3D_EXP_NOCMAP)) { + cmap = _m3d_addcmap(cmap, &numcmap, model->vertex[k].color); + if(!cmap) goto memerr; + } + k = model->face[i].normal[j]; + if(k < model->numvertex && !(flags & M3D_EXP_NONORMAL)) { + if(quality < M3D_EXP_FLOAT) { + _m3d_round(quality, &model->vertex[k], &vertex); + vrtx = _m3d_addnorm(vrtx, &numvrtx, &vertex, &idx); + } else + vrtx = _m3d_addnorm(vrtx, &numvrtx, &model->vertex[k], &idx); + if(!vrtx) goto memerr; + face[i].normal[j] = (M3D_INDEX)idx; + } + k = model->face[i].texcoord[j]; + if(k < model->numtmap) { + switch(quality) { + case M3D_EXP_INT8: + l = model->tmap[k].u * 255; tcoord.u = (M3D_FLOAT)l / 255; + l = model->tmap[k].v * 255; tcoord.v = (M3D_FLOAT)l / 255; + break; + case M3D_EXP_INT16: + l = model->tmap[k].u * 65535; tcoord.u = (M3D_FLOAT)l / 65535; + l = model->tmap[k].v * 65535; tcoord.v = (M3D_FLOAT)l / 65535; + break; + default: + tcoord.u = model->tmap[k].u; + tcoord.v = model->tmap[k].v; + break; + } + if(flags & M3D_EXP_FLIPTXTCRD) + tcoord.v = (M3D_FLOAT)1.0 - tcoord.v; + tmap = _m3d_addtmap(tmap, &numtmap, &tcoord, &idx); + if(!tmap) goto memerr; + face[i].texcoord[j] = (M3D_INDEX)idx; + } + } + /* convert from CW to CCW */ + if(flags & M3D_EXP_IDOSUCK) { + j = face[i].vertex[1]; + face[i].vertex[1] = face[i].vertex[2]; + face[i].vertex[2] = face[i].vertex[1]; + j = face[i].normal[1]; + face[i].normal[1] = face[i].normal[2]; + face[i].normal[2] = face[i].normal[1]; + j = face[i].texcoord[1]; + face[i].texcoord[1] = face[i].texcoord[2]; + face[i].texcoord[2] = face[i].texcoord[1]; + } + } + } else if(!(flags & M3D_EXP_NOMATERIAL)) { + /* without a face, simply add all materials, because it can be an mtllib */ + nummtrl = model->nummaterial; + } + /* add colors to color map and texture names to string table */ + for(i = 0; i < nummtrl; i++) { + m = !mtrl ? &model->material[i] : mtrl[i]; + str = _m3d_addstr(str, &numstr, m->name); + if(!str) goto memerr; + for(j = 0; j < mtrl[i]->numprop; j++) { + if(!(flags & M3D_EXP_NOCMAP) && m->prop[j].type < 128) { + for(l = 0; l < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); l++) { + if(m->prop[j].type == m3d_propertytypes[l].id && m3d_propertytypes[l].format == m3dpf_color) { + cmap = _m3d_addcmap(cmap, &numcmap, m->prop[j].value.color); + if(!cmap) goto memerr; + break; + } + } + } + if(m->prop[j].type >= 128 && m->prop[j].value.textureid < model->numtexture && + model->texture[m->prop[j].value.textureid].name) { + str = _m3d_addstr(str, &numstr, model->texture[m->prop[j].value.textureid].name); + if(!str) goto memerr; + } + } + } + /* get bind-pose skeleton and skin */ + if(model->numbone && model->bone && !(flags & M3D_EXP_NOBONE)) { + numbone = model->numbone; + bone = (m3db_t*)M3D_MALLOC(model->numbone * sizeof(m3db_t)); + if(!bone) goto memerr; + memset(bone, 0, model->numbone * sizeof(m3db_t)); + for(i = 0; i < model->numbone; i++) { + bone[i].parent = model->bone[i].parent; + bone[i].name = model->bone[i].name; + str = _m3d_addstr(str, &numstr, bone[i].name); + if(!str) goto memerr; + if(quality < M3D_EXP_FLOAT) { + _m3d_round(quality, &model->vertex[model->bone[i].pos], &vertex); + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &vertex, &k); + } else + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &model->vertex[model->bone[i].pos], &k); + if(!vrtx) goto memerr; + bone[i].pos = (M3D_INDEX)k; + if(quality < M3D_EXP_FLOAT) { + _m3d_round(quality, &model->vertex[model->bone[i].ori], &vertex); + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &vertex, &k); + } else + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &model->vertex[model->bone[i].ori], &k); + if(!vrtx) goto memerr; + bone[i].ori = (M3D_INDEX)k; + } + } + /* actions, animated skeleton poses */ + if(model->numaction && model->action && !(flags & M3D_EXP_NOACTION)) { + for(j = 0; j < model->numaction; j++) { + a = &model->action[j]; + str = _m3d_addstr(str, &numstr, a->name); + if(!str) goto memerr; + if(a->numframe > 65535) a->numframe = 65535; + for(i = 0; i < a->numframe; i++) { + l = numactn; + numactn += (a->frame[i].numtransform * 2); + if(a->frame[i].numtransform > maxt) + maxt = a->frame[i].numtransform; + actn = (uint32_t*)M3D_REALLOC(actn, numactn * sizeof(uint32_t)); + if(!actn) goto memerr; + for(k = 0; k < a->frame[i].numtransform; k++) { + if(quality < M3D_EXP_FLOAT) { + _m3d_round(quality, &model->vertex[a->frame[i].transform[k].pos], &vertex); + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &vertex, &actn[l++]); + if(!vrtx) goto memerr; + _m3d_round(quality, &model->vertex[a->frame[i].transform[k].ori], &vertex); + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &vertex, &actn[l++]); + } else { + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &model->vertex[a->frame[i].transform[k].pos], &actn[l++]); + if(!vrtx) goto memerr; + vrtx = _m3d_addvrtx(vrtx, &numvrtx, &model->vertex[a->frame[i].transform[k].ori], &actn[l++]); + } + if(!vrtx) goto memerr; + } + } + } + } + /* normalize bounding cube and collect referenced skin records */ + if(numvrtx) { + min_x = min_y = min_z = 1e10; + max_x = max_y = max_z = -1e10; + j = model->numskin && model->skin && !(flags & M3D_EXP_NOBONE); + for(i = 0; i < numvrtx; i++) { + if(j && model->numskin && model->skin && vrtx[i].skinid < M3D_INDEXMAX) { + skin = _m3d_addskin(skin, &numskin, &model->skin[vrtx[i].skinid], &idx); + if(!skin) goto memerr; + vrtx[i].skinid = idx; + } + if(vrtx[i].skinid == (M3D_INDEX)-2U) continue; + if(vrtx[i].x > max_x) max_x = vrtx[i].x; + if(vrtx[i].x < min_x) min_x = vrtx[i].x; + if(vrtx[i].y > max_y) max_y = vrtx[i].y; + if(vrtx[i].y < min_y) min_y = vrtx[i].y; + if(vrtx[i].z > max_z) max_z = vrtx[i].z; + if(vrtx[i].z < min_z) min_z = vrtx[i].z; + } + if(min_x < 0.0f) min_x = -min_x; + if(max_x < 0.0f) max_x = -max_x; + if(min_y < 0.0f) min_y = -min_y; + if(max_y < 0.0f) max_y = -max_y; + if(min_z < 0.0f) min_z = -min_z; + if(max_z < 0.0f) max_z = -max_z; + scale = min_x; + if(max_x > scale) scale = max_x; + if(min_y > scale) scale = min_y; + if(max_y > scale) scale = max_y; + if(min_z > scale) scale = min_z; + if(max_z > scale) scale = max_z; + if(scale == 0.0f) scale = 1.0f; + if(scale != 1.0f && !(flags & M3D_EXP_NORECALC)) { + for(i = 0; i < numvrtx; i++) { + if(vrtx[i].skinid == (M3D_INDEX)-2U) continue; + vrtx[i].x /= scale; + vrtx[i].y /= scale; + vrtx[i].z /= scale; + } + } + } + /* if there's only one black color, don't store it */ + if(numcmap == 1 && cmap && !cmap[0]) numcmap = 0; + /* at least 3 UV coordinate required for texture mapping */ + if(numtmap < 3 && tmap) numtmap = 0; + /* meta info */ + sn = _m3d_safestr(model->name && *model->name ? model->name : (char*)"(noname)", 2); + sl = _m3d_safestr(model->license ? model->license : (char*)"MIT", 2); + sa = _m3d_safestr(model->author ? model->author : getenv("LOGNAME"), 2); + if(!sn || !sl || !sa) { +memerr: if(face) M3D_FREE(face); + if(cmap) M3D_FREE(cmap); + if(tmap) M3D_FREE(tmap); + if(mtrl) M3D_FREE(mtrl); + if(vrtx) M3D_FREE(vrtx); + if(bone) M3D_FREE(bone); + if(skin) M3D_FREE(skin); + if(actn) M3D_FREE(actn); + if(sn) M3D_FREE(sn); + if(sl) M3D_FREE(sl); + if(sa) M3D_FREE(sa); + if(sd) M3D_FREE(sd); + if(out) M3D_FREE(out); + if(str) M3D_FREE(str); + if(h) M3D_FREE(h); + M3D_LOG("Out of memory"); + model->errcode = M3D_ERR_ALLOC; + return NULL; + } + if(model->scale > (M3D_FLOAT)0.0) scale = (float)model->scale; + if(scale <= 0.0f) scale = 1.0f; +#ifdef M3D_ASCII + if(flags & M3D_EXP_ASCII) { + /* use CRLF to make model creators on Win happy... */ + sd = _m3d_safestr(model->desc, 1); + if(!sd) goto memerr; + ol = setlocale(LC_NUMERIC, NULL); + setlocale(LC_NUMERIC, "C"); + /* header */ + len = 64 + strlen(sn) + strlen(sl) + strlen(sa) + strlen(sd); + out = (unsigned char*)M3D_MALLOC(len); + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr = (char*)out; + ptr += sprintf(ptr, "3dmodel %g\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n", scale, + sn, sl, sa, sd); + M3D_FREE(sn); M3D_FREE(sl); M3D_FREE(sa); M3D_FREE(sd); + sn = sl = sa = sd = NULL; + /* texture map */ + if(numtmap && tmap && !(flags & M3D_EXP_NOTXTCRD) && !(flags & M3D_EXP_NOFACE)) { + ptr -= (uint64_t)out; len = (uint64_t)ptr + numtmap * 32 + 12; + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Textmap\r\n"); + for(i = 0; i < numtmap; i++) + ptr += sprintf(ptr, "%g %g\r\n", tmap[i].u, tmap[i].v); + ptr += sprintf(ptr, "\r\n"); + } + /* vertex chunk */ + if(numvrtx && vrtx && !(flags & M3D_EXP_NOFACE)) { + ptr -= (uint64_t)out; len = (uint64_t)ptr + numvrtx * 128 + 10; + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Vertex\r\n"); + for(i = 0; i < numvrtx; i++) { + ptr += sprintf(ptr, "%g %g %g %g", vrtx[i].x, vrtx[i].y, vrtx[i].z, vrtx[i].w); + if(!(flags & M3D_EXP_NOCMAP) && vrtx[i].color) + ptr += sprintf(ptr, " #%08x", vrtx[i].color); + if(!(flags & M3D_EXP_NOBONE) && numbone && numskin && vrtx[i].skinid != (M3D_INDEX)-1U && + vrtx[i].skinid != (M3D_INDEX)-2U) { + if(skin[vrtx[i].skinid].weight[0] == (M3D_FLOAT)1.0) + ptr += sprintf(ptr, " %d", skin[vrtx[i].skinid].boneid[0]); + else + for(j = 0; j < M3D_NUMBONE && skin[vrtx[i].skinid].boneid[j] != (M3D_INDEX)-1U && + skin[vrtx[i].skinid].weight[j] > (M3D_FLOAT)0.0; j++) + ptr += sprintf(ptr, " %d:%g", skin[vrtx[i].skinid].boneid[j], + skin[vrtx[i].skinid].weight[j]); + } + ptr += sprintf(ptr, "\r\n"); + } + ptr += sprintf(ptr, "\r\n"); + } + /* bones chunk */ + if(numbone && bone && !(flags & M3D_EXP_NOBONE)) { + ptr -= (uint64_t)out; len = (uint64_t)ptr + 9; + for(i = 0; i < numbone; i++) { + len += strlen(bone[i].name) + 128; + } + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Bones\r\n"); + ptr = _m3d_prtbone(ptr, bone, numbone, (M3D_INDEX)-1U, 0); + ptr += sprintf(ptr, "\r\n"); + } + /* materials */ + if(nummtrl && !(flags & M3D_EXP_NOMATERIAL)) { + for(j = 0; j < nummtrl; j++) { + m = !mtrl ? &model->material[j] : mtrl[j]; + sn = _m3d_safestr(m->name, 0); + if(!sn) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr -= (uint64_t)out; len = (uint64_t)ptr + strlen(sn) + 12; + for(i = 0; i < m->numprop; i++) { + if(m->prop[i].type < 128) + len += 32; + else if(m->prop[i].value.textureid < model->numtexture && model->texture[m->prop[i].value.textureid].name) + len += strlen(model->texture[m->prop[i].value.textureid].name) + 16; + } + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Material %s\r\n", sn); + M3D_FREE(sn); sn = NULL; + for(i = 0; i < m->numprop; i++) { + k = 256; + if(m->prop[i].type >= 128) { + for(l = 0; l < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); l++) + if(m->prop[i].type == m3d_propertytypes[l].id) { + sn = m3d_propertytypes[l].key; + break; + } + if(!sn) + for(l = 0; l < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); l++) + if(m->prop[i].type - 128 == m3d_propertytypes[l].id) { + sn = m3d_propertytypes[l].key; + break; + } + k = sn ? m3dpf_map : 256; + } else { + for(l = 0; l < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); l++) + if(m->prop[i].type == m3d_propertytypes[l].id) { + sn = m3d_propertytypes[l].key; + k = m3d_propertytypes[l].format; + break; + } + } + switch(k) { + case m3dpf_color: ptr += sprintf(ptr, "%s #%08x\r\n", sn, m->prop[i].value.color); break; + case m3dpf_uint8: + case m3dpf_uint16: + case m3dpf_uint32: ptr += sprintf(ptr, "%s %d\r\n", sn, m->prop[i].value.num); break; + case m3dpf_float: ptr += sprintf(ptr, "%s %g\r\n", sn, m->prop[i].value.fnum); break; + case m3dpf_map: + if(m->prop[i].value.textureid < model->numtexture && + model->texture[m->prop[i].value.textureid].name) { + sl = _m3d_safestr(model->texture[m->prop[i].value.textureid].name, 0); + if(!sl) { setlocale(LC_NUMERIC, ol); goto memerr; } + if(*sl) + ptr += sprintf(ptr, "map_%s %s\r\n", sn, sl); + M3D_FREE(sn); M3D_FREE(sl); sl = NULL; + } + break; + } + sn = NULL; + } + ptr += sprintf(ptr, "\r\n"); + } + } + /* mesh face */ + if(model->numface && face && !(flags & M3D_EXP_NOFACE)) { + ptr -= (uint64_t)out; len = (uint64_t)ptr + model->numface * 128 + 6; + last = (M3D_INDEX)-1U; + if(!(flags & M3D_EXP_NOMATERIAL)) + for(i = 0; i < model->numface; i++) { + if(face[i].materialid != last) { + last = face[i].materialid; + if(last < nummtrl) + len += strlen(mtrl[last]->name); + len += 6; + } + } + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Mesh\r\n"); + last = (M3D_INDEX)-1U; + for(i = 0; i < model->numface; i++) { + if(!(flags & M3D_EXP_NOMATERIAL) && face[i].materialid != last) { + last = face[i].materialid; + if(last < nummtrl) { + sn = _m3d_safestr(mtrl[last]->name, 0); + if(!sn) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "use %s\r\n", sn); + M3D_FREE(sn); sn = NULL; + } else + ptr += sprintf(ptr, "use\r\n"); + } + /* hardcoded triangles. Should be repeated as many times as the number of edges in polygon */ + for(j = 0; j < 3; j++) { + ptr += sprintf(ptr, "%s%d", j?" ":"", face[i].vertex[j]); + if(!(flags & M3D_EXP_NOTXTCRD) && (face[i].texcoord[j] != (M3D_INDEX)-1U)) + ptr += sprintf(ptr, "/%d", face[i].texcoord[j]); + if(!(flags & M3D_EXP_NONORMAL) && (face[i].normal[j] != (M3D_INDEX)-1U)) + ptr += sprintf(ptr, "%s/%d", + (flags & M3D_EXP_NOTXTCRD) || (face[i].texcoord[j] == (M3D_INDEX)-1U)? "/" : "", + face[i].normal[j]); + } + ptr += sprintf(ptr, "\r\n"); + } + ptr += sprintf(ptr, "\r\n"); + } + /* actions */ + if(model->numaction && model->action && numactn && actn && !(flags & M3D_EXP_NOACTION)) { + l = 0; + for(j = 0; j < model->numaction; j++) { + a = &model->action[j]; + sn = _m3d_safestr(a->name, 0); + if(!sn) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr -= (uint64_t)out; len = (uint64_t)ptr + strlen(sn) + 48; + for(i = 0; i < a->numframe; i++) + len += a->frame[i].numtransform * 128 + 8; + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Action %d %s\r\n", a->durationmsec, sn); + M3D_FREE(sn); sn = NULL; + if(a->numframe > 65535) a->numframe = 65535; + for(i = 0; i < a->numframe; i++) { + ptr += sprintf(ptr, "frame %d\r\n", a->frame[i].msec); + for(k = 0; k < a->frame[i].numtransform; k++) { + ptr += sprintf(ptr, "%d %d %d\r\n", a->frame[i].transform[k].boneid, actn[l], actn[l + 1]); + l += 2; + } + } + ptr += sprintf(ptr, "\r\n"); + } + } + /* extra info */ + if(model->numunknown && (flags & M3D_EXP_EXTRA)) { + for(i = 0; i < model->numunknown; i++) { + if(model->unknown[i]->length < 9) continue; + ptr -= (uint64_t)out; len = (uint64_t)ptr + 17 + model->unknown[i]->length * 3; + out = (unsigned char*)M3D_REALLOC(out, len); ptr += (uint64_t)out; + if(!out) { setlocale(LC_NUMERIC, ol); goto memerr; } + ptr += sprintf(ptr, "Extra %c%c%c%c\r\n", + model->unknown[i]->magic[0] > ' ' ? model->unknown[i]->magic[0] : '_', + model->unknown[i]->magic[1] > ' ' ? model->unknown[i]->magic[1] : '_', + model->unknown[i]->magic[2] > ' ' ? model->unknown[i]->magic[2] : '_', + model->unknown[i]->magic[3] > ' ' ? model->unknown[i]->magic[3] : '_'); + for(j = 0; j < model->unknown[i]->length; j++) + ptr += sprintf(ptr, "%02x ", *((unsigned char *)model->unknown + sizeof(m3dchunk_t) + j)); + ptr--; + ptr += sprintf(ptr, "\r\n\r\n"); + } + } + setlocale(LC_NUMERIC, ol); + len = (uint64_t)ptr - (uint64_t)out; + out = (unsigned char*)M3D_REALLOC(out, len + 1); + if(!out) goto memerr; + out[len] = 0; + } else +#endif + { + /* stricly only use LF (newline) in binary */ + sd = _m3d_safestr(model->desc, 3); + if(!sd) goto memerr; + /* header */ + h = (m3dhdr_t*)M3D_MALLOC(sizeof(m3dhdr_t) + strlen(sn) + strlen(sl) + strlen(sa) + strlen(sd) + 4); + if(!h) goto memerr; + memcpy((uint8_t*)h, "HEAD", 4); + h->length = sizeof(m3dhdr_t); + h->scale = scale; + i = strlen(sn); memcpy((uint8_t*)h + h->length, sn, i+1); h->length += i+1; M3D_FREE(sn); + i = strlen(sl); memcpy((uint8_t*)h + h->length, sl, i+1); h->length += i+1; M3D_FREE(sl); + i = strlen(sa); memcpy((uint8_t*)h + h->length, sa, i+1); h->length += i+1; M3D_FREE(sa); + i = strlen(sd); memcpy((uint8_t*)h + h->length, sd, i+1); h->length += i+1; M3D_FREE(sd); + sn = sl = sa = sd = NULL; + len = 0; + if(!bone) numbone = 0; + if(skin) + for(i = 0; i < numskin; i++) { + for(j = k = 0; j < M3D_NUMBONE; j++) + if(skin[i].boneid[j] != (M3D_INDEX)-1U && skin[i].weight[j] > (M3D_FLOAT)0.0) k++; + if(k > len) len = k; + } + else + numskin = 0; + if(model->inlined) + for(i = 0; i < model->numinlined; i++) { + if(model->inlined[i].name && *model->inlined[i].name && model->inlined[i].length > 0) { + str = _m3d_addstr(str, &numstr, model->inlined[i].name); + if(!str) goto memerr; + } + } + if(str) + for(i = 0; i < numstr; i++) { + h = _m3d_addhdr(h, &str[i]); + if(!h) goto memerr; + } + vc_s = quality == M3D_EXP_INT8? 1 : (quality == M3D_EXP_INT16? 2 : (quality == M3D_EXP_DOUBLE? 8 : 4)); + vi_s = numvrtx < 254 ? 1 : (numvrtx < 65534 ? 2 : 4); + si_s = h->length - 16 < 254 ? 1 : (h->length - 16 < 65534 ? 2 : 4); + ci_s = !numcmap || !cmap ? 0 : (numcmap < 254 ? 1 : (numcmap < 65534 ? 2 : 4)); + ti_s = !numtmap || !tmap ? 0 : (numtmap < 254 ? 1 : (numtmap < 65534 ? 2 : 4)); + bi_s = !numbone || !bone ? 0 : (numbone < 254 ? 1 : (numbone < 65534 ? 2 : 4)); + nb_s = len < 2 ? 1 : (len == 2 ? 2 : (len <= 4 ? 4 : 8)); + sk_s = !numbone || !numskin ? 0 : (numskin < 254 ? 1 : (numskin < 65534 ? 2 : 4)); + fi_s = maxt < 254 ? 1 : (maxt < 65534 ? 2 : 4); + h->types = (vc_s == 8 ? (3<<0) : (vc_s == 2 ? (1<<0) : (vc_s == 1 ? (0<<0) : (2<<0)))) | + (vi_s == 2 ? (1<<2) : (vi_s == 1 ? (0<<2) : (2<<2))) | + (si_s == 2 ? (1<<4) : (si_s == 1 ? (0<<4) : (2<<4))) | + (ci_s == 2 ? (1<<6) : (ci_s == 1 ? (0<<6) : (ci_s == 4 ? (2<<6) : (3<<6)))) | + (ti_s == 2 ? (1<<8) : (ti_s == 1 ? (0<<8) : (ti_s == 4 ? (2<<8) : (3<<8)))) | + (bi_s == 2 ? (1<<10): (bi_s == 1 ? (0<<10): (bi_s == 4 ? (2<<10) : (3<<10)))) | + (nb_s == 2 ? (1<<12): (nb_s == 1 ? (0<<12): (2<<12))) | + (sk_s == 2 ? (1<<14): (sk_s == 1 ? (0<<14): (sk_s == 4 ? (2<<14) : (3<<14)))) | + (fi_s == 2 ? (1<<16): (fi_s == 1 ? (0<<16): (2<<16))) ; + len = h->length; + /* color map */ + if(numcmap && cmap && ci_s < 4 && !(flags & M3D_EXP_NOCMAP)) { + chunklen = 8 + numcmap * sizeof(uint32_t); + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "CMAP", 4); + *((uint32_t*)((uint8_t*)h + len + 4)) = chunklen; + memcpy((uint8_t*)h + len + 8, cmap, chunklen - 8); + len += chunklen; + } else numcmap = 0; + /* texture map */ + if(numtmap && tmap && !(flags & M3D_EXP_NOTXTCRD) && !(flags & M3D_EXP_NOFACE)) { + chunklen = 8 + numtmap * vc_s * 2; + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "TMAP", 4); + *((uint32_t*)((uint8_t*)h + len + 4)) = chunklen; + out = (uint8_t*)h + len + 8; + for(i = 0; i < numtmap; i++) { + switch(vc_s) { + case 1: *out++ = (uint8_t)(tmap[i].u * 255); *out++ = (uint8_t)(tmap[i].v * 255); break; + case 2: + *((uint16_t*)out) = (uint16_t)(tmap[i].u * 65535); out += 2; + *((uint16_t*)out) = (uint16_t)(tmap[i].v * 65535); out += 2; + break; + case 4: *((float*)out) = tmap[i].u; out += 4; *((float*)out) = tmap[i].v; out += 4; break; + case 8: *((double*)out) = tmap[i].u; out += 8; *((double*)out) = tmap[i].v; out += 8; break; + } + } + out = NULL; + len += chunklen; + } + /* vertex */ + if(numvrtx && vrtx) { + chunklen = 8 + numvrtx * (ci_s + sk_s + 4 * vc_s); + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "VRTS", 4); + *((uint32_t*)((uint8_t*)h + len + 4)) = chunklen; + out = (uint8_t*)h + len + 8; + for(i = 0; i < numvrtx; i++) { + switch(vc_s) { + case 1: + *out++ = (int8_t)(vrtx[i].x * 127); + *out++ = (int8_t)(vrtx[i].y * 127); + *out++ = (int8_t)(vrtx[i].z * 127); + *out++ = (int8_t)(vrtx[i].w * 127); + break; + case 2: + *((int16_t*)out) = (int16_t)(vrtx[i].x * 32767); out += 2; + *((int16_t*)out) = (int16_t)(vrtx[i].y * 32767); out += 2; + *((int16_t*)out) = (int16_t)(vrtx[i].z * 32767); out += 2; + *((int16_t*)out) = (int16_t)(vrtx[i].w * 32767); out += 2; + break; + case 4: + *((float*)out) = vrtx[i].x; out += 4; + *((float*)out) = vrtx[i].y; out += 4; + *((float*)out) = vrtx[i].z; out += 4; + *((float*)out) = vrtx[i].w; out += 4; + break; + case 8: + *((double*)out) = vrtx[i].x; out += 8; + *((double*)out) = vrtx[i].y; out += 8; + *((double*)out) = vrtx[i].z; out += 8; + *((double*)out) = vrtx[i].w; out += 8; + break; + } + idx = _m3d_cmapidx(cmap, numcmap, vrtx[i].color); + switch(ci_s) { + case 1: *out++ = (uint8_t)(idx); break; + case 2: *((uint16_t*)out) = (uint16_t)(idx); out += 2; break; + case 4: *((uint32_t*)out) = vrtx[i].color; out += 4; break; + } + out = _m3d_addidx(out, sk_s, numbone && numskin ? vrtx[i].skinid : -1U); + } + out = NULL; + len += chunklen; + } + /* bones chunk */ + if(numbone && bone && !(flags & M3D_EXP_NOBONE)) { + i = 8 + bi_s + sk_s + numbone * (bi_s + si_s + 2*vi_s); + chunklen = i + numskin * nb_s * (bi_s + 1); + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "BONE", 4); + length = (uint32_t*)((uint8_t*)h + len + 4); + out = (uint8_t*)h + len + 8; + out = _m3d_addidx(out, bi_s, numbone); + out = _m3d_addidx(out, sk_s, numskin); + for(i = 0; i < numbone; i++) { + out = _m3d_addidx(out, bi_s, bone[i].parent); + out = _m3d_addidx(out, si_s, _m3d_stridx(str, numstr, bone[i].name)); + out = _m3d_addidx(out, vi_s, bone[i].pos); + out = _m3d_addidx(out, vi_s, bone[i].ori); + } + if(numskin && skin && sk_s) { + for(i = 0; i < numskin; i++) { + memset(&weights, 0, nb_s); + for(j = 0; j < (uint32_t)nb_s && skin[i].boneid[j] != (M3D_INDEX)-1U && + skin[i].weight[j] > (M3D_FLOAT)0.0; j++) + weights[j] = (uint8_t)(skin[i].weight[j] * 255); + switch(nb_s) { + case 1: weights[0] = 255; break; + case 2: *((uint16_t*)out) = *((uint16_t*)&weights[0]); out += 2; break; + case 4: *((uint32_t*)out) = *((uint32_t*)&weights[0]); out += 4; break; + case 8: *((uint64_t*)out) = *((uint64_t*)&weights[0]); out += 8; break; + } + for(j = 0; j < (uint32_t)nb_s && skin[i].boneid[j] != (M3D_INDEX)-1U && + skin[i].weight[j] > (M3D_FLOAT)0.0; j++) { + out = _m3d_addidx(out, bi_s, skin[i].boneid[j]); + *length += bi_s; + } + } + } + *length = (uint64_t)out - (uint64_t)((uint8_t*)h + len); + out = NULL; + len += *length; + } + /* materials */ + if(nummtrl && !(flags & M3D_EXP_NOMATERIAL)) { + for(j = 0; j < nummtrl; j++) { + m = !mtrl ? &model->material[j] : mtrl[j]; + chunklen = 12 + si_s + m->numprop * 5; + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "MTRL", 4); + length = (uint32_t*)((uint8_t*)h + len + 4); + out = (uint8_t*)h + len + 8; + out = _m3d_addidx(out, si_s, _m3d_stridx(str, numstr, m->name)); + for(i = 0; i < m->numprop; i++) { + if(m->prop[i].type >= 128) { + if(m->prop[i].value.textureid >= model->numtexture || + !model->texture[m->prop[i].value.textureid].name) continue; + k = m3dpf_map; + } else { + for(k = 256, l = 0; l < sizeof(m3d_propertytypes)/sizeof(m3d_propertytypes[0]); l++) + if(m->prop[i].type == m3d_propertytypes[l].id) { k = m3d_propertytypes[l].format; break; } + } + if(k == 256) continue; + *out++ = m->prop[i].type; + switch(k) { + case m3dpf_color: + if(!(flags & M3D_EXP_NOCMAP)) { + idx = _m3d_cmapidx(cmap, numcmap, m->prop[i].value.color); + switch(ci_s) { + case 1: *out++ = (uint8_t)(idx); break; + case 2: *((uint16_t*)out) = (uint16_t)(idx); out += 2; break; + case 4: *((uint32_t*)out) = (uint32_t)(m->prop[i].value.color); out += 4; break; + } + } else out--; + break; + case m3dpf_uint8: *out++ = m->prop[i].value.num; break; + case m3dpf_uint16: *((uint16_t*)out) = m->prop[i].value.num; out += 2; break; + case m3dpf_uint32: *((uint32_t*)out) = m->prop[i].value.num; out += 4; break; + case m3dpf_float: *((float*)out) = m->prop[i].value.fnum; out += 4; break; + + case m3dpf_map: + idx = _m3d_stridx(str, numstr, model->texture[m->prop[i].value.textureid].name); + out = _m3d_addidx(out, si_s, idx); + break; + } + } + *length = (uint64_t)out - (uint64_t)((uint8_t*)h + len); + len += *length; + out = NULL; + } + } + /* mesh face */ + if(model->numface && face && !(flags & M3D_EXP_NOFACE)) { + chunklen = 8 + si_s + model->numface * (6 * vi_s + 3 * ti_s + si_s + 1); + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "MESH", 4); + length = (uint32_t*)((uint8_t*)h + len + 4); + out = (uint8_t*)h + len + 8; + last = (M3D_INDEX)-1U; + for(i = 0; i < model->numface; i++) { + if(!(flags & M3D_EXP_NOMATERIAL) && face[i].materialid != last) { + last = face[i].materialid; + if(last < nummtrl) { + idx = _m3d_stridx(str, numstr, !mtrl ? model->material[last].name : mtrl[last]->name); + if(idx) { + *out++ = 0; + out = _m3d_addidx(out, si_s, idx); + } + } + } + /* hardcoded triangles. */ + k = (3 << 4) | + (((flags & M3D_EXP_NOTXTCRD) || ti_s == 8 || (face[i].texcoord[0] == (M3D_INDEX)-1U && + face[i].texcoord[1] == (M3D_INDEX)-1U && face[i].texcoord[2] == (M3D_INDEX)-1U)) ? 0 : 1) | + (((flags & M3D_EXP_NONORMAL) || (face[i].normal[0] == (M3D_INDEX)-1U && + face[i].normal[1] == (M3D_INDEX)-1U && face[i].normal[2] == (M3D_INDEX)-1U)) ? 0 : 2); + *out++ = k; + for(j = 0; j < 3; j++) { + out = _m3d_addidx(out, vi_s, face[i].vertex[j]); + if(k & 1) + out = _m3d_addidx(out, ti_s, face[i].texcoord[j]); + if(k & 2) + out = _m3d_addidx(out, vi_s, face[i].normal[j]); + } + } + *length = (uint64_t)out - (uint64_t)((uint8_t*)h + len); + len += *length; + out = NULL; + } + /* actions */ + if(model->numaction && model->action && numactn && actn && numbone && bone && !(flags & M3D_EXP_NOACTION)) { + l = 0; + for(j = 0; j < model->numaction; j++) { + a = &model->action[j]; + chunklen = 14 + si_s + a->numframe * (4 + fi_s + maxt * (bi_s + 2 * vi_s)); + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "ACTN", 4); + length = (uint32_t*)((uint8_t*)h + len + 4); + out = (uint8_t*)h + len + 8; + out = _m3d_addidx(out, si_s, _m3d_stridx(str, numstr, a->name)); + *((uint16_t*)out) = (uint16_t)(a->numframe); out += 2; + *((uint32_t*)out) = (uint32_t)(a->durationmsec); out += 4; + for(i = 0; i < a->numframe; i++) { + *((uint32_t*)out) = (uint32_t)(a->frame[i].msec); out += 4; + out = _m3d_addidx(out, fi_s, a->frame[i].numtransform); + for(k = 0; k < a->frame[i].numtransform; k++) { + out = _m3d_addidx(out, bi_s, a->frame[i].transform[k].boneid); + out = _m3d_addidx(out, vi_s, actn[l++]); + out = _m3d_addidx(out, vi_s, actn[l++]); + } + } + *length = (uint64_t)out - (uint64_t)((uint8_t*)h + len); + len += *length; + out = NULL; + } + } + /* inlined assets */ + if(model->numinlined && model->inlined && (flags & M3D_EXP_INLINE)) { + for(j = 0; j < model->numinlined; j++) { + if(!model->inlined[j].name || !*model->inlined[j].name || !model->inlined[j].length) + continue; + chunklen = 8 + si_s + model->inlined[j].length; + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "ASET", 4); + *((uint32_t*)((uint8_t*)h + len + 4)) = chunklen; + out = (uint8_t*)h + len + 8; + out = _m3d_addidx(out, si_s, _m3d_stridx(str, numstr, model->inlined[j].name)); + memcpy(out, model->inlined[j].data, model->inlined[j].length); + out = NULL; + len += chunklen; + } + } + /* extra chunks */ + if(model->numunknown && model->unknown && (flags & M3D_EXP_EXTRA)) { + for(j = 0; j < model->numunknown; j++) { + if(!model->unknown[j] || model->unknown[j]->length < 8) + continue; + chunklen = model->unknown[j]->length; + h = (m3dhdr_t*)M3D_REALLOC(h, len + chunklen); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, model->unknown[j], chunklen); + len += chunklen; + } + } + /* add end chunk */ + h = (m3dhdr_t*)M3D_REALLOC(h, len + 4); + if(!h) goto memerr; + memcpy((uint8_t*)h + len, "OMD3", 4); + len += 4; + /* zlib compress */ + if(!(flags & M3D_EXP_NOZLIB)) { + z = stbi_zlib_compress((unsigned char *)h, len, (int*)&l, 9); + if(z && l > 0 && l < len) { len = l; M3D_FREE(h); h = (m3dhdr_t*)z; } + } + /* add file header at the begining */ + len += 8; + out = (unsigned char*)M3D_MALLOC(len); + if(!out) goto memerr; + memcpy(out, "3DMO", 4); + *((uint32_t*)(out + 4)) = len; + memcpy(out + 8, h, len - 8); + } + if(size) *size = out ? len : 0; + if(face) M3D_FREE(face); + if(cmap) M3D_FREE(cmap); + if(tmap) M3D_FREE(tmap); + if(mtrl) M3D_FREE(mtrl); + if(vrtx) M3D_FREE(vrtx); + if(bone) M3D_FREE(bone); + if(skin) M3D_FREE(skin); + if(actn) M3D_FREE(actn); + if(str) M3D_FREE(str); + if(h) M3D_FREE(h); + return out; +} +#endif + +#endif + +#ifdef __cplusplus +} +#ifdef M3D_CPPWRAPPER +#include +#include +#include + +/*** C++ wrapper class ***/ +namespace M3D { +#ifdef M3D_IMPLEMENTATION + + class Model { + public: + m3d_t *model; + + public: + Model() { + this->model = (m3d_t*)malloc(sizeof(m3d_t)); memset(this->model, 0, sizeof(m3d_t)); + } + Model(_unused const std::string &data, _unused m3dread_t ReadFileCB, + _unused m3dfree_t FreeCB, _unused M3D::Model mtllib) { +#ifndef M3D_NOIMPORTER + this->model = m3d_load((unsigned char *)data.data(), ReadFileCB, FreeCB, mtllib.model); +#else + Model(); +#endif + } + Model(_unused const std::vector data, _unused m3dread_t ReadFileCB, + _unused m3dfree_t FreeCB, _unused M3D::Model mtllib) { +#ifndef M3D_NOIMPORTER + this->model = m3d_load((unsigned char *)&data[0], ReadFileCB, FreeCB, mtllib.model); +#else + Model(); +#endif + } + ~Model() { m3d_free(this->model); } + + public: + m3d_t *getCStruct() { return this->model; } + std::string getName() { return std::string(this->model->name); } + void setName(std::string name) { this->model->name = (char*)name.c_str(); } + std::string getLicense() { return std::string(this->model->license); } + void setLicense(std::string license) { this->model->license = (char*)license.c_str(); } + std::string getAuthor() { return std::string(this->model->author); } + void setAuthor(std::string author) { this->model->author = (char*)author.c_str(); } + std::string getDescription() { return std::string(this->model->desc); } + void setDescription(std::string desc) { this->model->desc = (char*)desc.c_str(); } + float getScale() { return this->model->scale; } + void setScale(float scale) { this->model->scale = scale; } + std::vector getColorMap() { return this->model->cmap ? std::vector(this->model->cmap, + this->model->cmap + this->model->numcmap) : std::vector(); } + std::vector getTextureMap() { return this->model->tmap ? std::vector(this->model->tmap, + this->model->tmap + this->model->numtmap) : std::vector(); } + std::vector getTextures() { return this->model->texture ? std::vector(this->model->texture, + this->model->texture + this->model->numtexture) : std::vector(); } + std::string getTextureName(int idx) { return idx >= 0 && (unsigned int)idx < this->model->numtexture ? + std::string(this->model->texture[idx].name) : nullptr; } + std::vector getBones() { return this->model->bone ? std::vector(this->model->bone, this->model->bone + + this->model->numbone) : std::vector(); } + std::string getBoneName(int idx) { return idx >= 0 && (unsigned int)idx < this->model->numbone ? + std::string(this->model->bone[idx].name) : nullptr; } + std::vector getMaterials() { return this->model->material ? std::vector(this->model->material, + this->model->material + this->model->nummaterial) : std::vector(); } + std::string getMaterialName(int idx) { return idx >= 0 && (unsigned int)idx < this->model->nummaterial ? + std::string(this->model->material[idx].name) : nullptr; } + int getMaterialPropertyInt(int idx, int type) { + if (idx < 0 || (unsigned int)idx >= this->model->nummaterial || type < 0 || type >= 127 || + !this->model->material[idx].prop) return -1; + for (int i = 0; i < this->model->material[idx].numprop; i++) { + if (this->model->material[idx].prop[i].type == type) + return this->model->material[idx].prop[i].value.num; + } + return -1; + } + uint32_t getMaterialPropertyColor(int idx, int type) { return this->getMaterialPropertyInt(idx, type); } + float getMaterialPropertyFloat(int idx, int type) { + if (idx < 0 || (unsigned int)idx >= this->model->nummaterial || type < 0 || type >= 127 || + !this->model->material[idx].prop) return -1.0f; + for (int i = 0; i < this->model->material[idx].numprop; i++) { + if (this->model->material[idx].prop[i].type == type) + return this->model->material[idx].prop[i].value.fnum; + } + return -1.0f; + } + m3dtx_t* getMaterialPropertyMap(int idx, int type) { + if (idx < 0 || (unsigned int)idx >= this->model->nummaterial || type < 128 || type > 255 || + !this->model->material[idx].prop) return nullptr; + for (int i = 0; i < this->model->material[idx].numprop; i++) { + if (this->model->material[idx].prop[i].type == type) + return this->model->material[idx].prop[i].value.textureid < this->model->numtexture ? + &this->model->texture[this->model->material[idx].prop[i].value.textureid] : nullptr; + } + return nullptr; + } + std::vector getVertices() { return this->model->vertex ? std::vector(this->model->vertex, + this->model->vertex + this->model->numvertex) : std::vector(); } + std::vector getFace() { return this->model->face ? std::vector(this->model->face, this->model->face + + this->model->numface) : std::vector(); } + std::vector getSkin() { return this->model->skin ? std::vector(this->model->skin, this->model->skin + + this->model->numskin) : std::vector(); } + std::vector getActions() { return this->model->action ? std::vector(this->model->action, + this->model->action + this->model->numaction) : std::vector(); } + std::string getActionName(int aidx) { return aidx >= 0 && (unsigned int)aidx < this->model->numaction ? + std::string(this->model->action[aidx].name) : nullptr; } + unsigned int getActionDuration(int aidx) { return aidx >= 0 && (unsigned int)aidx < this->model->numaction ? + this->model->action[aidx].durationmsec : 0; } + std::vector getActionFrames(int aidx) { return aidx >= 0 && (unsigned int)aidx < this->model->numaction ? + std::vector(this->model->action[aidx].frame, this->model->action[aidx].frame + + this->model->action[aidx].numframe) : std::vector(); } + unsigned int getActionFrameTimestamp(int aidx, int fidx) { return aidx >= 0 && (unsigned int)aidx < this->model->numaction? + (fidx >= 0 && (unsigned int)fidx < this->model->action[aidx].numframe ? + this->model->action[aidx].frame[fidx].msec : 0) : 0; } + std::vector getActionFrameTransforms(int aidx, int fidx) { + return aidx >= 0 && (unsigned int)aidx < this->model->numaction ? ( + fidx >= 0 && (unsigned int)fidx < this->model->action[aidx].numframe ? + std::vector(this->model->action[aidx].frame[fidx].transform, + this->model->action[aidx].frame[fidx].transform + this->model->action[aidx].frame[fidx].numtransform) : + std::vector()) : std::vector(); } + std::vector getActionFrame(int aidx, int fidx, std::vector skeleton) { + m3dtr_t *pose = m3d_frame(this->model, (unsigned int)aidx, (unsigned int)fidx, + skeleton.size() ? &skeleton[0] : nullptr); + return std::vector(pose, pose + this->model->numbone); } + std::vector getActionPose(int aidx, unsigned int msec) { + m3db_t *pose = m3d_pose(this->model, (unsigned int)aidx, (unsigned int)msec); + return std::vector(pose, pose + this->model->numbone); } + std::vector getInlinedAssets() { return this->model->inlined ? std::vector(this->model->inlined, + this->model->inlined + this->model->numinlined) : std::vector(); } + std::vector> getUnknowns() { return this->model->unknown ? + std::vector>(this->model->unknown, + this->model->unknown + this->model->numunknown) : std::vector>(); } + std::vector Save(_unused int quality, _unused int flags) { +#ifdef M3D_EXPORTER + unsigned int size; + unsigned char *ptr = m3d_save(this->model, quality, flags, &size); + return ptr && size ? std::vector(ptr, ptr + size) : std::vector(); +#else + return std::vector(); +#endif + } + }; + +#else + class Model { + public: + m3d_t *model; + + public: + Model(const std::string &data, m3dread_t ReadFileCB, m3dfree_t FreeCB); + Model(const std::vector data, m3dread_t ReadFileCB, m3dfree_t FreeCB); + Model(); + ~Model(); + + public: + m3d_t *getCStruct(); + std::string getName(); + void setName(std::string name); + std::string getLicense(); + void setLicense(std::string license); + std::string getAuthor(); + void setAuthor(std::string author); + std::string getDescription(); + void setDescription(std::string desc); + float getScale(); + void setScale(float scale); + std::vector getColorMap(); + std::vector getTextureMap(); + std::vector getTextures(); + std::string getTextureName(int idx); + std::vector getBones(); + std::string getBoneName(int idx); + std::vector getMaterials(); + std::string getMaterialName(int idx); + int getMaterialPropertyInt(int idx, int type); + uint32_t getMaterialPropertyColor(int idx, int type); + float getMaterialPropertyFloat(int idx, int type); + m3dtx_t* getMaterialPropertyMap(int idx, int type); + std::vector getVertices(); + std::vector getFace(); + std::vector getSkin(); + std::vector getActions(); + std::string getActionName(int aidx); + unsigned int getActionDuration(int aidx); + std::vector getActionFrames(int aidx); + unsigned int getActionFrameTimestamp(int aidx, int fidx); + std::vector getActionFrameTransforms(int aidx, int fidx); + std::vector getActionFrame(int aidx, int fidx, std::vector skeleton); + std::vector getActionPose(int aidx, unsigned int msec); + std::vector getInlinedAssets(); + std::vector> getUnknowns(); + std::vector Save(int quality, int flags); + }; + +#endif /* impl */ +} +#endif + +#endif /* __cplusplus */ + +#endif diff --git a/Engine/lib/assimp/code/MD2FileData.h b/Engine/lib/assimp/code/MD2/MD2FileData.h similarity index 100% rename from Engine/lib/assimp/code/MD2FileData.h rename to Engine/lib/assimp/code/MD2/MD2FileData.h diff --git a/Engine/lib/assimp/code/MD2Loader.cpp b/Engine/lib/assimp/code/MD2/MD2Loader.cpp similarity index 99% rename from Engine/lib/assimp/code/MD2Loader.cpp rename to Engine/lib/assimp/code/MD2/MD2Loader.cpp index a26f70533..7023c0fa3 100644 --- a/Engine/lib/assimp/code/MD2Loader.cpp +++ b/Engine/lib/assimp/code/MD2/MD2Loader.cpp @@ -344,7 +344,7 @@ void MD2Importer::InternReadFile( const std::string& pFile, if (pcSkins->name[0]) { aiString szString; - const size_t iLen = ::strlen(pcSkins->name); + const ai_uint32 iLen = (ai_uint32) ::strlen(pcSkins->name); ::memcpy(szString.data,pcSkins->name,iLen); szString.data[iLen] = '\0'; szString.length = iLen; diff --git a/Engine/lib/assimp/code/MD2Loader.h b/Engine/lib/assimp/code/MD2/MD2Loader.h similarity index 100% rename from Engine/lib/assimp/code/MD2Loader.h rename to Engine/lib/assimp/code/MD2/MD2Loader.h diff --git a/Engine/lib/assimp/code/MD2NormalTable.h b/Engine/lib/assimp/code/MD2/MD2NormalTable.h similarity index 100% rename from Engine/lib/assimp/code/MD2NormalTable.h rename to Engine/lib/assimp/code/MD2/MD2NormalTable.h diff --git a/Engine/lib/assimp/code/MD3FileData.h b/Engine/lib/assimp/code/MD3/MD3FileData.h similarity index 97% rename from Engine/lib/assimp/code/MD3FileData.h rename to Engine/lib/assimp/code/MD3/MD3FileData.h index 0978e548d..2acd6631f 100644 --- a/Engine/lib/assimp/code/MD3FileData.h +++ b/Engine/lib/assimp/code/MD3/MD3FileData.h @@ -59,7 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace Assimp { +namespace Assimp { namespace MD3 { // to make it easier for us, we test the magic word against both "endianesses" @@ -303,12 +303,12 @@ inline void Vec3NormalToLatLng( const aiVector3D& p_vIn, uint16_t& p_iOut ) b = int(57.2957795f * ( std::acos( p_vIn[2] ) ) * ( 255.0f / 360.0f )); b &= 0xff; - ((unsigned char*)&p_iOut)[0] = b; // longitude - ((unsigned char*)&p_iOut)[1] = a; // latitude + ((unsigned char*)&p_iOut)[0] = (unsigned char) b; // longitude + ((unsigned char*)&p_iOut)[1] = (unsigned char) a; // latitude } } -} -} +} // Namespace MD3 +} // Namespace Assimp #endif // !! AI_MD3FILEHELPER_H_INC diff --git a/Engine/lib/assimp/code/MD3Loader.cpp b/Engine/lib/assimp/code/MD3/MD3Loader.cpp similarity index 97% rename from Engine/lib/assimp/code/MD3Loader.cpp rename to Engine/lib/assimp/code/MD3/MD3Loader.cpp index 0faffd5f9..1e78b6e05 100644 --- a/Engine/lib/assimp/code/MD3Loader.cpp +++ b/Engine/lib/assimp/code/MD3/MD3Loader.cpp @@ -53,19 +53,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_MD3_IMPORTER -#include "MD3Loader.h" +#include "MD3/MD3Loader.h" +#include "Common/Importer.h" + #include #include #include #include -#include "Importer.h" #include -#include #include #include #include #include + #include +#include using namespace Assimp; @@ -258,10 +260,10 @@ bool Q3Shader::LoadSkin(SkinData& fill, const std::string& pFile,IOSystem* io) continue; fill.textures.push_back(SkinData::TextureEntry()); - SkinData::TextureEntry& s = fill.textures.back(); + SkinData::TextureEntry &entry = fill.textures.back(); - s.first = ss; - s.second = GetNextToken(buff); + entry.first = ss; + entry.second = GetNextToken(buff); } return true; } @@ -718,9 +720,7 @@ void MD3Importer::ConvertPath(const char* texture_name, const char* header_name, // ------------------------------------------------------------------------------------------------ // Imports the given file into the given scene structure. -void MD3Importer::InternReadFile( const std::string& pFile, - aiScene* pScene, IOSystem* pIOHandler) -{ +void MD3Importer::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler) { mFile = pFile; mScene = pScene; mIOHandler = pIOHandler; @@ -730,11 +730,13 @@ void MD3Importer::InternReadFile( const std::string& pFile, std::string::size_type s = mFile.find_last_of("/\\"); if (s == std::string::npos) { s = 0; + } else { + ++s; + } + filename = mFile.substr(s), path = mFile.substr(0, s); + for (std::string::iterator it = filename.begin(); it != filename.end(); ++it) { + *it = static_cast( tolower(*it) ); } - else ++s; - filename = mFile.substr(s), path = mFile.substr(0,s); - for( std::string::iterator it = filename .begin(); it != filename.end(); ++it) - *it = tolower( *it); // Load multi-part model file, if necessary if (configHandleMP) { @@ -905,15 +907,15 @@ void MD3Importer::InternReadFile( const std::string& pFile, // Now search the current shader for a record with this name ( // excluding texture file extension) if (!shaders.blocks.empty()) { + std::string::size_type sh = convertedPath.find_last_of('.'); + if (sh == std::string::npos) { + sh = convertedPath.length(); + } - std::string::size_type s = convertedPath.find_last_of('.'); - if (s == std::string::npos) - s = convertedPath.length(); - - const std::string without_ext = convertedPath.substr(0,s); + const std::string without_ext = convertedPath.substr(0,sh); std::list< Q3Shader::ShaderDataBlock >::const_iterator dit = std::find(shaders.blocks.begin(),shaders.blocks.end(),without_ext); if (dit != shaders.blocks.end()) { - // Hurra, wir haben einen. Tolle Sache. + // We made it! shader = &*dit; ASSIMP_LOG_INFO("Found shader record for " +without_ext ); } else { @@ -945,8 +947,7 @@ void MD3Importer::InternReadFile( const std::string& pFile, aiString szString; if (convertedPath.length()) { szString.Set(convertedPath); - } - else { + } else { ASSIMP_LOG_WARN("Texture file name has zero length. Using default name"); szString.Set("dummy_texture.bmp"); } @@ -955,8 +956,7 @@ void MD3Importer::InternReadFile( const std::string& pFile, // prevent transparency by default int no_alpha = aiTextureFlags_IgnoreAlpha; pcHelper->AddProperty(&no_alpha,1,AI_MATKEY_TEXFLAGS_DIFFUSE(0)); - } - else { + } else { Q3Shader::ConvertShaderToMaterial(pcHelper,*shader); } @@ -1026,7 +1026,7 @@ void MD3Importer::InternReadFile( const std::string& pFile, if (!shader || shader->cull == Q3Shader::CULL_CW) { std::swap(pcMesh->mFaces[i].mIndices[2],pcMesh->mFaces[i].mIndices[1]); } - pcTriangles++; + ++pcTriangles; } // Go to the next surface @@ -1042,8 +1042,9 @@ void MD3Importer::InternReadFile( const std::string& pFile, } } - if (!pScene->mNumMeshes) + if (!pScene->mNumMeshes) { throw DeadlyImportError( "MD3: File contains no valid mesh"); + } pScene->mNumMaterials = iNumMaterials; // Now we need to generate an empty node graph @@ -1057,7 +1058,6 @@ void MD3Importer::InternReadFile( const std::string& pFile, pScene->mRootNode->mChildren = new aiNode*[pcHeader->NUM_TAGS]; for (unsigned int i = 0; i < pcHeader->NUM_TAGS; ++i, ++pcTags) { - aiNode* nd = pScene->mRootNode->mChildren[i] = new aiNode(); nd->mName.Set((const char*)pcTags->NAME); nd->mParent = pScene->mRootNode; @@ -1085,8 +1085,12 @@ void MD3Importer::InternReadFile( const std::string& pFile, pScene->mRootNode->mMeshes[i] = i; // Now rotate the whole scene 90 degrees around the x axis to convert to internal coordinate system - pScene->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); + pScene->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 + ); } #endif // !! ASSIMP_BUILD_NO_MD3_IMPORTER diff --git a/Engine/lib/assimp/code/MD3Loader.h b/Engine/lib/assimp/code/MD3/MD3Loader.h similarity index 100% rename from Engine/lib/assimp/code/MD3Loader.h rename to Engine/lib/assimp/code/MD3/MD3Loader.h diff --git a/Engine/lib/assimp/code/MD4FileData.h b/Engine/lib/assimp/code/MD4/MD4FileData.h similarity index 100% rename from Engine/lib/assimp/code/MD4FileData.h rename to Engine/lib/assimp/code/MD4/MD4FileData.h diff --git a/Engine/lib/assimp/code/MD5Loader.cpp b/Engine/lib/assimp/code/MD5/MD5Loader.cpp similarity index 97% rename from Engine/lib/assimp/code/MD5Loader.cpp rename to Engine/lib/assimp/code/MD5/MD5Loader.cpp index 346b59504..a4aed8d70 100644 --- a/Engine/lib/assimp/code/MD5Loader.cpp +++ b/Engine/lib/assimp/code/MD5/MD5Loader.cpp @@ -53,6 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "MD5Loader.h" #include #include +#include #include #include #include @@ -64,7 +65,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; // Minimum weight value. Weights inside [-n ... n] are ignored -#define AI_MD5_WEIGHT_EPSILON 1e-5f +#define AI_MD5_WEIGHT_EPSILON Math::getEpsilon() static const aiImporterDesc desc = { @@ -443,10 +444,10 @@ void MD5Importer::LoadMD5MeshFile () for (MD5::VertexList::const_iterator iter = meshSrc.mVertices.begin();iter != meshSrc.mVertices.end();++iter,++pv) { for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights;++w) { - MD5::WeightDesc& desc = meshSrc.mWeights[w]; + MD5::WeightDesc& weightDesc = meshSrc.mWeights[w]; /* FIX for some invalid exporters */ - if (!(desc.mWeight < AI_MD5_WEIGHT_EPSILON && desc.mWeight >= -AI_MD5_WEIGHT_EPSILON )) - ++piCount[desc.mBone]; + if (!(weightDesc.mWeight < AI_MD5_WEIGHT_EPSILON && weightDesc.mWeight >= -AI_MD5_WEIGHT_EPSILON )) + ++piCount[weightDesc.mBone]; } } @@ -493,20 +494,20 @@ void MD5Importer::LoadMD5MeshFile () if (w >= meshSrc.mWeights.size()) throw DeadlyImportError("MD5MESH: Invalid weight index"); - MD5::WeightDesc& desc = meshSrc.mWeights[w]; - if ( desc.mWeight < AI_MD5_WEIGHT_EPSILON && desc.mWeight >= -AI_MD5_WEIGHT_EPSILON) { + MD5::WeightDesc& weightDesc = meshSrc.mWeights[w]; + if ( weightDesc.mWeight < AI_MD5_WEIGHT_EPSILON && weightDesc.mWeight >= -AI_MD5_WEIGHT_EPSILON) { continue; } - const ai_real fNewWeight = desc.mWeight / fSum; + const ai_real fNewWeight = weightDesc.mWeight / fSum; // transform the local position into worldspace - MD5::BoneDesc& boneSrc = meshParser.mJoints[desc.mBone]; - const aiVector3D v = boneSrc.mRotationQuatConverted.Rotate (desc.vOffsetPosition); + MD5::BoneDesc& boneSrc = meshParser.mJoints[weightDesc.mBone]; + const aiVector3D v = boneSrc.mRotationQuatConverted.Rotate (weightDesc.vOffsetPosition); // use the original weight to compute the vertex position // (some MD5s seem to depend on the invalid weight values ...) - *pv += ((boneSrc.mPositionXYZ+v)* (ai_real)desc.mWeight); + *pv += ((boneSrc.mPositionXYZ+v)* (ai_real)weightDesc.mWeight); aiBone* bone = mesh->mBones[boneSrc.mMap]; *bone->mWeights++ = aiVertexWeight((unsigned int)(pv-mesh->mVertices),fNewWeight); diff --git a/Engine/lib/assimp/code/MD5Loader.h b/Engine/lib/assimp/code/MD5/MD5Loader.h similarity index 100% rename from Engine/lib/assimp/code/MD5Loader.h rename to Engine/lib/assimp/code/MD5/MD5Loader.h diff --git a/Engine/lib/assimp/code/MD5Parser.cpp b/Engine/lib/assimp/code/MD5/MD5Parser.cpp similarity index 99% rename from Engine/lib/assimp/code/MD5Parser.cpp rename to Engine/lib/assimp/code/MD5/MD5Parser.cpp index 2770226a9..37490212f 100644 --- a/Engine/lib/assimp/code/MD5Parser.cpp +++ b/Engine/lib/assimp/code/MD5/MD5Parser.cpp @@ -47,16 +47,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers -#include "MD5Loader.h" -#include "MaterialSystem.h" +#include "MD5/MD5Loader.h" +#include "Material/MaterialSystem.h" + #include #include #include #include #include - - using namespace Assimp; using namespace Assimp::MD5; @@ -236,7 +235,7 @@ bool MD5Parser::ParseSection(Section& out) const char* szStart = ++sz; \ while('\"'!=*sz)++sz; \ const char* szEnd = (sz++); \ - out.length = (size_t)(szEnd - szStart); \ + out.length = (ai_uint32) (szEnd - szStart); \ ::memcpy(out.data,szStart,out.length); \ out.data[out.length] = '\0'; // ------------------------------------------------------------------------------------------------ diff --git a/Engine/lib/assimp/code/MD5Parser.h b/Engine/lib/assimp/code/MD5/MD5Parser.h similarity index 100% rename from Engine/lib/assimp/code/MD5Parser.h rename to Engine/lib/assimp/code/MD5/MD5Parser.h diff --git a/Engine/lib/assimp/code/MDCFileData.h b/Engine/lib/assimp/code/MDC/MDCFileData.h similarity index 100% rename from Engine/lib/assimp/code/MDCFileData.h rename to Engine/lib/assimp/code/MDC/MDCFileData.h diff --git a/Engine/lib/assimp/code/MDCLoader.cpp b/Engine/lib/assimp/code/MDC/MDCLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/MDCLoader.cpp rename to Engine/lib/assimp/code/MDC/MDCLoader.cpp index 42947f123..084ec6024 100644 --- a/Engine/lib/assimp/code/MDCLoader.cpp +++ b/Engine/lib/assimp/code/MDC/MDCLoader.cpp @@ -47,16 +47,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_MDC_IMPORTER // internal headers -#include "MDCLoader.h" -#include "MD3FileData.h" -#include "MDCNormalTable.h" // shouldn't be included by other units +#include "MDC/MDCLoader.h" +#include "MD3/MD3FileData.h" +#include "MDC/MDCNormalTable.h" // shouldn't be included by other units + #include #include #include #include #include -#include +#include using namespace Assimp; using namespace Assimp::MDC; diff --git a/Engine/lib/assimp/code/MDCLoader.h b/Engine/lib/assimp/code/MDC/MDCLoader.h similarity index 100% rename from Engine/lib/assimp/code/MDCLoader.h rename to Engine/lib/assimp/code/MDC/MDCLoader.h diff --git a/Engine/lib/assimp/code/MDCNormalTable.h b/Engine/lib/assimp/code/MDC/MDCNormalTable.h similarity index 100% rename from Engine/lib/assimp/code/MDCNormalTable.h rename to Engine/lib/assimp/code/MDC/MDCNormalTable.h diff --git a/Engine/lib/assimp/code/MDLDefaultColorMap.h b/Engine/lib/assimp/code/MDL/MDLDefaultColorMap.h similarity index 100% rename from Engine/lib/assimp/code/MDLDefaultColorMap.h rename to Engine/lib/assimp/code/MDL/MDLDefaultColorMap.h diff --git a/Engine/lib/assimp/code/MDLFileData.h b/Engine/lib/assimp/code/MDL/MDLFileData.h similarity index 100% rename from Engine/lib/assimp/code/MDLFileData.h rename to Engine/lib/assimp/code/MDL/MDLFileData.h diff --git a/Engine/lib/assimp/code/MDLLoader.cpp b/Engine/lib/assimp/code/MDL/MDLLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/MDLLoader.cpp rename to Engine/lib/assimp/code/MDL/MDLLoader.cpp index 256d79a2c..d71057d55 100644 --- a/Engine/lib/assimp/code/MDLLoader.cpp +++ b/Engine/lib/assimp/code/MDL/MDLLoader.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -50,11 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_MDL_IMPORTER -#include "MDLLoader.h" -#include +#include "MDL/MDLLoader.h" +#include "MDL/MDLDefaultColorMap.h" +#include "MD2/MD2FileData.h" + #include -#include "MDLDefaultColorMap.h" -#include "MD2FileData.h" #include #include #include @@ -93,23 +91,24 @@ static const aiImporterDesc desc = { // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer MDLImporter::MDLImporter() - : configFrameID(), - mBuffer(), - iGSFileVersion(), - pIOHandler(), - pScene(), - iFileSize() -{} +: configFrameID() +, mBuffer() +, iGSFileVersion() +, pIOHandler() +, pScene() +, iFileSize() { + // empty +} // ------------------------------------------------------------------------------------------------ // Destructor, private as well -MDLImporter::~MDLImporter() -{} +MDLImporter::~MDLImporter() { + // empty +} // ------------------------------------------------------------------------------------------------ // Returns whether the class can handle the format of the given file. -bool MDLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const -{ +bool MDLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const { const std::string extension = GetExtension(pFile); // if check for extension is not enough, check for the magic tokens @@ -403,23 +402,15 @@ void MDLImporter::InternReadFile_Quake1() { // now get a pointer to the first frame in the file BE_NCONST MDL::Frame* pcFrames = (BE_NCONST MDL::Frame*)szCurrent; - BE_NCONST MDL::SimpleFrame* pcFirstFrame; + MDL::SimpleFrame* pcFirstFrame; if (0 == pcFrames->type) { // get address of single frame - pcFirstFrame = &pcFrames->frame; + pcFirstFrame =( MDL::SimpleFrame*) &pcFrames->frame; } else { // get the first frame in the group - -#if 1 - // FIXME: the cast is wrong and cause a warning on clang 5.0 - // disable this code for now, fix it later - ai_assert(false && "Bad pointer cast"); - pcFirstFrame = nullptr; // Workaround: msvc++ C4703 error -#else - BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*)pcFrames; - pcFirstFrame = (BE_NCONST MDL::SimpleFrame*)(&pcFrames2->time + pcFrames->type); -#endif + BE_NCONST MDL::GroupFrame* pcFrames2 = (BE_NCONST MDL::GroupFrame*) pcFrames; + pcFirstFrame = &(pcFrames2->frames[0]); } BE_NCONST MDL::Vertex* pcVertices = (BE_NCONST MDL::Vertex*) ((pcFirstFrame->name) + sizeof(pcFirstFrame->name)); VALIDATE_FILE_SIZE((const unsigned char*)(pcVertices + pcHeader->num_verts)); diff --git a/Engine/lib/assimp/code/MDLLoader.h b/Engine/lib/assimp/code/MDL/MDLLoader.h similarity index 99% rename from Engine/lib/assimp/code/MDLLoader.h rename to Engine/lib/assimp/code/MDL/MDLLoader.h index 7009d5ba4..c5ebac024 100644 --- a/Engine/lib/assimp/code/MDLLoader.h +++ b/Engine/lib/assimp/code/MDL/MDLLoader.h @@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "MDLFileData.h" -#include "HalfLifeFileData.h" +#include "HMP/HalfLifeFileData.h" struct aiNode; struct aiTexture; @@ -89,16 +89,12 @@ public: MDLImporter(); ~MDLImporter(); - -public: - // ------------------------------------------------------------------- /** Returns whether the class can handle the format of the given file. * See BaseImporter::CanRead() for details. */ bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const; - // ------------------------------------------------------------------- /** Called prior to ReadFile(). * The function is a request to the importer to update its configuration @@ -107,8 +103,6 @@ public: void SetupProperties(const Importer* pImp); protected: - - // ------------------------------------------------------------------- /** Return importer meta information. * See #BaseImporter::GetInfo for the details @@ -122,8 +116,6 @@ protected: void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); -protected: - // ------------------------------------------------------------------- /** Import a quake 1 MDL file (IDPO) */ @@ -154,7 +146,6 @@ protected: void SizeCheck(const void* szPos); void SizeCheck(const void* szPos, const char* szFile, unsigned int iLine); - // ------------------------------------------------------------------- /** Validate the header data structure of a game studio MDL7 file * \param pcHeader Input header to be validated @@ -167,7 +158,6 @@ protected: */ void ValidateHeader_Quake1(const MDL::Header* pcHeader); - // ------------------------------------------------------------------- /** Try to load a palette from the current directory (colormap.lmp) * If it is not found the default palette of Quake1 is returned @@ -179,9 +169,8 @@ protected: */ void FreePalette(const unsigned char* pszColorMap); - // ------------------------------------------------------------------- - /** Load a paletized texture from the file and convert it to 32bpp + /** Load a palletized texture from the file and convert it to 32bpp */ void CreateTextureARGB8_3DGS_MDL3(const unsigned char* szData); @@ -195,7 +184,6 @@ protected: unsigned int iType, unsigned int* piSkip); - // ------------------------------------------------------------------- /** Used to load textures from MDL5 * \param szData Input data @@ -206,7 +194,6 @@ protected: unsigned int iType, unsigned int* piSkip); - // ------------------------------------------------------------------- /** Checks whether a texture can be replaced with a single color * This is useful for all file formats before MDL7 (all those @@ -218,14 +205,12 @@ protected: */ aiColor4D ReplaceTextureWithColor(const aiTexture* pcTexture); - // ------------------------------------------------------------------- /** Converts the absolute texture coordinates in MDL5 files to * relative in a range between 0 and 1 */ void CalculateUVCoordinates_MDL5(); - // ------------------------------------------------------------------- /** Read an UV coordinate from the file. If the file format is not * MDL5, the function calculates relative texture coordinates @@ -245,7 +230,6 @@ protected: */ void SetupMaterialProperties_3DGS_MDL5_Quake1( ); - // ------------------------------------------------------------------- /** Parse a skin lump in a MDL7/HMP7 file with all of its features * variant 1: Current cursor position is the beginning of the skin header diff --git a/Engine/lib/assimp/code/MDLMaterialLoader.cpp b/Engine/lib/assimp/code/MDL/MDLMaterialLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/MDLMaterialLoader.cpp rename to Engine/lib/assimp/code/MDL/MDLMaterialLoader.cpp diff --git a/Engine/lib/assimp/code/MMDCpp14.h b/Engine/lib/assimp/code/MMD/MMDCpp14.h similarity index 100% rename from Engine/lib/assimp/code/MMDCpp14.h rename to Engine/lib/assimp/code/MMD/MMDCpp14.h diff --git a/Engine/lib/assimp/code/MMDImporter.cpp b/Engine/lib/assimp/code/MMD/MMDImporter.cpp similarity index 98% rename from Engine/lib/assimp/code/MMDImporter.cpp rename to Engine/lib/assimp/code/MMD/MMDImporter.cpp index 84b9e35a6..e7744e4cd 100644 --- a/Engine/lib/assimp/code/MMDImporter.cpp +++ b/Engine/lib/assimp/code/MMD/MMDImporter.cpp @@ -41,15 +41,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_MMD_IMPORTER -#include "MMDImporter.h" -#include "MMDPmdParser.h" -#include "MMDPmxParser.h" -#include "MMDVmdParser.h" -#include "ConvertToLHProcess.h" +#include "MMD/MMDImporter.h" +#include "MMD/MMDPmdParser.h" +#include "MMD/MMDPmxParser.h" +#include "MMD/MMDVmdParser.h" +#include "PostProcessing/ConvertToLHProcess.h" + #include #include #include #include + #include #include #include diff --git a/Engine/lib/assimp/code/MMDImporter.h b/Engine/lib/assimp/code/MMD/MMDImporter.h similarity index 100% rename from Engine/lib/assimp/code/MMDImporter.h rename to Engine/lib/assimp/code/MMD/MMDImporter.h diff --git a/Engine/lib/assimp/code/MMDPmdParser.h b/Engine/lib/assimp/code/MMD/MMDPmdParser.h similarity index 100% rename from Engine/lib/assimp/code/MMDPmdParser.h rename to Engine/lib/assimp/code/MMD/MMDPmdParser.h diff --git a/Engine/lib/assimp/code/MMDPmxParser.cpp b/Engine/lib/assimp/code/MMD/MMDPmxParser.cpp similarity index 99% rename from Engine/lib/assimp/code/MMDPmxParser.cpp rename to Engine/lib/assimp/code/MMD/MMDPmxParser.cpp index 7425ceac2..80f0986dd 100644 --- a/Engine/lib/assimp/code/MMDPmxParser.cpp +++ b/Engine/lib/assimp/code/MMD/MMDPmxParser.cpp @@ -42,7 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "MMDPmxParser.h" #include -#include "../contrib/utf8cpp/source/utf8.h" +#ifdef ASSIMP_USE_HUNTER +# include +#else +# include "../contrib/utf8cpp/source/utf8.h" +#endif #include namespace pmx diff --git a/Engine/lib/assimp/code/MMDPmxParser.h b/Engine/lib/assimp/code/MMD/MMDPmxParser.h similarity index 100% rename from Engine/lib/assimp/code/MMDPmxParser.h rename to Engine/lib/assimp/code/MMD/MMDPmxParser.h diff --git a/Engine/lib/assimp/code/MMDVmdParser.h b/Engine/lib/assimp/code/MMD/MMDVmdParser.h similarity index 100% rename from Engine/lib/assimp/code/MMDVmdParser.h rename to Engine/lib/assimp/code/MMD/MMDVmdParser.h diff --git a/Engine/lib/assimp/code/MS3DLoader.cpp b/Engine/lib/assimp/code/MS3D/MS3DLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/MS3DLoader.cpp rename to Engine/lib/assimp/code/MS3D/MS3DLoader.cpp diff --git a/Engine/lib/assimp/code/MS3DLoader.h b/Engine/lib/assimp/code/MS3D/MS3DLoader.h similarity index 100% rename from Engine/lib/assimp/code/MS3DLoader.h rename to Engine/lib/assimp/code/MS3D/MS3DLoader.h diff --git a/Engine/lib/assimp/code/MaterialSystem.cpp b/Engine/lib/assimp/code/Material/MaterialSystem.cpp similarity index 95% rename from Engine/lib/assimp/code/MaterialSystem.cpp rename to Engine/lib/assimp/code/Material/MaterialSystem.cpp index 03d5a18a3..0be6e9f7b 100644 --- a/Engine/lib/assimp/code/MaterialSystem.cpp +++ b/Engine/lib/assimp/code/Material/MaterialSystem.cpp @@ -51,7 +51,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include using namespace Assimp; @@ -96,12 +95,12 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, ai_real* pOut, unsigned int* pMax) { - ai_assert( pOut != NULL ); - ai_assert( pMat != NULL ); + ai_assert( pOut != nullptr ); + ai_assert( pMat != nullptr ); const aiMaterialProperty* prop; aiGetMaterialProperty(pMat,pKey,type,index, (const aiMaterialProperty**) &prop); - if (!prop) { + if ( nullptr == prop) { return AI_FAILURE; } @@ -112,9 +111,11 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, if (pMax) { iWrite = std::min(*pMax,iWrite); ; } - for (unsigned int a = 0; a < iWrite;++a) { - pOut[a] = static_cast ( reinterpret_cast(prop->mData)[a] ); + + for (unsigned int a = 0; a < iWrite; ++a) { + pOut[ a ] = static_cast ( reinterpret_cast(prop->mData)[a] ); } + if (pMax) { *pMax = iWrite; } @@ -543,23 +544,7 @@ aiReturn aiMaterial::AddProperty (const aiString* pInput, unsigned int type, unsigned int index) { - // We don't want to add the whole buffer .. write a 32 bit length - // prefix followed by the zero-terminated UTF8 string. - // (HACK) I don't want to break the ABI now, but we definitely - // ought to change aiString::mLength to uint32_t one day. - if (sizeof(size_t) == 8) { - aiString copy = *pInput; - uint32_t* s = reinterpret_cast(©.length); - s[1] = static_cast(pInput->length); - - return AddBinaryProperty(s+1, - static_cast(pInput->length+1+4), - pKey, - type, - index, - aiPTI_String); - } - ai_assert(sizeof(size_t)==4); + ai_assert(sizeof(ai_uint32)==4); return AddBinaryProperty(pInput, static_cast(pInput->length+1+4), pKey, diff --git a/Engine/lib/assimp/code/MaterialSystem.h b/Engine/lib/assimp/code/Material/MaterialSystem.h similarity index 100% rename from Engine/lib/assimp/code/MaterialSystem.h rename to Engine/lib/assimp/code/Material/MaterialSystem.h diff --git a/Engine/lib/assimp/code/MemoryIOWrapper.h b/Engine/lib/assimp/code/MemoryIOWrapper.h deleted file mode 100644 index 9bd245337..000000000 --- a/Engine/lib/assimp/code/MemoryIOWrapper.h +++ /dev/null @@ -1,198 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file MemoryIOWrapper.h - * Handy IOStream/IOSystem implemetation to read directly from a memory buffer */ -#ifndef AI_MEMORYIOSTREAM_H_INC -#define AI_MEMORYIOSTREAM_H_INC - -#include -#include -#include -#include - -namespace Assimp { -#define AI_MEMORYIO_MAGIC_FILENAME "$$$___magic___$$$" -#define AI_MEMORYIO_MAGIC_FILENAME_LENGTH 17 - -// ---------------------------------------------------------------------------------- -/** Implementation of IOStream to read directly from a memory buffer */ -// ---------------------------------------------------------------------------------- -class MemoryIOStream : public IOStream -{ - //friend class MemoryIOSystem; -public: - MemoryIOStream (const uint8_t* buff, size_t len, bool own = false) - : buffer (buff) - , length(len) - , pos((size_t)0) - , own(own) - { - } - -public: - - ~MemoryIOStream () { - if(own) { - delete[] buffer; - } - } - - // ------------------------------------------------------------------- - // Read from stream - size_t Read(void* pvBuffer, size_t pSize, size_t pCount) { - const size_t cnt = std::min(pCount,(length-pos)/pSize),ofs = pSize*cnt; - - memcpy(pvBuffer,buffer+pos,ofs); - pos += ofs; - - return cnt; - } - - // ------------------------------------------------------------------- - // Write to stream - size_t Write(const void* /*pvBuffer*/, size_t /*pSize*/,size_t /*pCount*/) { - ai_assert(false); // won't be needed - return 0; - } - - // ------------------------------------------------------------------- - // Seek specific position - aiReturn Seek(size_t pOffset, aiOrigin pOrigin) { - if (aiOrigin_SET == pOrigin) { - if (pOffset >= length) { - return AI_FAILURE; - } - pos = pOffset; - } - else if (aiOrigin_END == pOrigin) { - if (pOffset >= length) { - return AI_FAILURE; - } - pos = length-pOffset; - } - else { - if (pOffset+pos >= length) { - return AI_FAILURE; - } - pos += pOffset; - } - return AI_SUCCESS; - } - - // ------------------------------------------------------------------- - // Get current seek position - size_t Tell() const { - return pos; - } - - // ------------------------------------------------------------------- - // Get size of file - size_t FileSize() const { - return length; - } - - // ------------------------------------------------------------------- - // Flush file contents - void Flush() { - ai_assert(false); // won't be needed - } - -private: - const uint8_t* buffer; - size_t length,pos; - bool own; -}; - -// --------------------------------------------------------------------------- -/** Dummy IO system to read from a memory buffer */ -class MemoryIOSystem : public IOSystem -{ -public: - /** Constructor. */ - MemoryIOSystem (const uint8_t* buff, size_t len) - : buffer (buff), length(len) { - } - - /** Destructor. */ - ~MemoryIOSystem() { - } - - // ------------------------------------------------------------------- - /** Tests for the existence of a file at the given path. */ - bool Exists( const char* pFile) const { - return !strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH); - } - - // ------------------------------------------------------------------- - /** Returns the directory separator. */ - char getOsSeparator() const { - return '/'; // why not? it doesn't care - } - - // ------------------------------------------------------------------- - /** Open a new file with a given path. */ - IOStream* Open( const char* pFile, const char* /*pMode*/ = "rb") { - if (strncmp(pFile,AI_MEMORYIO_MAGIC_FILENAME,AI_MEMORYIO_MAGIC_FILENAME_LENGTH)) { - return NULL; - } - return new MemoryIOStream(buffer,length); - } - - // ------------------------------------------------------------------- - /** Closes the given file and releases all resources associated with it. */ - void Close( IOStream* pFile) { - delete pFile; - } - - // ------------------------------------------------------------------- - /** Compare two paths */ - bool ComparePaths (const char* /*one*/, const char* /*second*/) const { - return false; - } - -private: - const uint8_t* buffer; - size_t length; -}; -} // end namespace Assimp - -#endif diff --git a/Engine/lib/assimp/code/NDOLoader.cpp b/Engine/lib/assimp/code/NDO/NDOLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/NDOLoader.cpp rename to Engine/lib/assimp/code/NDO/NDOLoader.cpp diff --git a/Engine/lib/assimp/code/NDOLoader.h b/Engine/lib/assimp/code/NDO/NDOLoader.h similarity index 100% rename from Engine/lib/assimp/code/NDOLoader.h rename to Engine/lib/assimp/code/NDO/NDOLoader.h diff --git a/Engine/lib/assimp/code/NFFLoader.cpp b/Engine/lib/assimp/code/NFF/NFFLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/NFFLoader.cpp rename to Engine/lib/assimp/code/NFF/NFFLoader.cpp diff --git a/Engine/lib/assimp/code/NFFLoader.h b/Engine/lib/assimp/code/NFF/NFFLoader.h similarity index 100% rename from Engine/lib/assimp/code/NFFLoader.h rename to Engine/lib/assimp/code/NFF/NFFLoader.h diff --git a/Engine/lib/assimp/code/OFFLoader.cpp b/Engine/lib/assimp/code/OFF/OFFLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/OFFLoader.cpp rename to Engine/lib/assimp/code/OFF/OFFLoader.cpp diff --git a/Engine/lib/assimp/code/OFFLoader.h b/Engine/lib/assimp/code/OFF/OFFLoader.h similarity index 100% rename from Engine/lib/assimp/code/OFFLoader.h rename to Engine/lib/assimp/code/OFF/OFFLoader.h diff --git a/Engine/lib/assimp/code/ObjExporter.cpp b/Engine/lib/assimp/code/ObjExporter.cpp deleted file mode 100644 index 08cba43f7..000000000 --- a/Engine/lib/assimp/code/ObjExporter.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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_OBJ_EXPORTER - -#include "ObjExporter.h" -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace Assimp; - -namespace Assimp { - -// ------------------------------------------------------------------------------------------------ -// Worker function for exporting a scene to Wavefront OBJ. Prototyped and registered in Exporter.cpp -void ExportSceneObj(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/) { - // invoke the exporter - ObjExporter exporter(pFile, pScene); - - if (exporter.mOutput.fail() || exporter.mOutputMat.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 both the main OBJ file and the material script - { - std::unique_ptr outfile (pIOSystem->Open(pFile,"wt")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); - } - outfile->Write( exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()),1); - } - { - std::unique_ptr outfile (pIOSystem->Open(exporter.GetMaterialLibFileName(),"wt")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output .mtl file: " + std::string(exporter.GetMaterialLibFileName())); - } - outfile->Write( exporter.mOutputMat.str().c_str(), static_cast(exporter.mOutputMat.tellp()),1); - } -} - -// ------------------------------------------------------------------------------------------------ -// Worker function for exporting a scene to Wavefront OBJ without the material file. Prototyped and registered in Exporter.cpp -void ExportSceneObjNoMtl(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* pProperties) { - // invoke the exporter - ObjExporter exporter(pFile, pScene, true); - - if (exporter.mOutput.fail() || exporter.mOutputMat.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 both the main OBJ file and the material script - { - std::unique_ptr outfile (pIOSystem->Open(pFile,"wt")); - if(outfile == NULL) { - throw DeadlyExportError("could not open output .obj file: " + std::string(pFile)); - } - outfile->Write( exporter.mOutput.str().c_str(), static_cast(exporter.mOutput.tellp()),1); - } - - -} - -} // end of namespace Assimp - -static const std::string MaterialExt = ".mtl"; - -// ------------------------------------------------------------------------------------------------ -ObjExporter::ObjExporter(const char* _filename, const aiScene* pScene, bool noMtl) -: filename(_filename) -, pScene(pScene) -, vn() -, vt() -, vp() -, useVc(false) -, mVnMap() -, mVtMap() -, mVpMap() -, mMeshes() -, endl("\n") { - // make sure that all formatting happens using the standard, C locale and not the user's current locale - const std::locale& l = std::locale("C"); - mOutput.imbue(l); - mOutput.precision(16); - mOutputMat.imbue(l); - mOutputMat.precision(16); - - WriteGeometryFile(noMtl); - if ( !noMtl ) { - WriteMaterialFile(); - } -} - -// ------------------------------------------------------------------------------------------------ -ObjExporter::~ObjExporter() { - // empty -} - -// ------------------------------------------------------------------------------------------------ -std::string ObjExporter::GetMaterialLibName() { - // within the Obj file, we use just the relative file name with the path stripped - const std::string& s = GetMaterialLibFileName(); - std::string::size_type il = s.find_last_of("/\\"); - if (il != std::string::npos) { - return s.substr(il + 1); - } - - return s; -} - -// ------------------------------------------------------------------------------------------------ -std::string ObjExporter::GetMaterialLibFileName() { - // Remove existing .obj file extension so that the final material file name will be fileName.mtl and not fileName.obj.mtl - size_t lastdot = filename.find_last_of('.'); - if ( lastdot != std::string::npos ) { - return filename.substr( 0, lastdot ) + MaterialExt; - } - - return filename + MaterialExt; -} - -// ------------------------------------------------------------------------------------------------ -void ObjExporter::WriteHeader(std::ostringstream& out) { - out << "# File produced by Open Asset Import Library (http://www.assimp.sf.net)" << endl; - out << "# (assimp v" << aiGetVersionMajor() << '.' << aiGetVersionMinor() << '.' - << aiGetVersionRevision() << ")" << endl << endl; -} - -// ------------------------------------------------------------------------------------------------ -std::string ObjExporter::GetMaterialName(unsigned int index) { - const aiMaterial* const mat = pScene->mMaterials[index]; - if ( nullptr == mat ) { - static const std::string EmptyStr; - return EmptyStr; - } - - aiString s; - if(AI_SUCCESS == mat->Get(AI_MATKEY_NAME,s)) { - return std::string(s.data,s.length); - } - - char number[ sizeof(unsigned int) * 3 + 1 ]; - ASSIMP_itoa10(number,index); - return "$Material_" + std::string(number); -} - -// ------------------------------------------------------------------------------------------------ -void ObjExporter::WriteMaterialFile() { - WriteHeader(mOutputMat); - - for(unsigned int i = 0; i < pScene->mNumMaterials; ++i) { - const aiMaterial* const mat = pScene->mMaterials[i]; - - int illum = 1; - mOutputMat << "newmtl " << GetMaterialName(i) << endl; - - aiColor4D c; - if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_DIFFUSE,c)) { - mOutputMat << "Kd " << c.r << " " << c.g << " " << c.b << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_AMBIENT,c)) { - mOutputMat << "Ka " << c.r << " " << c.g << " " << c.b << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_SPECULAR,c)) { - mOutputMat << "Ks " << c.r << " " << c.g << " " << c.b << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_EMISSIVE,c)) { - mOutputMat << "Ke " << c.r << " " << c.g << " " << c.b << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_COLOR_TRANSPARENT,c)) { - mOutputMat << "Tf " << c.r << " " << c.g << " " << c.b << endl; - } - - ai_real o; - if(AI_SUCCESS == mat->Get(AI_MATKEY_OPACITY,o)) { - mOutputMat << "d " << o << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_REFRACTI,o)) { - mOutputMat << "Ni " << o << endl; - } - - if(AI_SUCCESS == mat->Get(AI_MATKEY_SHININESS,o) && o) { - mOutputMat << "Ns " << o << endl; - illum = 2; - } - - mOutputMat << "illum " << illum << endl; - - aiString s; - if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_DIFFUSE(0),s)) { - mOutputMat << "map_Kd " << s.data << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_AMBIENT(0),s)) { - mOutputMat << "map_Ka " << s.data << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_SPECULAR(0),s)) { - mOutputMat << "map_Ks " << s.data << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_SHININESS(0),s)) { - mOutputMat << "map_Ns " << s.data << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_OPACITY(0),s)) { - mOutputMat << "map_d " << s.data << endl; - } - if(AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_HEIGHT(0),s) || AI_SUCCESS == mat->Get(AI_MATKEY_TEXTURE_NORMALS(0),s)) { - // implementations seem to vary here, so write both variants - mOutputMat << "bump " << s.data << endl; - mOutputMat << "map_bump " << s.data << endl; - } - - mOutputMat << endl; - } -} - -void ObjExporter::WriteGeometryFile(bool noMtl) { - WriteHeader(mOutput); - if (!noMtl) - mOutput << "mtllib " << GetMaterialLibName() << endl << endl; - - // collect mesh geometry - aiMatrix4x4 mBase; - AddNode(pScene->mRootNode, mBase); - - // write vertex positions with colors, if any - mVpMap.getKeys( vp ); - if ( !useVc ) { - mOutput << "# " << vp.size() << " vertex positions" << endl; - for ( const vertexData& v : vp ) { - mOutput << "v " << v.vp.x << " " << v.vp.y << " " << v.vp.z << endl; - } - } else { - mOutput << "# " << vp.size() << " vertex positions and colors" << endl; - for ( const vertexData& v : vp ) { - mOutput << "v " << v.vp.x << " " << v.vp.y << " " << v.vp.z << " " << v.vc.r << " " << v.vc.g << " " << v.vc.b << endl; - } - } - mOutput << endl; - - // write uv coordinates - mVtMap.getKeys(vt); - mOutput << "# " << vt.size() << " UV coordinates" << endl; - for(const aiVector3D& v : vt) { - mOutput << "vt " << v.x << " " << v.y << " " << v.z << endl; - } - mOutput << endl; - - // write vertex normals - mVnMap.getKeys(vn); - mOutput << "# " << vn.size() << " vertex normals" << endl; - for(const aiVector3D& v : vn) { - mOutput << "vn " << v.x << " " << v.y << " " << v.z << endl; - } - mOutput << endl; - - // now write all mesh instances - for(const MeshInstance& m : mMeshes) { - mOutput << "# Mesh \'" << m.name << "\' with " << m.faces.size() << " faces" << endl; - if (!m.name.empty()) { - mOutput << "g " << m.name << endl; - } - if ( !noMtl ) { - mOutput << "usemtl " << m.matname << endl; - } - - for(const Face& f : m.faces) { - mOutput << f.kind << ' '; - for(const FaceVertex& fv : f.indices) { - mOutput << ' ' << fv.vp; - - if (f.kind != 'p') { - if (fv.vt || f.kind == 'f') { - mOutput << '/'; - } - if (fv.vt) { - mOutput << fv.vt; - } - if (f.kind == 'f' && fv.vn) { - mOutput << '/' << fv.vn; - } - } - } - - mOutput << endl; - } - mOutput << endl; - } -} - -// ------------------------------------------------------------------------------------------------ -void ObjExporter::AddMesh(const aiString& name, const aiMesh* m, const aiMatrix4x4& mat) { - mMeshes.push_back(MeshInstance() ); - MeshInstance& mesh = mMeshes.back(); - - if ( nullptr != m->mColors[ 0 ] ) { - useVc = true; - } - - mesh.name = std::string( name.data, name.length ); - mesh.matname = GetMaterialName(m->mMaterialIndex); - - mesh.faces.resize(m->mNumFaces); - - for(unsigned int i = 0; i < m->mNumFaces; ++i) { - const aiFace& f = m->mFaces[i]; - - Face& face = mesh.faces[i]; - switch (f.mNumIndices) { - case 1: - face.kind = 'p'; - break; - case 2: - face.kind = 'l'; - break; - default: - face.kind = 'f'; - } - face.indices.resize(f.mNumIndices); - - for(unsigned int a = 0; a < f.mNumIndices; ++a) { - const unsigned int idx = f.mIndices[a]; - - aiVector3D vert = mat * m->mVertices[idx]; - - if ( nullptr != m->mColors[ 0 ] ) { - aiColor4D col4 = m->mColors[ 0 ][ idx ]; - face.indices[a].vp = mVpMap.getIndex({vert, aiColor3D(col4.r, col4.g, col4.b)}); - } else { - face.indices[a].vp = mVpMap.getIndex({vert, aiColor3D(0,0,0)}); - } - - if (m->mNormals) { - aiVector3D norm = aiMatrix3x3(mat) * m->mNormals[idx]; - face.indices[a].vn = mVnMap.getIndex(norm); - } else { - face.indices[a].vn = 0; - } - - if ( m->mTextureCoords[ 0 ] ) { - face.indices[a].vt = mVtMap.getIndex(m->mTextureCoords[0][idx]); - } else { - face.indices[a].vt = 0; - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -void ObjExporter::AddNode(const aiNode* nd, const aiMatrix4x4& mParent) { - const aiMatrix4x4& mAbs = mParent * nd->mTransformation; - - aiMesh *cm( nullptr ); - for(unsigned int i = 0; i < nd->mNumMeshes; ++i) { - cm = pScene->mMeshes[nd->mMeshes[i]]; - if (nullptr != cm) { - AddMesh(cm->mName, pScene->mMeshes[nd->mMeshes[i]], mAbs); - } else { - AddMesh(nd->mName, pScene->mMeshes[nd->mMeshes[i]], mAbs); - } - } - - for(unsigned int i = 0; i < nd->mNumChildren; ++i) { - AddNode(nd->mChildren[i], mAbs); - } -} - -// ------------------------------------------------------------------------------------------------ - -#endif // ASSIMP_BUILD_NO_OBJ_EXPORTER -#endif // ASSIMP_BUILD_NO_EXPORT diff --git a/Engine/lib/assimp/code/ObjExporter.h b/Engine/lib/assimp/code/ObjExporter.h deleted file mode 100644 index 0d2b48d6b..000000000 --- a/Engine/lib/assimp/code/ObjExporter.h +++ /dev/null @@ -1,190 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 ObjExporter.h - * Declares the exporter class to write a scene to a Collada file - */ -#ifndef AI_OBJEXPORTER_H_INC -#define AI_OBJEXPORTER_H_INC - -#include -#include -#include -#include - -struct aiScene; -struct aiNode; -struct aiMesh; - -namespace Assimp { - -// ------------------------------------------------------------------------------------------------ -/** Helper class to export a given scene to an OBJ file. */ -// ------------------------------------------------------------------------------------------------ -class ObjExporter { -public: - /// Constructor for a specific scene to export - ObjExporter(const char* filename, const aiScene* pScene, bool noMtl=false); - ~ObjExporter(); - std::string GetMaterialLibName(); - std::string GetMaterialLibFileName(); - - /// public string-streams to write all output into - std::ostringstream mOutput, mOutputMat; - -private: - // intermediate data structures - struct FaceVertex { - FaceVertex() - : vp() - , vn() - , vt() { - // empty - } - - // one-based, 0 means: 'does not exist' - unsigned int vp, vn, vt; - }; - - struct Face { - char kind; - std::vector indices; - }; - - struct MeshInstance { - std::string name, matname; - std::vector faces; - }; - - void WriteHeader(std::ostringstream& out); - void WriteMaterialFile(); - void WriteGeometryFile(bool noMtl=false); - std::string GetMaterialName(unsigned int index); - void AddMesh(const aiString& name, const aiMesh* m, const aiMatrix4x4& mat); - void AddNode(const aiNode* nd, const aiMatrix4x4& mParent); - -private: - std::string filename; - const aiScene* const pScene; - - struct vertexData { - aiVector3D vp; - aiColor3D vc; // OBJ does not support 4D color - }; - - std::vector vn, vt; - std::vector vc; - std::vector vp; - bool useVc; - - struct vertexDataCompare { - bool operator() ( const vertexData& a, const vertexData& b ) const { - // position - if (a.vp.x < b.vp.x) return true; - if (a.vp.x > b.vp.x) return false; - if (a.vp.y < b.vp.y) return true; - if (a.vp.y > b.vp.y) return false; - if (a.vp.z < b.vp.z) return true; - if (a.vp.z > b.vp.z) return false; - - // color - if (a.vc.r < b.vc.r) return true; - if (a.vc.r > b.vc.r) return false; - if (a.vc.g < b.vc.g) return true; - if (a.vc.g > b.vc.g) return false; - if (a.vc.b < b.vc.b) return true; - if (a.vc.b > b.vc.b) return false; - return false; - } - }; - - struct aiVectorCompare { - bool operator() (const aiVector3D& a, const aiVector3D& b) const { - if(a.x < b.x) return true; - if(a.x > b.x) return false; - if(a.y < b.y) return true; - if(a.y > b.y) return false; - if(a.z < b.z) return true; - return false; - } - }; - - template > - class indexMap { - int mNextIndex; - typedef std::map dataType; - dataType vecMap; - - public: - indexMap() - : mNextIndex(1) { - // empty - } - - int getIndex(const T& key) { - typename dataType::iterator vertIt = vecMap.find(key); - // vertex already exists, so reference it - if(vertIt != vecMap.end()){ - return vertIt->second; - } - return vecMap[key] = mNextIndex++; - }; - - void getKeys( std::vector& keys ) { - keys.resize(vecMap.size()); - for(typename dataType::iterator it = vecMap.begin(); it != vecMap.end(); ++it){ - keys[it->second-1] = it->first; - } - }; - }; - - indexMap mVnMap, mVtMap; - indexMap mVpMap; - std::vector mMeshes; - - // this endl() doesn't flush() the stream - const std::string endl; -}; - -} - -#endif diff --git a/Engine/lib/assimp/code/ObjFileData.h b/Engine/lib/assimp/code/ObjFileData.h deleted file mode 100644 index 5ff9db68c..000000000 --- a/Engine/lib/assimp/code/ObjFileData.h +++ /dev/null @@ -1,336 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 OBJ_FILEDATA_H_INC -#define OBJ_FILEDATA_H_INC - -#include -#include -#include -#include - -namespace Assimp { -namespace ObjFile { - -struct Object; -struct Face; -struct Material; - -// ------------------------------------------------------------------------------------------------ -//! \struct Face -//! \brief Data structure for a simple obj-face, describes discredit,l.ation and materials -// ------------------------------------------------------------------------------------------------ -struct Face { - typedef std::vector IndexArray; - - //! Primitive type - aiPrimitiveType m_PrimitiveType; - //! Vertex indices - IndexArray m_vertices; - //! Normal indices - IndexArray m_normals; - //! Texture coordinates indices - IndexArray m_texturCoords; - //! Pointer to assigned material - Material *m_pMaterial; - - //! \brief Default constructor - Face( aiPrimitiveType pt = aiPrimitiveType_POLYGON) - : m_PrimitiveType( pt ) - , m_vertices() - , m_normals() - , m_texturCoords() - , m_pMaterial( 0L ) { - // empty - } - - //! \brief Destructor - ~Face() { - // empty - } -}; - -// ------------------------------------------------------------------------------------------------ -//! \struct Object -//! \brief Stores all objects of an obj-file object definition -// ------------------------------------------------------------------------------------------------ -struct Object { - enum ObjectType { - ObjType, - GroupType - }; - - //! Object name - std::string m_strObjName; - //! Transformation matrix, stored in OpenGL format - aiMatrix4x4 m_Transformation; - //! All sub-objects referenced by this object - std::vector m_SubObjects; - /// Assigned meshes - std::vector m_Meshes; - - //! \brief Default constructor - Object() - : m_strObjName("") { - // empty - } - - //! \brief Destructor - ~Object() { - for ( std::vector::iterator it = m_SubObjects.begin(); it != m_SubObjects.end(); ++it) { - delete *it; - } - } -}; - -// ------------------------------------------------------------------------------------------------ -//! \struct Material -//! \brief Data structure to store all material specific data -// ------------------------------------------------------------------------------------------------ -struct Material { - //! Name of material description - aiString MaterialName; - - //! Texture names - aiString texture; - aiString textureSpecular; - aiString textureAmbient; - aiString textureEmissive; - aiString textureBump; - aiString textureNormal; - aiString textureReflection[6]; - aiString textureSpecularity; - aiString textureOpacity; - aiString textureDisp; - - enum TextureType { - TextureDiffuseType = 0, - TextureSpecularType, - TextureAmbientType, - TextureEmissiveType, - TextureBumpType, - TextureNormalType, - TextureReflectionSphereType, - TextureReflectionCubeTopType, - TextureReflectionCubeBottomType, - TextureReflectionCubeFrontType, - TextureReflectionCubeBackType, - TextureReflectionCubeLeftType, - TextureReflectionCubeRightType, - TextureSpecularityType, - TextureOpacityType, - TextureDispType, - TextureTypeCount - }; - bool clamp[TextureTypeCount]; - - //! Ambient color - aiColor3D ambient; - //! Diffuse color - aiColor3D diffuse; - //! Specular color - aiColor3D specular; - //! Emissive color - aiColor3D emissive; - //! Alpha value - ai_real alpha; - //! Shineness factor - ai_real shineness; - //! Illumination model - int illumination_model; - //! Index of refraction - ai_real ior; - //! Transparency color - aiColor3D transparent; - - //! Constructor - Material() - : diffuse ( ai_real( 0.6 ), ai_real( 0.6 ), ai_real( 0.6 ) ) - , alpha (ai_real( 1.0 ) ) - , shineness ( ai_real( 0.0) ) - , illumination_model (1) - , ior ( ai_real( 1.0 ) ) - , transparent( ai_real( 1.0), ai_real (1.0), ai_real(1.0)) { - // empty - for (size_t i = 0; i < TextureTypeCount; ++i) { - clamp[ i ] = false; - } - } - - // Destructor - ~Material() { - // empty - } -}; - -// ------------------------------------------------------------------------------------------------ -//! \struct Mesh -//! \brief Data structure to store a mesh -// ------------------------------------------------------------------------------------------------ -struct Mesh { - static const unsigned int NoMaterial = ~0u; - /// The name for the mesh - std::string m_name; - /// Array with pointer to all stored faces - std::vector m_Faces; - /// Assigned material - Material *m_pMaterial; - /// Number of stored indices. - unsigned int m_uiNumIndices; - /// Number of UV - unsigned int m_uiUVCoordinates[ AI_MAX_NUMBER_OF_TEXTURECOORDS ]; - /// Material index. - unsigned int m_uiMaterialIndex; - /// True, if normals are stored. - bool m_hasNormals; - /// True, if vertex colors are stored. - bool m_hasVertexColors; - - /// Constructor - explicit Mesh( const std::string &name ) - : m_name( name ) - , m_pMaterial(NULL) - , m_uiNumIndices(0) - , m_uiMaterialIndex( NoMaterial ) - , m_hasNormals(false) { - memset(m_uiUVCoordinates, 0, sizeof( unsigned int ) * AI_MAX_NUMBER_OF_TEXTURECOORDS); - } - - /// Destructor - ~Mesh() { - for (std::vector::iterator it = m_Faces.begin(); - it != m_Faces.end(); ++it) - { - delete *it; - } - } -}; - -// ------------------------------------------------------------------------------------------------ -//! \struct Model -//! \brief Data structure to store all obj-specific model datas -// ------------------------------------------------------------------------------------------------ -struct Model { - typedef std::map* > GroupMap; - typedef std::map* >::iterator GroupMapIt; - typedef std::map* >::const_iterator ConstGroupMapIt; - - //! Model name - std::string m_ModelName; - //! List ob assigned objects - std::vector m_Objects; - //! Pointer to current object - ObjFile::Object *m_pCurrent; - //! Pointer to current material - ObjFile::Material *m_pCurrentMaterial; - //! Pointer to default material - ObjFile::Material *m_pDefaultMaterial; - //! Vector with all generated materials - std::vector m_MaterialLib; - //! Vector with all generated vertices - std::vector m_Vertices; - //! vector with all generated normals - std::vector m_Normals; - //! vector with all vertex colors - std::vector m_VertexColors; - //! Group map - GroupMap m_Groups; - //! Group to face id assignment - std::vector *m_pGroupFaceIDs; - //! Active group - std::string m_strActiveGroup; - //! Vector with generated texture coordinates - std::vector m_TextureCoord; - //! Current mesh instance - Mesh *m_pCurrentMesh; - //! Vector with stored meshes - std::vector m_Meshes; - //! Material map - std::map m_MaterialMap; - - //! \brief The default class constructor - Model() : - m_ModelName(""), - m_pCurrent(NULL), - m_pCurrentMaterial(NULL), - m_pDefaultMaterial(NULL), - m_pGroupFaceIDs(NULL), - m_strActiveGroup(""), - m_pCurrentMesh(NULL) - { - // empty - } - - //! \brief The class destructor - ~Model() { - // Clear all stored object instances - for (std::vector::iterator it = m_Objects.begin(); - it != m_Objects.end(); ++it) { - delete *it; - } - m_Objects.clear(); - - // Clear all stored mesh instances - for (std::vector::iterator it = m_Meshes.begin(); - it != m_Meshes.end(); ++it) { - delete *it; - } - m_Meshes.clear(); - - for(GroupMapIt it = m_Groups.begin(); it != m_Groups.end(); ++it) { - delete it->second; - } - m_Groups.clear(); - - for ( std::map::iterator it = m_MaterialMap.begin(); it != m_MaterialMap.end(); ++it ) { - delete it->second; - } - } -}; - -// ------------------------------------------------------------------------------------------------ - -} // Namespace ObjFile -} // Namespace Assimp - -#endif // OBJ_FILEDATA_H_INC diff --git a/Engine/lib/assimp/code/ObjFileImporter.cpp b/Engine/lib/assimp/code/ObjFileImporter.cpp deleted file mode 100644 index 814180c81..000000000 --- a/Engine/lib/assimp/code/ObjFileImporter.cpp +++ /dev/null @@ -1,787 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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_OBJ_IMPORTER - -#include "ObjFileImporter.h" -#include "ObjFileParser.h" -#include "ObjFileData.h" -#include -#include -#include -#include -#include -#include -#include -#include - -static const aiImporterDesc desc = { - "Wavefront Object Importer", - "", - "", - "surfaces not supported", - aiImporterFlags_SupportTextFlavour, - 0, - 0, - 0, - 0, - "obj" -}; - -static const unsigned int ObjMinSize = 16; - -namespace Assimp { - -using namespace std; - -// ------------------------------------------------------------------------------------------------ -// Default constructor -ObjFileImporter::ObjFileImporter() -: m_Buffer() -, m_pRootObject( nullptr ) -, m_strAbsPath( "" ) { - DefaultIOSystem io; - m_strAbsPath = io.getOsSeparator(); -} - -// ------------------------------------------------------------------------------------------------ -// Destructor. -ObjFileImporter::~ObjFileImporter() { - delete m_pRootObject; - m_pRootObject = nullptr; -} - -// ------------------------------------------------------------------------------------------------ -// Returns true, if file is an obj file. -bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler , bool checkSig ) const { - if(!checkSig) { - //Check File Extension - return SimpleExtensionCheck(pFile,"obj"); - } else { - // Check file Header - static const char *pTokens[] = { "mtllib", "usemtl", "v ", "vt ", "vn ", "o ", "g ", "s ", "f " }; - return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 9, 200, false, true ); - } -} - -// ------------------------------------------------------------------------------------------------ -const aiImporterDesc* ObjFileImporter::GetInfo() const { - return &desc; -} - -// ------------------------------------------------------------------------------------------------ -// Obj-file import implementation -void ObjFileImporter::InternReadFile( const std::string &file, aiScene* pScene, IOSystem* pIOHandler) { - // Read file into memory - static const std::string mode = "rb"; - std::unique_ptr fileStream( pIOHandler->Open( file, mode)); - if( !fileStream.get() ) { - throw DeadlyImportError( "Failed to open file " + file + "." ); - } - - // Get the file-size and validate it, throwing an exception when fails - size_t fileSize = fileStream->FileSize(); - if( fileSize < ObjMinSize ) { - throw DeadlyImportError( "OBJ-file is too small."); - } - - IOStreamBuffer streamedBuffer; - streamedBuffer.open( fileStream.get() ); - - // Allocate buffer and read file into it - //TextFileToBuffer( fileStream.get(),m_Buffer); - - // Get the model name - std::string modelName, folderName; - std::string::size_type pos = file.find_last_of( "\\/" ); - if ( pos != std::string::npos ) { - modelName = file.substr(pos+1, file.size() - pos - 1); - folderName = file.substr( 0, pos ); - if ( !folderName.empty() ) { - pIOHandler->PushDirectory( folderName ); - } - } else { - modelName = file; - } - - // parse the file into a temporary representation - ObjFileParser parser( streamedBuffer, modelName, pIOHandler, m_progress, file); - - // And create the proper return structures out of it - CreateDataFromImport(parser.GetModel(), pScene); - - streamedBuffer.close(); - - // Clean up allocated storage for the next import - m_Buffer.clear(); - - // Pop directory stack - if ( pIOHandler->StackSize() > 0 ) { - pIOHandler->PopDirectory(); - } -} - -// ------------------------------------------------------------------------------------------------ -// Create the data from parsed obj-file -void ObjFileImporter::CreateDataFromImport(const ObjFile::Model* pModel, aiScene* pScene) { - if( 0L == pModel ) { - return; - } - - // Create the root node of the scene - pScene->mRootNode = new aiNode; - if ( !pModel->m_ModelName.empty() ) { - // Set the name of the scene - pScene->mRootNode->mName.Set(pModel->m_ModelName); - } else { - // This is a fatal error, so break down the application - ai_assert(false); - } - - if (pModel->m_Objects.size() > 0) { - - unsigned int meshCount = 0; - unsigned int childCount = 0; - - for(size_t index = 0; index < pModel->m_Objects.size(); ++index) { - if(pModel->m_Objects[index]) { - ++childCount; - meshCount += (unsigned int)pModel->m_Objects[index]->m_Meshes.size(); - } - } - - // Allocate space for the child nodes on the root node - pScene->mRootNode->mChildren = new aiNode*[ childCount ]; - - // Create nodes for the whole scene - std::vector MeshArray; - MeshArray.reserve(meshCount); - for (size_t index = 0; index < pModel->m_Objects.size(); ++index) { - createNodes(pModel, pModel->m_Objects[index], pScene->mRootNode, pScene, MeshArray); - } - - ai_assert(pScene->mRootNode->mNumChildren == childCount); - - // Create mesh pointer buffer for this scene - if (pScene->mNumMeshes > 0) { - pScene->mMeshes = new aiMesh*[MeshArray.size()]; - for (size_t index = 0; index < MeshArray.size(); ++index) { - pScene->mMeshes[index] = MeshArray[index]; - } - } - - // Create all materials - createMaterials(pModel, pScene); - }else { - if (pModel->m_Vertices.empty()){ - return; - } - - std::unique_ptr mesh( new aiMesh ); - mesh->mPrimitiveTypes = aiPrimitiveType_POINT; - unsigned int n = (unsigned int)pModel->m_Vertices.size(); - mesh->mNumVertices = n; - - mesh->mVertices = new aiVector3D[n]; - memcpy(mesh->mVertices, pModel->m_Vertices.data(), n*sizeof(aiVector3D) ); - - if ( !pModel->m_Normals.empty() ) { - mesh->mNormals = new aiVector3D[n]; - if (pModel->m_Normals.size() < n) { - throw DeadlyImportError("OBJ: vertex normal index out of range"); - } - memcpy(mesh->mNormals, pModel->m_Normals.data(), n*sizeof(aiVector3D)); - } - - if ( !pModel->m_VertexColors.empty() ){ - mesh->mColors[0] = new aiColor4D[mesh->mNumVertices]; - for (unsigned int i = 0; i < n; ++i) { - if (i < pModel->m_VertexColors.size() ) { - const aiVector3D& color = pModel->m_VertexColors[i]; - mesh->mColors[0][i] = aiColor4D(color.x, color.y, color.z, 1.0); - }else { - throw DeadlyImportError("OBJ: vertex color index out of range"); - } - } - } - - pScene->mRootNode->mNumMeshes = 1; - pScene->mRootNode->mMeshes = new unsigned int[1]; - pScene->mRootNode->mMeshes[0] = 0; - pScene->mMeshes = new aiMesh*[1]; - pScene->mNumMeshes = 1; - pScene->mMeshes[0] = mesh.release(); - } -} - -// ------------------------------------------------------------------------------------------------ -// Creates all nodes of the model -aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile::Object* pObject, - aiNode *pParent, aiScene* pScene, - std::vector &MeshArray ) -{ - ai_assert( NULL != pModel ); - if( NULL == pObject ) { - return NULL; - } - - // Store older mesh size to be able to computes mesh offsets for new mesh instances - const size_t oldMeshSize = MeshArray.size(); - aiNode *pNode = new aiNode; - - pNode->mName = pObject->m_strObjName; - - // If we have a parent node, store it - ai_assert( NULL != pParent ); - appendChildToParentNode( pParent, pNode ); - - for ( size_t i=0; i< pObject->m_Meshes.size(); ++i ) { - unsigned int meshId = pObject->m_Meshes[ i ]; - aiMesh *pMesh = createTopology( pModel, pObject, meshId ); - if( pMesh ) { - if (pMesh->mNumFaces > 0) { - MeshArray.push_back( pMesh ); - } else { - delete pMesh; - } - } - } - - // Create all nodes from the sub-objects stored in the current object - if ( !pObject->m_SubObjects.empty() ) { - size_t numChilds = pObject->m_SubObjects.size(); - pNode->mNumChildren = static_cast( numChilds ); - pNode->mChildren = new aiNode*[ numChilds ]; - pNode->mNumMeshes = 1; - pNode->mMeshes = new unsigned int[ 1 ]; - } - - // Set mesh instances into scene- and node-instances - const size_t meshSizeDiff = MeshArray.size()- oldMeshSize; - if ( meshSizeDiff > 0 ) { - pNode->mMeshes = new unsigned int[ meshSizeDiff ]; - pNode->mNumMeshes = static_cast( meshSizeDiff ); - size_t index = 0; - for (size_t i = oldMeshSize; i < MeshArray.size(); ++i ) { - pNode->mMeshes[ index ] = pScene->mNumMeshes; - pScene->mNumMeshes++; - ++index; - } - } - - return pNode; -} - -// ------------------------------------------------------------------------------------------------ -// Create topology data -aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData, unsigned int meshIndex ) { - // Checking preconditions - ai_assert( NULL != pModel ); - - if( NULL == pData ) { - return NULL; - } - - // Create faces - ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ meshIndex ]; - if( !pObjMesh ) { - return NULL; - } - - if( pObjMesh->m_Faces.empty() ) { - return NULL; - } - - std::unique_ptr pMesh(new aiMesh); - if( !pObjMesh->m_name.empty() ) { - pMesh->mName.Set( pObjMesh->m_name ); - } - - for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++) - { - ObjFile::Face *const inp = pObjMesh->m_Faces[ index ]; - ai_assert( NULL != inp ); - - if (inp->m_PrimitiveType == aiPrimitiveType_LINE) { - pMesh->mNumFaces += static_cast(inp->m_vertices.size() - 1); - pMesh->mPrimitiveTypes |= aiPrimitiveType_LINE; - } else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) { - pMesh->mNumFaces += static_cast(inp->m_vertices.size()); - pMesh->mPrimitiveTypes |= aiPrimitiveType_POINT; - } else { - ++pMesh->mNumFaces; - if (inp->m_vertices.size() > 3) { - pMesh->mPrimitiveTypes |= aiPrimitiveType_POLYGON; - } else { - pMesh->mPrimitiveTypes |= aiPrimitiveType_TRIANGLE; - } - } - } - - unsigned int uiIdxCount( 0u ); - if ( pMesh->mNumFaces > 0 ) { - pMesh->mFaces = new aiFace[ pMesh->mNumFaces ]; - if ( pObjMesh->m_uiMaterialIndex != ObjFile::Mesh::NoMaterial ) { - pMesh->mMaterialIndex = pObjMesh->m_uiMaterialIndex; - } - - unsigned int outIndex( 0 ); - - // Copy all data from all stored meshes - for (size_t index = 0; index < pObjMesh->m_Faces.size(); index++) { - ObjFile::Face* const inp = pObjMesh->m_Faces[ index ]; - if (inp->m_PrimitiveType == aiPrimitiveType_LINE) { - for(size_t i = 0; i < inp->m_vertices.size() - 1; ++i) { - aiFace& f = pMesh->mFaces[ outIndex++ ]; - uiIdxCount += f.mNumIndices = 2; - f.mIndices = new unsigned int[2]; - } - continue; - } - else if (inp->m_PrimitiveType == aiPrimitiveType_POINT) { - for(size_t i = 0; i < inp->m_vertices.size(); ++i) { - aiFace& f = pMesh->mFaces[ outIndex++ ]; - uiIdxCount += f.mNumIndices = 1; - f.mIndices = new unsigned int[1]; - } - continue; - } - - aiFace *pFace = &pMesh->mFaces[ outIndex++ ]; - const unsigned int uiNumIndices = (unsigned int) pObjMesh->m_Faces[ index ]->m_vertices.size(); - uiIdxCount += pFace->mNumIndices = (unsigned int) uiNumIndices; - if (pFace->mNumIndices > 0) { - pFace->mIndices = new unsigned int[ uiNumIndices ]; - } - } - } - - // Create mesh vertices - createVertexArray(pModel, pData, meshIndex, pMesh.get(), uiIdxCount); - - return pMesh.release(); -} - -// ------------------------------------------------------------------------------------------------ -// Creates a vertex array -void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel, - const ObjFile::Object* pCurrentObject, - unsigned int uiMeshIndex, - aiMesh* pMesh, - unsigned int numIndices) { - // Checking preconditions - ai_assert( NULL != pCurrentObject ); - - // Break, if no faces are stored in object - if ( pCurrentObject->m_Meshes.empty() ) - return; - - // Get current mesh - ObjFile::Mesh *pObjMesh = pModel->m_Meshes[ uiMeshIndex ]; - if ( NULL == pObjMesh || pObjMesh->m_uiNumIndices < 1 ) { - return; - } - - // Copy vertices of this mesh instance - pMesh->mNumVertices = numIndices; - if (pMesh->mNumVertices == 0) { - throw DeadlyImportError( "OBJ: no vertices" ); - } else if (pMesh->mNumVertices > AI_MAX_VERTICES) { - throw DeadlyImportError( "OBJ: Too many vertices" ); - } - pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ]; - - // Allocate buffer for normal vectors - if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals ) - pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ]; - - // Allocate buffer for vertex-color vectors - if ( !pModel->m_VertexColors.empty() ) - pMesh->mColors[0] = new aiColor4D[ pMesh->mNumVertices ]; - - // Allocate buffer for texture coordinates - if ( !pModel->m_TextureCoord.empty() && pObjMesh->m_uiUVCoordinates[0] ) - { - pMesh->mNumUVComponents[ 0 ] = 2; - pMesh->mTextureCoords[ 0 ] = new aiVector3D[ pMesh->mNumVertices ]; - } - - // Copy vertices, normals and textures into aiMesh instance - bool normalsok = true, uvok = true; - unsigned int newIndex = 0, outIndex = 0; - for ( size_t index=0; index < pObjMesh->m_Faces.size(); index++ ) { - // Get source face - ObjFile::Face *pSourceFace = pObjMesh->m_Faces[ index ]; - - // Copy all index arrays - for ( size_t vertexIndex = 0, outVertexIndex = 0; vertexIndex < pSourceFace->m_vertices.size(); vertexIndex++ ) { - const unsigned int vertex = pSourceFace->m_vertices.at( vertexIndex ); - if ( vertex >= pModel->m_Vertices.size() ) { - throw DeadlyImportError( "OBJ: vertex index out of range" ); - } - - if ( pMesh->mNumVertices <= newIndex ) { - throw DeadlyImportError("OBJ: bad vertex index"); - } - - pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ]; - - // Copy all normals - if ( normalsok && !pModel->m_Normals.empty() && vertexIndex < pSourceFace->m_normals.size()) { - const unsigned int normal = pSourceFace->m_normals.at( vertexIndex ); - if ( normal >= pModel->m_Normals.size() ) - { - normalsok = false; - } - else - { - pMesh->mNormals[ newIndex ] = pModel->m_Normals[ normal ]; - } - } - - // Copy all vertex colors - if ( !pModel->m_VertexColors.empty()) - { - const aiVector3D& color = pModel->m_VertexColors[ vertex ]; - pMesh->mColors[0][ newIndex ] = aiColor4D(color.x, color.y, color.z, 1.0); - } - - // Copy all texture coordinates - if ( uvok && !pModel->m_TextureCoord.empty() && vertexIndex < pSourceFace->m_texturCoords.size()) - { - const unsigned int tex = pSourceFace->m_texturCoords.at( vertexIndex ); - - if ( tex >= pModel->m_TextureCoord.size() ) - { - uvok = false; - } - else - { - const aiVector3D &coord3d = pModel->m_TextureCoord[ tex ]; - pMesh->mTextureCoords[ 0 ][ newIndex ] = aiVector3D( coord3d.x, coord3d.y, coord3d.z ); - } - } - - // Get destination face - aiFace *pDestFace = &pMesh->mFaces[ outIndex ]; - - const bool last = ( vertexIndex == pSourceFace->m_vertices.size() - 1 ); - if (pSourceFace->m_PrimitiveType != aiPrimitiveType_LINE || !last) { - pDestFace->mIndices[ outVertexIndex ] = newIndex; - outVertexIndex++; - } - - if (pSourceFace->m_PrimitiveType == aiPrimitiveType_POINT) { - outIndex++; - outVertexIndex = 0; - } else if (pSourceFace->m_PrimitiveType == aiPrimitiveType_LINE) { - outVertexIndex = 0; - - if(!last) - outIndex++; - - if (vertexIndex) { - if(!last) { - pMesh->mVertices[ newIndex+1 ] = pMesh->mVertices[ newIndex ]; - if ( !pSourceFace->m_normals.empty() && !pModel->m_Normals.empty()) { - pMesh->mNormals[ newIndex+1 ] = pMesh->mNormals[newIndex ]; - } - if ( !pModel->m_TextureCoord.empty() ) { - for ( size_t i=0; i < pMesh->GetNumUVChannels(); i++ ) { - pMesh->mTextureCoords[ i ][ newIndex+1 ] = pMesh->mTextureCoords[ i ][ newIndex ]; - } - } - ++newIndex; - } - - pDestFace[-1].mIndices[1] = newIndex; - } - } - else if (last) { - outIndex++; - } - ++newIndex; - } - } - - if (!normalsok) - { - delete [] pMesh->mNormals; - pMesh->mNormals = nullptr; - } - - if (!uvok) - { - delete [] pMesh->mTextureCoords[0]; - pMesh->mTextureCoords[0] = nullptr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Counts all stored meshes -void ObjFileImporter::countObjects(const std::vector &rObjects, int &iNumMeshes) -{ - iNumMeshes = 0; - if ( rObjects.empty() ) - return; - - iNumMeshes += static_cast( rObjects.size() ); - for (std::vector::const_iterator it = rObjects.begin(); - it != rObjects.end(); - ++it) - { - if (!(*it)->m_SubObjects.empty()) - { - countObjects((*it)->m_SubObjects, iNumMeshes); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Add clamp mode property to material if necessary -void ObjFileImporter::addTextureMappingModeProperty( aiMaterial* mat, aiTextureType type, int clampMode, int index) { - if ( nullptr == mat ) { - return; - } - - mat->AddProperty( &clampMode, 1, AI_MATKEY_MAPPINGMODE_U( type, index ) ); - mat->AddProperty( &clampMode, 1, AI_MATKEY_MAPPINGMODE_V( type, index ) ); -} - -// ------------------------------------------------------------------------------------------------ -// Creates the material -void ObjFileImporter::createMaterials(const ObjFile::Model* pModel, aiScene* pScene ) { - if ( NULL == pScene ) { - return; - } - - const unsigned int numMaterials = (unsigned int) pModel->m_MaterialLib.size(); - pScene->mNumMaterials = 0; - if ( pModel->m_MaterialLib.empty() ) { - ASSIMP_LOG_DEBUG("OBJ: no materials specified"); - return; - } - - pScene->mMaterials = new aiMaterial*[ numMaterials ]; - for ( unsigned int matIndex = 0; matIndex < numMaterials; matIndex++ ) - { - // Store material name - std::map::const_iterator it; - it = pModel->m_MaterialMap.find( pModel->m_MaterialLib[ matIndex ] ); - - // No material found, use the default material - if ( pModel->m_MaterialMap.end() == it ) - continue; - - aiMaterial* mat = new aiMaterial; - ObjFile::Material *pCurrentMaterial = (*it).second; - mat->AddProperty( &pCurrentMaterial->MaterialName, AI_MATKEY_NAME ); - - // convert illumination model - int sm = 0; - switch (pCurrentMaterial->illumination_model) - { - case 0: - sm = aiShadingMode_NoShading; - break; - case 1: - sm = aiShadingMode_Gouraud; - break; - case 2: - sm = aiShadingMode_Phong; - break; - default: - sm = aiShadingMode_Gouraud; - ASSIMP_LOG_ERROR("OBJ: unexpected illumination model (0-2 recognized)"); - } - - mat->AddProperty( &sm, 1, AI_MATKEY_SHADING_MODEL); - - // Adding material colors - mat->AddProperty( &pCurrentMaterial->ambient, 1, AI_MATKEY_COLOR_AMBIENT ); - mat->AddProperty( &pCurrentMaterial->diffuse, 1, AI_MATKEY_COLOR_DIFFUSE ); - mat->AddProperty( &pCurrentMaterial->specular, 1, AI_MATKEY_COLOR_SPECULAR ); - mat->AddProperty( &pCurrentMaterial->emissive, 1, AI_MATKEY_COLOR_EMISSIVE ); - mat->AddProperty( &pCurrentMaterial->shineness, 1, AI_MATKEY_SHININESS ); - mat->AddProperty( &pCurrentMaterial->alpha, 1, AI_MATKEY_OPACITY ); - mat->AddProperty( &pCurrentMaterial->transparent,1,AI_MATKEY_COLOR_TRANSPARENT); - - // Adding refraction index - mat->AddProperty( &pCurrentMaterial->ior, 1, AI_MATKEY_REFRACTI ); - - // Adding textures - const int uvwIndex = 0; - - if ( 0 != pCurrentMaterial->texture.length ) - { - mat->AddProperty( &pCurrentMaterial->texture, AI_MATKEY_TEXTURE_DIFFUSE(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_DIFFUSE(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureDiffuseType]) - { - addTextureMappingModeProperty(mat, aiTextureType_DIFFUSE); - } - } - - if ( 0 != pCurrentMaterial->textureAmbient.length ) - { - mat->AddProperty( &pCurrentMaterial->textureAmbient, AI_MATKEY_TEXTURE_AMBIENT(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_AMBIENT(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureAmbientType]) - { - addTextureMappingModeProperty(mat, aiTextureType_AMBIENT); - } - } - - if ( 0 != pCurrentMaterial->textureEmissive.length ) - { - mat->AddProperty( &pCurrentMaterial->textureEmissive, AI_MATKEY_TEXTURE_EMISSIVE(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_EMISSIVE(0) ); - } - - if ( 0 != pCurrentMaterial->textureSpecular.length ) - { - mat->AddProperty( &pCurrentMaterial->textureSpecular, AI_MATKEY_TEXTURE_SPECULAR(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_SPECULAR(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureSpecularType]) - { - addTextureMappingModeProperty(mat, aiTextureType_SPECULAR); - } - } - - if ( 0 != pCurrentMaterial->textureBump.length ) - { - mat->AddProperty( &pCurrentMaterial->textureBump, AI_MATKEY_TEXTURE_HEIGHT(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_HEIGHT(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureBumpType]) - { - addTextureMappingModeProperty(mat, aiTextureType_HEIGHT); - } - } - - if ( 0 != pCurrentMaterial->textureNormal.length ) - { - mat->AddProperty( &pCurrentMaterial->textureNormal, AI_MATKEY_TEXTURE_NORMALS(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_NORMALS(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureNormalType]) - { - addTextureMappingModeProperty(mat, aiTextureType_NORMALS); - } - } - - if( 0 != pCurrentMaterial->textureReflection[0].length ) - { - ObjFile::Material::TextureType type = 0 != pCurrentMaterial->textureReflection[1].length ? - ObjFile::Material::TextureReflectionCubeTopType : - ObjFile::Material::TextureReflectionSphereType; - - unsigned count = type == ObjFile::Material::TextureReflectionSphereType ? 1 : 6; - for( unsigned i = 0; i < count; i++ ) - { - mat->AddProperty(&pCurrentMaterial->textureReflection[i], AI_MATKEY_TEXTURE_REFLECTION(i)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_REFLECTION(i) ); - - if(pCurrentMaterial->clamp[type]) - addTextureMappingModeProperty(mat, aiTextureType_REFLECTION, 1, i); - } - } - - if ( 0 != pCurrentMaterial->textureDisp.length ) - { - mat->AddProperty( &pCurrentMaterial->textureDisp, AI_MATKEY_TEXTURE_DISPLACEMENT(0) ); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_DISPLACEMENT(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureDispType]) - { - addTextureMappingModeProperty(mat, aiTextureType_DISPLACEMENT); - } - } - - if ( 0 != pCurrentMaterial->textureOpacity.length ) - { - mat->AddProperty( &pCurrentMaterial->textureOpacity, AI_MATKEY_TEXTURE_OPACITY(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_OPACITY(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureOpacityType]) - { - addTextureMappingModeProperty(mat, aiTextureType_OPACITY); - } - } - - if ( 0 != pCurrentMaterial->textureSpecularity.length ) - { - mat->AddProperty( &pCurrentMaterial->textureSpecularity, AI_MATKEY_TEXTURE_SHININESS(0)); - mat->AddProperty( &uvwIndex, 1, AI_MATKEY_UVWSRC_SHININESS(0) ); - if (pCurrentMaterial->clamp[ObjFile::Material::TextureSpecularityType]) - { - addTextureMappingModeProperty(mat, aiTextureType_SHININESS); - } - } - - // Store material property info in material array in scene - pScene->mMaterials[ pScene->mNumMaterials ] = mat; - pScene->mNumMaterials++; - } - - // Test number of created materials. - ai_assert( pScene->mNumMaterials == numMaterials ); -} - -// ------------------------------------------------------------------------------------------------ -// Appends this node to the parent node -void ObjFileImporter::appendChildToParentNode(aiNode *pParent, aiNode *pChild) -{ - // Checking preconditions - ai_assert( NULL != pParent ); - ai_assert( NULL != pChild ); - - // Assign parent to child - pChild->mParent = pParent; - - // Copy node instances into parent node - pParent->mNumChildren++; - pParent->mChildren[ pParent->mNumChildren-1 ] = pChild; -} - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Assimp - -#endif // !! ASSIMP_BUILD_NO_OBJ_IMPORTER diff --git a/Engine/lib/assimp/code/ObjFileImporter.h b/Engine/lib/assimp/code/ObjFileImporter.h deleted file mode 100644 index 0df2ef731..000000000 --- a/Engine/lib/assimp/code/ObjFileImporter.h +++ /dev/null @@ -1,123 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 OBJ_FILE_IMPORTER_H_INC -#define OBJ_FILE_IMPORTER_H_INC - -#include -#include -#include - -struct aiMesh; -struct aiNode; - -namespace Assimp { - -namespace ObjFile { - struct Object; - struct Model; -} - -// ------------------------------------------------------------------------------------------------ -/// \class ObjFileImporter -/// \brief Imports a waveform obj file -// ------------------------------------------------------------------------------------------------ -class ObjFileImporter : public BaseImporter { -public: - /// \brief Default constructor - ObjFileImporter(); - - /// \brief Destructor - ~ObjFileImporter(); - -public: - /// \brief Returns whether the class can handle the format of the given file. - /// \remark See BaseImporter::CanRead() for details. - bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const; - -private: - //! \brief Appends the supported extension. - const aiImporterDesc* GetInfo () const; - - //! \brief File import implementation. - void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); - - //! \brief Create the data from imported content. - void CreateDataFromImport(const ObjFile::Model* pModel, aiScene* pScene); - - //! \brief Creates all nodes stored in imported content. - aiNode *createNodes(const ObjFile::Model* pModel, const ObjFile::Object* pData, - aiNode *pParent, aiScene* pScene, std::vector &MeshArray); - - //! \brief Creates topology data like faces and meshes for the geometry. - aiMesh *createTopology( const ObjFile::Model* pModel, const ObjFile::Object* pData, - unsigned int uiMeshIndex ); - - //! \brief Creates vertices from model. - void createVertexArray(const ObjFile::Model* pModel, const ObjFile::Object* pCurrentObject, - unsigned int uiMeshIndex, aiMesh* pMesh, unsigned int numIndices ); - - //! \brief Object counter helper method. - void countObjects(const std::vector &rObjects, int &iNumMeshes); - - //! \brief Material creation. - void createMaterials(const ObjFile::Model* pModel, aiScene* pScene); - - /// @brief Adds special property for the used texture mapping mode of the model. - void addTextureMappingModeProperty(aiMaterial* mat, aiTextureType type, int clampMode = 1, int index = 0); - - //! \brief Appends a child node to a parent node and updates the data structures. - void appendChildToParentNode(aiNode *pParent, aiNode *pChild); - -private: - //! Data buffer - std::vector m_Buffer; - //! Pointer to root object instance - ObjFile::Object *m_pRootObject; - //! Absolute pathname of model in file system - std::string m_strAbsPath; -}; - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Assimp - -#endif diff --git a/Engine/lib/assimp/code/ObjFileMtlImporter.cpp b/Engine/lib/assimp/code/ObjFileMtlImporter.cpp deleted file mode 100644 index dd9cc3ce2..000000000 --- a/Engine/lib/assimp/code/ObjFileMtlImporter.cpp +++ /dev/null @@ -1,494 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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_OBJ_IMPORTER - -#include -#include "ObjFileMtlImporter.h" -#include "ObjTools.h" -#include "ObjFileData.h" -#include -#include -#include -#include - -namespace Assimp { - -// Material specific token (case insensitive compare) -static const std::string DiffuseTexture = "map_Kd"; -static const std::string AmbientTexture = "map_Ka"; -static const std::string SpecularTexture = "map_Ks"; -static const std::string OpacityTexture = "map_d"; -static const std::string EmissiveTexture1 = "map_emissive"; -static const std::string EmissiveTexture2 = "map_Ke"; -static const std::string BumpTexture1 = "map_bump"; -static const std::string BumpTexture2 = "bump"; -static const std::string NormalTexture = "map_Kn"; -static const std::string ReflectionTexture = "refl"; -static const std::string DisplacementTexture1 = "map_disp"; -static const std::string DisplacementTexture2 = "disp"; -static const std::string SpecularityTexture = "map_ns"; - -// texture option specific token -static const std::string BlendUOption = "-blendu"; -static const std::string BlendVOption = "-blendv"; -static const std::string BoostOption = "-boost"; -static const std::string ModifyMapOption = "-mm"; -static const std::string OffsetOption = "-o"; -static const std::string ScaleOption = "-s"; -static const std::string TurbulenceOption = "-t"; -static const std::string ResolutionOption = "-texres"; -static const std::string ClampOption = "-clamp"; -static const std::string BumpOption = "-bm"; -static const std::string ChannelOption = "-imfchan"; -static const std::string TypeOption = "-type"; - -// ------------------------------------------------------------------- -// Constructor -ObjFileMtlImporter::ObjFileMtlImporter( std::vector &buffer, - const std::string &, - ObjFile::Model *pModel ) : - m_DataIt( buffer.begin() ), - m_DataItEnd( buffer.end() ), - m_pModel( pModel ), - m_uiLine( 0 ) -{ - ai_assert( NULL != m_pModel ); - if ( NULL == m_pModel->m_pDefaultMaterial ) - { - m_pModel->m_pDefaultMaterial = new ObjFile::Material; - m_pModel->m_pDefaultMaterial->MaterialName.Set( "default" ); - } - load(); -} - -// ------------------------------------------------------------------- -// Destructor -ObjFileMtlImporter::~ObjFileMtlImporter() -{ - // empty -} - -// ------------------------------------------------------------------- -// Private copy constructor -ObjFileMtlImporter::ObjFileMtlImporter(const ObjFileMtlImporter & ) -{ - // empty -} - -// ------------------------------------------------------------------- -// Private copy constructor -ObjFileMtlImporter &ObjFileMtlImporter::operator = ( const ObjFileMtlImporter & ) -{ - return *this; -} - -// ------------------------------------------------------------------- -// Loads the material description -void ObjFileMtlImporter::load() -{ - if ( m_DataIt == m_DataItEnd ) - return; - - while ( m_DataIt != m_DataItEnd ) - { - switch (*m_DataIt) - { - case 'k': - case 'K': - { - ++m_DataIt; - if (*m_DataIt == 'a') // Ambient color - { - ++m_DataIt; - getColorRGBA( &m_pModel->m_pCurrentMaterial->ambient ); - } - else if (*m_DataIt == 'd') // Diffuse color - { - ++m_DataIt; - getColorRGBA( &m_pModel->m_pCurrentMaterial->diffuse ); - } - else if (*m_DataIt == 's') - { - ++m_DataIt; - getColorRGBA( &m_pModel->m_pCurrentMaterial->specular ); - } - else if (*m_DataIt == 'e') - { - ++m_DataIt; - getColorRGBA( &m_pModel->m_pCurrentMaterial->emissive ); - } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - case 'T': - { - ++m_DataIt; - if (*m_DataIt == 'f') // Material transmission - { - ++m_DataIt; - getColorRGBA( &m_pModel->m_pCurrentMaterial->transparent); - } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - case 'd': - { - if( *(m_DataIt+1) == 'i' && *( m_DataIt + 2 ) == 's' && *( m_DataIt + 3 ) == 'p' ) { - // A displacement map - getTexture(); - } else { - // Alpha value - ++m_DataIt; - getFloatValue( m_pModel->m_pCurrentMaterial->alpha ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - } - break; - - case 'N': - case 'n': - { - ++m_DataIt; - switch(*m_DataIt) - { - case 's': // Specular exponent - ++m_DataIt; - getFloatValue(m_pModel->m_pCurrentMaterial->shineness); - break; - case 'i': // Index Of refraction - ++m_DataIt; - getFloatValue(m_pModel->m_pCurrentMaterial->ior); - break; - case 'e': // New material - createMaterial(); - break; - } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - - case 'm': // Texture - case 'b': // quick'n'dirty - for 'bump' sections - case 'r': // quick'n'dirty - for 'refl' sections - { - getTexture(); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - - case 'i': // Illumination model - { - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - getIlluminationModel( m_pModel->m_pCurrentMaterial->illumination_model ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - - default: - { - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - } - } -} - -// ------------------------------------------------------------------- -// Loads a color definition -void ObjFileMtlImporter::getColorRGBA( aiColor3D *pColor ) -{ - ai_assert( NULL != pColor ); - - ai_real r( 0.0 ), g( 0.0 ), b( 0.0 ); - m_DataIt = getFloat( m_DataIt, m_DataItEnd, r ); - pColor->r = r; - - // we have to check if color is default 0 with only one token - if( !IsLineEnd( *m_DataIt ) ) { - m_DataIt = getFloat( m_DataIt, m_DataItEnd, g ); - m_DataIt = getFloat( m_DataIt, m_DataItEnd, b ); - } - pColor->g = g; - pColor->b = b; -} - -// ------------------------------------------------------------------- -// Loads the kind of illumination model. -void ObjFileMtlImporter::getIlluminationModel( int &illum_model ) -{ - m_DataIt = CopyNextWord( m_DataIt, m_DataItEnd, m_buffer, BUFFERSIZE ); - illum_model = atoi(m_buffer); -} - -// ------------------------------------------------------------------- -// Loads a single float value. -void ObjFileMtlImporter::getFloatValue( ai_real &value ) -{ - m_DataIt = CopyNextWord( m_DataIt, m_DataItEnd, m_buffer, BUFFERSIZE ); - value = (ai_real) fast_atof(m_buffer); -} - -// ------------------------------------------------------------------- -// Creates a material from loaded data. -void ObjFileMtlImporter::createMaterial() -{ - std::string line( "" ); - while( !IsLineEnd( *m_DataIt ) ) { - line += *m_DataIt; - ++m_DataIt; - } - - std::vector token; - const unsigned int numToken = tokenize( line, token, " \t" ); - std::string name( "" ); - if ( numToken == 1 ) { - name = AI_DEFAULT_MATERIAL_NAME; - } else { - // skip newmtl and all following white spaces - std::size_t first_ws_pos = line.find_first_of(" \t"); - std::size_t first_non_ws_pos = line.find_first_not_of(" \t", first_ws_pos); - if (first_non_ws_pos != std::string::npos) { - name = line.substr(first_non_ws_pos); - } - } - - name = trim_whitespaces(name); - - std::map::iterator it = m_pModel->m_MaterialMap.find( name ); - if ( m_pModel->m_MaterialMap.end() == it) { - // New Material created - m_pModel->m_pCurrentMaterial = new ObjFile::Material(); - m_pModel->m_pCurrentMaterial->MaterialName.Set( name ); - m_pModel->m_MaterialLib.push_back( name ); - m_pModel->m_MaterialMap[ name ] = m_pModel->m_pCurrentMaterial; - - if (m_pModel->m_pCurrentMesh) { - m_pModel->m_pCurrentMesh->m_uiMaterialIndex = static_cast(m_pModel->m_MaterialLib.size() - 1); - } - } else { - // Use older material - m_pModel->m_pCurrentMaterial = (*it).second; - } -} - -// ------------------------------------------------------------------- -// Gets a texture name from data. -void ObjFileMtlImporter::getTexture() { - aiString *out( NULL ); - int clampIndex = -1; - - const char *pPtr( &(*m_DataIt) ); - if ( !ASSIMP_strincmp( pPtr, DiffuseTexture.c_str(), static_cast(DiffuseTexture.size()) ) ) { - // Diffuse texture - out = & m_pModel->m_pCurrentMaterial->texture; - clampIndex = ObjFile::Material::TextureDiffuseType; - } else if ( !ASSIMP_strincmp( pPtr,AmbientTexture.c_str(), static_cast(AmbientTexture.size()) ) ) { - // Ambient texture - out = & m_pModel->m_pCurrentMaterial->textureAmbient; - clampIndex = ObjFile::Material::TextureAmbientType; - } else if ( !ASSIMP_strincmp( pPtr, SpecularTexture.c_str(), static_cast(SpecularTexture.size()) ) ) { - // Specular texture - out = & m_pModel->m_pCurrentMaterial->textureSpecular; - clampIndex = ObjFile::Material::TextureSpecularType; - } else if ( !ASSIMP_strincmp( pPtr, DisplacementTexture1.c_str(), static_cast(DisplacementTexture1.size()) ) || - !ASSIMP_strincmp( pPtr, DisplacementTexture2.c_str(), static_cast(DisplacementTexture2.size()) ) ) { - // Displacement texture - out = &m_pModel->m_pCurrentMaterial->textureDisp; - clampIndex = ObjFile::Material::TextureDispType; - } else if ( !ASSIMP_strincmp( pPtr, OpacityTexture.c_str(), static_cast(OpacityTexture.size()) ) ) { - // Opacity texture - out = & m_pModel->m_pCurrentMaterial->textureOpacity; - clampIndex = ObjFile::Material::TextureOpacityType; - } else if ( !ASSIMP_strincmp( pPtr, EmissiveTexture1.c_str(), static_cast(EmissiveTexture1.size()) ) || - !ASSIMP_strincmp( pPtr, EmissiveTexture2.c_str(), static_cast(EmissiveTexture2.size()) ) ) { - // Emissive texture - out = & m_pModel->m_pCurrentMaterial->textureEmissive; - clampIndex = ObjFile::Material::TextureEmissiveType; - } else if ( !ASSIMP_strincmp( pPtr, BumpTexture1.c_str(), static_cast(BumpTexture1.size()) ) || - !ASSIMP_strincmp( pPtr, BumpTexture2.c_str(), static_cast(BumpTexture2.size()) ) ) { - // Bump texture - out = & m_pModel->m_pCurrentMaterial->textureBump; - clampIndex = ObjFile::Material::TextureBumpType; - } else if ( !ASSIMP_strincmp( pPtr,NormalTexture.c_str(), static_cast(NormalTexture.size()) ) ) { - // Normal map - out = & m_pModel->m_pCurrentMaterial->textureNormal; - clampIndex = ObjFile::Material::TextureNormalType; - } else if( !ASSIMP_strincmp( pPtr, ReflectionTexture.c_str(), static_cast(ReflectionTexture.size()) ) ) { - // Reflection texture(s) - //Do nothing here - return; - } else if ( !ASSIMP_strincmp( pPtr, SpecularityTexture.c_str(), static_cast(SpecularityTexture.size()) ) ) { - // Specularity scaling (glossiness) - out = & m_pModel->m_pCurrentMaterial->textureSpecularity; - clampIndex = ObjFile::Material::TextureSpecularityType; - } else { - ASSIMP_LOG_ERROR("OBJ/MTL: Encountered unknown texture type"); - return; - } - - bool clamp = false; - getTextureOption(clamp, clampIndex, out); - m_pModel->m_pCurrentMaterial->clamp[clampIndex] = clamp; - - std::string texture; - m_DataIt = getName( m_DataIt, m_DataItEnd, texture ); - if ( NULL!=out ) { - out->Set( texture ); - } -} - -/* ///////////////////////////////////////////////////////////////////////////// - * Texture Option - * ///////////////////////////////////////////////////////////////////////////// - * According to http://en.wikipedia.org/wiki/Wavefront_.obj_file#Texture_options - * Texture map statement can contains various texture option, for example: - * - * map_Ka -o 1 1 1 some.png - * map_Kd -clamp on some.png - * - * So we need to parse and skip these options, and leave the last part which is - * the url of image, otherwise we will get a wrong url like "-clamp on some.png". - * - * Because aiMaterial supports clamp option, so we also want to return it - * ///////////////////////////////////////////////////////////////////////////// - */ -void ObjFileMtlImporter::getTextureOption(bool &clamp, int &clampIndex, aiString *&out) { - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - - // If there is any more texture option - while (!isEndOfBuffer(m_DataIt, m_DataItEnd) && *m_DataIt == '-') - { - const char *pPtr( &(*m_DataIt) ); - //skip option key and value - int skipToken = 1; - - if (!ASSIMP_strincmp(pPtr, ClampOption.c_str(), static_cast(ClampOption.size()))) - { - DataArrayIt it = getNextToken(m_DataIt, m_DataItEnd); - char value[3]; - CopyNextWord(it, m_DataItEnd, value, sizeof(value) / sizeof(*value)); - if (!ASSIMP_strincmp(value, "on", 2)) - { - clamp = true; - } - - skipToken = 2; - } - else if( !ASSIMP_strincmp( pPtr, TypeOption.c_str(), static_cast(TypeOption.size()) ) ) - { - DataArrayIt it = getNextToken( m_DataIt, m_DataItEnd ); - char value[ 12 ]; - CopyNextWord( it, m_DataItEnd, value, sizeof( value ) / sizeof( *value ) ); - if( !ASSIMP_strincmp( value, "cube_top", 8 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionCubeTopType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[0]; - } - else if( !ASSIMP_strincmp( value, "cube_bottom", 11 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionCubeBottomType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[1]; - } - else if( !ASSIMP_strincmp( value, "cube_front", 10 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionCubeFrontType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[2]; - } - else if( !ASSIMP_strincmp( value, "cube_back", 9 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionCubeBackType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[3]; - } - else if( !ASSIMP_strincmp( value, "cube_left", 9 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionCubeLeftType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[4]; - } - else if( !ASSIMP_strincmp( value, "cube_right", 10 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionCubeRightType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[5]; - } - else if( !ASSIMP_strincmp( value, "sphere", 6 ) ) - { - clampIndex = ObjFile::Material::TextureReflectionSphereType; - out = &m_pModel->m_pCurrentMaterial->textureReflection[0]; - } - - skipToken = 2; - } - else if (!ASSIMP_strincmp(pPtr, BlendUOption.c_str(), static_cast(BlendUOption.size())) - || !ASSIMP_strincmp(pPtr, BlendVOption.c_str(), static_cast(BlendVOption.size())) - || !ASSIMP_strincmp(pPtr, BoostOption.c_str(), static_cast(BoostOption.size())) - || !ASSIMP_strincmp(pPtr, ResolutionOption.c_str(), static_cast(ResolutionOption.size())) - || !ASSIMP_strincmp(pPtr, BumpOption.c_str(), static_cast(BumpOption.size())) - || !ASSIMP_strincmp(pPtr, ChannelOption.c_str(), static_cast(ChannelOption.size()))) - { - skipToken = 2; - } - else if (!ASSIMP_strincmp(pPtr, ModifyMapOption.c_str(), static_cast(ModifyMapOption.size()))) - { - skipToken = 3; - } - else if ( !ASSIMP_strincmp(pPtr, OffsetOption.c_str(), static_cast(OffsetOption.size())) - || !ASSIMP_strincmp(pPtr, ScaleOption.c_str(), static_cast(ScaleOption.size())) - || !ASSIMP_strincmp(pPtr, TurbulenceOption.c_str(), static_cast(TurbulenceOption.size())) - ) - { - skipToken = 4; - } - - for (int i = 0; i < skipToken; ++i) - { - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - } - } -} - -// ------------------------------------------------------------------- - -} // Namespace Assimp - -#endif // !! ASSIMP_BUILD_NO_OBJ_IMPORTER diff --git a/Engine/lib/assimp/code/ObjFileMtlImporter.h b/Engine/lib/assimp/code/ObjFileMtlImporter.h deleted file mode 100644 index 731952359..000000000 --- a/Engine/lib/assimp/code/ObjFileMtlImporter.h +++ /dev/null @@ -1,117 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 OBJFILEMTLIMPORTER_H_INC -#define OBJFILEMTLIMPORTER_H_INC - -#include -#include -#include - -struct aiColor3D; -struct aiString; - -namespace Assimp { - -namespace ObjFile { - struct Model; - struct Material; -} - - -/** - * @class ObjFileMtlImporter - * @brief Loads the material description from a mtl file. - */ -class ObjFileMtlImporter -{ -public: - static const size_t BUFFERSIZE = 2048; - typedef std::vector DataArray; - typedef std::vector::iterator DataArrayIt; - typedef std::vector::const_iterator ConstDataArrayIt; - -public: - //! \brief Default constructor - ObjFileMtlImporter( std::vector &buffer, const std::string &strAbsPath, - ObjFile::Model *pModel ); - - //! \brief DEstructor - ~ObjFileMtlImporter(); - -private: - /// Copy constructor, empty. - ObjFileMtlImporter(const ObjFileMtlImporter &rOther); - /// \brief Assignment operator, returns only a reference of this instance. - ObjFileMtlImporter &operator = (const ObjFileMtlImporter &rOther); - /// Load the whole material description - void load(); - /// Get color data. - void getColorRGBA( aiColor3D *pColor); - /// Get illumination model from loaded data - void getIlluminationModel( int &illum_model ); - /// Gets a float value from data. - void getFloatValue( ai_real &value ); - /// Creates a new material from loaded data. - void createMaterial(); - /// Get texture name from loaded data. - void getTexture(); - void getTextureOption(bool &clamp, int &clampIndex, aiString *&out); - -private: - //! Absolute pathname - std::string m_strAbsPath; - //! Data iterator showing to the current position in data buffer - DataArrayIt m_DataIt; - //! Data iterator to end of buffer - DataArrayIt m_DataItEnd; - //! USed model instance - ObjFile::Model *m_pModel; - //! Current line in file - unsigned int m_uiLine; - //! Helper buffer - char m_buffer[BUFFERSIZE]; -}; - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Assimp - -#endif // OBJFILEMTLIMPORTER_H_INC diff --git a/Engine/lib/assimp/code/ObjFileParser.cpp b/Engine/lib/assimp/code/ObjFileParser.cpp deleted file mode 100644 index d303cb8b9..000000000 --- a/Engine/lib/assimp/code/ObjFileParser.cpp +++ /dev/null @@ -1,860 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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_OBJ_IMPORTER - -#include "ObjFileParser.h" -#include "ObjFileMtlImporter.h" -#include "ObjTools.h" -#include "ObjFileData.h" -#include -#include -#include -#include -#include -#include -#include - -namespace Assimp { - -const std::string ObjFileParser::DEFAULT_MATERIAL = AI_DEFAULT_MATERIAL_NAME; - -ObjFileParser::ObjFileParser() -: m_DataIt() -, m_DataItEnd() -, m_pModel( nullptr ) -, m_uiLine( 0 ) -, m_pIO( nullptr ) -, m_progress( nullptr ) -, m_originalObjFileName() { - // empty -} - -ObjFileParser::ObjFileParser( IOStreamBuffer &streamBuffer, const std::string &modelName, - IOSystem *io, ProgressHandler* progress, - const std::string &originalObjFileName) : - m_DataIt(), - m_DataItEnd(), - m_pModel(nullptr), - m_uiLine(0), - m_pIO( io ), - m_progress(progress), - m_originalObjFileName(originalObjFileName) -{ - std::fill_n(m_buffer,Buffersize,0); - - // Create the model instance to store all the data - m_pModel.reset(new ObjFile::Model()); - m_pModel->m_ModelName = modelName; - - // create default material and store it - m_pModel->m_pDefaultMaterial = new ObjFile::Material; - m_pModel->m_pDefaultMaterial->MaterialName.Set( DEFAULT_MATERIAL ); - m_pModel->m_MaterialLib.push_back( DEFAULT_MATERIAL ); - m_pModel->m_MaterialMap[ DEFAULT_MATERIAL ] = m_pModel->m_pDefaultMaterial; - - // Start parsing the file - parseFile( streamBuffer ); -} - -ObjFileParser::~ObjFileParser() { -} - -void ObjFileParser::setBuffer( std::vector &buffer ) { - m_DataIt = buffer.begin(); - m_DataItEnd = buffer.end(); -} - -ObjFile::Model *ObjFileParser::GetModel() const { - return m_pModel.get(); -} - -void ObjFileParser::parseFile( IOStreamBuffer &streamBuffer ) { - // only update every 100KB or it'll be too slow - //const unsigned int updateProgressEveryBytes = 100 * 1024; - unsigned int progressCounter = 0; - const unsigned int bytesToProcess = static_cast(streamBuffer.size()); - const unsigned int progressTotal = bytesToProcess; - unsigned int processed = 0; - size_t lastFilePos( 0 ); - - std::vector buffer; - while ( streamBuffer.getNextDataLine( buffer, '\0' ) ) { - m_DataIt = buffer.begin(); - m_DataItEnd = buffer.end(); - - // Handle progress reporting - const size_t filePos( streamBuffer.getFilePos() ); - if ( lastFilePos < filePos ) { - processed = static_cast(filePos); - lastFilePos = filePos; - progressCounter++; - m_progress->UpdateFileRead( processed, progressTotal ); - } - - // parse line - switch (*m_DataIt) { - case 'v': // Parse a vertex texture coordinate - { - ++m_DataIt; - if (*m_DataIt == ' ' || *m_DataIt == '\t') { - size_t numComponents = getNumComponentsInDataDefinition(); - if (numComponents == 3) { - // read in vertex definition - getVector3(m_pModel->m_Vertices); - } else if (numComponents == 4) { - // read in vertex definition (homogeneous coords) - getHomogeneousVector3(m_pModel->m_Vertices); - } else if (numComponents == 6) { - // read vertex and vertex-color - getTwoVectors3(m_pModel->m_Vertices, m_pModel->m_VertexColors); - } - } else if (*m_DataIt == 't') { - // read in texture coordinate ( 2D or 3D ) - ++m_DataIt; - getVector( m_pModel->m_TextureCoord ); - } else if (*m_DataIt == 'n') { - // Read in normal vector definition - ++m_DataIt; - getVector3( m_pModel->m_Normals ); - } - } - break; - - case 'p': // Parse a face, line or point statement - case 'l': - case 'f': - { - getFace(*m_DataIt == 'f' ? aiPrimitiveType_POLYGON : (*m_DataIt == 'l' - ? aiPrimitiveType_LINE : aiPrimitiveType_POINT)); - } - break; - - case '#': // Parse a comment - { - getComment(); - } - break; - - case 'u': // Parse a material desc. setter - { - std::string name; - - getNameNoSpace(m_DataIt, m_DataItEnd, name); - - size_t nextSpace = name.find(" "); - if (nextSpace != std::string::npos) - name = name.substr(0, nextSpace); - - if(name == "usemtl") - { - getMaterialDesc(); - } - } - break; - - case 'm': // Parse a material library or merging group ('mg') - { - std::string name; - - getNameNoSpace(m_DataIt, m_DataItEnd, name); - - size_t nextSpace = name.find(" "); - if (nextSpace != std::string::npos) - name = name.substr(0, nextSpace); - - if (name == "mg") - getGroupNumberAndResolution(); - else if(name == "mtllib") - getMaterialLib(); - else - goto pf_skip_line; - } - break; - - case 'g': // Parse group name - { - getGroupName(); - } - break; - - case 's': // Parse group number - { - getGroupNumber(); - } - break; - - case 'o': // Parse object name - { - getObjectName(); - } - break; - - default: - { -pf_skip_line: - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - } - break; - } - } -} - -void ObjFileParser::copyNextWord(char *pBuffer, size_t length) { - size_t index = 0; - m_DataIt = getNextWord(m_DataIt, m_DataItEnd); - if ( *m_DataIt == '\\' ) { - m_DataIt++; - m_DataIt++; - m_DataIt = getNextWord( m_DataIt, m_DataItEnd ); - } - while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { - pBuffer[index] = *m_DataIt; - index++; - if( index == length - 1 ) { - break; - } - ++m_DataIt; - } - - ai_assert(index < length); - pBuffer[index] = '\0'; -} - -static bool isDataDefinitionEnd( const char *tmp ) { - if ( *tmp == '\\' ) { - tmp++; - if ( IsLineEnd( *tmp ) ) { - tmp++; - return true; - } - } - return false; -} - -size_t ObjFileParser::getNumComponentsInDataDefinition() { - size_t numComponents( 0 ); - const char* tmp( &m_DataIt[0] ); - bool end_of_definition = false; - while ( !end_of_definition ) { - if ( isDataDefinitionEnd( tmp ) ) { - tmp += 2; - } else if ( IsLineEnd( *tmp ) ) { - end_of_definition = true; - } - if ( !SkipSpaces( &tmp ) ) { - break; - } - const bool isNum( IsNumeric( *tmp ) ); - SkipToken( tmp ); - if ( isNum ) { - ++numComponents; - } - if ( !SkipSpaces( &tmp ) ) { - break; - } - } - return numComponents; -} - -void ObjFileParser::getVector( std::vector &point3d_array ) { - size_t numComponents = getNumComponentsInDataDefinition(); - ai_real x, y, z; - if( 2 == numComponents ) { - copyNextWord( m_buffer, Buffersize ); - x = ( ai_real ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - y = ( ai_real ) fast_atof( m_buffer ); - z = 0.0; - } else if( 3 == numComponents ) { - copyNextWord( m_buffer, Buffersize ); - x = ( ai_real ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - y = ( ai_real ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - z = ( ai_real ) fast_atof( m_buffer ); - } else { - throw DeadlyImportError( "OBJ: Invalid number of components" ); - } - point3d_array.push_back( aiVector3D( x, y, z ) ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -void ObjFileParser::getVector3( std::vector &point3d_array ) { - ai_real x, y, z; - copyNextWord(m_buffer, Buffersize); - x = (ai_real) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (ai_real) fast_atof(m_buffer); - - copyNextWord( m_buffer, Buffersize ); - z = ( ai_real ) fast_atof( m_buffer ); - - point3d_array.push_back( aiVector3D( x, y, z ) ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -void ObjFileParser::getHomogeneousVector3( std::vector &point3d_array ) { - ai_real x, y, z, w; - copyNextWord(m_buffer, Buffersize); - x = (ai_real) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (ai_real) fast_atof(m_buffer); - - copyNextWord( m_buffer, Buffersize ); - z = ( ai_real ) fast_atof( m_buffer ); - - copyNextWord( m_buffer, Buffersize ); - w = ( ai_real ) fast_atof( m_buffer ); - - if (w == 0) - throw DeadlyImportError("OBJ: Invalid component in homogeneous vector (Division by zero)"); - - point3d_array.push_back( aiVector3D( x/w, y/w, z/w ) ); - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -void ObjFileParser::getTwoVectors3( std::vector &point3d_array_a, std::vector &point3d_array_b ) { - ai_real x, y, z; - copyNextWord(m_buffer, Buffersize); - x = (ai_real) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (ai_real) fast_atof(m_buffer); - - copyNextWord( m_buffer, Buffersize ); - z = ( ai_real ) fast_atof( m_buffer ); - - point3d_array_a.push_back( aiVector3D( x, y, z ) ); - - copyNextWord(m_buffer, Buffersize); - x = (ai_real) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (ai_real) fast_atof(m_buffer); - - copyNextWord( m_buffer, Buffersize ); - z = ( ai_real ) fast_atof( m_buffer ); - - point3d_array_b.push_back( aiVector3D( x, y, z ) ); - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -void ObjFileParser::getVector2( std::vector &point2d_array ) { - ai_real x, y; - copyNextWord(m_buffer, Buffersize); - x = (ai_real) fast_atof(m_buffer); - - copyNextWord(m_buffer, Buffersize); - y = (ai_real) fast_atof(m_buffer); - - point2d_array.push_back(aiVector2D(x, y)); - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -static const std::string DefaultObjName = "defaultobject"; - -void ObjFileParser::getFace( aiPrimitiveType type ) { - m_DataIt = getNextToken( m_DataIt, m_DataItEnd ); - if ( m_DataIt == m_DataItEnd || *m_DataIt == '\0' ) { - return; - } - - ObjFile::Face *face = new ObjFile::Face( type ); - bool hasNormal = false; - - const int vSize = static_cast(m_pModel->m_Vertices.size()); - const int vtSize = static_cast(m_pModel->m_TextureCoord.size()); - const int vnSize = static_cast(m_pModel->m_Normals.size()); - - const bool vt = (!m_pModel->m_TextureCoord.empty()); - const bool vn = (!m_pModel->m_Normals.empty()); - int iStep = 0, iPos = 0; - while ( m_DataIt != m_DataItEnd ) { - iStep = 1; - - if ( IsLineEnd( *m_DataIt ) ) { - break; - } - - if ( *m_DataIt =='/' ) { - if (type == aiPrimitiveType_POINT) { - ASSIMP_LOG_ERROR("Obj: Separator unexpected in point statement"); - } - if (iPos == 0) { - //if there are no texture coordinates in the file, but normals - if (!vt && vn) { - iPos = 1; - iStep++; - } - } - iPos++; - } else if( IsSpaceOrNewLine( *m_DataIt ) ) { - iPos = 0; - } else { - //OBJ USES 1 Base ARRAYS!!!! - const int iVal( ::atoi( & ( *m_DataIt ) ) ); - - // increment iStep position based off of the sign and # of digits - int tmp = iVal; - if ( iVal < 0 ) { - ++iStep; - } - while ( ( tmp = tmp / 10 ) != 0 ) { - ++iStep; - } - - if ( iVal > 0 ) { - // Store parsed index - if ( 0 == iPos ) { - face->m_vertices.push_back( iVal - 1 ); - } else if ( 1 == iPos ) { - face->m_texturCoords.push_back( iVal - 1 ); - } else if ( 2 == iPos ) { - face->m_normals.push_back( iVal - 1 ); - hasNormal = true; - } else { - reportErrorTokenInFace(); - } - } else if ( iVal < 0 ) { - // Store relatively index - if ( 0 == iPos ) { - face->m_vertices.push_back( vSize + iVal ); - } else if ( 1 == iPos ) { - face->m_texturCoords.push_back( vtSize + iVal ); - } else if ( 2 == iPos ) { - face->m_normals.push_back( vnSize + iVal ); - hasNormal = true; - } else { - reportErrorTokenInFace(); - } - } else { - //On error, std::atoi will return 0 which is not a valid value - delete face; - throw DeadlyImportError("OBJ: Invalid face indice"); - } - - } - m_DataIt += iStep; - } - - if ( face->m_vertices.empty() ) { - ASSIMP_LOG_ERROR("Obj: Ignoring empty face"); - // skip line and clean up - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - delete face; - return; - } - - // Set active material, if one set - if( NULL != m_pModel->m_pCurrentMaterial ) { - face->m_pMaterial = m_pModel->m_pCurrentMaterial; - } else { - face->m_pMaterial = m_pModel->m_pDefaultMaterial; - } - - // Create a default object, if nothing is there - if( NULL == m_pModel->m_pCurrent ) { - createObject( DefaultObjName ); - } - - // Assign face to mesh - if ( NULL == m_pModel->m_pCurrentMesh ) { - createMesh( DefaultObjName ); - } - - // Store the face - m_pModel->m_pCurrentMesh->m_Faces.push_back( face ); - m_pModel->m_pCurrentMesh->m_uiNumIndices += (unsigned int) face->m_vertices.size(); - m_pModel->m_pCurrentMesh->m_uiUVCoordinates[ 0 ] += (unsigned int) face->m_texturCoords.size(); - if( !m_pModel->m_pCurrentMesh->m_hasNormals && hasNormal ) { - m_pModel->m_pCurrentMesh->m_hasNormals = true; - } - // Skip the rest of the line - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -void ObjFileParser::getMaterialDesc() { - // Get next data for material data - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - if (m_DataIt == m_DataItEnd) { - return; - } - - char *pStart = &(*m_DataIt); - while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) { - ++m_DataIt; - } - - // In some cases we should ignore this 'usemtl' command, this variable helps us to do so - bool skip = false; - - // Get name - std::string strName(pStart, &(*m_DataIt)); - strName = trim_whitespaces(strName); - if (strName.empty()) - skip = true; - - // If the current mesh has the same material, we simply ignore that 'usemtl' command - // There is no need to create another object or even mesh here - if ( m_pModel->m_pCurrentMaterial && m_pModel->m_pCurrentMaterial->MaterialName == aiString( strName ) ) { - skip = true; - } - - if (!skip) { - // Search for material - std::map::iterator it = m_pModel->m_MaterialMap.find(strName); - if (it == m_pModel->m_MaterialMap.end()) { - // Not found, so we don't know anything about the material except for its name. - // This may be the case if the material library is missing. We don't want to lose all - // materials if that happens, so create a new named material instead of discarding it - // completely. - ASSIMP_LOG_ERROR("OBJ: failed to locate material " + strName + ", creating new material"); - m_pModel->m_pCurrentMaterial = new ObjFile::Material(); - m_pModel->m_pCurrentMaterial->MaterialName.Set(strName); - m_pModel->m_MaterialLib.push_back(strName); - m_pModel->m_MaterialMap[strName] = m_pModel->m_pCurrentMaterial; - } else { - // Found, using detected material - m_pModel->m_pCurrentMaterial = (*it).second; - } - - if ( needsNewMesh( strName ) ) { - createMesh( strName ); - } - - m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex(strName); - } - - // Skip rest of line - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -// Get a comment, values will be skipped -void ObjFileParser::getComment() { - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -// Get material library from file. -void ObjFileParser::getMaterialLib() { - // Translate tuple - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - if( m_DataIt == m_DataItEnd ) { - return; - } - - char *pStart = &(*m_DataIt); - while( m_DataIt != m_DataItEnd && !IsLineEnd( *m_DataIt ) ) { - ++m_DataIt; - } - - // Check for existence - const std::string strMatName(pStart, &(*m_DataIt)); - std::string absName; - - // Check if directive is valid. - if ( 0 == strMatName.length() ) { - ASSIMP_LOG_WARN( "OBJ: no name for material library specified." ); - return; - } - - if ( m_pIO->StackSize() > 0 ) { - std::string path = m_pIO->CurrentDirectory(); - if ( '/' != *path.rbegin() ) { - path += '/'; - } - absName += path; - absName += strMatName; - } else { - absName = strMatName; - } - - IOStream *pFile = m_pIO->Open( absName ); - if ( nullptr == pFile ) { - ASSIMP_LOG_ERROR("OBJ: Unable to locate material file " + strMatName); - std::string strMatFallbackName = m_originalObjFileName.substr(0, m_originalObjFileName.length() - 3) + "mtl"; - ASSIMP_LOG_INFO("OBJ: Opening fallback material file " + strMatFallbackName); - pFile = m_pIO->Open(strMatFallbackName); - if (!pFile) { - ASSIMP_LOG_ERROR("OBJ: Unable to locate fallback material file " + strMatFallbackName); - m_DataIt = skipLine(m_DataIt, m_DataItEnd, m_uiLine); - return; - } - } - - // Import material library data from file. - // Some exporters (e.g. Silo) will happily write out empty - // material files if the model doesn't use any materials, so we - // allow that. - std::vector buffer; - BaseImporter::TextFileToBuffer( pFile, buffer, BaseImporter::ALLOW_EMPTY ); - m_pIO->Close( pFile ); - - // Importing the material library - ObjFileMtlImporter mtlImporter( buffer, strMatName, m_pModel.get() ); -} - -// ------------------------------------------------------------------- -// Set a new material definition as the current material. -void ObjFileParser::getNewMaterial() { - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - m_DataIt = getNextWord(m_DataIt, m_DataItEnd); - if( m_DataIt == m_DataItEnd ) { - return; - } - - char *pStart = &(*m_DataIt); - std::string strMat( pStart, *m_DataIt ); - while( m_DataIt != m_DataItEnd && IsSpaceOrNewLine( *m_DataIt ) ) { - ++m_DataIt; - } - std::map::iterator it = m_pModel->m_MaterialMap.find( strMat ); - if ( it == m_pModel->m_MaterialMap.end() ) { - // Show a warning, if material was not found - ASSIMP_LOG_WARN("OBJ: Unsupported material requested: " + strMat); - m_pModel->m_pCurrentMaterial = m_pModel->m_pDefaultMaterial; - } else { - // Set new material - if ( needsNewMesh( strMat ) ) { - createMesh( strMat ); - } - m_pModel->m_pCurrentMesh->m_uiMaterialIndex = getMaterialIndex( strMat ); - } - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -int ObjFileParser::getMaterialIndex( const std::string &strMaterialName ) -{ - int mat_index = -1; - if( strMaterialName.empty() ) { - return mat_index; - } - for (size_t index = 0; index < m_pModel->m_MaterialLib.size(); ++index) - { - if ( strMaterialName == m_pModel->m_MaterialLib[ index ]) - { - mat_index = (int)index; - break; - } - } - return mat_index; -} - -// ------------------------------------------------------------------- -// Getter for a group name. -void ObjFileParser::getGroupName() { - std::string groupName; - - // here we skip 'g ' from line - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - m_DataIt = getName(m_DataIt, m_DataItEnd, groupName); - if( isEndOfBuffer( m_DataIt, m_DataItEnd ) ) { - return; - } - - // Change active group, if necessary - if ( m_pModel->m_strActiveGroup != groupName ) { - // Search for already existing entry - ObjFile::Model::ConstGroupMapIt it = m_pModel->m_Groups.find(groupName); - - // We are mapping groups into the object structure - createObject( groupName ); - - // New group name, creating a new entry - if (it == m_pModel->m_Groups.end()) - { - std::vector *pFaceIDArray = new std::vector; - m_pModel->m_Groups[ groupName ] = pFaceIDArray; - m_pModel->m_pGroupFaceIDs = (pFaceIDArray); - } - else - { - m_pModel->m_pGroupFaceIDs = (*it).second; - } - m_pModel->m_strActiveGroup = groupName; - } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -// Not supported -void ObjFileParser::getGroupNumber() -{ - // Not used - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -// Not supported -void ObjFileParser::getGroupNumberAndResolution() -{ - // Not used - - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} - -// ------------------------------------------------------------------- -// Stores values for a new object instance, name will be used to -// identify it. -void ObjFileParser::getObjectName() -{ - m_DataIt = getNextToken(m_DataIt, m_DataItEnd); - if( m_DataIt == m_DataItEnd ) { - return; - } - char *pStart = &(*m_DataIt); - while( m_DataIt != m_DataItEnd && !IsSpaceOrNewLine( *m_DataIt ) ) { - ++m_DataIt; - } - - std::string strObjectName(pStart, &(*m_DataIt)); - if (!strObjectName.empty()) - { - // Reset current object - m_pModel->m_pCurrent = NULL; - - // Search for actual object - for (std::vector::const_iterator it = m_pModel->m_Objects.begin(); - it != m_pModel->m_Objects.end(); - ++it) - { - if ((*it)->m_strObjName == strObjectName) - { - m_pModel->m_pCurrent = *it; - break; - } - } - - // Allocate a new object, if current one was not found before - if( NULL == m_pModel->m_pCurrent ) { - createObject( strObjectName ); - } - } - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); -} -// ------------------------------------------------------------------- -// Creates a new object instance -void ObjFileParser::createObject(const std::string &objName) -{ - ai_assert( NULL != m_pModel ); - - m_pModel->m_pCurrent = new ObjFile::Object; - m_pModel->m_pCurrent->m_strObjName = objName; - m_pModel->m_Objects.push_back( m_pModel->m_pCurrent ); - - createMesh( objName ); - - if( m_pModel->m_pCurrentMaterial ) - { - m_pModel->m_pCurrentMesh->m_uiMaterialIndex = - getMaterialIndex( m_pModel->m_pCurrentMaterial->MaterialName.data ); - m_pModel->m_pCurrentMesh->m_pMaterial = m_pModel->m_pCurrentMaterial; - } -} -// ------------------------------------------------------------------- -// Creates a new mesh -void ObjFileParser::createMesh( const std::string &meshName ) -{ - ai_assert( NULL != m_pModel ); - m_pModel->m_pCurrentMesh = new ObjFile::Mesh( meshName ); - m_pModel->m_Meshes.push_back( m_pModel->m_pCurrentMesh ); - unsigned int meshId = static_cast(m_pModel->m_Meshes.size()-1); - if ( NULL != m_pModel->m_pCurrent ) - { - m_pModel->m_pCurrent->m_Meshes.push_back( meshId ); - } - else - { - ASSIMP_LOG_ERROR("OBJ: No object detected to attach a new mesh instance."); - } -} - -// ------------------------------------------------------------------- -// Returns true, if a new mesh must be created. -bool ObjFileParser::needsNewMesh( const std::string &materialName ) -{ - // If no mesh data yet - if(m_pModel->m_pCurrentMesh == 0) - { - return true; - } - bool newMat = false; - int matIdx = getMaterialIndex( materialName ); - int curMatIdx = m_pModel->m_pCurrentMesh->m_uiMaterialIndex; - if ( curMatIdx != int(ObjFile::Mesh::NoMaterial) - && curMatIdx != matIdx - // no need create a new mesh if no faces in current - // lets say 'usemtl' goes straight after 'g' - && m_pModel->m_pCurrentMesh->m_Faces.size() > 0 ) - { - // New material -> only one material per mesh, so we need to create a new - // material - newMat = true; - } - return newMat; -} - -// ------------------------------------------------------------------- -// Shows an error in parsing process. -void ObjFileParser::reportErrorTokenInFace() -{ - m_DataIt = skipLine( m_DataIt, m_DataItEnd, m_uiLine ); - ASSIMP_LOG_ERROR("OBJ: Not supported token in face description detected"); -} - -// ------------------------------------------------------------------- - -} // Namespace Assimp - -#endif // !! ASSIMP_BUILD_NO_OBJ_IMPORTER diff --git a/Engine/lib/assimp/code/ObjFileParser.h b/Engine/lib/assimp/code/ObjFileParser.h deleted file mode 100644 index e00382f4c..000000000 --- a/Engine/lib/assimp/code/ObjFileParser.h +++ /dev/null @@ -1,165 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 OBJ_FILEPARSER_H_INC -#define OBJ_FILEPARSER_H_INC - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace Assimp { - -namespace ObjFile { - struct Model; - struct Object; - struct Material; - struct Point3; - struct Point2; -} - -class ObjFileImporter; -class IOSystem; -class ProgressHandler; - -/// \class ObjFileParser -/// \brief Parser for a obj waveform file -class ASSIMP_API ObjFileParser { -public: - static const size_t Buffersize = 4096; - typedef std::vector DataArray; - typedef std::vector::iterator DataArrayIt; - typedef std::vector::const_iterator ConstDataArrayIt; - -public: - /// @brief The default constructor. - ObjFileParser(); - /// @brief Constructor with data array. - ObjFileParser( IOStreamBuffer &streamBuffer, const std::string &modelName, IOSystem* io, ProgressHandler* progress, const std::string &originalObjFileName); - /// @brief Destructor - ~ObjFileParser(); - /// @brief If you want to load in-core data. - void setBuffer( std::vector &buffer ); - /// @brief Model getter. - ObjFile::Model *GetModel() const; - -protected: - /// Parse the loaded file - void parseFile( IOStreamBuffer &streamBuffer ); - /// Method to copy the new delimited word in the current line. - void copyNextWord(char *pBuffer, size_t length); - /// Method to copy the new line. -// void copyNextLine(char *pBuffer, size_t length); - /// Get the number of components in a line. - size_t getNumComponentsInDataDefinition(); - /// Stores the vector - void getVector( std::vector &point3d_array ); - /// Stores the following 3d vector. - void getVector3( std::vector &point3d_array ); - /// Stores the following homogeneous vector as a 3D vector - void getHomogeneousVector3( std::vector &point3d_array ); - /// Stores the following two 3d vectors on the line. - void getTwoVectors3( std::vector &point3d_array_a, std::vector &point3d_array_b ); - /// Stores the following 3d vector. - void getVector2(std::vector &point2d_array); - /// Stores the following face. - void getFace(aiPrimitiveType type); - /// Reads the material description. - void getMaterialDesc(); - /// Gets a comment. - void getComment(); - /// Gets a a material library. - void getMaterialLib(); - /// Creates a new material. - void getNewMaterial(); - /// Gets the group name from file. - void getGroupName(); - /// Gets the group number from file. - void getGroupNumber(); - /// Gets the group number and resolution from file. - void getGroupNumberAndResolution(); - /// Returns the index of the material. Is -1 if not material was found. - int getMaterialIndex( const std::string &strMaterialName ); - /// Parse object name - void getObjectName(); - /// Creates a new object. - void createObject( const std::string &strObjectName ); - /// Creates a new mesh. - void createMesh( const std::string &meshName ); - /// Returns true, if a new mesh instance must be created. - bool needsNewMesh( const std::string &rMaterialName ); - /// Error report in token - void reportErrorTokenInFace(); - -private: - // Copy and assignment constructor should be private - // because the class contains pointer to allocated memory - ObjFileParser(const ObjFileParser& rhs); - ObjFileParser& operator=(const ObjFileParser& rhs); - - /// Default material name - static const std::string DEFAULT_MATERIAL; - //! Iterator to current position in buffer - DataArrayIt m_DataIt; - //! Iterator to end position of buffer - DataArrayIt m_DataItEnd; - //! Pointer to model instance - std::unique_ptr m_pModel; - //! Current line (for debugging) - unsigned int m_uiLine; - //! Helper buffer - char m_buffer[Buffersize]; - /// Pointer to IO system instance. - IOSystem *m_pIO; - //! Pointer to progress handler - ProgressHandler* m_progress; - /// Path to the current model, name of the obj file where the buffer comes from - const std::string m_originalObjFileName; -}; - -} // Namespace Assimp - -#endif diff --git a/Engine/lib/assimp/code/ObjTools.h b/Engine/lib/assimp/code/ObjTools.h deleted file mode 100644 index 3f4c41033..000000000 --- a/Engine/lib/assimp/code/ObjTools.h +++ /dev/null @@ -1,308 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 ObjTools.h - * @brief Some helpful templates for text parsing - */ -#ifndef OBJ_TOOLS_H_INC -#define OBJ_TOOLS_H_INC - -#include -#include -#include - -namespace Assimp { - -/** @brief Returns true, if the last entry of the buffer is reached. - * @param it Iterator of current position. - * @param end Iterator with end of buffer. - * @return true, if the end of the buffer is reached. - */ -template -inline bool isEndOfBuffer( char_t it, char_t end ) { - if ( it == end ) - { - return true; - } - else - { - --end; - } - return ( it == end ); -} - -/** @brief Returns next word separated by a space - * @param pBuffer Pointer to data buffer - * @param pEnd Pointer to end of buffer - * @return Pointer to next space - */ -template -inline Char_T getNextWord( Char_T pBuffer, Char_T pEnd ) -{ - while ( !isEndOfBuffer( pBuffer, pEnd ) ) - { - if ( !IsSpaceOrNewLine( *pBuffer ) || IsLineEnd( *pBuffer ) ) { - //if ( *pBuffer != '\\' ) - break; - } - pBuffer++; - } - return pBuffer; -} - -/** @brief Returns pointer a next token - * @param pBuffer Pointer to data buffer - * @param pEnd Pointer to end of buffer - * @return Pointer to next token - */ -template -inline Char_T getNextToken( Char_T pBuffer, Char_T pEnd ) -{ - while ( !isEndOfBuffer( pBuffer, pEnd ) ) - { - if( IsSpaceOrNewLine( *pBuffer ) ) - break; - pBuffer++; - } - return getNextWord( pBuffer, pEnd ); -} - -/** @brief Skips a line - * @param it Iterator set to current position - * @param end Iterator set to end of scratch buffer for readout - * @param uiLine Current line number in format - * @return Current-iterator with new position - */ -template -inline char_t skipLine( char_t it, char_t end, unsigned int &uiLine ) { - while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) { - ++it; - } - - if ( it != end ) { - ++it; - ++uiLine; - } - // fix .. from time to time there are spaces at the beginning of a material line - while ( it != end && ( *it == '\t' || *it == ' ' ) ) { - ++it; - } - - return it; -} - -/** @brief Get a name from the current line. Preserve space in the middle, - * but trim it at the end. - * @param it set to current position - * @param end set to end of scratch buffer for readout - * @param name Separated name - * @return Current-iterator with new position - */ -template -inline char_t getName( char_t it, char_t end, std::string &name ) -{ - name = ""; - if( isEndOfBuffer( it, end ) ) { - return end; - } - - char *pStart = &( *it ); - while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it )) { - ++it; - } - - while(IsSpace( *it ) ) { - --it; - } - // Get name - // if there is no name, and the previous char is a separator, come back to start - while (&(*it) < pStart) { - ++it; - } - std::string strName( pStart, &(*it) ); - if ( strName.empty() ) - return it; - else - name = strName; - - return it; -} - -/** @brief Get a name from the current line. Do not preserve space - * in the middle, but trim it at the end. - * @param it set to current position - * @param end set to end of scratch buffer for readout - * @param name Separated name - * @return Current-iterator with new position - */ -template -inline char_t getNameNoSpace( char_t it, char_t end, std::string &name ) -{ - name = ""; - if( isEndOfBuffer( it, end ) ) { - return end; - } - - char *pStart = &( *it ); - while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) - && !IsSpaceOrNewLine( *it ) ) { - ++it; - } - - while( isEndOfBuffer( it, end ) || IsLineEnd( *it ) - || IsSpaceOrNewLine( *it ) ) { - --it; - } - ++it; - - // Get name - // if there is no name, and the previous char is a separator, come back to start - while (&(*it) < pStart) { - ++it; - } - std::string strName( pStart, &(*it) ); - if ( strName.empty() ) - return it; - else - name = strName; - - return it; -} - -/** @brief Get next word from given line - * @param it set to current position - * @param end set to end of scratch buffer for readout - * @param pBuffer Buffer for next word - * @param length Buffer length - * @return Current-iterator with new position - */ -template -inline char_t CopyNextWord( char_t it, char_t end, char *pBuffer, size_t length ) -{ - size_t index = 0; - it = getNextWord( it, end ); - while( !IsSpaceOrNewLine( *it ) && !isEndOfBuffer( it, end ) ) - { - pBuffer[index] = *it ; - index++; - if (index == length-1) - break; - ++it; - } - pBuffer[ index ] = '\0'; - return it; -} - -/** @brief Get next float from given line - * @param it set to current position - * @param end set to end of scratch buffer for readout - * @param value Separated float value. - * @return Current-iterator with new position - */ -template -inline char_t getFloat( char_t it, char_t end, ai_real &value ) -{ - static const size_t BUFFERSIZE = 1024; - char buffer[ BUFFERSIZE ]; - it = CopyNextWord( it, end, buffer, BUFFERSIZE ); - value = (ai_real) fast_atof( buffer ); - - return it; -} - -/** @brief Will perform a simple tokenize. - * @param str String to tokenize. - * @param tokens Array with tokens, will be empty if no token was found. - * @param delimiters Delimiter for tokenize. - * @return Number of found token. - */ -template -unsigned int tokenize( const string_type& str, std::vector& tokens, - const string_type& delimiters ) -{ - // Skip delimiters at beginning. - typename string_type::size_type lastPos = str.find_first_not_of( delimiters, 0 ); - - // Find first "non-delimiter". - typename string_type::size_type pos = str.find_first_of( delimiters, lastPos ); - while ( string_type::npos != pos || string_type::npos != lastPos ) - { - // Found a token, add it to the vector. - string_type tmp = str.substr(lastPos, pos - lastPos); - if ( !tmp.empty() && ' ' != tmp[ 0 ] ) - tokens.push_back( tmp ); - - // Skip delimiters. Note the "not_of" - lastPos = str.find_first_not_of( delimiters, pos ); - - // Find next "non-delimiter" - pos = str.find_first_of( delimiters, lastPos ); - } - - return static_cast( tokens.size() ); -} - -template -string_type trim_whitespaces(string_type str) -{ - while (!str.empty() && IsSpace(str[0])) str.erase(0); - while (!str.empty() && IsSpace(str[str.length() - 1])) str.erase(str.length() - 1); - return str; -} - -template -bool hasLineEnd( T it, T end ) { - bool hasLineEnd( false ); - while ( !isEndOfBuffer( it, end ) ) { - it++; - if ( IsLineEnd( it ) ) { - hasLineEnd = true; - break; - } - } - - return hasLineEnd; -} - -} // Namespace Assimp - -#endif // OBJ_TOOLS_H_INC diff --git a/Engine/lib/assimp/code/OgreBinarySerializer.cpp b/Engine/lib/assimp/code/Ogre/OgreBinarySerializer.cpp similarity index 99% rename from Engine/lib/assimp/code/OgreBinarySerializer.cpp rename to Engine/lib/assimp/code/Ogre/OgreBinarySerializer.cpp index b2326e244..589e69c7e 100644 --- a/Engine/lib/assimp/code/OgreBinarySerializer.cpp +++ b/Engine/lib/assimp/code/Ogre/OgreBinarySerializer.cpp @@ -864,6 +864,8 @@ bool OgreBinarySerializer::ImportSkeleton(Assimp::IOSystem *pIOHandler, Mesh *me } MemoryStreamReaderPtr reader = OpenReader(pIOHandler, mesh->skeletonRef); + if (!reader) + return false; Skeleton *skeleton = new Skeleton(); OgreBinarySerializer serializer(reader.get(), OgreBinarySerializer::AM_Skeleton); diff --git a/Engine/lib/assimp/code/OgreBinarySerializer.h b/Engine/lib/assimp/code/Ogre/OgreBinarySerializer.h similarity index 100% rename from Engine/lib/assimp/code/OgreBinarySerializer.h rename to Engine/lib/assimp/code/Ogre/OgreBinarySerializer.h diff --git a/Engine/lib/assimp/code/OgreImporter.cpp b/Engine/lib/assimp/code/Ogre/OgreImporter.cpp similarity index 100% rename from Engine/lib/assimp/code/OgreImporter.cpp rename to Engine/lib/assimp/code/Ogre/OgreImporter.cpp diff --git a/Engine/lib/assimp/code/OgreImporter.h b/Engine/lib/assimp/code/Ogre/OgreImporter.h similarity index 100% rename from Engine/lib/assimp/code/OgreImporter.h rename to Engine/lib/assimp/code/Ogre/OgreImporter.h diff --git a/Engine/lib/assimp/code/OgreMaterial.cpp b/Engine/lib/assimp/code/Ogre/OgreMaterial.cpp similarity index 100% rename from Engine/lib/assimp/code/OgreMaterial.cpp rename to Engine/lib/assimp/code/Ogre/OgreMaterial.cpp diff --git a/Engine/lib/assimp/code/OgreParsingUtils.h b/Engine/lib/assimp/code/Ogre/OgreParsingUtils.h similarity index 100% rename from Engine/lib/assimp/code/OgreParsingUtils.h rename to Engine/lib/assimp/code/Ogre/OgreParsingUtils.h diff --git a/Engine/lib/assimp/code/OgreStructs.cpp b/Engine/lib/assimp/code/Ogre/OgreStructs.cpp similarity index 100% rename from Engine/lib/assimp/code/OgreStructs.cpp rename to Engine/lib/assimp/code/Ogre/OgreStructs.cpp diff --git a/Engine/lib/assimp/code/OgreStructs.h b/Engine/lib/assimp/code/Ogre/OgreStructs.h similarity index 100% rename from Engine/lib/assimp/code/OgreStructs.h rename to Engine/lib/assimp/code/Ogre/OgreStructs.h diff --git a/Engine/lib/assimp/code/OgreXmlSerializer.cpp b/Engine/lib/assimp/code/Ogre/OgreXmlSerializer.cpp similarity index 100% rename from Engine/lib/assimp/code/OgreXmlSerializer.cpp rename to Engine/lib/assimp/code/Ogre/OgreXmlSerializer.cpp diff --git a/Engine/lib/assimp/code/OgreXmlSerializer.h b/Engine/lib/assimp/code/Ogre/OgreXmlSerializer.h similarity index 100% rename from Engine/lib/assimp/code/OgreXmlSerializer.h rename to Engine/lib/assimp/code/Ogre/OgreXmlSerializer.h diff --git a/Engine/lib/assimp/code/OpenGEXExporter.cpp b/Engine/lib/assimp/code/OpenGEX/OpenGEXExporter.cpp similarity index 100% rename from Engine/lib/assimp/code/OpenGEXExporter.cpp rename to Engine/lib/assimp/code/OpenGEX/OpenGEXExporter.cpp diff --git a/Engine/lib/assimp/code/OpenGEXExporter.h b/Engine/lib/assimp/code/OpenGEX/OpenGEXExporter.h similarity index 100% rename from Engine/lib/assimp/code/OpenGEXExporter.h rename to Engine/lib/assimp/code/OpenGEX/OpenGEXExporter.h diff --git a/Engine/lib/assimp/code/OpenGEXImporter.cpp b/Engine/lib/assimp/code/OpenGEX/OpenGEXImporter.cpp similarity index 99% rename from Engine/lib/assimp/code/OpenGEXImporter.cpp rename to Engine/lib/assimp/code/OpenGEX/OpenGEXImporter.cpp index a7a143035..07d3efd5e 100644 --- a/Engine/lib/assimp/code/OpenGEXImporter.cpp +++ b/Engine/lib/assimp/code/OpenGEX/OpenGEXImporter.cpp @@ -41,10 +41,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ASSIMP_BUILD_NO_OPENGEX_IMPORTER -#include "OpenGEXImporter.h" +#include "OpenGEX/OpenGEXImporter.h" +#include "PostProcessing/MakeVerboseFormat.h" + #include #include -#include "MakeVerboseFormat.h" #include #include @@ -212,7 +213,11 @@ static void propId2StdString( Property *prop, std::string &name, std::string &ke } if ( nullptr != prop->m_key ) { +#ifdef ASSIMP_USE_HUNTER + name = prop->m_key->m_text.m_buffer; +#else name = prop->m_key->m_buffer; +#endif if ( Value::ddl_string == prop->m_value->m_type ) { key = prop->m_value->getString(); } @@ -497,7 +502,11 @@ static void getRefNames( DDLNode *node, std::vector &names ) { for( size_t i = 0; i < ref->m_numRefs; i++ ) { Name *currentName( ref->m_referencedName[ i ] ); if( nullptr != currentName && nullptr != currentName->m_id ) { +#ifdef ASSIMP_USE_HUNTER + const std::string name( currentName->m_id->m_text.m_buffer ); +#else const std::string name( currentName->m_id->m_buffer ); +#endif if( !name.empty() ) { names.push_back( name ); } @@ -1038,7 +1047,11 @@ void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene * /*pS col.g = col4.g; col.b = col4.b; } +#ifdef ASSIMP_USE_HUNTER + const ColorType colType( getColorType( &prop->m_key->m_text ) ); +#else const ColorType colType( getColorType( prop->m_key ) ); +#endif if( DiffuseColor == colType ) { m_currentMaterial->AddProperty( &col, 1, AI_MATKEY_COLOR_DIFFUSE ); } else if( SpecularColor == colType ) { diff --git a/Engine/lib/assimp/code/OpenGEXImporter.h b/Engine/lib/assimp/code/OpenGEX/OpenGEXImporter.h similarity index 100% rename from Engine/lib/assimp/code/OpenGEXImporter.h rename to Engine/lib/assimp/code/OpenGEX/OpenGEXImporter.h diff --git a/Engine/lib/assimp/code/OpenGEXStructs.h b/Engine/lib/assimp/code/OpenGEX/OpenGEXStructs.h similarity index 100% rename from Engine/lib/assimp/code/OpenGEXStructs.h rename to Engine/lib/assimp/code/OpenGEX/OpenGEXStructs.h diff --git a/Engine/lib/assimp/code/ParsingUtils.h b/Engine/lib/assimp/code/ParsingUtils.h deleted file mode 100644 index 7da664374..000000000 --- a/Engine/lib/assimp/code/ParsingUtils.h +++ /dev/null @@ -1,251 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - - -/** @file ParsingUtils.h - * @brief Defines helper functions for text parsing - */ -#ifndef AI_PARSING_UTILS_H_INC -#define AI_PARSING_UTILS_H_INC - -#include "StringComparison.h" -#include "StringUtils.h" -#include - -namespace Assimp { - -// NOTE: the functions below are mostly intended as replacement for -// std::upper, std::lower, std::isupper, std::islower, std::isspace. -// we don't bother of locales. We don't want them. We want reliable -// (i.e. identical) results across all locales. - -// The functions below accept any character type, but know only -// about ASCII. However, UTF-32 is the only safe ASCII superset to -// use since it doesn't have multi-byte sequences. - -static const unsigned int BufferSize = 4096; - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE char_t ToLower( char_t in) -{ - return (in >= (char_t)'A' && in <= (char_t)'Z') ? (char_t)(in+0x20) : in; -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE char_t ToUpper( char_t in) { - return (in >= (char_t)'a' && in <= (char_t)'z') ? (char_t)(in-0x20) : in; -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool IsUpper( char_t in) -{ - return (in >= (char_t)'A' && in <= (char_t)'Z'); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool IsLower( char_t in) -{ - return (in >= (char_t)'a' && in <= (char_t)'z'); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool IsSpace( char_t in) -{ - return (in == (char_t)' ' || in == (char_t)'\t'); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool IsLineEnd( char_t in) -{ - return (in==(char_t)'\r'||in==(char_t)'\n'||in==(char_t)'\0'||in==(char_t)'\f'); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool IsSpaceOrNewLine( char_t in) -{ - return IsSpace(in) || IsLineEnd(in); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool SkipSpaces( const char_t* in, const char_t** out) -{ - while( *in == ( char_t )' ' || *in == ( char_t )'\t' ) { - ++in; - } - *out = in; - return !IsLineEnd(*in); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool SkipSpaces( const char_t** inout) -{ - return SkipSpaces(*inout,inout); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool SkipLine( const char_t* in, const char_t** out) -{ - while( *in != ( char_t )'\r' && *in != ( char_t )'\n' && *in != ( char_t )'\0' ) { - ++in; - } - - // files are opened in binary mode. Ergo there are both NL and CR - while( *in == ( char_t )'\r' || *in == ( char_t )'\n' ) { - ++in; - } - *out = in; - return *in != (char_t)'\0'; -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool SkipLine( const char_t** inout) -{ - return SkipLine(*inout,inout); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool SkipSpacesAndLineEnd( const char_t* in, const char_t** out) -{ - while( *in == ( char_t )' ' || *in == ( char_t )'\t' || *in == ( char_t )'\r' || *in == ( char_t )'\n' ) { - ++in; - } - *out = in; - return *in != '\0'; -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool SkipSpacesAndLineEnd( const char_t** inout) -{ - return SkipSpacesAndLineEnd(*inout,inout); -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool GetNextLine( const char_t*& buffer, char_t out[ BufferSize ] ) -{ - if( ( char_t )'\0' == *buffer ) { - return false; - } - - char* _out = out; - char* const end = _out + BufferSize; - while( !IsLineEnd( *buffer ) && _out < end ) { - *_out++ = *buffer++; - } - *_out = (char_t)'\0'; - - while( IsLineEnd( *buffer ) && '\0' != *buffer ) { - ++buffer; - } - - return true; -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool IsNumeric( char_t in) -{ - return ( in >= '0' && in <= '9' ) || '-' == in || '+' == in; -} - -// --------------------------------------------------------------------------------- -template -AI_FORCE_INLINE bool TokenMatch(char_t*& in, const char* token, unsigned int len) -{ - if (!::strncmp(token,in,len) && IsSpaceOrNewLine(in[len])) { - if (in[len] != '\0') { - in += len+1; - } else { - // If EOF after the token make sure we don't go past end of buffer - in += len; - } - return true; - } - - return false; -} -// --------------------------------------------------------------------------------- -/** @brief Case-ignoring version of TokenMatch - * @param in Input - * @param token Token to check for - * @param len Number of characters to check - */ -AI_FORCE_INLINE bool TokenMatchI(const char*& in, const char* token, unsigned int len) -{ - if (!ASSIMP_strincmp(token,in,len) && IsSpaceOrNewLine(in[len])) { - in += len+1; - return true; - } - return false; -} -// --------------------------------------------------------------------------------- -AI_FORCE_INLINE void SkipToken(const char*& in) -{ - SkipSpaces(&in); - while (!IsSpaceOrNewLine(*in))++in; -} -// --------------------------------------------------------------------------------- -AI_FORCE_INLINE std::string GetNextToken(const char*& in) -{ - SkipSpacesAndLineEnd(&in); - const char* cur = in; - while (!IsSpaceOrNewLine(*in))++in; - return std::string(cur,(size_t)(in-cur)); -} - -// --------------------------------------------------------------------------------- - -} // ! namespace Assimp - -#endif // ! AI_PARSING_UTILS_H_INC diff --git a/Engine/lib/assimp/code/PlyExporter.cpp b/Engine/lib/assimp/code/Ply/PlyExporter.cpp similarity index 99% rename from Engine/lib/assimp/code/PlyExporter.cpp rename to Engine/lib/assimp/code/Ply/PlyExporter.cpp index 4f9fa6c6f..5e21a88ac 100644 --- a/Engine/lib/assimp/code/PlyExporter.cpp +++ b/Engine/lib/assimp/code/Ply/PlyExporter.cpp @@ -111,7 +111,7 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina // make sure that all formatting happens using the standard, C locale and not the user's current locale const std::locale& l = std::locale("C"); mOutput.imbue(l); - mOutput.precision(16); + mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); unsigned int faces = 0u, vertices = 0u, components = 0u; for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) { diff --git a/Engine/lib/assimp/code/PlyExporter.h b/Engine/lib/assimp/code/Ply/PlyExporter.h similarity index 100% rename from Engine/lib/assimp/code/PlyExporter.h rename to Engine/lib/assimp/code/Ply/PlyExporter.h diff --git a/Engine/lib/assimp/code/PlyLoader.cpp b/Engine/lib/assimp/code/Ply/PlyLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/PlyLoader.cpp rename to Engine/lib/assimp/code/Ply/PlyLoader.cpp index 3924305cb..ca1ec22f8 100644 --- a/Engine/lib/assimp/code/PlyLoader.cpp +++ b/Engine/lib/assimp/code/Ply/PlyLoader.cpp @@ -49,7 +49,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "PlyLoader.h" #include -#include #include #include #include diff --git a/Engine/lib/assimp/code/PlyLoader.h b/Engine/lib/assimp/code/Ply/PlyLoader.h similarity index 100% rename from Engine/lib/assimp/code/PlyLoader.h rename to Engine/lib/assimp/code/Ply/PlyLoader.h diff --git a/Engine/lib/assimp/code/PlyParser.cpp b/Engine/lib/assimp/code/Ply/PlyParser.cpp similarity index 100% rename from Engine/lib/assimp/code/PlyParser.cpp rename to Engine/lib/assimp/code/Ply/PlyParser.cpp diff --git a/Engine/lib/assimp/code/PlyParser.h b/Engine/lib/assimp/code/Ply/PlyParser.h similarity index 100% rename from Engine/lib/assimp/code/PlyParser.h rename to Engine/lib/assimp/code/Ply/PlyParser.h diff --git a/Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.cpp b/Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.cpp new file mode 100644 index 000000000..75daeb6b5 --- /dev/null +++ b/Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.cpp @@ -0,0 +1,268 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 "ArmaturePopulate.h" + +#include +#include +#include +#include +#include + +namespace Assimp { + +/// The default class constructor. +ArmaturePopulate::ArmaturePopulate() : BaseProcess() +{} + +/// The class destructor. +ArmaturePopulate::~ArmaturePopulate() +{} + +bool ArmaturePopulate::IsActive(unsigned int pFlags) const { + return (pFlags & aiProcess_PopulateArmatureData) != 0; +} + +void ArmaturePopulate::SetupProperties(const Importer *pImp) { + // do nothing +} + +void ArmaturePopulate::Execute(aiScene *out) { + + // Now convert all bone positions to the correct mOffsetMatrix + std::vector bones; + std::vector nodes; + std::map bone_stack; + BuildBoneList(out->mRootNode, out->mRootNode, out, bones); + BuildNodeList(out->mRootNode, nodes); + + BuildBoneStack(out->mRootNode, out->mRootNode, out, bones, bone_stack, nodes); + + ASSIMP_LOG_DEBUG_F("Bone stack size: ", bone_stack.size()); + + 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()); + // lcl transform grab - done in generate_nodes :) + + // bone->mOffsetMatrix = bone_node->mTransformation; + aiNode *armature = GetArmatureRoot(bone_node, bones); + + ai_assert(armature); + + // set up bone armature id + bone->mArmature = armature; + + // set this bone node to be referenced properly + ai_assert(bone_node); + bone->mNode = bone_node; + } +} + + +/* Reprocess all nodes to calculate bone transforms properly based on the REAL + * mOffsetMatrix not the local. */ +/* Before this would use mesh transforms which is wrong for bone transforms */ +/* Before this would work for simple character skeletons but not complex meshes + * with multiple origins */ +/* Source: sketch fab log cutter fbx */ +void ArmaturePopulate::BuildBoneList(aiNode *current_node, + const aiNode *root_node, + const aiScene *scene, + std::vector &bones) { + ai_assert(scene); + for (unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId) { + aiNode *child = current_node->mChildren[nodeId]; + ai_assert(child); + + // check for bones + for (unsigned int meshId = 0; meshId < child->mNumMeshes; ++meshId) { + ai_assert(child->mMeshes); + unsigned int mesh_index = child->mMeshes[meshId]; + aiMesh *mesh = scene->mMeshes[mesh_index]; + ai_assert(mesh); + + for (unsigned int boneId = 0; boneId < mesh->mNumBones; ++boneId) { + aiBone *bone = mesh->mBones[boneId]; + ai_assert(bone); + + // duplicate meshes exist with the same bones sometimes :) + // so this must be detected + if (std::find(bones.begin(), bones.end(), bone) == bones.end()) { + // add the element once + bones.push_back(bone); + } + } + + // find mesh and get bones + // then do recursive lookup for bones in root node hierarchy + } + + BuildBoneList(child, root_node, scene, bones); + } +} + +/* Prepare flat node list which can be used for non recursive lookups later */ +void ArmaturePopulate::BuildNodeList(const aiNode *current_node, + std::vector &nodes) { + ai_assert(current_node); + + for (unsigned int nodeId = 0; nodeId < current_node->mNumChildren; ++nodeId) { + aiNode *child = current_node->mChildren[nodeId]; + ai_assert(child); + + nodes.push_back(child); + + BuildNodeList(child, nodes); + } +} + +/* A bone stack allows us to have multiple armatures, with the same bone names + * A bone stack allows us also to retrieve bones true transform even with + * duplicate names :) + */ +void ArmaturePopulate::BuildBoneStack(aiNode *current_node, + const aiNode *root_node, + const aiScene *scene, + const std::vector &bones, + std::map &bone_stack, + std::vector &node_stack) { + ai_assert(scene); + ai_assert(root_node); + ai_assert(!node_stack.empty()); + + for (aiBone *bone : bones) { + ai_assert(bone); + aiNode *node = GetNodeFromStack(bone->mName, node_stack); + if (node == nullptr) { + node_stack.clear(); + BuildNodeList(root_node, node_stack); + ASSIMP_LOG_DEBUG_F("Resetting bone stack: nullptr element ", bone->mName.C_Str()); + + node = GetNodeFromStack(bone->mName, node_stack); + + if (!node) { + ASSIMP_LOG_ERROR("serious import issue node for bone was not detected"); + continue; + } + } + + ASSIMP_LOG_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)); + } +} + + +/* Returns the armature root node */ +/* This is required to be detected for a bone initially, it will recurse up + * until it cannot find another bone and return the node No known failure + * points. (yet) + */ +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()); + return bone_node; + } + + bone_node = bone_node->mParent; + } + + ASSIMP_LOG_ERROR("GetArmatureRoot() can't find armature!"); + + return nullptr; +} + + + +/* Simple IsBoneNode check if this could be a bone */ +bool ArmaturePopulate::IsBoneNode(const aiString &bone_name, + std::vector &bones) { + for (aiBone *bone : bones) { + if (bone->mName == bone_name) { + return true; + } + } + + return false; +} + +/* Pop this node by name from the stack if found */ +/* Used in multiple armature situations with duplicate node / bone names */ +/* Known flaw: cannot have nodes with bone names, will be fixed in later release + */ +/* (serious to be fixed) Known flaw: nodes which have more than one bone could + * be prematurely dropped from stack */ +aiNode *ArmaturePopulate::GetNodeFromStack(const aiString &node_name, + std::vector &nodes) { + std::vector::iterator iter; + aiNode *found = nullptr; + for (iter = nodes.begin(); iter < nodes.end(); ++iter) { + aiNode *element = *iter; + ai_assert(element); + // node valid and node name matches + if (element->mName == node_name) { + found = element; + break; + } + } + + if (found != nullptr) { + ASSIMP_LOG_INFO_F("Removed node from stack: ", found->mName.C_Str()); + // now pop the element from the node list + nodes.erase(iter); + + return found; + } + + // unique names can cause this problem + ASSIMP_LOG_ERROR("[Serious] GetNodeFromStack() can't find node from stack!"); + + return nullptr; +} + + + + +} // Namespace Assimp diff --git a/Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.h b/Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.h new file mode 100644 index 000000000..aa1ad7c80 --- /dev/null +++ b/Engine/lib/assimp/code/PostProcessing/ArmaturePopulate.h @@ -0,0 +1,112 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 ARMATURE_POPULATE_H_ +#define ARMATURE_POPULATE_H_ + +#include "Common/BaseProcess.h" +#include +#include +#include + + +struct aiNode; +struct aiBone; + +namespace Assimp { + +// --------------------------------------------------------------------------- +/** Armature Populate: This is a post process designed + * To save you time when importing models into your game engines + * This was originally designed only for fbx but will work with other formats + * it is intended to auto populate aiBone data with armature and the aiNode + * This is very useful when dealing with skinned meshes + * or when dealing with many different skeletons + * It's off by default but recommend that you try it and use it + * It should reduce down any glue code you have in your + * importers + * You can contact RevoluPowered + * For more info about this +*/ +class ASSIMP_API ArmaturePopulate : public BaseProcess { +public: + /// The default class constructor. + ArmaturePopulate(); + + /// The class destructor. + virtual ~ArmaturePopulate(); + + /// Overwritten, @see BaseProcess + virtual bool IsActive( unsigned int pFlags ) const; + + /// Overwritten, @see BaseProcess + virtual void SetupProperties( const Importer* pImp ); + + /// Overwritten, @see BaseProcess + virtual void Execute( aiScene* pScene ); + + static aiNode *GetArmatureRoot(aiNode *bone_node, + std::vector &bone_list); + + static bool IsBoneNode(const aiString &bone_name, + std::vector &bones); + + static aiNode *GetNodeFromStack(const aiString &node_name, + std::vector &nodes); + + static void BuildNodeList(const aiNode *current_node, + std::vector &nodes); + + static void BuildBoneList(aiNode *current_node, const aiNode *root_node, + const aiScene *scene, + std::vector &bones); + + static void BuildBoneStack(aiNode *current_node, const aiNode *root_node, + const aiScene *scene, + const std::vector &bones, + std::map &bone_stack, + std::vector &node_stack); +}; + +} // Namespace Assimp + + +#endif // SCALE_PROCESS_H_ \ No newline at end of file diff --git a/Engine/lib/assimp/code/CalcTangentsProcess.cpp b/Engine/lib/assimp/code/PostProcessing/CalcTangentsProcess.cpp similarity index 98% rename from Engine/lib/assimp/code/CalcTangentsProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/CalcTangentsProcess.cpp index b30f39c27..a3f7dd255 100644 --- a/Engine/lib/assimp/code/CalcTangentsProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/CalcTangentsProcess.cpp @@ -212,7 +212,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) // project tangent and bitangent into the plane formed by the vertex' normal aiVector3D localTangent = tangent - meshNorm[p] * (tangent * meshNorm[p]); aiVector3D localBitangent = bitangent - meshNorm[p] * (bitangent * meshNorm[p]); - localTangent.Normalize(); localBitangent.Normalize(); + localTangent.NormalizeSafe(); localBitangent.NormalizeSafe(); // reconstruct tangent/bitangent according to normal and bitangent/tangent when it's infinite or NaN. bool invalid_tangent = is_special_float(localTangent.x) || is_special_float(localTangent.y) || is_special_float(localTangent.z); @@ -220,10 +220,10 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) if (invalid_tangent != invalid_bitangent) { if (invalid_tangent) { localTangent = meshNorm[p] ^ localBitangent; - localTangent.Normalize(); + localTangent.NormalizeSafe(); } else { localBitangent = localTangent ^ meshNorm[p]; - localBitangent.Normalize(); + localBitangent.NormalizeSafe(); } } diff --git a/Engine/lib/assimp/code/CalcTangentsProcess.h b/Engine/lib/assimp/code/PostProcessing/CalcTangentsProcess.h similarity index 98% rename from Engine/lib/assimp/code/CalcTangentsProcess.h rename to Engine/lib/assimp/code/PostProcessing/CalcTangentsProcess.h index 18775abcc..3568a624f 100644 --- a/Engine/lib/assimp/code/CalcTangentsProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/CalcTangentsProcess.h @@ -42,11 +42,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** @file Defines a post processing step to calculate tangents and - bitangents on all imported meshes.*/ + bi-tangents on all imported meshes.*/ #ifndef AI_CALCTANGENTSPROCESS_H_INC #define AI_CALCTANGENTSPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiMesh; diff --git a/Engine/lib/assimp/code/ComputeUVMappingProcess.cpp b/Engine/lib/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp similarity index 99% rename from Engine/lib/assimp/code/ComputeUVMappingProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp index bb571a551..df4d44337 100644 --- a/Engine/lib/assimp/code/ComputeUVMappingProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/ComputeUVMappingProcess.cpp @@ -354,12 +354,12 @@ void ComputeUVMappingProcess::ComputePlaneMapping(aiMesh* mesh,const aiVector3D& } else if (axis * base_axis_z >= angle_epsilon) { FindMeshCenter(mesh, center, min, max); - diffu = max.y - min.y; - diffv = max.z - min.z; + diffu = max.x - min.x; + diffv = max.y - min.y; for (unsigned int pnt = 0; pnt < mesh->mNumVertices;++pnt) { const aiVector3D& pos = mesh->mVertices[pnt]; - out[pnt].Set((pos.y - min.y) / diffu,(pos.x - min.x) / diffv,0.0); + out[pnt].Set((pos.x - min.x) / diffu,(pos.y - min.y) / diffv,0.0); } } // slower code path in case the mapping axis is not one of the coordinate system axes diff --git a/Engine/lib/assimp/code/ComputeUVMappingProcess.h b/Engine/lib/assimp/code/PostProcessing/ComputeUVMappingProcess.h similarity index 99% rename from Engine/lib/assimp/code/ComputeUVMappingProcess.h rename to Engine/lib/assimp/code/PostProcessing/ComputeUVMappingProcess.h index 24f6bb721..a6d36e06e 100644 --- a/Engine/lib/assimp/code/ComputeUVMappingProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/ComputeUVMappingProcess.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_COMPUTEUVMAPPING_H_INC #define AI_COMPUTEUVMAPPING_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include #include #include diff --git a/Engine/lib/assimp/code/ConvertToLHProcess.cpp b/Engine/lib/assimp/code/PostProcessing/ConvertToLHProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/ConvertToLHProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/ConvertToLHProcess.cpp diff --git a/Engine/lib/assimp/code/ConvertToLHProcess.h b/Engine/lib/assimp/code/PostProcessing/ConvertToLHProcess.h similarity index 99% rename from Engine/lib/assimp/code/ConvertToLHProcess.h rename to Engine/lib/assimp/code/PostProcessing/ConvertToLHProcess.h index 63351568d..f32b91fc3 100644 --- a/Engine/lib/assimp/code/ConvertToLHProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/ConvertToLHProcess.h @@ -52,7 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_CONVERTTOLHPROCESS_H_INC #include -#include "BaseProcess.h" + +#include "Common/BaseProcess.h" struct aiMesh; struct aiNodeAnim; diff --git a/Engine/lib/assimp/code/DeboneProcess.cpp b/Engine/lib/assimp/code/PostProcessing/DeboneProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/DeboneProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/DeboneProcess.cpp diff --git a/Engine/lib/assimp/code/DeboneProcess.h b/Engine/lib/assimp/code/PostProcessing/DeboneProcess.h similarity index 97% rename from Engine/lib/assimp/code/DeboneProcess.h rename to Engine/lib/assimp/code/PostProcessing/DeboneProcess.h index ba77aba70..8b64c2acc 100644 --- a/Engine/lib/assimp/code/DeboneProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/DeboneProcess.h @@ -44,17 +44,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_DEBONEPROCESS_H_INC #define AI_DEBONEPROCESS_H_INC -#include -#include -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include #include +#include +#include + +#// Forward declarations class DeboneTest; -namespace Assimp -{ +namespace Assimp { #if (!defined AI_DEBONE_THRESHOLD) # define AI_DEBONE_THRESHOLD 1.0f @@ -66,14 +67,11 @@ namespace Assimp * the bone are split from the mesh. The split off (new) mesh is boneless. At any * point in time, bones without affect upon a given mesh are to be removed. */ -class DeboneProcess : public BaseProcess -{ +class DeboneProcess : public BaseProcess { public: - DeboneProcess(); ~DeboneProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. @@ -91,7 +89,6 @@ public: void SetupProperties(const Importer* pImp); protected: - // ------------------------------------------------------------------- /** Executes the post processing step on the given imported data. * At the moment a process is not supposed to fail. diff --git a/Engine/lib/assimp/code/DropFaceNormalsProcess.cpp b/Engine/lib/assimp/code/PostProcessing/DropFaceNormalsProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/DropFaceNormalsProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/DropFaceNormalsProcess.cpp diff --git a/Engine/lib/assimp/code/DropFaceNormalsProcess.h b/Engine/lib/assimp/code/PostProcessing/DropFaceNormalsProcess.h similarity index 98% rename from Engine/lib/assimp/code/DropFaceNormalsProcess.h rename to Engine/lib/assimp/code/PostProcessing/DropFaceNormalsProcess.h index 0d116663b..c710c5a5e 100644 --- a/Engine/lib/assimp/code/DropFaceNormalsProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/DropFaceNormalsProcess.h @@ -44,23 +44,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_DROPFACENORMALPROCESS_H_INC #define AI_DROPFACENORMALPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include -namespace Assimp -{ +namespace Assimp { // --------------------------------------------------------------------------- /** The DropFaceNormalsProcess computes face normals for all faces of all meshes */ -class ASSIMP_API_WINONLY DropFaceNormalsProcess : public BaseProcess -{ +class ASSIMP_API_WINONLY DropFaceNormalsProcess : public BaseProcess { public: - DropFaceNormalsProcess(); ~DropFaceNormalsProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise diff --git a/Engine/lib/assimp/code/EmbedTexturesProcess.cpp b/Engine/lib/assimp/code/PostProcessing/EmbedTexturesProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/EmbedTexturesProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/EmbedTexturesProcess.cpp diff --git a/Engine/lib/assimp/code/EmbedTexturesProcess.h b/Engine/lib/assimp/code/PostProcessing/EmbedTexturesProcess.h similarity index 98% rename from Engine/lib/assimp/code/EmbedTexturesProcess.h rename to Engine/lib/assimp/code/PostProcessing/EmbedTexturesProcess.h index cdf40bef7..3c4b2eab4 100644 --- a/Engine/lib/assimp/code/EmbedTexturesProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/EmbedTexturesProcess.h @@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include diff --git a/Engine/lib/assimp/code/FindDegenerates.cpp b/Engine/lib/assimp/code/PostProcessing/FindDegenerates.cpp similarity index 99% rename from Engine/lib/assimp/code/FindDegenerates.cpp rename to Engine/lib/assimp/code/PostProcessing/FindDegenerates.cpp index 365f5d744..50fac46db 100644 --- a/Engine/lib/assimp/code/FindDegenerates.cpp +++ b/Engine/lib/assimp/code/PostProcessing/FindDegenerates.cpp @@ -228,6 +228,7 @@ bool FindDegeneratesProcess::ExecuteOnMesh( aiMesh* mesh) { if ( area < 1e-6 ) { if ( mConfigRemoveDegenerates ) { remove_me[ a ] = true; + ++deg; goto evil_jump_outside; } diff --git a/Engine/lib/assimp/code/FindDegenerates.h b/Engine/lib/assimp/code/PostProcessing/FindDegenerates.h similarity index 99% rename from Engine/lib/assimp/code/FindDegenerates.h rename to Engine/lib/assimp/code/PostProcessing/FindDegenerates.h index 880f5f16a..7a15e77cf 100644 --- a/Engine/lib/assimp/code/FindDegenerates.h +++ b/Engine/lib/assimp/code/PostProcessing/FindDegenerates.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FINDDEGENERATESPROCESS_H_INC #define AI_FINDDEGENERATESPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include class FindDegeneratesProcessTest; diff --git a/Engine/lib/assimp/code/FindInstancesProcess.cpp b/Engine/lib/assimp/code/PostProcessing/FindInstancesProcess.cpp similarity index 92% rename from Engine/lib/assimp/code/FindInstancesProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/FindInstancesProcess.cpp index 23f9d1581..64907458a 100644 --- a/Engine/lib/assimp/code/FindInstancesProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/FindInstancesProcess.cpp @@ -137,6 +137,11 @@ void FindInstancesProcess::Execute( aiScene* pScene) aiMesh* inst = pScene->mMeshes[i]; hashes[i] = GetMeshHash(inst); + // Find an appropriate epsilon + // to compare position differences against + float epsilon = ComputePositionEpsilon(inst); + epsilon *= epsilon; + for (int a = i-1; a >= 0; --a) { if (hashes[i] == hashes[a]) { @@ -154,12 +159,7 @@ void FindInstancesProcess::Execute( aiScene* pScene) orig->mPrimitiveTypes != inst->mPrimitiveTypes) continue; - // up to now the meshes are equal. find an appropriate - // epsilon to compare position differences against - float epsilon = ComputePositionEpsilon(inst); - epsilon *= epsilon; - - // now compare vertex positions, normals, + // up to now the meshes are equal. Now compare vertex positions, normals, // tangents and bitangents using this epsilon. if (orig->HasPositions()) { if(!CompareArrays(orig->mVertices,inst->mVertices,orig->mNumVertices,epsilon)) @@ -178,30 +178,30 @@ void FindInstancesProcess::Execute( aiScene* pScene) // use a constant epsilon for colors and UV coordinates static const float uvEpsilon = 10e-4f; { - unsigned int i, end = orig->GetNumUVChannels(); - for(i = 0; i < end; ++i) { - if (!orig->mTextureCoords[i]) { + unsigned int j, end = orig->GetNumUVChannels(); + for(j = 0; j < end; ++j) { + if (!orig->mTextureCoords[j]) { continue; } - if(!CompareArrays(orig->mTextureCoords[i],inst->mTextureCoords[i],orig->mNumVertices,uvEpsilon)) { + if(!CompareArrays(orig->mTextureCoords[j],inst->mTextureCoords[j],orig->mNumVertices,uvEpsilon)) { break; } } - if (i != end) { + if (j != end) { continue; } } { - unsigned int i, end = orig->GetNumColorChannels(); - for(i = 0; i < end; ++i) { - if (!orig->mColors[i]) { + unsigned int j, end = orig->GetNumColorChannels(); + for(j = 0; j < end; ++j) { + if (!orig->mColors[j]) { continue; } - if(!CompareArrays(orig->mColors[i],inst->mColors[i],orig->mNumVertices,uvEpsilon)) { + if(!CompareArrays(orig->mColors[j],inst->mColors[j],orig->mNumVertices,uvEpsilon)) { break; } } - if (i != end) { + if (j != end) { continue; } } diff --git a/Engine/lib/assimp/code/FindInstancesProcess.h b/Engine/lib/assimp/code/PostProcessing/FindInstancesProcess.h similarity index 98% rename from Engine/lib/assimp/code/FindInstancesProcess.h rename to Engine/lib/assimp/code/PostProcessing/FindInstancesProcess.h index ab4a371c7..64b838d7c 100644 --- a/Engine/lib/assimp/code/FindInstancesProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/FindInstancesProcess.h @@ -46,8 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FINDINSTANCES_H_INC #define AI_FINDINSTANCES_H_INC -#include "BaseProcess.h" -#include "ProcessHelper.h" +#include "Common/BaseProcess.h" +#include "PostProcessing/ProcessHelper.h" class FindInstancesProcessTest; namespace Assimp { diff --git a/Engine/lib/assimp/code/FindInvalidDataProcess.cpp b/Engine/lib/assimp/code/PostProcessing/FindInvalidDataProcess.cpp similarity index 99% rename from Engine/lib/assimp/code/FindInvalidDataProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/FindInvalidDataProcess.cpp index 433f04244..016884c6e 100644 --- a/Engine/lib/assimp/code/FindInvalidDataProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/FindInvalidDataProcess.cpp @@ -52,7 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FindInvalidDataProcess.h" #include "ProcessHelper.h" -#include #include #include diff --git a/Engine/lib/assimp/code/FindInvalidDataProcess.h b/Engine/lib/assimp/code/PostProcessing/FindInvalidDataProcess.h similarity index 99% rename from Engine/lib/assimp/code/FindInvalidDataProcess.h rename to Engine/lib/assimp/code/PostProcessing/FindInvalidDataProcess.h index 8504fb7b1..ce7375f34 100644 --- a/Engine/lib/assimp/code/FindInvalidDataProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/FindInvalidDataProcess.h @@ -46,7 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FINDINVALIDDATA_H_INC #define AI_FINDINVALIDDATA_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include #include diff --git a/Engine/lib/assimp/code/FixNormalsStep.cpp b/Engine/lib/assimp/code/PostProcessing/FixNormalsStep.cpp similarity index 100% rename from Engine/lib/assimp/code/FixNormalsStep.cpp rename to Engine/lib/assimp/code/PostProcessing/FixNormalsStep.cpp diff --git a/Engine/lib/assimp/code/FixNormalsStep.h b/Engine/lib/assimp/code/PostProcessing/FixNormalsStep.h similarity index 99% rename from Engine/lib/assimp/code/FixNormalsStep.h rename to Engine/lib/assimp/code/PostProcessing/FixNormalsStep.h index 6be27faef..f60ce596a 100644 --- a/Engine/lib/assimp/code/FixNormalsStep.h +++ b/Engine/lib/assimp/code/PostProcessing/FixNormalsStep.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_FIXNORMALSPROCESS_H_INC #define AI_FIXNORMALSPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiMesh; diff --git a/Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp b/Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp new file mode 100644 index 000000000..c013454fc --- /dev/null +++ b/Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.cpp @@ -0,0 +1,115 @@ +/* +--------------------------------------------------------------------------- +Open Asset Import Library (assimp) +--------------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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_GENBOUNDINGBOXES_PROCESS + +#include "PostProcessing/GenBoundingBoxesProcess.h" + +#include +#include + +namespace Assimp { + +GenBoundingBoxesProcess::GenBoundingBoxesProcess() +: BaseProcess() { + +} + +GenBoundingBoxesProcess::~GenBoundingBoxesProcess() { + // empty +} + +bool GenBoundingBoxesProcess::IsActive(unsigned int pFlags) const { + return 0 != ( pFlags & aiProcess_GenBoundingBoxes ); +} + +void checkMesh(aiMesh* mesh, aiVector3D& min, aiVector3D& max) { + ai_assert(nullptr != mesh); + + if (0 == mesh->mNumVertices) { + return; + } + + for (unsigned int i = 0; i < mesh->mNumVertices; ++i) { + const aiVector3D &pos = mesh->mVertices[i]; + if (pos.x < min.x) { + min.x = pos.x; + } + if (pos.y < min.y) { + min.y = pos.y; + } + if (pos.z < min.z) { + min.z = pos.z; + } + + if (pos.x > max.x) { + max.x = pos.x; + } + if (pos.y > max.y) { + max.y = pos.y; + } + if (pos.z > max.z) { + max.z = pos.z; + } + } +} + +void GenBoundingBoxesProcess::Execute(aiScene* pScene) { + if (nullptr == pScene) { + return; + } + + for (unsigned int i = 0; i < pScene->mNumMeshes; ++i) { + aiMesh* mesh = pScene->mMeshes[i]; + if (nullptr == mesh) { + continue; + } + + aiVector3D min(999999, 999999, 999999), max(-999999, -999999, -999999); + checkMesh(mesh, min, max); + mesh->mAABB.mMin = min; + mesh->mAABB.mMax = max; + } +} + +} // Namespace Assimp + +#endif // ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS diff --git a/Engine/lib/assimp/code/MathFunctions.h b/Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.h similarity index 65% rename from Engine/lib/assimp/code/MathFunctions.h rename to Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.h index cb3b69607..4b43c82a4 100644 --- a/Engine/lib/assimp/code/MathFunctions.h +++ b/Engine/lib/assimp/code/PostProcessing/GenBoundingBoxesProcess.h @@ -3,7 +3,7 @@ Open Asset Import Library (assimp) --------------------------------------------------------------------------- -Copyright (c) 2006-2016, assimp team +Copyright (c) 2006-2019, assimp team All rights reserved. @@ -39,39 +39,38 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------- */ -/** @file MathFunctions.h - * @brief Implementation of the math functions (gcd and lcm) - * - * Copied from BoostWorkaround/math +/** @file Defines a post-processing step to generate Axis-aligned bounding + * volumes for all meshes. */ +#pragma once + +#ifndef AI_GENBOUNDINGBOXESPROCESS_H_INC +#define AI_GENBOUNDINGBOXESPROCESS_H_INC + +#ifndef ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS + +#include "Common/BaseProcess.h" + namespace Assimp { -namespace Math { -// TODO: use binary GCD for unsigned integers .... -template < typename IntegerType > -IntegerType gcd( IntegerType a, IntegerType b ) -{ - const IntegerType zero = (IntegerType)0; - while ( true ) - { - if ( a == zero ) - return b; - b %= a; +/** Post-processing process to find axis-aligned bounding volumes for amm meshes + * used in a scene + */ +class ASSIMP_API GenBoundingBoxesProcess : public BaseProcess { +public: + /// The class constructor. + GenBoundingBoxesProcess(); + /// The class destructor. + ~GenBoundingBoxesProcess(); + /// Will return true, if aiProcess_GenBoundingBoxes is defined. + bool IsActive(unsigned int pFlags) const override; + /// The execution callback. + void Execute(aiScene* pScene) override; +}; - if ( b == zero ) - return a; - a %= b; - } -} +} // Namespace Assimp -template < typename IntegerType > -IntegerType lcm( IntegerType a, IntegerType b ) -{ - const IntegerType t = gcd (a,b); - if (!t)return t; - return a / t * b; -} +#endif // #ifndef ASSIMP_BUILD_NO_GENBOUNDINGBOXES_PROCESS -} -} +#endif // AI_GENBOUNDINGBOXESPROCESS_H_INC diff --git a/Engine/lib/assimp/code/GenFaceNormalsProcess.cpp b/Engine/lib/assimp/code/PostProcessing/GenFaceNormalsProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/GenFaceNormalsProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/GenFaceNormalsProcess.cpp diff --git a/Engine/lib/assimp/code/GenFaceNormalsProcess.h b/Engine/lib/assimp/code/PostProcessing/GenFaceNormalsProcess.h similarity index 98% rename from Engine/lib/assimp/code/GenFaceNormalsProcess.h rename to Engine/lib/assimp/code/PostProcessing/GenFaceNormalsProcess.h index c80ec9fdd..c641fd635 100644 --- a/Engine/lib/assimp/code/GenFaceNormalsProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/GenFaceNormalsProcess.h @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_GENFACENORMALPROCESS_H_INC #define AI_GENFACENORMALPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include namespace Assimp diff --git a/Engine/lib/assimp/code/GenVertexNormalsProcess.cpp b/Engine/lib/assimp/code/PostProcessing/GenVertexNormalsProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/GenVertexNormalsProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/GenVertexNormalsProcess.cpp diff --git a/Engine/lib/assimp/code/GenVertexNormalsProcess.h b/Engine/lib/assimp/code/PostProcessing/GenVertexNormalsProcess.h similarity index 94% rename from Engine/lib/assimp/code/GenVertexNormalsProcess.h rename to Engine/lib/assimp/code/PostProcessing/GenVertexNormalsProcess.h index 9142ad26f..2ceee17e8 100644 --- a/Engine/lib/assimp/code/GenVertexNormalsProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/GenVertexNormalsProcess.h @@ -45,24 +45,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_GENVERTEXNORMALPROCESS_H_INC #define AI_GENVERTEXNORMALPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/assbin_chunks.h" +#include "Common/BaseProcess.h" + #include +// Forward declarations class GenNormalsTest; namespace Assimp { // --------------------------------------------------------------------------- -/** The GenFaceNormalsProcess computes vertex normals for all vertizes +/** The GenFaceNormalsProcess computes vertex normals for all vertices */ -class ASSIMP_API GenVertexNormalsProcess : public BaseProcess -{ +class ASSIMP_API GenVertexNormalsProcess : public BaseProcess { public: - GenVertexNormalsProcess(); ~GenVertexNormalsProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. @@ -88,13 +88,10 @@ public: // setter for configMaxAngle - inline void SetMaxSmoothAngle(ai_real f) - { + inline void SetMaxSmoothAngle(ai_real f) { configMaxAngle =f; } -public: - // ------------------------------------------------------------------- /** Computes normals for a specific mesh * @param pcMesh Mesh @@ -104,7 +101,6 @@ public: bool GenMeshVertexNormals (aiMesh* pcMesh, unsigned int meshIndex); private: - /** Configuration option: maximum smoothing angle, in radians*/ ai_real configMaxAngle; mutable bool force_ = false; diff --git a/Engine/lib/assimp/code/ImproveCacheLocality.cpp b/Engine/lib/assimp/code/PostProcessing/ImproveCacheLocality.cpp similarity index 89% rename from Engine/lib/assimp/code/ImproveCacheLocality.cpp rename to Engine/lib/assimp/code/PostProcessing/ImproveCacheLocality.cpp index be6452dda..d0a016fa4 100644 --- a/Engine/lib/assimp/code/ImproveCacheLocality.cpp +++ b/Engine/lib/assimp/code/PostProcessing/ImproveCacheLocality.cpp @@ -45,14 +45,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* The algorithm is roughly basing on this paper: * http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf - * .. although overdraw rduction isn't implemented yet ... + * .. although overdraw reduction isn't implemented yet ... */ - - // internal headers -#include "ImproveCacheLocality.h" -#include "VertexTriangleAdjacency.h" +#include "PostProcessing/ImproveCacheLocality.h" +#include "Common/VertexTriangleAdjacency.h" + #include #include #include @@ -64,36 +63,33 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer -ImproveCacheLocalityProcess::ImproveCacheLocalityProcess() { - configCacheDepth = PP_ICL_PTCACHE_SIZE; +ImproveCacheLocalityProcess::ImproveCacheLocalityProcess() +: mConfigCacheDepth(PP_ICL_PTCACHE_SIZE) { + // empty } // ------------------------------------------------------------------------------------------------ // Destructor, private as well -ImproveCacheLocalityProcess::~ImproveCacheLocalityProcess() -{ +ImproveCacheLocalityProcess::~ImproveCacheLocalityProcess() { // nothing to do here } // ------------------------------------------------------------------------------------------------ // Returns whether the processing step is present in the given flag field. -bool ImproveCacheLocalityProcess::IsActive( unsigned int pFlags) const -{ +bool ImproveCacheLocalityProcess::IsActive( unsigned int pFlags) const { return (pFlags & aiProcess_ImproveCacheLocality) != 0; } // ------------------------------------------------------------------------------------------------ // Setup configuration -void ImproveCacheLocalityProcess::SetupProperties(const Importer* pImp) -{ +void ImproveCacheLocalityProcess::SetupProperties(const Importer* pImp) { // AI_CONFIG_PP_ICL_PTCACHE_SIZE controls the target cache size for the optimizer - configCacheDepth = pImp->GetPropertyInteger(AI_CONFIG_PP_ICL_PTCACHE_SIZE,PP_ICL_PTCACHE_SIZE); + mConfigCacheDepth = pImp->GetPropertyInteger(AI_CONFIG_PP_ICL_PTCACHE_SIZE,PP_ICL_PTCACHE_SIZE); } // ------------------------------------------------------------------------------------------------ // Executes the post processing step on the given imported data. -void ImproveCacheLocalityProcess::Execute( aiScene* pScene) -{ +void ImproveCacheLocalityProcess::Execute( aiScene* pScene) { if (!pScene->mNumMeshes) { ASSIMP_LOG_DEBUG("ImproveCacheLocalityProcess skipped; there are no meshes"); return; @@ -103,7 +99,7 @@ void ImproveCacheLocalityProcess::Execute( aiScene* pScene) float out = 0.f; unsigned int numf = 0, numm = 0; - for( unsigned int a = 0; a < pScene->mNumMeshes; a++){ + for( unsigned int a = 0; a < pScene->mNumMeshes; ++a ){ const float res = ProcessMesh( pScene->mMeshes[a],a); if (res) { numf += pScene->mMeshes[a]->mNumFaces; @@ -112,51 +108,50 @@ void ImproveCacheLocalityProcess::Execute( aiScene* pScene) } } if (!DefaultLogger::isNullLogger()) { - ASSIMP_LOG_INFO_F("Cache relevant are ", numm, " meshes (", numf," faces). Average output ACMR is ", out / numf ); + if (numf > 0) { + ASSIMP_LOG_INFO_F("Cache relevant are ", numm, " meshes (", numf, " faces). Average output ACMR is ", out / numf); + } ASSIMP_LOG_DEBUG("ImproveCacheLocalityProcess finished. "); } } // ------------------------------------------------------------------------------------------------ // Improves the cache coherency of a specific mesh -float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshNum) -{ +ai_real ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshNum) { // TODO: rewrite this to use std::vector or boost::shared_array - ai_assert(NULL != pMesh); + ai_assert(nullptr != pMesh); // Check whether the input data is valid // - there must be vertices and faces // - all faces must be triangulated or we can't operate on them if (!pMesh->HasFaces() || !pMesh->HasPositions()) - return 0.f; + return static_cast(0.f); if (pMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE) { ASSIMP_LOG_ERROR("This algorithm works on triangle meshes only"); - return 0.f; + return static_cast(0.f); } - if(pMesh->mNumVertices <= configCacheDepth) { - return 0.f; + if(pMesh->mNumVertices <= mConfigCacheDepth) { + return static_cast(0.f); } - float fACMR = 3.f; + ai_real fACMR = 3.f; const aiFace* const pcEnd = pMesh->mFaces+pMesh->mNumFaces; // Input ACMR is for logging purposes only if (!DefaultLogger::isNullLogger()) { - unsigned int* piFIFOStack = new unsigned int[configCacheDepth]; - memset(piFIFOStack,0xff,configCacheDepth*sizeof(unsigned int)); + unsigned int* piFIFOStack = new unsigned int[mConfigCacheDepth]; + memset(piFIFOStack,0xff,mConfigCacheDepth*sizeof(unsigned int)); unsigned int* piCur = piFIFOStack; - const unsigned int* const piCurEnd = piFIFOStack + configCacheDepth; + const unsigned int* const piCurEnd = piFIFOStack + mConfigCacheDepth; // count the number of cache misses unsigned int iCacheMisses = 0; for (const aiFace* pcFace = pMesh->mFaces;pcFace != pcEnd;++pcFace) { - for (unsigned int qq = 0; qq < 3;++qq) { bool bInCache = false; - for (unsigned int* pp = piFIFOStack;pp < piCurEnd;++pp) { if (*pp == pcFace->mIndices[qq]) { // the vertex is in cache @@ -174,7 +169,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh } } delete[] piFIFOStack; - fACMR = (float)iCacheMisses / pMesh->mNumFaces; + fACMR = (ai_real) iCacheMisses / pMesh->mNumFaces; if (3.0 == fACMR) { char szBuff[128]; // should be sufficiently large in every case @@ -183,7 +178,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh // smaller than 3.0 ... ai_snprintf(szBuff,128,"Mesh %u: Not suitable for vcache optimization",meshNum); ASSIMP_LOG_WARN(szBuff); - return 0.f; + return static_cast(0.f); } } @@ -256,7 +251,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh int ivdx = 0; int ics = 1; - int iStampCnt = configCacheDepth+1; + int iStampCnt = mConfigCacheDepth+1; while (ivdx >= 0) { unsigned int icnt = piNumTriPtrNoModify[ivdx]; @@ -292,7 +287,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh *piCSIter++ = dp; // if the vertex is not yet in cache, set its cache count - if (iStampCnt-piCachingStamps[dp] > configCacheDepth) { + if (iStampCnt-piCachingStamps[dp] > mConfigCacheDepth) { piCachingStamps[dp] = iStampCnt++; ++iCacheMisses; } @@ -317,7 +312,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh // will the vertex be in cache, even after fanning occurs? unsigned int tmp; - if ((tmp = iStampCnt-piCachingStamps[dp]) + 2*piNumTriPtr[dp] <= configCacheDepth) { + if ((tmp = iStampCnt-piCachingStamps[dp]) + 2*piNumTriPtr[dp] <= mConfigCacheDepth) { priority = tmp; } @@ -354,7 +349,7 @@ float ImproveCacheLocalityProcess::ProcessMesh( aiMesh* pMesh, unsigned int mesh } } } - float fACMR2 = 0.0f; + ai_real fACMR2 = 0.0f; if (!DefaultLogger::isNullLogger()) { fACMR2 = (float)iCacheMisses / pMesh->mNumFaces; diff --git a/Engine/lib/assimp/code/ImproveCacheLocality.h b/Engine/lib/assimp/code/PostProcessing/ImproveCacheLocality.h similarity index 96% rename from Engine/lib/assimp/code/ImproveCacheLocality.h rename to Engine/lib/assimp/code/PostProcessing/ImproveCacheLocality.h index 1b29ee0d6..de25ecd9f 100644 --- a/Engine/lib/assimp/code/ImproveCacheLocality.h +++ b/Engine/lib/assimp/code/PostProcessing/ImproveCacheLocality.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_IMPROVECACHELOCALITY_H_INC #define AI_IMPROVECACHELOCALITY_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include struct aiMesh; @@ -87,12 +88,12 @@ protected: * @param pMesh The mesh to process. * @param meshNum Index of the mesh to process */ - float ProcessMesh( aiMesh* pMesh, unsigned int meshNum); + ai_real ProcessMesh( aiMesh* pMesh, unsigned int meshNum); private: //! Configuration parameter: specifies the size of the cache to //! optimize the vertex data for. - unsigned int configCacheDepth; + unsigned int mConfigCacheDepth; }; } // end of namespace Assimp diff --git a/Engine/lib/assimp/code/JoinVerticesProcess.cpp b/Engine/lib/assimp/code/PostProcessing/JoinVerticesProcess.cpp similarity index 93% rename from Engine/lib/assimp/code/JoinVerticesProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/JoinVerticesProcess.cpp index 914ec05b4..f121fc60d 100644 --- a/Engine/lib/assimp/code/JoinVerticesProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/JoinVerticesProcess.cpp @@ -431,31 +431,6 @@ int JoinVerticesProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex) bone->mWeights = new aiVertexWeight[bone->mNumWeights]; memcpy( bone->mWeights, &newWeights[0], bone->mNumWeights * sizeof( aiVertexWeight)); } - else { - - /* NOTE: - * - * In the algorithm above we're assuming that there are no vertices - * with a different bone weight setup at the same position. That wouldn't - * make sense, but it is not absolutely impossible. SkeletonMeshBuilder - * for example generates such input data if two skeleton points - * share the same position. Again this doesn't make sense but is - * reality for some model formats (MD5 for example uses these special - * nodes as attachment tags for its weapons). - * - * Then it is possible that a bone has no weights anymore .... as a quick - * workaround, we're just removing these bones. If they're animated, - * model geometry might be modified but at least there's no risk of a crash. - */ - delete bone; - --pMesh->mNumBones; - for (unsigned int n = a; n < pMesh->mNumBones; ++n) { - pMesh->mBones[n] = pMesh->mBones[n+1]; - } - - --a; - ASSIMP_LOG_WARN("Removing bone -> no weights remaining"); - } } return pMesh->mNumVertices; } diff --git a/Engine/lib/assimp/code/JoinVerticesProcess.h b/Engine/lib/assimp/code/PostProcessing/JoinVerticesProcess.h similarity index 97% rename from Engine/lib/assimp/code/JoinVerticesProcess.h rename to Engine/lib/assimp/code/PostProcessing/JoinVerticesProcess.h index 66fa362de..e017ae62d 100644 --- a/Engine/lib/assimp/code/JoinVerticesProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/JoinVerticesProcess.h @@ -45,7 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_JOINVERTICESPROCESS_H_INC #define AI_JOINVERTICESPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include struct aiMesh; @@ -61,13 +62,11 @@ namespace Assimp * erases all but one of the copies. This usually reduces the number of vertices * in a mesh by a serious amount and is the standard form to render a mesh. */ -class ASSIMP_API JoinVerticesProcess : public BaseProcess -{ +class ASSIMP_API JoinVerticesProcess : public BaseProcess { public: JoinVerticesProcess(); ~JoinVerticesProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise @@ -83,15 +82,12 @@ public: */ void Execute( aiScene* pScene); -public: // ------------------------------------------------------------------- /** Unites identical vertices in the given mesh. * @param pMesh The mesh to process. * @param meshIndex Index of the mesh to process */ int ProcessMesh( aiMesh* pMesh, unsigned int meshIndex); - -private: }; } // end of namespace Assimp diff --git a/Engine/lib/assimp/code/LimitBoneWeightsProcess.cpp b/Engine/lib/assimp/code/PostProcessing/LimitBoneWeightsProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/LimitBoneWeightsProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/LimitBoneWeightsProcess.cpp diff --git a/Engine/lib/assimp/code/LimitBoneWeightsProcess.h b/Engine/lib/assimp/code/PostProcessing/LimitBoneWeightsProcess.h similarity index 93% rename from Engine/lib/assimp/code/LimitBoneWeightsProcess.h rename to Engine/lib/assimp/code/PostProcessing/LimitBoneWeightsProcess.h index 3602fd8ed..73c2a68d5 100644 --- a/Engine/lib/assimp/code/LimitBoneWeightsProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/LimitBoneWeightsProcess.h @@ -44,14 +44,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_LIMITBONEWEIGHTSPROCESS_H_INC #define AI_LIMITBONEWEIGHTSPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" +// Forward declarations struct aiMesh; class LimitBoneWeightsTest; -namespace Assimp -{ +namespace Assimp { // NOTE: If you change these limits, don't forget to change the // corresponding values in all Assimp ports @@ -72,14 +72,11 @@ namespace Assimp * The other weights on this bone are then renormalized to assure the sum weight * to be 1. */ -class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess -{ +class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess { public: - LimitBoneWeightsProcess(); ~LimitBoneWeightsProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag. * @param pFlags The processing flags the importer was called with. @@ -96,8 +93,6 @@ public: */ void SetupProperties(const Importer* pImp); -public: - // ------------------------------------------------------------------- /** Limits the bone weight count for all vertices in the given mesh. * @param pMesh The mesh to process. @@ -111,34 +106,29 @@ public: */ void Execute( aiScene* pScene); - -public: - // ------------------------------------------------------------------- /** Describes a bone weight on a vertex */ - struct Weight - { + struct Weight { unsigned int mBone; ///< Index of the bone float mWeight; ///< Weight of that bone on this vertex Weight() AI_NO_EXCEPT : mBone(0) - , mWeight(0.0f) - { } + , mWeight(0.0f) { + // empty + } Weight( unsigned int pBone, float pWeight) - { - mBone = pBone; - mWeight = pWeight; + : mBone(pBone) + , mWeight(pWeight) { + // empty } /** Comparison operator to sort bone weights by descending weight */ - bool operator < (const Weight& pWeight) const - { + bool operator < (const Weight& pWeight) const { return mWeight > pWeight.mWeight; } }; -public: /** Maximum number of bones influencing any single vertex. */ unsigned int mMaxWeights; }; diff --git a/Engine/lib/assimp/code/MakeVerboseFormat.cpp b/Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.cpp similarity index 89% rename from Engine/lib/assimp/code/MakeVerboseFormat.cpp rename to Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.cpp index 50ff5ed93..41f50a5ba 100644 --- a/Engine/lib/assimp/code/MakeVerboseFormat.cpp +++ b/Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.cpp @@ -224,3 +224,32 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh) } return (pcMesh->mNumVertices != iOldNumVertices); } + + +// ------------------------------------------------------------------------------------------------ +bool IsMeshInVerboseFormat(const aiMesh* mesh) { + // avoid slow vector specialization + std::vector seen(mesh->mNumVertices,0); + for(unsigned int i = 0; i < mesh->mNumFaces; ++i) { + const aiFace& f = mesh->mFaces[i]; + for(unsigned int j = 0; j < f.mNumIndices; ++j) { + if(++seen[f.mIndices[j]] == 2) { + // found a duplicate index + return false; + } + } + } + + return true; +} + +// ------------------------------------------------------------------------------------------------ +bool MakeVerboseFormatProcess::IsVerboseFormat(const aiScene* pScene) { + for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) { + if(!IsMeshInVerboseFormat(pScene->mMeshes[i])) { + return false; + } + } + + return true; +} diff --git a/Engine/lib/assimp/code/MakeVerboseFormat.h b/Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.h similarity index 92% rename from Engine/lib/assimp/code/MakeVerboseFormat.h rename to Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.h index d12db63ae..8565d5933 100644 --- a/Engine/lib/assimp/code/MakeVerboseFormat.h +++ b/Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.h @@ -46,7 +46,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_MAKEVERBOSEFORMAT_H_INC #define AI_MAKEVERBOSEFORMAT_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + struct aiMesh; namespace Assimp { @@ -93,6 +94,13 @@ public: * @param pScene The imported data to work at. */ void Execute( aiScene* pScene); +public: + + // ------------------------------------------------------------------- + /** Checks whether the scene is already in verbose format. + * @param pScene The data to check. + * @return true if the scene is already in verbose format. */ + static bool IsVerboseFormat(const aiScene* pScene); private: diff --git a/Engine/lib/assimp/code/OptimizeGraph.cpp b/Engine/lib/assimp/code/PostProcessing/OptimizeGraph.cpp similarity index 99% rename from Engine/lib/assimp/code/OptimizeGraph.cpp rename to Engine/lib/assimp/code/PostProcessing/OptimizeGraph.cpp index add9ab79e..5db51f58b 100644 --- a/Engine/lib/assimp/code/OptimizeGraph.cpp +++ b/Engine/lib/assimp/code/PostProcessing/OptimizeGraph.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, diff --git a/Engine/lib/assimp/code/OptimizeGraph.h b/Engine/lib/assimp/code/PostProcessing/OptimizeGraph.h similarity index 93% rename from Engine/lib/assimp/code/OptimizeGraph.h rename to Engine/lib/assimp/code/PostProcessing/OptimizeGraph.h index e5bbed767..82cc5db3f 100644 --- a/Engine/lib/assimp/code/OptimizeGraph.h +++ b/Engine/lib/assimp/code/PostProcessing/OptimizeGraph.h @@ -46,13 +46,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_OPTIMIZEGRAPHPROCESS_H_INC #define AI_OPTIMIZEGRAPHPROCESS_H_INC -#include "BaseProcess.h" -#include "ProcessHelper.h" +#include "Common/BaseProcess.h" +#include "PostProcessing/ProcessHelper.h" + #include + #include +// Forward declarations struct aiMesh; + class OptimizeGraphProcessTest; + namespace Assimp { // ----------------------------------------------------------------------------- @@ -64,14 +69,11 @@ namespace Assimp { * @see aiProcess_OptimizeGraph for a detailed description of the * algorithm being applied. */ -class OptimizeGraphProcess : public BaseProcess -{ +class OptimizeGraphProcess : public BaseProcess { public: - OptimizeGraphProcess(); ~OptimizeGraphProcess(); -public: // ------------------------------------------------------------------- bool IsActive( unsigned int pFlags) const; @@ -81,14 +83,12 @@ public: // ------------------------------------------------------------------- void SetupProperties(const Importer* pImp); - // ------------------------------------------------------------------- /** @brief Add a list of node names to be locked and not modified. * @param in List of nodes. See #AI_CONFIG_PP_OG_EXCLUDE_LIST for * format explanations. */ - inline void AddLockedNodeList(std::string& in) - { + inline void AddLockedNodeList(std::string& in) { ConvertListToStrings (in,locked_nodes); } @@ -96,8 +96,7 @@ public: /** @brief Add another node to be locked and not modified. * @param name Name to be locked */ - inline void AddLockedNode(std::string& name) - { + inline void AddLockedNode(std::string& name) { locked_nodes.push_back(name); } @@ -105,25 +104,21 @@ public: /** @brief Remove a node from the list of locked nodes. * @param name Name to be unlocked */ - inline void RemoveLockedNode(std::string& name) - { + inline void RemoveLockedNode(std::string& name) { locked_nodes.remove(name); } protected: - void CollectNewChildren(aiNode* nd, std::list& nodes); void FindInstancedMeshes (aiNode* pNode); private: - #ifdef AI_OG_USE_HASHING typedef std::set LockedSetType; #else typedef std::set LockedSetType; #endif - //! Scene we're working with aiScene* mScene; diff --git a/Engine/lib/assimp/code/OptimizeMeshes.cpp b/Engine/lib/assimp/code/PostProcessing/OptimizeMeshes.cpp similarity index 100% rename from Engine/lib/assimp/code/OptimizeMeshes.cpp rename to Engine/lib/assimp/code/PostProcessing/OptimizeMeshes.cpp diff --git a/Engine/lib/assimp/code/OptimizeMeshes.h b/Engine/lib/assimp/code/PostProcessing/OptimizeMeshes.h similarity index 97% rename from Engine/lib/assimp/code/OptimizeMeshes.h rename to Engine/lib/assimp/code/PostProcessing/OptimizeMeshes.h index 9f46f349b..dec4ab52d 100644 --- a/Engine/lib/assimp/code/OptimizeMeshes.h +++ b/Engine/lib/assimp/code/PostProcessing/OptimizeMeshes.h @@ -46,8 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_OPTIMIZEMESHESPROCESS_H_INC #define AI_OPTIMIZEMESHESPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include + #include struct aiMesh; @@ -64,16 +66,14 @@ namespace Assimp { * * @note Instanced meshes are currently not processed. */ -class OptimizeMeshesProcess : public BaseProcess -{ +class OptimizeMeshesProcess : public BaseProcess { public: /// @brief The class constructor. OptimizeMeshesProcess(); - /// @brief The class destcructor, + /// @brief The class destructor. ~OptimizeMeshesProcess(); - /** @brief Internal utility to store additional mesh info */ struct MeshInfo { diff --git a/Engine/lib/assimp/code/PretransformVertices.cpp b/Engine/lib/assimp/code/PostProcessing/PretransformVertices.cpp similarity index 100% rename from Engine/lib/assimp/code/PretransformVertices.cpp rename to Engine/lib/assimp/code/PostProcessing/PretransformVertices.cpp diff --git a/Engine/lib/assimp/code/PretransformVertices.h b/Engine/lib/assimp/code/PostProcessing/PretransformVertices.h similarity index 97% rename from Engine/lib/assimp/code/PretransformVertices.h rename to Engine/lib/assimp/code/PostProcessing/PretransformVertices.h index b7329af13..b2982951e 100644 --- a/Engine/lib/assimp/code/PretransformVertices.h +++ b/Engine/lib/assimp/code/PostProcessing/PretransformVertices.h @@ -47,13 +47,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_PRETRANSFORMVERTICES_H_INC #define AI_PRETRANSFORMVERTICES_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include + #include #include +// Forward declarations struct aiNode; + class PretransformVerticesTest; + namespace Assimp { // --------------------------------------------------------------------------- @@ -80,10 +85,10 @@ public: // ------------------------------------------------------------------- /** @brief Toggle the 'keep hierarchy' option - * @param d hm ... difficult to guess what this means, hu!? + * @param keep true for keep configuration. */ - void KeepHierarchy(bool d) { - configKeepHierarchy = d; + void KeepHierarchy(bool keep) { + configKeepHierarchy = keep; } // ------------------------------------------------------------------- @@ -148,8 +153,6 @@ private: // Build reference counters for all meshes void BuildMeshRefCountArray(aiNode* nd, unsigned int * refs); - - //! Configuration option: keep scene hierarchy as long as possible bool configKeepHierarchy; bool configNormalize; diff --git a/Engine/lib/assimp/code/ProcessHelper.cpp b/Engine/lib/assimp/code/PostProcessing/ProcessHelper.cpp similarity index 100% rename from Engine/lib/assimp/code/ProcessHelper.cpp rename to Engine/lib/assimp/code/PostProcessing/ProcessHelper.cpp diff --git a/Engine/lib/assimp/code/ProcessHelper.h b/Engine/lib/assimp/code/PostProcessing/ProcessHelper.h similarity index 99% rename from Engine/lib/assimp/code/ProcessHelper.h rename to Engine/lib/assimp/code/PostProcessing/ProcessHelper.h index c59f3217b..0afcc4142 100644 --- a/Engine/lib/assimp/code/ProcessHelper.h +++ b/Engine/lib/assimp/code/PostProcessing/ProcessHelper.h @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include #include diff --git a/Engine/lib/assimp/code/RemoveRedundantMaterials.cpp b/Engine/lib/assimp/code/PostProcessing/RemoveRedundantMaterials.cpp similarity index 97% rename from Engine/lib/assimp/code/RemoveRedundantMaterials.cpp rename to Engine/lib/assimp/code/PostProcessing/RemoveRedundantMaterials.cpp index 632bdca3f..49ec8f5c4 100644 --- a/Engine/lib/assimp/code/RemoveRedundantMaterials.cpp +++ b/Engine/lib/assimp/code/PostProcessing/RemoveRedundantMaterials.cpp @@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "RemoveRedundantMaterials.h" #include #include "ProcessHelper.h" -#include "MaterialSystem.h" +#include "Material/MaterialSystem.h" #include using namespace Assimp; @@ -57,7 +57,7 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer RemoveRedundantMatsProcess::RemoveRedundantMatsProcess() -: configFixedMaterials() { +: mConfigFixedMaterials() { // nothing to do here } @@ -80,7 +80,7 @@ bool RemoveRedundantMatsProcess::IsActive( unsigned int pFlags) const void RemoveRedundantMatsProcess::SetupProperties(const Importer* pImp) { // Get value of AI_CONFIG_PP_RRM_EXCLUDE_LIST - configFixedMaterials = pImp->GetPropertyString(AI_CONFIG_PP_RRM_EXCLUDE_LIST,""); + mConfigFixedMaterials = pImp->GetPropertyString(AI_CONFIG_PP_RRM_EXCLUDE_LIST,""); } // ------------------------------------------------------------------------------------------------ @@ -100,10 +100,10 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene) // If a list of materials to be excluded was given, match the list with // our imported materials and 'salt' all positive matches to ensure that // we get unique hashes later. - if (configFixedMaterials.length()) { + if (mConfigFixedMaterials.length()) { std::list strings; - ConvertListToStrings(configFixedMaterials,strings); + ConvertListToStrings(mConfigFixedMaterials,strings); for (unsigned int i = 0; i < pScene->mNumMaterials;++i) { aiMaterial* mat = pScene->mMaterials[i]; diff --git a/Engine/lib/assimp/code/RemoveRedundantMaterials.h b/Engine/lib/assimp/code/PostProcessing/RemoveRedundantMaterials.h similarity index 92% rename from Engine/lib/assimp/code/RemoveRedundantMaterials.h rename to Engine/lib/assimp/code/PostProcessing/RemoveRedundantMaterials.h index dbd4d44cc..1f32a0abf 100644 --- a/Engine/lib/assimp/code/RemoveRedundantMaterials.h +++ b/Engine/lib/assimp/code/PostProcessing/RemoveRedundantMaterials.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_REMOVEREDUNDANTMATERIALS_H_INC #define AI_REMOVEREDUNDANTMATERIALS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include class RemoveRedundantMatsTest; @@ -57,8 +57,7 @@ namespace Assimp { /** RemoveRedundantMatsProcess: Post-processing step to remove redundant * materials from the imported scene. */ -class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess -{ +class ASSIMP_API RemoveRedundantMatsProcess : public BaseProcess { public: /// The default class constructor. RemoveRedundantMatsProcess(); @@ -66,7 +65,6 @@ public: /// The class destructor. ~RemoveRedundantMatsProcess(); -public: // ------------------------------------------------------------------- // Check whether step is active bool IsActive( unsigned int pFlags) const; @@ -79,27 +77,25 @@ public: // Setup import settings void SetupProperties(const Importer* pImp); - // ------------------------------------------------------------------- - /** @brief Set list of fixed (unmutable) materials + /** @brief Set list of fixed (inmutable) materials * @param fixed See #AI_CONFIG_PP_RRM_EXCLUDE_LIST */ void SetFixedMaterialsString(const std::string& fixed = "") { - configFixedMaterials = fixed; + mConfigFixedMaterials = fixed; } // ------------------------------------------------------------------- - /** @brief Get list of fixed (unmutable) materials + /** @brief Get list of fixed (inmutable) materials * @return See #AI_CONFIG_PP_RRM_EXCLUDE_LIST */ const std::string& GetFixedMaterialsString() const { - return configFixedMaterials; + return mConfigFixedMaterials; } private: - //! Configuration option: list of all fixed materials - std::string configFixedMaterials; + std::string mConfigFixedMaterials; }; } // end of namespace Assimp diff --git a/Engine/lib/assimp/code/RemoveVCProcess.cpp b/Engine/lib/assimp/code/PostProcessing/RemoveVCProcess.cpp similarity index 100% rename from Engine/lib/assimp/code/RemoveVCProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/RemoveVCProcess.cpp diff --git a/Engine/lib/assimp/code/RemoveVCProcess.h b/Engine/lib/assimp/code/PostProcessing/RemoveVCProcess.h similarity index 99% rename from Engine/lib/assimp/code/RemoveVCProcess.h rename to Engine/lib/assimp/code/PostProcessing/RemoveVCProcess.h index 617d7b9b2..7bb21a833 100644 --- a/Engine/lib/assimp/code/RemoveVCProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/RemoveVCProcess.h @@ -44,7 +44,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_REMOVEVCPROCESS_H_INCLUDED #define AI_REMOVEVCPROCESS_H_INCLUDED -#include "BaseProcess.h" +#include "Common/BaseProcess.h" + #include class RemoveVCProcessTest; diff --git a/Engine/lib/assimp/code/PostProcessing/ScaleProcess.cpp b/Engine/lib/assimp/code/PostProcessing/ScaleProcess.cpp new file mode 100644 index 000000000..ac770c41f --- /dev/null +++ b/Engine/lib/assimp/code/PostProcessing/ScaleProcess.cpp @@ -0,0 +1,208 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 "ScaleProcess.h" + +#include +#include +#include + +namespace Assimp { + +ScaleProcess::ScaleProcess() +: BaseProcess() +, mScale( AI_CONFIG_GLOBAL_SCALE_FACTOR_DEFAULT ) { +} + +ScaleProcess::~ScaleProcess() { + // empty +} + +void ScaleProcess::setScale( ai_real scale ) { + mScale = scale; +} + +ai_real ScaleProcess::getScale() const { + return mScale; +} + +bool ScaleProcess::IsActive( unsigned int pFlags ) const { + return ( pFlags & aiProcess_GlobalScale ) != 0; +} + +void ScaleProcess::SetupProperties( const Importer* pImp ) { + // User scaling + mScale = pImp->GetPropertyFloat( AI_CONFIG_GLOBAL_SCALE_FACTOR_KEY, 1.0f ); + + // File scaling * Application Scaling + float importerScale = pImp->GetPropertyFloat( AI_CONFIG_APP_SCALE_KEY, 1.0f ); + + // apply scale to the scale + // helps prevent bugs with backward compatibility for anyone using normal scaling. + mScale *= importerScale; +} + +void ScaleProcess::Execute( aiScene* pScene ) { + if(mScale == 1.0f) { + return; // nothing to scale + } + + ai_assert( mScale != 0 ); + ai_assert( nullptr != pScene ); + ai_assert( nullptr != pScene->mRootNode ); + + if ( nullptr == pScene ) { + return; + } + + if ( nullptr == pScene->mRootNode ) { + return; + } + + // Process animations and update position transform to new unit system + for( unsigned int animationID = 0; animationID < pScene->mNumAnimations; animationID++ ) + { + aiAnimation* animation = pScene->mAnimations[animationID]; + + for( unsigned int animationChannel = 0; animationChannel < animation->mNumChannels; animationChannel++) + { + aiNodeAnim* anim = animation->mChannels[animationChannel]; + + for( unsigned int posKey = 0; posKey < anim->mNumPositionKeys; posKey++) + { + aiVectorKey& vectorKey = anim->mPositionKeys[posKey]; + vectorKey.mValue *= mScale; + } + } + } + + for( unsigned int meshID = 0; meshID < pScene->mNumMeshes; meshID++) + { + aiMesh *mesh = pScene->mMeshes[meshID]; + + // Reconstruct mesh vertexes to the new unit system + for( unsigned int vertexID = 0; vertexID < mesh->mNumVertices; vertexID++) + { + aiVector3D& vertex = mesh->mVertices[vertexID]; + vertex *= mScale; + } + + + // bone placement / scaling + for( unsigned int boneID = 0; boneID < mesh->mNumBones; boneID++) + { + // Reconstruct matrix by transform rather than by scale + // This prevent scale values being changed which can + // be meaningful in some cases + // like when you want the modeller to see 1:1 compatibility. + aiBone* bone = mesh->mBones[boneID]; + + aiVector3D pos, scale; + aiQuaternion rotation; + + bone->mOffsetMatrix.Decompose( scale, rotation, pos); + + aiMatrix4x4 translation; + aiMatrix4x4::Translation( pos * mScale, translation ); + + aiMatrix4x4 scaling; + aiMatrix4x4::Scaling( aiVector3D(scale), scaling ); + + aiMatrix4x4 RotMatrix = aiMatrix4x4 (rotation.GetMatrix()); + + bone->mOffsetMatrix = translation * RotMatrix * scaling; + } + + + // animation mesh processing + // convert by position rather than scale. + for( unsigned int animMeshID = 0; animMeshID < mesh->mNumAnimMeshes; animMeshID++) + { + aiAnimMesh * animMesh = mesh->mAnimMeshes[animMeshID]; + + for( unsigned int vertexID = 0; vertexID < animMesh->mNumVertices; vertexID++) + { + aiVector3D& vertex = animMesh->mVertices[vertexID]; + vertex *= mScale; + } + } + } + + traverseNodes( pScene->mRootNode ); +} + +void ScaleProcess::traverseNodes( aiNode *node, unsigned int nested_node_id ) { + applyScaling( node ); + + for( size_t i = 0; i < node->mNumChildren; i++) + { + // recurse into the tree until we are done! + traverseNodes( node->mChildren[i], nested_node_id+1 ); + } +} + +void ScaleProcess::applyScaling( aiNode *currentNode ) { + if ( nullptr != currentNode ) { + // Reconstruct matrix by transform rather than by scale + // This prevent scale values being changed which can + // be meaningful in some cases + // like when you want the modeller to + // see 1:1 compatibility. + + aiVector3D pos, scale; + aiQuaternion rotation; + currentNode->mTransformation.Decompose( scale, rotation, pos); + + aiMatrix4x4 translation; + aiMatrix4x4::Translation( pos * mScale, translation ); + + aiMatrix4x4 scaling; + + // note: we do not use mScale here, this is on purpose. + aiMatrix4x4::Scaling( scale, scaling ); + + aiMatrix4x4 RotMatrix = aiMatrix4x4 (rotation.GetMatrix()); + + currentNode->mTransformation = translation * RotMatrix * scaling; + } +} + +} // Namespace Assimp diff --git a/Engine/lib/assimp/code/ScaleProcess.h b/Engine/lib/assimp/code/PostProcessing/ScaleProcess.h similarity index 84% rename from Engine/lib/assimp/code/ScaleProcess.h rename to Engine/lib/assimp/code/PostProcessing/ScaleProcess.h index 55146ae06..468a21673 100644 --- a/Engine/lib/assimp/code/ScaleProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/ScaleProcess.h @@ -39,9 +39,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -#pragma once +#ifndef SCALE_PROCESS_H_ +#define SCALE_PROCESS_H_ -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiNode; @@ -53,6 +54,11 @@ namespace Assimp { // --------------------------------------------------------------------------- /** ScaleProcess: Class to rescale the whole model. + * Now rescales animations, bones, and blend shapes properly. + * Please note this will not write to 'scale' transform it will rewrite mesh + * and matrixes so that your scale values + * from your model package are preserved, so this is completely intentional + * bugs should be reported as soon as they are found. */ class ASSIMP_API ScaleProcess : public BaseProcess { public: @@ -78,7 +84,7 @@ public: virtual void Execute( aiScene* pScene ); private: - void traverseNodes( aiNode *currentNode ); + void traverseNodes( aiNode *currentNode, unsigned int nested_node_id = 0 ); void applyScaling( aiNode *currentNode ); private: @@ -86,3 +92,6 @@ private: }; } // Namespace Assimp + + +#endif // SCALE_PROCESS_H_ \ No newline at end of file diff --git a/Engine/lib/assimp/code/SortByPTypeProcess.cpp b/Engine/lib/assimp/code/PostProcessing/SortByPTypeProcess.cpp similarity index 89% rename from Engine/lib/assimp/code/SortByPTypeProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/SortByPTypeProcess.cpp index 87bbe5257..be8405a17 100644 --- a/Engine/lib/assimp/code/SortByPTypeProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/SortByPTypeProcess.cpp @@ -57,8 +57,8 @@ using namespace Assimp; // ------------------------------------------------------------------------------------------------ // Constructor to be privately used by Importer SortByPTypeProcess::SortByPTypeProcess() -{ - configRemoveMeshes = 0; +: mConfigRemoveMeshes( 0 ) { + // empty } // ------------------------------------------------------------------------------------------------ @@ -78,7 +78,7 @@ bool SortByPTypeProcess::IsActive( unsigned int pFlags) const // ------------------------------------------------------------------------------------------------ void SortByPTypeProcess::SetupProperties(const Importer* pImp) { - configRemoveMeshes = pImp->GetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE,0); + mConfigRemoveMeshes = pImp->GetPropertyInteger(AI_CONFIG_PP_SBP_REMOVE,0); } // ------------------------------------------------------------------------------------------------ @@ -172,7 +172,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { } if (1 == num) { - if (!(configRemoveMeshes & mesh->mPrimitiveTypes)) { + if (!(mConfigRemoveMeshes & mesh->mPrimitiveTypes)) { *meshIdx = static_cast( outMeshes.size() ); outMeshes.push_back(mesh); } else { @@ -206,7 +206,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { VertexWeightTable* avw = ComputeVertexBoneWeightTable(mesh); for (unsigned int real = 0; real < 4; ++real,++meshIdx) { - if ( !aiNumPerPType[real] || configRemoveMeshes & (1u << real)) + if ( !aiNumPerPType[real] || mConfigRemoveMeshes & (1u << real)) { continue; } @@ -228,36 +228,37 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { out->mNumVertices = (3 == real ? numPolyVerts : out->mNumFaces * (real+1)); - aiVector3D *vert(NULL), *nor(NULL), *tan(NULL), *bit(NULL); + aiVector3D *vert(nullptr), *nor(nullptr), *tan(nullptr), *bit(nullptr); aiVector3D *uv [AI_MAX_NUMBER_OF_TEXTURECOORDS]; aiColor4D *cols [AI_MAX_NUMBER_OF_COLOR_SETS]; - if (mesh->mVertices) + if (mesh->mVertices) { vert = out->mVertices = new aiVector3D[out->mNumVertices]; + } - if (mesh->mNormals) - nor = out->mNormals = new aiVector3D[out->mNumVertices]; + if (mesh->mNormals) { + nor = out->mNormals = new aiVector3D[out->mNumVertices]; + } - if (mesh->mTangents) - { + if (mesh->mTangents) { tan = out->mTangents = new aiVector3D[out->mNumVertices]; bit = out->mBitangents = new aiVector3D[out->mNumVertices]; } - for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS;++i) - { - if (mesh->mTextureCoords[i]) - uv[i] = out->mTextureCoords[i] = new aiVector3D[out->mNumVertices]; - else uv[i] = NULL; + for (unsigned int j = 0; j < AI_MAX_NUMBER_OF_TEXTURECOORDS;++j) { + uv[j] = nullptr; + if (mesh->mTextureCoords[j]) { + uv[j] = out->mTextureCoords[j] = new aiVector3D[out->mNumVertices]; + } - out->mNumUVComponents[i] = mesh->mNumUVComponents[i]; + out->mNumUVComponents[j] = mesh->mNumUVComponents[j]; } - for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_COLOR_SETS;++i) - { - if (mesh->mColors[i]) - cols[i] = out->mColors[i] = new aiColor4D[out->mNumVertices]; - else cols[i] = NULL; + for (unsigned int j = 0; j < AI_MAX_NUMBER_OF_COLOR_SETS;++j) { + cols[j] = nullptr; + if (mesh->mColors[j]) { + cols[j] = out->mColors[j] = new aiColor4D[out->mNumVertices]; + } } typedef std::vector< aiVertexWeight > TempBoneInfo; @@ -323,7 +324,7 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { in.mIndices[q] = outIdx++; } - in.mIndices = NULL; + in.mIndices = nullptr; ++outFaces; } ai_assert(outFaces == out->mFaces + out->mNumFaces); @@ -391,10 +392,10 @@ void SortByPTypeProcess::Execute( aiScene* pScene) { { char buffer[1024]; ::ai_snprintf(buffer,1024,"Points: %u%s, Lines: %u%s, Triangles: %u%s, Polygons: %u%s (Meshes, X = removed)", - aiNumMeshesPerPType[0], ((configRemoveMeshes & aiPrimitiveType_POINT) ? "X" : ""), - aiNumMeshesPerPType[1], ((configRemoveMeshes & aiPrimitiveType_LINE) ? "X" : ""), - aiNumMeshesPerPType[2], ((configRemoveMeshes & aiPrimitiveType_TRIANGLE) ? "X" : ""), - aiNumMeshesPerPType[3], ((configRemoveMeshes & aiPrimitiveType_POLYGON) ? "X" : "")); + aiNumMeshesPerPType[0], ((mConfigRemoveMeshes & aiPrimitiveType_POINT) ? "X" : ""), + aiNumMeshesPerPType[1], ((mConfigRemoveMeshes & aiPrimitiveType_LINE) ? "X" : ""), + aiNumMeshesPerPType[2], ((mConfigRemoveMeshes & aiPrimitiveType_TRIANGLE) ? "X" : ""), + aiNumMeshesPerPType[3], ((mConfigRemoveMeshes & aiPrimitiveType_POLYGON) ? "X" : "")); ASSIMP_LOG_INFO(buffer); ASSIMP_LOG_DEBUG("SortByPTypeProcess finished"); } diff --git a/Engine/lib/assimp/code/SortByPTypeProcess.h b/Engine/lib/assimp/code/PostProcessing/SortByPTypeProcess.h similarity index 95% rename from Engine/lib/assimp/code/SortByPTypeProcess.h rename to Engine/lib/assimp/code/PostProcessing/SortByPTypeProcess.h index c9d9924d8..1d7ccfc15 100644 --- a/Engine/lib/assimp/code/SortByPTypeProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/SortByPTypeProcess.h @@ -45,10 +45,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_SORTBYPTYPEPROCESS_H_INC #define AI_SORTBYPTYPEPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include class SortByPTypeProcessTest; + namespace Assimp { @@ -57,14 +58,11 @@ namespace Assimp { * A mesh with 5 lines, 3 points and 145 triangles would be split in 3 * submeshes. */ -class ASSIMP_API SortByPTypeProcess : public BaseProcess -{ +class ASSIMP_API SortByPTypeProcess : public BaseProcess { public: - SortByPTypeProcess(); ~SortByPTypeProcess(); -public: // ------------------------------------------------------------------- bool IsActive( unsigned int pFlags) const; @@ -75,8 +73,7 @@ public: void SetupProperties(const Importer* pImp); private: - - int configRemoveMeshes; + int mConfigRemoveMeshes; }; diff --git a/Engine/lib/assimp/code/SplitLargeMeshes.cpp b/Engine/lib/assimp/code/PostProcessing/SplitLargeMeshes.cpp similarity index 100% rename from Engine/lib/assimp/code/SplitLargeMeshes.cpp rename to Engine/lib/assimp/code/PostProcessing/SplitLargeMeshes.cpp diff --git a/Engine/lib/assimp/code/SplitLargeMeshes.h b/Engine/lib/assimp/code/PostProcessing/SplitLargeMeshes.h similarity index 98% rename from Engine/lib/assimp/code/SplitLargeMeshes.h rename to Engine/lib/assimp/code/PostProcessing/SplitLargeMeshes.h index 77f089ce7..3f90576ea 100644 --- a/Engine/lib/assimp/code/SplitLargeMeshes.h +++ b/Engine/lib/assimp/code/PostProcessing/SplitLargeMeshes.h @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -40,21 +39,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- */ -/** @file Defines a post processing step to split large meshes into submeshes +/** @file Defines a post processing step to split large meshes into sub-meshes */ #ifndef AI_SPLITLARGEMESHES_H_INC #define AI_SPLITLARGEMESHES_H_INC #include -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include #include +// Forward declarations class SplitLargeMeshesTest; -namespace Assimp -{ +namespace Assimp { class SplitLargeMeshesProcess_Triangle; class SplitLargeMeshesProcess_Vertex; diff --git a/Engine/lib/assimp/code/TextureTransform.cpp b/Engine/lib/assimp/code/PostProcessing/TextureTransform.cpp similarity index 100% rename from Engine/lib/assimp/code/TextureTransform.cpp rename to Engine/lib/assimp/code/PostProcessing/TextureTransform.cpp diff --git a/Engine/lib/assimp/code/TextureTransform.h b/Engine/lib/assimp/code/PostProcessing/TextureTransform.h similarity index 99% rename from Engine/lib/assimp/code/TextureTransform.h rename to Engine/lib/assimp/code/PostProcessing/TextureTransform.h index c556ff5d8..2a5d623d7 100644 --- a/Engine/lib/assimp/code/TextureTransform.h +++ b/Engine/lib/assimp/code/PostProcessing/TextureTransform.h @@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_TEXTURE_TRANSFORM_H_INCLUDED #include -#include "BaseProcess.h" +#include "Common/BaseProcess.h" #include #include diff --git a/Engine/lib/assimp/code/TriangulateProcess.cpp b/Engine/lib/assimp/code/PostProcessing/TriangulateProcess.cpp similarity index 99% rename from Engine/lib/assimp/code/TriangulateProcess.cpp rename to Engine/lib/assimp/code/PostProcessing/TriangulateProcess.cpp index 0f68f47dd..1040836bb 100644 --- a/Engine/lib/assimp/code/TriangulateProcess.cpp +++ b/Engine/lib/assimp/code/PostProcessing/TriangulateProcess.cpp @@ -5,8 +5,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2019, assimp team - - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -60,9 +58,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * a file */ #ifndef ASSIMP_BUILD_NO_TRIANGULATE_PROCESS -#include "TriangulateProcess.h" -#include "ProcessHelper.h" -#include "PolyTools.h" + +#include "PostProcessing/TriangulateProcess.h" +#include "PostProcessing/ProcessHelper.h" +#include "Common/PolyTools.h" + #include //#define AI_BUILD_TRIANGULATE_COLOR_FACE_WINDING diff --git a/Engine/lib/assimp/code/TriangulateProcess.h b/Engine/lib/assimp/code/PostProcessing/TriangulateProcess.h similarity index 97% rename from Engine/lib/assimp/code/TriangulateProcess.h rename to Engine/lib/assimp/code/PostProcessing/TriangulateProcess.h index 47bd2115a..916b5103d 100644 --- a/Engine/lib/assimp/code/TriangulateProcess.h +++ b/Engine/lib/assimp/code/PostProcessing/TriangulateProcess.h @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_TRIANGULATEPROCESS_H_INC #define AI_TRIANGULATEPROCESS_H_INC -#include "BaseProcess.h" +#include "Common/BaseProcess.h" struct aiMesh; @@ -59,14 +59,11 @@ namespace Assimp { * into triangles. You usually want this to happen because the graphics cards * need their data as triangles. */ -class ASSIMP_API TriangulateProcess : public BaseProcess -{ +class ASSIMP_API TriangulateProcess : public BaseProcess { public: - TriangulateProcess(); ~TriangulateProcess(); -public: // ------------------------------------------------------------------- /** Returns whether the processing step is present in the given flag field. * @param pFlags The processing flags the importer was called with. A bitwise @@ -82,7 +79,6 @@ public: */ void Execute( aiScene* pScene); -public: // ------------------------------------------------------------------- /** Triangulates the given mesh. * @param pMesh The mesh to triangulate. diff --git a/Engine/lib/assimp/code/ValidateDataStructure.cpp b/Engine/lib/assimp/code/PostProcessing/ValidateDataStructure.cpp similarity index 87% rename from Engine/lib/assimp/code/ValidateDataStructure.cpp rename to Engine/lib/assimp/code/PostProcessing/ValidateDataStructure.cpp index 405670bdd..75d1b6ef7 100644 --- a/Engine/lib/assimp/code/ValidateDataStructure.cpp +++ b/Engine/lib/assimp/code/PostProcessing/ValidateDataStructure.cpp @@ -46,8 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * the data structure returned by Assimp. */ - - // internal headers #include "ValidateDataStructure.h" #include @@ -110,8 +108,8 @@ void ValidateDSProcess::ReportWarning(const char* msg,...) } // ------------------------------------------------------------------------------------------------ -inline int HasNameMatch(const aiString& in, aiNode* node) -{ +inline +int HasNameMatch(const aiString& in, aiNode* node) { int result = (node->mName == in ? 1 : 0 ); for (unsigned int i = 0; i < node->mNumChildren;++i) { result += HasNameMatch(in,node->mChildren[i]); @@ -121,9 +119,8 @@ inline int HasNameMatch(const aiString& in, aiNode* node) // ------------------------------------------------------------------------------------------------ template -inline void ValidateDSProcess::DoValidation(T** parray, unsigned int size, - const char* firstName, const char* secondName) -{ +inline +void ValidateDSProcess::DoValidation(T** parray, unsigned int size, const char* firstName, const char* secondName) { // validate all entries if (size) { @@ -160,7 +157,7 @@ inline void ValidateDSProcess::DoValidationEx(T** parray, unsigned int size, { if (!parray[i]) { - ReportError("aiScene::%s[%i] is NULL (aiScene::%s is %i)", + ReportError("aiScene::%s[%u] is NULL (aiScene::%s is %u)", firstName,i,secondName,size); } Validate(parray[i]); @@ -170,8 +167,8 @@ inline void ValidateDSProcess::DoValidationEx(T** parray, unsigned int size, { if (parray[i]->mName == parray[a]->mName) { - this->ReportError("aiScene::%s[%i] has the same name as " - "aiScene::%s[%i]",firstName, i,secondName, a); + ReportError("aiScene::%s[%u] has the same name as " + "aiScene::%s[%u]",firstName, i,secondName, a); } } } @@ -181,7 +178,8 @@ inline void ValidateDSProcess::DoValidationEx(T** parray, unsigned int size, // ------------------------------------------------------------------------------------------------ template inline -void ValidateDSProcess::DoValidationWithNameCheck(T** array, unsigned int size, const char* firstName, const char* secondName) { +void ValidateDSProcess::DoValidationWithNameCheck(T** array, unsigned int size, const char* firstName, + const char* secondName) { // validate all entries DoValidationEx(array,size,firstName,secondName); @@ -201,9 +199,8 @@ void ValidateDSProcess::DoValidationWithNameCheck(T** array, unsigned int size, // ------------------------------------------------------------------------------------------------ // Executes the post processing step on the given imported data. -void ValidateDSProcess::Execute( aiScene* pScene) -{ - this->mScene = pScene; +void ValidateDSProcess::Execute( aiScene* pScene) { + mScene = pScene; ASSIMP_LOG_DEBUG("ValidateDataStructureProcess begin"); // validate the node graph of the scene @@ -330,6 +327,7 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) { case 0: ReportError("aiMesh::mFaces[%i].mNumIndices is 0",i); + break; case 1: if (0 == (pMesh->mPrimitiveTypes & aiPrimitiveType_POINT)) { @@ -422,7 +420,9 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) if (!abRefList[i])b = true; } abRefList.clear(); - if (b)ReportWarning("There are unreferenced vertices"); + if (b) { + ReportWarning("There are unreferenced vertices"); + } // texture channel 2 may not be set if channel 1 is zero ... { @@ -513,13 +513,11 @@ void ValidateDSProcess::Validate( const aiMesh* pMesh) } // ------------------------------------------------------------------------------------------------ -void ValidateDSProcess::Validate( const aiMesh* pMesh, - const aiBone* pBone,float* afSum) -{ +void ValidateDSProcess::Validate( const aiMesh* pMesh, const aiBone* pBone,float* afSum) { this->Validate(&pBone->mName); if (!pBone->mNumWeights) { - ReportError("aiBone::mNumWeights is zero"); + //ReportError("aiBone::mNumWeights is zero"); } // check whether all vertices affected by this bone are valid @@ -540,13 +538,17 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation) { Validate(&pAnimation->mName); - // validate all materials - if (pAnimation->mNumChannels) + // validate all animations + if (pAnimation->mNumChannels || pAnimation->mNumMorphMeshChannels) { - if (!pAnimation->mChannels) { + if (!pAnimation->mChannels && pAnimation->mNumChannels) { ReportError("aiAnimation::mChannels is NULL (aiAnimation::mNumChannels is %i)", pAnimation->mNumChannels); } + if (!pAnimation->mMorphMeshChannels && pAnimation->mNumMorphMeshChannels) { + ReportError("aiAnimation::mMorphMeshChannels is NULL (aiAnimation::mNumMorphMeshChannels is %i)", + pAnimation->mNumMorphMeshChannels); + } for (unsigned int i = 0; i < pAnimation->mNumChannels;++i) { if (!pAnimation->mChannels[i]) @@ -556,11 +558,19 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation) } Validate(pAnimation, pAnimation->mChannels[i]); } + for (unsigned int i = 0; i < pAnimation->mNumMorphMeshChannels;++i) + { + if (!pAnimation->mMorphMeshChannels[i]) + { + ReportError("aiAnimation::mMorphMeshChannels[%i] is NULL (aiAnimation::mNumMorphMeshChannels is %i)", + i, pAnimation->mNumMorphMeshChannels); + } + Validate(pAnimation, pAnimation->mMorphMeshChannels[i]); + } + } + else { + ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there."); } - else ReportError("aiAnimation::mNumChannels is 0. At least one node animation channel must be there."); - - // Animation duration is allowed to be zero in cases where the anim contains only a single key frame. - // if (!pAnimation->mDuration)this->ReportError("aiAnimation::mDuration is zero"); } // ------------------------------------------------------------------------------------------------ @@ -577,15 +587,16 @@ void ValidateDSProcess::SearchForInvalidTextures(const aiMaterial* pMaterial, int iNumIndices = 0; int iIndex = -1; - for (unsigned int i = 0; i < pMaterial->mNumProperties;++i) - { - aiMaterialProperty* prop = pMaterial->mProperties[i]; - if (!::strcmp(prop->mKey.data,"$tex.file") && prop->mSemantic == type) { + for (unsigned int i = 0; i < pMaterial->mNumProperties;++i) { + aiMaterialProperty* prop = pMaterial->mProperties[ i ]; + ai_assert(nullptr != prop); + if ( !::strcmp(prop->mKey.data,"$tex.file") && prop->mSemantic == static_cast(type)) { iIndex = std::max(iIndex, (int) prop->mIndex); ++iNumIndices; - if (aiPTI_String != prop->mType) - ReportError("Material property %s is expected to be a string",prop->mKey.data); + if (aiPTI_String != prop->mType) { + ReportError("Material property %s is expected to be a string", prop->mKey.data); + } } } if (iIndex +1 != iNumIndices) { @@ -740,8 +751,9 @@ void ValidateDSProcess::Validate( const aiMaterial* pMaterial) "AI_MATKEY_SHININESS_STRENGTH key is 0.0"); } break; - default: ; - }; + default: + break; + } } if (AI_SUCCESS == aiGetMaterialFloat( pMaterial,AI_MATKEY_OPACITY,&fTemp) && (!fTemp || fTemp > 1.01)) { @@ -773,8 +785,10 @@ void ValidateDSProcess::Validate( const aiTexture* pTexture) } if (pTexture->mHeight) { - if (!pTexture->mWidth)ReportError("aiTexture::mWidth is zero " - "(aiTexture::mHeight is %i, uncompressed texture)",pTexture->mHeight); + if (!pTexture->mWidth){ + ReportError("aiTexture::mWidth is zero (aiTexture::mHeight is %i, uncompressed texture)", + pTexture->mHeight); + } } else { @@ -805,15 +819,15 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation, { Validate(&pNodeAnim->mNodeName); - if (!pNodeAnim->mNumPositionKeys && !pNodeAnim->mScalingKeys && !pNodeAnim->mNumRotationKeys) + if (!pNodeAnim->mNumPositionKeys && !pNodeAnim->mScalingKeys && !pNodeAnim->mNumRotationKeys) { ReportError("Empty node animation channel"); - + } // otherwise check whether one of the keys exceeds the total duration of the animation if (pNodeAnim->mNumPositionKeys) { if (!pNodeAnim->mPositionKeys) { - this->ReportError("aiNodeAnim::mPositionKeys is NULL (aiNodeAnim::mNumPositionKeys is %i)", + ReportError("aiNodeAnim::mPositionKeys is NULL (aiNodeAnim::mNumPositionKeys is %i)", pNodeAnim->mNumPositionKeys); } double dLast = -10e10; @@ -844,7 +858,7 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation, { if (!pNodeAnim->mRotationKeys) { - this->ReportError("aiNodeAnim::mRotationKeys is NULL (aiNodeAnim::mNumRotationKeys is %i)", + ReportError("aiNodeAnim::mRotationKeys is NULL (aiNodeAnim::mNumRotationKeys is %i)", pNodeAnim->mNumRotationKeys); } double dLast = -10e10; @@ -902,22 +916,68 @@ void ValidateDSProcess::Validate( const aiAnimation* pAnimation, } } +void ValidateDSProcess::Validate( const aiAnimation* pAnimation, + const aiMeshMorphAnim* pMeshMorphAnim) +{ + Validate(&pMeshMorphAnim->mName); + + if (!pMeshMorphAnim->mNumKeys) { + ReportError("Empty mesh morph animation channel"); + } + + // otherwise check whether one of the keys exceeds the total duration of the animation + if (pMeshMorphAnim->mNumKeys) + { + if (!pMeshMorphAnim->mKeys) + { + ReportError("aiMeshMorphAnim::mKeys is NULL (aiMeshMorphAnim::mNumKeys is %i)", + pMeshMorphAnim->mNumKeys); + } + double dLast = -10e10; + for (unsigned int i = 0; i < pMeshMorphAnim->mNumKeys;++i) + { + // ScenePreprocessor will compute the duration if still the default value + // (Aramis) Add small epsilon, comparison tended to fail if max_time == duration, + // seems to be due the compilers register usage/width. + if (pAnimation->mDuration > 0. && pMeshMorphAnim->mKeys[i].mTime > pAnimation->mDuration+0.001) + { + ReportError("aiMeshMorphAnim::mKeys[%i].mTime (%.5f) is larger " + "than aiAnimation::mDuration (which is %.5f)",i, + (float)pMeshMorphAnim->mKeys[i].mTime, + (float)pAnimation->mDuration); + } + if (i && pMeshMorphAnim->mKeys[i].mTime <= dLast) + { + ReportWarning("aiMeshMorphAnim::mKeys[%i].mTime (%.5f) is smaller " + "than aiMeshMorphAnim::mKeys[%i] (which is %.5f)",i, + (float)pMeshMorphAnim->mKeys[i].mTime, + i-1, (float)dLast); + } + dLast = pMeshMorphAnim->mKeys[i].mTime; + } + } +} + // ------------------------------------------------------------------------------------------------ void ValidateDSProcess::Validate( const aiNode* pNode) { - if (!pNode)ReportError("A node of the scenegraph is NULL"); - if (pNode != mScene->mRootNode && !pNode->mParent) - this->ReportError("A node has no valid parent (aiNode::mParent is NULL)"); - + if (!pNode) { + ReportError("A node of the scenegraph is NULL"); + } + // Validate node name string first so that it's safe to use in below expressions this->Validate(&pNode->mName); + const char* nodeName = (&pNode->mName)->C_Str(); + if (pNode != mScene->mRootNode && !pNode->mParent){ + ReportError("Non-root node %s lacks a valid parent (aiNode::mParent is NULL) ", nodeName); + } // validate all meshes if (pNode->mNumMeshes) { if (!pNode->mMeshes) { - ReportError("aiNode::mMeshes is NULL (aiNode::mNumMeshes is %i)", - pNode->mNumMeshes); + ReportError("aiNode::mMeshes is NULL for node %s (aiNode::mNumMeshes is %i)", + nodeName, pNode->mNumMeshes); } std::vector abHadMesh; abHadMesh.resize(mScene->mNumMeshes,false); @@ -925,13 +985,13 @@ void ValidateDSProcess::Validate( const aiNode* pNode) { if (pNode->mMeshes[i] >= mScene->mNumMeshes) { - ReportError("aiNode::mMeshes[%i] is out of range (maximum is %i)", - pNode->mMeshes[i],mScene->mNumMeshes-1); + ReportError("aiNode::mMeshes[%i] is out of range for node %s (maximum is %i)", + pNode->mMeshes[i], nodeName, mScene->mNumMeshes-1); } if (abHadMesh[pNode->mMeshes[i]]) { - ReportError("aiNode::mMeshes[%i] is already referenced by this node (value: %i)", - i,pNode->mMeshes[i]); + ReportError("aiNode::mMeshes[%i] is already referenced by this node %s (value: %i)", + i, nodeName, pNode->mMeshes[i]); } abHadMesh[pNode->mMeshes[i]] = true; } @@ -939,8 +999,8 @@ void ValidateDSProcess::Validate( const aiNode* pNode) if (pNode->mNumChildren) { if (!pNode->mChildren) { - ReportError("aiNode::mChildren is NULL (aiNode::mNumChildren is %i)", - pNode->mNumChildren); + ReportError("aiNode::mChildren is NULL for node %s (aiNode::mNumChildren is %i)", + nodeName, pNode->mNumChildren); } for (unsigned int i = 0; i < pNode->mNumChildren;++i) { Validate(pNode->mChildren[i]); @@ -953,7 +1013,7 @@ void ValidateDSProcess::Validate( const aiString* pString) { if (pString->length > MAXLEN) { - this->ReportError("aiString::length is too large (%i, maximum is %lu)", + ReportError("aiString::length is too large (%u, maximum is %lu)", pString->length,MAXLEN); } const char* sz = pString->data; @@ -961,12 +1021,14 @@ void ValidateDSProcess::Validate( const aiString* pString) { if ('\0' == *sz) { - if (pString->length != (unsigned int)(sz-pString->data)) + if (pString->length != (unsigned int)(sz-pString->data)) { ReportError("aiString::data is invalid: the terminal zero is at a wrong offset"); + } break; } - else if (sz >= &pString->data[MAXLEN]) + else if (sz >= &pString->data[MAXLEN]) { ReportError("aiString::data is invalid. There is no terminal character"); + } ++sz; } } diff --git a/Engine/lib/assimp/code/ValidateDataStructure.h b/Engine/lib/assimp/code/PostProcessing/ValidateDataStructure.h similarity index 95% rename from Engine/lib/assimp/code/ValidateDataStructure.h rename to Engine/lib/assimp/code/PostProcessing/ValidateDataStructure.h index bd21e8854..7b309c925 100644 --- a/Engine/lib/assimp/code/ValidateDataStructure.h +++ b/Engine/lib/assimp/code/PostProcessing/ValidateDataStructure.h @@ -48,12 +48,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include "BaseProcess.h" + +#include "Common/BaseProcess.h" struct aiBone; struct aiMesh; struct aiAnimation; struct aiNodeAnim; +struct aiMeshMorphAnim; struct aiTexture; struct aiMaterial; struct aiNode; @@ -149,6 +151,13 @@ protected: void Validate( const aiAnimation* pAnimation, const aiNodeAnim* pBoneAnim); + /** Validates a mesh morph animation channel. + * @param pAnimation Input animation. + * @param pMeshMorphAnim Mesh morph animation channel. + * */ + void Validate( const aiAnimation* pAnimation, + const aiMeshMorphAnim* pMeshMorphAnim); + // ------------------------------------------------------------------- /** Validates a node and all of its subnodes * @param Node Input node*/ diff --git a/Engine/lib/assimp/code/Q3BSPFileData.h b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileData.h similarity index 100% rename from Engine/lib/assimp/code/Q3BSPFileData.h rename to Engine/lib/assimp/code/Q3BSP/Q3BSPFileData.h diff --git a/Engine/lib/assimp/code/Q3BSPFileImporter.cpp b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileImporter.cpp similarity index 97% rename from Engine/lib/assimp/code/Q3BSPFileImporter.cpp rename to Engine/lib/assimp/code/Q3BSP/Q3BSPFileImporter.cpp index 6a3b95bb8..4add00a07 100644 --- a/Engine/lib/assimp/code/Q3BSPFileImporter.cpp +++ b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileImporter.cpp @@ -43,7 +43,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_Q3BSP_IMPORTER #include "Q3BSPFileImporter.h" -#include "Q3BSPZipArchive.h" #include "Q3BSPFileParser.h" #include "Q3BSPFileData.h" @@ -60,6 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include #include #include @@ -181,7 +181,7 @@ const aiImporterDesc* Q3BSPFileImporter::GetInfo () const { // ------------------------------------------------------------------------------------------------ // Import method. void Q3BSPFileImporter::InternReadFile(const std::string &rFile, aiScene* scene, IOSystem* ioHandler) { - Q3BSPZipArchive Archive( ioHandler, rFile ); + ZipArchiveIOSystem Archive( ioHandler, rFile ); if ( !Archive.isOpen() ) { throw DeadlyImportError( "Failed to open file " + rFile + "." ); } @@ -223,10 +223,10 @@ void Q3BSPFileImporter::separateMapName( const std::string &importName, std::str // ------------------------------------------------------------------------------------------------ // Returns the first map in the map archive. -bool Q3BSPFileImporter::findFirstMapInArchive( Q3BSPZipArchive &bspArchive, std::string &mapName ) { +bool Q3BSPFileImporter::findFirstMapInArchive(ZipArchiveIOSystem &bspArchive, std::string &mapName ) { mapName = ""; std::vector fileList; - bspArchive.getFileList( fileList ); + bspArchive.getFileListExtension( fileList, "bsp" ); if (fileList.empty()) { return false; } @@ -249,7 +249,7 @@ bool Q3BSPFileImporter::findFirstMapInArchive( Q3BSPZipArchive &bspArchive, std: // ------------------------------------------------------------------------------------------------ // Creates the assimp specific data. void Q3BSPFileImporter::CreateDataFromImport( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, - Q3BSPZipArchive *pArchive ) { + ZipArchiveIOSystem *pArchive ) { if (nullptr == pModel || nullptr == pScene) { return; } @@ -418,7 +418,7 @@ void Q3BSPFileImporter::createTriangleTopology( const Q3BSP::Q3BSPModel *pModel, // ------------------------------------------------------------------------------------------------ // Creates all referenced materials. void Q3BSPFileImporter::createMaterials( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, - Q3BSPZipArchive *pArchive ) { + ZipArchiveIOSystem *pArchive ) { if ( m_MaterialLookupMap.empty() ) { return; } @@ -564,7 +564,7 @@ aiFace *Q3BSPFileImporter::getNextFace( aiMesh *mesh, unsigned int &faceIdx ) { // ------------------------------------------------------------------------------------------------ // Imports a texture file. bool Q3BSPFileImporter::importTextureFromArchive( const Q3BSP::Q3BSPModel *model, - Q3BSP::Q3BSPZipArchive *archive, aiScene*, + ZipArchiveIOSystem *archive, aiScene*, aiMaterial *pMatHelper, int textureId ) { if (nullptr == archive || nullptr == pMatHelper ) { return false; @@ -669,7 +669,7 @@ bool Q3BSPFileImporter::importLightmap( const Q3BSP::Q3BSPModel *pModel, aiScene // ------------------------------------------------------------------------------------------------ // Will search for a supported extension. -bool Q3BSPFileImporter::expandFile( Q3BSP::Q3BSPZipArchive *pArchive, const std::string &rFilename, +bool Q3BSPFileImporter::expandFile(ZipArchiveIOSystem *pArchive, const std::string &rFilename, const std::vector &rExtList, std::string &rFile, std::string &rExt ) { diff --git a/Engine/lib/assimp/code/Q3BSPFileImporter.h b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileImporter.h similarity index 92% rename from Engine/lib/assimp/code/Q3BSPFileImporter.h rename to Engine/lib/assimp/code/Q3BSP/Q3BSPFileImporter.h index 5af9fb7bc..ee21fa48e 100644 --- a/Engine/lib/assimp/code/Q3BSPFileImporter.h +++ b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileImporter.h @@ -54,9 +54,9 @@ struct aiMaterial; struct aiTexture; namespace Assimp { + class ZipArchiveIOSystem; namespace Q3BSP { - class Q3BSPZipArchive; struct Q3BSPModel; struct sQ3BSPFace; } @@ -85,24 +85,24 @@ protected: const aiImporterDesc* GetInfo () const; void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler); void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName ); - bool findFirstMapInArchive( Q3BSP::Q3BSPZipArchive &rArchive, std::string &rMapName ); - void CreateDataFromImport( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, Q3BSP::Q3BSPZipArchive *pArchive ); + bool findFirstMapInArchive(ZipArchiveIOSystem &rArchive, std::string &rMapName ); + void CreateDataFromImport( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, ZipArchiveIOSystem *pArchive ); void CreateNodes( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, aiNode *pParent ); aiNode *CreateTopology( const Q3BSP::Q3BSPModel *pModel, unsigned int materialIdx, std::vector &rArray, aiMesh **pMesh ); void createTriangleTopology( const Q3BSP::Q3BSPModel *pModel, Q3BSP::sQ3BSPFace *pQ3BSPFace, aiMesh* pMesh, unsigned int &rFaceIdx, unsigned int &rVertIdx ); - void createMaterials( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, Q3BSP::Q3BSPZipArchive *pArchive ); + void createMaterials( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, ZipArchiveIOSystem *pArchive ); size_t countData( const std::vector &rArray ) const; size_t countFaces( const std::vector &rArray ) const; size_t countTriangles( const std::vector &rArray ) const; void createMaterialMap( const Q3BSP::Q3BSPModel *pModel); aiFace *getNextFace( aiMesh *pMesh, unsigned int &rFaceIdx ); - bool importTextureFromArchive( const Q3BSP::Q3BSPModel *pModel, Q3BSP::Q3BSPZipArchive *pArchive, aiScene* pScene, + bool importTextureFromArchive( const Q3BSP::Q3BSPModel *pModel, ZipArchiveIOSystem *pArchive, aiScene* pScene, aiMaterial *pMatHelper, int textureId ); bool importLightmap( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene, aiMaterial *pMatHelper, int lightmapId ); bool importEntities( const Q3BSP::Q3BSPModel *pModel, aiScene* pScene ); - bool expandFile( Q3BSP::Q3BSPZipArchive *pArchive, const std::string &rFilename, const std::vector &rExtList, + bool expandFile(ZipArchiveIOSystem *pArchive, const std::string &rFilename, const std::vector &rExtList, std::string &rFile, std::string &rExt ); private: diff --git a/Engine/lib/assimp/code/Q3BSPFileParser.cpp b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileParser.cpp similarity index 98% rename from Engine/lib/assimp/code/Q3BSPFileParser.cpp rename to Engine/lib/assimp/code/Q3BSP/Q3BSPFileParser.cpp index 5bac5ae76..bed2efe53 100644 --- a/Engine/lib/assimp/code/Q3BSPFileParser.cpp +++ b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileParser.cpp @@ -45,9 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Q3BSPFileParser.h" #include "Q3BSPFileData.h" -#include "Q3BSPZipArchive.h" #include #include +#include #include namespace Assimp { @@ -55,7 +55,7 @@ namespace Assimp { using namespace Q3BSP; // ------------------------------------------------------------------------------------------------ -Q3BSPFileParser::Q3BSPFileParser( const std::string &mapName, Q3BSPZipArchive *pZipArchive ) : +Q3BSPFileParser::Q3BSPFileParser( const std::string &mapName, ZipArchiveIOSystem *pZipArchive ) : m_sOffset( 0 ), m_Data(), m_pModel(nullptr), @@ -101,6 +101,7 @@ bool Q3BSPFileParser::readData( const std::string &rMapName ) { const size_t readSize = pMapFile->Read( &m_Data[0], sizeof( char ), size ); if ( readSize != size ) { m_Data.clear(); + m_pZipArchive->Close(pMapFile); return false; } m_pZipArchive->Close( pMapFile ); diff --git a/Engine/lib/assimp/code/Q3BSPFileParser.h b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileParser.h similarity index 92% rename from Engine/lib/assimp/code/Q3BSPFileParser.h rename to Engine/lib/assimp/code/Q3BSP/Q3BSPFileParser.h index 143e42b15..fd73f5e10 100644 --- a/Engine/lib/assimp/code/Q3BSPFileParser.h +++ b/Engine/lib/assimp/code/Q3BSP/Q3BSPFileParser.h @@ -48,13 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Assimp { + class ZipArchiveIOSystem; + namespace Q3BSP { - -class Q3BSPZipArchive; -struct Q3BSPModel; -class ZipFile; - + struct Q3BSPModel; + class ZipFile; } // ------------------------------------------------------------------- @@ -62,7 +61,7 @@ class ZipFile; class Q3BSPFileParser { public: - Q3BSPFileParser( const std::string &rMapName, Q3BSP::Q3BSPZipArchive *pZipArchive ); + Q3BSPFileParser( const std::string &rMapName, ZipArchiveIOSystem *pZipArchive ); ~Q3BSPFileParser(); Q3BSP::Q3BSPModel *getModel() const; @@ -83,7 +82,7 @@ private: size_t m_sOffset; std::vector m_Data; Q3BSP::Q3BSPModel *m_pModel; - Q3BSP::Q3BSPZipArchive *m_pZipArchive; + ZipArchiveIOSystem *m_pZipArchive; }; } // Namespace Assimp diff --git a/Engine/lib/assimp/code/Q3BSPZipArchive.cpp b/Engine/lib/assimp/code/Q3BSPZipArchive.cpp deleted file mode 100644 index 0b6664842..000000000 --- a/Engine/lib/assimp/code/Q3BSPZipArchive.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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_Q3BSP_IMPORTER - -#include "Q3BSPZipArchive.h" -#include -#include -#include - -namespace Assimp { -namespace Q3BSP { - -voidpf IOSystem2Unzip::open(voidpf opaque, const char* filename, int mode) { - IOSystem* io_system = (IOSystem*) opaque; - - const char* mode_fopen = NULL; - if((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) { - mode_fopen = "rb"; - } else { - if(mode & ZLIB_FILEFUNC_MODE_EXISTING) { - mode_fopen = "r+b"; - } else { - if(mode & ZLIB_FILEFUNC_MODE_CREATE) { - mode_fopen = "wb"; - } - } - } - - return (voidpf) io_system->Open(filename, mode_fopen); -} - -uLong IOSystem2Unzip::read(voidpf /*opaque*/, voidpf stream, void* buf, uLong size) { - IOStream* io_stream = (IOStream*) stream; - - return static_cast(io_stream->Read(buf, 1, size)); -} - -uLong IOSystem2Unzip::write(voidpf /*opaque*/, voidpf stream, const void* buf, uLong size) { - IOStream* io_stream = (IOStream*) stream; - - return static_cast(io_stream->Write(buf, 1, size)); -} - -long IOSystem2Unzip::tell(voidpf /*opaque*/, voidpf stream) { - IOStream* io_stream = (IOStream*) stream; - - return static_cast(io_stream->Tell()); -} - -long IOSystem2Unzip::seek(voidpf /*opaque*/, voidpf stream, uLong offset, int origin) { - IOStream* io_stream = (IOStream*) stream; - - aiOrigin assimp_origin; - switch (origin) { - default: - case ZLIB_FILEFUNC_SEEK_CUR: - assimp_origin = aiOrigin_CUR; - break; - case ZLIB_FILEFUNC_SEEK_END: - assimp_origin = aiOrigin_END; - break; - case ZLIB_FILEFUNC_SEEK_SET: - assimp_origin = aiOrigin_SET; - break; - } - - return (io_stream->Seek(offset, assimp_origin) == aiReturn_SUCCESS ? 0 : -1); -} - -int IOSystem2Unzip::close(voidpf opaque, voidpf stream) { - IOSystem* io_system = (IOSystem*) opaque; - IOStream* io_stream = (IOStream*) stream; - - io_system->Close(io_stream); - - return 0; -} - -int IOSystem2Unzip::testerror(voidpf /*opaque*/, voidpf /*stream*/) { - return 0; -} - -zlib_filefunc_def IOSystem2Unzip::get(IOSystem* pIOHandler) { - zlib_filefunc_def mapping; - - mapping.zopen_file = open; - mapping.zread_file = read; - mapping.zwrite_file = write; - mapping.ztell_file = tell; - mapping.zseek_file = seek; - mapping.zclose_file = close; - mapping.zerror_file = testerror; - mapping.opaque = (voidpf) pIOHandler; - - return mapping; -} - -ZipFile::ZipFile(size_t size) : m_Size(size) { - ai_assert(m_Size != 0); - - m_Buffer = malloc(m_Size); -} - -ZipFile::~ZipFile() { - free(m_Buffer); - m_Buffer = NULL; -} - -size_t ZipFile::Read(void* pvBuffer, size_t pSize, size_t pCount) { - const size_t size = pSize * pCount; - assert(size <= m_Size); - - std::memcpy(pvBuffer, m_Buffer, size); - - return size; -} - -size_t ZipFile::Write(const void* /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) { - return 0; -} - -size_t ZipFile::FileSize() const { - return m_Size; -} - -aiReturn ZipFile::Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) { - return aiReturn_FAILURE; -} - -size_t ZipFile::Tell() const { - return 0; -} - -void ZipFile::Flush() { - // empty -} - -// ------------------------------------------------------------------------------------------------ -// Constructor. -Q3BSPZipArchive::Q3BSPZipArchive(IOSystem* pIOHandler, const std::string& rFile) : m_ZipFileHandle(NULL), m_ArchiveMap() { - if (! rFile.empty()) { - zlib_filefunc_def mapping = IOSystem2Unzip::get(pIOHandler); - - m_ZipFileHandle = unzOpen2(rFile.c_str(), &mapping); - - if(m_ZipFileHandle != nullptr) { - mapArchive(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// Destructor. -Q3BSPZipArchive::~Q3BSPZipArchive() { - for(auto &file : m_ArchiveMap) { - delete file.second; - } - m_ArchiveMap.clear(); - - if(m_ZipFileHandle != nullptr) { - unzClose(m_ZipFileHandle); - m_ZipFileHandle = nullptr; - } -} - -// ------------------------------------------------------------------------------------------------ -// Returns true, if the archive is already open. -bool Q3BSPZipArchive::isOpen() const { - return (m_ZipFileHandle != nullptr); -} - -// ------------------------------------------------------------------------------------------------ -// Returns true, if the filename is part of the archive. -bool Q3BSPZipArchive::Exists(const char* pFile) const { - bool exist = false; - if (pFile != nullptr) { - std::string rFile(pFile); - std::map::const_iterator it = m_ArchiveMap.find(rFile); - - if(it != m_ArchiveMap.end()) { - exist = true; - } - } - - return exist; -} - -// ------------------------------------------------------------------------------------------------ -// Returns the separator delimiter. -char Q3BSPZipArchive::getOsSeparator() const { -#ifndef _WIN32 - return '/'; -#else - return '\\'; -#endif -} - -// ------------------------------------------------------------------------------------------------ -// Opens a file, which is part of the archive. -IOStream *Q3BSPZipArchive::Open(const char* pFile, const char* /*pMode*/) { - ai_assert(pFile != nullptr); - - IOStream* result = nullptr; - - std::map::iterator it = m_ArchiveMap.find(pFile); - - if(it != m_ArchiveMap.end()) { - result = (IOStream*) it->second; - } - - return result; -} - -// ------------------------------------------------------------------------------------------------ -// Close a filestream. -void Q3BSPZipArchive::Close(IOStream *pFile) { - (void)(pFile); - ai_assert(pFile != nullptr); - - // We don't do anything in case the file would be opened again in the future -} -// ------------------------------------------------------------------------------------------------ -// Returns the file-list of the archive. -void Q3BSPZipArchive::getFileList(std::vector &rFileList) { - rFileList.clear(); - - for(auto &file : m_ArchiveMap) { - rFileList.push_back(file.first); - } -} - -// ------------------------------------------------------------------------------------------------ -// Maps the archive content. -bool Q3BSPZipArchive::mapArchive() { - bool success = false; - - if(m_ZipFileHandle != nullptr) { - if(m_ArchiveMap.empty()) { - // At first ensure file is already open - if(unzGoToFirstFile(m_ZipFileHandle) == UNZ_OK) { - // Loop over all files - do { - char filename[FileNameSize]; - unz_file_info fileInfo; - - if(unzGetCurrentFileInfo(m_ZipFileHandle, &fileInfo, filename, FileNameSize, NULL, 0, NULL, 0) == UNZ_OK) { - // The file has EXACTLY the size of uncompressed_size. In C - // you need to mark the last character with '\0', so add - // another character - if(fileInfo.uncompressed_size != 0 && unzOpenCurrentFile(m_ZipFileHandle) == UNZ_OK) { - std::pair::iterator, bool> result = m_ArchiveMap.insert(std::make_pair(filename, new ZipFile(fileInfo.uncompressed_size))); - - if(unzReadCurrentFile(m_ZipFileHandle, result.first->second->m_Buffer, fileInfo.uncompressed_size) == (long int) fileInfo.uncompressed_size) { - if(unzCloseCurrentFile(m_ZipFileHandle) == UNZ_OK) { - // Nothing to do anymore... - } - } - } - } - } while(unzGoToNextFile(m_ZipFileHandle) != UNZ_END_OF_LIST_OF_FILE); - } - } - - success = true; - } - - return success; -} - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Q3BSP -} // Namespace Assimp - -#endif // ASSIMP_BUILD_NO_Q3BSP_IMPORTER diff --git a/Engine/lib/assimp/code/Q3BSPZipArchive.h b/Engine/lib/assimp/code/Q3BSPZipArchive.h deleted file mode 100644 index 2fdc781f8..000000000 --- a/Engine/lib/assimp/code/Q3BSPZipArchive.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2019, 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 AI_Q3BSP_ZIPARCHIVE_H_INC -#define AI_Q3BSP_ZIPARCHIVE_H_INC - -#include -#include -#include -#include -#include -#include - -namespace Assimp { -namespace Q3BSP { - -// ------------------------------------------------------------------------------------------------ -/// \class IOSystem2Unzip -/// \ingroup Assimp::Q3BSP -/// -/// \brief -// ------------------------------------------------------------------------------------------------ -class IOSystem2Unzip { -public: - static voidpf open(voidpf opaque, const char* filename, int mode); - static uLong read(voidpf opaque, voidpf stream, void* buf, uLong size); - static uLong write(voidpf opaque, voidpf stream, const void* buf, uLong size); - static long tell(voidpf opaque, voidpf stream); - static long seek(voidpf opaque, voidpf stream, uLong offset, int origin); - static int close(voidpf opaque, voidpf stream); - static int testerror(voidpf opaque, voidpf stream); - static zlib_filefunc_def get(IOSystem* pIOHandler); -}; - -// ------------------------------------------------------------------------------------------------ -/// \class ZipFile -/// \ingroup Assimp::Q3BSP -/// -/// \brief -// ------------------------------------------------------------------------------------------------ -class ZipFile : public IOStream { - friend class Q3BSPZipArchive; - -public: - explicit ZipFile(size_t size); - ~ZipFile(); - 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 FileSize() const; - aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/); - size_t Tell() const; - void Flush(); - -private: - void* m_Buffer; - size_t m_Size; -}; - -// ------------------------------------------------------------------------------------------------ -/// \class Q3BSPZipArchive -/// \ingroup Assimp::Q3BSP -/// -/// \brief IMplements a zip archive like the WinZip archives. Will be also used to import data -/// from a P3K archive ( Quake level format ). -// ------------------------------------------------------------------------------------------------ -class Q3BSPZipArchive : public Assimp::IOSystem { -public: - static const unsigned int FileNameSize = 256; - -public: - Q3BSPZipArchive(IOSystem* pIOHandler, const std::string & rFile); - ~Q3BSPZipArchive(); - bool Exists(const char* pFile) const; - char getOsSeparator() const; - IOStream* Open(const char* pFile, const char* pMode = "rb"); - void Close(IOStream* pFile); - bool isOpen() const; - void getFileList(std::vector &rFileList); - -private: - bool mapArchive(); - -private: - unzFile m_ZipFileHandle; - std::map m_ArchiveMap; -}; - -// ------------------------------------------------------------------------------------------------ - -} // Namespace Q3BSP -} // Namespace Assimp - -#endif // AI_Q3BSP_ZIPARCHIVE_H_INC diff --git a/Engine/lib/assimp/code/Q3DLoader.cpp b/Engine/lib/assimp/code/Q3D/Q3DLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/Q3DLoader.cpp rename to Engine/lib/assimp/code/Q3D/Q3DLoader.cpp diff --git a/Engine/lib/assimp/code/Q3DLoader.h b/Engine/lib/assimp/code/Q3D/Q3DLoader.h similarity index 100% rename from Engine/lib/assimp/code/Q3DLoader.h rename to Engine/lib/assimp/code/Q3D/Q3DLoader.h diff --git a/Engine/lib/assimp/code/RawLoader.cpp b/Engine/lib/assimp/code/Raw/RawLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/RawLoader.cpp rename to Engine/lib/assimp/code/Raw/RawLoader.cpp diff --git a/Engine/lib/assimp/code/RawLoader.h b/Engine/lib/assimp/code/Raw/RawLoader.h similarity index 100% rename from Engine/lib/assimp/code/RawLoader.h rename to Engine/lib/assimp/code/Raw/RawLoader.h diff --git a/Engine/lib/assimp/code/RemoveComments.h b/Engine/lib/assimp/code/RemoveComments.h deleted file mode 100644 index 0a00a8f0f..000000000 --- a/Engine/lib/assimp/code/RemoveComments.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Declares a helper class, "CommentRemover", which can be - * used to remove comments (single and multi line) from a text file. - */ -#ifndef AI_REMOVE_COMMENTS_H_INC -#define AI_REMOVE_COMMENTS_H_INC - - -#include - -namespace Assimp { - -// --------------------------------------------------------------------------- -/** \brief Helper class to remove single and multi line comments from a file - * - * Some mesh formats like MD5 have comments that are quite similar - * to those in C or C++ so this code has been moved to a separate - * module. - */ -class ASSIMP_API CommentRemover -{ - // class cannot be instanced - CommentRemover() {} - -public: - - //! Remove single-line comments. The end of a line is - //! expected to be either NL or CR or NLCR. - //! \param szComment The start sequence of the comment, e.g. "//" - //! \param szBuffer Buffer to work with - //! \param chReplacement Character to be used as replacement - //! for commented lines. By default this is ' ' - static void RemoveLineComments(const char* szComment, - char* szBuffer, char chReplacement = ' '); - - //! Remove multi-line comments. The end of a line is - //! expected to be either NL or CR or NLCR. Multi-line comments - //! may not be nested (as in C). - //! \param szCommentStart The start sequence of the comment, e.g. "/*" - //! \param szCommentEnd The end sequence of the comment, e.g. "*/" - //! \param szBuffer Buffer to work with - //! \param chReplacement Character to be used as replacement - //! for commented lines. By default this is ' ' - static void RemoveMultiLineComments(const char* szCommentStart, - const char* szCommentEnd,char* szBuffer, - char chReplacement = ' '); -}; -} // ! Assimp - -#endif // !! AI_REMOVE_COMMENTS_H_INC diff --git a/Engine/lib/assimp/code/SGSpatialSort.h b/Engine/lib/assimp/code/SGSpatialSort.h deleted file mode 100644 index e7cd38724..000000000 --- a/Engine/lib/assimp/code/SGSpatialSort.h +++ /dev/null @@ -1,141 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** Small helper classes to optimize finding vertices close to a given location - */ -#ifndef AI_D3DSSPATIALSORT_H_INC -#define AI_D3DSSPATIALSORT_H_INC - -#include -#include -#include - -namespace Assimp { - -// ---------------------------------------------------------------------------------- -/** Specialized version of SpatialSort to support smoothing groups - * This is used in by the 3DS, ASE and LWO loaders. 3DS and ASE share their - * normal computation code in SmoothingGroups.inl, the LWO loader has its own - * implementation to handle all details of its file format correctly. - */ -// ---------------------------------------------------------------------------------- -class SGSpatialSort -{ -public: - - SGSpatialSort(); - - // ------------------------------------------------------------------- - /** Construction from a given face array, handling smoothing groups - * properly - */ - explicit SGSpatialSort(const std::vector& vPositions); - - // ------------------------------------------------------------------- - /** Add a vertex to the spatial sort - * @param vPosition Vertex position to be added - * @param index Index of the vrtex - * @param smoothingGroup SmoothingGroup for this vertex - */ - void Add(const aiVector3D& vPosition, unsigned int index, - unsigned int smoothingGroup); - - // ------------------------------------------------------------------- - /** Prepare the spatial sorter for use. This step runs in O(logn) - */ - void Prepare(); - - /** Destructor */ - ~SGSpatialSort(); - - // ------------------------------------------------------------------- - /** Returns an iterator for all positions close to the given position. - * @param pPosition The position to look for vertices. - * @param pSG Only included vertices with at least one shared smooth group - * @param pRadius Maximal distance from the position a vertex may have - * to be counted in. - * @param poResults The container to store the indices of the found - * positions. Will be emptied by the call so it may contain anything. - * @param exactMatch Specifies whether smoothing groups are bit masks - * (false) or integral values (true). In the latter case, a vertex - * cannot belong to more than one smoothing group. - * @return An iterator to iterate over all vertices in the given area. - */ - // ------------------------------------------------------------------- - void FindPositions( const aiVector3D& pPosition, uint32_t pSG, - float pRadius, std::vector& poResults, - bool exactMatch = false) const; - -protected: - /** Normal of the sorting plane, normalized. The center is always at (0, 0, 0) */ - aiVector3D mPlaneNormal; - - // ------------------------------------------------------------------- - /** An entry in a spatially sorted position array. Consists of a - * vertex index, its position and its precalculated distance from - * the reference plane */ - // ------------------------------------------------------------------- - struct Entry - { - unsigned int mIndex; ///< The vertex referred by this entry - aiVector3D mPosition; ///< Position - uint32_t mSmoothGroups; - float mDistance; ///< Distance of this vertex to the sorting plane - - Entry() { /** intentionally not initialized.*/ } - Entry( unsigned int pIndex, const aiVector3D& pPosition, float pDistance,uint32_t pSG) - : - mIndex( pIndex), - mPosition( pPosition), - mSmoothGroups (pSG), - mDistance( pDistance) - { } - - bool operator < (const Entry& e) const { return mDistance < e.mDistance; } - }; - - // all positions, sorted by distance to the sorting plane - std::vector mPositions; -}; - -} // end of namespace Assimp - -#endif // AI_SPATIALSORT_H_INC diff --git a/Engine/lib/assimp/code/SIBImporter.cpp b/Engine/lib/assimp/code/SIB/SIBImporter.cpp similarity index 99% rename from Engine/lib/assimp/code/SIBImporter.cpp rename to Engine/lib/assimp/code/SIB/SIBImporter.cpp index cfa65520e..20cdc8009 100644 --- a/Engine/lib/assimp/code/SIBImporter.cpp +++ b/Engine/lib/assimp/code/SIB/SIBImporter.cpp @@ -59,8 +59,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -//#include "../contrib/ConvertUTF/ConvertUTF.h" -#include "../contrib/utf8cpp/source/utf8.h" +#ifdef ASSIMP_USE_HUNTER +# include +#else +//# include "../contrib/ConvertUTF/ConvertUTF.h" +# include "../contrib/utf8cpp/source/utf8.h" +#endif #include #include #include diff --git a/Engine/lib/assimp/code/SIBImporter.h b/Engine/lib/assimp/code/SIB/SIBImporter.h similarity index 100% rename from Engine/lib/assimp/code/SIBImporter.h rename to Engine/lib/assimp/code/SIB/SIBImporter.h diff --git a/Engine/lib/assimp/code/SMDLoader.cpp b/Engine/lib/assimp/code/SMD/SMDLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/SMDLoader.cpp rename to Engine/lib/assimp/code/SMD/SMDLoader.cpp index 00d92e0b4..4288bf9c3 100644 --- a/Engine/lib/assimp/code/SMDLoader.cpp +++ b/Engine/lib/assimp/code/SMD/SMDLoader.cpp @@ -486,7 +486,7 @@ void SMDImporter::CreateOutputAnimations(const std::string &pFile, IOSystem* pIO if (bLoadAnimationList) { GetAnimationFileList(pFile, pIOHandler, animFileList); } - int animCount = animFileList.size() + 1; + int animCount = static_cast( animFileList.size() + 1u ); pScene->mNumAnimations = 1; pScene->mAnimations = new aiAnimation*[animCount]; memset(pScene->mAnimations, 0, sizeof(aiAnimation*)*animCount); @@ -510,7 +510,7 @@ void SMDImporter::CreateOutputAnimation(int index, const std::string &name) { anim->mName.Set(name.c_str()); } anim->mDuration = dLengthOfAnim; - anim->mNumChannels = asBones.size(); + anim->mNumChannels = static_cast( asBones.size() ); anim->mTicksPerSecond = 25.0; // FIXME: is this correct? aiNodeAnim** pp = anim->mChannels = new aiNodeAnim*[anim->mNumChannels]; diff --git a/Engine/lib/assimp/code/SMDLoader.h b/Engine/lib/assimp/code/SMD/SMDLoader.h similarity index 100% rename from Engine/lib/assimp/code/SMDLoader.h rename to Engine/lib/assimp/code/SMD/SMDLoader.h diff --git a/Engine/lib/assimp/code/STLExporter.cpp b/Engine/lib/assimp/code/STL/STLExporter.cpp similarity index 98% rename from Engine/lib/assimp/code/STLExporter.cpp rename to Engine/lib/assimp/code/STL/STLExporter.cpp index 00fced6ff..43bc752ae 100644 --- a/Engine/lib/assimp/code/STLExporter.cpp +++ b/Engine/lib/assimp/code/STL/STLExporter.cpp @@ -111,7 +111,7 @@ STLExporter::STLExporter(const char* _filename, const aiScene* pScene, bool expo // make sure that all formatting happens using the standard, C locale and not the user's current locale const std::locale& l = std::locale("C"); mOutput.imbue(l); - mOutput.precision(16); + mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); if (binary) { char buf[80] = {0} ; buf[0] = 'A'; buf[1] = 's'; buf[2] = 's'; buf[3] = 'i'; buf[4] = 'm'; buf[5] = 'p'; @@ -127,7 +127,7 @@ STLExporter::STLExporter(const char* _filename, const aiScene* pScene, bool expo mOutput.write((char *)&meshnum, 4); if (exportPointClouds) { - + throw DeadlyExportError("This functionality is not yet implemented for binary output."); } for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) { diff --git a/Engine/lib/assimp/code/STLExporter.h b/Engine/lib/assimp/code/STL/STLExporter.h similarity index 100% rename from Engine/lib/assimp/code/STLExporter.h rename to Engine/lib/assimp/code/STL/STLExporter.h diff --git a/Engine/lib/assimp/code/STLLoader.cpp b/Engine/lib/assimp/code/STL/STLLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/STLLoader.cpp rename to Engine/lib/assimp/code/STL/STLLoader.cpp index c615561a8..199a84a44 100644 --- a/Engine/lib/assimp/code/STLLoader.cpp +++ b/Engine/lib/assimp/code/STL/STLLoader.cpp @@ -225,7 +225,7 @@ void STLImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS } pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_DIFFUSE); pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_SPECULAR); - clrDiffuse = aiColor4D( ai_real(1.0), ai_real(1.0), ai_real(1.0), ai_real(1.0)); + clrDiffuse = aiColor4D( ai_real(0.05), ai_real(0.05), ai_real(0.05), ai_real(1.0)); pcMat->AddProperty(&clrDiffuse,1,AI_MATKEY_COLOR_AMBIENT); pScene->mNumMaterials = 1; @@ -278,6 +278,7 @@ void STLImporter::LoadASCIIFile( aiNode *root ) { } std::string name( szMe, temp ); node->mName.Set( name.c_str() ); + pMesh->mName.Set( name.c_str() ); //pScene->mRootNode->mName.length = temp; //memcpy(pScene->mRootNode->mName.data,szMe,temp); //pScene->mRootNode->mName.data[temp] = '\0'; diff --git a/Engine/lib/assimp/code/STLLoader.h b/Engine/lib/assimp/code/STL/STLLoader.h similarity index 100% rename from Engine/lib/assimp/code/STLLoader.h rename to Engine/lib/assimp/code/STL/STLLoader.h diff --git a/Engine/lib/assimp/code/SkeletonMeshBuilder.h b/Engine/lib/assimp/code/SkeletonMeshBuilder.h deleted file mode 100644 index 7a7e7b8ff..000000000 --- a/Engine/lib/assimp/code/SkeletonMeshBuilder.h +++ /dev/null @@ -1,124 +0,0 @@ -/** Helper class to construct a dummy mesh for file formats containing only motion data */ - -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file SkeletonMeshBuilder.h - * Declares SkeletonMeshBuilder, a tiny utility to build dummy meshes - * for animation skeletons. - */ - -#ifndef AI_SKELETONMESHBUILDER_H_INC -#define AI_SKELETONMESHBUILDER_H_INC - -#include -#include - -struct aiMaterial; -struct aiScene; -struct aiNode; - -namespace Assimp { - -// --------------------------------------------------------------------------- -/** - * This little helper class constructs a dummy mesh for a given scene - * the resembles the node hierarchy. This is useful for file formats - * that don't carry any mesh data but only animation data. - */ -class SkeletonMeshBuilder -{ -public: - - // ------------------------------------------------------------------- - /** The constructor processes the given scene and adds a mesh there. - * - * Does nothing if the scene already has mesh data. - * @param pScene The scene for which a skeleton mesh should be constructed. - * @param root The node to start with. NULL is the scene root - * @param bKnobsOnly Set this to true if you don't want the connectors - * between the knobs representing the nodes. - */ - SkeletonMeshBuilder( aiScene* pScene, aiNode* root = NULL, - bool bKnobsOnly = false); - -protected: - - // ------------------------------------------------------------------- - /** Recursively builds a simple mesh representation for the given node - * and also creates a joint for the node that affects this part of - * the mesh. - * @param pNode The node to build geometry for. - */ - void CreateGeometry( const aiNode* pNode); - - // ------------------------------------------------------------------- - /** Creates the mesh from the internally accumulated stuff and returns it. - */ - aiMesh* CreateMesh(); - - // ------------------------------------------------------------------- - /** Creates a dummy material and returns it. */ - aiMaterial* CreateMaterial(); - -protected: - /** space to assemble the mesh data: points */ - std::vector mVertices; - - /** faces */ - struct Face - { - unsigned int mIndices[3]; - Face(); - Face( unsigned int p0, unsigned int p1, unsigned int p2) - { mIndices[0] = p0; mIndices[1] = p1; mIndices[2] = p2; } - }; - std::vector mFaces; - - /** bones */ - std::vector mBones; - - bool mKnobsOnly; -}; - -} // end of namespace Assimp - -#endif // AI_SKELETONMESHBUILDER_H_INC diff --git a/Engine/lib/assimp/code/SmoothingGroups.h b/Engine/lib/assimp/code/SmoothingGroups.h deleted file mode 100644 index 7a7e2e429..000000000 --- a/Engine/lib/assimp/code/SmoothingGroups.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Defines the helper data structures for importing 3DS files. -http://www.jalix.org/ressources/graphics/3DS/_unofficials/3ds-unofficial.txt */ - -#ifndef AI_SMOOTHINGGROUPS_H_INC -#define AI_SMOOTHINGGROUPS_H_INC - -#include -#include -#include - -// --------------------------------------------------------------------------- -/** Helper structure representing a face with smoothing groups assigned */ -struct FaceWithSmoothingGroup -{ - FaceWithSmoothingGroup() - : mIndices(), - iSmoothGroup(0) - { - // in debug builds set all indices to a common magic value -#ifdef ASSIMP_BUILD_DEBUG - this->mIndices[0] = 0xffffffff; - this->mIndices[1] = 0xffffffff; - this->mIndices[2] = 0xffffffff; -#endif - } - - - //! Indices. .3ds is using uint16. However, after - //! an unique vertex set has been generated, - //! individual index values might exceed 2^16 - uint32_t mIndices[3]; - - //! specifies to which smoothing group the face belongs to - uint32_t iSmoothGroup; -}; - -// --------------------------------------------------------------------------- -/** Helper structure representing a mesh whose faces have smoothing - groups assigned. This allows us to reuse the code for normal computations - from smoothings groups for several loaders (3DS, ASE). All of them - use face structures which inherit from #FaceWithSmoothingGroup, - but as they add extra members and need to be copied by value we - need to use a template here. - */ -template -struct MeshWithSmoothingGroups -{ - //! Vertex positions - std::vector mPositions; - - //! Face lists - std::vector mFaces; - - //! List of normal vectors - std::vector mNormals; -}; - -// --------------------------------------------------------------------------- -/** Computes normal vectors for the mesh - */ -template -void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups& sMesh); - - -// include implementations -#include "SmoothingGroups.inl" - -#endif // !! AI_SMOOTHINGGROUPS_H_INC diff --git a/Engine/lib/assimp/code/SmoothingGroups.inl b/Engine/lib/assimp/code/SmoothingGroups.inl deleted file mode 100644 index 42c500070..000000000 --- a/Engine/lib/assimp/code/SmoothingGroups.inl +++ /dev/null @@ -1,138 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2012, 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 Generation of normal vectors basing on smoothing groups */ - -#ifndef AI_SMOOTHINGGROUPS_INL_INCLUDED -#define AI_SMOOTHINGGROUPS_INL_INCLUDED - -// internal headers -#include "SGSpatialSort.h" - -// CRT header -#include - -using namespace Assimp; - -// ------------------------------------------------------------------------------------------------ -template -void ComputeNormalsWithSmoothingsGroups(MeshWithSmoothingGroups& sMesh) -{ - // First generate face normals - sMesh.mNormals.resize(sMesh.mPositions.size(),aiVector3D()); - for( unsigned int a = 0; a < sMesh.mFaces.size(); a++) - { - T& face = sMesh.mFaces[a]; - - aiVector3D* pV1 = &sMesh.mPositions[face.mIndices[0]]; - aiVector3D* pV2 = &sMesh.mPositions[face.mIndices[1]]; - aiVector3D* pV3 = &sMesh.mPositions[face.mIndices[2]]; - - aiVector3D pDelta1 = *pV2 - *pV1; - aiVector3D pDelta2 = *pV3 - *pV1; - aiVector3D vNor = pDelta1 ^ pDelta2; - - for (unsigned int c = 0; c < 3;++c) - sMesh.mNormals[face.mIndices[c]] = vNor; - } - - // calculate the position bounds so we have a reliable epsilon to check position differences against - aiVector3D minVec( 1e10f, 1e10f, 1e10f), maxVec( -1e10f, -1e10f, -1e10f); - for( unsigned int a = 0; a < sMesh.mPositions.size(); a++) - { - minVec.x = std::min( minVec.x, sMesh.mPositions[a].x); - minVec.y = std::min( minVec.y, sMesh.mPositions[a].y); - minVec.z = std::min( minVec.z, sMesh.mPositions[a].z); - maxVec.x = std::max( maxVec.x, sMesh.mPositions[a].x); - maxVec.y = std::max( maxVec.y, sMesh.mPositions[a].y); - maxVec.z = std::max( maxVec.z, sMesh.mPositions[a].z); - } - const float posEpsilon = (maxVec - minVec).Length() * 1e-5f; - std::vector avNormals; - avNormals.resize(sMesh.mNormals.size()); - - // now generate the spatial sort tree - SGSpatialSort sSort; - for( typename std::vector::iterator i = sMesh.mFaces.begin(); - i != sMesh.mFaces.end();++i) - { - for (unsigned int c = 0; c < 3;++c) - sSort.Add(sMesh.mPositions[(*i).mIndices[c]],(*i).mIndices[c],(*i).iSmoothGroup); - } - sSort.Prepare(); - - std::vector vertexDone(sMesh.mPositions.size(),false); - for( typename std::vector::iterator i = sMesh.mFaces.begin(); - i != sMesh.mFaces.end();++i) - { - std::vector poResult; - for (unsigned int c = 0; c < 3;++c) - { - unsigned int idx = (*i).mIndices[c]; - if (vertexDone[idx])continue; - - sSort.FindPositions(sMesh.mPositions[idx],(*i).iSmoothGroup, - posEpsilon,poResult); - - aiVector3D vNormals; - for (std::vector::const_iterator - a = poResult.begin(); - a != poResult.end();++a) - { - vNormals += sMesh.mNormals[(*a)]; - } - vNormals.NormalizeSafe(); - - // write back into all affected normals - for (std::vector::const_iterator - a = poResult.begin(); - a != poResult.end();++a) - { - idx = *a; - avNormals [idx] = vNormals; - vertexDone[idx] = true; - } - } - } - sMesh.mNormals = avNormals; -} - -#endif // !! AI_SMOOTHINGGROUPS_INL_INCLUDED diff --git a/Engine/lib/assimp/code/SpatialSort.h b/Engine/lib/assimp/code/SpatialSort.h deleted file mode 100644 index 36b7a2767..000000000 --- a/Engine/lib/assimp/code/SpatialSort.h +++ /dev/null @@ -1,171 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** Small helper classes to optimise finding vertizes close to a given location */ -#ifndef AI_SPATIALSORT_H_INC -#define AI_SPATIALSORT_H_INC - -#include -#include - -namespace Assimp -{ - -// ------------------------------------------------------------------------------------------------ -/** A little helper class to quickly find all vertices in the epsilon environment of a given - * position. Construct an instance with an array of positions. The class stores the given positions - * by their indices and sorts them by their distance to an arbitrary chosen plane. - * You can then query the instance for all vertices close to a given position in an average O(log n) - * time, with O(n) worst case complexity when all vertices lay on the plane. The plane is chosen - * so that it avoids common planes in usual data sets. */ -// ------------------------------------------------------------------------------------------------ -class SpatialSort -{ -public: - - SpatialSort(); - - // ------------------------------------------------------------------------------------ - /** Constructs a spatially sorted representation from the given position array. - * Supply the positions in its layout in memory, the class will only refer to them - * by index. - * @param pPositions Pointer to the first position vector of the array. - * @param pNumPositions Number of vectors to expect in that array. - * @param pElementOffset Offset in bytes from the beginning of one vector in memory - * to the beginning of the next vector. */ - SpatialSort( const aiVector3D* pPositions, unsigned int pNumPositions, - unsigned int pElementOffset); - - /** Destructor */ - ~SpatialSort(); - -public: - - // ------------------------------------------------------------------------------------ - /** Sets the input data for the SpatialSort. This replaces existing data, if any. - * The new data receives new indices in ascending order. - * - * @param pPositions Pointer to the first position vector of the array. - * @param pNumPositions Number of vectors to expect in that array. - * @param pElementOffset Offset in bytes from the beginning of one vector in memory - * to the beginning of the next vector. - * @param pFinalize Specifies whether the SpatialSort's internal representation - * is finalized after the new data has been added. Finalization is - * required in order to use #FindPosition() or #GenerateMappingTable(). - * If you don't finalize yet, you can use #Append() to add data from - * other sources.*/ - void Fill( const aiVector3D* pPositions, unsigned int pNumPositions, - unsigned int pElementOffset, - bool pFinalize = true); - - - // ------------------------------------------------------------------------------------ - /** Same as #Fill(), except the method appends to existing data in the #SpatialSort. */ - void Append( const aiVector3D* pPositions, unsigned int pNumPositions, - unsigned int pElementOffset, - bool pFinalize = true); - - - // ------------------------------------------------------------------------------------ - /** Finalize the spatial hash data structure. This can be useful after - * multiple calls to #Append() with the pFinalize parameter set to false. - * This is finally required before one of #FindPositions() and #GenerateMappingTable() - * can be called to query the spatial sort.*/ - void Finalize(); - - // ------------------------------------------------------------------------------------ - /** Returns an iterator for all positions close to the given position. - * @param pPosition The position to look for vertices. - * @param pRadius Maximal distance from the position a vertex may have to be counted in. - * @param poResults The container to store the indices of the found positions. - * Will be emptied by the call so it may contain anything. - * @return An iterator to iterate over all vertices in the given area.*/ - void FindPositions( const aiVector3D& pPosition, ai_real pRadius, - std::vector& poResults) const; - - // ------------------------------------------------------------------------------------ - /** Fills an array with indices of all positions identical to the given position. In - * opposite to FindPositions(), not an epsilon is used but a (very low) tolerance of - * four floating-point units. - * @param pPosition The position to look for vertices. - * @param poResults The container to store the indices of the found positions. - * Will be emptied by the call so it may contain anything.*/ - void FindIdenticalPositions( const aiVector3D& pPosition, - std::vector& poResults) const; - - // ------------------------------------------------------------------------------------ - /** Compute a table that maps each vertex ID referring to a spatially close - * enough position to the same output ID. Output IDs are assigned in ascending order - * from 0...n. - * @param fill Will be filled with numPositions entries. - * @param pRadius Maximal distance from the position a vertex may have to - * be counted in. - * @return Number of unique vertices (n). */ - unsigned int GenerateMappingTable(std::vector& fill, - ai_real pRadius) const; - -protected: - /** Normal of the sorting plane, normalized. The center is always at (0, 0, 0) */ - aiVector3D mPlaneNormal; - - /** An entry in a spatially sorted position array. Consists of a vertex index, - * its position and its precalculated distance from the reference plane */ - struct Entry - { - unsigned int mIndex; ///< The vertex referred by this entry - aiVector3D mPosition; ///< Position - ai_real mDistance; ///< Distance of this vertex to the sorting plane - - Entry() { /** intentionally not initialized.*/ } - Entry( unsigned int pIndex, const aiVector3D& pPosition, ai_real pDistance) - : mIndex( pIndex), mPosition( pPosition), mDistance( pDistance) - { } - - bool operator < (const Entry& e) const { return mDistance < e.mDistance; } - }; - - // all positions, sorted by distance to the sorting plane - std::vector mPositions; -}; - -} // end of namespace Assimp - -#endif // AI_SPATIALSORT_H_INC diff --git a/Engine/lib/assimp/code/StandardShapes.h b/Engine/lib/assimp/code/StandardShapes.h deleted file mode 100644 index a31de566c..000000000 --- a/Engine/lib/assimp/code/StandardShapes.h +++ /dev/null @@ -1,199 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Declares a helper class, "StandardShapes" which generates - * vertices for standard shapes, such as cylnders, cones, spheres .. - */ -#ifndef AI_STANDARD_SHAPES_H_INC -#define AI_STANDARD_SHAPES_H_INC - -#include -#include - -struct aiMesh; - -namespace Assimp { - -// --------------------------------------------------------------------------- -/** \brief Helper class to generate vertex buffers for standard geometric - * shapes, such as cylinders, cones, boxes, spheres, elipsoids ... . - */ -class StandardShapes -{ - // class cannot be instanced - StandardShapes() {} - -public: - - - // ---------------------------------------------------------------- - /** Generates a mesh from an array of vertex positions. - * - * @param positions List of vertex positions - * @param numIndices Number of indices per primitive - * @return Output mesh - */ - static aiMesh* MakeMesh(const std::vector& positions, - unsigned int numIndices); - - - static aiMesh* MakeMesh ( unsigned int (*GenerateFunc) - (std::vector&)); - - static aiMesh* MakeMesh ( unsigned int (*GenerateFunc) - (std::vector&, bool)); - - static aiMesh* MakeMesh ( unsigned int n, void (*GenerateFunc) - (unsigned int,std::vector&)); - - // ---------------------------------------------------------------- - /** @brief Generates a hexahedron (cube) - * - * Hexahedrons can be scaled on all axes. - * @param positions Receives output triangles. - * @param polygons If you pass true here quads will be returned - * @return Number of vertices per face - */ - static unsigned int MakeHexahedron( - std::vector& positions, - bool polygons = false); - - // ---------------------------------------------------------------- - /** @brief Generates an icosahedron - * - * @param positions Receives output triangles. - * @return Number of vertices per face - */ - static unsigned int MakeIcosahedron( - std::vector& positions); - - - // ---------------------------------------------------------------- - /** @brief Generates a dodecahedron - * - * @param positions Receives output triangles - * @param polygons If you pass true here pentagons will be returned - * @return Number of vertices per face - */ - static unsigned int MakeDodecahedron( - std::vector& positions, - bool polygons = false); - - - // ---------------------------------------------------------------- - /** @brief Generates an octahedron - * - * @param positions Receives output triangles. - * @return Number of vertices per face - */ - static unsigned int MakeOctahedron( - std::vector& positions); - - - // ---------------------------------------------------------------- - /** @brief Generates a tetrahedron - * - * @param positions Receives output triangles. - * @return Number of vertices per face - */ - static unsigned int MakeTetrahedron( - std::vector& positions); - - - - // ---------------------------------------------------------------- - /** @brief Generates a sphere - * - * @param tess Number of subdivions - 0 generates a octahedron - * @param positions Receives output triangles. - */ - static void MakeSphere(unsigned int tess, - std::vector& positions); - - - // ---------------------------------------------------------------- - /** @brief Generates a cone or a cylinder, either open or closed. - * - * @code - * - * |-----| <- radius 1 - * - * __x__ <- ] ^ - * / \ | height | - * / \ | Y - * / \ | - * / \ | - * /______x______\ <- ] <- end cap - * - * |-------------| <- radius 2 - * - * @endcode - * - * @param height Height of the cone - * @param radius1 First radius - * @param radius2 Second radius - * @param tess Number of triangles. - * @param bOpened true for an open cone/cylinder. An open shape has - * no 'end caps' - * @param positions Receives output triangles - */ - static void MakeCone(ai_real height,ai_real radius1, - ai_real radius2,unsigned int tess, - std::vector& positions,bool bOpen= false); - - - // ---------------------------------------------------------------- - /** @brief Generates a flat circle - * - * The circle is constructed in the planned formed by the x,z - * axes of the cartesian coordinate system. - * - * @param radius Radius of the circle - * @param tess Number of segments. - * @param positions Receives output triangles. - */ - static void MakeCircle(ai_real radius, unsigned int tess, - std::vector& positions); - -}; -} // ! Assimp - -#endif // !! AI_STANDARD_SHAPES_H_INC diff --git a/Engine/lib/assimp/code/Step/STEPFile.h b/Engine/lib/assimp/code/Step/STEPFile.h new file mode 100644 index 000000000..d99b34b3c --- /dev/null +++ b/Engine/lib/assimp/code/Step/STEPFile.h @@ -0,0 +1,1016 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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 INCLUDED_AI_STEPFILE_H +#define INCLUDED_AI_STEPFILE_H + +#include +#include +#include +#include +#include +#include + +#include "FBX/FBXDocument.h" //ObjectMap::value_type + +#include + +// +#if _MSC_VER > 1500 || (defined __GNUC___) +# define ASSIMP_STEP_USE_UNORDERED_MULTIMAP +#else +# define step_unordered_map map +# define step_unordered_multimap multimap +#endif + +#ifdef ASSIMP_STEP_USE_UNORDERED_MULTIMAP +# include +# if _MSC_VER > 1600 +# define step_unordered_map unordered_map +# define step_unordered_multimap unordered_multimap +# else +# define step_unordered_map tr1::unordered_map +# define step_unordered_multimap tr1::unordered_multimap +# endif +#endif + +#include + +// uncomment this to have the loader evaluate all entities upon loading. +// this is intended as stress test - by default, entities are evaluated +// lazily and therefore not unless needed. + +//#define ASSIMP_IFC_TEST + +namespace Assimp { + +// ******************************************************************************** +// before things get complicated, this is the basic outline: + + +namespace STEP { + + namespace EXPRESS { + + // base data types known by EXPRESS schemata - any custom data types will derive one of those + class DataType; + class UNSET; /*: public DataType */ + class ISDERIVED; /*: public DataType */ + // class REAL; /*: public DataType */ + class ENUM; /*: public DataType */ + // class STRING; /*: public DataType */ + // class INTEGER; /*: public DataType */ + class ENTITY; /*: public DataType */ + class LIST; /*: public DataType */ + // class SELECT; /*: public DataType */ + + // a conversion schema is not exactly an EXPRESS schema, rather it + // is a list of pointers to conversion functions to build up the + // object tree from an input file. + class ConversionSchema; + } + + struct HeaderInfo; + class Object; + class LazyObject; + class DB; + + + typedef Object* (*ConvertObjectProc)(const DB& db, const EXPRESS::LIST& params); +} + +// ******************************************************************************** + +namespace STEP { + + // ------------------------------------------------------------------------------- + /** Exception class used by the STEP loading & parsing code. It is typically + * coupled with a line number. */ + // ------------------------------------------------------------------------------- + struct SyntaxError : DeadlyImportError { + enum { + LINE_NOT_SPECIFIED = 0xffffffffffffffffLL + }; + + SyntaxError (const std::string& s,uint64_t line = LINE_NOT_SPECIFIED); + }; + + + // ------------------------------------------------------------------------------- + /** Exception class used by the STEP loading & parsing code when a type + * error (i.e. an entity expects a string but receives a bool) occurs. + * It is typically coupled with both an entity id and a line number.*/ + // ------------------------------------------------------------------------------- + struct TypeError : DeadlyImportError { + enum { + ENTITY_NOT_SPECIFIED = 0xffffffffffffffffLL, + ENTITY_NOT_SPECIFIED_32 = 0x00000000ffffffff + }; + + TypeError (const std::string& s,uint64_t entity = ENTITY_NOT_SPECIFIED, uint64_t line = SyntaxError::LINE_NOT_SPECIFIED); + }; + + + // hack to make a given member template-dependent + template + T2& Couple(T2& in) { + return in; + } + + + namespace EXPRESS { + + // ------------------------------------------------------------------------------- + //** Base class for all STEP data types */ + // ------------------------------------------------------------------------------- + class DataType + { + public: + typedef std::shared_ptr Out; + + public: + + virtual ~DataType() { + } + + public: + + template + const T& To() const { + return dynamic_cast(*this); + } + + template + T& To() { + return dynamic_cast(*this); + } + + + template + const T* ToPtr() const { + return dynamic_cast(this); + } + + template + T* ToPtr() { + return dynamic_cast(this); + } + + // utilities to deal with SELECT entities, which currently lack automatic + // conversion support. + template + const T& ResolveSelect(const DB& db) const { + return Couple(db).MustGetObject(To())->template To(); + } + + template + const T* ResolveSelectPtr(const DB& db) const { + const EXPRESS::ENTITY* e = ToPtr(); + return e?Couple(db).MustGetObject(*e)->template ToPtr():(const T*)0; + } + + public: + + /** parse a variable from a string and set 'inout' to the character + * behind the last consumed character. An optional schema enables, + * if specified, automatic conversion of custom data types. + * + * @throw SyntaxError + */ + static std::shared_ptr Parse(const char*& inout, + uint64_t line = SyntaxError::LINE_NOT_SPECIFIED, + const EXPRESS::ConversionSchema* schema = NULL); + + public: + }; + + typedef DataType SELECT; + typedef DataType LOGICAL; + + // ------------------------------------------------------------------------------- + /** Sentinel class to represent explicitly unset (optional) fields ($) */ + // ------------------------------------------------------------------------------- + class UNSET : public DataType + { + public: + private: + }; + + // ------------------------------------------------------------------------------- + /** Sentinel class to represent explicitly derived fields (*) */ + // ------------------------------------------------------------------------------- + class ISDERIVED : public DataType + { + public: + private: + }; + + // ------------------------------------------------------------------------------- + /** Shared implementation for some of the primitive data type, i.e. int, float */ + // ------------------------------------------------------------------------------- + template + class PrimitiveDataType : public DataType + { + public: + + // This is the type that will cd ultimatively be used to + // expose this data type to the user. + typedef T Out; + + public: + + PrimitiveDataType() {} + PrimitiveDataType(const T& val) + : val(val) + {} + + PrimitiveDataType(const PrimitiveDataType& o) { + (*this) = o; + } + + + public: + + operator const T& () const { + return val; + } + + PrimitiveDataType& operator=(const PrimitiveDataType& o) { + val = o.val; + return *this; + } + + protected: + T val; + + }; + + typedef PrimitiveDataType INTEGER; + typedef PrimitiveDataType REAL; + typedef PrimitiveDataType NUMBER; + typedef PrimitiveDataType STRING; + + + + // ------------------------------------------------------------------------------- + /** Generic base class for all enumerated types */ + // ------------------------------------------------------------------------------- + class ENUMERATION : public STRING + { + public: + + ENUMERATION (const std::string& val) + : STRING(val) + {} + + private: + }; + + typedef ENUMERATION BOOLEAN; + + // ------------------------------------------------------------------------------- + /** This is just a reference to an entity/object somewhere else */ + // ------------------------------------------------------------------------------- + class ENTITY : public PrimitiveDataType + { + public: + + ENTITY(uint64_t val) + : PrimitiveDataType(val) + { + ai_assert(val!=0); + } + + ENTITY() + : PrimitiveDataType(TypeError::ENTITY_NOT_SPECIFIED) + { + } + + private: + }; + + // ------------------------------------------------------------------------------- + /** Wrap any STEP aggregate: LIST, SET, ... */ + // ------------------------------------------------------------------------------- + class LIST : public DataType + { + public: + + // access a particular list index, throw std::range_error for wrong indices + std::shared_ptr operator[] (size_t index) const { + return members[index]; + } + + size_t GetSize() const { + return members.size(); + } + + public: + + /** @see DaraType::Parse */ + static std::shared_ptr Parse(const char*& inout, + uint64_t line = SyntaxError::LINE_NOT_SPECIFIED, + const EXPRESS::ConversionSchema* schema = NULL); + + + private: + typedef std::vector< std::shared_ptr > MemberList; + MemberList members; + }; + + class BINARY : public PrimitiveDataType { + public: + BINARY(uint32_t val) + : PrimitiveDataType(val) { + // empty + } + + BINARY() + : PrimitiveDataType(TypeError::ENTITY_NOT_SPECIFIED_32) { + // empty + } + }; + + // ------------------------------------------------------------------------------- + /* Not exactly a full EXPRESS schema but rather a list of conversion functions + * to extract valid C++ objects out of a STEP file. Those conversion functions + * may, however, perform further schema validations. */ + // ------------------------------------------------------------------------------- + class ConversionSchema { + public: + struct SchemaEntry { + SchemaEntry( const char *name, ConvertObjectProc func ) + : mName( name ) + , mFunc(func) { + // empty + } + + const char* mName; + ConvertObjectProc mFunc; + }; + + typedef std::map ConverterMap; + + template + explicit ConversionSchema( const SchemaEntry (& schemas)[N]) { + *this = schemas; + } + + ConversionSchema() { + + } + + ConvertObjectProc GetConverterProc(const std::string& name) const { + ConverterMap::const_iterator it = converters.find(name); + return it == converters.end() ? nullptr : (*it).second; + } + + bool IsKnownToken(const std::string& name) const { + return converters.find(name) != converters.end(); + } + + const char* GetStaticStringForToken(const std::string& token) const { + ConverterMap::const_iterator it = converters.find(token); + return it == converters.end() ? nullptr : (*it).first.c_str(); + } + + + template + const ConversionSchema& operator=( const SchemaEntry (& schemas)[N]) { + for(size_t i = 0; i < N; ++i ) { + const SchemaEntry& schema = schemas[i]; + converters[schema.mName] = schema.mFunc; + } + return *this; + } + + private: + ConverterMap converters; + }; + } + + + + // ------------------------------------------------------------------------------ + /** Bundle all the relevant info from a STEP header, parts of which may later + * be plainly dumped to the logfile, whereas others may help the caller pick an + * appropriate loading strategy.*/ + // ------------------------------------------------------------------------------ + struct HeaderInfo + { + std::string timestamp; + std::string app; + std::string fileSchema; + }; + + + // ------------------------------------------------------------------------------ + /** Base class for all concrete object instances */ + // ------------------------------------------------------------------------------ + class Object { + public: + Object(const char* classname = "unknown") + : id( 0 ) + , classname(classname) { + // empty + } + + virtual ~Object() { + // empty + } + + // utilities to simplify casting to concrete types + template + const T& To() const { + return dynamic_cast(*this); + } + + template + T& To() { + return dynamic_cast(*this); + } + + template + const T* ToPtr() const { + return dynamic_cast(this); + } + + template + T* ToPtr() { + return dynamic_cast(this); + } + + uint64_t GetID() const { + return id; + } + + std::string GetClassName() const { + return classname; + } + + void SetID(uint64_t newval) { + id = newval; + } + + private: + uint64_t id; + const char* const classname; + }; + + template + size_t GenericFill(const STEP::DB& db, const EXPRESS::LIST& params, T* in); + // (intentionally undefined) + + + // ------------------------------------------------------------------------------ + /** CRTP shared base class for use by concrete entity implementation classes */ + // ------------------------------------------------------------------------------ + template + struct ObjectHelper : virtual Object { + ObjectHelper() + : aux_is_derived(0) { + // empty + } + + static Object* Construct(const STEP::DB& db, const EXPRESS::LIST& params) { + // make sure we don't leak if Fill() throws an exception + std::unique_ptr impl(new TDerived()); + + // GenericFill is undefined so we need to have a specialization + const size_t num_args = GenericFill(db,params,&*impl); + (void)num_args; + + // the following check is commented because it will always trigger if + // parts of the entities are generated with dummy wrapper code. + // This is currently done to reduce the size of the loader + // code. + //if (num_args != params.GetSize() && impl->GetClassName() != "NotImplemented") { + // DefaultLogger::get()->debug("STEP: not all parameters consumed"); + //} + return impl.release(); + } + + // note that this member always exists multiple times within the hierarchy + // of an individual object, so any access to it must be disambiguated. + std::bitset aux_is_derived; + }; + + // ------------------------------------------------------------------------------ + /** Class template used to represent OPTIONAL data members in the converted schema */ + // ------------------------------------------------------------------------------ + template + struct Maybe { + Maybe() + : have() { + // empty + } + + explicit Maybe(const T& ptr) + : ptr(ptr) + , have(true) { + // empty + } + + + void flag_invalid() { + have = false; + } + + void flag_valid() { + have = true; + } + + + bool operator! () const { + return !have; + } + + operator bool() const { + return have; + } + + operator const T&() const { + return Get(); + } + + const T& Get() const { + ai_assert(have); + return ptr; + } + + Maybe& operator=(const T& _ptr) { + ptr = _ptr; + have = true; + return *this; + } + + private: + template friend struct InternGenericConvert; + + operator T&() { + return ptr; + } + + T ptr; + bool have; + }; + + // ------------------------------------------------------------------------------ + /** A LazyObject is created when needed. Before this happens, we just keep + the text line that contains the object definition. */ + // ------------------------------------------------------------------------------- + class LazyObject { + friend class DB; + + public: + LazyObject(DB& db, uint64_t id, uint64_t line, const char* type,const char* args); + ~LazyObject(); + + Object& operator * () { + if (!obj) { + LazyInit(); + ai_assert(obj); + } + return *obj; + } + + const Object& operator * () const { + if (!obj) { + LazyInit(); + ai_assert(obj); + } + return *obj; + } + + template + const T& To() const { + return dynamic_cast( **this ); + } + + template + T& To() { + return dynamic_cast( **this ); + } + + template + const T* ToPtr() const { + return dynamic_cast( &**this ); + } + + template + T* ToPtr() { + return dynamic_cast( &**this ); + } + + Object* operator -> () { + return &**this; + } + + const Object* operator -> () const { + return &**this; + } + + bool operator== (const std::string& atype) const { + return type == atype; + } + + bool operator!= (const std::string& atype) const { + return type != atype; + } + + uint64_t GetID() const { + return id; + } + + private: + void LazyInit() const; + + private: + mutable uint64_t id; + const char* const type; + DB& db; + mutable const char* args; + mutable Object* obj; + }; + + template + inline + bool operator==( std::shared_ptr lo, T whatever ) { + return *lo == whatever; // XXX use std::forward if we have 0x + } + + template + inline + bool operator==( const std::pair >& lo, T whatever ) { + return *(lo.second) == whatever; // XXX use std::forward if we have 0x + } + + // ------------------------------------------------------------------------------ + /** Class template used to represent lazily evaluated object references in the converted schema */ + // ------------------------------------------------------------------------------ + template + struct Lazy { + typedef Lazy Out; + Lazy(const LazyObject* obj = nullptr) + : obj(obj) { + // empty + } + + operator const T*() const { + return obj->ToPtr(); + } + + operator const T&() const { + return obj->To(); + } + + const T& operator * () const { + return obj->To(); + } + + const T* operator -> () const { + return &obj->To(); + } + + const LazyObject* obj; + }; + + // ------------------------------------------------------------------------------ + /** Class template used to represent LIST and SET data members in the converted schema */ + // ------------------------------------------------------------------------------ + template + struct ListOf : public std::vector { + typedef typename T::Out OutScalar; + typedef ListOf Out; + + ListOf() { + static_assert(min_cnt <= max_cnt || !max_cnt, "min_cnt <= max_cnt || !max_cnt"); + } + }; + + // ------------------------------------------------------------------------------ + template + struct PickBaseType { + typedef EXPRESS::PrimitiveDataType Type; + }; + + template + struct PickBaseType< Lazy > { + typedef EXPRESS::ENTITY Type; + }; + + template<> + struct PickBaseType< std::shared_ptr< const EXPRESS::DataType > >; + + // ------------------------------------------------------------------------------ + template + struct InternGenericConvert { + void operator()(T& out, const std::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& /*db*/) { + try{ + out = dynamic_cast< const typename PickBaseType::Type& > ( *in ); + } catch(std::bad_cast&) { + throw TypeError("type error reading literal field"); + } + } + }; + + template <> + struct InternGenericConvert< std::shared_ptr< const EXPRESS::DataType > > { + void operator()(std::shared_ptr< const EXPRESS::DataType >& out, const std::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& /*db*/) { + out = in; + } + }; + + template + struct InternGenericConvert< Maybe > { + void operator()(Maybe& out, const std::shared_ptr< const EXPRESS::DataType >& in, const STEP::DB& db) { + GenericConvert((T&)out,in,db); + out.flag_valid(); + } + }; + + template + struct InternGenericConvertList { + void operator()(ListOf& out, const std::shared_ptr< const EXPRESS::DataType >& inp_base, const STEP::DB& db) { + + const EXPRESS::LIST* inp = dynamic_cast(inp_base.get()); + if (!inp) { + throw TypeError("type error reading aggregate"); + } + + // XXX is this really how the EXPRESS notation ([?:3],[1:3]) is intended? + if (max_cnt && inp->GetSize() > max_cnt) { + ASSIMP_LOG_WARN("too many aggregate elements"); + } + else if (inp->GetSize() < min_cnt) { + ASSIMP_LOG_WARN("too few aggregate elements"); + } + + out.reserve(inp->GetSize()); + for(size_t i = 0; i < inp->GetSize(); ++i) { + + out.push_back( typename ListOf::OutScalar() ); + try{ + GenericConvert(out.back(),(*inp)[i], db); + } + catch(const TypeError& t) { + throw TypeError(t.what() +std::string(" of aggregate")); + } + } + } + }; + + template + struct InternGenericConvert< Lazy > { + void operator()(Lazy& out, const std::shared_ptr< const EXPRESS::DataType >& in_base, const STEP::DB& db) { + const EXPRESS::ENTITY* in = dynamic_cast(in_base.get()); + if (!in) { + throw TypeError("type error reading entity"); + } + out = Couple(db).GetObject(*in); + } + }; + + template + inline void GenericConvert(T1& a, const std::shared_ptr< const EXPRESS::DataType >& b, const STEP::DB& db) { + return InternGenericConvert()(a,b,db); + } + + template + inline void GenericConvert(ListOf& a, const std::shared_ptr< const EXPRESS::DataType >& b, const STEP::DB& db) { + return InternGenericConvertList()(a,b,db); + } + + // ------------------------------------------------------------------------------ + /** Lightweight manager class that holds the map of all objects in a + * STEP file. DB's are exclusively maintained by the functions in + * STEPFileReader.h*/ + // ------------------------------------------------------------------------------- + class DB + { + friend DB* ReadFileHeader(std::shared_ptr stream); + friend void ReadFile(DB& db,const EXPRESS::ConversionSchema& scheme, + const char* const* types_to_track, size_t len, + const char* const* inverse_indices_to_track, size_t len2 + ); + + friend class LazyObject; + + public: + // objects indexed by ID - this can grow pretty large (i.e some hundred million + // entries), so use raw pointers to avoid *any* overhead. + typedef std::map ObjectMap; + + // objects indexed by their declarative type, but only for those that we truly want + typedef std::set< const LazyObject*> ObjectSet; + typedef std::map ObjectMapByType; + + // list of types for which to keep inverse indices for all references + // that the respective objects keep. + // the list keeps pointers to strings in static storage + typedef std::set InverseWhitelist; + + // references - for each object id the ids of all objects which reference it + // this is used to simulate STEP inverse indices for selected types. + typedef std::step_unordered_multimap RefMap; + typedef std::pair RefMapRange; + + private: + + DB(std::shared_ptr reader) + : reader(reader) + , splitter(*reader,true,true) + , evaluated_count() + , schema( nullptr ) + {} + + public: + ~DB() { + for(ObjectMap::value_type& o : objects) { + delete o.second; + } + } + + uint64_t GetObjectCount() const { + return objects.size(); + } + + uint64_t GetEvaluatedObjectCount() const { + return evaluated_count; + } + + const HeaderInfo& GetHeader() const { + return header; + } + + const EXPRESS::ConversionSchema& GetSchema() const { + return *schema; + } + + const ObjectMap& GetObjects() const { + return objects; + } + + const ObjectMapByType& GetObjectsByType() const { + return objects_bytype; + } + + const RefMap& GetRefs() const { + return refs; + } + + bool KeepInverseIndicesForType(const char* const type) const { + return inv_whitelist.find(type) != inv_whitelist.end(); + } + + + // get the yet unevaluated object record with a given id + const LazyObject* GetObject(uint64_t id) const { + const ObjectMap::const_iterator it = objects.find(id); + if (it != objects.end()) { + return (*it).second; + } + return nullptr; + } + + + // get an arbitrary object out of the soup with the only restriction being its type. + const LazyObject* GetObject(const std::string& type) const { + const ObjectMapByType::const_iterator it = objects_bytype.find(type); + if (it != objects_bytype.end() && (*it).second.size()) { + return *(*it).second.begin(); + } + return NULL; + } + + // same, but raise an exception if the object doesn't exist and return a reference + const LazyObject& MustGetObject(uint64_t id) const { + const LazyObject* o = GetObject(id); + if (!o) { + throw TypeError("requested entity is not present",id); + } + return *o; + } + + const LazyObject& MustGetObject(const std::string& type) const { + const LazyObject* o = GetObject(type); + if (!o) { + throw TypeError("requested entity of type "+type+"is not present"); + } + return *o; + } + + +#ifdef ASSIMP_IFC_TEST + + // evaluate *all* entities in the file. this is a power test for the loader + void EvaluateAll() { + for(ObjectMap::value_type& e :objects) { + **e.second; + } + ai_assert(evaluated_count == objects.size()); + } + +#endif + + private: + + // full access only offered to close friends - they should + // use the provided getters rather than messing around with + // the members directly. + LineSplitter& GetSplitter() { + return splitter; + } + + void InternInsert(const LazyObject* lz) { + objects[lz->GetID()] = lz; + + const ObjectMapByType::iterator it = objects_bytype.find( lz->type ); + if (it != objects_bytype.end()) { + (*it).second.insert(lz); + } + } + + void SetSchema(const EXPRESS::ConversionSchema& _schema) { + schema = &_schema; + } + + + void SetTypesToTrack(const char* const* types, size_t N) { + for(size_t i = 0; i < N;++i) { + objects_bytype[types[i]] = ObjectSet(); + } + } + + void SetInverseIndicesToTrack( const char* const* types, size_t N ) { + for(size_t i = 0; i < N;++i) { + const char* const sz = schema->GetStaticStringForToken(types[i]); + ai_assert(sz); + inv_whitelist.insert(sz); + } + } + + HeaderInfo& GetHeader() { + return header; + } + + void MarkRef(uint64_t who, uint64_t by_whom) { + refs.insert(std::make_pair(who,by_whom)); + } + + private: + HeaderInfo header; + ObjectMap objects; + ObjectMapByType objects_bytype; + RefMap refs; + InverseWhitelist inv_whitelist; + std::shared_ptr reader; + LineSplitter splitter; + uint64_t evaluated_count; + const EXPRESS::ConversionSchema* schema; + }; + +} + +} // end Assimp + +#endif // INCLUDED_AI_STEPFILE_H diff --git a/Engine/lib/assimp/code/Step/StepExporter.cpp b/Engine/lib/assimp/code/Step/StepExporter.cpp new file mode 100644 index 000000000..70035d9ea --- /dev/null +++ b/Engine/lib/assimp/code/Step/StepExporter.cpp @@ -0,0 +1,375 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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. + +@author: Richard Steffen, 2015 +---------------------------------------------------------------------- +*/ + + +#ifndef ASSIMP_BUILD_NO_EXPORT +#ifndef ASSIMP_BUILD_NO_STEP_EXPORTER + +#include "Step/StepExporter.h" +#include "PostProcessing/ConvertToLHProcess.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// +#if _MSC_VER > 1500 || (defined __GNUC___) +# define ASSIMP_STEP_USE_UNORDERED_MULTIMAP +# else +# define step_unordered_map map +# define step_unordered_multimap multimap +#endif + +#ifdef ASSIMP_STEP_USE_UNORDERED_MULTIMAP +# include +# if _MSC_VER > 1600 +# define step_unordered_map unordered_map +# define step_unordered_multimap unordered_multimap +# else +# define step_unordered_map tr1::unordered_map +# define step_unordered_multimap tr1::unordered_multimap +# endif +#endif + +typedef std::step_unordered_map VectorIndexUMap; + +/* Tested with Step viewer v4 from www.ida-step.net */ + +using namespace Assimp; + +namespace Assimp +{ + +// ------------------------------------------------------------------------------------------------ +// Worker function for exporting a scene to Collada. Prototyped and registered in Exporter.cpp +void ExportSceneStep(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)); + + // create/copy Properties + ExportProperties props(*pProperties); + + // invoke the exporter + StepExporter iDoTheExportThing( pScene, pIOSystem, path, file, &props); + + // 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 .stp 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 + + +namespace { + // Collect world transformations for each node + void CollectTrafos(const aiNode* node, std::map& trafos) { + const aiMatrix4x4& parent = node->mParent ? trafos[node->mParent] : aiMatrix4x4(); + trafos[node] = parent * node->mTransformation; + for (unsigned int i = 0; i < node->mNumChildren; ++i) { + CollectTrafos(node->mChildren[i], trafos); + } + } + + // Generate a flat list of the meshes (by index) assigned to each node + void CollectMeshes(const aiNode* node, std::multimap& meshes) { + for (unsigned int i = 0; i < node->mNumMeshes; ++i) { + meshes.insert(std::make_pair(node, node->mMeshes[i])); + } + for (unsigned int i = 0; i < node->mNumChildren; ++i) { + CollectMeshes(node->mChildren[i], meshes); + } + } +} + +// ------------------------------------------------------------------------------------------------ +// Constructor for a specific scene to export +StepExporter::StepExporter(const aiScene* pScene, IOSystem* pIOSystem, const std::string& path, + const std::string& file, const ExportProperties* pProperties) : + mProperties(pProperties), mIOSystem(pIOSystem), mFile(file), mPath(path), + mScene(pScene), endstr(";\n") { + CollectTrafos(pScene->mRootNode, trafos); + CollectMeshes(pScene->mRootNode, meshes); + + // 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); + + // start writing + WriteFile(); +} + +// ------------------------------------------------------------------------------------------------ +// Starts writing the contents +void StepExporter::WriteFile() +{ + // see http://shodhganga.inflibnet.ac.in:8080/jspui/bitstream/10603/14116/11/11_chapter%203.pdf + // note, that all realnumber values must be comma separated in x files + mOutput.setf(std::ios::fixed); + // precision for double + // see http://stackoverflow.com/questions/554063/how-do-i-print-a-double-value-with-full-precision-using-cout + mOutput.precision(ASSIMP_AI_REAL_TEXT_PRECISION); + + // standard color + aiColor4D fColor; + fColor.r = 0.8f; + fColor.g = 0.8f; + fColor.b = 0.8f; + + int ind = 100; // the start index to be used + int faceEntryLen = 30; // number of entries for a triangle/face + // prepare unique (count triangles and vertices) + + VectorIndexUMap uniqueVerts; // use a map to reduce find complexity to log(n) + VectorIndexUMap::iterator it; + int countFace = 0; + + for (unsigned int i=0; imNumMeshes; ++i) + { + aiMesh* mesh = mScene->mMeshes[i]; + for (unsigned int j=0; jmNumFaces; ++j) + { + aiFace* face = &(mesh->mFaces[j]); + + if (face->mNumIndices == 3) countFace++; + } + for (unsigned int j=0; jmNumVertices; ++j) + { + aiVector3D* v = &(mesh->mVertices[j]); + it =uniqueVerts.find(v); + if (it == uniqueVerts.end()) + { + uniqueVerts[v] = -1; // first mark the vector as not transformed + } + } + } + + 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)); + + // write the header + mOutput << "ISO-10303-21" << endstr; + mOutput << "HEADER" << endstr; + mOutput << "FILE_DESCRIPTION(('STEP AP214'),'1')" << endstr; + mOutput << "FILE_NAME('" << mFile << ".stp','" << date_str << "',(' '),(' '),'Spatial InterOp 3D',' ',' ')" << endstr; + mOutput << "FILE_SCHEMA(('automotive_design'))" << endstr; + mOutput << "ENDSEC" << endstr; + + // write the top of data + mOutput << "DATA" << endstr; + mOutput << "#1=MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION(' ',("; + for (int i=0; imMeshes[mesh_idx]; + aiMatrix4x4& trafo = trafos[&node]; + for (unsigned int i = 0; i < mesh->mNumVertices; ++i) + { + aiVector3D* v = &(mesh->mVertices[i]); + it = uniqueVerts.find(v); + if (it->second >=0 ) continue; + it->second = ind; // this one is new, so set the index (ind) + aiVector3D vt = trafo * (*v); // transform the coordinate + mOutput << "#" << it->second << "=CARTESIAN_POINT('',(" << vt.x << "," << vt.y << "," << vt.z << "))" << endstr; + mOutput << "#" << it->second+1 << "=VERTEX_POINT('',#" << it->second << ")" << endstr; + ind += 2; + } + } + + // write the triangles + for (unsigned int i=0; imNumMeshes; ++i) + { + aiMesh* mesh = mScene->mMeshes[i]; + for (unsigned int j=0; jmNumFaces; ++j) + { + aiFace* face = &(mesh->mFaces[j]); + + if (face->mNumIndices != 3) continue; + + aiVector3D* v1 = &(mesh->mVertices[face->mIndices[0]]); + aiVector3D* v2 = &(mesh->mVertices[face->mIndices[1]]); + aiVector3D* v3 = &(mesh->mVertices[face->mIndices[2]]); + aiVector3D dv12 = *v2 - *v1; + aiVector3D dv23 = *v3 - *v2; + aiVector3D dv31 = *v1 - *v3; + aiVector3D dv13 = *v3 - *v1; + dv12.Normalize(); + dv23.Normalize(); + dv31.Normalize(); + dv13.Normalize(); + + int pid1 = uniqueVerts.find(v1)->second; + int pid2 = uniqueVerts.find(v2)->second; + int pid3 = uniqueVerts.find(v3)->second; + + // mean vertex color for the face if available + if (mesh->HasVertexColors(0)) + { + fColor.r = 0.0; + fColor.g = 0.0; + fColor.b = 0.0; + fColor += mesh->mColors[0][face->mIndices[0]]; + fColor += mesh->mColors[0][face->mIndices[1]]; + fColor += mesh->mColors[0][face->mIndices[2]]; + fColor /= 3.0f; + } + + int sid = ind; // the sub index + mOutput << "#" << sid << "=STYLED_ITEM('',(#" << sid+1 << "),#" << sid+8 << ")" << endstr; /* the item that must be referenced in #1 */ + /* This is the color information of the Triangle */ + mOutput << "#" << sid+1 << "=PRESENTATION_STYLE_ASSIGNMENT((#" << sid+2 << "))" << endstr; + mOutput << "#" << sid+2 << "=SURFACE_STYLE_USAGE(.BOTH.,#" << sid+3 << ")" << endstr; + mOutput << "#" << sid+3 << "=SURFACE_SIDE_STYLE('',(#" << sid+4 << "))" << endstr; + mOutput << "#" << sid+4 << "=SURFACE_STYLE_FILL_AREA(#" << sid+5 << ")" << endstr; + mOutput << "#" << sid+5 << "=FILL_AREA_STYLE('',(#" << sid+6 << "))" << endstr; + mOutput << "#" << sid+6 << "=FILL_AREA_STYLE_COLOUR('',#" << sid+7 << ")" << endstr; + mOutput << "#" << sid+7 << "=COLOUR_RGB(''," << fColor.r << "," << fColor.g << "," << fColor.b << ")" << endstr; + + /* this is the geometry */ + mOutput << "#" << sid+8 << "=FACE_SURFACE('',(#" << sid+13 << "),#" << sid+9<< ",.T.)" << endstr; /* the face that must be referenced in 29 */ + + /* 2 directions of the plane */ + mOutput << "#" << sid+9 << "=PLANE('',#" << sid+10 << ")" << endstr; + mOutput << "#" << sid+10 << "=AXIS2_PLACEMENT_3D('',#" << pid1 << ", #" << sid+11 << ",#" << sid+12 << ")" << endstr; + + mOutput << "#" << sid+11 << "=DIRECTION('',(" << dv12.x << "," << dv12.y << "," << dv12.z << "))" << endstr; + mOutput << "#" << sid+12 << "=DIRECTION('',(" << dv13.x << "," << dv13.y << "," << dv13.z << "))" << endstr; + + mOutput << "#" << sid+13 << "=FACE_BOUND('',#" << sid+14 << ",.T.)" << endstr; + mOutput << "#" << sid+14 << "=EDGE_LOOP('',(#" << sid+15 << ",#" << sid+16 << ",#" << sid+17 << "))" << endstr; + + /* edge loop */ + mOutput << "#" << sid+15 << "=ORIENTED_EDGE('',*,*,#" << sid+18 << ",.T.)" << endstr; + mOutput << "#" << sid+16 << "=ORIENTED_EDGE('',*,*,#" << sid+19 << ",.T.)" << endstr; + mOutput << "#" << sid+17 << "=ORIENTED_EDGE('',*,*,#" << sid+20 << ",.T.)" << endstr; + + /* oriented edges */ + mOutput << "#" << sid+18 << "=EDGE_CURVE('',#" << pid1+1 << ",#" << pid2+1 << ",#" << sid+21 << ",.F.)" << endstr; + mOutput << "#" << sid+19 << "=EDGE_CURVE('',#" << pid2+1 << ",#" << pid3+1 << ",#" << sid+22 << ",.T.)" << endstr; + mOutput << "#" << sid+20 << "=EDGE_CURVE('',#" << pid3+1 << ",#" << pid1+1 << ",#" << sid+23 << ",.T.)" << endstr; + + /* 3 lines and 3 vectors for the lines for the 3 edge curves */ + mOutput << "#" << sid+21 << "=LINE('',#" << pid1 << ",#" << sid+24 << ")" << endstr; + mOutput << "#" << sid+22 << "=LINE('',#" << pid2 << ",#" << sid+25 << ")" << endstr; + mOutput << "#" << sid+23 << "=LINE('',#" << pid3 << ",#" << sid+26 << ")" << endstr; + mOutput << "#" << sid+24 << "=VECTOR('',#" << sid+27 << ",1.0)" << endstr; + mOutput << "#" << sid+25 << "=VECTOR('',#" << sid+28 << ",1.0)" << endstr; + mOutput << "#" << sid+26 << "=VECTOR('',#" << sid+29 << ",1.0)" << endstr; + mOutput << "#" << sid+27 << "=DIRECTION('',(" << dv12.x << "," << dv12.y << "," << dv12.z << "))" << endstr; + mOutput << "#" << sid+28 << "=DIRECTION('',(" << dv23.x << "," << dv23.y << "," << dv23.z << "))" << endstr; + mOutput << "#" << sid+29 << "=DIRECTION('',(" << dv31.x << "," << dv31.y << "," << dv31.z << "))" << endstr; + ind += faceEntryLen; // increase counter + } + } + + mOutput << "ENDSEC" << endstr; // end of data section + mOutput << "END-ISO-10303-21" << endstr; // end of file +} + +#endif +#endif diff --git a/Engine/lib/assimp/code/Step/StepExporter.h b/Engine/lib/assimp/code/Step/StepExporter.h new file mode 100644 index 000000000..f96a0d2b5 --- /dev/null +++ b/Engine/lib/assimp/code/Step/StepExporter.h @@ -0,0 +1,111 @@ +/* +Open Asset Import Library (assimp) +---------------------------------------------------------------------- + +Copyright (c) 2006-2019, 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. + +@author: Richard Steffen, 2014 + +---------------------------------------------------------------------- +*/ + +/** @file StepExporter.h + * Declares the exporter class to write a scene to a Collada file + */ +#ifndef AI_STEPEXPORTER_H_INC +#define AI_STEPEXPORTER_H_INC + +#include +#include +#include +#include + + +struct aiScene; +struct aiNode; + +namespace Assimp +{ + +/// Helper class to export a given scene to a StepFile. +/// Note: an StepFile uses a left hand system. Assimp used a right hand system (OpenGL), therefore we have to transform everything +class StepExporter +{ +public: + /// Constructor for a specific scene to export + StepExporter(const aiScene* pScene, IOSystem* pIOSystem, const std::string& path, const std::string& file, const ExportProperties* pProperties); + +protected: + /// Starts writing the contents + void WriteFile(); + +public: + + /// Stringstream to write all output into + std::stringstream mOutput; + +protected: + + /// hold the properties pointer + const ExportProperties* mProperties; + + /// The IOSystem for output + IOSystem* mIOSystem; + + /// Name of the file (without extension) where the scene will be exported + std::string mFile; + + /// Path of the directory where the scene will be exported + std::string mPath; + + /// The scene to be written + const aiScene* mScene; + + /// current line end string for simple stream insertion + std::string endstr; + + /// accumultated transformations for nodes + std::map trafos; + + /// map to all meshed of nodes + typedef std::multimap MeshesByNodeMap; + MeshesByNodeMap meshes; + +}; + +} + +#endif // !! AI_STEPEXPORTER_H_INC diff --git a/Engine/lib/assimp/code/StreamReader.h b/Engine/lib/assimp/code/StreamReader.h deleted file mode 100644 index 6220de9a8..000000000 --- a/Engine/lib/assimp/code/StreamReader.h +++ /dev/null @@ -1,347 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -/** @file Defines the StreamReader class which reads data from - * a binary stream with a well-defined endianness. - */ - -#ifndef AI_STREAMREADER_H_INCLUDED -#define AI_STREAMREADER_H_INCLUDED - -#include "ByteSwapper.h" -#include "Exceptional.h" -#include -#include -#include - -namespace Assimp { - -// -------------------------------------------------------------------------------------------- -/** Wrapper class around IOStream to allow for consistent reading of binary data in both - * little and big endian format. Don't attempt to instance the template directly. Use - * StreamReaderLE to read from a little-endian stream and StreamReaderBE to read from a - * BE stream. The class expects that the endianness of any input data is known at - * compile-time, which should usually be true (#BaseImporter::ConvertToUTF8 implements - * runtime endianness conversions for text files). - * - * XXX switch from unsigned int for size types to size_t? or ptrdiff_t?*/ -// -------------------------------------------------------------------------------------------- -template -class StreamReader -{ -public: - // FIXME: use these data types throughout the whole library, - // then change them to 64 bit values :-) - - typedef int diff; - typedef unsigned int pos; - -public: - // --------------------------------------------------------------------- - /** Construction from a given stream with a well-defined endianness. - * - * The StreamReader holds a permanent strong reference to the - * stream, which is released upon destruction. - * @param stream Input stream. The stream is not restarted if - * its file pointer is not at 0. Instead, the stream reader - * reads from the current position to the end of the stream. - * @param le If @c RuntimeSwitch is true: specifies whether the - * stream is in little endian byte order. Otherwise the - * endianness information is contained in the @c SwapEndianess - * template parameter and this parameter is meaningless. */ - StreamReader(std::shared_ptr stream, bool le = false) - : stream(stream) - , le(le) - { - ai_assert(stream); - InternBegin(); - } - - // --------------------------------------------------------------------- - StreamReader(IOStream* stream, bool le = false) - : stream(std::shared_ptr(stream)) - , le(le) - { - ai_assert(stream); - InternBegin(); - } - - // --------------------------------------------------------------------- - ~StreamReader() { - delete[] buffer; - } - -public: - - // deprecated, use overloaded operator>> instead - - // --------------------------------------------------------------------- - /** Read a float from the stream */ - float GetF4() - { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a double from the stream */ - double GetF8() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a signed 16 bit integer from the stream */ - int16_t GetI2() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a signed 8 bit integer from the stream */ - int8_t GetI1() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read an signed 32 bit integer from the stream */ - int32_t GetI4() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a signed 64 bit integer from the stream */ - int64_t GetI8() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a unsigned 16 bit integer from the stream */ - uint16_t GetU2() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a unsigned 8 bit integer from the stream */ - uint8_t GetU1() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read an unsigned 32 bit integer from the stream */ - uint32_t GetU4() { - return Get(); - } - - // --------------------------------------------------------------------- - /** Read a unsigned 64 bit integer from the stream */ - uint64_t GetU8() { - return Get(); - } - -public: - // --------------------------------------------------------------------- - /** Get the remaining stream size (to the end of the stream) */ - unsigned int GetRemainingSize() const { - return (unsigned int)(end - current); - } - - // --------------------------------------------------------------------- - /** Get the remaining stream size (to the current read limit). The - * return value is the remaining size of the stream if no custom - * read limit has been set. */ - unsigned int GetRemainingSizeToLimit() const { - return (unsigned int)(limit - current); - } - - // --------------------------------------------------------------------- - /** Increase the file pointer (relative seeking) */ - void IncPtr(size_t plus) { - current += plus; - if (current > limit) { - throw DeadlyImportError("End of file or read limit was reached"); - } - } - - // --------------------------------------------------------------------- - /** Get the current file pointer */ - int8_t* GetPtr() const { - return current; - } - - // --------------------------------------------------------------------- - /** Set current file pointer (Get it from #GetPtr). This is if you - * prefer to do pointer arithmetics on your own or want to copy - * large chunks of data at once. - * @param p The new pointer, which is validated against the size - * limit and buffer boundaries. */ - void SetPtr(int8_t* p) { - current = p; - if (current > limit || current < buffer) { - throw DeadlyImportError("End of file or read limit was reached"); - } - } - - // --------------------------------------------------------------------- - /** Copy n bytes to an external buffer - * @param out Destination for copying - * @param bytes Number of bytes to copy */ - void CopyAndAdvance(void* out, size_t bytes) { - int8_t* ur = GetPtr(); - SetPtr(ur+bytes); // fire exception if eof - - ::memcpy(out,ur,bytes); - } - - // --------------------------------------------------------------------- - /** Get the current offset from the beginning of the file */ - int GetCurrentPos() const { - return (unsigned int)(current - buffer); - } - - void SetCurrentPos(size_t pos) { - SetPtr(buffer + pos); - } - - // --------------------------------------------------------------------- - /** Setup a temporary read limit - * - * @param limit Maximum number of bytes to be read from - * the beginning of the file. Specifying UINT_MAX - * resets the limit to the original end of the stream. - * Returns the previously set limit. */ - unsigned int SetReadLimit(unsigned int _limit) { - unsigned int prev = GetReadLimit(); - if (UINT_MAX == _limit) { - limit = end; - return prev; - } - - limit = buffer + _limit; - if (limit > end) { - throw DeadlyImportError("StreamReader: Invalid read limit"); - } - return prev; - } - - // --------------------------------------------------------------------- - /** Get the current read limit in bytes. Reading over this limit - * accidentally raises an exception. */ - unsigned int GetReadLimit() const { - return (unsigned int)(limit - buffer); - } - - // --------------------------------------------------------------------- - /** Skip to the read limit in bytes. Reading over this limit - * accidentally raises an exception. */ - void SkipToReadLimit() { - current = limit; - } - - // --------------------------------------------------------------------- - /** overload operator>> and allow chaining of >> ops. */ - template - StreamReader& operator >> (T& f) { - f = Get(); - return *this; - } - -private: - // --------------------------------------------------------------------- - /** Generic read method. ByteSwap::Swap(T*) *must* be defined */ - template - T Get() { - if ( current + sizeof(T) > limit) { - throw DeadlyImportError("End of file or stream limit was reached"); - } - - T f; - ::memcpy (&f, current, sizeof(T)); - Intern::Getter() (&f,le); - current += sizeof(T); - - return f; - } - - // --------------------------------------------------------------------- - void InternBegin() { - if (!stream) { - // in case someone wonders: StreamReader is frequently invoked with - // no prior validation whether the input stream is valid. Since - // no one bothers changing the error message, this message here - // is passed down to the caller and 'unable to open file' - // simply describes best what happened. - throw DeadlyImportError("StreamReader: Unable to open file"); - } - - const size_t s = stream->FileSize() - stream->Tell(); - if (!s) { - throw DeadlyImportError("StreamReader: File is empty or EOF is already reached"); - } - - current = buffer = new int8_t[s]; - const size_t read = stream->Read(current,1,s); - // (read < s) can only happen if the stream was opened in text mode, in which case FileSize() is not reliable - ai_assert(read <= s); - end = limit = &buffer[read]; - } - -private: - std::shared_ptr stream; - int8_t *buffer, *current, *end, *limit; - bool le; -}; - -// -------------------------------------------------------------------------------------------- -// `static` StreamReaders. Their byte order is fixed and they might be a little bit faster. -#ifdef AI_BUILD_BIG_ENDIAN - typedef StreamReader StreamReaderLE; - typedef StreamReader StreamReaderBE; -#else - typedef StreamReader StreamReaderBE; - typedef StreamReader StreamReaderLE; -#endif - -// `dynamic` StreamReader. The byte order of the input data is specified in the -// c'tor. This involves runtime branching and might be a little bit slower. -typedef StreamReader StreamReaderAny; - -} // end namespace Assimp - -#endif // !! AI_STREAMREADER_H_INCLUDED diff --git a/Engine/lib/assimp/code/StreamWriter.h b/Engine/lib/assimp/code/StreamWriter.h deleted file mode 100644 index 26873fb5b..000000000 --- a/Engine/lib/assimp/code/StreamWriter.h +++ /dev/null @@ -1,240 +0,0 @@ -/* ---------------------------------------------------------------------------- -Open Asset Import Library (assimp) ---------------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the following -conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------------- -*/ - -/** @file Defines the StreamWriter class which writes data to - * a binary stream with a well-defined endianness. */ - -#ifndef AI_STREAMWRITER_H_INCLUDED -#define AI_STREAMWRITER_H_INCLUDED - -#include "ByteSwapper.h" -#include - -#include -#include - -namespace Assimp { - -// -------------------------------------------------------------------------------------------- -/** Wrapper class around IOStream to allow for consistent writing of binary data in both - * little and big endian format. Don't attempt to instance the template directly. Use - * StreamWriterLE to read from a little-endian stream and StreamWriterBE to read from a - * BE stream. Alternatively, there is StreamWriterAny if the endianness of the output - * stream is to be determined at runtime. - */ -// -------------------------------------------------------------------------------------------- -template -class StreamWriter -{ - enum { - INITIAL_CAPACITY = 1024 - }; - -public: - - // --------------------------------------------------------------------- - /** Construction from a given stream with a well-defined endianness. - * - * The StreamReader holds a permanent strong reference to the - * stream, which is released upon destruction. - * @param stream Input stream. The stream is not re-seeked and writing - continues at the current position of the stream cursor. - * @param le If @c RuntimeSwitch is true: specifies whether the - * stream is in little endian byte order. Otherwise the - * endianness information is defined by the @c SwapEndianess - * template parameter and this parameter is meaningless. */ - StreamWriter(std::shared_ptr stream, bool le = false) - : stream(stream) - , le(le) - , cursor() - { - ai_assert(stream); - buffer.reserve(INITIAL_CAPACITY); - } - - // --------------------------------------------------------------------- - StreamWriter(IOStream* stream, bool le = false) - : stream(std::shared_ptr(stream)) - , le(le) - , cursor() - { - ai_assert(stream); - buffer.reserve(INITIAL_CAPACITY); - } - - // --------------------------------------------------------------------- - ~StreamWriter() { - stream->Write(&buffer[0], 1, buffer.size()); - stream->Flush(); - } - -public: - - // --------------------------------------------------------------------- - /** Write a float to the stream */ - void PutF4(float f) - { - Put(f); - } - - // --------------------------------------------------------------------- - /** Write a double to the stream */ - void PutF8(double d) { - Put(d); - } - - // --------------------------------------------------------------------- - /** Write a signed 16 bit integer to the stream */ - void PutI2(int16_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write a signed 8 bit integer to the stream */ - void PutI1(int8_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write an signed 32 bit integer to the stream */ - void PutI4(int32_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write a signed 64 bit integer to the stream */ - void PutI8(int64_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write a unsigned 16 bit integer to the stream */ - void PutU2(uint16_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write a unsigned 8 bit integer to the stream */ - void PutU1(uint8_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write an unsigned 32 bit integer to the stream */ - void PutU4(uint32_t n) { - Put(n); - } - - // --------------------------------------------------------------------- - /** Write a unsigned 64 bit integer to the stream */ - void PutU8(uint64_t n) { - Put(n); - } - -public: - - // --------------------------------------------------------------------- - /** overload operator<< and allow chaining of MM ops. */ - template - StreamWriter& operator << (T f) { - Put(f); - return *this; - } - - // --------------------------------------------------------------------- - std::size_t GetCurrentPos() const { - return cursor; - } - - // --------------------------------------------------------------------- - void SetCurrentPos(std::size_t new_cursor) { - cursor = new_cursor; - } - -private: - - // --------------------------------------------------------------------- - /** Generic write method. ByteSwap::Swap(T*) *must* be defined */ - template - void Put(T f) { - Intern :: Getter() (&f, le); - - if (cursor + sizeof(T) >= buffer.size()) { - buffer.resize(cursor + sizeof(T)); - } - - void* dest = &buffer[cursor]; - - // reinterpret_cast + assignment breaks strict aliasing rules - // and generally causes trouble on platforms such as ARM that - // do not silently ignore alignment faults. - ::memcpy(dest, &f, sizeof(T)); - cursor += sizeof(T); - } - -private: - - std::shared_ptr stream; - bool le; - - std::vector buffer; - std::size_t cursor; -}; - - -// -------------------------------------------------------------------------------------------- -// `static` StreamWriter. Their byte order is fixed and they might be a little bit faster. -#ifdef AI_BUILD_BIG_ENDIAN - typedef StreamWriter StreamWriterLE; - typedef StreamWriter StreamWriterBE; -#else - typedef StreamWriter StreamWriterBE; - typedef StreamWriter StreamWriterLE; -#endif - -// `dynamic` StreamWriter. The byte order of the input data is specified in the -// c'tor. This involves runtime branching and might be a little bit slower. -typedef StreamWriter StreamWriterAny; - -} // end namespace Assimp - -#endif // !! AI_STREAMWriter_H_INCLUDED diff --git a/Engine/lib/assimp/code/StringComparison.h b/Engine/lib/assimp/code/StringComparison.h deleted file mode 100644 index ed5f4bd6a..000000000 --- a/Engine/lib/assimp/code/StringComparison.h +++ /dev/null @@ -1,225 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Definition of platform independent string workers: - - ASSIMP_itoa10 - ASSIMP_stricmp - ASSIMP_strincmp - - These functions are not consistently available on all platforms, - or the provided implementations behave too differently. -*/ -#ifndef INCLUDED_AI_STRING_WORKERS_H -#define INCLUDED_AI_STRING_WORKERS_H - -#include -#include "StringComparison.h" - -#include -#include -#include - -namespace Assimp { - -// ------------------------------------------------------------------------------- -/** @brief itoa with a fixed base 10 - * 'itoa' is not consistently available on all platforms so it is quite useful - * to have a small replacement function here. No need to use a full sprintf() - * if we just want to print a number ... - * @param out Output buffer - * @param max Maximum number of characters to be written, including '\0'. - * This parameter may not be 0. - * @param number Number to be written - * @return Length of the output string, excluding the '\0' - */ -inline unsigned int ASSIMP_itoa10( char* out, unsigned int max, int32_t number) -{ - ai_assert(NULL != out); - - // write the unary minus to indicate we have a negative number - unsigned int written = 1u; - if (number < 0 && written < max) { - *out++ = '-'; - ++written; - number = -number; - } - - // We begin with the largest number that is not zero. - int32_t cur = 1000000000; // 2147483648 - bool mustPrint = false; - while (written < max) { - - const unsigned int digit = number / cur; - if (mustPrint || digit > 0 || 1 == cur) { - // print all future zeroes from now - mustPrint = true; - - *out++ = '0'+static_cast(digit); - - ++written; - number -= digit*cur; - if (1 == cur) { - break; - } - } - cur /= 10; - } - - // append a terminal zero - *out++ = '\0'; - return written-1; -} - -// ------------------------------------------------------------------------------- -/** @brief itoa with a fixed base 10 (Secure template overload) - * The compiler should choose this function if he or she is able to determine the - * size of the array automatically. - */ -template -inline unsigned int ASSIMP_itoa10( char(& out)[length], int32_t number) -{ - return ASSIMP_itoa10(out,length,number); -} - -// ------------------------------------------------------------------------------- -/** @brief Helper function to do platform independent string comparison. - * - * This is required since stricmp() is not consistently available on - * all platforms. Some platforms use the '_' prefix, others don't even - * have such a function. - * - * @param s1 First input string - * @param s2 Second input string - * @return 0 if the given strings are identical - */ -inline int ASSIMP_stricmp(const char *s1, const char *s2) -{ - ai_assert(NULL != s1 && NULL != s2); - -#if (defined _MSC_VER) - - return ::_stricmp(s1,s2); -#elif defined( __GNUC__ ) - - return ::strcasecmp(s1,s2); -#else - - char c1, c2; - do { - c1 = tolower(*s1++); - c2 = tolower(*s2++); - } - while ( c1 && (c1 == c2) ); - return c1 - c2; -#endif -} - -// ------------------------------------------------------------------------------- -/** @brief Case independent comparison of two std::strings - * - * @param a First string - * @param b Second string - * @return 0 if a == b - */ -inline int ASSIMP_stricmp(const std::string& a, const std::string& b) -{ - int i = (int)b.length()-(int)a.length(); - return (i ? i : ASSIMP_stricmp(a.c_str(),b.c_str())); -} - -// ------------------------------------------------------------------------------- -/** @brief Helper function to do platform independent string comparison. - * - * This is required since strincmp() is not consistently available on - * all platforms. Some platforms use the '_' prefix, others don't even - * have such a function. - * - * @param s1 First input string - * @param s2 Second input string - * @param n Macimum number of characters to compare - * @return 0 if the given strings are identical - */ -inline int ASSIMP_strincmp(const char *s1, const char *s2, unsigned int n) -{ - ai_assert(NULL != s1 && NULL != s2); - if (!n)return 0; - -#if (defined _MSC_VER) - - return ::_strnicmp(s1,s2,n); - -#elif defined( __GNUC__ ) - - return ::strncasecmp(s1,s2, n); - -#else - char c1, c2; - unsigned int p = 0; - do - { - if (p++ >= n)return 0; - c1 = tolower(*s1++); - c2 = tolower(*s2++); - } - while ( c1 && (c1 == c2) ); - - return c1 - c2; -#endif -} - - -// ------------------------------------------------------------------------------- -/** @brief Evaluates an integer power - * - * todo: move somewhere where it fits better in than here - */ -inline unsigned int integer_pow (unsigned int base, unsigned int power) -{ - unsigned int res = 1; - for (unsigned int i = 0; i < power;++i) - res *= base; - - return res; -} -} // end of namespace - -#endif // ! AI_STRINGCOMPARISON_H_INC diff --git a/Engine/lib/assimp/code/StringUtils.h b/Engine/lib/assimp/code/StringUtils.h deleted file mode 100644 index 64f66e6b9..000000000 --- a/Engine/lib/assimp/code/StringUtils.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above -copyright notice, this list of conditions and the -following disclaimer. - -* Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other -materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its -contributors may be used to endorse or promote products -derived from this software without specific prior -written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -#ifndef INCLUDED_AI_STRINGUTILS_H -#define INCLUDED_AI_STRINGUTILS_H - -#include -#include -#include - -/// @fn ai_snprintf -/// @brief The portable version of the function snprintf ( C99 standard ), which works on visual studio compilers 2013 and earlier. -/// @param outBuf The buffer to write in -/// @param size The buffer size -/// @param format The format string -/// @param ap The additional arguments. -/// @return The number of written characters if the buffer size was big enough. If an encoding error occurs, a negative number is returned. -#if defined(_MSC_VER) && _MSC_VER < 1900 - - inline int c99_ai_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) { - int count(-1); - if (0 != size) { - count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); - } - if (count == -1) { - count = _vscprintf(format, ap); - } - - return count; - } - - inline int ai_snprintf(char *outBuf, size_t size, const char *format, ...) { - int count; - va_list ap; - - va_start(ap, format); - count = c99_ai_vsnprintf(outBuf, size, format, ap); - va_end(ap); - - return count; - } - -#else -# define ai_snprintf snprintf -#endif - -template -inline -std::string to_string( T value ) { - std::ostringstream os; - os << value; - return os.str(); -} - -inline -float ai_strtof( const char *begin, const char *end ) { - if ( nullptr == begin ) { - return 0.0f; - } - float val( 0.0f ); - if ( nullptr == end ) { - val = static_cast< float >( ::atof( begin ) ); - } else { - std::string::size_type len( end - begin ); - std::string token( begin, len ); - val = static_cast< float >( ::atof( token.c_str() ) ); - } - - return val; -} - -#endif // INCLUDED_AI_STRINGUTILS_H - diff --git a/Engine/lib/assimp/code/Subdivision.h b/Engine/lib/assimp/code/Subdivision.h deleted file mode 100644 index d06bc09d6..000000000 --- a/Engine/lib/assimp/code/Subdivision.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file Defines a helper class to evaluate subdivision surfaces.*/ -#pragma once -#ifndef AI_SUBDISIVION_H_INC -#define AI_SUBDISIVION_H_INC - -#include -#include - -struct aiMesh; - -namespace Assimp { - -// ------------------------------------------------------------------------------ -/** Helper class to evaluate subdivision surfaces. Different algorithms - * are provided for choice. */ -// ------------------------------------------------------------------------------ -class ASSIMP_API Subdivider { -public: - - /** Enumerates all supported subvidision algorithms */ - enum Algorithm { - CATMULL_CLARKE = 0x1 - }; - - virtual ~Subdivider(); - - // --------------------------------------------------------------- - /** Create a subdivider of a specific type - * - * @param algo Algorithm to be used for subdivision - * @return Subdivider instance. */ - static Subdivider* Create (Algorithm algo); - - // --------------------------------------------------------------- - /** Subdivide a mesh using the selected algorithm - * - * @param mesh First mesh to be subdivided. Must be in verbose - * format. - * @param out Receives the output mesh, allocated by me. - * @param num Number of subdivisions to perform. - * @param discard_input If true is passed, the input mesh is - * deleted after the subdivision is complete. This can - * improve performance because it allows the optimization - * to reuse the existing mesh for intermediate results. - * @pre out!=mesh*/ - virtual void Subdivide ( aiMesh* mesh, - aiMesh*& out, unsigned int num, - bool discard_input = false) = 0; - - // --------------------------------------------------------------- - /** Subdivide multiple meshes using the selected algorithm. This - * avoids erroneous smoothing on objects consisting of multiple - * per-material meshes. Usually, most 3d modellers smooth on a - * per-object base, regardless the materials assigned to the - * meshes. - * - * @param smesh Array of meshes to be subdivided. Must be in - * verbose format. - * @param nmesh Number of meshes in smesh. - * @param out Receives the output meshes. The array must be - * sufficiently large (at least @c nmesh elements) and may not - * overlap the input array. Output meshes map one-to-one to - * their corresponding input meshes. The meshes are allocated - * by the function. - * @param discard_input If true is passed, input meshes are - * deleted after the subdivision is complete. This can - * improve performance because it allows the optimization - * of reusing existing meshes for intermediate results. - * @param num Number of subdivisions to perform. - * @pre nmesh != 0, smesh and out may not overlap*/ - virtual void Subdivide ( - aiMesh** smesh, - size_t nmesh, - aiMesh** out, - unsigned int num, - bool discard_input = false) = 0; - -}; - -inline -Subdivider::~Subdivider() { - // empty -} - -} // end namespace Assimp - - -#endif // !! AI_SUBDISIVION_H_INC - diff --git a/Engine/lib/assimp/code/TerragenLoader.cpp b/Engine/lib/assimp/code/Terragen/TerragenLoader.cpp similarity index 100% rename from Engine/lib/assimp/code/TerragenLoader.cpp rename to Engine/lib/assimp/code/Terragen/TerragenLoader.cpp diff --git a/Engine/lib/assimp/code/TerragenLoader.h b/Engine/lib/assimp/code/Terragen/TerragenLoader.h similarity index 100% rename from Engine/lib/assimp/code/TerragenLoader.h rename to Engine/lib/assimp/code/Terragen/TerragenLoader.h diff --git a/Engine/lib/assimp/code/TinyFormatter.h b/Engine/lib/assimp/code/TinyFormatter.h deleted file mode 100644 index 1612282fb..000000000 --- a/Engine/lib/assimp/code/TinyFormatter.h +++ /dev/null @@ -1,165 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ - -/** @file TinyFormatter.h - * @brief Utility to format log messages more easily. Introduced - * to get rid of the boost::format dependency. Much slinker, - * basically just extends stringstream. - */ -#ifndef INCLUDED_TINY_FORMATTER_H -#define INCLUDED_TINY_FORMATTER_H - -#include - -namespace Assimp { -namespace Formatter { - -// ------------------------------------------------------------------------------------------------ -/** stringstream utility. Usage: - * @code - * void writelog(const std::string&s); - * void writelog(const std::wstring&s); - * ... - * writelog(format()<< "hi! this is a number: " << 4); - * writelog(wformat()<< L"hi! this is a number: " << 4); - * - * @endcode */ -template < typename T, - typename CharTraits = std::char_traits, - typename Allocator = std::allocator -> -class basic_formatter -{ - -public: - - typedef class std::basic_string< - T,CharTraits,Allocator - > string; - - typedef class std::basic_ostringstream< - T,CharTraits,Allocator - > stringstream; - -public: - - basic_formatter() {} - - /* Allow basic_formatter's to be used almost interchangeably - * with std::(w)string or const (w)char* arguments because the - * conversion c'tor is called implicitly. */ - template - basic_formatter(const TT& sin) { - underlying << sin; - } - - - // The problem described here: - // https://sourceforge.net/tracker/?func=detail&atid=1067632&aid=3358562&group_id=226462 - // can also cause trouble here. Apparently, older gcc versions sometimes copy temporaries - // being bound to const ref& function parameters. Copying streams is not permitted, though. - // This workaround avoids this by manually specifying a copy ctor. -#if !defined(__GNUC__) || !defined(__APPLE__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) - explicit basic_formatter(const basic_formatter& other) { - underlying << (string)other; - } -#endif - - -public: - - operator string () const { - return underlying.str(); - } - - - /* note - this is declared const because binding temporaries does only - * work for const references, so many function prototypes will - * include const basic_formatter& s but might still want to - * modify the formatted string without the need for a full copy.*/ - template - const basic_formatter& operator << (const TToken& s) const { - underlying << s; - return *this; - } - - template - basic_formatter& operator << (const TToken& s) { - underlying << s; - return *this; - } - - - // comma operator overloaded as well, choose your preferred way. - template - const basic_formatter& operator, (const TToken& s) const { - underlying << s; - return *this; - } - - template - basic_formatter& operator, (const TToken& s) { - underlying << s; - return *this; - } - - // Fix for MSVC8 - // See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824 - template - basic_formatter& operator, (TToken& s) { - underlying << s; - return *this; - } - - -private: - mutable stringstream underlying; -}; - - -typedef basic_formatter< char > format; -typedef basic_formatter< wchar_t > wformat; - -} // ! namespace Formatter - -} // ! namespace Assimp - -#endif diff --git a/Engine/lib/assimp/code/UnrealLoader.cpp b/Engine/lib/assimp/code/Unreal/UnrealLoader.cpp similarity index 99% rename from Engine/lib/assimp/code/UnrealLoader.cpp rename to Engine/lib/assimp/code/Unreal/UnrealLoader.cpp index 778aef59d..0bd4650d0 100644 --- a/Engine/lib/assimp/code/UnrealLoader.cpp +++ b/Engine/lib/assimp/code/Unreal/UnrealLoader.cpp @@ -52,12 +52,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef ASSIMP_BUILD_NO_3D_IMPORTER -#include "UnrealLoader.h" +#include "Unreal/UnrealLoader.h" +#include "PostProcessing/ConvertToLHProcess.h" + #include #include #include -#include "ConvertToLHProcess.h" - #include #include #include diff --git a/Engine/lib/assimp/code/UnrealLoader.h b/Engine/lib/assimp/code/Unreal/UnrealLoader.h similarity index 98% rename from Engine/lib/assimp/code/UnrealLoader.h rename to Engine/lib/assimp/code/Unreal/UnrealLoader.h index f846eb43a..678aaa76b 100644 --- a/Engine/lib/assimp/code/UnrealLoader.h +++ b/Engine/lib/assimp/code/Unreal/UnrealLoader.h @@ -127,7 +127,8 @@ inline void CompressVertex(const aiVector3D& v, uint32_t& out) n.X = (int32_t)v.x; n.Y = (int32_t)v.y; n.Z = (int32_t)v.z; - out = t; + ::memcpy( &out, &t, sizeof(int32_t)); + //out = t; } // UNREAL vertex decompression diff --git a/Engine/lib/assimp/code/Vertex.h b/Engine/lib/assimp/code/Vertex.h deleted file mode 100644 index 1f1685ae9..000000000 --- a/Engine/lib/assimp/code/Vertex.h +++ /dev/null @@ -1,323 +0,0 @@ -/* -Open Asset Import Library (assimp) ----------------------------------------------------------------------- - -Copyright (c) 2006-2017, assimp team - -All rights reserved. - -Redistribution and use of this software in source and binary forms, -with or without modification, are permitted provided that the -following conditions are met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the assimp team, nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission of the assimp team. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ----------------------------------------------------------------------- -*/ -/** @file Defines a helper class to represent an interleaved vertex - along with arithmetic operations to support vertex operations - such as subdivision, smoothing etc. - - While the code is kept as general as possible, arithmetic operations - that are not currently well-defined (and would cause compile errors - due to missing operators in the math library), are commented. - */ -#ifndef AI_VERTEX_H_INC -#define AI_VERTEX_H_INC - -#include -#include -#include -#include - -namespace Assimp { - - /////////////////////////////////////////////////////////////////////////// - // std::plus-family operates on operands with identical types - we need to - // support all the (vectype op float) combinations in vector maths. - // Providing T(float) would open the way to endless implicit conversions. - /////////////////////////////////////////////////////////////////////////// - namespace Intern { - template struct plus { - TRES operator() (const T0& t0, const T1& t1) const { - return t0+t1; - } - }; - template struct minus { - TRES operator() (const T0& t0, const T1& t1) const { - return t0-t1; - } - }; - template struct multiplies { - TRES operator() (const T0& t0, const T1& t1) const { - return t0*t1; - } - }; - template struct divides { - TRES operator() (const T0& t0, const T1& t1) const { - return t0/t1; - } - }; - } - -// ------------------------------------------------------------------------------------------------ -/** Intermediate description a vertex with all possible components. Defines a full set of - * operators, so you may use such a 'Vertex' in basic arithmetics. All operators are applied - * to *all* vertex components equally. This is useful for stuff like interpolation - * or subdivision, but won't work if special handling is required for some vertex components. */ -// ------------------------------------------------------------------------------------------------ -class Vertex -{ - friend Vertex operator + (const Vertex&,const Vertex&); - friend Vertex operator - (const Vertex&,const Vertex&); - -// friend Vertex operator + (const Vertex&,ai_real); -// friend Vertex operator - (const Vertex&,ai_real); - friend Vertex operator * (const Vertex&,ai_real); - friend Vertex operator / (const Vertex&,ai_real); - -// friend Vertex operator + (ai_real, const Vertex&); -// friend Vertex operator - (ai_real, const Vertex&); - friend Vertex operator * (ai_real, const Vertex&); -// friend Vertex operator / (ai_real, const Vertex&); - -public: - - Vertex() {} - - // ---------------------------------------------------------------------------- - /** Extract a particular vertex from a mesh and interleave all components */ - explicit Vertex(const aiMesh* msh, unsigned int idx) { - ai_assert(idx < msh->mNumVertices); - position = msh->mVertices[idx]; - - if (msh->HasNormals()) { - normal = msh->mNormals[idx]; - } - - if (msh->HasTangentsAndBitangents()) { - tangent = msh->mTangents[idx]; - bitangent = msh->mBitangents[idx]; - } - - for (unsigned int i = 0; msh->HasTextureCoords(i); ++i) { - texcoords[i] = msh->mTextureCoords[i][idx]; - } - - for (unsigned int i = 0; msh->HasVertexColors(i); ++i) { - colors[i] = msh->mColors[i][idx]; - } - } - -public: - - Vertex& operator += (const Vertex& v) { - *this = *this+v; - return *this; - } - - Vertex& operator -= (const Vertex& v) { - *this = *this-v; - return *this; - } - - -/* - Vertex& operator += (ai_real v) { - *this = *this+v; - return *this; - } - - Vertex& operator -= (ai_real v) { - *this = *this-v; - return *this; - } -*/ - Vertex& operator *= (ai_real v) { - *this = *this*v; - return *this; - } - - Vertex& operator /= (ai_real v) { - *this = *this/v; - return *this; - } - -public: - - // ---------------------------------------------------------------------------- - /** Convert back to non-interleaved storage */ - void SortBack(aiMesh* out, unsigned int idx) const { - - ai_assert(idxmNumVertices); - out->mVertices[idx] = position; - - if (out->HasNormals()) { - out->mNormals[idx] = normal; - } - - if (out->HasTangentsAndBitangents()) { - out->mTangents[idx] = tangent; - out->mBitangents[idx] = bitangent; - } - - for(unsigned int i = 0; out->HasTextureCoords(i); ++i) { - out->mTextureCoords[i][idx] = texcoords[i]; - } - - for(unsigned int i = 0; out->HasVertexColors(i); ++i) { - out->mColors[i][idx] = colors[i]; - } - } - -private: - - // ---------------------------------------------------------------------------- - /** Construct from two operands and a binary operation to combine them */ - template