diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d86eb9d --- /dev/null +++ b/.gitignore @@ -0,0 +1,190 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates +.DS_Store + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.mdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# If using the old MSBuild-Integrated Package Restore, uncomment this: +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +*.msi + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Rhino +*.rui_bak diff --git a/DLL Projects/GeometryGymIFC.sln b/DLL Projects/GeometryGymIFC.sln new file mode 100644 index 0000000..61b8b4e --- /dev/null +++ b/DLL Projects/GeometryGymIFC.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeometryGymIFC", "GeometryGymIFC\GeometryGymIFC.csproj", "{6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeometryGymIFCRhinoCommonx64", "GeometryGymIFCRhinoCommonx64\GeometryGymIFCRhinoCommonx64.csproj", "{0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|x64.ActiveCfg = Debug|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|x86.ActiveCfg = Debug|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|Any CPU.Build.0 = Release|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|x64.ActiveCfg = Release|Any CPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|x86.ActiveCfg = Release|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|x64.ActiveCfg = Debug|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|x86.ActiveCfg = Debug|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|Any CPU.Build.0 = Release|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|x64.ActiveCfg = Release|Any CPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/DLL Projects/GeometryGymIFC/GeometryGymIFC.csproj b/DLL Projects/GeometryGymIFC/GeometryGymIFC.csproj new file mode 100644 index 0000000..f23f9c6 --- /dev/null +++ b/DLL Projects/GeometryGymIFC/GeometryGymIFC.csproj @@ -0,0 +1,168 @@ + + + + + Debug + AnyCPU + {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C} + Library + Properties + GGYM.IFC + GeometryGymIFC + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE;IFCMODEL IFCPARSE IFCEXPORTONLY GGDLL RHCOMM NOLISTS NOTREEVIEW NOFORMS + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + + + + + + + + + + + + + + + + IFC\BaseClassIFC.cs + + + IFC\DatabaseIFC.cs + + + IFC\Enumerations.cs + + + IFC\IFC A.cs + + + IFC\IFC B.cs + + + IFC\IFC C.cs + + + IFC\IFC D.cs + + + IFC\IFC E.cs + + + IFC\IFC F.cs + + + IFC\IFC G.cs + + + IFC\IFC H.cs + + + IFC\IFC I.cs + + + IFC\IFC J.cs + + + IFC\IFC L.cs + + + IFC\IFC M.cs + + + IFC\IFC N.cs + + + IFC\IFC O.cs + + + IFC\IFC P.cs + + + IFC\IFC Q.cs + + + IFC\IFC R.cs + + + IFC\IFC S.cs + + + IFC\IFC T.cs + + + IFC\IFC U.cs + + + IFC\IFC V.cs + + + IFC\IFC W.cs + + + IFC\IFC Z.cs + + + IFC\ParserIFC.cs + + + STEP\BaseClassSTEP.cs + + + STEP\ParserSTEP.cs + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs b/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3a2cbfd --- /dev/null +++ b/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs @@ -0,0 +1,54 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GeometryGymIFC")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Geometry Gym Pty Ltd")] +[assembly: AssemblyProduct("GeometryGymIFC")] +[assembly: AssemblyCopyright("Copyright © Geometry Gym Pty Ltd 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c26aa7cc-baf1-4551-b91b-76e56ca15567")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.1.0")] +[assembly: AssemblyFileVersion("0.0.1.0")] diff --git a/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj b/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj new file mode 100644 index 0000000..61e4a11 --- /dev/null +++ b/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj @@ -0,0 +1,206 @@ + + + + + Debug + AnyCPU + {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1} + Library + Properties + GGYM.IFC + GeometryGymIFCRhinoCommonx64 + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\x64\ + TRACE + prompt + 4 + + + + ..\packages\Rhino3dmIO.dll-AnyCPU-Windows.5.1.30000.25\lib\net40\Rhino3dmIO.dll + True + + + + + + + + + + + + + + + IFC\Core\BaseClassIFC.cs + + + IFC\Core\DatabaseIFC.cs + + + IFC\Core\Enumerations.cs + + + IFC\Core\ifc A.cs + + + IFC\Core\IFC B.cs + + + IFC\Core\IFC C.cs + + + IFC\Core\IFC D.cs + + + IFC\Core\IFC E.cs + + + IFC\Core\IFC F.cs + + + IFC\Core\IFC G.cs + + + IFC\Core\IFC H.cs + + + IFC\Core\IFC I.cs + + + IFC\Core\IFC J.cs + + + IFC\Core\IFC L.cs + + + IFC\Core\IFC M.cs + + + IFC\Core\IFC N.cs + + + IFC\Core\IFC O.cs + + + IFC\Core\IFC P.cs + + + IFC\Core\IFC Q.cs + + + IFC\Core\IFC R.cs + + + IFC\Core\IFC S.cs + + + IFC\Core\IFC T.cs + + + IFC\Core\IFC U.cs + + + IFC\Core\IFC V.cs + + + IFC\Core\IFC W.cs + + + IFC\Core\IFC Z.cs + + + IFC\Core\ParserIFC.cs + + + IFC\RhinoCommon\IFC A RhinoCommon.cs + + + IFC\RhinoCommon\IFC B RhinoCommon.cs + + + IFC\RhinoCommon\IFC C RhinoCommon.cs + + + IFC\RhinoCommon\IFC D RhinoCommon.cs + + + IFC\RhinoCommon\IFC E RhinoCommon.cs + + + IFC\RhinoCommon\IFC F RhinoCommon.cs + + + IFC\RhinoCommon\IFC G RhinoCommon.cs + + + IFC\RhinoCommon\IFC H RhinoCommon.cs + + + IFC\RhinoCommon\IFC I RhinoCommon.cs + + + IFC\RhinoCommon\IFC L RhinoCommon.cs + + + IFC\RhinoCommon\IFC M RhinoCommon.cs + + + IFC\RhinoCommon\IFC O RhinoCommon.cs + + + IFC\RhinoCommon\IFC P RhinoCommon.cs + + + IFC\RhinoCommon\IFC R RhinoCommon.cs + + + IFC\RhinoCommon\IFC S RhinoCommon.cs + + + IFC\RhinoCommon\IFC T RhinoCommon.cs + + + IFC\RhinoCommon\IFC V RhinoCommon.cs + + + STEP\BaseClassSTEP.cs + + + STEP\ParserSTEP.cs + + + + + + + + + +xcopy /s /y "$(SolutionDir)packages\Rhino3dmIO.dll-AnyCPU-Windows.5.1.30000.25\NativeBinaries\x86\*.*" "$(TargetDir)x86\" +xcopy /s /y "$(SolutionDir)packages\Rhino3dmIO.dll-AnyCPU-Windows.5.1.30000.25\NativeBinaries\x64\*.*" "$(TargetDir)x64\" + + + + \ No newline at end of file diff --git a/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs b/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1883eba --- /dev/null +++ b/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs @@ -0,0 +1,54 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("GeometryGymIFCRhinoCommonx64")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Geometry Gym Pty Ltd")] +[assembly: AssemblyProduct("GeometryGymIFCRhinoCommonx64")] +[assembly: AssemblyCopyright("Copyright © Geometry Gym Pty Ltd 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c26aa7cc-baf1-4551-b91b-76e56ca15567")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.0.1.0")] +[assembly: AssemblyFileVersion("0.0.1.0")] diff --git a/DLL Projects/GeometryGymIFCRhinoCommonx64/packages.config b/DLL Projects/GeometryGymIFCRhinoCommonx64/packages.config new file mode 100644 index 0000000..344963b --- /dev/null +++ b/DLL Projects/GeometryGymIFCRhinoCommonx64/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/IFC/BaseClassIFC.cs b/IFC/BaseClassIFC.cs new file mode 100644 index 0000000..35bf0be --- /dev/null +++ b/IFC/BaseClassIFC.cs @@ -0,0 +1,77 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; + +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class BaseClassIfc : STEPEntity, IfcInterface + { + internal string mIFCString = ""; + public virtual string Name { get { return ""; } set { } } + internal DatabaseIfc mDatabase = null; + + DatabaseIfc IfcInterface.Database { get { return mDatabase; } } + + internal BaseClassIfc() : base() { } + protected BaseClassIfc(BaseClassIfc e) { mIndex = e.mIndex; mDatabase = e.mDatabase; mDatabase.mIfcObjects[e.mIndex] = this; } + internal BaseClassIfc(int record, string kw, string line) { mIndex = record; mIFCString = line; } + protected BaseClassIfc(DatabaseIfc m) { attachModel(m); } + + + private void attachModel(DatabaseIfc m) + { + + bool added = false; + for (int icounter = m.mNextBlank; icounter < m.mIfcObjects.Count; icounter++) + { + if (m.mIfcObjects[icounter] == null) + { + added = true; + mIndex = icounter; + m.mNextBlank = icounter + 1; + m.mIfcObjects[icounter] = this; + break; + } + } + if (!added) + { + if (m.mNextBlank > m.mIfcObjects.Count) + { + int count = m.mNextBlank - m.mIfcObjects.Count; + for (int pcounter = 0; pcounter < count; pcounter++) + m.mIfcObjects.Add(null); + } + mIndex = m.mIfcObjects.Count; + m.mIfcObjects.Add(this); + m.mNextBlank = mIndex + 1; + } + mDatabase = m; + } + } + public interface IfcInterface { int Index { get; } string Name { get; set; } DatabaseIfc Database { get; } } + +} diff --git a/IFC/DatabaseIFC.cs b/IFC/DatabaseIFC.cs new file mode 100644 index 0000000..102462a --- /dev/null +++ b/IFC/DatabaseIFC.cs @@ -0,0 +1,979 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using System.Globalization; +using System.Threading; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public enum Schema { IFC2x3, IFC4, IFC4A1 }; + public enum ModelView { Ifc4Reference, Ifc4DesignTransfer, Ifc4NotAssigned,Ifc2x3Coordination, If2x3NotAssigned }; + public partial class DatabaseIfc + { + + internal partial class Aggregate + { + //internal List mProfiles = new List(); + //internal List mWorkPlans = new List(); + //internal List mRepMaps = new List(); + //internal List mApplications = new List(); + internal List mBuildingStories = new List(); + internal List mComplexProperties = new List(); + internal List mCoordinateOperations = new List(); + internal List mEdgeCurves = new List(); + internal List mExternalRelationships = new List(); + //internal List mExtrusions = new List(); + internal List mGeomContexts = new List(); + internal List mGrids = new List(); + internal List mGroups = new List(); + internal List mIndexedColourMap = new List(); + internal List mIndexedTextureMap = new List(); + internal List mLocalPlacements = new List(); + internal List mMappedItems = new List(); + internal List mMaterials = new List(); + internal List mMaterialProperties = new List(); + internal List mMaterialPropertiesSS = new List(); + //internal List mFasteners = new List(); + internal List mOwnHistories = new List(); + internal List mPresentationLayerAssignments = new List(); + internal List mProducts = new List(); + internal List mProductReps = new List(); + internal List mPropertySets = new List(); + internal List mRelationships = new List(); + internal List mRepresentations = new List(); + internal List mConstraintRelationships = new List(); + internal List mShapeAspects = new List(); + internal List mSlabs = new List(); + internal List mStructItems = new List(); + internal List mStyledItems = new List(); + internal List mTypeProducts = new List(); + internal List mWalls = new List(); + internal List mZones = new List(); + + internal Aggregate() { } + partial void setCustomAggregate(BaseClassIfc obj); + internal void setAggregate(BaseClassIfc obj) + { + IfcProduct product = obj as IfcProduct; + if (product != null) + { + mProducts.Add(product); + IfcBuildingStorey buildingStorey = obj as IfcBuildingStorey; + if (buildingStorey != null) + mBuildingStories.Add(buildingStorey); + IfcGrid grid = obj as IfcGrid; + if (grid != null) + mGrids.Add(grid); + IfcSlab slab = product as IfcSlab; + if (slab != null) + mSlabs.Add(slab); + IfcStructuralItem structuralItem = obj as IfcStructuralItem; + if (structuralItem != null) + mStructItems.Add(structuralItem); + IfcWall wall = product as IfcWall; + if (wall != null) + mWalls.Add(wall); + return; + } + //IfcApplication application = obj as IfcApplication; + //if (application != null) + // mApplications.Add(application); + IfcComplexProperty cp = obj as IfcComplexProperty; + if(cp != null) + { + mComplexProperties.Add(cp); + return; + } + IfcCoordinateOperation coordOp = obj as IfcCoordinateOperation; + if (coordOp != null) + { + mCoordinateOperations.Add(coordOp); + return; + } + + IfcEdgeCurve edgeCurve = obj as IfcEdgeCurve; + if (edgeCurve != null) + { + mEdgeCurves.Add(edgeCurve); + return; + } + IfcExternalReferenceRelationship externalReferenceRelationship = obj as IfcExternalReferenceRelationship; + if (externalReferenceRelationship != null) + { + mExternalRelationships.Add(externalReferenceRelationship); + return; + } + //IfcExtrudedAreaSolid extrudedAreaSolid = result as IfcExtrudedAreaSolid; + //if(extrudedAreaSolid != null) + //{ + // if(result as IfcExtrudedAreaSolidTapered == null) + // aggregate.mExtrusions.Add(extrudedAreaSolid); + // return extrudedAreaSolid; + //} + IfcGeometricRepresentationSubContext geometricRepresentationContext = obj as IfcGeometricRepresentationSubContext; + if (geometricRepresentationContext != null) + { + mGeomContexts.Add(geometricRepresentationContext); + return ; + } + + + IfcGroup group = obj as IfcGroup; + if (group != null) + { + IfcZone zone = group as IfcZone; + if (zone != null) + { + mZones.Add(zone); + return; + } + mGroups.Add(group); + return; + } + IfcIndexedColourMap indexedColourMap = obj as IfcIndexedColourMap; + if (indexedColourMap != null) + { + mIndexedColourMap.Add(indexedColourMap); + return; + } + IfcIndexedTextureMap indexedTextureMap = obj as IfcIndexedTextureMap; + if (indexedTextureMap != null) + { + mIndexedTextureMap.Add(indexedTextureMap); + return; + } + IfcLocalPlacement localPlacement = obj as IfcLocalPlacement; + if (localPlacement != null) + { + mLocalPlacements.Add(localPlacement); + return; + } + IfcMappedItem mi = obj as IfcMappedItem; + if (mi != null) + { + mMappedItems.Add(mi); + return; + } + IfcMaterial material = obj as IfcMaterial; + if (material != null) + { + mMaterials.Add(material); + return; + } + IfcMaterialProperties materialProperties = obj as IfcMaterialProperties; + if (materialProperties != null) + { + mMaterialProperties.Add(materialProperties); + return; + } + IfcMaterialPropertiesSuperSeded materialPropertiesSS = obj as IfcMaterialPropertiesSuperSeded; + if (materialPropertiesSS != null) + { + mMaterialPropertiesSS.Add(materialPropertiesSS); + return; + } + // IfcMechanicalFastener mechanicalFastener = result as IfcMechanicalFastener; + //if(mechanicalFastener != null) + //{ + // mFasteners.Add(mechanicalFastener); + // return mechanicalFastener; + //} + //IfcOwnerHistory ownerHistory = result as IfcOwnerHistory; + //if(ownerHistory != null) + //{ + // mOwnHistories.Add(ownerHistory); + // return ownerHistory; + //} + IfcPresentationLayerAssignment presentationLayerAssignment = obj as IfcPresentationLayerAssignment; + if (presentationLayerAssignment != null) + { + mPresentationLayerAssignments.Add(presentationLayerAssignment); + return; + } + IfcProductRepresentation productRepresentation = obj as IfcProductRepresentation; + if (productRepresentation != null) + { + mProductReps.Add(productRepresentation); + return; + } + IfcPropertySet propSet = obj as IfcPropertySet; + if(propSet != null) + { + mPropertySets.Add(propSet); + return; + } + //IfcProfileDef profileDef = obj as IfcProfileDef; + //if (profileDef != null) + //{ + // mProfiles.Add(profileDef); + // return profileDef; + //} + IfcRelationship relationship = obj as IfcRelationship; + if (relationship != null) + { + mRelationships.Add(relationship); + return; + } + IfcRepresentation representation = obj as IfcRepresentation; + if (representation != null) + { + mRepresentations.Add(representation); + return; + } + //IfcRepresentationMap representationMap = obj as IfcRepresentationMap; + //if (representationMap != null) + //{ + // mRepMaps.Add(representationMap); + // return representationMap; + //} + IfcResourceConstraintRelationship rcr = obj as IfcResourceConstraintRelationship; + if (rcr != null) + { + mConstraintRelationships.Add(rcr); + return; + } + IfcShapeAspect shapeAspect = obj as IfcShapeAspect; + if (shapeAspect != null) + { + mShapeAspects.Add(shapeAspect); + return; + } + IfcStyledItem styledItem = obj as IfcStyledItem; + if (styledItem != null) + { + mStyledItems.Add(styledItem); + return; + } + + IfcTypeProduct typeProduct = obj as IfcTypeProduct; + if (typeProduct != null) + { + mTypeProducts.Add(typeProduct); + return; + } + setCustomAggregate(obj); + } + partial void InitializeOthers(string folder); + internal void RelateObjects(string folder) + { + try + { + int icounter; + for(icounter = 0; icounter < mComplexProperties.Count;icounter++) + mComplexProperties[icounter].relate(); + for (icounter = 0; icounter < mCoordinateOperations.Count; icounter++) + mCoordinateOperations[icounter].Relate(); + for (icounter = 0; icounter < mEdgeCurves.Count; icounter++) + mEdgeCurves[icounter].associate(); + foreach (IfcExternalReferenceRelationship er in mExternalRelationships) + { + try + { + er.relate(); + } + catch (Exception) { } + } + for (icounter = 0; icounter < mProducts.Count; icounter++) + mProducts[icounter].relate(); + foreach (IfcIndexedColourMap icm in mIndexedColourMap) + icm.relate(); + foreach (IfcIndexedTextureMap itm in mIndexedTextureMap) + itm.relate(); + for (icounter = 0; icounter < mLocalPlacements.Count; icounter++) + mLocalPlacements[icounter].setReference(); + for(icounter = 0; icounter < mMappedItems.Count; icounter++) + mMappedItems[icounter].MappingSource.mMapUsage.Add(mMappedItems[icounter]); + for (icounter = 0; icounter < mMaterialProperties.Count; icounter++) + mMaterialProperties[icounter].relate(); + for (icounter = 0; icounter < mMaterialPropertiesSS.Count; icounter++) + mMaterialPropertiesSS[icounter].relate(); + for (icounter = 0; icounter < mPresentationLayerAssignments.Count; icounter++) + mPresentationLayerAssignments[icounter].relate(); + for (icounter = 0; icounter < mProductReps.Count; icounter++) + { + try + { + mProductReps[icounter].relate(); + } + catch (Exception) { } + } + for (icounter = 0; icounter < mPropertySets.Count; icounter++) + mPropertySets[icounter].relate(); + for (icounter = 0; icounter < mRelationships.Count; icounter++) + { + try + { + mRelationships[icounter].relate(); + } + catch (Exception) { } + } + foreach (IfcRepresentation r in mRepresentations) + r.relate(); + foreach (IfcResourceConstraintRelationship rc in mConstraintRelationships) + rc.relate(); + foreach (IfcShapeAspect sa in mShapeAspects) + sa.relate(); + for(icounter = 0; icounter < mTypeProducts.Count; icounter++) + { + List repMaps = mTypeProducts[icounter].RepresentationMaps; + for (int jcounter = 0; jcounter < repMaps.Count; jcounter++) + repMaps[jcounter].mTypeProducts.Add(mTypeProducts[icounter]); + } + for (icounter = 0; icounter < mStyledItems.Count; icounter++) + mStyledItems[icounter].associateItem(); + InitializeOthers(folder); + } + catch (Exception) + { + //logError.printMessage("XXX " + x.ToString()); + } + } + } + internal Guid id = Guid.NewGuid(); + internal int mNextBlank = 1; + + internal Schema mSchema = Schema.IFC2x3; + + internal ModelView mModelView = ModelView.If2x3NotAssigned; + internal bool mAccuratePreview = false;// mCoordinationView = false; + internal string mFolder = ""; + internal double mPlaneAngleToRadians = 1; + internal bool mTimeInDays = false; + public int NextObjectRecord { set { mNextBlank = value; } } + public Schema IFCSchema + { + get { return mSchema; } + set { mSchema = value; } + } + public ModelView ModelView + { + get { return mModelView; } + set { mModelView = value; } + } + public double Tolerance + { + get { return mModelTolerance; } + set { mModelTolerance = Math.Min(0.0005 / mModelSIScale, value); } + } + public double ScaleSI + { + get { return mModelSIScale; } + set { mModelSIScale = value; } + } + + private double mModelTolerance = 0.0001,mModelSIScale = 1; + public IfcProject Project + { + get { return mContext as IfcProject; } + } + internal List mIfcObjects = new List(new BaseClassIfc[] { new BaseClassIfc() }); + + private IfcCartesianPoint mOrigin = null, mWorldOrigin = null,mOrigin2d = null; + internal IfcDirection mXAxis, mYAxis, mZAxis; + //internal int mTempWorldCoordinatePlacement = 0; + private IfcAxis2Placement3D mWorldCoordinatePlacement; + internal IfcAxis2Placement3D mPlacementPlaneXY; + internal IfcAxis2Placement2D m2DPlaceOrigin; + internal IfcSIUnit mSILength, mSIArea, mSIVolume; + internal IfcGeometricRepresentationContext mGeomRepContxt; + internal IfcGeometricRepresentationSubContext mGeoRepSubContxtBody = null, mGeoRepSubContxtAxis=null, mGeoRepSubContxtAnalysisSurface = null; + private IfcApplication mApplication = null; + internal IfcApplication Application + { + get + { + if (mApplication == null) + mApplication = new IfcApplication(this); + return mApplication; + } + } + private IfcPersonAndOrganization mPersonOrganization = null; + internal IfcPersonAndOrganization PersonOrganization + { + get + { + if (mPersonOrganization == null) + mPersonOrganization = new IfcPersonAndOrganization(this); + return mPersonOrganization; + } + } + private IfcOwnerHistory mOwnerHistoryCreate,mOwnerHistoryModify,mOwnerHistoryDelete; + internal IfcOwnerHistory OwnerHistory(IfcChangeActionEnum changeAction) + { + if(changeAction == IfcChangeActionEnum.ADDED) + { + if (mOwnerHistoryCreate == null) + mOwnerHistoryCreate = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.ADDED); + return mOwnerHistoryCreate; + } + if(changeAction == IfcChangeActionEnum.DELETED) + { + if (mOwnerHistoryDelete == null) + mOwnerHistoryDelete = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.DELETED); + return mOwnerHistoryDelete; + } + if(changeAction == IfcChangeActionEnum.MODIFIED) + { + if (mOwnerHistoryModify == null) + mOwnerHistoryModify = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.MODIFIED); + return mOwnerHistoryModify; + } + return null; + } + + + internal IfcContext mContext = null; + + internal HashSet mGlobalIDs = new HashSet(); + + partial void printError(string str); + internal void logError(string str) { printError(str); } + partial void getApplicationString(ref string app); + internal string applicationString + { + get + { + string str = ""; + getApplicationString(ref str); + if(string.IsNullOrEmpty(str)) + { + try + { + Assembly assembly = Assembly.GetExecutingAssembly(); + AssemblyName name = assembly.GetName(); + return name.Name + " v" + name.Version; + } + catch(Exception) { } + } + return "Unknown Application"; + } + } + internal string getHeaderString(string fileName) + { + string vd = (mModelView == ModelView.Ifc2x3Coordination ? "CoordinationView_V2" : + (mModelView == ModelView.Ifc4Reference ? "ReferenceView_V1" : (mModelView == ModelView.Ifc4DesignTransfer ? "DesignTransferView_V1" : "notYetAssigned"))); + string hdr = "ISO-10303-21;\r\nHEADER;\r\nFILE_DESCRIPTION(('ViewDefinition [" + vd + "]'),'2;1');\r\n"; + + hdr += "FILE_NAME(\r\n"; + hdr += "/* name */ '" + ParserIfc.Encode(fileName.Replace("\\", "\\\\")) + "',\r\n"; + DateTime now = DateTime.Now; + hdr += "/* time_stamp */ '" + now.Year + "-" + (now.Month < 10 ? "0" : "") + now.Month + "-" + (now.Day < 10 ? "0" : "") + now.Day + "T" + (now.Hour < 10 ? "0" : "") + now.Hour + ":" + (now.Minute < 10 ? "0" : "") + now.Minute + ":" + (now.Second < 10 ? "0" : "") + now.Second + "',\r\n"; + hdr += "/* author */ ('" + System.Environment.UserName + "'),\r\n"; + hdr += "/* organization */ ('Unknown'),\r\n"; + hdr += "/* preprocessor_version */ 'GeomGymIFC by Geometry Gym Pty Ltd',\r\n"; + hdr += "/* originating_system */ '" + applicationString + "',\r\n"; + + hdr += "/* authorization */ 'None');\r\n\r\n"; + hdr += "FILE_SCHEMA (('" + (mSchema == Schema.IFC2x3 ? "IFC2X3" : "IFC4") + "'));\r\n"; + hdr += "ENDSEC;\r\n"; + hdr += "\r\nDATA;"; + return hdr; + } + internal string getFooterString() { return "ENDSEC;\r\n\r\nEND-ISO-10303-21;\r\n\r\n"; } + internal bool mDrawBuildElemProx = true, mDrawSpaceReps = false,mDrawFurnishing = true,mDrawFasteners = false,mDrawPlates = true,mDrawRailings = true, mOutputEssential = false, mCFSasMesh = false; + + public DatabaseIfc(string fileName) : base() + { + Aggregate aggregate = new Aggregate(); + ReadFile(getStreamReader(fileName),aggregate,0); + } + public DatabaseIfc(TextReader stream) : base() + { + Aggregate aggregate = new Aggregate(); + ReadFile(stream, aggregate, 0); + } + public DatabaseIfc(ModelView view) : this(true, view) { } + public DatabaseIfc(bool generate, ModelView view) : this(generate, view == ModelView.Ifc2x3Coordination ? Schema.IFC2x3 : Schema.IFC4A1,view) { } + public DatabaseIfc(bool generate, Schema schema) : this(generate,schema,schema == Schema.IFC2x3 ? ModelView.If2x3NotAssigned : ModelView.Ifc4NotAssigned) { } + private DatabaseIfc(bool generate,Schema schema, ModelView view) + { + mSchema = schema; + mModelView = view; +#if(RHINO) + mModelSIScale = 1 / GGYM.Units.mLengthConversion[(int) GGYM.GGYMRhino.GGRhino.ActiveUnits()]; + Tolerance = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance; +#endif + if (mSchema == Schema.IFC2x3 || mSchema == Schema.IFC4) + { + OwnerHistory(IfcChangeActionEnum.ADDED); + } + mGeomRepContxt = new IfcGeometricRepresentationContext(this, 3, Tolerance) { ContextType = "Model" }; + mGeoRepSubContxtAxis = new IfcGeometricRepresentationSubContext(mGeomRepContxt, 0, IfcGeometricProjectionEnum.MODEL_VIEW) { ContextIdentifier = "Axis" }; + mGeoRepSubContxtBody = new IfcGeometricRepresentationSubContext(mGeomRepContxt, 0, IfcGeometricProjectionEnum.MODEL_VIEW) { ContextIdentifier = "Body" }; + + if (generate) + initData(); + } + + + + + internal void initData() + { + initGeom(); + mSILength = new IfcSIUnit(this, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.NONE, IfcSIUnitName.METRE); + mSIArea = new IfcSIUnit(this, IfcUnitEnum.AREAUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SQUARE_METRE); + mSIVolume = new IfcSIUnit(this, IfcUnitEnum.VOLUMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.CUBIC_METRE); + } + internal void initGeom() + { + IfcCartesianPoint point = Origin; + IfcDirection direction = XAxis; + direction = YAxis; + direction = ZAxis; + IfcAxis2Placement pl = this.WorldCoordinatePlacement; + IfcAxis2Placement2D placement = Origin2dPlace; + } + public override string ToString() + { + //IFCModel im = new IFCModel(mIFC2x3,true); + string result = getHeaderString("") + "\r\n"; + for (int icounter = 1; icounter < mIfcObjects.Count; icounter++) + { + BaseClassIfc ie = mIfcObjects[icounter]; + if (ie != null) + { + string str = ie.ToString(); + if (str != "") + result += str +"\r\n"; + } + } + return result + getFooterString(); + } + internal IfcAxis2Placement2D Origin2dPlace + { + get + { + if (m2DPlaceOrigin == null) + m2DPlaceOrigin = new IfcAxis2Placement2D(new IfcCartesianPoint(this, 0, 0)); + return m2DPlaceOrigin; + } + } + internal IfcCartesianPoint WorldOrigin + { + get + { + if(mWorldOrigin == null) + mWorldOrigin = WorldCoordinatePlacement.Location; + return mWorldOrigin; + } + } + internal IfcCartesianPoint Origin2d + { + get + { + if (mOrigin2d == null) + mOrigin2d = new IfcCartesianPoint(this,0, 0); + return mOrigin2d; + } + } + internal IfcAxis2Placement3D WorldCoordinatePlacement + { + get + { + if (mWorldCoordinatePlacement == null) + { + if (mContext != null) + { + List contexts = mContext.RepresentationContexts; + foreach (IfcRepresentationContext context in contexts) + { + IfcGeometricRepresentationContext grc = context as IfcGeometricRepresentationContext; + if (grc == null) + continue; + IfcAxis2Placement3D pl = grc.WorldCoordinateSystem as IfcAxis2Placement3D; + if (pl != null) + { + mWorldCoordinatePlacement = pl; + break; + } + } + } + if (mWorldCoordinatePlacement == null) + { + mWorldCoordinatePlacement = new IfcAxis2Placement3D(new IfcCartesianPoint(this, 0, 0, 0), mZAxis, mXAxis); + if (mContext != null) + { + List contexts = mContext.RepresentationContexts; + foreach (IfcRepresentationContext context in contexts) + { + IfcGeometricRepresentationContext grc = context as IfcGeometricRepresentationContext; + if (grc != null) + { + grc.WorldCoordinateSystem = mWorldCoordinatePlacement; + return mWorldCoordinatePlacement; + } + } + } + } + } + return mWorldCoordinatePlacement; + } + } + internal IfcAxis2Placement3D PlaneXYPlacement + { + get + { + if (mPlacementPlaneXY == null) + mPlacementPlaneXY = new IfcAxis2Placement3D(this); + return mPlacementPlaneXY; + } + } + internal IfcCartesianPoint Origin + { + get + { + if (mOrigin == null) + mOrigin = new IfcCartesianPoint(this, 0, 0, 0); + return mOrigin; + } + } + internal IfcDirection XAxis + { + get + { + if (mXAxis == null) + mXAxis = new IfcDirection(this, 1, 0, 0); + return mXAxis; + } + } + internal IfcDirection YAxis + { + get + { + if (mYAxis == null) + mYAxis = new IfcDirection(this, 0, 1, 0); + return mYAxis; + } + } + internal IfcDirection ZAxis + { + get + { + if (mZAxis == null) + mZAxis = new IfcDirection(this, 0, 0, 1); + return mZAxis; + } + } + + internal static StreamReader getStreamReader(string fileName) + { + string ext = System.IO.Path.GetExtension(fileName); + if (string.Compare(ext, ".IFCZIP", true) == 0) + { + System.IO.Compression.ZipArchive za = System.IO.Compression.ZipFile.OpenRead(fileName); + if (za.Entries.Count != 1) + { + return null; + } + return new StreamReader(za.Entries[0].Open(), System.Text.Encoding.GetEncoding("windows-1252")); + } + return new StreamReader(fileName, System.Text.Encoding.GetEncoding("windows-1252")); + } + + private IfcContext ReadFile(TextReader sr, Aggregate aggregate, int offset) + { + mSchema = Schema.IFC2x3; + CultureInfo current = Thread.CurrentThread.CurrentCulture; + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); + string strLine = sr.ReadLine(), str = ""; + DateTime s = DateTime.Now; + if (offset > 0) + { + while (strLine != null) + { + int index = strLine.IndexOf("/*"); + if (index >= 0) + { + string str2 = "", str3 = strLine; + if (index > 0) + str2 = strLine.Substring(0, index); + int index2 = str3.IndexOf("*/"); + while (index2 < 0) + { + str3 = sr.ReadLine(); + if (strLine == null) + break; + index2 = str3.IndexOf("*/"); + } + strLine = str2; + if (strLine != null && index2 + 2 < str3.Length) + strLine += str3.Substring(index2 + 2); + } + while (!strLine.EndsWith(";")) + { + str = sr.ReadLine(); + if (str != null) + { + index = str.IndexOf("/*"); + if (index >= 0) + { + string str2 = "", str3 = str; + if (index > 0) + str2 = strLine.Substring(0, index); + int index2 = str3.IndexOf("*/"); + while (index2 < 0) + { + str3 = sr.ReadLine(); + if (strLine == null) + break; + index2 = str3.IndexOf("*/"); + } + str = str2; + if (strLine != null && index2 + 2 < str3.Length) + str += str3.Substring(index2 + 2); + } + strLine += str; + strLine.Trim(); + } + else + { + strLine = strLine.Trim(); + strLine += ";"; + break; + } + } + strLine = ParserSTEP.offsetSTEPRecords(strLine, offset); + try + { + InterpretLine(strLine, aggregate); + } + catch (Exception ex) { logError("XXX Error in line " + strLine + " " + ex.Message); } + strLine = sr.ReadLine(); + } + } + else + { + while (strLine != null) + { + int index = strLine.IndexOf("/*"); + if (index >= 0) + { + string str2 = "", str3 = strLine; + if (index > 0) + str2 = strLine.Substring(0, index); + int index2 = str3.IndexOf("*/"); + while (index2 < 0) + { + str3 = sr.ReadLine(); + if (strLine == null) + break; + index2 = str3.IndexOf("*/"); + } + strLine = str2; + if (strLine != null && index2 + 2 < str3.Length) + strLine += str3.Substring(index2 + 2); + } + strLine = strLine.Trim(); + while (!strLine.EndsWith(";")) + { + str = sr.ReadLine(); + if (str != null) + { + index = str.IndexOf("/*"); + if (index >= 0) + { + string str2 = "", str3 = str; + if (index > 0) + str2 = strLine.Substring(0, index); + int index2 = str3.IndexOf("*/"); + while (index2 < 0) + { + str3 = sr.ReadLine(); + if (strLine == null) + break; + index2 = str3.IndexOf("*/"); + } + str = str2; + if (strLine != null && index2 + 2 < str3.Length) + str += str3.Substring(index2 + 2); + } + strLine += str; + strLine.Trim(); + } + else + { + strLine = strLine.Trim(); + strLine += ";"; + break; + } + } + try + { + InterpretLine(strLine, aggregate); + } + catch (Exception ex) { logError("XXX Error in line " + strLine + " " + ex.Message); } + strLine = sr.ReadLine(); + } + } + sr.Close(); + Thread.CurrentThread.CurrentCulture = current; + postImport(aggregate); + + return mContext; + } + + partial void customPostImport(Aggregate aggregate); + private void postImport(Aggregate aggregate) + { + mWorldCoordinatePlacement = null; + aggregate.RelateObjects(mFolder); + if(mContext != null) + { + mContext.initializeUnitsAndScales(); + + if (mContext.mRepresentationContexts.Count > 0) + mGeomRepContxt = mIfcObjects[mContext.mRepresentationContexts[0]] as IfcGeometricRepresentationContext; + if (mContext.mDeclares.Count == 0) + { + List lds = aggregate.mTypeProducts.ConvertAll(x => (IfcDefinitionSelect)x); + IfcRelDeclares rd = new IfcRelDeclares(mContext, lds) { Name = "DeclaredTypes" }; + } + } + customPostImport(aggregate); + + } + internal BaseClassIfc InterpretLine(string line,Aggregate aggregate) + { + if (line.StartsWith("ISO")) + return null; + string ts = line.Trim().Replace(" ", ""); + if (ts.StartsWith("FILE_SCHEMA(('IFC2X4", true, System.Globalization.CultureInfo.CurrentCulture) || + ts.StartsWith("FILE_SCHEMA(('IFC4", true, System.Globalization.CultureInfo.CurrentCulture)) + { + mSchema = Schema.IFC4; + return null; + } + BaseClassIfc result = ParserIfc.ParseLine(line, mSchema); + if (result == null) + { + int ifcID = 0; + string kw = "", str = ""; + ParserIfc.GetKeyWord(line, out ifcID, out kw, out str); + if (string.IsNullOrEmpty(kw)) + return null; + + result = new BaseClassIfc(ifcID, kw,str); + } + if(result == null) + return null; + IfcApplication application = result as IfcApplication; + if (application != null) + { + IfcApplication ea = mApplication; + if (ea != null && ea.mVersion == application.mVersion) + { + if (string.Compare(ea.ApplicationFullName, application.ApplicationFullName, true) == 0) + { + if (string.Compare(ea.mApplicationIdentifier, application.mApplicationIdentifier) == 0) + { + mIfcObjects[ea.mIndex] = null; + mApplication = application; + OwnerHistory(IfcChangeActionEnum.ADDED).mLastModifyingApplication = application.mIndex; + if (mOwnerHistoryModify != null) + mOwnerHistoryModify.mLastModifyingApplication = application.mIndex; + } + } + } + } + IfcContext context = result as IfcContext; + if (context != null) + mContext = context; + IfcGeometricRepresentationContext geometricRepresentationContext = result as IfcGeometricRepresentationContext; + if (geometricRepresentationContext != null) + { + if (string.Compare(geometricRepresentationContext.mContextType, "Plan", true) != 0) + mGeomRepContxt = geometricRepresentationContext; + if (geometricRepresentationContext.mPrecision > 1e-6) + Tolerance = geometricRepresentationContext.mPrecision; + + } + IfcSIUnit unit = result as IfcSIUnit; + if(unit != null) + { + if (unit.Name == IfcSIUnitName.METRE && unit.Prefix == IfcSIPrefix.NONE) + mSILength = unit; + else if (unit.Name == IfcSIUnitName.SQUARE_METRE && unit.Prefix == IfcSIPrefix.NONE) + mSIArea = unit; + else if (unit.Name == IfcSIUnitName.CUBIC_METRE && unit.Prefix == IfcSIPrefix.NONE) + mSIVolume = unit; + } + aggregate.setAggregate(result); + if (mIfcObjects.Count <= result.mIndex) + for (int ncounter = mIfcObjects.Count; ncounter <= result.mIndex; ncounter++) + mIfcObjects.Add(new BaseClassIfc()); + mIfcObjects[result.mIndex] = result; + result.mDatabase = this; + + //IfcWorkPlan workPlan = result as IfcWorkPlan; + //if(workPlan != null) + //{ + // mWorkPlans.Add(workPlan); + // return workPlan; + //} + return result; + } + + public bool WriteFile(string filename) + { + StreamWriter sw = null; + bool zip = filename.EndsWith(".ifczip"); + System.IO.Compression.ZipArchive za = null; + if (zip) + { + if (System.IO.File.Exists(filename)) + System.IO.File.Delete(filename); + za = System.IO.Compression.ZipFile.Open(filename, System.IO.Compression.ZipArchiveMode.Create); + System.IO.Compression.ZipArchiveEntry zae = za.CreateEntry(System.IO.Path.GetFileNameWithoutExtension(filename) + ".ifc"); + sw = new StreamWriter(zae.Open()); + } + else + sw = new StreamWriter(filename); + CultureInfo current = Thread.CurrentThread.CurrentCulture; + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); + sw.Write(getHeaderString("") + "\r\n"); + for (int icounter = 1; icounter < mIfcObjects.Count; icounter++) + { + BaseClassIfc ie = mIfcObjects[icounter]; + if (ie != null) + { + string str = ie.ToString(); + if (!string.IsNullOrEmpty(str)) + sw.WriteLine(str); + } + } + sw.Write(getFooterString()); + sw.Close(); + Thread.CurrentThread.CurrentUICulture = current; + if (zip) + za.Dispose(); + return true; + } + } +} + + \ No newline at end of file diff --git a/IFC/Enumerations.cs b/IFC/Enumerations.cs new file mode 100644 index 0000000..c6cd03a --- /dev/null +++ b/IFC/Enumerations.cs @@ -0,0 +1,276 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Reflection; + +namespace GeometryGym.Ifc +{ + public enum IfcActionSourceTypeEnum { DEAD_LOAD_G, COMPLETION_G1, LIVE_LOAD_Q, SNOW_S, WIND_W, PRESTRESSING_P, SETTLEMENT_U, TEMPERATURE_T, EARTHQUAKE_E, FIRE, IMPULSE, IMPACT, TRANSPORT, ERECTION, PROPPING, SYSTEM_IMPERFECTION, SHRINKAGE, CREEP, LACK_OF_FIT, BUOYANCY, ICE, CURRENT, WAVE, RAIN, BRAKES, USERDEFINED, NOTDEFINED }; + public enum IfcActionTypeEnum { PERMANENT_G, VARIABLE_Q, EXTRAORDINARY_A, USERDEFINED, NOTDEFINED }; + public enum IfcActuatorTypeEnum { ELECTRICACTUATOR, HANDOPERATEDACTUATOR, HYDRAULICACTUATOR, PNEUMATICACTUATOR, THERMOSTATICACTUATOR, USERDEFINED, NOTDEFINED }; + public enum IfcAddressTypeEnum { OFFICE, SITE, HOME, DISTRIBUTIONPOINT, USERDEFINED, NOTDEFINED }; + public enum IfcAheadOrBehind { AHEAD, BEHIND }; //OBSELETE IFC4 + public enum IfcAirTerminalBoxTypeEnum { CONSTANTFLOW, VARIABLEFLOWPRESSUREDEPENDANT, VARIABLEFLOWPRESSUREINDEPENDANT, USERDEFINED, NOTDEFINED }; + public enum IfcAirTerminalTypeEnum { GRILLE, REGISTER, DIFFUSER,LOUVRE, USERDEFINED, NOTDEFINED, EYEBALL, IRIS, LINEARGRILLE, LINEARDIFFUSER }; //IFC4 DELETED + public enum IfcAirToAirHeatRecoveryTypeEnum { FIXEDPLATECOUNTERFLOWEXCHANGER, FIXEDPLATECROSSFLOWEXCHANGER, FIXEDPLATEPARALLELFLOWEXCHANGER, ROTARYWHEEL, RUNAROUNDCOILLOOP, HEATPIPE, TWINTOWERENTHALPYRECOVERYLOOPS, THERMOSIPHONSEALEDTUBEHEATEXCHANGERS, THERMOSIPHONCOILTYPEHEATEXCHANGERS, USERDEFINED, NOTDEFINED }; + public enum IfcAlarmTypeEnum { BELL, BREAKGLASSBUTTON, LIGHT, MANUALPULLBOX, SIREN, WHISTLE, USERDEFINED, NOTDEFINED }; + public enum IfcAlignmentTypeEnum { ABSOLUTE, USERDEFINED, NOTDEFINED }; + public enum IfcAnalysisModelTypeEnum { IN_PLANE_LOADING_2D, OUT_PLANE_LOADING_2D, LOADING_3D, USERDEFINED, NOTDEFINED }; + public enum IfcAnalysisTheoryTypeEnum { FIRST_ORDER_THEORY, SECOND_ORDER_THEORY, THIRD_ORDER_THEORY, FULL_NONLINEAR_THEORY, USERDEFINED, NOTDEFINED }; + public enum IfcArithmeticOperatorEnum { ADD, DIVIDE, MULTIPLY, SUBTRACT,NONE }; //GG ADDED NONE + public enum IfcAssemblyPlaceEnum { SITE, FACTORY, NOTDEFINED }; + public enum IfcAudioVisualApplianceTypeEnum { AMPLIFIER, CAMERA, DISPLAY, MICROPHONE, PLAYER, PROJECTOR, RECEIVER, SPEAKER, SWITCHER, TELEPHONE, TUNER, USERDEFINED, NOTDEFINED }; + public enum IfcBeamTypeEnum { BEAM, HOLLOWCORE, JOIST, LINTEL, SPANDREL, T_BEAM, USERDEFINED, NOTDEFINED }; + public enum IfcBenchmarkEnum { GREATERTHAN, GREATERTHANOREQUALTO, LESSTHAN, LESSTHANOREQUALTO, EQUALTO, NOTEQUALTO, INCLUDES, NOTINCLUDES, INCLUDEDIN, NOTINCLUDEDIN }; + public enum IfcBoilerTypeEnum { WATER, STEAM, USERDEFINED, NOTDEFINED }; + public enum IfcBooleanOperator { UNION, INTERSECTION, DIFFERENCE }; + public enum IfcBSplineCurveForm { POLYLINE_FORM, CIRCULAR_ARC, ELLIPTIC_ARC, PARABOLIC_ARC, HYPERBOLIC_ARC, UNSPECIFIED }; + public enum IfcBSplineSurfaceForm { PLANE_SURF, CYLINDRICAL_SURF, CONICAL_SURF, SPHERICAL_SURF, TOROIDAL_SURF, SURF_OF_REVOLUTION, RULED_SURF, GENERALISED_CONE, QUADRIC_SURF, SURF_OF_LINEAR_EXTRUSION, UNSPECIFIED }; + //public enum IfcBuildingElementEnum { IfcBeam, IfcBuildingElementPart, IfcBuildingElementProxy, IfcColumn, IfcCovering, IfcCurtainWall, IfcDoor, IfcFooting, IfcMember, IfcPile, IfcPlate, IfcRailing, IfcRamp, IfcRampFlight, IfcRoof, IfcSlab, IfcStair, IfcStairFlight, IfcWall, IfcWindow }; + public enum IfcBuildingElementPartTypeEnum { INSULATION, PRECASTPANEL, USERDEFINED, NOTDEFINED }; + public enum IfcBuildingElementProxyTypeEnum { COMPLEX, ELEMENT, PARTIAL, PROVISIONFORVOID, USERDEFINED, NOTDEFINED }; // 1st 3 not used + public enum IfcBuildingSystemTypeEnum { FENESTRATION, FOUNDATION, LOADBEARING, OUTERSHELL, SHADING, TRANSPORT, USERDEFINED, NOTDEFINED}; + public enum IfcBurnerTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcCableCarrierFittingTypeEnum { BEND, CROSS, REDUCER, TEE, USERDEFINED, NOTDEFINED }; + public enum IfcCableCarrierSegmentTypeEnum { CABLELADDERSEGMENT, CABLETRAYSEGMENT, CABLETRUNKINGSEGMENT, CONDUITSEGMENT, USERDEFINED, NOTDEFINED }; + public enum IfcCableFittingTypeEnum { CONNECTOR, ENTRY, EXIT, JUNCTION, TRANSITION, USERDEFINED, NOTDEFINED }; + public enum IfcCableSegmentTypeEnum { CABLESEGMENT, CONDUCTORSEGMENT, USERDEFINED, NOTDEFINED }; + public enum IfcCardinalPointReference { DEFAULT = 0, BOTLEFT = 1, BOTMID = 2, BOTRIGHT = 3, MIDLEFT = 4, MID = 5, MIDRIGHT = 6, TOPLEFT = 7, TOPMID = 8, TOPRIGHT = 9, CENTROID = 10, BOTCENT = 11, LEFTCENT = 12, RIGHTCENT = 13, TOPCENT = 14, SHEARCENT = 15, BOTSHEAR = 16, LEFTSHEAR = 17, RIGHTSHEAR = 18, TOPSHEAR = 19}; + public enum IfcChangeActionEnum { NOCHANGE, MODIFIED, ADDED, DELETED, NOTDEFINED, MODIFIEDADDED, MODIFIEDDELETED }; //IFC4 MODIFIED DELETED + public enum IfcChillerTypeEnum { AIRCOOLED, WATERCOOLED, HEATRECOVERY, USERDEFINED, NOTDEFINED }; + public enum IfcChimneyTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcCoilTypeEnum { DXCOOLINGCOIL, WATERCOOLINGCOIL, STEAMHEATINGCOIL, WATERHEATINGCOIL, ELECTRICHEATINGCOIL, GASHEATINGCOIL, USERDEFINED, NOTDEFINED }; + public enum IfcColumnTypeEnum { COLUMN, USERDEFINED, NOTDEFINED }; + public enum IfcCommunicationsApplianceTypeEnum { ANTENNA, COMPUTER, FAX, GATEWAY, MODEM, NETWORKAPPLIANCE, NETWORKBRIDGE, NETWORKHUB, PRINTER, REPEATER, ROUTER, SCANNER, USERDEFINED, NOTDEFINED }; + public enum IfcComplexPropertyTemplateTypeEnum { P_COMPLEX, Q_COMPLEX }; + public enum IfcCompressorTypeEnum { DYNAMIC, RECIPROCATING, ROTARY, SCROLL, TROCHOIDAL, SINGLESTAGE, BOOSTER, OPENTYPE, HERMETIC, SEMIHERMETIC, WELDEDSHELLHERMETIC, ROLLINGPISTON, ROTARYVANE, SINGLESCREW, TWINSCREW, USERDEFINED, NOTDEFINED }; + public enum IfcCondenserTypeEnum { WATERCOOLEDSHELLTUBE, WATERCOOLEDSHELLCOIL, WATERCOOLEDTUBEINTUBE, WATERCOOLEDBRAZEDPLATE, AIRCOOLED, EVAPORATIVECOOLED, USERDEFINED, NOTDEFINED }; + public enum IfcConnectionTypeEnum { ATPATH, ATSTART, ATEND, NOTDEFINED }; + public enum IfcConstraintEnum { HARD, SOFT, ADVISORY, USERDEFINED, NOTDEFINED }; + public enum IfcControllerTypeEnum { FLOATING, PROPORTIONAL, PROPORTIONALINTEGRAL, PROPORTIONALINTEGRALDERIVATIVE, TIMEDTWOPOSITION, TWOPOSITION, USERDEFINED, NOTDEFINED }; + public enum IfcConstructionEquipmentResourceTypeEnum { DEMOLISHING, EARTHMOVING, ERECTING, HEATING, LIGHTING, PAVING, PUMPING, TRANSPORTING, USERDEFINED, NOTDEFINED }; + public enum IfcConstructionMaterialResourceTypeEnum { AGGREGATES, CONCRETE, DRYWALL, FUEL, GYPSUM, MASONRY, METAL, PLASTIC, WOOD, NOTDEFINED, USERDEFINED }; + public enum IfcConstructionProductResourceTypeEnum { ASSEMBLY, FORMWORK, NOTDEFINED, USERDEFINED }; + public enum IfcCooledBeamTypeEnum { ACTIVE, PASSIVE, USERDEFINED, NOTDEFINED }; + public enum IfcCoolingTowerTypeEnum { NATURALDRAFT, MECHANICALINDUCEDDRAFT, MECHANICALFORCEDDRAFT, USERDEFINED, NOTDEFINED }; + public enum IfcCostItemTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcCostScheduleTypeEnum { BUDGET, COSTPLAN, ESTIMATE, TENDER, PRICEDBILLOFQUANTITIES, UNPRICEDBILLOFQUANTITIES, SCHEDULEOFRATES, USERDEFINED, NOTDEFINED }; + public enum IfcCoveringTypeEnum { CEILING, CLADDING, FLOORING, MOLDING, ROOFING, SKIRTINGBOARD, USERDEFINED, NOTDEFINED, INSULATION, MEMBRANE, SLEEVING, WRAPPING }; //IFC4 DELETED + public enum IfcCrewResourceTypeEnum { OFFICE, SITE, NOTDEFINED, USERDEFINED }; + public enum IfcCurrencyEnum { AED, AES, ATS, AUD, BBD, BEG, BGL, BHD, BMD, BND, BRL, BSD, BWP, BZD, CAD, CBD, CHF, CLP, CNY, CYS, CZK, DDP, DEM, DKK, EGL, EST, EUR, FAK, FIM, FJD, FKP, FRF, GBP, GIP, GMD, GRX, HKD, HUF, ICK, IDR, ILS, INR, IRP, ITL, JMD, JOD, JPY, KES, KRW, KWD, KYD, LKR, LUF, MTL, MUR, MXN, MYR, NLG, NZD, OMR, PGK, PHP, PKR, PLN, PTN, QAR, RUR, SAR, SCR, SEK, SGD, SKP, THB, TRL, TTD, TWD, USD, VEB, VND, XEU, ZAR, ZWD, NOK }; + public enum IfcCurtainWallTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcCurveInterpolationEnum { LINEAR, LOG_LINEAR, LOG_LOG, NOTDEFINED } + public enum IfcDamperTypeEnum { CONTROLDAMPER, FIREDAMPER, SMOKEDAMPER, FIRESMOKEDAMPER, BACKDRAFTDAMPER, RELIEFDAMPER, BLASTDAMPER, GRAVITYDAMPER, GRAVITYRELIEFDAMPER, BALANCINGDAMPER, FUMEHOODEXHAUST, USERDEFINED, NOTDEFINED }; + public enum IfcDataOriginEnum { MEASURED, PREDICTED, SIMULATED, USERDEFINED, NOTDEFINED }; + public enum IfcDerivedUnitEnum + { + ANGULARVELOCITYUNIT, COMPOUNDPLANEANGLEUNIT, DYNAMICVISCOSITYUNIT, HEATFLUXDENSITYUNIT, + INTEGERCOUNTRATEUNIT, ISOTHERMALMOISTURECAPACITYUNIT, KINEMATICVISCOSITYUNIT, LINEARVELOCITYUNIT, MASSDENSITYUNIT, + MASSFLOWRATEUNIT, MOISTUREDIFFUSIVITYUNIT, MOLECULARWEIGHTUNIT, SPECIFICHEATCAPACITYUNIT, THERMALADMITTANCEUNIT, + THERMALCONDUCTANCEUNIT, THERMALRESISTANCEUNIT, THERMALTRANSMITTANCEUNIT, VAPORPERMEABILITYUNIT, VOLUMETRICFLOWRATEUNIT, + ROTATIONALFREQUENCYUNIT, TORQUEUNIT, MOMENTOFINERTIAUNIT, LINEARMOMENTUNIT, LINEARFORCEUNIT, PLANARFORCEUNIT, + MODULUSOFELASTICITYUNIT, SHEARMODULUSUNIT, LINEARSTIFFNESSUNIT, ROTATIONALSTIFFNESSUNIT, MODULUSOFSUBGRADEREACTIONUNIT, + ACCELERATIONUNIT, CURVATUREUNIT, HEATINGVALUEUNIT, IONCONCENTRATIONUNIT, LUMINOUSINTENSITYDISTRIBUTIONUNIT, MASSPERLENGTHUNIT, + MODULUSOFLINEARSUBGRADEREACTIONUNIT, MODULUSOFROTATIONALSUBGRADEREACTIONUNIT, PHUNIT, ROTATIONALMASSUNIT, SECTIONAREAINTEGRALUNIT, + SECTIONMODULUSUNIT, SOUNDPOWERUNIT, SOUNDPRESSUREUNIT, TEMPERATUREGRADIENTUNIT, THERMALEXPANSIONCOEFFICIENTUNIT, WARPINGCONSTANTUNIT, + WARPINGMOMENTUNIT, AREADENSITYUNIT, SOUNDPRESSURELEVELUNIT, TEMPERATURERATEOFCHANGEUNIT, USERDEFINED + }; + public enum IfcDimensionExtentUsage { ORIGIN, TARGET }; + public enum IfcDirectionSenseEnum { POSITIVE, NEGATIVE }; + public enum IfcDiscreteAccessoryTypeEnum { ANCHORPLATE, BRACKET, SHOE, USERDEFINED, NOTDEFINED }; + public enum IfcDistributionChamberElementTypeEnum { FORMEDDUCT, INSPECTIONCHAMBER, INSPECTIONPIT, MANHOLE, METERCHAMBER, SUMP, TRENCH, VALVECHAMBER, USERDEFINED, NOTDEFINED }; + public enum IfcDistributionPortTypeEnum { CABLE, CABLECARRIER, DUCT, PIPE, USERDEFINED, NOTDEFINED } + public enum IfcDistributionSystemEnum { AIRCONDITIONING, AUDIOVISUAL, CHEMICAL, CHILLEDWATER, COMMUNICATION, COMPRESSEDAIR, CONDENSERWATER, + CONTROL, CONVEYING, DATA, DISPOSAL, DOMESTICCOLDWATER, DOMESTICHOTWATER, DRAINAGE, EARTHING, ELECTRICAL, ELECTROACOUSTIC, EXHAUST, + FIREPROTECTION, FUEL, GAS, HAZARDOUS, HEATING, LIGHTING, LIGHTNINGPROTECTION, MUNICIPALSOLIDWASTE, OIL, OPERATIONAL, POWERGENERATION, + RAINWATER, REFRIGERATION, SECURITY, SEWAGE, SIGNAL, STORMWATER, TELEPHONE, TV, VACUUM, VENT, VENTILATION, WASTEWATER, WATERSUPPLY, USERDEFINED, NOTDEFINED }; + public enum IfcDistributionSystemEnumPipe { CHEMICAL, CHILLEDWATER, COMPRESSEDAIR, CONDENSERWATER, CONVEYING, DISPOSAL, DOMESTICCOLDWATER, + DOMESTICHOTWATER, DRAINAGE, FIREPROTECTION, FUEL, GAS, HAZARDOUS, HEATING, MUNICIPALSOLIDWASTE, OIL, OPERATIONAL, RAINWATER, + REFRIGERATION, SEWAGE, STORMWATER, VACUUM, VENT, WASTEWATER, WATERSUPPLY, USERDEFINED, NOTDEFINED }; + public enum IfcDistributionSystemEnumDuct { AIRCONDITIONING, EXHAUST, VENTILATION, USERDEFINED, NOTDEFINED }; + public enum IfcDistributionSystemEnumCable { AUDIOVISUAL, COMMUNICATION, CONTROL, DATA, EARTHING, ELECTRICAL, ELECTROACOUSTIC, LIGHTING, + LIGHTNINGPROTECTION, POWERGENERATION, SECURITY, SIGNAL, TELEPHONE, TV, USERDEFINED, NOTDEFINED }; + public enum IfcDistributionSystemEnumCableCarrier { AUDIOVISUAL, COMMUNICATION, CONTROL, DATA, EARTHING, ELECTRICAL, ELECTROACOUSTIC, + LIGHTING, LIGHTNINGPROTECTION, POWERGENERATION, SECURITY, SIGNAL, TELEPHONE, TV, USERDEFINED, NOTDEFINED }; + public enum IfcDocumentConfidentialityEnum { PUBLIC, RESTRICTED, CONFIDENTIAL, PERSONAL, USERDEFINED, NOTDEFINED }; + public enum IfcDocumentStatusEnum { DRAFT, FINALDRAFT, FINAL, REVISION, NOTDEFINED }; + public enum IfcDoorPanelOperationEnum { SWINGING, DOUBLE_ACTING, SLIDING, FOLDING, REVOLVING, ROLLINGUP, USERDEFINED, NOTDEFINED }; + public enum IfcDoorPanelPositionEnum { LEFT, MIDDLE, RIGHT, NOTDEFINED }; + public enum IfcDoorStyleConstructionEnum { ALUMINIUM, HIGH_GRADE_STEEL, STEEL, WOOD, ALUMINIUM_WOOD, ALUMINIUM_PLASTIC, PLASTIC, USERDEFINED, NOTDEFINED }; + public enum IfcDoorTypeOperationEnum { SINGLE_SWING_LEFT, SINGLE_SWING_RIGHT, DOUBLE_DOOR_SINGLE_SWING, DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT, DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT, DOUBLE_SWING_LEFT, DOUBLE_SWING_RIGHT, DOUBLE_DOOR_DOUBLE_SWING, SLIDING_TO_LEFT, SLIDING_TO_RIGHT, DOUBLE_DOOR_SLIDING, FOLDING_TO_LEFT, FOLDING_TO_RIGHT, DOUBLE_DOOR_FOLDING, REVOLVING, ROLLINGUP, SWING_FIXED_LEFT, SWING_FIXED_RIGHT, USERDEFINED, NOTDEFINED }; + public enum IfcDoorTypeEnum { DOOR, GATE, TRAPDOOR, USERDEFINED, NOTDEFINED }; + public enum IfcDuctFittingTypeEnum { BEND, CONNECTOR, ENTRY, EXIT, JUNCTION, OBSTRUCTION, TRANSITION, USERDEFINED, NOTDEFINED }; + public enum IfcDuctSegmentTypeEnum { RIGIDSEGMENT, FLEXIBLESEGMENT, USERDEFINED, NOTDEFINED }; + public enum IfcDuctSilencerTypeEnum { FLATOVAL, RECTANGULAR, ROUND, USERDEFINED, NOTDEFINED }; + public enum IfcElectricApplianceTypeEnum { COMPUTER, DIRECTWATERHEATER, DISHWASHER, ELECTRICCOOKER, ELECTRICHEATER, FACSIMILE, FREESTANDINGFAN, FREEZER, FRIDGE_FREEZER, HANDDRYER, INDIRECTWATERHEATER, MICROWAVE, PHOTOCOPIER, PRINTER, REFRIGERATOR, RADIANTHEATER, SCANNER, TELEPHONE, TUMBLEDRYER, TV, VENDINGMACHINE, WASHINGMACHINE, WATERHEATER, WATERCOOLER, USERDEFINED, NOTDEFINED }; + public enum IfcElectricCurrentEnum { ALTERNATING, DIRECT, NOTDEFINED }; + public enum IfcElectricDistributionBoardTypeEnum { CONSUMERUNIT, DISTRIBUTIONBOARD, MOTORCONTROLCENTRE, SWITCHBOARD, USERDEFINED, NOTDEFINED }; + public enum IfcElectricDistributionPointFunctionEnum { ALARMPANEL, CONSUMERUNIT, CONTROLPANEL, DISTRIBUTIONBOARD, GASDETECTORPANEL, INDICATORPANEL, MIMICPANEL, MOTORCONTROLCENTRE, SWITCHBOARD, USERDEFINED, NOTDEFINED }; + public enum IfcElectricFlowStorageDeviceTypeEnum { BATTERY, CAPACITORBANK, HARMONICFILTER, INDUCTORBANK, UPS, USERDEFINED, NOTDEFINED }; + public enum IfcElectricGeneratorTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcElectricHeaterTypeEnum { ELECTRICPOINTHEATER, ELECTRICCABLEHEATER, ELECTRICMATHEATER, USERDEFINED, NOTDEFINED }; + public enum IfcElectricMotorTypeEnum { DC, INDUCTION, POLYPHASE, RELUCTANCESYNCHRONOUS, SYNCHRONOUS, USERDEFINED, NOTDEFINED }; + public enum IfcElectricTimeControlTypeEnum { TIMECLOCK, TIMEDELAY, RELAY, USERDEFINED, NOTDEFINED }; + public enum IfcElementAssemblyTypeEnum { ACCESSORY_ASSEMBLY, ARCH, BEAM_GRID, BRACED_FRAME, GIRDER, REINFORCEMENT_UNIT, RIGID_FRAME, SLAB_FIELD, TRUSS, USERDEFINED, NOTDEFINED }; + public enum IfcElementCompositionEnum { COMPLEX, ELEMENT, PARTIAL, NA }; + public enum IfcEnergySequenceEnum { PRIMARY, SECONDARY, TERTIARY, AUXILIARY, USERDEFINED, NOTDEFINED }; + public enum IfcEngineTypeEnum { EXTERNALCOMBUSTION, publicCOMBUSTION, USERDEFINED, NOTDEFINED }; + public enum IfcEnvironmentalImpactCategoryEnum { COMBINEDVALUE, DISPOSAL, EXTRACTION, INSTALLATION, MANUFACTURE, TRANSPORTATION, USERDEFINED, NOTDEFINED }; + public enum IfcEvaporativeCoolerTypeEnum { DIRECTEVAPORATIVERANDOMMEDIAAIRCOOLER, DIRECTEVAPORATIVERIGIDMEDIAAIRCOOLER, DIRECTEVAPORATIVESLINGERSPACKAGEDAIRCOOLER, DIRECTEVAPORATIVEPACKAGEDROTARYAIRCOOLER, DIRECTEVAPORATIVEAIRWASHER, INDIRECTEVAPORATIVEPACKAGEAIRCOOLER, INDIRECTEVAPORATIVEWETCOIL, INDIRECTEVAPORATIVECOOLINGTOWERORCOILCOOLER, INDIRECTDIRECTCOMBINATION, USERDEFINED, NOTDEFINED }; + public enum IfcEvaporatorTypeEnum { DIRECTEXPANSIONSHELLANDTUBE, DIRECTEXPANSIONTUBEINTUBE, DIRECTEXPANSIONBRAZEDPLATE, FLOODEDSHELLANDTUBE, SHELLANDCOIL, USERDEFINED, NOTDEFINED }; + public enum IfcEventTypeEnum { STARTEVENT, ENDEVENT, INTERMEDIATEEVENT, USERDEFINED, NOTDEFINED } //IFC4 + public enum IfcEventTriggerTypeEnum { EVENTRULE, EVENTMESSAGE, EVENTTIME, EVENTCOMPLEX, USERDEFINED, NOTDEFINED } //IFC4 + public enum IfcExternalSpatialElementTypeEnum { EXTERNAL, EXTERNAL_EARTH, EXTERNAL_WATER, EXTERNAL_FIRE, USERDEFINED, NOTDEFINED } //IFC4 + public enum IfcFanTypeEnum { CENTRIFUGALFORWARDCURVED, CENTRIFUGALRADIAL, CENTRIFUGALBACKWARDINCLINEDCURVED, CENTRIFUGALAIRFOIL, TUBEAXIAL, VANEAXIAL, PROPELLORAXIAL, USERDEFINED, NOTDEFINED }; + public enum IfcFastenerTypeEnum { GLUE, MORTAR, WELD, USERDEFINED, NOTDEFINED } //IFC4 + public enum IfcFilterTypeEnum { AIRPARTICLEFILTER, ODORFILTER, OILFILTER, STRAINER, WATERFILTER, USERDEFINED, NOTDEFINED }; + public enum IfcFireSuppressionTerminalTypeEnum { BREECHINGINLET, FIREHYDRANT, HOSEREEL, SPRINKLER, SPRINKLERDEFLECTOR, USERDEFINED, NOTDEFINED }; + public enum IfcFlowDirectionEnum { SOURCE, SINK, SOURCEANDSINK, NOTDEFINED }; + public enum IfcFlowInstrumentTypeEnum { PRESSUREGAUGE, THERMOMETER, AMMETER, FREQUENCYMETER, POWERFACTORMETER, PHASEANGLEMETER, VOLTMETER_PEAK, VOLTMETER_RMS, USERDEFINED, NOTDEFINED }; + public enum IfcFlowMeterTypeEnum { ENERGYMETER, GASMETER, OILMETER, WATERMETER, USERDEFINED, NOTDEFINED, ELECTRICMETER, FLOWMETER }; // IFC4 DELETED + public enum IfcFootingTypeEnum { CAISSON_FOUNDATION, FOOTING_BEAM, PAD_FOOTING, PILE_CAP, STRIP_FOOTING, USERDEFINED, NOTDEFINED }; + public enum IfcFurnitureTypeEnum { CHAIR, TABLE, DESK, BED, FILECABINET, SHELF, SOFA, USERDEFINED, NOTDEFINED }; + public enum IfcGasTerminalTypeEnum { GASAPPLIANCE, GASBOOSTER, GASBURNER, USERDEFINED, NOTDEFINED }; + public enum IfcGeographicElementTypeEnum { TERRAIN, USERDEFINED, NOTDEFINED }; + public enum IfcGeometricProjectionEnum { GRAPH_VIEW, SKETCH_VIEW, MODEL_VIEW, PLAN_VIEW, REFLECTED_PLAN_VIEW, SECTION_VIEW, ELEVATION_VIEW, USERDEFINED, NOTDEFINED }; + public enum IfcGlobalOrLocalEnum { GLOBAL_COORDS, LOCAL_COORDS }; + public enum IfcGridTypeEnum { RECTANGULAR, RADIAL, TRIANGULAR, IRREGULAR, USERDEFINED, NOTDEFINED }; + public enum IfcHeatExchangerTypeEnum { PLATE, SHELLANDTUBE, USERDEFINED, NOTDEFINED }; + public enum IfcHumidifierTypeEnum { STEAMINJECTION, ADIABATICAIRWASHER, ADIABATICPAN, ADIABATICWETTEDELEMENT, ADIABATICATOMIZING, ADIABATICULTRASONIC, ADIABATICRIGIDMEDIA, ADIABATICCOMPRESSEDAIRNOZZLE, ASSISTEDELECTRIC, ASSISTEDNATURALGAS, ASSISTEDPROPANE, ASSISTEDBUTANE, ASSISTEDSTEAM, USERDEFINED, NOTDEFINED }; + public enum IfcInternalOrExternalEnum { INTERNAL, EXTERNAL, EXTERNAL_EARTH, EXTERNAL_WATER, EXTERNAL_FIRE, NOTDEFINED }; + public enum IfcInventoryTypeEnum { ASSETINVENTORY, SPACEINVENTORY, FURNITUREINVENTORY, USERDEFINED, NOTDEFINED }; + public enum IfcInterceptorTypeEnum { CYCLONIC, GREASE, OIL, PETROL, USERDEFINED, NOTDEFINED }; + public enum IfcJunctionBoxTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcKnotType { UNIFORM_KNOTS, QUASI_UNIFORM_KNOTS, PIECEWISE_BEZIER_KNOTS, UNSPECIFIED }; + public enum IfcLaborResourceTypeEnum { ADMINISTRATION ,CARPENTRY ,CLEANING ,CONCRETE ,DRYWALL ,ELECTRIC ,FINISHING ,FLOORING ,GENERAL ,HVAC ,LANDSCAPING ,MASONRY ,PAINTING ,PAVING ,PLUMBING ,ROOFING ,SITEGRADING ,STEELWORK ,SURVEYING ,USERDEFINED ,NOTDEFINED}; + public enum IfcLampTypeEnum { COMPACTFLUORESCENT, FLUORESCENT, HIGHPRESSUREMERCURY, HIGHPRESSURESODIUM, METALHALIDE, TUNGSTENFILAMENT, USERDEFINED, NOTDEFINED }; + public enum IfcLayerSetDirectionEnum { AXIS1, AXIS2, AXIS3 }; + public enum IfcLightDistributionCurveEnum { TYPE_A, TYPE_B, TYPE_C, NOTDEFINED }; + public enum IfcLightEmissionSourceEnum { COMPACTFLUORESCENT, FLUORESCENT, HIGHPRESSUREMERCURY, HIGHPRESSURESODIUM, LIGHTEMITTINGDIODE, LOWPRESSURESODIUM, LOWVOLTAGEHALOGEN, MAINVOLTAGEHALOGEN, METALHALIDE, TUNGSTENFILAMENT, NOTDEFINED }; + public enum IfcLightFixtureTypeEnum { POINTSOURCE, DIRECTIONSOURCE, USERDEFINED, NOTDEFINED }; + public enum IfcLoadGroupTypeEnum { LOAD_GROUP, LOAD_CASE, LOAD_COMBINATION, USERDEFINED, NOTDEFINED, LOAD_COMBINATION_GROUP }; //IFC4 DELETED + public enum IfcLogicalEnum { TRUE, FALSE, UNKNOWN }; + public enum IfcLogicalOperatorEnum { LOGICALAND, LOGICALOR, LOGICALXOR, LOGICALNOTAND, LOGICALNOTOR, NONE }; + public enum IfcMechanicalFastenerTypeEnum { ANCHORBOLT, BOLT, DOWEL, NAIL, NAILPLATE, RIVET, SCREW, SHEARCONNECTOR, STAPLE, STUDSHEARCONNECTOR, USERDEFINED, NOTDEFINED } + public enum IfcMedicalDeviceTypeEnum { AIRSTATION, FEEDAIRUNIT, OXYGENGENERATOR, OXYGENPLANT, VACUUMSTATION, USERDEFINED, NOTDEFINED }; + public enum IfcMemberTypeEnum { BRACE, CHORD, COLLAR, MEMBER, MULLION, PLATE, POST, PURLIN, RAFTER, STRINGER, STRUT, STUD, USERDEFINED, NOTDEFINED }; + public enum IfcMotorConnectionTypeEnum { BELTDRIVE, COUPLING, DIRECTDRIVE, USERDEFINED, NOTDEFINED }; + public enum IfcNullStyle { NULL }; //DEPRECEATED + public enum IfcObjectiveEnum { CODECOMPLIANCE, CODEWAIVER, DESIGNINTENT, EXTERNAL, HEALTHANDSAFETY, MERGECONFLICT, MODELVIEW, PARAMETER, REQUIREMENT, SPECIFICATION, TRIGGERCONDITION, USERDEFINED, NOTDEFINED }; + public enum IfcObjectTypeEnum { PRODUCT, PROCESS, CONTROL, RESOURCE, ACTOR, GROUP, PROJECT, NOTDEFINED }; + public enum IfcOccupantTypeEnum { ASSIGNEE, ASSIGNOR, LESSEE, LESSOR, LETTINGAGENT, OWNER, TENANT, USERDEFINED, NOTDEFINED }; + public enum IfcOpeningElementTypeEnum { OPENING, RECESS, USERDEFINED, NOTDEFINED } + public enum IfcOutletTypeEnum { AUDIOVISUALOUTLET, COMMUNICATIONSOUTLET, POWEROUTLET, USERDEFINED, NOTDEFINED }; + public enum IfcPermeableCoveringOperationEnum { GRILL, LOUVER, SCREEN, USERDEFINED, NOTDEFINED }; + public enum IfcPhysicalOrVirtualEnum { PHYSICAL, VIRTUAL, NOTDEFINED }; + public enum IfcPileConstructionEnum { BORED, CAST_IN_PLACE, COMPOSITE, DRIVEN, JETGROUTING, PRECAST_CONCRETE, PREFAB_STEEL, USERDEFINED, NOTDEFINED }; + public enum IfcPileTypeEnum { COHESION, FRICTION, SUPPORT, USERDEFINED, NOTDEFINED }; + public enum IfcPipeFittingTypeEnum { BEND, CONNECTOR, ENTRY, EXIT, JUNCTION, OBSTRUCTION, TRANSITION, USERDEFINED, NOTDEFINED }; + public enum IfcPipeSegmentTypeEnum { FLEXIBLESEGMENT, RIGIDSEGMENT, GUTTER, SPOOL, USERDEFINED, NOTDEFINED }; + public enum IfcPlateTypeEnum { CURTAIN_PANEL, SHEET, USERDEFINED, NOTDEFINED }; + public enum IfcProcedureTypeEnum { ADVICE_CAUTION, ADVICE_NOTE, ADVICE_WARNING, CALIBRATION, DIAGNOSTIC, SHUTDOWN, STARTUP, USERDEFINED, NOTDEFINED }; + public enum IfcProfileTypeEnum { CURVE, AREA }; + public enum IfcProjectedOrTrueLengthEnum { PROJECTED_LENGTH, TRUE_LENGTH }; + public enum IfcProjectOrderRecordTypeEnum { CHANGE, MAINTENANCE, MOVE, PURCHASE, WORK, USERDEFINED, NOTDEFINED }; + public enum IfcProjectOrderTypeEnum { CHANGEORDER, MAINTENANCEWORKORDER, MOVEORDER, PURCHASEORDER, WORKORDER, USERDEFINED, NOTDEFINED }; + public enum IfcProjectionElementTypeEnum { USERDEFINED, NOTDEFINED } + public enum IfcPropertySetTemplateTypeEnum { PSET_TYPEDRIVENONLY, PSET_TYPEDRIVENOVERRIDE, PSET_OCCURRENCEDRIVEN, PSET_PERFORMANCEDRIVEN, QTO_TYPEDRIVENONLY, QTO_TYPEDRIVENOVERRIDE, QTO_OCCURRENCEDRIVEN, NOTDEFINED }; + public enum IfcPropertySourceEnum { DESIGN, DESIGNMAXIMUM, DESIGNMINIMUM, SIMULATED, ASBUILT, COMMISSIONING, MEASURED, USERDEFINED, NOTKNOWN }; + public enum IfcProtectiveDeviceTrippingUnitTypeEnum { ELECTRONIC, ELECTROMAGNETIC, RESIDUALCURRENT, THERMAL, USERDEFINED, NOTDEFINED }; + public enum IfcProtectiveDeviceTypeEnum { FUSEDISCONNECTOR, CIRCUITBREAKER, EARTHFAILUREDEVICE, RESIDUALCURRENTCIRCUITBREAKER, RESIDUALCURRENTSWITCH, VARISTOR, USERDEFINED, NOTDEFINED }; + public enum IfcPumpTypeEnum { CIRCULATOR, ENDSUCTION, SPLITCASE, VERTICALINLINE, VERTICALTURBINE, USERDEFINED, NOTDEFINED }; + public enum IfcRailingTypeEnum { HANDRAIL, GUARDRAIL, BALUSTRADE, USERDEFINED, NOTDEFINED }; + public enum IfcRampFlightTypeEnum { STRAIGHT, SPIRAL, USERDEFINED, NOTDEFINED }; + public enum IfcRampTypeEnum { STRAIGHT_RUN_RAMP, TWO_STRAIGHT_RUN_RAMP, QUARTER_TURN_RAMP, TWO_QUARTER_TURN_RAMP, HALF_TURN_RAMP, SPIRAL_RAMP, USERDEFINED, NOTDEFINED }; + public enum IfcRecurrenceTypeEnum { DAILY, WEEKLY, MONTHLY_BY_DAY_OF_MONTH, MONTHLY_BY_POSITION, BY_DAY_COUNT, BY_WEEKDAY_COUNT, YEARLY_BY_DAY_OF_MONTH, YEARLY_BY_POSITION }; + public enum IfcReflectanceMethodEnum { BLINN, FLAT, GLASS, MATT, METAL, MIRROR, PHONG, PLASTIC, STRAUSS, NOTDEFINED }; + public enum IfcReinforcingBarSurfaceEnum { PLAIN, TEXTURED, NONE }; + public enum IfcReinforcingBarRoleEnum { MAIN, SHEAR, LIGATURE, STUD, PUNCHING, EDGE, RING, ANCHORING, USERDEFINED, NOTDEFINED }; + public enum IfcReinforcingBarTypeEnum { MAIN, SHEAR, LIGATURE, STUD, PUNCHING, EDGE, RING, ANCHORING, USERDEFINED, NOTDEFINED }; + public enum IfcReinforcingMeshTypeEnum { USERDEFINED, NOTDEFINED }; + public enum IfcResourceConsumptionEnum { CONSUMED, PARTIALLYCONSUMED, NOTCONSUMED, OCCUPIED, PARTIALLYOCCUPIED, NOTOCCUPIED, USERDEFINED, NOTDEFINED }; + public enum IfcRibPlateDirectionEnum { DIRECTION_X, DIRECTION_Y }; + public enum IfcRoleEnum { SUPPLIER, MANUFACTURER, CONTRACTOR, SUBCONTRACTOR, ARCHITECT, STRUCTURALENGINEER, COSTENGINEER, CLIENT, BUILDINGOWNER, BUILDINGOPERATOR, MECHANICALENGINEER, ELECTRICALENGINEER, PROJECTMANAGER, FACILITIESMANAGER, CIVILENGINEER, COMMISSIONINGENGINEER, ENGINEER, OWNER, CONSULTANT, CONSTRUCTIONMANAGER, FIELDCONSTRUCTIONMANAGER, RESELLER, USERDEFINED, NOTDEFINED }; + public enum IfcRoofTypeEnum { FLAT_ROOF, SHED_ROOF, GABLE_ROOF, HIP_ROOF, HIPPED_GABLE_ROOF, GAMBREL_ROOF, MANSARD_ROOF, BARREL_ROOF, RAINBOW_ROOF, BUTTERFLY_ROOF, PAVILION_ROOF, DOME_ROOF, FREEFORM, NOTDEFINED, USERDEFINED }; + public enum IfcSanitaryTerminalTypeEnum { BATH, BIDET, CISTERN, SHOWER, SINK, SANITARYFOUNTAIN, TOILETPAN, URINAL, WASHHANDBASIN, WCSEAT, USERDEFINED, NOTDEFINED }; + public enum IfcSectionTypeEnum { UNIFORM, TAPERED }; + public enum IfcSensorTypeEnum { CO2SENSOR, FIRESENSOR, FLOWSENSOR, GASSENSOR, HEATSENSOR, HUMIDITYSENSOR, LIGHTSENSOR, MOISTURESENSOR, MOVEMENTSENSOR, PRESSURESENSOR, SMOKESENSOR, SOUNDSENSOR, TEMPERATURESENSOR, USERDEFINED, NOTDEFINED }; + public enum IfcSequenceEnum { START_START, START_FINISH, FINISH_START, FINISH_FINISH, USERDEFINED, NOTDEFINED }; + public enum IfcServiceLifeTypeEnum { ACTUALSERVICELIFE, EXPECTEDSERVICELIFE, OPTIMISTICREFERENCESERVICELIFE, PESSIMISTICREFERENCESERVICELIFE, REFERENCESERVICELIFE }; + public enum IfcServiceLifeFactorTypeEnum { A_QUALITYOFCOMPONENTS, B_DESIGNLEVEL, C_WORKEXECUTIONLEVEL, D_INDOORENVIRONMENT, E_OUTDOORENVIRONMENT, F_INUSECONDITIONS, G_MAINTENANCELEVEL, USERDEFINED, NOTDEFINED }; + public enum IfcShadingDeviceTypeEnum { JALOUSIE, SHUTTER, AWNING, USERDEFINED, NOTDEFINED }; + public enum IfcSIUnitName { AMPERE, BECQUEREL, CANDELA, COULOMB, CUBIC_METRE, DEGREE_CELSIUS, FARAD, GRAM, GRAY, HENRY, HERTZ, JOULE, KELVIN, LUMEN, LUX, METRE, MOLE, NEWTON, OHM, PASCAL, RADIAN, SECOND, SIEMENS, SIEVERT, SQUARE_METRE, STERADIAN, TESLA, VOLT, WATT, WEBER }; + public enum IfcSIPrefix { EXA, PETA, TERA, GIGA, MEGA, KILO, HECTO, DECA, DECI, CENTI, MILLI, MICRO, NANO, PICO, FEMTO, ATTO, NONE }; + public enum IfcSlabTypeEnum { FLOOR, ROOF, LANDING, BASESLAB, USERDEFINED, NOTDEFINED }; + public enum IfcSolarDeviceTypeEnum { SOLARCOLLECTOR, SOLARPANEL, USERDEFINED, NOTDEFINED }; + public enum IfcSoundScaleEnum { DBA, DBB, DBC, NC, NR, USERDEFINED, NOTDEFINED }; + public enum IfcSpaceHeaterTypeEnum { SECTIONALRADIATOR, PANELRADIATOR, TUBULARRADIATOR, CONVECTOR, BASEBOARDHEATER, FINNEDTUBEUNIT, UNITHEATER, USERDEFINED, NOTDEFINED }; + public enum IfcSpaceTypeEnum { SPACE, PARKING, GFA, INTERNAL, EXTERNAL, USERDEFINED, NOTDEFINED }; + public enum IfcSpatialZoneTypeEnum { CONSTRUCTION, FIRESAFETY, LIGHTING, OCCUPANCY, SECURITY, THERMAL, VENTILATION, USERDEFINED, NOTDEFINED }; + public enum IfcStairTypeEnum { STRAIGHT_RUN_STAIR, TWO_STRAIGHT_RUN_STAIR, QUARTER_WINDING_STAIR, QUARTER_TURN_STAIR, HALF_WINDING_STAIR, HALF_TURN_STAIR, TWO_QUARTER_WINDING_STAIR, TWO_QUARTER_TURN_STAIR, THREE_QUARTER_WINDING_STAIR, THREE_QUARTER_TURN_STAIR, SPIRAL_STAIR, DOUBLE_RETURN_STAIR, CURVED_RUN_STAIR, TWO_CURVED_RUN_STAIR, USERDEFINED, NOTDEFINED }; + public enum IfcStackTerminalTypeEnum { BIRDCAGE, COWL, RAINWATERHOPPER, USERDEFINED, NOTDEFINED }; + public enum IfcStairFlightTypeEnum { STRAIGHT, WINDER, SPIRAL, CURVED, FREEFORM, USERDEFINED, NOTDEFINED }; + public enum IfcStateEnum { READWRITE, READONLY, LOCKED, READWRITELOCKED, READONLYLOCKED, NA }; + public enum IfcStatusEnum { NEW, EXISTING, DEMOLISH, TEMPORARY, OTHER, NOTKNOWN, UNSET }; + public enum IfcStructuralCurveActivityTypeEnum {CONST, LINEAR, POLYGONAL, EQUIDISTANT, SINUS, PARABOLA, DISCRETE, USERDEFINED, NOTDEFINED} + public enum IfcStructuralCurveTypeEnum { RIGID_JOINED_MEMBER, PIN_JOINED_MEMBER, CABLE, TENSION_MEMBER, COMPRESSION_MEMBER, USERDEFINED, NOTDEFINED }; + public enum IfcStructuralSurfaceActivityTypeEnum {CONST, BILINEAR, DISCRETE, ISOCONTOUR, USERDEFINED, NOTDEFINED} + public enum IfcStructuralSurfaceTypeEnum { BENDING_ELEMENT, MEMBRANE_ELEMENT, SHELL, USERDEFINED, NOTDEFINED }; + public enum IfcSubContractResourceTypeEnum { PURCHASE, WORK, USERDEFINED, NOTDEFINED }; + public enum IfcSurfaceSide { POSITIVE, NEGATIVE, BOTH }; + public enum IfcSurfaceTextureEnum { BUMP, OPACITY, REFLECTION, SELFILLUMINATION, SHININESS, SPECULAR, TEXTURE, TRANSPARENCYMAP, NOTDEFINED }; + public enum IfcSwitchingDeviceTypeEnum { CONTACTOR, EMERGENCYSTOP, STARTER, SWITCHDISCONNECTOR, TOGGLESWITCH, USERDEFINED, NOTDEFINED }; + public enum IfcSystemFurnitureElementTypeEnum { PANEL, WORKSURFACE, USERDEFINED, NOTDEFINED }; + public enum IfcTankTypeEnum { EXPANSION, PRESSUREVESSEL, USERDEFINED, NOTDEFINED, PREFORMED, SECTIONAL, }; //IFC4 DELETED + public enum IfcTaskTypeEnum { ATTENDANCE, CONSTRUCTION, DEMOLITION, DISMANTLE, DISPOSAL, INSTALLATION, LOGISTIC, MAINTENANCE, MOVE, OPERATION, REMOVAL, RENOVATION, USERDEFINED, NOTDEFINED }; //IFC4 + public enum IfcTaskDurationEnum { ELAPSEDTIME, WORKTIME, NOTDEFINED }; + public enum IfcTendonTypeEnum { STRAND, WIRE, BAR, COATED, USERDEFINED, NOTDEFINED }; + public enum IfcTendonAnchorTypeEnum { COUPLER, FIXED_END, TENSIONING_END, USERDEFINED, NOTDEFINED }; + public enum IfcTextPath { LEFT, RIGHT, UP, DOWN }; + public enum IfcThermalLoadSourceEnum { PEOPLE, LIGHTING, EQUIPMENT, VENTILATIONINDOORAIR, VENTILATIONOUTSIDEAIR, RECIRCULATEDAIR, EXHAUSTAIR, AIREXCHANGERATE, DRYBULBTEMPERATURE, RELATIVEHUMIDITY, INFILTRATION, USERDEFINED, NOTDEFINED }; + public enum IfcThermalLoadTypeEnum { SENSIBLE, LATENT, RADIANT, NOTDEFINED }; + public enum IfcTimeSeriesDataTypeEnum { CONTINUOUS, DISCRETE, DISCRETEBINARY, PIECEWISEBINARY, PIECEWISECONSTANT, PIECEWISECONTINUOUS, NOTDEFINED }; + public enum IfcTimeSeriesScheduleTypeEnum { ANNUAL, MONTHLY, WEEKLY, DAILY, USERDEFINED, NOTDEFINED }; + public enum IfcTransformerTypeEnum { CURRENT, FREQUENCY, VOLTAGE, USERDEFINED, NOTDEFINED }; + public enum IfcTransitionCode { DISCONTINUOUS, CONTINUOUS, CONTSAMEGRADIENT, CONTSAMEGRADIENTSAMECURVATURE }; + public enum IfcTransportElementTypeEnum { ELEVATOR, ESCALATOR, MOVINGWALKWAY, USERDEFINED, NOTDEFINED }; + public enum IfcTrimmingPreference { CARTESIAN, PARAMETER, UNSPECIFIED }; + public enum IfcTubeBundleTypeEnum { FINNED, USERDEFINED, NOTDEFINED }; + public enum IfcUnitaryControlElementTypeEnum { ALARMPANEL, CONTROLPANEL, GASDETECTIONPANEL, INDICATORPANEL, MIMICPANEL, HUMIDISTAT, THERMOSTAT, WEATHERSTATION, USERDEFINED, NOTDEFINED }; + public enum IfcUnitaryEquipmentTypeEnum { AIRHANDLER, AIRCONDITIONINGUNIT, SPLITSYSTEM, ROOFTOPUNIT, USERDEFINED, NOTDEFINED }; + public enum IfcUnitEnum { ABSORBEDDOSEUNIT, AMOUNTOFSUBSTANCEUNIT, AREAUNIT, DOSEEQUIVALENTUNIT, ELECTRICCAPACITANCEUNIT, ELECTRICCHARGEUNIT, ELECTRICCONDUCTANCEUNIT, ELECTRICCURRENTUNIT, ELECTRICRESISTANCEUNIT, ELECTRICVOLTAGEUNIT, ENERGYUNIT, FORCEUNIT, FREQUENCYUNIT, ILLUMINANCEUNIT, INDUCTANCEUNIT, LENGTHUNIT, LUMINOUSFLUXUNIT, LUMINOUSINTENSITYUNIT, MAGNETICFLUXDENSITYUNIT, MAGNETICFLUXUNIT, MASSUNIT, PLANEANGLEUNIT, POWERUNIT, PRESSUREUNIT, RADIOACTIVITYUNIT, SOLIDANGLEUNIT, THERMODYNAMICTEMPERATUREUNIT, TIMEUNIT, VOLUMEUNIT, USERDEFINED }; + public enum IfcValveTypeEnum { AIRRELEASE, ANTIVACUUM, CHANGEOVER, CHECK, COMMISSIONING, DIVERTING, DRAWOFFCOCK, DOUBLECHECK, DOUBLEREGULATING, FAUCET, FLUSHING, GASCOCK, GASTAP, ISOLATING, MIXING, PRESSUREREDUCING, PRESSURERELIEF, REGULATING, SAFETYCUTOFF, STEAMTRAP, STOPCOCK, USERDEFINED, NOTDEFINED }; + public enum IfcVibrationIsolatorTypeEnum { COMPRESSION, SPRING, USERDEFINED, NOTDEFINED }; + public enum IfcVoidingFeatureTypeEnum { CUTOUT, NOTCH, HOLE, MITER, CHAMFER, EDGE, USERDEFINED, NOTDEFINED }; + public enum IfcWallTypeEnum { STANDARD, ELEMENTEDWALL, MOVABLE, PARAPET, PARTITIONING, PLUMBINGWALL, POLYGONAL, SHEAR, SOLIDWALL, USERDEFINED, NOTDEFINED }; //IFC4 change STANDARD, POLYGONAL, ELEMENTEDWALL + public enum IfcWasteTerminalTypeEnum { FLOORTRAP, FLOORWASTE, GULLYSUMP, GULLYTRAP, ROOFDRAIN, WASTEDISPOSALUNIT, WASTETRAP, USERDEFINED, NOTDEFINED }; // IFC4 GREASEINTERCEPTOR, OILINTERCEPTOR, PETROLINTERCEPTOR + public enum IfcWindowPanelOperationEnum { SIDEHUNGRIGHTHAND, SIDEHUNGLEFTHAND, TILTANDTURNRIGHTHAND, TILTANDTURNLEFTHAND, TOPHUNG, BOTTOMHUNG, PIVOTHORIZONTAL, PIVOTVERTICAL, SLIDINGHORIZONTAL, SLIDINGVERTICAL, REMOVABLECASEMENT, FIXEDCASEMENT, OTHEROPERATION, NOTDEFINED }; + public enum IfcWindowPanelPositionEnum { LEFT, MIDDLE, RIGHT, BOTTOM, TOP, NOTDEFINED }; + public enum IfcWindowStyleConstructionEnum { ALUMINIUM, HIGH_GRADE_STEEL, STEEL, WOOD, ALUMINIUM_WOOD, PLASTIC, OTHER_CONSTRUCTION, NOTDEFINED }; + public enum IfcWindowStyleOperationEnum { SINGLE_PANEL, DOUBLE_PANEL_VERTICAL, DOUBLE_PANEL_HORIZONTAL, TRIPLE_PANEL_VERTICAL, TRIPLE_PANEL_BOTTOM, TRIPLE_PANEL_TOP, TRIPLE_PANEL_LEFT, TRIPLE_PANEL_RIGHT, TRIPLE_PANEL_HORIZONTAL, USERDEFINED, NOTDEFINED }; + public enum IfcWindowTypeEnum { WINDOW, SKYLIGHT, LIGHTDOME, USERDEFINED, NOTDEFINED }; + public enum IfcWindowTypePartitioningEnum { SINGLE_PANEL, DOUBLE_PANEL_VERTICAL, DOUBLE_PANEL_HORIZONTAL, TRIPLE_PANEL_VERTICAL, TRIPLE_PANEL_BOTTOM, TRIPLE_PANEL_TOP, TRIPLE_PANEL_LEFT, TRIPLE_PANEL_RIGHT, TRIPLE_PANEL_HORIZONTAL, USERDEFINED, NOTDEFINED }; + public enum IfcWorkCalendarTypeEnum { FIRSTSHIFT, SECONDSHIFT, THIRDSHIFT, USERDEFINED, NOTDEFINED }; + public enum IfcWorkControlTypeEnum { ACTUAL, BASELINE, PLANNED, USERDEFINED, NOTDEFINED }; + public enum IfcWorkPlanTypeEnum { ACTUAL, BASELINE, PLANNED, USERDEFINED, NOTDEFINED }; + public enum IfcWorkScheduleTypeEnum { ACTUAL, BASELINE, PLANNED, USERDEFINED, NOTDEFINED }; + + public enum PEnum_DuctConnectionType { BEADEDSLEEVE, COMPRESSION, CRIMP, DRAWBAND, DRIVESLIP, FLANGED, OUTSIDESLEEVE, SLIPON, SOLDERED, SSLIP, STANDINGSEAM, SWEDGE, WELDED, OTHER, NONE, USERDEFINED, NOTDEFINED } + +} diff --git a/IFC/IFC A.cs b/IFC/IFC A.cs new file mode 100644 index 0000000..4f3fb82 --- /dev/null +++ b/IFC/IFC A.cs @@ -0,0 +1,1075 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + + +namespace GeometryGym.Ifc +{ + public class IfcActionRequest : IfcControl + { + //internal string mRequestID;// : IfcIdentifier; IFC4 relocated + internal IfcActionRequest(IfcActionRequest i) : base(i) { } + internal IfcActionRequest() : base() { } + internal static IfcActionRequest Parse(string strDef,Schema schema) { IfcActionRequest r = new IfcActionRequest(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcActionRequest r,List arrFields, ref int ipos,Schema schema) + { + IfcControl.parseFields(r,arrFields, ref ipos,schema); + if(schema == Schema.IFC2x3) + r.mIdentification = arrFields[ipos++].Replace("'",""); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? ",'" + mIdentification + "'" : ""); } + } + public class IfcActor : IfcObject // SUPERTYPE OF(IfcOccupant) + { + internal int mTheActor;// : IfcActorSelect; + //INVERSE + internal List mIsActingUpon = new List();// : SET [0:?] OF IfcRelAssignsToActor FOR RelatingActor; + + internal IfcActor(IfcActor o) : base(o) { } + internal IfcActor() : base() { } + internal IfcActor(IfcActorSelect a) : base(a.Database) + { + if(mDatabase.mModelView != ModelView.If2x3NotAssigned && mDatabase.mModelView != ModelView.Ifc4NotAssigned ) + throw new Exception("Invalid Model View for IfcActor : " + mDatabase.ModelView.ToString()); + mTheActor = a.Index; + } + internal static IfcActor Parse(string strDef) { IfcActor a = new IfcActor(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcActor a, List arrFields, ref int ipos) { IfcObject.parseFields(a, arrFields, ref ipos); a.mTheActor = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mTheActor); } + } + public partial class IfcActorRole : BaseClassIfc, IfcResourceObjectSelect + { + internal IfcRoleEnum mRole = IfcRoleEnum.NOTDEFINED;// : OPTIONAL IfcRoleEnum + internal string mUserDefinedRole = "$";// : OPTIONAL IfcLabel + internal string mDescription = "$";// : OPTIONAL IfcText; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public IfcRoleEnum Role { get { return mRole; } set { mRole = value; } } + public string UserDefinedRole { get { return (mUserDefinedRole == "$" ? "" : ParserIfc.Decode(mUserDefinedRole)); } set { mUserDefinedRole = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + internal IfcActorRole() : base() { } + internal IfcActorRole(IfcActorRole o) : base() { mRole = o.mRole; mDescription = o.mDescription; mUserDefinedRole = o.mUserDefinedRole; } + + internal static void parseFields(IfcActorRole a,List arrFields, ref int ipos) + { + string str = arrFields[ipos++]; + if (str != "$") + a.mRole = (string.Compare(str, "COMISSIONINGENGINEER", true) == 0 ? IfcRoleEnum.COMMISSIONINGENGINEER : (IfcRoleEnum)Enum.Parse(typeof(IfcRoleEnum), str.Replace(".", ""))); + a.mUserDefinedRole = arrFields[ipos++].Replace("'",""); + a.mDescription = arrFields[ipos++].Replace("'",""); + } + internal static IfcActorRole Parse(string strDef) { IfcActorRole a = new IfcActorRole(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + protected override string BuildString() { return base.BuildString() + ",." + (mDatabase.mSchema == Schema.IFC2x3 && mRole == IfcRoleEnum.COMMISSIONINGENGINEER ? "COMISSIONINGENGINEER" : mRole.ToString()) + (mUserDefinedRole == "$" ? ".,$," : ".,'" + mUserDefinedRole + "',") + (mDescription == "$" ? "$" : "'" + mDescription + "'") ; } + } + public interface IfcActorSelect : IfcInterface { }// IfcOrganization, IfcPerson, IfcPersonAndOrganization); + public partial class IfcActuator : IfcDistributionControlElement //IFC4 + { + public override string KeyWord { get { return mDatabase.mSchema == Schema.IFC2x3 ? base.KeyWord : "IFCACTUATOR"; } } + + internal IfcActuatorTypeEnum mPredefinedType = IfcActuatorTypeEnum.NOTDEFINED; + public IfcActuatorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcActuator() : base() { } + internal IfcActuator(IfcActuator a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcActuator(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement,representation, system) { } + + internal static void parseFields(IfcActuator a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcActuatorTypeEnum)Enum.Parse(typeof(IfcActuatorTypeEnum), s.Replace(".", "")); + } + internal new static IfcActuator Parse(string strDef) { IfcActuator d = new IfcActuator(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcActuatorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public partial class IfcActuatorType : IfcDistributionControlElementType + { + internal IfcActuatorTypeEnum mPredefinedType = IfcActuatorTypeEnum.NOTDEFINED;// : IfcActuatorTypeEnum; + public IfcActuatorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcActuatorType() : base() { } + internal IfcActuatorType(IfcActuatorType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcActuatorType(DatabaseIfc m, string name, IfcActuatorTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcActuatorType t,List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcActuatorTypeEnum)Enum.Parse(typeof(IfcActuatorTypeEnum),arrFields[ipos++].Replace(".","")); } + internal new static IfcActuatorType Parse(string strDef) { IfcActuatorType t = new IfcActuatorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcAddress : BaseClassIfc //ABSTRACT SUPERTYPE OF(ONEOF(IfcPostalAddress, IfcTelecomAddress)); + { + internal IfcAddressTypeEnum mPurpose = IfcAddressTypeEnum.NOTDEFINED;// : OPTIONAL IfcAddressTypeEnum + internal string mDescription = "$";// : OPTIONAL IfcText; + internal string mUserDefinedPurpose = "$";// : OPTIONAL IfcLabel + + public IfcAddressTypeEnum Purpose { get { return mPurpose; } set { mPurpose = value; } } + public string Description { get { return mDescription == "$" ? "" : ParserIfc.Decode(mDescription); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string UserDefinedPurpose { get { return mUserDefinedPurpose == "$" ? "" : ParserIfc.Decode(mUserDefinedPurpose); } set { mUserDefinedPurpose = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcAddress() : base() { } + protected IfcAddress(IfcAddress o) : base() + { + mPurpose = o.mPurpose; + mDescription = o.mDescription; + mUserDefinedPurpose = o.mUserDefinedPurpose; + } + protected IfcAddress(DatabaseIfc m, IfcAddressTypeEnum purpose) : base(m) { mPurpose = purpose; } + internal static void parseFields(IfcAddress a, List arrFields, ref int ipos) + { + string str = arrFields[ipos++]; + if (str != "$") + a.mPurpose = (IfcAddressTypeEnum)Enum.Parse(typeof(IfcAddressTypeEnum), str.Replace(".", "")); + a.mDescription = arrFields[ipos++].Replace("'", ""); + a.mUserDefinedPurpose = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + (mPurpose == IfcAddressTypeEnum.NOTDEFINED ? ",$," : ",." + mPurpose.ToString() + ".,") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + (mUserDefinedPurpose == "$" ? "$" : "'" + mUserDefinedPurpose + "'"); } + } + public partial class IfcAdvancedBrep : IfcManifoldSolidBrep // IFC4 + { + internal IfcAdvancedBrep() : base() { } + internal IfcAdvancedBrep(IfcAdvancedBrep p) : base(p) { } + public IfcAdvancedBrep(List faces) : base(new IfcClosedShell(faces.ConvertAll(x => (IfcFace)x))) { } + internal IfcAdvancedBrep(IfcClosedShell s) : base(s) { } + + internal static IfcAdvancedBrep Parse(string strDef) { IfcAdvancedBrep b = new IfcAdvancedBrep(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcAdvancedBrep b, List arrFields, ref int ipos) { IfcManifoldSolidBrep.parseFields(b, arrFields, ref ipos); } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString()); } + } + public partial class IfcAdvancedBrepWithVoids : IfcAdvancedBrep + { + private List mVoids = new List();// : SET [1:?] OF IfcClosedShell + + internal List Voids { get { return mVoids.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcClosedShell); } } + internal IfcAdvancedBrepWithVoids() : base() { } + internal IfcAdvancedBrepWithVoids(IfcAdvancedBrepWithVoids p) : base((IfcAdvancedBrep)p) { mVoids = new List(p.mVoids.ToArray()); } + + internal new static IfcAdvancedBrepWithVoids Parse(string strDef) { IfcAdvancedBrepWithVoids b = new IfcAdvancedBrepWithVoids(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcAdvancedBrepWithVoids b, List arrFields, ref int ipos) { IfcAdvancedBrep.parseFields(b, arrFields, ref ipos); b.mVoids = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mVoids.Count > 0) + { + str += ParserSTEP.LinkToString(mVoids[0]); + for (int icounter = 1; icounter < mVoids.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mVoids[icounter]); + } + return str + ")"; + } + } + public partial class IfcAdvancedFace : IfcFaceSurface + { + internal IfcAdvancedFace() : base() { } + internal IfcAdvancedFace(IfcAdvancedFace i) : base(i) { } + public IfcAdvancedFace(IfcFaceOuterBound bound, IfcSurface f, bool sense) : base(bound, f, sense) { } + public IfcAdvancedFace(List bounds, IfcSurface f, bool sense) : base(bounds, f, sense) { } + public IfcAdvancedFace(IfcFaceOuterBound outer, IfcFaceBound inner, IfcSurface f, bool sense) : base(outer,inner, f, sense) { } + internal new static IfcAdvancedFace Parse(string strDef) { IfcAdvancedFace f = new IfcAdvancedFace(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcAdvancedFace f, List arrFields, ref int ipos) { IfcFaceSurface.parseFields(f, arrFields, ref ipos); } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString()); } + } + public class IfcAirTerminal : IfcFlowTerminal //IFC4 + { + internal IfcAirTerminalTypeEnum mPredefinedType = IfcAirTerminalTypeEnum.NOTDEFINED;// OPTIONAL : IfcAirTerminalTypeEnum; + public IfcAirTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAirTerminal() : base() { } + internal IfcAirTerminal(IfcAirTerminal t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcAirTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcAirTerminal s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcAirTerminalTypeEnum)Enum.Parse(typeof(IfcAirTerminalTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcAirTerminal Parse(string strDef) { IfcAirTerminal s = new IfcAirTerminal(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcAirTerminalTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + + } + public class IfcAirTerminalBox : IfcFlowController //IFC4 + { + internal IfcAirTerminalBoxTypeEnum mPredefinedType = IfcAirTerminalBoxTypeEnum.NOTDEFINED;// OPTIONAL : IfcAirTerminalBoxTypeEnum; + public IfcAirTerminalBoxTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAirTerminalBox() : base() { } + internal IfcAirTerminalBox(IfcAirTerminalBox b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcAirTerminalBox(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcAirTerminalBox s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcAirTerminalBoxTypeEnum)Enum.Parse(typeof(IfcAirTerminalBoxTypeEnum), str); + } + internal new static IfcAirTerminalBox Parse(string strDef) { IfcAirTerminalBox s = new IfcAirTerminalBox(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcAirTerminalBoxTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcAirTerminalBoxType : IfcFlowControllerType + { + internal IfcAirTerminalBoxTypeEnum mPredefinedType = IfcAirTerminalBoxTypeEnum.NOTDEFINED;// : IfcAirTerminalBoxTypeEnum; + public IfcAirTerminalBoxTypeEnum PredefinedType { get { return mPredefinedType;} set { mPredefinedType = value; } } + + internal IfcAirTerminalBoxType() : base() { } + internal IfcAirTerminalBoxType(IfcAirTerminalBoxType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcAirTerminalBoxType(DatabaseIfc m, string name, IfcAirTerminalBoxTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcAirTerminalBoxType t,List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcAirTerminalBoxTypeEnum)Enum.Parse(typeof(IfcAirTerminalBoxTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcAirTerminalBoxType Parse(string strDef) { IfcAirTerminalBoxType t = new IfcAirTerminalBoxType(); int ipos = 0; parseFields(t,ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcAirTerminalType : IfcFlowTerminalType + { + internal IfcAirTerminalTypeEnum mPredefinedType = IfcAirTerminalTypeEnum.NOTDEFINED;// : IfcAirTerminalBoxTypeEnum; + public IfcAirTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAirTerminalType(IfcAirTerminalType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcAirTerminalType() : base() { } + public IfcAirTerminalType(DatabaseIfc m, string name, IfcAirTerminalTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcAirTerminalType t,List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcAirTerminalTypeEnum)Enum.Parse(typeof(IfcAirTerminalTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcAirTerminalType Parse(string strDef) { IfcAirTerminalType t = new IfcAirTerminalType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcAirToAirHeatRecovery : IfcEnergyConversionDevice //IFC4 + { + internal IfcAirToAirHeatRecoveryTypeEnum mPredefinedType = IfcAirToAirHeatRecoveryTypeEnum.NOTDEFINED; + public IfcAirToAirHeatRecoveryTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAirToAirHeatRecovery() : base() { } + internal IfcAirToAirHeatRecovery(IfcAirToAirHeatRecovery a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcAirToAirHeatRecovery(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcAirToAirHeatRecovery a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcAirToAirHeatRecoveryTypeEnum)Enum.Parse(typeof(IfcAirToAirHeatRecoveryTypeEnum), s.Replace(".", "")); + } + internal new static IfcAirToAirHeatRecovery Parse(string strDef) { IfcAirToAirHeatRecovery d = new IfcAirToAirHeatRecovery(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mPredefinedType == IfcAirToAirHeatRecoveryTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + "."); + } + } + public class IfcAirToAirHeatRecoveryType : IfcEnergyConversionDeviceType + { + internal IfcAirToAirHeatRecoveryTypeEnum mPredefinedType = IfcAirToAirHeatRecoveryTypeEnum.NOTDEFINED;// : IfcAirToAirHeatRecoveryTypeEnum; + public IfcAirToAirHeatRecoveryTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAirToAirHeatRecoveryType(IfcAirToAirHeatRecoveryType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal IfcAirToAirHeatRecoveryType() : base() { } + internal IfcAirToAirHeatRecoveryType(DatabaseIfc m, string name, IfcAirToAirHeatRecoveryTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcAirToAirHeatRecoveryType t,List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcAirToAirHeatRecoveryTypeEnum)Enum.Parse(typeof(IfcAirToAirHeatRecoveryTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcAirToAirHeatRecoveryType Parse(string strDef) { IfcAirToAirHeatRecoveryType t = new IfcAirToAirHeatRecoveryType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcAlarm : IfcDistributionControlElement //IFC4 + { + internal IfcAlarmTypeEnum mPredefinedType = IfcAlarmTypeEnum.NOTDEFINED; + internal IfcAlarmTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAlarm() : base() { } + internal IfcAlarm(IfcAlarm a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcAlarm(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcAlarm a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcAlarmTypeEnum)Enum.Parse(typeof(IfcAlarmTypeEnum), s.Replace(".", "")); + } + internal new static IfcAlarm Parse(string strDef) { IfcAlarm a = new IfcAlarm(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcAlarmTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcAlarmType : IfcDistributionControlElementType + { + internal IfcAlarmTypeEnum mPredefinedType = IfcAlarmTypeEnum.NOTDEFINED;// : IfcAlarmTypeEnum; + public IfcAlarmTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcAlarmType(IfcAlarmType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcAlarmType() : base() { } + internal IfcAlarmType(DatabaseIfc m, string name, IfcAlarmTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcAlarmType t,List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcAlarmTypeEnum)Enum.Parse(typeof(IfcAlarmTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcAlarmType Parse(string strDef) { IfcAlarmType t = new IfcAlarmType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcAlignment : IfcPositioningElement //IFC4.1 + { + internal IfcAlignmentTypeEnum mPredefinedType;// : OPTIONAL IfcAlignmentTypeEnum; + public IfcAlignmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal int mHorizontal = 0;// : OPTIONAL IfcAlignment2DHorizontal; + internal int mVertical = 0;// : OPTIONAL IfcAlignment2DVertical; + internal string mLinearRefMethod = "$";// : OPTIONAL IfcLabel; + + internal IfcAlignment() : base() { } + internal IfcAlignment(IfcAlignment a) : base(a) { mPredefinedType = a.mPredefinedType; mLinearRefMethod = a.mLinearRefMethod; } + internal static void parseFields(IfcAlignment a, List arrFields, ref int ipos) + { + IfcPositioningElement.parseFields(a, arrFields, ref ipos); + string str = arrFields[ipos++]; + if(str != "$") + a.mPredefinedType = (IfcAlignmentTypeEnum)Enum.Parse(typeof(IfcAlignmentTypeEnum), str.Replace(".", "")); + a.mHorizontal = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mVertical = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mLinearRefMethod = arrFields[ipos++].Replace("'", ""); + } + internal static IfcAlignment Parse(string strDef) { IfcAlignment a = new IfcAlignment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + protected override string BuildString() + { + return base.BuildString() + (mPredefinedType== IfcAlignmentTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType.ToString() + ".,") + + ParserSTEP.LinkToString(mHorizontal) + "," + ParserSTEP.LinkToString(mVertical) + "," + ( mLinearRefMethod == "$" ? "$" : "'" + mLinearRefMethod + "'"); + } + } + public partial class IfcAlignment2DHorizontal : BaseClassIfc //IFC4.1 + { + internal double mStartDistAlong;// : OPTIONAL IfcLengthMeasure; + internal List mSegments = new List();// : LIST [1:?] OF IfcAlignment2DHorizontalSegment; + + internal IfcAlignment2DHorizontal() : base() { } + internal IfcAlignment2DHorizontal(IfcAlignment2DHorizontal a) : base() { mStartDistAlong = a.mStartDistAlong; mSegments = new List(a.mSegments.ToArray()); } + internal static void parseFields(IfcAlignment2DHorizontal a, List arrFields, ref int ipos) + { + a.mStartDistAlong = ParserSTEP.ParseDouble(arrFields[ipos++]); + a.mSegments = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mStartDistAlong) + "," + ParserSTEP.LinkToString(mSegments[0]); + for (int icounter = 1; icounter < mSegments.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mSegments[icounter]); + return str + ")"; + } + internal static IfcAlignment2DHorizontal Parse(string strDef) { IfcAlignment2DHorizontal a = new IfcAlignment2DHorizontal(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + } + public partial class IfcAlignment2DHorizontalSegment : IfcAlignment2DSegment //IFC4.1 + { + internal int mCurveGeometry;// : IfcCurveSegment2D; + + public IfcCurveSegment2D CurveGeometry { get { return mDatabase.mIfcObjects[mCurveGeometry] as IfcCurveSegment2D; } } + + internal IfcAlignment2DHorizontalSegment() : base() { } + internal IfcAlignment2DHorizontalSegment(IfcAlignment2DHorizontalSegment p) : base(p) { mCurveGeometry = p.mCurveGeometry; } + internal IfcAlignment2DHorizontalSegment(bool tangential, string startTag, string endTag, IfcCurveSegment2D seg) : base(seg.mDatabase, tangential, startTag, endTag) { mCurveGeometry = seg.mIndex; } + internal static void parseFields(IfcAlignment2DHorizontalSegment s, List arrFields, ref int ipos) + { + IfcAlignment2DSegment.parseFields(s, arrFields, ref ipos); + s.mCurveGeometry = ParserSTEP.ParseLink(arrFields[ipos++]); + } + internal static IfcAlignment2DHorizontalSegment Parse(string strDef) { IfcAlignment2DHorizontalSegment a = new IfcAlignment2DHorizontalSegment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mCurveGeometry); } + } + public abstract class IfcAlignment2DSegment : BaseClassIfc //IFC4.1 + { + internal IfcLogicalEnum mTangentialContinuity = IfcLogicalEnum.UNKNOWN;// : OPTIONAL IfcBoolean; + private string mStartTag = "$";// : OPTIONAL IfcLabel; + private string mEndTag = "$";// : OPTIONAL IfcLabel; + + public string StartTag { get { return (mStartTag == "$" ? "" : ParserIfc.Decode(mStartTag)); } set { mStartTag = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string EndTag { get { return (mEndTag == "$" ? "" : ParserIfc.Decode(mEndTag)); } set { mEndTag = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcAlignment2DSegment() : base() { } + protected IfcAlignment2DSegment(IfcAlignment2DSegment s) : base() { mTangentialContinuity = s.mTangentialContinuity; mStartTag = s.mStartTag; mEndTag = s.mEndTag; } + protected IfcAlignment2DSegment(DatabaseIfc m, bool tangential, string startTag, string endTag) : base(m) { mTangentialContinuity = (tangential ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); StartTag = startTag; EndTag = endTag; } + protected static void parseFields(IfcAlignment2DSegment a, List arrFields, ref int ipos) + { + a.mTangentialContinuity = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + a.mStartTag = arrFields[ipos++].Replace("'", ""); + a.mEndTag = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() + { + return base.BuildString() + (mTangentialContinuity == IfcLogicalEnum.UNKNOWN ? ",$," : (mTangentialContinuity == IfcLogicalEnum.TRUE ? ",.T.," : ",.F.")) + + (mStartTag == "$" ? "$," : "'" + mStartTag + "',") + (mEndTag == "$" ? "$" : "'" + mEndTag + "'"); + } + } + public partial class IfcAlignment2DVerSegCircularArc : IfcAlignment2DVerticalSegment //IFC4x1 + { + private double mRadius;// : IfcPositiveLengthMeasure; + private bool mIsConvex;// : IfcBoolean; + + internal IfcAlignment2DVerSegCircularArc() : base() { } + internal IfcAlignment2DVerSegCircularArc(IfcAlignment2DVerSegCircularArc p) : base(p) { mRadius = p.mRadius; mIsConvex = p.mIsConvex; } + internal IfcAlignment2DVerSegCircularArc(DatabaseIfc m, bool tangential, string startTag, string endTag, double startDist, double horizontalLength, double startHeight, double startGradient, double radius, bool isCCW) + : base(m, tangential, startTag, endTag, startDist, horizontalLength, startHeight, startGradient) + { + mRadius = radius; + mIsConvex = isCCW; + } + internal static void parseFields(IfcAlignment2DVerSegCircularArc c, List arrFields, ref int ipos) + { + IfcAlignment2DVerticalSegment.parseFields(c, arrFields, ref ipos); + c.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mIsConvex = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcAlignment2DVerSegCircularArc Parse(string strDef) { IfcAlignment2DVerSegCircularArc c = new IfcAlignment2DVerSegCircularArc(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mRadius) + "," + ParserSTEP.BoolToString(mIsConvex); } + + } + public partial class IfcAlignment2DVerSegLine : IfcAlignment2DVerticalSegment //IFC4x1 + { + internal IfcAlignment2DVerSegLine() : base() { } + internal IfcAlignment2DVerSegLine(IfcAlignment2DVerSegLine s) : base(s) { } + internal IfcAlignment2DVerSegLine(DatabaseIfc m, bool tangential, string startTag, string endTag, double startDist, double horizontalLength, double startHeight, double startGradient) + : base(m, tangential, startTag, endTag, startDist, horizontalLength, startHeight, startGradient) { } + internal static void parseFields(IfcAlignment2DVerSegLine c, List arrFields, ref int ipos) { IfcAlignment2DVerticalSegment.parseFields(c, arrFields, ref ipos); } + internal static IfcAlignment2DVerSegLine Parse(string strDef) { IfcAlignment2DVerSegLine c = new IfcAlignment2DVerSegLine(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public partial class IfcAlignment2DVerSegParabolicArc : IfcAlignment2DVerticalSegment //IFC4x1 + { + private double mParabolaConstant;// : IfcPositiveLengthMeasure; + private bool mIsConvex;// : IfcBoolean; + + internal IfcAlignment2DVerSegParabolicArc() : base() { } + internal IfcAlignment2DVerSegParabolicArc(IfcAlignment2DVerSegParabolicArc p) : base(p) { mParabolaConstant = p.mParabolaConstant; mIsConvex = p.mIsConvex; } + internal IfcAlignment2DVerSegParabolicArc(DatabaseIfc m, bool tangential, string startTag, string endTag, double startDist, double horizontalLength, double startHeight, double startGradient, double radius, bool isCCW) + : base(m, tangential, startTag, endTag, startDist, horizontalLength, startHeight, startGradient) + { + mParabolaConstant = radius; + mIsConvex = isCCW; + } + internal static void parseFields(IfcAlignment2DVerSegParabolicArc c, List arrFields, ref int ipos) + { + IfcAlignment2DVerticalSegment.parseFields(c, arrFields, ref ipos); + c.mParabolaConstant = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mIsConvex = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcAlignment2DVerSegParabolicArc Parse(string strDef) { IfcAlignment2DVerSegParabolicArc c = new IfcAlignment2DVerSegParabolicArc(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mParabolaConstant) + "," + ParserSTEP.BoolToString(mIsConvex); } + } + public partial class IfcAlignment2DVertical : BaseClassIfc //IFC4.1 + { + internal List mSegments = new List();// : LIST [1:?] OF IfcAlignment2DVerticalSegment; + internal IfcAlignment2DVertical() : base() { } + internal IfcAlignment2DVertical(IfcAlignment2DVertical o) : base() { mSegments = new List(o.mSegments.ToArray()); } + internal static void parseFields(IfcAlignment2DVertical a, List arrFields, ref int ipos) { a.mSegments = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mSegments[0]); + for (int icounter = 1; icounter < mSegments.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mSegments[icounter]); + return str + ")"; + } + internal static IfcAlignment2DVertical Parse(string strDef) { IfcAlignment2DVertical a = new IfcAlignment2DVertical(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + } + public abstract class IfcAlignment2DVerticalSegment : IfcAlignment2DSegment //IFC4.1 + { + internal double mStartDistAlong;// : IfcLengthMeasure; + internal double mHorizontalLength;// : IfcPositiveLengthMeasure; + internal double mStartHeight;// : IfcLengthMeasure; + internal double mStartGradient;// : IfcRatioMeasure; + + protected IfcAlignment2DVerticalSegment() : base() { } + protected IfcAlignment2DVerticalSegment(IfcAlignment2DVerticalSegment s) : base(s) { mStartDistAlong = s.mStartDistAlong; mHorizontalLength = s.mHorizontalLength; mStartHeight = s.mStartHeight; mStartGradient = s.mStartGradient; } + protected IfcAlignment2DVerticalSegment(DatabaseIfc m, bool tangential, string startTag, string endTag, double startDist, double horizontalLength,double startHeight, double startGradient) : base(m, tangential, startTag, endTag) { } + protected static void parseFields(IfcAlignment2DVerticalSegment s, List arrFields, ref int ipos) + { + IfcAlignment2DSegment.parseFields(s, arrFields, ref ipos); + s.mStartDistAlong = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mHorizontalLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mStartHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mStartGradient = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mStartDistAlong) + "," + ParserSTEP.DoubleToString(mHorizontalLength) + "," + ParserSTEP.DoubleToString(mStartHeight) + "," + ParserSTEP.DoubleToString(mStartGradient); } + } + public class IfcAngularDimension : IfcDimensionCurveDirectedCallout //IFC4 depreceated + { + internal IfcAngularDimension(IfcAngularDimension el) : base(el) { } + internal IfcAngularDimension() : base() { } + internal new static IfcAngularDimension Parse(string strDef) { IfcAngularDimension d = new IfcAngularDimension(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcAngularDimension d,List arrFields, ref int ipos) { IfcDimensionCurveDirectedCallout.parseFields(d,arrFields, ref ipos); } + } + public class IfcAnnotation : IfcProduct + { //INVERSE + //internal List mContainedInStructure = new List(); //: SET [0:1] OF IfcRelContainedInSpatialStructure FOR RelatedElements; + internal IfcAnnotation(IfcAnnotation el) : base(el) { } + internal IfcAnnotation() : base() { } + internal IfcAnnotation(IfcProduct host) : base(host) + { + if (mDatabase.mModelView != ModelView.If2x3NotAssigned && mDatabase.mModelView != ModelView.Ifc4NotAssigned) + throw new Exception("Invalid Model View for " + KeyWord + " : " + mDatabase.ModelView.ToString()); + } + internal static IfcAnnotation Parse(string strDef) { int ipos = 0; IfcAnnotation a = new IfcAnnotation(); parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcAnnotation a, List arrFields, ref int ipos) { IfcProduct.parseFields(a,arrFields, ref ipos); } +#if(rRHINO) + internal override bool drawRhino(Transform tr, int layerIndex, List voids, string building, string storey) + { + List vs = voids; + if (vs == null) + vs = new List(); + + for (int icounter = 0; icounter < mHasOpenings.Count; icounter++) + { + List v = ((IfcRelVoidsElement)mModel.mIFCobjs[mHasOpenings[icounter]]).getGeom(); + if (v != null) + vs.AddRange(v); + } + return base.drawRhino(tr, layerIndex, vs, building, storey); + } +#endif + } + public abstract class IfcAnnotationCurveOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated + { + protected IfcAnnotationCurveOccurrence(IfcAnnotationCurveOccurrence p) : base((IfcAnnotationOccurrence)p) { } + protected IfcAnnotationCurveOccurrence() : base() { } + protected static void parseFields(IfcAnnotationCurveOccurrence a,List arrFields, ref int ipos) { IfcAnnotationOccurrence.parseFields(a,arrFields, ref ipos); } + } + public class IfcAnnotationFillArea : IfcGeometricRepresentationItem //IFC4 Depreceated + { + internal int mOuterBoundary;// : IfcCurve; + internal List mInnerBoundaries = new List();// OPTIONAL SET [1:?] OF IfcCurve; + internal IfcAnnotationFillArea(IfcAnnotationFillArea p) : base(p) { mOuterBoundary = p.mOuterBoundary; mInnerBoundaries = new List(p.mInnerBoundaries.ToArray()); } + internal IfcAnnotationFillArea() : base() { } + internal static void parseFields(IfcAnnotationFillArea a, List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(a, arrFields, ref ipos); + a.mOuterBoundary = ParserSTEP.ParseLink(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (str != "$") + a.mInnerBoundaries = ParserSTEP.SplitListLinks(str); + } + internal static IfcAnnotationFillArea Parse(string strDef) { IfcAnnotationFillArea a = new IfcAnnotationFillArea(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mOuterBoundary); + if (mInnerBoundaries.Count > 0) + { + str += ",(" + ParserSTEP.LinkToString(mInnerBoundaries[0]); + for (int icounter = 1; icounter < mInnerBoundaries.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mInnerBoundaries[icounter]); + return str + ")"; + } + return str + ",$"; + } + + } + public class IfcAnnotationFillAreaOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated + { + internal int mFillStyleTarget;// : OPTIONAL IfcPoint; + internal IfcGlobalOrLocalEnum mGlobalOrLocal;// : OPTIONAL IfcGlobalOrLocalEnum; + internal IfcAnnotationFillAreaOccurrence(IfcAnnotationFillAreaOccurrence i) : base(i) { } + internal IfcAnnotationFillAreaOccurrence() : base() { } + internal new static IfcAnnotationFillAreaOccurrence Parse(string strDef) { IfcAnnotationFillAreaOccurrence a = new IfcAnnotationFillAreaOccurrence(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcAnnotationFillAreaOccurrence el,List arrFields, ref int ipos) + { + IfcAnnotationOccurrence.parseFields(el,arrFields, ref ipos); + el.mFillStyleTarget = ParserSTEP.ParseLink(arrFields[ipos++]); + string str = arrFields[ipos++]; + if(str != "$") + el.mGlobalOrLocal = (IfcGlobalOrLocalEnum)Enum.Parse(typeof(IfcGlobalOrLocalEnum),str.Replace(".","")); + } + protected override string BuildString() { return base.BuildString() +"," + ParserSTEP.LinkToString(mFillStyleTarget) + ",." + mGlobalOrLocal.ToString() + "."; } + } + public abstract class IfcAnnotationOccurrence : IfcStyledItem //DEPRECEATED IFC4 + { + protected IfcAnnotationOccurrence(IfcAnnotationOccurrence p) : base((IfcStyledItem)p) { } + protected IfcAnnotationOccurrence() : base() { } + protected static void parseFields(IfcAnnotationOccurrence a,List arrFields, ref int ipos) { IfcStyledItem.parseFields(a,arrFields, ref ipos); } + } + public class IfcAnnotationSurface : IfcGeometricRepresentationItem //DEPRECEATED IFC4 + { + internal int mItem;// : IfcGeometricRepresentationItem; + internal int mTextureCoordinates;// OPTIONAL IfcTextureCoordinate; + internal IfcAnnotationSurface(IfcAnnotationSurface p) : base(p) { mItem = p.mItem; mTextureCoordinates = p.mTextureCoordinates; } + internal IfcAnnotationSurface() : base() { } + internal static void parseFields(IfcAnnotationSurface s,List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(s,arrFields, ref ipos); + s.mItem = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mTextureCoordinates = ParserSTEP.ParseLink(arrFields[ipos++]); + } + internal static IfcAnnotationSurface Parse(string strDef) { IfcAnnotationSurface a = new IfcAnnotationSurface(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mItem) + "," + ParserSTEP.LinkToString(mTextureCoordinates); } + } + public class IfcAnnotationSurfaceOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated + { + internal IfcAnnotationSurfaceOccurrence(IfcAnnotationSurfaceOccurrence i) : base(i) { } + internal IfcAnnotationSurfaceOccurrence() : base() { } + internal new static IfcAnnotationSurfaceOccurrence Parse(string strDef) { IfcAnnotationSurfaceOccurrence a = new IfcAnnotationSurfaceOccurrence(); int ipos = 0; parseFields(a,ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcAnnotationSurfaceOccurrence a,List arrFields, ref int ipos) { IfcAnnotationOccurrence.parseFields(a,arrFields, ref ipos); } + } + public class IfcAnnotationSymbolOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated + { + internal IfcAnnotationSymbolOccurrence(IfcAnnotationSymbolOccurrence i) : base(i) { } + internal IfcAnnotationSymbolOccurrence() : base() { } + internal new static IfcAnnotationSymbolOccurrence Parse(string strDef) { IfcAnnotationSymbolOccurrence a = new IfcAnnotationSymbolOccurrence(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcAnnotationSymbolOccurrence a,List arrFields, ref int ipos) { IfcAnnotationOccurrence.parseFields(a,arrFields, ref ipos); } + } + public class IfcAnnotationTextOccurrence : IfcAnnotationOccurrence //IFC4 Depreceated + { + internal IfcAnnotationTextOccurrence() : base() { } + internal IfcAnnotationTextOccurrence(IfcAnnotationTextOccurrence i) : base(i) { } + internal new static IfcAnnotationTextOccurrence Parse(string strDef) { IfcAnnotationTextOccurrence a = new IfcAnnotationTextOccurrence(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcAnnotationTextOccurrence a,List arrFields, ref int ipos) { IfcAnnotationOccurrence.parseFields(a,arrFields, ref ipos); } + } + public class IfcApplication : BaseClassIfc + { + internal int mApplicationDeveloper;// : IfcOrganization; + internal string mVersion;// : IfcLabel; + private string mApplicationFullName;// : IfcLabel; + internal string mApplicationIdentifier;// : IfcIdentifier; + + public string ApplicationFullName { get { return ParserIfc.Decode(mApplicationFullName); } set { mApplicationFullName = ParserIfc.Encode(value.Replace("'", "")); } } + + public override string Name { get { return ApplicationFullName; } set { ApplicationFullName = value; } } + + internal IfcApplication() : base() { } + internal IfcApplication(IfcApplication o) : base() { mApplicationDeveloper = o.mApplicationDeveloper; mVersion = o.mVersion; mApplicationFullName = o.mApplicationFullName; mApplicationIdentifier = o.mApplicationIdentifier; } + internal IfcApplication(DatabaseIfc m) : base(m) + { + IfcOrganization o = new IfcOrganization(m, "Geometry Gym Pty Ltd"); + mApplicationDeveloper = o.mIndex; + try + { + mVersion = "'" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "'"; + } + catch (Exception) { } +#if(GH) + mApplicationFullName = "'ggGrasshopperIFC - Geometry Gym Plug-in for Grasshopper3d'"; + mApplicationIdentifier = "'ggGrasshopperIFC'"; +#elif(CONVERTER) + mApplicationFullName = "'ggIFCConverter - Geometry Gym Pty Ltd'"; + mApplicationIdentifier = "'ggIFCConverter'"; +#else + mApplicationFullName = "'ggRhinoIFC - Geometry Gym Plug-in for Rhino3d'"; + mApplicationIdentifier = "'ggRhinoIFC'"; +#endif + } + internal static void parseFields(IfcApplication a, List arrFields, ref int ipos) { a.mApplicationDeveloper = ParserSTEP.ParseLink(arrFields[ipos++]); a.mVersion = arrFields[ipos++]; a.mApplicationFullName = arrFields[ipos++]; a.mApplicationIdentifier = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mApplicationDeveloper) + "," + mVersion + "," + mApplicationFullName + "," + mApplicationIdentifier; } + internal static IfcApplication Parse(string strDef) { IfcApplication a = new IfcApplication(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + } + public partial class IfcAppliedValue : BaseClassIfc, IfcMetricValueSelect, IfcAppliedValueSelect, IfcResourceObjectSelect //SUPERTYPE OF(IfcCostValue); + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal int mAppliedValue = 0;// : OPTIONAL IfcAppliedValueSelect + internal IfcValue mAppliedValueValue = null; + internal int mUnitBasis;// : OPTIONAL IfcMeasureWithUnit; + internal string mApplicableDate = "$";// : OPTIONAL IfcDateTimeSelect; 4 IfcDate + internal string mFixedUntilDate = "$";// : OPTIONAL IfcDateTimeSelect; 4 IfcDate + internal string mCategory = "$";// : OPTIONAL IfcLabel; IFC4 + internal string mCondition = "$";// : OPTIONAL IfcLabel; IFC4 + internal IfcArithmeticOperatorEnum mArithmeticOperator = IfcArithmeticOperatorEnum.NONE;// : OPTIONAL IfcArithmeticOperatorEnum; IFC4 + internal List mComponents = new List();// : OPTIONAL LIST [1:?] OF IfcAppliedValue; IFC4 + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + internal IfcAppliedValue() : base() { } + internal IfcAppliedValue(IfcAppliedValue v) : base() + { + mName = v.mName; mDescription = v.mDescription; mAppliedValue = v.mAppliedValue; mAppliedValueValue = v.mAppliedValueValue; mUnitBasis = v.mUnitBasis; mApplicableDate = v.mApplicableDate; + mFixedUntilDate = v.mFixedUntilDate; mCategory = v.mCategory; mCondition = v.mCondition; mArithmeticOperator = v.mArithmeticOperator; mComponents.AddRange(v.mComponents); + } + + internal static IfcAppliedValue Parse(string strDef, Schema schema) { IfcAppliedValue v = new IfcAppliedValue(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return v; } + internal static void parseFields(IfcAppliedValue a, List arrFields, ref int ipos, Schema schema) + { + a.mName = arrFields[ipos++].Replace("'", ""); + a.mDescription = arrFields[ipos++].Replace("'", ""); + string str = arrFields[ipos++]; + a.mAppliedValueValue = ParserIfc.parseValue(str); + if (a.mAppliedValueValue == null) + a.mAppliedValue = ParserSTEP.ParseLink(str); + a.mUnitBasis = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mApplicableDate = arrFields[ipos++]; + a.mFixedUntilDate = arrFields[ipos++]; + if (schema != Schema.IFC2x3) + { + a.mCategory = arrFields[ipos++].Replace("'", ""); + a.mCondition = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mArithmeticOperator = (IfcArithmeticOperatorEnum)Enum.Parse(typeof(IfcArithmeticOperatorEnum), s.Replace(".", "")); + a.mComponents = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + } + protected override string BuildString() + { + string str = "$"; + if (mComponents.Count > 0) + { + str = "(" + ParserSTEP.LinkToString(mComponents[0]); + for (int icounter = 1; icounter < mComponents.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mComponents[icounter]); + str += ")"; + } + return base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + (mAppliedValueValue != null ? mAppliedValueValue.ToString() : ParserSTEP.LinkToString(mAppliedValue)) + "," + ParserSTEP.LinkToString(mUnitBasis) + "," + mApplicableDate + "," + mFixedUntilDate + + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mCategory == "$" ? ",$," : ",'" + mCategory + "',") + (mCondition == "$" ? "$," : "'" + mCondition + "',") + (mArithmeticOperator == IfcArithmeticOperatorEnum.NONE ? "$," : "." + mArithmeticOperator.ToString() + ".,") + str); + } + } + public class IfcAppliedValueRelationship : BaseClassIfc //DEPRECEATED IFC4 + { + internal int mComponentOfTotal;// : IfcAppliedValue; + internal List< int> mComponents = new List();// : SET [1:?] OF IfcAppliedValue; + internal IfcArithmeticOperatorEnum mArithmeticOperator;// : IfcArithmeticOperatorEnum; + internal string mName;// : OPTIONAL IfcLabel; + internal string mDescription;// : OPTIONAL IfcText + internal IfcAppliedValueRelationship() : base() { } + internal IfcAppliedValueRelationship(IfcAppliedValueRelationship o) : base() + { + mComponentOfTotal = o.mComponentOfTotal; + mComponents = new List(o.mComponents.ToArray()); + mArithmeticOperator = o.mArithmeticOperator; + mName = o.mName; + mDescription = o.mDescription; + } + internal static void parseFields( IfcAppliedValueRelationship a,List arrFields, ref int ipos) + { + a.mComponentOfTotal = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mComponents = ParserSTEP.SplitListLinks(arrFields[ipos++]); + a.mArithmeticOperator =( IfcArithmeticOperatorEnum)Enum.Parse(typeof(IfcArithmeticOperatorEnum), arrFields[ipos++].Replace(".","")); + a.mName = arrFields[ipos++]; + a.mDescription = arrFields[ipos++]; + } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mComponentOfTotal) + ",(" + + ParserSTEP.LinkToString(mComponents[0]); + for(int icounter = 1; icounter < mComponents.Count;icounter++) + str += "," + ParserSTEP.LinkToString(mComponents[icounter]); + return str + "),." + mArithmeticOperator.ToString() + ".," + mName + "," + mDescription; + } + internal static IfcAppliedValueRelationship Parse(string strDef) { IfcAppliedValueRelationship a = new IfcAppliedValueRelationship(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + } + public interface IfcAppliedValueSelect : IfcInterface { }; // IfcMeasureWithUnit, IfcValue, IfcReference); IFC2x3 //IfcRatioMeasure, IfcMeasureWithUnit, IfcMonetaryMeasure); + public class IfcApproval : BaseClassIfc, IfcResourceObjectSelect + { + internal string mDescription = "$";// : OPTIONAL IfcText; + internal int mApprovalDateTime;// : IfcDateTimeSelect; + internal string mApprovalStatus = "$";// : OPTIONAL IfcLabel; + internal string mApprovalLevel = "$";// : OPTIONAL IfcLabel; + internal string mApprovalQualifier = "$";// : OPTIONAL IfcText; + internal string mName = "$";// :OPTIONAL IfcLabel; + internal string mIdentifier = "$";// : OPTIONAL IfcIdentifier; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + [Browsable(false)] + public List HasExternalReferences { get { return mHasExternalReferences; } } + [Browsable(false)] + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + internal IfcApproval() : base() { } + internal IfcApproval(IfcApproval o) : base() + { + mDescription = o.mDescription; + mApprovalDateTime = o.mApprovalDateTime; + mApprovalStatus = o.mApprovalStatus; + mApprovalLevel = o.mApprovalLevel; + mApprovalQualifier = o.mApprovalQualifier; + mName = o.mName; + mIdentifier = o.mIdentifier; + } + internal static void parseFields(IfcApproval a,List arrFields, ref int ipos) + { + a.mDescription = arrFields[ipos++]; + a.mApprovalDateTime = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mApprovalStatus = arrFields[ipos++]; + a.mApprovalLevel = arrFields[ipos++]; + a.mApprovalQualifier = arrFields[ipos++]; + a.mName = arrFields[ipos++]; + a.mIdentifier = arrFields[ipos++]; + } + protected override string BuildString() { return base.BuildString() + "," + mDescription + "," + ParserSTEP.LinkToString(mApprovalDateTime) + "," + mApprovalStatus + "," + mApprovalLevel + "," + mApprovalQualifier + "," + mName + "," + mIdentifier; } + internal static IfcApproval Parse(string strDef) { IfcApproval a = new IfcApproval(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + } + public class IfcApprovalActorRelationship : BaseClassIfc //DEPRECEATED IFC4 + { + internal int mActor;// : IfcActorSelect; + internal int mApproval;// : IfcApproval; + internal int mRole;// : IfcActorRole; + internal IfcApprovalActorRelationship() : base() { } + internal IfcApprovalActorRelationship(IfcApprovalActorRelationship o) : base() { mActor = o.mActor; mApproval = o.mApproval; mRole = o.mRole; } + internal static void parseFields(IfcApprovalActorRelationship r,List arrFields, ref int ipos) { r.mActor = ParserSTEP.ParseLink(arrFields[ipos++]); r.mApproval = ParserSTEP.ParseLink(arrFields[ipos++]); r.mRole = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mActor) + "," + ParserSTEP.LinkToString(mApproval) + "," + ParserSTEP.LinkToString(mRole); } + internal static IfcApprovalActorRelationship Parse(string strDef) { IfcApprovalActorRelationship r = new IfcApprovalActorRelationship(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + } + public class IfcApprovalPropertyRelationship : BaseClassIfc //DEPRECEATED IFC4 + { + internal List mApprovedProperties = new List();// : SET [1:?] OF IfcProperty; + internal int mApproval;// : IfcApproval; + internal IfcApprovalPropertyRelationship() : base() { } + internal IfcApprovalPropertyRelationship(IfcApprovalPropertyRelationship o) : base() { mApprovedProperties = new List(o.mApprovedProperties.ToArray()); mApproval = o.mApproval; } + internal static void parseFields(IfcApprovalPropertyRelationship r,List arrFields, ref int ipos) { r.mApprovedProperties = ParserSTEP.SplitListLinks(arrFields[ipos++]); r.mApproval = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mApprovedProperties[0]); + for(int icounter = 1; icounter < mApprovedProperties.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mApprovedProperties[icounter]); + str += ")," + ParserSTEP.LinkToString(mApproval); + return str; + } + internal static IfcApprovalPropertyRelationship Parse(string strDef) { IfcApprovalPropertyRelationship r = new IfcApprovalPropertyRelationship(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + } + public class IfcApprovalRelationship : IfcResourceLevelRelationship //IFC4Change + { + internal int mRelatedApproval;// : IfcApproval; + internal int mRelatingApproval;// : IfcApproval; + internal IfcApprovalRelationship() : base() { } + internal IfcApprovalRelationship(IfcApprovalRelationship o) : base(o) { mRelatedApproval = o.mRelatedApproval; mRelatingApproval = o.mRelatingApproval; } + internal static void parseFields( IfcApprovalRelationship a,List arrFields, ref int ipos,Schema schema) + { + IfcResourceLevelRelationship.parseFields(a,arrFields,ref ipos,schema); + a.mRelatedApproval = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mRelatingApproval = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + { + a.mDescription = arrFields[ipos++]; + a.mName = arrFields[ipos++]; + } + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatedApproval) + "," + ParserSTEP.LinkToString(mRelatingApproval) + (mDatabase.mSchema == Schema.IFC2x3 ? (mDescription == "$" ? ",$,'" : ",'" + mDescription + "','") + mName + "'": ""); } + internal static IfcApprovalRelationship Parse(string strDef,Schema schema) { IfcApprovalRelationship a = new IfcApprovalRelationship(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + } + public partial class IfcArbitraryClosedProfileDef : IfcProfileDef + { + private int mOuterCurve;// : IfcBoundedCurve + internal IfcBoundedCurve OuterCurve { get { return mDatabase.mIfcObjects[mOuterCurve] as IfcBoundedCurve; } } + + internal IfcArbitraryClosedProfileDef() : base() { } + internal IfcArbitraryClosedProfileDef(IfcArbitraryClosedProfileDef i) : base(i) { mOuterCurve = i.mOuterCurve; } + public IfcArbitraryClosedProfileDef(string name, IfcBoundedCurve boundedCurve) : base(boundedCurve.mDatabase) { Name = name; mOuterCurve = boundedCurve.mIndex; }//if (string.Compare(getKW, mKW) == 0) mModel.mArbProfiles.Add(this); } + + internal new static IfcArbitraryClosedProfileDef Parse(string strDef) { IfcArbitraryClosedProfileDef p = new IfcArbitraryClosedProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcArbitraryClosedProfileDef p, List arrFields, ref int ipos) { IfcProfileDef.parseFields(p, arrFields, ref ipos); p.mOuterCurve = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mOuterCurve)); } + } + public partial class IfcArbitraryOpenProfileDef : IfcProfileDef + { + private int mCurve;// : IfcBoundedCurve + internal IfcBoundedCurve Curve { get { return mDatabase.mIfcObjects[mCurve] as IfcBoundedCurve; } } + + internal IfcArbitraryOpenProfileDef() : base() { } + internal IfcArbitraryOpenProfileDef(IfcArbitraryOpenProfileDef i) : base((IfcProfileDef)i) { mCurve = i.mCurve; } + internal IfcArbitraryOpenProfileDef(string name, IfcBoundedCurve boundedCurve) : base(boundedCurve.mDatabase) { Name = name; mCurve = boundedCurve.mIndex; } + internal new static IfcArbitraryOpenProfileDef Parse(string strDef) { IfcArbitraryOpenProfileDef p = new IfcArbitraryOpenProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcArbitraryOpenProfileDef p, List arrFields, ref int ipos) { IfcProfileDef.parseFields(p, arrFields, ref ipos); p.mCurve = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mCurve); } + } + public partial class IfcArbitraryProfileDefWithVoids : IfcArbitraryClosedProfileDef + { + private List mInnerCurves = new List();// : SET [1:?] OF IfcCurve; + internal List InnerCurves { get { return mInnerCurves.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCurve); } } + + internal IfcArbitraryProfileDefWithVoids() : base() { } + internal IfcArbitraryProfileDefWithVoids(IfcArbitraryProfileDefWithVoids i) : base((IfcArbitraryClosedProfileDef)i) { mInnerCurves = new List(i.mInnerCurves.ToArray()); } + internal IfcArbitraryProfileDefWithVoids(string name, IfcBoundedCurve perim, IfcCurve inner) : base(name, perim) { mInnerCurves.Add(inner.mIndex); } + internal IfcArbitraryProfileDefWithVoids(string name, IfcBoundedCurve perim, List inner) : base(name, perim) { mInnerCurves = inner.ConvertAll(x => x.mIndex); } + internal new static IfcArbitraryProfileDefWithVoids Parse(string strDef) { IfcArbitraryProfileDefWithVoids p = new IfcArbitraryProfileDefWithVoids(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcArbitraryProfileDefWithVoids p, List arrFields, ref int ipos) { IfcArbitraryClosedProfileDef.parseFields(p, arrFields, ref ipos); p.mInnerCurves = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + if (mInnerCurves.Count == 0) + return base.BuildString(); + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mInnerCurves[0]); + for (int icounter = 1; icounter < mInnerCurves.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mInnerCurves[icounter]); + return str + ")"; + } + } + public class IfcArcIndex : IfcSegmentIndexSelect + { + internal int mA, mB, mC; + public IfcArcIndex(int a, int b, int c) { mA = a; mB = b; mC = c; } + public override string ToString() { return "IFCARCINDEX((" + mA + "," + mB + "," + mC + "))"; } + } + public class IfcAsset : IfcGroup + { + internal string mAssetID;// : IfcIdentifier; + internal int mOriginalValue;// : IfcCostValue; + internal int mCurrentValue;// : IfcCostValue; + internal int mTotalReplacementCost;// : IfcCostValue; + internal int mOwner;// : IfcActorSelect; + internal int mUser;// : IfcActorSelect; + internal int mResponsiblePerson;// : IfcPerson; + internal int mIncorporationDate;// : IfcCalendarDate; + internal int mDepreciatedValue;// : IfcCostValue; + internal IfcAsset() : base() { } + internal IfcAsset(IfcAsset p) : base(p) + { + mAssetID = p.mAssetID; + mOriginalValue = p.mOriginalValue; + mCurrentValue = p.mCurrentValue; + mTotalReplacementCost = p.mTotalReplacementCost; + mOwner = p.mOwner; + mUser = p.mUser; + mResponsiblePerson = p.mResponsiblePerson; + mIncorporationDate = p.mIncorporationDate; + mDepreciatedValue = p.mDepreciatedValue; + } + internal IfcAsset(DatabaseIfc m, string name) : base(m,name) { } + internal new static IfcAsset Parse(string strDef) { IfcAsset a = new IfcAsset(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcAsset a,List arrFields, ref int ipos) + { + IfcGroup.parseFields(a,arrFields, ref ipos); + a.mAssetID = arrFields[ipos++].Replace("'",""); + a.mOriginalValue = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mCurrentValue = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mTotalReplacementCost = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mOwner = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mUser = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mResponsiblePerson = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mIncorporationDate = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mDepreciatedValue = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() +",'" + mAssetID + "'," + ParserSTEP.LinkToString(mOriginalValue) + "," +ParserSTEP.LinkToString(mCurrentValue) + "," + + ParserSTEP.LinkToString(mTotalReplacementCost) + "," +ParserSTEP.LinkToString(mOwner) + "," + + ParserSTEP.LinkToString(mUser) + "," +ParserSTEP.LinkToString(mResponsiblePerson) + "," + + ParserSTEP.LinkToString(mIncorporationDate) + "," +ParserSTEP.LinkToString(mDepreciatedValue); + } + } + public class IfcAsymmetricIShapeProfileDef : IfcIShapeProfileDef //IFC4 IfcParameterizedProfileDef + { + internal double mTopFlangeWidth;// : IfcPositiveLengthMeasure; + internal double mTopFlangeThickness;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mTopFlangeFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mCentreOfGravityInY;// : OPTIONAL IfcPositiveLengthMeasure + internal IfcAsymmetricIShapeProfileDef() : base() { } + internal IfcAsymmetricIShapeProfileDef(IfcAsymmetricIShapeProfileDef i) : base(i) + { + mTopFlangeWidth = i.mTopFlangeWidth; + mTopFlangeThickness = i.mTopFlangeThickness; + mTopFlangeFilletRadius = i.mTopFlangeFilletRadius; + mCentreOfGravityInY = i.mCentreOfGravityInY; + } + internal static void parseFields(IfcAsymmetricIShapeProfileDef p, List arrFields, ref int ipos,Schema schema) + { + IfcIShapeProfileDef.parseFields(p, arrFields, ref ipos,schema); + p.mTopFlangeWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTopFlangeThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTopFlangeFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + p.mCentreOfGravityInY = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal new static IfcAsymmetricIShapeProfileDef Parse(string strDef,Schema schema) { IfcAsymmetricIShapeProfileDef p = new IfcAsymmetricIShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleToString(mTopFlangeWidth) + "," + ParserSTEP.DoubleOptionalToString(mTopFlangeThickness) + "," + + ParserSTEP.DoubleOptionalToString(mTopFlangeFilletRadius) + (mDatabase.mSchema == Schema.IFC2x3 ? "," + ParserSTEP.DoubleOptionalToString(mCentreOfGravityInY) : ""); + } + } + public class IfcAudioVisualAppliance : IfcFlowTerminal //IFC4 + { + internal IfcAudioVisualApplianceTypeEnum mPredefinedType = IfcAudioVisualApplianceTypeEnum.NOTDEFINED;// OPTIONAL : IfcAudioVisualApplianceTypeEnum; + public IfcAudioVisualApplianceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcAudioVisualAppliance(IfcAudioVisualAppliance a) : base(a) { } + internal IfcAudioVisualAppliance() : base() { } + internal static void parseFields(IfcAudioVisualAppliance s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcAudioVisualApplianceTypeEnum)Enum.Parse(typeof(IfcAudioVisualApplianceTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcAudioVisualAppliance Parse(string strDef) { IfcAudioVisualAppliance s = new IfcAudioVisualAppliance(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ( mPredefinedType == IfcAudioVisualApplianceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + + } + public partial class IfcAudioVisualApplianceType : IfcFlowTerminalType + { + internal IfcAudioVisualApplianceTypeEnum mPredefinedType = IfcAudioVisualApplianceTypeEnum.NOTDEFINED;// : IfcAudioVisualApplianceBoxTypeEnum; + public IfcAudioVisualApplianceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcAudioVisualApplianceType(IfcAudioVisualApplianceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcAudioVisualApplianceType() : base() { } + internal IfcAudioVisualApplianceType(DatabaseIfc m, string name, IfcAudioVisualApplianceTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcAudioVisualApplianceType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcAudioVisualApplianceTypeEnum)Enum.Parse(typeof(IfcAudioVisualApplianceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcAudioVisualApplianceType Parse(string strDef) { IfcAudioVisualApplianceType t = new IfcAudioVisualApplianceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcAxis1Placement : IfcPlacement + { + private int mAxis;// : OPTIONAL IfcDirection + public IfcDirection Axis { get { return (mAxis > 0 ? mDatabase.mIfcObjects[mAxis] as IfcDirection : null); } } + + internal IfcAxis1Placement() : base() { } + internal IfcAxis1Placement(IfcAxis1Placement p) : base(p) { mAxis = p.mAxis; } + internal IfcAxis1Placement(DatabaseIfc m) : base(m) { } + + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mAxis)); } + internal static IfcAxis1Placement Parse(string strDef) { IfcAxis1Placement p = new IfcAxis1Placement(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcAxis1Placement p, List arrFields, ref int ipos) { IfcPlacement.parseFields(p, arrFields, ref ipos); p.mAxis = ParserSTEP.ParseLink(arrFields[ipos++]); } + } + public partial interface IfcAxis2Placement : IfcInterface { } //SELECT ( IfcAxis2Placement2D, IfcAxis2Placement3D); + public partial class IfcAxis2Placement2D : IfcPlacement, IfcAxis2Placement + { + private int mRefDirection;// : OPTIONAL IfcDirection; + public IfcDirection RefDirection { get { return mDatabase.mIfcObjects[mRefDirection] as IfcDirection; } } + + internal IfcAxis2Placement2D() : base() { } + internal IfcAxis2Placement2D(IfcAxis2Placement2D i) : base(i) { mRefDirection = i.mRefDirection; } + public IfcAxis2Placement2D(DatabaseIfc db) : base(db) { } + public IfcAxis2Placement2D(IfcCartesianPoint point) : base(point) { } + + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRefDirection)); } + internal static IfcAxis2Placement2D Parse(string strDef) { IfcAxis2Placement2D p = new IfcAxis2Placement2D(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcAxis2Placement2D p, List arrFields, ref int ipos) { IfcPlacement.parseFields(p, arrFields, ref ipos); p.mRefDirection = ParserSTEP.ParseLink(arrFields[ipos++]); } + } + public partial class IfcAxis2Placement3D : IfcPlacement, IfcAxis2Placement + { + private int mAxis;// : OPTIONAL IfcDirection; + private int mRefDirection;// : OPTIONAL IfcDirection; + + internal IfcDirection Axis { get { return mDatabase.mIfcObjects[mAxis] as IfcDirection; } set { mAxis = (value == null ? 0 : value.mIndex); } } + internal IfcDirection RefDirection { get { return mDatabase.mIfcObjects[mRefDirection] as IfcDirection; } set { mRefDirection = (value == null ? 0 : value.mIndex); } } + + internal IfcAxis2Placement3D() : base() { } + internal IfcAxis2Placement3D(IfcAxis2Placement3D i) : base(i) { mAxis = i.mAxis; mRefDirection = i.mRefDirection; } + public IfcAxis2Placement3D(IfcCartesianPoint p) : base(p) { } + public IfcAxis2Placement3D(IfcCartesianPoint p, IfcDirection axis, IfcDirection refDirection) : base(p) { mAxis = (axis == null ? 0 : axis.mIndex); mRefDirection = (refDirection == null ? 0 : refDirection.mIndex); } + internal IfcAxis2Placement3D(DatabaseIfc m) : base(m) { } + + internal static IfcAxis2Placement3D Parse(string strDef) { IfcAxis2Placement3D p = new IfcAxis2Placement3D(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcAxis2Placement3D p, List arrFields, ref int ipos) { IfcPlacement.parseFields(p, arrFields, ref ipos); p.mAxis = ParserSTEP.ParseLink(arrFields[ipos++]); p.mRefDirection = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + (mAxis > 0 ? "," + ParserSTEP.LinkToString(mAxis) : ",$") + (mRefDirection > 0 ? "," + ParserSTEP.LinkToString(mRefDirection) : ",$")); } + } +} diff --git a/IFC/IFC B.cs b/IFC/IFC B.cs new file mode 100644 index 0000000..1d914f3 --- /dev/null +++ b/IFC/IFC B.cs @@ -0,0 +1,856 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + + +namespace GeometryGym.Ifc +{ + public partial class IfcBeam : IfcBuildingElement + { + internal IfcBeamTypeEnum mPredefinedType = IfcBeamTypeEnum.NOTDEFINED;//: OPTIONAL IfcBeamTypeEnum; IFC4 + public IfcBeamTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcBeam() : base() { } + internal IfcBeam(IfcBeam b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcBeam(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static void parseFields(IfcBeam b, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(b, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + b.mPredefinedType = (IfcBeamTypeEnum)Enum.Parse(typeof(IfcBeamTypeEnum), str.Substring(1, str.Length - 2)); + } + } + internal static IfcBeam Parse(string strDef, Schema schema) { IfcBeam b = new IfcBeam(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return b; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcBeamTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcBeamStandardCase : IfcBeam + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 || mDatabase.mModelView == ModelView.Ifc4Reference ? "IFCBEAM" : base.KeyWord); } } + + internal IfcBeamStandardCase() : base() { } + internal IfcBeamStandardCase(IfcBeamStandardCase o) : base(o) { } + + internal new static IfcBeamStandardCase Parse(string strDef, Schema schema) { IfcBeamStandardCase c = new IfcBeamStandardCase(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return c; } + internal static void parseFields(IfcBeamStandardCase c, List arrFields, ref int ipos, Schema schema) { IfcBeam.parseFields(c, arrFields, ref ipos,schema); } + } + public partial class IfcBeamType : IfcBuildingElementType + { + internal IfcBeamTypeEnum mPredefinedType; + public IfcBeamTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcBeamType() : base() { } + internal IfcBeamType(IfcBeamType b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcBeamType(DatabaseIfc m, string name, IfcBeamTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + public IfcBeamType(string name, IfcMaterialProfile mp, IfcBeamTypeEnum type) : this(name, new IfcMaterialProfileSet(name, mp), type) { } + public IfcBeamType(string name, IfcMaterialProfileSet ps, IfcBeamTypeEnum type) : base(ps.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = ps; } + internal static void parseFields(IfcBeamType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcBeamTypeEnum)Enum.Parse(typeof(IfcBeamTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcBeamType Parse(string strDef) { IfcBeamType t = new IfcBeamType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public interface IfcBendingParameterSelect { } // IfcLengthMeasure, IfcPlaneAngleMeasure + public partial class IfcBezierCurve : IfcBSplineCurve // DEPRECEATED IFC4 + { + internal IfcBezierCurve() : base() { } + internal IfcBezierCurve(IfcBezierCurve pl) : base(pl) { } + internal static void parseFields(IfcBezierCurve c, List arrFields, ref int ipos) { IfcBSplineCurve.parseFields(c, arrFields, ref ipos); } + internal static IfcBezierCurve Parse(string strDef) { IfcBezierCurve c = new IfcBezierCurve(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public class IfcBlobTexture : IfcSurfaceTexture + { + internal string mRasterFormat;// : IfcIdentifier; + internal bool mRasterCode;// : BOOLEAN; + internal IfcBlobTexture() : base() { } + internal IfcBlobTexture(IfcBlobTexture i) : base(i) { mRasterFormat = i.mRasterFormat; mRasterCode = i.mRasterCode; } + internal static IfcBlobTexture Parse(string strDef, Schema schema) { IfcBlobTexture t = new IfcBlobTexture(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return t; } + internal static void parseFields(IfcBlobTexture t, List arrFields, ref int ipos, Schema schema) { IfcSurfaceTexture.parseFields(t, arrFields, ref ipos,schema); t.mRasterFormat = arrFields[ipos++].Replace("'", ""); t.mRasterCode = ParserSTEP.ParseBool(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + ",'" + mRasterFormat + "'," + ParserSTEP.BoolToString(mRasterCode); } + } + public partial class IfcBlock : IfcCsgPrimitive3D + { + private double mXLength, mYLength, mZLength;// : IfcPositiveLengthMeasure; + + public double XLength { get { return mXLength; } } + public double YLength { get { return mYLength; } } + public double ZLength { get { return mZLength; } } + + internal IfcBlock() : base() { } + internal IfcBlock(IfcBlock pl) : base(pl) { mXLength = pl.mXLength; mYLength = pl.mYLength; mZLength = pl.mZLength; } + internal static void parseFields(IfcBlock b, List arrFields, ref int ipos) { IfcCsgPrimitive3D.parseFields(b, arrFields, ref ipos); b.mXLength = ParserSTEP.ParseDouble(arrFields[ipos++]); b.mYLength = ParserSTEP.ParseDouble(arrFields[ipos++]); b.mZLength = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcBlock Parse(string strDef) { IfcBlock b = new IfcBlock(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mXLength) + "," + ParserSTEP.DoubleToString(mYLength) + "," + ParserSTEP.DoubleToString(mZLength); } + } + public class IfcBoiler : IfcEnergyConversionDevice //IFC4 + { + internal IfcBoilerTypeEnum mPredefinedType = IfcBoilerTypeEnum.NOTDEFINED; + public IfcBoilerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcBoiler() : base() { } + internal IfcBoiler(IfcBoiler b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcBoiler(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcBoiler a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcBoilerTypeEnum)Enum.Parse(typeof(IfcBoilerTypeEnum), s.Replace(".", "")); + } + internal new static IfcBoiler Parse(string strDef) { IfcBoiler d = new IfcBoiler(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcBoilerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcBoilerType : IfcEnergyConversionDeviceType + { + internal IfcBoilerTypeEnum mPredefinedType = IfcBoilerTypeEnum.NOTDEFINED;// : IfcBoilerypeEnum; + public IfcBoilerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcBoilerType() : base() { } + internal IfcBoilerType(IfcBoilerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcBoilerType(DatabaseIfc m, string name, IfcBoilerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcBoilerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcBoilerTypeEnum)Enum.Parse(typeof(IfcBoilerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcBoilerType Parse(string strDef) { IfcBoilerType t = new IfcBoilerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcBooleanClippingResult : IfcBooleanResult + { + internal IfcBooleanClippingResult() : base() { } + internal IfcBooleanClippingResult(IfcBooleanClippingResult c) : base(c) { } + internal IfcBooleanClippingResult(IfcBooleanClippingResult bc, IfcHalfSpaceSolid hss) : base(IfcBooleanOperator.DIFFERENCE, bc, hss) { } + internal IfcBooleanClippingResult(IfcSweptAreaSolid s, IfcHalfSpaceSolid hss) : base(IfcBooleanOperator.DIFFERENCE, s, hss) { } + internal static void parseFields(IfcBooleanClippingResult c, List arrFields, ref int ipos) { IfcBooleanResult.parseFields(c, arrFields, ref ipos); } + internal new static IfcBooleanClippingResult Parse(string strDef) { IfcBooleanClippingResult c = new IfcBooleanClippingResult(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public partial interface IfcBooleanOperand : IfcInterface { } // SELECT (IfcSolidModel ,IfcHalfSpaceSolid ,IfcBooleanResult ,IfcCsgPrimitive3D); + public partial class IfcBooleanResult : IfcGeometricRepresentationItem, IfcBooleanOperand, IfcCsgSelect + { + private IfcBooleanOperator mOperator;// : IfcBooleanOperator; + private int mFirstOperand;// : IfcBooleanOperand; + private int mSecondOperand;// : IfcBooleanOperand; + + internal IfcBooleanOperator Operator { get { return mOperator; } } + internal IfcBooleanOperand FirstOperand { get { return mDatabase.mIfcObjects[mFirstOperand] as IfcBooleanOperand; } } + internal IfcBooleanOperand SecondOperand { get { return mDatabase.mIfcObjects[mSecondOperand] as IfcBooleanOperand; } } + + internal IfcBooleanResult() : base() { } + internal IfcBooleanResult(IfcBooleanResult b) : base(b) { mOperator = b.mOperator; mFirstOperand = b.mFirstOperand; mSecondOperand = b.mSecondOperand; } + public IfcBooleanResult(IfcBooleanOperator op, IfcBooleanOperand first, IfcBooleanOperand second) : base(first.Database) + { + mOperator = op; + mFirstOperand = first.Index; + mSecondOperand = second.Index; + } + internal static void parseFields(IfcBooleanResult b, List arrFields, ref int ipos) + { + IfcCurve.parseFields(b, arrFields, ref ipos); + b.mOperator = (IfcBooleanOperator)Enum.Parse(typeof(IfcBooleanOperator), arrFields[ipos++].Replace(".", "")); + b.mFirstOperand = ParserSTEP.ParseLink(arrFields[ipos++]); + b.mSecondOperand = ParserSTEP.ParseLink(arrFields[ipos++]); + } + internal static IfcBooleanResult Parse(string strDef) { IfcBooleanResult b = new IfcBooleanResult(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + protected override string BuildString() { return base.BuildString() + ",." + mOperator.ToString() + ".," + ParserSTEP.LinkToString(mFirstOperand) + "," + ParserSTEP.LinkToString(mSecondOperand); } + } + public abstract class IfcBoundaryCondition : BaseClassIfc //ABSTRACT SUPERTYPE OF (ONEOF (IfcBoundaryEdgeCondition ,IfcBoundaryFaceCondition ,IfcBoundaryNodeCondition)); + { + internal string mName;// : OPTIONAL IfcLabel; + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + protected IfcBoundaryCondition() : base() { } + protected IfcBoundaryCondition(IfcBoundaryCondition i) : base() { mName = i.mName; } + protected IfcBoundaryCondition(DatabaseIfc m, string name) : base(m) { mName = (string.IsNullOrEmpty(name) ? "Boundary Condition" : name.Replace("'", "")); } + protected static void parseFields(IfcBoundaryCondition c, List arrFields, ref int ipos) { c.mName = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + ",'" + mName + "'"; } + } + public class IfcBoundaryCurve : IfcCompositeCurveOnSurface + { + internal IfcBoundaryCurve() : base() { } + internal IfcBoundaryCurve(IfcBoundaryCurve i) : base(i) { } + internal IfcBoundaryCurve(List segs) : base(segs) { } + internal new static IfcBoundaryCurve Parse(string strDef) { IfcBoundaryCurve b = new IfcBoundaryCurve(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBoundaryCurve b, List arrFields, ref int ipos) { IfcCompositeCurveOnSurface.parseFields(b, arrFields, ref ipos); } + } + public class IfcBoundaryEdgeCondition : IfcBoundaryCondition + { + internal double mLinearStiffnessByLengthX, mLinearStiffnessByLengthY, mLinearStiffnessByLengthZ;// : OPTIONAL IfcModulusOfLinearSubgradeReactionMeasure; + internal double mRotationalStiffnessByLengthX, mRotationalStiffnessByLengthY, mRotationalStiffnessByLengthZ;// : OPTIONAL IfcModulusOfRotationalSubgradeReactionMeasure; + internal IfcBoundaryEdgeCondition() : base() { } + internal IfcBoundaryEdgeCondition(IfcBoundaryEdgeCondition i) : base(i) { mLinearStiffnessByLengthX = i.mLinearStiffnessByLengthX; mLinearStiffnessByLengthY = i.mLinearStiffnessByLengthY; mLinearStiffnessByLengthZ = i.mLinearStiffnessByLengthZ; mRotationalStiffnessByLengthX = i.mRotationalStiffnessByLengthX; mRotationalStiffnessByLengthY = i.mRotationalStiffnessByLengthY; mRotationalStiffnessByLengthZ = i.mRotationalStiffnessByLengthZ; } + internal IfcBoundaryEdgeCondition(DatabaseIfc m, string name) : base(m, name) { } + internal static IfcBoundaryEdgeCondition Parse(string strDef) { IfcBoundaryEdgeCondition b = new IfcBoundaryEdgeCondition(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBoundaryEdgeCondition b, List arrFields, ref int ipos) + { + IfcBoundaryCondition.parseFields(b, arrFields, ref ipos); + b.mLinearStiffnessByLengthX = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mLinearStiffnessByLengthY = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mLinearStiffnessByLengthZ = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mRotationalStiffnessByLengthX = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mRotationalStiffnessByLengthY = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mRotationalStiffnessByLengthZ = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mLinearStiffnessByLengthX) + "," + ParserSTEP.DoubleOptionalToString(mLinearStiffnessByLengthY) + "," + ParserSTEP.DoubleOptionalToString(mLinearStiffnessByLengthZ) + "," + ParserSTEP.DoubleOptionalToString(mRotationalStiffnessByLengthX) + "," + ParserSTEP.DoubleOptionalToString(mRotationalStiffnessByLengthY) + "," + ParserSTEP.DoubleOptionalToString(mRotationalStiffnessByLengthZ); } + } + public class IfcBoundaryFaceCondition : IfcBoundaryCondition + { + internal double mLinearStiffnessByAreaX, mLinearStiffnessByAreaY, mLinearStiffnessByAreaZ;// : OPTIONAL IfcModulusOfSubgradeReactionMeasure + internal IfcBoundaryFaceCondition() : base() { } + internal IfcBoundaryFaceCondition(IfcBoundaryFaceCondition i) : base(i) { mLinearStiffnessByAreaX = i.mLinearStiffnessByAreaX; mLinearStiffnessByAreaY = i.mLinearStiffnessByAreaY; mLinearStiffnessByAreaZ = i.mLinearStiffnessByAreaZ; } + internal IfcBoundaryFaceCondition(DatabaseIfc m, string name) : base(m, name) { } + internal static IfcBoundaryFaceCondition Parse(string strDef) { IfcBoundaryFaceCondition b = new IfcBoundaryFaceCondition(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBoundaryFaceCondition b, List arrFields, ref int ipos) { IfcBoundaryCondition.parseFields(b, arrFields, ref ipos); b.mLinearStiffnessByAreaX = ParserSTEP.ParseDouble(arrFields[ipos++]); b.mLinearStiffnessByAreaY = ParserSTEP.ParseDouble(arrFields[ipos++]); b.mLinearStiffnessByAreaZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mLinearStiffnessByAreaX) + "," + ParserSTEP.DoubleOptionalToString(mLinearStiffnessByAreaY) + "," + ParserSTEP.DoubleOptionalToString(mLinearStiffnessByAreaZ); } + } + public partial class IfcBoundaryNodeCondition : IfcBoundaryCondition + { + internal IfcTranslationalStiffnessSelect mTranslationalStiffnessX, mTranslationalStiffnessY, mTranslationalStiffnessZ;// : OPTIONAL IfcTranslationalStiffnessSelect; + internal IfcRotationalStiffnessSelect mRotationalStiffnessX, mRotationalStiffnessY, mRotationalStiffnessZ;// : OPTIONAL IfcRotationalStiffnessSelect; + internal IfcBoundaryNodeCondition() : base() { } + internal IfcBoundaryNodeCondition(IfcBoundaryNodeCondition i) : base(i) { mTranslationalStiffnessX = i.mTranslationalStiffnessX; mTranslationalStiffnessY = i.mTranslationalStiffnessY; mTranslationalStiffnessZ = i.mTranslationalStiffnessZ; mRotationalStiffnessX = i.mRotationalStiffnessX; mRotationalStiffnessY = i.mRotationalStiffnessY; mRotationalStiffnessZ = i.mRotationalStiffnessZ; } + public IfcBoundaryNodeCondition(DatabaseIfc m, string name, bool restrainX, bool restrainY, bool restrainZ, bool restrainXX, bool restrainYY, bool restrainZZ) + : this(m, name, new IfcTranslationalStiffnessSelect(restrainX), new IfcTranslationalStiffnessSelect(restrainY), new IfcTranslationalStiffnessSelect(restrainZ), new IfcRotationalStiffnessSelect(restrainXX), new IfcRotationalStiffnessSelect(restrainYY), new IfcRotationalStiffnessSelect(restrainZZ)) { } + internal IfcBoundaryNodeCondition(DatabaseIfc m, string name, IfcTranslationalStiffnessSelect x, IfcTranslationalStiffnessSelect y, IfcTranslationalStiffnessSelect z, IfcRotationalStiffnessSelect xx, IfcRotationalStiffnessSelect yy, IfcRotationalStiffnessSelect zz) + : base(m, name) + { + + if (m.mSchema == Schema.IFC2x3) + { + if (x != null && (x.mRigid || x.mStiffness == null)) + mTranslationalStiffnessX = new IfcTranslationalStiffnessSelect(x.mRigid ? -1 : 0); + if (y != null && (y.mRigid || y.mStiffness == null)) + mTranslationalStiffnessY = new IfcTranslationalStiffnessSelect(y.mRigid ? -1 : 0); + if (z != null && (z.mRigid || z.mStiffness == null)) + mTranslationalStiffnessZ = new IfcTranslationalStiffnessSelect(z.mRigid ? -1 : 0); + if (xx != null && (xx.mRigid || xx.mStiffness == null)) + mRotationalStiffnessX = new IfcRotationalStiffnessSelect(xx.mRigid ? -1 : 0); + if (yy != null && (yy.mRigid || yy.mStiffness == null)) + mRotationalStiffnessY = new IfcRotationalStiffnessSelect(yy.mRigid ? -1 : 0); + if (zz != null && (zz.mRigid || zz.mStiffness == null)) + mRotationalStiffnessZ = new IfcRotationalStiffnessSelect(zz.mRigid ? -1 : 0); + } + else + { + mTranslationalStiffnessX = x; + mTranslationalStiffnessY = y; + mTranslationalStiffnessZ = z; + mRotationalStiffnessX = xx; + mRotationalStiffnessY = yy; + mRotationalStiffnessZ = zz; + } + } + internal static IfcBoundaryNodeCondition Parse(string strDef) { IfcBoundaryNodeCondition b = new IfcBoundaryNodeCondition(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBoundaryNodeCondition b, List arrFields, ref int ipos, Schema schema) + { + IfcBoundaryCondition.parseFields(b, arrFields, ref ipos); + b.mTranslationalStiffnessX = IfcTranslationalStiffnessSelect.Parse(arrFields[ipos++], schema); + b.mTranslationalStiffnessY = IfcTranslationalStiffnessSelect.Parse(arrFields[ipos++], schema); + b.mTranslationalStiffnessZ = IfcTranslationalStiffnessSelect.Parse(arrFields[ipos++], schema); + b.mRotationalStiffnessX = IfcRotationalStiffnessSelect.Parse(arrFields[ipos++], schema); + b.mRotationalStiffnessY = IfcRotationalStiffnessSelect.Parse(arrFields[ipos++], schema); + b.mRotationalStiffnessZ = IfcRotationalStiffnessSelect.Parse(arrFields[ipos++], schema); + } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3) + return base.BuildString() + "," + (mTranslationalStiffnessX == null ? "$" : ParserSTEP.DoubleToString(mTranslationalStiffnessX.mStiffness.mValue)) + "," + + (mTranslationalStiffnessY == null ? "$" : ParserSTEP.DoubleToString(mTranslationalStiffnessY.mStiffness.mValue)) + "," + + (mTranslationalStiffnessZ == null ? "$" : ParserSTEP.DoubleToString(mTranslationalStiffnessZ.mStiffness.mValue)) + "," + + (mRotationalStiffnessX == null ? "$" : ParserSTEP.DoubleToString(mRotationalStiffnessX.mStiffness.mValue)) + "," + + (mRotationalStiffnessY == null ? "$" : ParserSTEP.DoubleToString(mRotationalStiffnessY.mStiffness.mValue)) + "," + + (mRotationalStiffnessZ == null ? "$" : ParserSTEP.DoubleToString(mRotationalStiffnessZ.mStiffness.mValue)); + return base.BuildString() + "," + (mTranslationalStiffnessX == null ? "$" : mTranslationalStiffnessX.ToString()) + "," + + (mTranslationalStiffnessY == null ? "$" : mTranslationalStiffnessY.ToString()) + "," + + (mTranslationalStiffnessZ == null ? "$" : mTranslationalStiffnessZ.ToString()) + "," + + (mRotationalStiffnessX == null ? "$" : mRotationalStiffnessX.ToString()) + "," + + (mRotationalStiffnessY == null ? "$" : mRotationalStiffnessY.ToString()) + "," + + (mRotationalStiffnessZ == null ? "$" : mRotationalStiffnessZ.ToString()); + } + } + + public class IfcBoundaryNodeConditionWarping : IfcBoundaryNodeCondition + { + internal IfcWarpingStiffnessSelect mWarpingStiffness;// : OPTIONAL IfcWarpingStiffnessSelect; + internal IfcBoundaryNodeConditionWarping() : base() { } + internal IfcBoundaryNodeConditionWarping(IfcBoundaryNodeConditionWarping i) : base(i) { mWarpingStiffness = i.mWarpingStiffness; } + internal IfcBoundaryNodeConditionWarping(DatabaseIfc m, string name, IfcTranslationalStiffnessSelect x, IfcTranslationalStiffnessSelect y, IfcTranslationalStiffnessSelect z, IfcRotationalStiffnessSelect xx, IfcRotationalStiffnessSelect yy, IfcRotationalStiffnessSelect zz, IfcWarpingStiffnessSelect w) + : base(m, name, x, y, z, xx, yy, zz) { mWarpingStiffness = w; } + internal new static IfcBoundaryNodeConditionWarping Parse(string strDef) { IfcBoundaryNodeConditionWarping b = new IfcBoundaryNodeConditionWarping(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBoundaryNodeConditionWarping b, List arrFields, ref int ipos) { IfcBoundaryNodeCondition.parseFields(b, arrFields, ref ipos); b.mWarpingStiffness = IfcWarpingStiffnessSelect.Parse(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + mWarpingStiffness.ToString(); } + } + public abstract partial class IfcBoundedCurve : IfcCurve //ABSTRACT SUPERTYPE OF (ONEOF (IfcBSplineCurve ,IfcCompositeCurve ,IfcPolyline ,IfcTrimmedCurve)) IFC4 IfcIndexedPolyCurve IFC4x1 IfcCurveSegment2D + { + protected IfcBoundedCurve() : base() { } + protected IfcBoundedCurve(IfcBoundedCurve pl) : base(pl) { } + protected IfcBoundedCurve(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcBoundedCurve c, List arrFields, ref int ipos) { IfcCurve.parseFields(c, arrFields, ref ipos); } + } + public abstract class IfcBoundedSurface : IfcSurface // ABSTRACT SUPERTYPE OF (ONEOF(IfcCurveBoundedPlane,IfcRectangularTrimmedSurface)) + { + protected IfcBoundedSurface() : base() { } + protected IfcBoundedSurface(IfcBoundedSurface p) : base(p) { } + protected IfcBoundedSurface(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcBoundedSurface s, List arrFields, ref int ipos) { IfcSurface.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcBoundingBox : IfcGeometricRepresentationItem + { + private int mCorner;// : IfcCartesianPoint; + private double mXDim, mYDim, mZDim;// : IfcPositiveLengthMeasure + + internal IfcCartesianPoint Corner { get { return mDatabase.mIfcObjects[mCorner] as IfcCartesianPoint; } } + internal double XDim { get { return mXDim; } } + internal double YDim { get { return mYDim; } } + internal double ZDim { get { return mZDim; } } + + internal IfcBoundingBox() : base() { } + internal IfcBoundingBox(IfcBoundingBox o) : base(o) { mCorner = o.mCorner; mXDim = o.mXDim; mYDim = o.mYDim; mZDim = o.mZDim; } + internal IfcBoundingBox(IfcCartesianPoint pt, double xdim, double ydim, double zdim) : base(pt.mDatabase) + { + //if (mModel.mModelView != ModelView.NotAssigned && mModel.mModelView != ModelView.IFC2x3Coordination) + // throw new Exception("Invalid Model View for IfcBoundingBox : " + m.ModelView.ToString()); + mCorner = pt.mIndex; + mXDim = xdim; + mYDim = ydim; + mZDim = zdim; + } + internal static IfcBoundingBox Parse(string strDef) { IfcBoundingBox b = new IfcBoundingBox(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBoundingBox b, List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(b, arrFields, ref ipos); + b.mCorner = ParserSTEP.ParseLink(arrFields[ipos++]); + b.mXDim = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mYDim = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mZDim = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mCorner) + "," + ParserSTEP.DoubleToString(mXDim) + "," + ParserSTEP.DoubleToString(mYDim) + "," + ParserSTEP.DoubleToString(mZDim); } + } + public partial class IfcBoxedHalfSpace : IfcHalfSpaceSolid + { + private int mEnclosure;// : IfcBoundingBox; + internal IfcBoundingBox Enclosure { get { return mDatabase.mIfcObjects[mEnclosure] as IfcBoundingBox; } } + + internal IfcBoxedHalfSpace() : base() { } + internal IfcBoxedHalfSpace(IfcBoxedHalfSpace pl) : base(pl) { mEnclosure = pl.mEnclosure; } + internal static void parseFields(IfcBoxedHalfSpace s, List arrFields, ref int ipos) { IfcHalfSpaceSolid.parseFields(s, arrFields, ref ipos); s.mEnclosure = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal new static IfcBoxedHalfSpace Parse(string strDef) { IfcBoxedHalfSpace s = new IfcBoxedHalfSpace(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mEnclosure); } + } + public abstract partial class IfcBSplineCurve : IfcBoundedCurve //SUPERTYPE OF(IfcBSplineCurveWithKnots) + { + private int mDegree;// : INTEGER; + private List mControlPointsList = new List();// : LIST [2:?] OF IfcCartesianPoint; + private IfcBSplineCurveForm mCurveForm;// : IfcBSplineCurveForm; + private IfcLogicalEnum mClosedCurve;// : LOGICAL; + private IfcLogicalEnum mSelfIntersect;// : LOGICAL; + + internal int Degree { get { return mDegree; } } + internal List ControlPointsList { get { return mControlPointsList.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCartesianPoint); } } + internal IfcBSplineCurveForm CurveForm { get { return mCurveForm; } } + internal IfcLogicalEnum ClosedCurve { get { return mClosedCurve; } } + internal IfcLogicalEnum SelfIntersect { get { return mSelfIntersect; } } + + protected IfcBSplineCurve() : base() { } + protected IfcBSplineCurve(IfcBSplineCurve pl) + : base(pl) + { + mDegree = pl.mDegree; + mControlPointsList = new List(pl.mControlPointsList.ToArray()); + mCurveForm = pl.mCurveForm; + mClosedCurve = pl.mClosedCurve; + mSelfIntersect = pl.mSelfIntersect; + } + private IfcBSplineCurve(DatabaseIfc m, int degree, IfcBSplineCurveForm form, IfcLogicalEnum closed, IfcLogicalEnum selfIntersect) + : base(m) + { + mDegree = degree; + mCurveForm = form; + mClosedCurve = closed; + mSelfIntersect = selfIntersect; + } + + protected static void parseFields(IfcBSplineCurve c, List arrFields, ref int ipos) + { + IfcBoundedCurve.parseFields(c, arrFields, ref ipos); + c.mDegree = int.Parse(arrFields[ipos++]); + c.mControlPointsList = ParserSTEP.SplitListLinks(arrFields[ipos++]); + c.mCurveForm = (IfcBSplineCurveForm)Enum.Parse(typeof(IfcBSplineCurveForm), arrFields[ipos++].Replace(".", "")); + c.mClosedCurve = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + c.mSelfIntersect = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + mDegree + ",("; + str += ParserSTEP.LinkToString(mControlPointsList[0]); + for (int icounter = 1; icounter < mControlPointsList.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mControlPointsList[icounter]); + return str + "),." + mCurveForm.ToString() + ".," + ParserIfc.LogicalToString(mClosedCurve) + "," + + ParserIfc.LogicalToString(mSelfIntersect); + } + } + public partial class IfcBSplineCurveWithKnots : IfcBSplineCurve + { + private List mMultiplicities = new List();// : LIST [2:?] OF INTEGER; + private List mKnots = new List();// : LIST [2:?] OF IfcParameterValue; + private IfcKnotType mKnotSpec = IfcKnotType.UNSPECIFIED;//: IfcKnotType; + + internal List Multiplicities { get { return mMultiplicities; } } + internal List Knots { get { return mKnots; } } + internal IfcKnotType KnotSpec { get { return mKnotSpec; } } + + internal IfcBSplineCurveWithKnots() : base() { } + internal IfcBSplineCurveWithKnots(IfcBSplineCurveWithKnots pl) + : base(pl) + { + mMultiplicities = new List(pl.mMultiplicities.ToArray()); + mKnots = new List(pl.mKnots.ToArray()); + mKnotSpec = pl.mKnotSpec; + } + + internal static void parseFields(IfcBSplineCurveWithKnots c, List arrFields, ref int ipos) + { + IfcBSplineCurve.parseFields(c, arrFields, ref ipos); + string s = arrFields[ipos++]; + List arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrLists.Count; icounter++) + c.mMultiplicities.Add(ParserSTEP.ParseInt(arrLists[icounter])); + s = arrFields[ipos++]; + arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrLists.Count; icounter++) + c.mKnots.Add(ParserSTEP.ParseDouble(arrLists[icounter])); + c.mKnotSpec = (IfcKnotType)Enum.Parse(typeof(IfcKnotType), arrFields[ipos++].Replace(".", "")); + } + internal static IfcBSplineCurveWithKnots Parse(string strDef) { IfcBSplineCurveWithKnots c = new IfcBSplineCurveWithKnots(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.IntToString(mMultiplicities[0]); + for (int jcounter = 1; jcounter < mMultiplicities.Count; jcounter++) + str += "," + ParserSTEP.IntToString(mMultiplicities[jcounter]); + str += "),(" + ParserSTEP.DoubleToString(mKnots[0]); + for (int jcounter = 1; jcounter < mKnots.Count; jcounter++) + str += "," + ParserSTEP.DoubleToString(mKnots[jcounter]); + return str + "),." + mKnotSpec.ToString() + "."; + } + } + public abstract partial class IfcBSplineSurface : IfcBoundedSurface //ABSTRACT SUPERTYPE OF (IfcBSplineSurfaceWithKnots) + { + private int mUDegree;// : INTEGER; + private int mVDegree;// : INTEGER; + private List> mControlPointsList = new List>();// : LIST [2:?] OF LIST [2:?] OF IfcCartesianPoint; + private IfcBSplineSurfaceForm mSurfaceForm = IfcBSplineSurfaceForm.UNSPECIFIED;// : IfcBSplineSurfaceForm; + private IfcLogicalEnum mUClosed = IfcLogicalEnum.UNKNOWN;// : LOGICAL; + private IfcLogicalEnum mVClosed = IfcLogicalEnum.UNKNOWN;// : LOGICAL; + private IfcLogicalEnum mSelfIntersect = IfcLogicalEnum.UNKNOWN;// : LOGICAL; + + internal int UDegree { get { return mUDegree; } } + internal int VDegree { get { return mVDegree; } } + internal List> ControlPointsList { get { return mControlPointsList.ConvertAll(x => x.ConvertAll(y => mDatabase.mIfcObjects[y] as IfcCartesianPoint)); } } + internal IfcBSplineSurfaceForm SurfaceForm { get { return mSurfaceForm; } } + internal IfcLogicalEnum UClosed { get { return mUClosed; } } + internal IfcLogicalEnum VClosed { get { return mVClosed; } } + internal IfcLogicalEnum SelfIntersect { get { return mSelfIntersect; } } + + protected IfcBSplineSurface() : base() { } + protected IfcBSplineSurface(IfcBSplineSurface pl) + : base(pl) + { + mUDegree = pl.mUDegree; + mVDegree = pl.mVDegree; + for (int icounter = 0; icounter < pl.mControlPointsList.Count; icounter++) + mControlPointsList.Add(new List(pl.mControlPointsList[icounter].ToArray())); + mSurfaceForm = pl.mSurfaceForm; + mUClosed = pl.mUClosed; + mVClosed = pl.mVClosed; + mSelfIntersect = pl.mSelfIntersect; + } + private IfcBSplineSurface(DatabaseIfc m, int uDegree, int vDegree, IfcBSplineSurfaceForm form, IfcLogicalEnum uClosed, IfcLogicalEnum vClosed, IfcLogicalEnum selfIntersect) + : base(m) + { + mUDegree = uDegree; + mVDegree = vDegree; + mSurfaceForm = form; + mUClosed = uClosed; + mVClosed = vClosed; + mSelfIntersect = selfIntersect; + } + protected IfcBSplineSurface(DatabaseIfc m, int uDegree, int vDegree, List> controlPoints, IfcBSplineSurfaceForm form, IfcLogicalEnum uClosed, IfcLogicalEnum vClosed, IfcLogicalEnum selfIntersect) : + this(m, uDegree, vDegree, form, uClosed, vClosed, selfIntersect) + { + foreach (List cps in controlPoints) + mControlPointsList.Add(cps.ConvertAll(x => x.mIndex)); + } + + protected static void parseFields(IfcBSplineSurface bs, List arrFields, ref int ipos) + { + IfcBoundedSurface.parseFields(bs, arrFields, ref ipos); + bs.mUDegree = int.Parse(arrFields[ipos++]); + bs.mVDegree = int.Parse(arrFields[ipos++]); + string s = arrFields[ipos++]; + List arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + int ilast = arrLists.Count; + for (int icounter = 0; icounter < ilast; icounter++) + { + List points = new List(); + s = arrLists[icounter]; + List arrPoints = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int jcounter = 0; jcounter < arrPoints.Count; jcounter++) + points.Add(ParserSTEP.ParseLink(arrPoints[jcounter])); + bs.mControlPointsList.Add(points); + } + bs.mSurfaceForm = (IfcBSplineSurfaceForm)Enum.Parse(typeof(IfcBSplineSurfaceForm), arrFields[ipos++].Replace(".", "")); + bs.mUClosed = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + bs.mVClosed = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + bs.mSelfIntersect = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + } + protected override string BuildString() + { + List cps = mControlPointsList[0]; + string str = base.BuildString() + "," + mUDegree + "," + mVDegree + ",((" + + ParserSTEP.LinkToString(cps[0]); + for (int jcounter = 1; jcounter < cps.Count; jcounter++) + str += "," + ParserSTEP.LinkToString(cps[jcounter]); + str += ")"; + for (int icounter = 1; icounter < mControlPointsList.Count; icounter++) + { + cps = mControlPointsList[icounter]; + str += ",(" + ParserSTEP.LinkToString(cps[0]); + for (int jcounter = 1; jcounter < cps.Count; jcounter++) + str += "," + ParserSTEP.LinkToString(cps[jcounter]); + str += ")"; + } + return str + "),." + mSurfaceForm.ToString() + ".," + ParserIfc.LogicalToString(mUClosed) + "," + + ParserIfc.LogicalToString(mVClosed) + "," + ParserIfc.LogicalToString(mSelfIntersect); + } + } + public partial class IfcBSplineSurfaceWithKnots : IfcBSplineSurface + { + internal List mUMultiplicities = new List();// : LIST [2:?] OF INTEGER; + internal List mVMultiplicities = new List();// : LIST [2:?] OF INTEGER; + internal List mUKnots = new List();// : LIST [2:?] OF IfcParameterValue; + internal List mVKnots = new List();// : LIST [2:?] OF IfcParameterValue; + internal IfcKnotType mKnotSpec = IfcKnotType.UNSPECIFIED;//: IfcKnotType; + internal IfcBSplineSurfaceWithKnots() : base() { } + internal IfcBSplineSurfaceWithKnots(IfcBSplineSurfaceWithKnots s) + : base(s) + { + mUMultiplicities = new List(s.mUMultiplicities.ToArray()); + mVMultiplicities = new List(s.mVMultiplicities.ToArray()); + mUKnots = new List(s.mUKnots.ToArray()); + mVKnots = new List(s.mVKnots.ToArray()); + mKnotSpec = s.mKnotSpec; + } + internal IfcBSplineSurfaceWithKnots(DatabaseIfc m, int uDegree, int vDegree, IfcBSplineSurfaceForm form, List> controlPoints, IfcLogicalEnum uClosed, IfcLogicalEnum vClosed, IfcLogicalEnum selfIntersect, List uMultiplicities, List vMultiplicities, List uKnots, List vKnots, IfcKnotType type) + : base(m, uDegree, vDegree, controlPoints, form, uClosed, vClosed, selfIntersect) + { + mUMultiplicities.AddRange(uMultiplicities); + mVMultiplicities.AddRange(vMultiplicities); + mUKnots.AddRange(uKnots); + mVKnots.AddRange(vKnots); + } + + internal static void parseFields(IfcBSplineSurfaceWithKnots ss, List arrFields, ref int ipos) + { + IfcBSplineSurface.parseFields(ss, arrFields, ref ipos); + string s = arrFields[ipos++]; + List arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrLists.Count; icounter++) + ss.mUMultiplicities.Add(ParserSTEP.ParseInt(arrLists[icounter])); + s = arrFields[ipos++]; + arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrLists.Count; icounter++) + ss.mVMultiplicities.Add(ParserSTEP.ParseInt(arrLists[icounter])); + s = arrFields[ipos++]; + arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrLists.Count; icounter++) + ss.mUKnots.Add(ParserSTEP.ParseDouble(arrLists[icounter])); + s = arrFields[ipos++]; + arrLists = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrLists.Count; icounter++) + ss.mVKnots.Add(ParserSTEP.ParseDouble(arrLists[icounter])); + ss.mKnotSpec = (IfcKnotType)Enum.Parse(typeof(IfcKnotType), arrFields[ipos++].Replace(".", "")); + } + internal static IfcBSplineSurfaceWithKnots Parse(string strDef) { IfcBSplineSurfaceWithKnots s = new IfcBSplineSurfaceWithKnots(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.IntToString(mUMultiplicities[0]); + for (int jcounter = 1; jcounter < mUMultiplicities.Count; jcounter++) + str += "," + ParserSTEP.IntToString(mUMultiplicities[jcounter]); + str += "),(" + ParserSTEP.IntToString(mVMultiplicities[0]); + for (int jcounter = 1; jcounter < mVMultiplicities.Count; jcounter++) + str += "," + ParserSTEP.IntToString(mVMultiplicities[jcounter]); + str += "),(" + ParserSTEP.DoubleToString(mUKnots[0]); + for (int jcounter = 1; jcounter < mUKnots.Count; jcounter++) + str += "," + ParserSTEP.DoubleToString(mUKnots[jcounter]); + str += "),(" + ParserSTEP.DoubleToString(mVKnots[0]); + for (int jcounter = 1; jcounter < mVKnots.Count; jcounter++) + str += "," + ParserSTEP.DoubleToString(mVKnots[jcounter]); + return str + "),." + mKnotSpec.ToString() + "."; + } + } + public partial class IfcBuilding : IfcSpatialStructureElement + { + internal double mElevationOfRefHeight;// : OPTIONAL IfcLengthMeasure; + internal double mElevationOfTerrain;// : OPTIONAL IfcLengthMeasure; + internal int mBuildingAddress;// : OPTIONAL IfcPostalAddress; + + internal double ElevationOfRefHeight { get { return mElevationOfRefHeight; } set {mElevationOfRefHeight = value; } } + internal double ElevationOfTerrain { get { return mElevationOfTerrain; } set {mElevationOfTerrain = value; } } + internal IfcPostalAddress BuildingAddress {get {return mDatabase.mIfcObjects[mBuildingAddress] as IfcPostalAddress;} set { mBuildingAddress = (value == null ? 0 : value.mIndex); }} + + internal IfcBuilding() : base() { } + internal IfcBuilding(IfcBuilding p) : base(p) { mElevationOfRefHeight = p.mElevationOfRefHeight; mElevationOfTerrain = p.mElevationOfTerrain; mBuildingAddress = p.mBuildingAddress; } + public IfcBuilding(DatabaseIfc db, string name) : base(db) { Name = name; } + public IfcBuilding(IfcBuilding host, string name) : base(host, name) { } + public IfcBuilding(IfcSite host, string name) : base(host, name) { } + + private void init(IfcSpatialElement container) + { + IfcRelAggregates ra = new IfcRelAggregates(mDatabase, "Building", "Building Storie", this); + if (container != null) + container.addBuilding(this); + //mBuildingAddress = new IfcPostalAddress(mModel, IfcAddressTypeEnum.NOTDEFINED).mIndex; + } + internal static IfcBuilding Parse(string strDef) { IfcBuilding b = new IfcBuilding(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcBuilding b, List arrFields, ref int ipos) { IfcSpatialStructureElement.parseFields(b, arrFields, ref ipos); b.mElevationOfRefHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); b.mElevationOfTerrain = ParserSTEP.ParseDouble(arrFields[ipos++]); b.mBuildingAddress = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mElevationOfRefHeight) + "," + ParserSTEP.DoubleOptionalToString(mElevationOfTerrain) + "," + ParserSTEP.LinkToString(mBuildingAddress); } + + internal new bool addStorey(IfcBuildingStorey s) { return base.addStorey(s); } + } + public abstract partial class IfcBuildingElement : IfcElement //ABSTRACT SUPERTYPE OF (ONEOF (IfcBeam,IfcBuildingElementProxy,IfcColumn,IfcCovering,IfcCurtainWall,IfcDoor,IfcFooting + { //,IfcMember,IfcPile,IfcPlate,IfcRailing,IfcRamp,IfcRampFlight,IfcRoof,IfcSlab,IfcStair,IfcStairFlight,IfcWall,IfcWindow) IFC2x3 IfcBuildingElementComponent IFC4 IfcShadingDevice + internal new enum SubTypes { IfcBeam, IfcBuildingElementProxy, IfcColumn, IfcCovering, IfcCurtainWall, IfcDoor, IfcFooting, IfcMember, IfcPile, IfcPlate, IfcRailing, IfcRamp, IfcRampFlight, IfcRoof, IfcShadingDevice, IfcSlab, IfcStair, IfcStairFlight, IfcWall, IfcWindow } + protected IfcBuildingElement() : base() { } + protected IfcBuildingElement(IfcBuildingElement e) : base(e) { } + protected IfcBuildingElement(DatabaseIfc m) : base(m) { } + protected IfcBuildingElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + protected static void parseFields(IfcBuildingElement e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + } + /*internal class IfcBuildingElementComponent : IfcBuildingElement //IFC4 DELETED + { + protected IfcBuildingElementComponent(IfcBuildingElementComponent b) : base(b) { } + protected IfcBuildingElementComponent() : base() { } + protected static void parseFields(IfcBuildingElementComponent c, List arrFields, ref int ipos) { IfcBuildingElement.parseFields(c, arrFields, ref ipos); } + }*/ + public partial class IfcBuildingElementPart : IfcElementComponent + { + internal IfcBuildingElementPartTypeEnum mPredefinedType = IfcBuildingElementPartTypeEnum.NOTDEFINED;//: OPTIONAL IfcBuildingElementPartTypeEnum; IFC4 added + public IfcBuildingElementPartTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcBuildingElementPart() : base() { } + internal IfcBuildingElementPart(IfcBuildingElementPart b) : base(b) { } + internal IfcBuildingElementPart(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static IfcBuildingElementPart Parse(string strDef, Schema schema) { IfcBuildingElementPart p = new IfcBuildingElementPart(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcBuildingElementPart a, List arrFields, ref int ipos, Schema schema) + { + IfcElementComponent.parseFields(a, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcBuildingElementPartTypeEnum)Enum.Parse(typeof(IfcBuildingElementPartTypeEnum), s.Replace(".", "")); + } + } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcBuildingElementPartTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + //internal override void repair() { mObjectType = "$"; base.repair(); } + } + public partial class IfcBuildingElementPartType : IfcElementComponentType + { + internal IfcBuildingElementPartTypeEnum mPredefinedType = IfcBuildingElementPartTypeEnum.NOTDEFINED;// : IfcBuildingElementPartTypeEnum; + public IfcBuildingElementPartTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcBuildingElementPartType() : base() { } + internal IfcBuildingElementPartType(IfcBuildingElementPartType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcBuildingElementPartType(DatabaseIfc m, string name, IfcBuildingElementPartTypeEnum type) : base(m) { Name = name; if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception("XXX Only valid in IFC4 or newer!"); mPredefinedType = type; } + internal static void parseFields(IfcBuildingElementPartType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcBuildingElementPartTypeEnum)Enum.Parse(typeof(IfcBuildingElementPartTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcBuildingElementPartType Parse(string strDef) { IfcBuildingElementPartType t = new IfcBuildingElementPartType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcBuildingElementProxy : IfcBuildingElement + { + internal IfcBuildingElementProxyTypeEnum mPredefinedType = IfcBuildingElementProxyTypeEnum.NOTDEFINED; + //Ifc2x3 internal IfcElementCompositionEnum mCompositionType = IfcElementCompositionEnum.NA;// : OPTIONAL IfcElementCompositionEnum; + public IfcBuildingElementProxyTypeEnum PredefinedType + { + get { return mPredefinedType; } + set + { + mPredefinedType = value; + if (mDatabase.mSchema == Schema.IFC2x3 && value != IfcBuildingElementProxyTypeEnum.NOTDEFINED && value != IfcBuildingElementProxyTypeEnum.COMPLEX && value != IfcBuildingElementProxyTypeEnum.ELEMENT && value != IfcBuildingElementProxyTypeEnum.PARTIAL) + { + + } + } + } + + public override string Name { set { base.Name = (string.IsNullOrEmpty(value) ? "NOTDEFINED" : value); } } + + internal IfcBuildingElementProxy() : base() { } + internal IfcBuildingElementProxy(IfcBuildingElementProxy p) : base(p) { mPredefinedType = p.mPredefinedType; } + public IfcBuildingElementProxy(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { Name = "NOTDEFINED"; } + internal static void parseFields(IfcBuildingElementProxy p, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(p, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + { + try + { + p.mPredefinedType = (IfcBuildingElementProxyTypeEnum)Enum.Parse(typeof(IfcBuildingElementProxyTypeEnum), str.Replace(".", "")); + } + catch (Exception) { } + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 && (mPredefinedType == IfcBuildingElementProxyTypeEnum.NOTDEFINED || mPredefinedType == IfcBuildingElementProxyTypeEnum.PROVISIONFORVOID || mPredefinedType == IfcBuildingElementProxyTypeEnum.USERDEFINED) ? ",$" : ",." + mPredefinedType.ToString() + "."); } + internal static IfcBuildingElementProxy Parse(string strDef) { IfcBuildingElementProxy p = new IfcBuildingElementProxy(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + + } + public partial class IfcBuildingElementProxyType : IfcBuildingElementType + { + internal IfcBuildingElementProxyTypeEnum mPredefinedType = IfcBuildingElementProxyTypeEnum.NOTDEFINED;// : IfcBuildingElementProxyTypeEnum; + public IfcBuildingElementProxyTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcBuildingElementProxyType() : base() { } + internal IfcBuildingElementProxyType(IfcBuildingElementProxyType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcBuildingElementProxyType(DatabaseIfc m, string name, IfcBuildingElementProxyTypeEnum type) : base(m) + { + Name = name; + mPredefinedType = type; + if (m.mSchema == Schema.IFC2x3) + { + if (type != IfcBuildingElementProxyTypeEnum.USERDEFINED && type != IfcBuildingElementProxyTypeEnum.NOTDEFINED) + { + if (ElementType == "$") + ElementType = type.ToString(); + mPredefinedType = IfcBuildingElementProxyTypeEnum.USERDEFINED; + } + } + } + internal static void parseFields(IfcBuildingElementProxyType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); try { t.mPredefinedType = (IfcBuildingElementProxyTypeEnum)Enum.Parse(typeof(IfcBuildingElementProxyTypeEnum), arrFields[ipos++].Replace(".", "")); } catch (Exception) { } } + internal new static IfcBuildingElementProxyType Parse(string strDef) { IfcBuildingElementProxyType t = new IfcBuildingElementProxyType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcBuildingElementType : IfcElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcBeamType, IfcBuildingElementProxyType, IfcChimneyType, IfcColumnType, + { //IfcCoveringType, IfcCurtainWallType, IfcDoorType, IfcFootingType, IfcMemberType, IfcPileType, IfcPlateType, IfcRailingType, IfcRampFlightType, IfcRampType, + //IfcRoofType, IfcShadingDeviceType, IfcSlabType, IfcStairFlightType, IfcStairType, IfcWallType, IfcWindowType)) + protected IfcBuildingElementType() : base() { } + protected IfcBuildingElementType(IfcBuildingElementType t) : base(t) { } + protected IfcBuildingElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcBuildingElementType t, List arrFields, ref int ipos) { IfcElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcBuildingStorey : IfcSpatialStructureElement + { + internal double mElevation;// : OPTIONAL IfcLengthMeasure; + + public double Elevation + { + get { return mElevation; } + set + { + mElevation = value; +#if(RHINO) + try + { + int i = Rhino.RhinoDoc.ActiveDoc.NamedConstructionPlanes.Find(Name); + if (i >= 0) + Rhino.RhinoDoc.ActiveDoc.NamedConstructionPlanes.Delete(i); + Rhino.RhinoDoc.ActiveDoc.NamedConstructionPlanes.Add(Name, new Rhino.Geometry.Plane(new Rhino.Geometry.Point3d(0, 0, mElevation), Rhino.Geometry.Vector3d.XAxis, Rhino.Geometry.Vector3d.YAxis)); + } + catch (Exception) { } +#endif + } + } + public IfcBuildingStorey() : base() { } + internal IfcBuildingStorey(IfcBuildingStorey p) : base(p) { mElevation = p.mElevation; } + internal IfcBuildingStorey(IfcBuilding host, string name, double elev) : base(host.mDatabase) + { + host.addStorey(this); + Name = name; + Elevation = elev; + Placement = new IfcLocalPlacement(host.Placement, new IfcAxis2Placement3D(new IfcCartesianPoint(mDatabase, 0, 0, Elevation))); + } + internal static void parseFields(IfcBuildingStorey s, List arrFields, ref int ipos) { IfcSpatialStructureElement.parseFields(s, arrFields, ref ipos); s.mElevation = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mElevation); } + internal static IfcBuildingStorey Parse(string strDef) { IfcBuildingStorey s = new IfcBuildingStorey(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public class IfcBuildingSystem : IfcSystem //IFC4 + { + internal IfcBuildingSystemTypeEnum mPredefinedType = IfcBuildingSystemTypeEnum.NOTDEFINED;// : OPTIONAL IfcBuildingSystemTypeEnum; + internal string mLongName = "$"; // OPTIONAL IfcLabel IFC4ADD1 + + public IfcBuildingSystemTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public string LongName { get { return (mLongName == "$" ? "" : ParserIfc.Decode(mLongName)); } set { mLongName = (string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcBuildingSystem() : base() { } + internal IfcBuildingSystem(IfcBuildingSystem i) : base(i) { mLongName = i.mLongName; mPredefinedType = i.mPredefinedType; } + internal IfcBuildingSystem(IfcSpatialElement bldg, string name, IfcBuildingSystemTypeEnum type) : base(bldg, name) { mPredefinedType = type; } + internal new static IfcBuildingSystem Parse(string strDef) { IfcBuildingSystem m = new IfcBuildingSystem(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcBuildingSystem c, List arrFields, ref int ipos) + { + IfcSystem.parseFields(c, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + c.mPredefinedType = (IfcBuildingSystemTypeEnum)Enum.Parse(typeof(IfcBuildingSystemTypeEnum), s.Replace(".", "")); + if (ipos++ < arrFields.Count) + c.mLongName = arrFields[ipos].Replace("'", ""); + + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mLongName == "$" ? ",$,." : ",'" + mLongName + "',.") + mPredefinedType.ToString() + "."); } + } + public class IfcBurner : IfcEnergyConversionDevice //IFC4 + { + internal IfcBurnerTypeEnum mPredefinedType = IfcBurnerTypeEnum.NOTDEFINED;// OPTIONAL : IfcBurnerTypeEnum; + internal IfcBurner() : base() { } + internal IfcBurner(IfcBurner b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcBurner(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcBurner s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcBurnerTypeEnum)Enum.Parse(typeof(IfcBurnerTypeEnum), str); + } + internal new static IfcBurner Parse(string strDef) { IfcBurner s = new IfcBurner(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcBurnerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public partial class IfcBurnerType : IfcEnergyConversionDeviceType + { + internal IfcBurnerTypeEnum mPredefinedType = IfcBurnerTypeEnum.NOTDEFINED;// : IfcBurnerTypeEnum + public IfcBurnerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcBurnerType() : base() { } + internal IfcBurnerType(IfcBurnerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcBurnerType(DatabaseIfc m, string name, IfcBurnerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcBurnerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcBurnerTypeEnum)Enum.Parse(typeof(IfcBurnerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcBurnerType Parse(string strDef) { IfcBurnerType t = new IfcBurnerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } +} diff --git a/IFC/IFC C.cs b/IFC/IFC C.cs new file mode 100644 index 0000000..d8f2c48 --- /dev/null +++ b/IFC/IFC C.cs @@ -0,0 +1,2308 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + + +namespace GeometryGym.Ifc +{ + public class IfcCableCarrierFitting : IfcFlowFitting //IFC4 + { + internal IfcCableCarrierFittingTypeEnum mPredefinedType = IfcCableCarrierFittingTypeEnum.NOTDEFINED;// OPTIONAL : IfcCableCarrierFittingTypeEnum; + public IfcCableCarrierFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCableCarrierFitting() : base() { } + internal IfcCableCarrierFitting(IfcCableCarrierFitting f) : base(f) { mPredefinedType = f.mPredefinedType; } + internal IfcCableCarrierFitting(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCableCarrierFitting s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCableCarrierFittingTypeEnum)Enum.Parse(typeof(IfcCableCarrierFittingTypeEnum), str); + } + internal new static IfcCableCarrierFitting Parse(string strDef) { IfcCableCarrierFitting s = new IfcCableCarrierFitting(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCableCarrierFittingTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcCableCarrierFittingType : IfcFlowFittingType + { + internal IfcCableCarrierFittingTypeEnum mPredefinedType = IfcCableCarrierFittingTypeEnum.NOTDEFINED;// : IfcDuctFittingTypeEnum; + public IfcCableCarrierFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCableCarrierFittingType() : base() { } + internal IfcCableCarrierFittingType(IfcCableCarrierFittingType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal static void parseFields(IfcCableCarrierFittingType t, List arrFields, ref int ipos) { IfcFlowFittingType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCableCarrierFittingTypeEnum)Enum.Parse(typeof(IfcCableCarrierFittingTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCableCarrierFittingType Parse(string strDef) { IfcCableCarrierFittingType t = new IfcCableCarrierFittingType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcCableCarrierSegment : IfcFlowSegment //IFC4 + { + internal IfcCableCarrierSegmentTypeEnum mPredefinedType = IfcCableCarrierSegmentTypeEnum.NOTDEFINED;// OPTIONAL : IfcCableCarrierSegmentTypeEnum; + public IfcCableCarrierSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCableCarrierSegment() : base() { } + internal IfcCableCarrierSegment(IfcCableCarrierSegment s) : base(s) { mPredefinedType = s.mPredefinedType; } + + internal static void parseFields(IfcCableCarrierSegment s, List arrFields, ref int ipos) + { + IfcFlowSegment.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCableCarrierSegmentTypeEnum)Enum.Parse(typeof(IfcCableCarrierSegmentTypeEnum), str); + } + internal new static IfcCableCarrierSegment Parse(string strDef) { IfcCableCarrierSegment s = new IfcCableCarrierSegment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCableCarrierSegmentTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcCableCarrierSegmentType : IfcFlowSegmentType + { + internal IfcCableCarrierSegmentTypeEnum mPredefinedType = IfcCableCarrierSegmentTypeEnum.NOTDEFINED;// : IfcCableCarrierSegmentTypeEnum; + public IfcCableCarrierSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCableCarrierSegmentType() : base() { } + internal IfcCableCarrierSegmentType(IfcCableCarrierSegmentType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCableCarrierSegmentType(DatabaseIfc m, string name, IfcCableCarrierSegmentTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcCableCarrierSegmentType t, List arrFields, ref int ipos) { IfcFlowSegmentType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCableCarrierSegmentTypeEnum)Enum.Parse(typeof(IfcCableCarrierSegmentTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCableCarrierSegmentType Parse(string strDef) { IfcCableCarrierSegmentType t = new IfcCableCarrierSegmentType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCableFitting : IfcFlowFitting //IFC4 + { + internal IfcCableFittingTypeEnum mPredefinedType = IfcCableFittingTypeEnum.NOTDEFINED;// OPTIONAL : IfcCableFittingTypeEnum; + public IfcCableFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCableFitting() : base() { } + internal IfcCableFitting(IfcCableFitting b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcCableFitting(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCableFitting s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCableFittingTypeEnum)Enum.Parse(typeof(IfcCableFittingTypeEnum), str); + } + internal new static IfcCableFitting Parse(string strDef) { IfcCableFitting s = new IfcCableFitting(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCableFittingTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcCableFittingType : IfcFlowFittingType + { + internal IfcCableFittingTypeEnum mPredefinedType = IfcCableFittingTypeEnum.NOTDEFINED;// : IfcDuctFittingTypeEnum; + public IfcCableFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCableFittingType() : base() { } + internal IfcCableFittingType(IfcCableFittingType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal static void parseFields(IfcCableFittingType t, List arrFields, ref int ipos) { IfcFlowFittingType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCableFittingTypeEnum)Enum.Parse(typeof(IfcCableFittingTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCableFittingType Parse(string strDef) { IfcCableFittingType t = new IfcCableFittingType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcCableSegment : IfcFlowSegment //IFC4 + { + internal IfcCableSegmentTypeEnum mPredefinedType = IfcCableSegmentTypeEnum.NOTDEFINED;// OPTIONAL : IfcCableSegmentTypeEnum; + public IfcCableSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCableSegment() : base() { } + internal IfcCableSegment(IfcCableSegment s) : base(s) { mPredefinedType = s.mPredefinedType; } + + internal static void parseFields(IfcCableSegment s, List arrFields, ref int ipos) + { + IfcFlowSegment.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCableSegmentTypeEnum)Enum.Parse(typeof(IfcCableSegmentTypeEnum), str); + } + internal new static IfcCableSegment Parse(string strDef) { IfcCableSegment s = new IfcCableSegment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType.ToString() + "."); } + } + public class IfcCableSegmentType : IfcFlowSegmentType + { + internal IfcCableSegmentTypeEnum mPredefinedType = IfcCableSegmentTypeEnum.NOTDEFINED;// : IfcCableSegmentTypeEnum; + public IfcCableSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCableSegmentType() : base() { } + internal IfcCableSegmentType(IfcCableSegmentType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCableSegmentType(DatabaseIfc m, string name, IfcCableSegmentTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal IfcCableSegmentType(DatabaseIfc m, string name, IfcMaterialProfileSet mps, IfcCableSegmentTypeEnum t) : base(m) { Name = name; MaterialSelect = mps; PredefinedType = t; } + internal static void parseFields(IfcCableSegmentType t, List arrFields, ref int ipos) { IfcFlowSegmentType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCableSegmentTypeEnum)Enum.Parse(typeof(IfcCableCarrierSegmentTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCableSegmentType Parse(string strDef) { IfcCableSegmentType t = new IfcCableSegmentType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCalendarDate : BaseClassIfc, IfcDateTimeSelect //DEPRECEATED IFC4 + { + internal int mDayComponent;// : IfcDayInMonthNumber; + internal int mMonthComponent;// : IfcMonthInYearNumber; + internal int mYearComponent;// : IfcYearNumber; + + internal IfcCalendarDate() : base() { } + internal IfcCalendarDate(IfcCalendarDate i) : base() { mDayComponent = i.mDayComponent; mMonthComponent = i.mMonthComponent; mYearComponent = i.mYearComponent; } + internal IfcCalendarDate(DatabaseIfc m, int day, int month, int year) : base(m) + { + if (m.mSchema != Schema.IFC2x3) throw new Exception("IfcCalanderDate DEPRECEATED, use IfcDate"); + mDayComponent = day; + mMonthComponent = month; + mYearComponent = year; + } + internal static IfcCalendarDate Parse(string strDef) { IfcCalendarDate d = new IfcCalendarDate(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcCalendarDate c, List arrFields, ref int ipos) + { + c.mDayComponent = ParserSTEP.ParseInt(arrFields[ipos++]); + c.mMonthComponent = ParserSTEP.ParseInt(arrFields[ipos++]); + c.mYearComponent = ParserSTEP.ParseInt(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + mDayComponent + "," + mMonthComponent + "," + mYearComponent; } + public DateTime DateTime { get { return new DateTime(mYearComponent, mMonthComponent, mDayComponent); } } + } + public partial class IfcCartesianPoint : IfcPoint + { + private double mCoordinateX = 0, mCoordinateY = 0, mCoordinateZ = 0; + + internal IfcCartesianPoint() : base() { } + internal IfcCartesianPoint(IfcCartesianPoint p) : base() + { + mCoordinateX = p.mCoordinateX; + mCoordinateY = p.mCoordinateY; + mCoordinateZ = p.mCoordinateZ; + } + public IfcCartesianPoint(DatabaseIfc m, double x, double y) : base(m) { mCoordinateX = x; mCoordinateY = y; mCoordinateZ = double.NaN; } + public IfcCartesianPoint(DatabaseIfc m, double x, double y, double z) : base(m) { mCoordinateX = x; mCoordinateY = y; mCoordinateZ = z; } + internal static void parseFields(IfcCartesianPoint p, List arrFields, ref int ipos) + { + IfcPoint.parseFields(p, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s != "$") + { + List arrCoords = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + int count = arrCoords.Count; + if (count > 0) + { + p.mCoordinateX = ParserSTEP.ParseDouble(arrCoords[0]); + if (count > 1) + { + p.mCoordinateY = ParserSTEP.ParseDouble(arrCoords[1]); + p.mCoordinateZ = (count > 2 ? ParserSTEP.ParseDouble(arrCoords[2]) : double.NaN); + } + } + } + } + internal static IfcCartesianPoint Parse(string str) + { + IfcCartesianPoint p = new IfcCartesianPoint(); + if (str[0] == '(') + { + int pos = 1; + string val = ParserSTEP.StripField(str, ref pos); + + if (!string.IsNullOrEmpty(val)) + p.mCoordinateX = ParserSTEP.ParseDouble(val); + val = ParserSTEP.StripField(str, ref pos); + if (!string.IsNullOrEmpty(val)) + p.mCoordinateY = ParserSTEP.ParseDouble(val); + if (pos >= str.Length) + p.mCoordinateZ = double.NaN; + else + { + val = str.Substring(pos, str.Length - pos - 1);// ParserSTEP.StripField(str.Substring(ref pos); + p.mCoordinateZ = (string.IsNullOrEmpty(val) ? double.NaN : ParserSTEP.ParseDouble(val)); + } + } + return p; + } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + double tol = (mDatabase.mGeomRepContxt != null ? mDatabase.mGeomRepContxt.mPrecision / 100 : 1e-6); + double x = mCoordinateX, y = mCoordinateY; + if (Math.Abs(x) < tol) + x = 0; + if (Math.Abs(y) < tol) + y = 0; + if (Is2D()) + return base.BuildString() + ",(" + ParserSTEP.DoubleToString(x) + "," + ParserSTEP.DoubleToString(y) + ")"; + double z = mCoordinateZ; + if (Math.Abs(z) < tol) + z = 0; + return base.BuildString() + ",(" + ParserSTEP.DoubleToString(x) + "," + + ParserSTEP.DoubleToString(y) + "," + ParserSTEP.DoubleToString(z) + ")"; + } + internal bool Is2D() { return double.IsNaN(mCoordinateZ); } + } + public abstract partial class IfcCartesianPointList : IfcGeometricRepresentationItem //IFC4 + { + protected IfcCartesianPointList() : base() { } + protected IfcCartesianPointList(IfcCartesianPointList o) : base(o) { } + protected IfcCartesianPointList(DatabaseIfc m) : base(m) { } + } + public partial class IfcCartesianPointList2D : IfcCartesianPointList //IFC4 + { + private Tuple[] mCoordList = new Tuple[0];// : LIST [1:?] OF LIST [2:2] OF IfcLengthMeasure; + + internal IfcCartesianPointList2D() : base() { } + internal IfcCartesianPointList2D(IfcCartesianPointList2D o) : base(o) { mCoordList = o.mCoordList; } + public IfcCartesianPointList2D(DatabaseIfc m, IEnumerable> coordList) : base(m) + { + List> pts = new List>(); + foreach (Tuple t in coordList) + pts.Add(new Tuple(t.Item1, t.Item2)); + mCoordList = pts.ToArray(); + } + internal static IfcCartesianPointList2D Parse(string strDef) + { + IfcCartesianPointList2D l = new IfcCartesianPointList2D(); + l.mCoordList = ParserSTEP.SplitListDoubleTuple(strDef); + return l; + } + protected override string BuildString() + { + StringBuilder sb = new StringBuilder(); + Tuple p = mCoordList[0]; + sb.Append(",((" + ParserSTEP.DoubleToString(p.Item1) + "," + ParserSTEP.DoubleToString(p.Item2) + ")"); + for (int icounter = 1; icounter < mCoordList.Length; icounter++) + { + p = mCoordList[icounter]; + sb.Append(",(" + ParserSTEP.DoubleToString(p.Item1) + "," + ParserSTEP.DoubleToString(p.Item2) + ")"); + } + return base.BuildString() + sb.ToString() + ")"; + } + } + public partial class IfcCartesianPointList3D : IfcCartesianPointList //IFC4 + { + private Tuple[] mCoordList = new Tuple[0];// : LIST [1:?] OF LIST [3:3] OF IfcLengthMeasure; + + internal IfcCartesianPointList3D() : base() { } + internal IfcCartesianPointList3D(IfcCartesianPointList3D o) : base(o) { mCoordList = o.mCoordList; } + public IfcCartesianPointList3D(DatabaseIfc m, IEnumerable> coordList) : base(m) + { + List> pts = new List>(); + foreach (Tuple t in coordList) + pts.Add(new Tuple(t.Item1, t.Item2, t.Item3)); + mCoordList = pts.ToArray(); + } + internal static IfcCartesianPointList3D Parse(string strDef) + { + IfcCartesianPointList3D l = new IfcCartesianPointList3D(); + l.mCoordList = ParserSTEP.SplitListDoubleTriple(strDef); + return l; + } + protected override string BuildString() + { + StringBuilder sb = new StringBuilder(); + Tuple p = mCoordList[0]; + sb.Append(",((" + ParserSTEP.DoubleToString(p.Item1) + "," + ParserSTEP.DoubleToString(p.Item2) + "," + ParserSTEP.DoubleToString(p.Item3) + ")"); + for (int icounter = 1; icounter < mCoordList.Length; icounter++) + { + p = mCoordList[icounter]; + sb.Append(",(" + ParserSTEP.DoubleToString(p.Item1) + "," + ParserSTEP.DoubleToString(p.Item2) + "," + ParserSTEP.DoubleToString(p.Item3) + ")"); + } + return base.BuildString() + sb.ToString() + ")"; + } + } + public abstract partial class IfcCartesianTransformationOperator : IfcGeometricRepresentationItem /*ABSTRACT SUPERTYPE OF (ONEOF (IfcCartesianTransformationOperator2D ,IfcCartesianTransformationOperator3D))*/ + { //http://www.buildingsmart-tech.org/ifc/ifc2x3/tc1/html/ifcprofileresource/lexical/ifcderivedprofiledef.htm for examples + private int mAxis1;// : OPTIONAL IfcDirection + private int mAxis2;// : OPTIONAL IfcDirection; + private int mLocalOrigin;// : IfcCartesianPoint; + private double mScale = 1;// : OPTIONAL REAL; + + internal IfcDirection Axis1 { get { return mDatabase.mIfcObjects[mAxis1] as IfcDirection; } set { mAxis1 = (value == null ? 0 : value.mIndex); } } + internal IfcDirection Axis2 { get { return mDatabase.mIfcObjects[mAxis2] as IfcDirection; } set { mAxis2 = (value == null ? 0 : value.mIndex); } } + internal IfcCartesianPoint LocalOrigin { get { return mDatabase.mIfcObjects[mLocalOrigin] as IfcCartesianPoint; } set { mLocalOrigin = value.mIndex; } } + internal double Scale { get { return mScale; } set { mScale = value; } } + + protected IfcCartesianTransformationOperator() { } + protected IfcCartesianTransformationOperator(IfcCartesianTransformationOperator o) : base(o) { mAxis1 = o.mAxis1; mAxis2 = o.mAxis2; mLocalOrigin = o.mLocalOrigin; mScale = o.mScale; } + protected IfcCartesianTransformationOperator(DatabaseIfc db) : base(db) { mLocalOrigin = db.WorldOrigin.mIndex; } + protected IfcCartesianTransformationOperator(DatabaseIfc db, IfcDirection ax1, IfcDirection ax2, IfcCartesianPoint o, double scale) + : base(db) { if (ax1 != null) mAxis1 = ax1.mIndex; if (ax2 != null) mAxis2 = ax2.mIndex; mLocalOrigin = o.mIndex; mScale = scale; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mAxis1) + "," + ParserSTEP.LinkToString(mAxis2) + "," + ParserSTEP.LinkToString(mLocalOrigin) + "," + ParserSTEP.DoubleOptionalToString(mScale); } + internal static void parseFields(IfcCartesianTransformationOperator o, List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(o, arrFields, ref ipos); + o.mAxis1 = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mAxis2 = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mLocalOrigin = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mScale = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (o.mScale == 0) + o.mScale = 1; + } + } + public partial class IfcCartesianTransformationOperator2D : IfcCartesianTransformationOperator + { + internal IfcCartesianTransformationOperator2D() : base() { } + internal IfcCartesianTransformationOperator2D(IfcCartesianTransformationOperator2D i) : base(i) { } + internal static IfcCartesianTransformationOperator2D Parse(string strDef) { IfcCartesianTransformationOperator2D o = new IfcCartesianTransformationOperator2D(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + internal static void parseFields(IfcCartesianTransformationOperator2D o, List arrFields, ref int ipos) { IfcCartesianTransformationOperator.parseFields(o, arrFields, ref ipos); } + } + public partial class IfcCartesianTransformationOperator2DnonUniform : IfcCartesianTransformationOperator2D + { + private double mScale2; //OPTIONAL REAL; + internal double Scale2 { get { return mScale2; } } + + internal IfcCartesianTransformationOperator2DnonUniform() : base() { } + internal IfcCartesianTransformationOperator2DnonUniform(IfcCartesianTransformationOperator2DnonUniform i) : base(i) { mScale2 = i.mScale2; } + internal new static IfcCartesianTransformationOperator2DnonUniform Parse(string strDef) { IfcCartesianTransformationOperator2DnonUniform o = new IfcCartesianTransformationOperator2DnonUniform(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + internal static void parseFields(IfcCartesianTransformationOperator2DnonUniform o, List arrFields, ref int ipos) { IfcCartesianTransformationOperator2D.parseFields(o, arrFields, ref ipos); o.mScale2 = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mScale2); } + } + public partial class IfcCartesianTransformationOperator3D : IfcCartesianTransformationOperator + { + private int mAxis3;// : OPTIONAL IfcDirection + internal IfcDirection Axis3 { get { return mDatabase.mIfcObjects[mAxis3] as IfcDirection; } set { mAxis3 = (value == null ? 0 : value.mIndex); } } + + internal IfcCartesianTransformationOperator3D() { } + internal IfcCartesianTransformationOperator3D(IfcCartesianTransformationOperator3D i) : base(i) { mAxis3 = i.mAxis3; } + public IfcCartesianTransformationOperator3D(DatabaseIfc db) : base(db) { } + internal static void parseFields(IfcCartesianTransformationOperator3D o, List arrFields, ref int ipos) { IfcCartesianTransformationOperator.parseFields(o, arrFields, ref ipos); o.mAxis3 = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mAxis3); } + internal static IfcCartesianTransformationOperator3D Parse(string strDef) { IfcCartesianTransformationOperator3D o = new IfcCartesianTransformationOperator3D(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + + } + public partial class IfcCartesianTransformationOperator3DnonUniform : IfcCartesianTransformationOperator3D + { + private double mScale2 = 1;// : OPTIONAL REAL; + private double mScale3 = 1;// : OPTIONAL REAL; + + internal double Scale2 { get { return mScale2; } } + internal double Scale3 { get { return mScale3; } } + + internal IfcCartesianTransformationOperator3DnonUniform() { } + internal IfcCartesianTransformationOperator3DnonUniform(IfcCartesianTransformationOperator3DnonUniform i) : base(i) { mScale2 = i.mScale2; mScale3 = i.mScale3; } + internal new static IfcCartesianTransformationOperator3DnonUniform Parse(string strDef) { IfcCartesianTransformationOperator3DnonUniform o = new IfcCartesianTransformationOperator3DnonUniform(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + internal static void parseFields(IfcCartesianTransformationOperator3DnonUniform o, List arrFields, ref int ipos) { IfcCartesianTransformationOperator3D.parseFields(o, arrFields, ref ipos); o.mScale2 = ParserSTEP.ParseDouble(arrFields[ipos++]); o.mScale3 = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mScale2) + "," + ParserSTEP.DoubleOptionalToString(mScale3); } + + } + public class IfcCenterLineProfileDef : IfcArbitraryOpenProfileDef + { + internal double mThickness;// : IfcPositiveLengthMeasure; + internal IfcCenterLineProfileDef() : base() { } + internal IfcCenterLineProfileDef(IfcCenterLineProfileDef i) : base(i) { mThickness = i.mThickness; } + internal new static IfcCenterLineProfileDef Parse(string strDef) { IfcCenterLineProfileDef p = new IfcCenterLineProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcCenterLineProfileDef p, List arrFields, ref int ipos) { IfcArbitraryOpenProfileDef.parseFields(p, arrFields, ref ipos); p.mThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mThickness); } + } + public class IfcChamferEdgeFeature : IfcEdgeFeature //DEPRECEATED IFC4 + { + internal double mWidth;// : OPTIONAL IfcPositiveLengthMeasure + internal double mHeight;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcChamferEdgeFeature() : base() { } + internal IfcChamferEdgeFeature(IfcChamferEdgeFeature p) : base(p) { mWidth = p.mWidth; mHeight = p.mHeight; } + internal static void parseFields(IfcChamferEdgeFeature f, List arrFields, ref int ipos) { IfcEdgeFeature.parseFields(f, arrFields, ref ipos); f.mWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); f.mHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcChamferEdgeFeature Parse(string strDef) { IfcChamferEdgeFeature f = new IfcChamferEdgeFeature(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mWidth) + "," + ParserSTEP.DoubleOptionalToString(mHeight); } + } + public class IfcChiller : IfcEnergyConversionDevice //IFC4 + { + internal IfcChillerTypeEnum mPredefinedType = IfcChillerTypeEnum.NOTDEFINED;// OPTIONAL : IfcBurnerTypeEnum; + public IfcChillerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcChiller() : base() { } + internal IfcChiller(IfcChiller c) : base(c) { mPredefinedType = c.mPredefinedType; } + internal IfcChiller(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcChiller s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcChillerTypeEnum)Enum.Parse(typeof(IfcChillerTypeEnum), str); + } + internal new static IfcBurner Parse(string strDef) { IfcBurner s = new IfcBurner(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcChillerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcChillerType : IfcEnergyConversionDeviceType + { + internal IfcChillerTypeEnum mPredefinedType = IfcChillerTypeEnum.NOTDEFINED;// : IfcChillerTypeEnum + public IfcChillerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcChillerType() : base() { } + internal IfcChillerType(IfcChillerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcChillerType(DatabaseIfc m, string name, IfcChillerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcChillerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcChillerTypeEnum)Enum.Parse(typeof(IfcChillerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcChillerType Parse(string strDef) { IfcChillerType t = new IfcChillerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcChimney : IfcBuildingElement + { + internal IfcChimneyTypeEnum mPredefinedType = IfcChimneyTypeEnum.NOTDEFINED;//: OPTIONAL IfcChimneyTypeEnum; + public IfcChimneyTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcChimney() : base() { } + internal IfcChimney(IfcChimney c) : base(c) { mPredefinedType = c.mPredefinedType; } + public IfcChimney(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcChimney Parse(string strDef, Schema schema) { IfcChimney w = new IfcChimney(); int ipos = 0; parseFields(w, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return w; } + internal static void parseFields(IfcChimney w, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(w, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + w.mPredefinedType = (IfcChimneyTypeEnum)Enum.Parse(typeof(IfcChimneyTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcChimneyTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcChimneyType : IfcBuildingElementType + { + internal IfcChimneyTypeEnum mPredefinedType = IfcChimneyTypeEnum.NOTDEFINED; + public IfcChimneyTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcChimneyType() : base() { } + internal IfcChimneyType(IfcChimneyType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcChimneyType(DatabaseIfc m, string name, IfcChimneyTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcChimneyType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcChimneyTypeEnum)Enum.Parse(typeof(IfcChimneyTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcChimneyType Parse(string strDef) { IfcChimneyType t = new IfcChimneyType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcCircle : IfcConic + { + private double mRadius;// : IfcPositiveLengthMeasure; + internal double Radius { get { return mRadius; } } + + internal IfcCircle() : base() { } + internal IfcCircle(IfcCircle el) : base(el) { mRadius = el.mRadius; } + internal IfcCircle(DatabaseIfc m, double radius) : base(m.m2DPlaceOrigin) { mRadius = radius; } + internal IfcCircle(IfcAxis2Placement ap, double radius) : base(ap) { mRadius = radius; } + internal static IfcCircle Parse(string strDef) { IfcCircle c = new IfcCircle(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcCircle c, List arrFields, ref int ipos) { IfcConic.parseFields(c, arrFields, ref ipos); c.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mRadius); } + } + public partial class IfcCircleHollowProfileDef : IfcCircleProfileDef + { + public override string KeyWord { get { return (mWallThickness > mDatabase.Tolerance ? "IFCCIRCLEPROFILEDEF" : base.KeyWord); } } + internal double mWallThickness;// : IfcPositiveLengthMeasure; + internal IfcCircleHollowProfileDef() : base() { } + internal IfcCircleHollowProfileDef(IfcCircleHollowProfileDef c) : base(c) { mWallThickness = c.mWallThickness; } + public IfcCircleHollowProfileDef(DatabaseIfc m, string name, double radius, double wallThickness) : base(m, name, radius) { mWallThickness = wallThickness; } + internal static void parseFields(IfcCircleHollowProfileDef p, List arrFields, ref int ipos) { IfcCircleProfileDef.parseFields(p, arrFields, ref ipos); p.mWallThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal new static IfcCircleHollowProfileDef Parse(string strDef) { IfcCircleHollowProfileDef p = new IfcCircleHollowProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + (mWallThickness > mDatabase.Tolerance ? "," + ParserSTEP.DoubleToString(mWallThickness) : ""); } + } + public partial class IfcCircleProfileDef : IfcParameterizedProfileDef //SUPERTYPE OF(IfcCircleHollowProfileDef) + { + internal double mRadius;// : IfcPositiveLengthMeasure; + internal IfcCircleProfileDef() : base() { } + internal IfcCircleProfileDef(IfcCircleProfileDef c) : base(c) { mRadius = c.mRadius; } + public IfcCircleProfileDef(DatabaseIfc db, string name, double radius) : base(db) { Name = name; mRadius = radius; }//if (string.Compare(getKW, mKW) == 0) mModel.mCircProfiles.Add(this); } + internal static void parseFields(IfcCircleProfileDef p, List arrFields, ref int ipos) { IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); p.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mRadius); } + internal new static IfcCircleProfileDef Parse(string strDef) { IfcCircleProfileDef p = new IfcCircleProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public partial class IfcCircularArcSegment2D : IfcCurveSegment2D //IFC4x1 + { + private double mRadius;// : IfcPositiveLengthMeasure; + private bool mIsCCW;// : IfcBoolean; + + internal IfcCircularArcSegment2D() : base() { } + internal IfcCircularArcSegment2D(IfcCircularArcSegment2D p) : base(p) { mRadius = p.mRadius; mIsCCW = p.mIsCCW; } + internal IfcCircularArcSegment2D(IfcCartesianPoint start, double startDirection, double length, double radius, bool isCCW) + : base(start, startDirection, length) + { + mRadius = radius; + mIsCCW = isCCW; + } + internal static void parseFields(IfcCircularArcSegment2D c, List arrFields, ref int ipos) + { + IfcCurveSegment2D.parseFields(c, arrFields, ref ipos); + c.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mIsCCW = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcCircularArcSegment2D Parse(string strDef) { IfcCircularArcSegment2D c = new IfcCircularArcSegment2D(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mRadius) + "," + ParserSTEP.BoolToString(mIsCCW); } + } + public class IfcCivilElement : IfcElement //IFC4 + { + internal IfcCivilElement() : base() { } + internal IfcCivilElement(IfcCivilElement e) : base(e) { } + public IfcCivilElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " only supported in IFC4!"); } + internal static IfcCivilElement Parse(string strDef) { IfcCivilElement e = new IfcCivilElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcCivilElement e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + } + public partial class IfcCivilElementType : IfcElementType //IFC4 + { + internal IfcCivilElementType() : base() { } + internal IfcCivilElementType(IfcCivilElementType t) : base(t) { } + internal IfcCivilElementType(DatabaseIfc m, string name) : base(m) { Name = name; if (m.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " only supported in IFC4!"); } + internal new static IfcCivilElementType Parse(string strDef) { IfcCivilElementType t = new IfcCivilElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcCivilElementType t, List arrFields, ref int ipos) { IfcElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcClassification : IfcExternalInformation, IfcClassificationSelect // SUBTYPE OF IfcExternalInformation; + { + internal string mSource = "$";// : OPTIONAL IfcLabel; + internal string mEdition = "$";// : OPTIONAL IfcLabel; + internal string mEditionDate = "$";// OPTIONAL IfcDate IFC4 change : OPTIONAL IfcCalendarDate; + internal string mName;// : IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; IFC4 Addition + internal string mLocation = "$";// : OPTIONAL IfcURIReference; IFC4 Addtion + internal List mReferenceTokens = new List();// : OPTIONAL LIST [1:?] OF IfcIdentifier; IFC4 Addition + //INVERSE + internal List mClassificationForObjects = new List();// : SET OF IfcRelAssociatesclassification FOR Relatingclassification; + internal List mHasReferences = new List();// : SET OF IfcClassificationReference FOR ReferencedSource; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { if (!string.IsNullOrEmpty(value)) mName = ParserIfc.Encode(value.Replace("'", "")); } } + public List ClassificationForObjects { get { return mClassificationForObjects; } } + + internal IfcClassification() : base() { } + internal IfcClassification(IfcClassification c) : base(c) { mSource = c.mSource; mEdition = c.mEdition; mEditionDate = c.mEditionDate; mName = c.mName; } + internal IfcClassification(DatabaseIfc m, string source, string edition, DateTime editionDate, string name, string desc, string location, List references) + : base(m) + { + if (!string.IsNullOrEmpty(source)) + mSource = source.Replace("'", ""); + if (!string.IsNullOrEmpty(edition)) + mEdition = edition.Replace("'", ""); + if (editionDate != DateTime.MinValue) + mEditionDate = IfcDate.convert(editionDate); + Name = name; + if (!string.IsNullOrEmpty(desc)) + mDescription = desc.Replace("'", ""); + if (!string.IsNullOrEmpty(location)) + mLocation = location.Replace("'", ""); + if (references != null) + mReferenceTokens = references.ConvertAll(x => x.Replace("'", "")); + mClassificationForObjects.Add(new IfcRelAssociatesClassification(this)); + } + internal static IfcClassification Parse(string strDef, Schema schema) { IfcClassification c = new IfcClassification(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return c; } + internal static void parseFields(IfcClassification c, List arrFields, ref int ipos, Schema schema) + { + IfcExternalInformation.parseFields(c, arrFields, ref ipos); + c.mSource = arrFields[ipos++].Replace("'", ""); + c.mEdition = arrFields[ipos++].Replace("'", ""); + c.mEditionDate = arrFields[ipos++].Replace("'", ""); + c.mName = arrFields[ipos++].Replace("'", ""); + if (schema != Schema.IFC2x3) + { + c.mDescription = arrFields[ipos++].Replace("'", ""); + c.mLocation = arrFields[ipos++].Replace("'", ""); + c.mReferenceTokens = ParserSTEP.SplitListStrings(arrFields[ipos++]); + } + } + protected override string BuildString() + { + string tokens = "$"; + if (mReferenceTokens.Count > 0) + { + tokens = "('" + mReferenceTokens; + for (int icounter = 1; icounter < mReferenceTokens.Count; icounter++) + tokens += "','" + mReferenceTokens; + tokens += "')"; + } + return base.BuildString() + (mSource == "$" ? (mDatabase.mSchema == Schema.IFC2x3 ? ",'Unknown'," : ",$,") : ",'" + mSource + "',") + (mEdition == "$" ? (mDatabase.mSchema == Schema.IFC2x3 ? "'Unknown'," : "$,") : "'" + mEdition + "',") + (mDatabase.mSchema == Schema.IFC2x3 ? mEditionDate : (mEdition == "$" ? "$" : "'" + mEditionDate + "'")) + + ",'" + mName + (mDatabase.mSchema == Schema.IFC2x3 ? "'" : (mDescription == "$" ? "',$," : "','" + mDescription + "',") + (mLocation == "$" ? "$," : "'" + mLocation + "',") + tokens); + } + } + public class IfcClassificationItem : BaseClassIfc //DEPRECEATED IFC4 + { + internal int mNotation;// : IfcClassificationNotationFacet; + internal int mItemOf;//: OPTIONAL IfcClassification; + internal string mTitle;// : IfcLabel; + + internal IfcClassificationItem() : base() { } + internal IfcClassificationItem(IfcClassificationItem i) : base() { mNotation = i.mNotation; mItemOf = i.mItemOf; mTitle = i.mTitle; } + internal static IfcClassificationItem Parse(string strDef) { IfcClassificationItem c = new IfcClassificationItem(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcClassificationItem c, List arrFields, ref int ipos) { c.mNotation = ParserSTEP.ParseLink(arrFields[ipos++]); c.mItemOf = ParserSTEP.ParseLink(arrFields[ipos++]); c.mTitle = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mNotation) + "," + ParserSTEP.LinkToString(mItemOf) + "," + mTitle; } + } + public class IfcClassificationItemRelationship : BaseClassIfc //DEPRECEATED IFC4 + { + internal string mSource;// : IfcLabel; + internal string mEdition;// : IfcLabel; + internal int mEditionDate;// : OPTIONAL IfcCalendarDate; + internal string mName;// : IfcLabel; + internal IfcClassificationItemRelationship() : base() { } + internal IfcClassificationItemRelationship(IfcClassificationItemRelationship i) + : base() + { + mSource = i.mSource; + mEdition = i.mEdition; + mEditionDate = i.mEditionDate; + mName = i.mName; + } + internal static IfcClassificationItemRelationship Parse(string strDef) { IfcClassificationItemRelationship c = new IfcClassificationItemRelationship(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcClassificationItemRelationship c, List arrFields, ref int ipos) { c.mSource = arrFields[ipos++]; c.mEdition = arrFields[ipos++]; c.mEditionDate = ParserSTEP.ParseLink(arrFields[ipos++]); c.mName = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mSource + "," + mEdition + "," + ParserSTEP.LinkToString(mEditionDate) + "," + mName; } + } + public class IfcClassificationNotation : BaseClassIfc, IfcClassificationNotationSelect //DEPRECEATED IFC4 + { + internal List mNotationFacets = new List();// : SET [1:?] OF IfcClassificationNotationFacet; + + internal IfcClassificationNotation() : base() { } + internal IfcClassificationNotation(IfcClassificationNotation i) : base() { mNotationFacets = new List(i.mNotationFacets.ToArray()); } + internal static IfcClassificationNotation Parse(string strDef) { IfcClassificationNotation c = new IfcClassificationNotation(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcClassificationNotation c, List arrFields, ref int ipos) { c.mNotationFacets = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mNotationFacets.Count > 0) + { + str += ParserSTEP.LinkToString(mNotationFacets[0]); + for (int icounter = 1; icounter < mNotationFacets.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mNotationFacets[icounter]); + } + return str + ")"; + } + } + public class IfcClassificationNotationFacet : BaseClassIfc //DEPRECEATED IFC4 + { + internal string mNotationValue;// : IfcLabel; + internal IfcClassificationNotationFacet() : base() { } + internal IfcClassificationNotationFacet(IfcClassification i) : base() { mNotationValue = i.mSource; } + internal static IfcClassificationNotationFacet Parse(string strDef) { IfcClassificationNotationFacet c = new IfcClassificationNotationFacet(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcClassificationNotationFacet c, List arrFields, ref int ipos) { c.mNotationValue = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mNotationValue; } + } + public interface IfcClassificationNotationSelect : IfcInterface { } // List classificationForObjects { get; } IfcClassificationNotation, IfcClassificationReference) + public class IfcClassificationReference : IfcExternalReference, IfcClassificationSelect, IfcClassificationNotationSelect + { + internal int mReferencedSource;// : OPTIONAL IfcClassificationReferenceSelect; //IFC2x3 : OPTIONAL IfcClassification; + internal string mDescription = "$";// : OPTIONAL IfcText; IFC4 + internal string mSort = "$";// : OPTIONAL IfcIdentifier; + //INVERSE + internal List mClassificationRefForObjects = new List();// : SET [0:?] OF IfcRelAssociatesclassification FOR Relatingclassification; + internal List mHasReferences = new List();// : SET [0:?] OF IfcClassificationReference FOR ReferencedSource; + public List ClassificationForObjects { get { return mClassificationRefForObjects; } } + + internal IfcClassificationReference() : base() { } + internal IfcClassificationReference(IfcClassificationReference r) : base(r) { mReferencedSource = r.mReferencedSource; mDescription = r.mDescription; mSort = r.mSort; } + internal IfcClassificationReference(DatabaseIfc db) : base(db) { } + internal static IfcClassificationReference Parse(string strDef, Schema schema) { IfcClassificationReference r = new IfcClassificationReference(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcClassificationReference r, List arrFields, ref int ipos, Schema schema) + { + IfcExternalReference.parseFields(r, arrFields, ref ipos); + r.mReferencedSource = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + r.mDescription = arrFields[ipos++].Replace("'", ""); + r.mSort = arrFields[ipos++].Replace("'", ""); + } + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mReferencedSource) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mDescription == "$" ? ",$" : ",'" + mDescription + "'") + (mSort == "$" ? ",$" : ",'" + mSort + "'")); } + } + public interface IfcClassificationSelect : IfcInterface { List ClassificationForObjects { get; } } // IFC4 rename IfcClassification,IfcClassificationReference + public partial class IfcClosedShell : IfcConnectedFaceSet, IfcShell + { + internal IfcClosedShell() : base() { } + internal IfcClosedShell(IfcClosedShell c) : base(c) { } + public IfcClosedShell(List faces) : base(faces) { } + internal new static IfcClosedShell Parse(string str) + { + IfcClosedShell s = new IfcClosedShell(); + int pos = 0; + s.Parse(str, ref pos); + return s; + } + } + public partial class IfcClothoidalArcSegment2D : IfcCurveSegment2D //IFC4x1 + { + private double mStartRadius;// : IfcPositiveLengthMeasure; + private bool mIsCCW;// : IfcBoolean; + private bool mIsEntry;// : IfcBoolean; + private double mClothoidConstant;// : IfcReal; + + internal IfcClothoidalArcSegment2D() : base() { } + internal IfcClothoidalArcSegment2D(IfcClothoidalArcSegment2D p) : base(p) { mStartRadius = p.mStartRadius; mIsCCW = p.mIsCCW; mIsEntry = p.mIsEntry; mClothoidConstant = p.mClothoidConstant; } + internal IfcClothoidalArcSegment2D(IfcCartesianPoint start, double startDirection, double length, double radius, bool isCCW, bool isEntry, double clothoidConstant) + : base(start, startDirection, length) + { + mStartRadius = radius; + mIsCCW = isCCW; + mIsEntry = isEntry; + mClothoidConstant = clothoidConstant; + } + internal static void parseFields(IfcClothoidalArcSegment2D c, List arrFields, ref int ipos) + { + IfcCurveSegment2D.parseFields(c, arrFields, ref ipos); + c.mStartRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mIsCCW = ParserSTEP.ParseBool(arrFields[ipos++]); + c.mIsEntry = ParserSTEP.ParseBool(arrFields[ipos++]); + c.mClothoidConstant = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal static IfcClothoidalArcSegment2D Parse(string strDef) { IfcClothoidalArcSegment2D c = new IfcClothoidalArcSegment2D(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mStartRadius) + "," + ParserSTEP.BoolToString(mIsCCW) + "," + ParserSTEP.BoolToString(mIsEntry) + "," + ParserSTEP.DoubleToString(mClothoidConstant); } + } + public class IfcCoil : IfcEnergyConversionDevice //IFC4 + { + internal IfcCoilTypeEnum mPredefinedType = IfcCoilTypeEnum.NOTDEFINED;// OPTIONAL : IfcCoilTypeEnum; + public IfcCoilTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCoil() : base() { } + internal IfcCoil(IfcCoil b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcCoil(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCoil s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCoilTypeEnum)Enum.Parse(typeof(IfcCoilTypeEnum), str); + } + internal new static IfcCoil Parse(string strDef) { IfcCoil s = new IfcCoil(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCoilTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcCoilType : IfcEnergyConversionDeviceType + { + internal IfcCoilTypeEnum mPredefinedType = IfcCoilTypeEnum.NOTDEFINED;// : IfcCoilTypeEnum; + public IfcCoilTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCoilType() : base() { } + internal IfcCoilType(IfcCoilType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCoilType(DatabaseIfc m, string name, IfcCoilTypeEnum t) : base(m) { Name = name; PredefinedType = t; } + internal static void parseFields(IfcCoilType t,List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcCoilTypeEnum)Enum.Parse(typeof(IfcCoilTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCoilType Parse(string strDef) { IfcCoilType t = new IfcCoilType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public interface IfcColour : IfcInterface { Color Colour { get; } }// = SELECT (IfcColourSpecification ,IfcPreDefinedColour); + public interface IfcColourOrFactor { }//IfcNormalisedRatioMeasure, IfcColourRgb); + public partial class IfcColourRgb : IfcColourSpecification, IfcColourOrFactor + { + internal double mRed, mGreen, mBlue;// : IfcNormalisedRatioMeasure; + public override Color Colour { get { return Color.FromArgb((int)(mRed * 255), (int)(mGreen * 255), (int)(mBlue * 255)); } } + + internal IfcColourRgb() : base() { } + internal IfcColourRgb(IfcColourRgb c) : base(c) { mRed = c.mRed; mGreen = c.mGreen; mBlue = c.mBlue; } + internal IfcColourRgb(DatabaseIfc m, string name, Color col) : base(m, name) { mRed = col.R / 255.0; mGreen = col.G / 255.0; mBlue = col.B / 255.0; } + internal static IfcColourRgb Parse(string strDef) { IfcColourRgb c = new IfcColourRgb(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcColourRgb c, List arrFields, ref int ipos) { IfcColourSpecification.parseFields(c, arrFields, ref ipos); c.mRed = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mGreen = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mBlue = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.DoubleToString(mRed) + "," + ParserSTEP.DoubleToString(mGreen) + "," + ParserSTEP.DoubleToString(mBlue)); } + } + public class IfcColourRgbList : IfcPresentationItem + { + internal Tuple[] mColourList = new Tuple[0];// : LIST [1:?] OF LIST [3:3] OF IfcNormalisedRatioMeasure; + internal IfcColourRgbList() : base() { } + internal IfcColourRgbList(IfcColourRgbList i) : base() { mColourList = i.mColourList; } + public IfcColourRgbList(DatabaseIfc m, IEnumerable colourList) : base(m) + { + mColourList = new Tuple[colourList.Count()]; + int ilast = colourList.Count(); + for (int icounter = 0; icounter < ilast; icounter++) + { + Color c = colourList.ElementAt(icounter); + mColourList[icounter] = new Tuple(c.R / 255.0, c.G / 255.0, c.B / 255.0); + } + } + internal static void parseFields(IfcColourRgbList s, List arrFields, ref int ipos) { s.mColourList = ParserSTEP.SplitListDoubleTriple(arrFields[ipos++]); } + internal static IfcColourRgbList Parse(string strDef) { IfcColourRgbList s = new IfcColourRgbList(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + Tuple t = mColourList[0]; + string result = base.BuildString() + ",((" + ParserSTEP.DoubleToString(t.Item1) + "," + ParserSTEP.DoubleToString(t.Item2) + "," + ParserSTEP.DoubleToString(t.Item3); + for (int icounter = 1; icounter < mColourList.Length; icounter++) + { + t = mColourList[icounter]; + result += "),(" + ParserSTEP.DoubleToString(t.Item1) + "," + ParserSTEP.DoubleToString(t.Item2) + "," + ParserSTEP.DoubleToString(t.Item3); + } + + return result + "))"; + } + internal List ColorList + { + get + { + List result = new List(); + foreach (Tuple c in mColourList) + result.Add(Color.FromArgb((int)(c.Item1 * 255), (int)(c.Item2 * 255), (int)(c.Item3 * 255))); + return result; + } + } + } + public abstract class IfcColourSpecification : IfcPresentationItem, IfcColour // ABSTRACT SUPERTYPE OF(IfcColourRgb) + { + private string mName = "$";// : OPTIONAL IfcLabel + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { if (!string.IsNullOrEmpty(value)) mName = ParserIfc.Encode(value.Replace("'", "")); } } + + protected IfcColourSpecification() : base() { } + protected IfcColourSpecification(IfcColourSpecification i) : base() { mName = i.mName; } + protected IfcColourSpecification(DatabaseIfc m, string name) : base(m) { Name = name; } + protected static void parseFields(IfcColourSpecification c, List arrFields, ref int ipos) { c.mName = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$" : ",'" + mName + "'"); } + public abstract Color Colour { get; } + } + public partial class IfcColumn : IfcBuildingElement + { + internal IfcColumnTypeEnum mPredefinedType = IfcColumnTypeEnum.NOTDEFINED;//: OPTIONAL IfcColumnTypeEnum; + public IfcColumnTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcColumn() : base() { } + internal IfcColumn(IfcColumn c) : base(c) { mPredefinedType = c.mPredefinedType; } + public IfcColumn(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcColumn Parse(string strDef, Schema schema) { IfcColumn col = new IfcColumn(); int ipos = 0; parseFields(col, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return col; } + internal static void parseFields(IfcColumn c, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(c, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + c.mPredefinedType = (IfcColumnTypeEnum)Enum.Parse(typeof(IfcColumnTypeEnum), str.Substring(1, str.Length - 2)); + + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcColumnTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcColumnStandardCase : IfcColumn + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 || mDatabase.mModelView == ModelView.Ifc4Reference ? "IFCCOLUMN" : base.KeyWord); } } + internal IfcColumnStandardCase() : base() { } + internal IfcColumnStandardCase(IfcColumnStandardCase o) : base(o) { } + + internal new static IfcColumnStandardCase Parse(string strDef, Schema schema) { IfcColumnStandardCase c = new IfcColumnStandardCase(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return c; } + internal static void parseFields(IfcColumnStandardCase c, List arrFields, ref int ipos, Schema schema) { IfcColumn.parseFields(c, arrFields, ref ipos,schema); } + } + public partial class IfcColumnType : IfcBuildingElementType + { + internal IfcColumnTypeEnum mPredefinedType = IfcColumnTypeEnum.NOTDEFINED; + public IfcColumnTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcColumnType() : base() { } + internal IfcColumnType(IfcColumnType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcColumnType(DatabaseIfc m, string name, IfcColumnTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + public IfcColumnType(string name, IfcMaterialProfile ps, IfcColumnTypeEnum type) : this(name,new IfcMaterialProfileSet(ps.Name, ps), type) { } + internal IfcColumnType(string name, IfcMaterialProfileSet ps, IfcColumnTypeEnum type) : base(ps.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = ps; } + internal static void parseFields(IfcColumnType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcColumnTypeEnum)Enum.Parse(typeof(IfcColumnTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcColumnType Parse(string strDef) { IfcColumnType t = new IfcColumnType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + + } + public partial class IfcComplexProperty : IfcProperty + { + internal string mUsageName;// : IfcIdentifier; + internal List mHasProperties = new List();// : SET [1:?] OF IfcProperty; + + public List HasProperties { get { return mHasProperties.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProperty); } } + + internal IfcComplexProperty(IfcComplexProperty p) : base(p) { mUsageName = p.mUsageName; mHasProperties = new List(p.mHasProperties.ToArray()); } + internal IfcComplexProperty() : base() { } + internal IfcComplexProperty(DatabaseIfc m, string name, string desc) : base(m, name, desc) { } + internal static void parseFields(IfcComplexProperty p, List arrFields, ref int ipos) { IfcProperty.parseFields(p, arrFields, ref ipos); p.mUsageName = arrFields[ipos++]; p.mHasProperties = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcComplexProperty Parse(string strDef) { IfcComplexProperty p = new IfcComplexProperty(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + string str = base.BuildString() + "," + mUsageName + ",(" + ParserSTEP.LinkToString(mHasProperties[0]); + for (int icounter = 1; icounter < mHasProperties.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mHasProperties[icounter]); + return str + ")"; + } + internal void relate() + { + List props = HasProperties; + for (int icounter = 0; icounter < props.Count; icounter++) + props[icounter].mPartOfComplex.Add(this); + } + } + public partial class IfcCompositeCurve : IfcBoundedCurve + { + private List mSegments = new List();// : LIST [1:?] OF IfcCompositeCurveSegment; + private IfcLogicalEnum mSelfIntersect = IfcLogicalEnum.UNKNOWN;// : LOGICAL; + + internal List Segments { get { return mSegments.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCompositeCurveSegment); } } + internal IfcLogicalEnum SelfIntersect { get { return mSelfIntersect; } } + + internal IfcCompositeCurve() : base() { } + internal IfcCompositeCurve(IfcCompositeCurve pl) : base(pl) { mSegments = new List(pl.mSegments.ToArray()); mSelfIntersect = pl.mSelfIntersect; } + public IfcCompositeCurve(List segs) : base(segs[0].mDatabase) { mSegments = segs.ConvertAll(x => x.mIndex); } + internal static void parseFields(IfcCompositeCurve c, List arrFields, ref int ipos) { IfcBoundedCurve.parseFields(c, arrFields, ref ipos); c.mSegments = ParserSTEP.SplitListLinks(arrFields[ipos++]); c.mSelfIntersect = ParserIfc.ParseIFCLogical(arrFields[ipos++]); } + internal static IfcCompositeCurve Parse(string strDef) { IfcCompositeCurve c = new IfcCompositeCurve(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mSegments.Count > 0) + str += ParserSTEP.LinkToString(mSegments[0]); + for (int icounter = 1; icounter < mSegments.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mSegments[icounter]); + str += "),"; + str += ParserIfc.LogicalToString(mSelfIntersect); + return base.BuildString() + str; + } + } + public class Ifc2dCompositeCurve : IfcCompositeCurve + { + internal Ifc2dCompositeCurve() : base() { } + internal Ifc2dCompositeCurve(Ifc2dCompositeCurve pl) : base(pl) { } + internal static void parseFields(Ifc2dCompositeCurve c, List arrFields, ref int ipos) { IfcCompositeCurve.parseFields(c, arrFields, ref ipos); } + internal new static IfcCompositeCurve Parse(string strDef) { Ifc2dCompositeCurve c = new Ifc2dCompositeCurve(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public class IfcCompositeCurveOnSurface : IfcCompositeCurve + { + internal IfcCompositeCurveOnSurface() : base() { } + internal IfcCompositeCurveOnSurface(IfcCompositeCurveOnSurface i) : base(i) { } + internal IfcCompositeCurveOnSurface(List segs) : base(segs) { } + internal new static IfcCompositeCurveOnSurface Parse(string strDef) { IfcCompositeCurveOnSurface c = new IfcCompositeCurveOnSurface(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcCompositeCurveOnSurface c, List arrFields, ref int ipos) { IfcCompositeCurve.parseFields(c, arrFields, ref ipos); } + } + public partial class IfcCompositeCurveSegment : IfcGeometricRepresentationItem + { + private IfcTransitionCode mTransition;// : IfcTransitionCode; + private bool mSameSense;// : BOOLEAN; + private int mParentCurve;// : IfcCurve; Really IfcBoundedCurve WR1 + + internal IfcTransitionCode Transition { get { return mTransition; } } + internal bool SameSense { get { return mSameSense; } } + internal IfcBoundedCurve ParentCurve { get { return mDatabase.mIfcObjects[mParentCurve] as IfcBoundedCurve; } } + + internal IfcCompositeCurveSegment() : base() { } + internal IfcCompositeCurveSegment(IfcCompositeCurveSegment el) : base(el) { mTransition = el.mTransition; mSameSense = el.mSameSense; mParentCurve = el.mParentCurve; } + public IfcCompositeCurveSegment(IfcTransitionCode tc, bool sense, IfcBoundedCurve bc) : base(bc.mDatabase) { mSameSense = sense; mTransition = tc; } + internal static IfcCompositeCurveSegment Parse(string strDef) { IfcCompositeCurveSegment s = new IfcCompositeCurveSegment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcCompositeCurveSegment s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); s.mTransition = (IfcTransitionCode)Enum.Parse(typeof(IfcTransitionCode), arrFields[ipos++].Replace(".", "")); s.mSameSense = ParserSTEP.ParseBool(arrFields[ipos++]); s.mParentCurve = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + ",." + mTransition.ToString() + ".," + ParserSTEP.BoolToString(mSameSense) + "," + ParserSTEP.LinkToString(mParentCurve); } + + } + public partial class IfcCompositeProfileDef : IfcProfileDef + { + private List mProfiles = new List();// : SET [2:?] OF IfcProfileDef; + private string mLabel = "$";// : OPTIONAL IfcLabel; + + internal List Profiles { get { return mProfiles.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProfileDef); } } + public string Label { get { return (mLabel == "$" ? "" : ParserIfc.Decode(mLabel)); } set { mLabel = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcCompositeProfileDef() : base() { } + internal IfcCompositeProfileDef(IfcCompositeProfileDef i) : base(i) { mProfiles = new List(i.mProfiles.ToArray()); mLabel = i.mLabel; } + private IfcCompositeProfileDef(DatabaseIfc m, string name, string label) + : base(m) + { + Name = name; + Label = label; + if (mDatabase.mModelView == ModelView.Ifc4Reference) + throw new Exception("Invalid Model View for IfcCompositeProfileDef : " + m.ModelView.ToString()); + } + internal IfcCompositeProfileDef(string name, List defs, string label) : this(defs[0].mDatabase, name, label) { mProfiles = defs.ConvertAll(x => x.mIndex); } + internal IfcCompositeProfileDef(string name, IfcProfileDef p1, IfcProfileDef p2, string label) : this(p1.mDatabase, name, label) { mProfiles.Add(p1.mIndex); mProfiles.Add(p2.mIndex); } + internal new static IfcCompositeProfileDef Parse(string strDef) { IfcCompositeProfileDef p = new IfcCompositeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcCompositeProfileDef p, List arrFields, ref int ipos) { IfcProfileDef.parseFields(p, arrFields, ref ipos); p.mProfiles = ParserSTEP.SplitListLinks(arrFields[ipos++]); p.mLabel = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mProfiles[0]); + for (int icounter = 1; icounter < mProfiles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mProfiles[icounter]); + return str + (mLabel == "$" ? "),$" : "),'" + mLabel + "'"); + } + } + public partial class IfcCompoundPlaneAngleMeasure + { + internal int mDegrees = 0, mMinutes = 0, mSeconds = 0, mMicroSeconds = 0; + internal IfcCompoundPlaneAngleMeasure(double angleDegrees) + { + double ang = Math.Abs(angleDegrees); + int sign = angleDegrees < 0 ? -1 : 1; + + mDegrees = sign * (int)Math.Floor(ang); + mMinutes = sign * (int)Math.Floor((ang - mDegrees) * 60.0); + mSeconds = sign * (int)Math.Floor(((ang - mDegrees) * 60 - mMinutes) * 60); + mMicroSeconds = sign * (int)Math.Floor((((ang - mDegrees) * 60 - mMinutes) * 60 - mSeconds) * 1e6); + + } + internal IfcCompoundPlaneAngleMeasure(int degrees, int minutes, int seconds, int microSeconds) + { + mDegrees = degrees; + mMinutes = minutes; + mSeconds = seconds; + mMicroSeconds = microSeconds; + } + + public override string ToString() { return "(" + mDegrees + "," + mMinutes + "," + mSeconds + "," + mMicroSeconds + ")"; } + internal double computeAngle() + { + double compound = Math.Abs(mMinutes) / 60.0 + Math.Abs(mSeconds) / 3600.0 + Math.Abs(mMicroSeconds) / 3600 * 1e-6; + return mDegrees + (mDegrees == 0 ? (mMinutes == 0 ? (mSeconds == 0 ? (mMicroSeconds > 0 ? 1 : -1) : (mSeconds > 0 ? 1 : -1)) : (mMinutes > 0 ? 1 : -1)) : (mDegrees > 0 ? 1 : -1)) * compound; + } + + } + public class IfcCompressor : IfcFlowMovingDevice //IFC4 + { + internal IfcCompressorTypeEnum mPredefinedType = IfcCompressorTypeEnum.NOTDEFINED;// OPTIONAL : IfcCompressorTypeEnum; + public IfcCompressorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCompressor() : base() { } + internal IfcCompressor(IfcCompressor c) : base(c) { mPredefinedType = c.mPredefinedType; } + internal IfcCompressor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCompressor s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCompressorTypeEnum)Enum.Parse(typeof(IfcCompressorTypeEnum), str); + } + internal new static IfcCompressor Parse(string strDef) { IfcCompressor s = new IfcCompressor(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCompressorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcCompressorType : IfcFlowMovingDeviceType + { + internal IfcCompressorTypeEnum mPredefinedType = IfcCompressorTypeEnum.NOTDEFINED;// : IfcCompressorTypeEnum; + public IfcCompressorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCompressorType() : base() { } + internal IfcCompressorType(IfcCompressorType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCompressorType(DatabaseIfc m, string name, IfcCompressorTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcCompressorType t, List arrFields, ref int ipos) { IfcFlowFittingType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCompressorTypeEnum)Enum.Parse(typeof(IfcCompressorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCompressorType Parse(string strDef) { IfcCompressorType t = new IfcCompressorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCommunicationsAppliance : IfcFlowTerminal //IFC4 + { + internal IfcCommunicationsApplianceTypeEnum mPredefinedType = IfcCommunicationsApplianceTypeEnum.NOTDEFINED;// OPTIONAL : IfcCommunicationsApplianceTypeEnum; + public IfcCommunicationsApplianceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCommunicationsAppliance(IfcCommunicationsAppliance a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcCommunicationsAppliance() : base() { } + internal static void parseFields(IfcCommunicationsAppliance s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCommunicationsApplianceTypeEnum)Enum.Parse(typeof(IfcCommunicationsApplianceTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcCommunicationsAppliance Parse(string strDef) { IfcCommunicationsAppliance s = new IfcCommunicationsAppliance(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCommunicationsApplianceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcCommunicationsApplianceType : IfcFlowTerminalType + { + internal IfcCommunicationsApplianceTypeEnum mPredefinedType = IfcCommunicationsApplianceTypeEnum.NOTDEFINED;// : IfcCommunicationsApplianceBoxTypeEnum; + public IfcCommunicationsApplianceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCommunicationsApplianceType(IfcCommunicationsApplianceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCommunicationsApplianceType() : base() { } + internal IfcCommunicationsApplianceType(DatabaseIfc m, string name, IfcCommunicationsApplianceTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcCommunicationsApplianceType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCommunicationsApplianceTypeEnum)Enum.Parse(typeof(IfcCommunicationsApplianceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCommunicationsApplianceType Parse(string strDef) { IfcCommunicationsApplianceType t = new IfcCommunicationsApplianceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCondenser : IfcEnergyConversionDevice //IFC4 + { + internal IfcCondenserTypeEnum mPredefinedType = IfcCondenserTypeEnum.NOTDEFINED;// OPTIONAL : IfcCCondenserTypeEnum; + public IfcCondenserTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCondenser() : base() { } + internal IfcCondenser(IfcCondenser b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcCondenser(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCondenser s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCondenserTypeEnum)Enum.Parse(typeof(IfcCondenserTypeEnum), str); + } + internal new static IfcCondenser Parse(string strDef) { IfcCondenser s = new IfcCondenser(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCondenserTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcCondenserType : IfcEnergyConversionDeviceType + { + internal IfcCondenserTypeEnum mPredefinedType = IfcCondenserTypeEnum.NOTDEFINED;// : IfcCondenserTypeEnum; + public IfcCondenserTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCondenserType() : base() { } + internal IfcCondenserType(IfcCondenserType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCondenserType(DatabaseIfc m, string name, IfcCondenserTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcCondenserType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCondenserTypeEnum)Enum.Parse(typeof(IfcCondenserTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCondenserType Parse(string strDef) { IfcCondenserType t = new IfcCondenserType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCondition : IfcGroup //DEPRECEATED IFC4 + { + internal IfcCondition() : base() { } + internal IfcCondition(IfcCondition c) : base(c) { } + internal new static IfcCondition Parse(string strDef) { IfcCondition c = new IfcCondition(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcCondition c, List arrFields, ref int ipos) { IfcGroup.parseFields(c, arrFields, ref ipos); } + } + public class IfcConditionCriterion : IfcControl //DEPRECEATED IFC4 + { + internal int mCriterion;// : IfcConditionCriterionSelect; + internal int mCriterionDateTime;// : IfcDateTimeSelect; + internal IfcConditionCriterion() : base() { } + internal IfcConditionCriterion(IfcConditionCriterion c) : base(c) { mCriterion = c.mCriterion; mCriterionDateTime = c.mCriterionDateTime; } + internal static IfcConditionCriterion Parse(string strDef, Schema schema) { IfcConditionCriterion c = new IfcConditionCriterion(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return c; } + internal static void parseFields(IfcConditionCriterion c, List arrFields, ref int ipos, Schema schema) { IfcControl.parseFields(c, arrFields, ref ipos,schema); c.mCriterion = ParserSTEP.ParseLink(arrFields[ipos++]); c.mCriterionDateTime = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mCriterion) + "," + ParserSTEP.LinkToString(mCriterionDateTime); } + } + public abstract partial class IfcConic : IfcCurve /*ABSTRACT SUPERTYPE OF (ONEOF (IfcCircle ,IfcEllipse))*/ + { + private int mPosition;// : IfcAxis2Placement; + internal IfcAxis2Placement Position { get { return mDatabase.mIfcObjects[mPosition] as IfcAxis2Placement; } } + + protected IfcConic() : base() { } + protected IfcConic(IfcConic el) : base(el) { mPosition = el.mPosition; } + protected IfcConic(IfcAxis2Placement ap) : base(ap.Database) { mPosition = ap.Index; } + protected static void parseFields(IfcConic c, List arrFields, ref int ipos) { IfcCurve.parseFields(c, arrFields, ref ipos); c.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition); } + } + public partial class IfcConnectedFaceSet : IfcTopologicalRepresentationItem //SUPERTYPE OF (ONEOF (IfcClosedShell ,IfcOpenShell)) + { + private List mCfsFaces = new List();// : SET [1:?] OF IfcFace; + public List CfsFaces { get { return mCfsFaces.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcFace); } } + + internal IfcConnectedFaceSet() : base() { } + internal IfcConnectedFaceSet(IfcConnectedFaceSet c) : base(c) { mCfsFaces = new List(c.mCfsFaces.ToArray()); } + internal IfcConnectedFaceSet(List faces) : base(faces[0].mDatabase) { mCfsFaces = faces.ConvertAll(x => x.mIndex); } + protected override string BuildString() + { + if (mDatabase.mOutputEssential || mCfsFaces.Count == 0) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mCfsFaces[0]); + if (mCfsFaces.Count > 100) + { + StringBuilder sb = new StringBuilder(); + for (int icounter = 1; icounter < mCfsFaces.Count; icounter++) + sb.Append(",#" + mCfsFaces[icounter]); + + str += sb.ToString(); + } + else + { + for (int icounter = 1; icounter < mCfsFaces.Count; icounter++) + str += ",#" + mCfsFaces[icounter]; + } + return str + ")"; + } + protected override void Parse(string str, ref int ipos) { base.Parse(str, ref ipos); mCfsFaces = ParserSTEP.SplitListLinks(str.Substring(1, str.Length - 2)); } + internal static IfcConnectedFaceSet Parse(string strDef) { IfcConnectedFaceSet s = new IfcConnectedFaceSet(); int ipos = 0; s.Parse(strDef, ref ipos); return s; } + + } + public class IfcConnectionCurveGeometry : IfcConnectionGeometry + { + private int mCurveOnRelatingElement;// : IfcCurveOrEdgeCurve; + private int mCurveOnRelatedElement;// : OPTIONAL IfcCurveOrEdgeCurve; + + //internal IfcCurveOrEdgeCurve CurveOnRelatingElement { get { } } + //internal IfcCurveOrEdgeCurve CurveOnRelatedElement { get { } } + + internal IfcConnectionCurveGeometry() : base() { } + internal IfcConnectionCurveGeometry(IfcConnectionCurveGeometry g) : base(g) { mCurveOnRelatingElement = g.mCurveOnRelatingElement; mCurveOnRelatedElement = g.mCurveOnRelatedElement; } + internal static IfcConnectionCurveGeometry Parse(string strDef) { IfcConnectionCurveGeometry c = new IfcConnectionCurveGeometry(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcConnectionCurveGeometry c, List arrFields, ref int ipos) { IfcConnectionGeometry.parseFields(c, arrFields, ref ipos); c.mCurveOnRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); c.mCurveOnRelatedElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mCurveOnRelatingElement) + "," + ParserSTEP.LinkToString(mCurveOnRelatedElement); } + } + public abstract class IfcConnectionGeometry : BaseClassIfc /*ABSTRACT SUPERTYPE OF (ONEOF(IfcConnectionCurveGeometry,IfcConnectionPointGeometry,IfcConnectionPortGeometry,IfcConnectionSurfaceGeometry));*/ + { + protected IfcConnectionGeometry() : base() { } + protected IfcConnectionGeometry(IfcConnectionGeometry i) : base() { } + protected IfcConnectionGeometry(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcConnectionGeometry c, List arrFields, ref int ipos) { } + } + public partial class IfcConnectionPointEccentricity : IfcConnectionPointGeometry + { + private double mEccentricityInX, mEccentricityInY, mEccentricityInZ;// : OPTIONAL IfcLengthMeasure; + + internal IfcConnectionPointEccentricity() : base() { } + internal IfcConnectionPointEccentricity(IfcConnectionPointEccentricity el) : base(el) { mEccentricityInX = el.mEccentricityInX; mEccentricityInY = el.mEccentricityInY; mEccentricityInZ = el.mEccentricityInZ; } + internal new static IfcConnectionPointEccentricity Parse(string strDef) { IfcConnectionPointEccentricity c = new IfcConnectionPointEccentricity(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcConnectionPointEccentricity c, List arrFields, ref int ipos) { IfcConnectionPointGeometry.parseFields(c, arrFields, ref ipos); c.mEccentricityInX = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mEccentricityInY = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mEccentricityInZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mEccentricityInX) + "," + ParserSTEP.DoubleOptionalToString(mEccentricityInY) + "," + ParserSTEP.DoubleOptionalToString(mEccentricityInZ); } + } + public class IfcConnectionPointGeometry : IfcConnectionGeometry + { + private int mPointOnRelatingElement;// : IfcPointOrVertexPoint; + private int mPointOnRelatedElement;// : OPTIONAL IfcPointOrVertexPoint; + + internal IfcPointOrVertexPoint PointOnRelatingElement { get { return mDatabase.mIfcObjects[mPointOnRelatingElement] as IfcPointOrVertexPoint; } } + internal IfcPointOrVertexPoint PointOnRelatedElement { get { return mDatabase.mIfcObjects[mPointOnRelatedElement] as IfcPointOrVertexPoint; } } + + internal IfcConnectionPointGeometry() : base() { } + internal IfcConnectionPointGeometry(IfcConnectionPointGeometry g) : base(g) { mPointOnRelatingElement = g.mPointOnRelatingElement; mPointOnRelatedElement = g.mPointOnRelatedElement; } + internal IfcConnectionPointGeometry(IfcPointOrVertexPoint v) : base(v.Database) { mPointOnRelatingElement = v.Index; } + internal static IfcConnectionPointGeometry Parse(string strDef) { IfcConnectionPointGeometry c = new IfcConnectionPointGeometry(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcConnectionPointGeometry c, List arrFields, ref int ipos) { IfcConnectionGeometry.parseFields(c, arrFields, ref ipos); c.mPointOnRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); c.mPointOnRelatedElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPointOnRelatingElement) + "," + ParserSTEP.LinkToString(mPointOnRelatedElement); } + } + //ENTITY IfcConnectionPortGeometry // DEPRECEATED IFC4 + public class IfcConnectionSurfaceGeometry : IfcConnectionGeometry + { + internal int mSurfaceOnRelatingElement;// : IfcSurfaceOrFaceSurface; + internal int mSurfaceOnRelatedElement;// : OPTIONAL IfcSurfaceOrFaceSurface; + + //internal IfcSurfaceOrFaceSurface SurfaceOnRelatingElement { get { return mModel.mIFCobjs[mSurfaceOnRelatingElement]; } } + //internal IfcSurfaceOrFaceSurface SurfaceOnRelatedElement { get { return mModel.mIFCobjs[mSurfaceOnRelatedElement]; } } + + internal IfcConnectionSurfaceGeometry() : base() { } + internal IfcConnectionSurfaceGeometry(IfcConnectionSurfaceGeometry el) : base(el) { mSurfaceOnRelatingElement = el.mSurfaceOnRelatingElement; mSurfaceOnRelatedElement = el.mSurfaceOnRelatedElement; } + internal static IfcConnectionSurfaceGeometry Parse(string strDef) { IfcConnectionSurfaceGeometry c = new IfcConnectionSurfaceGeometry(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcConnectionSurfaceGeometry c, List arrFields, ref int ipos) { IfcConnectionGeometry.parseFields(c, arrFields, ref ipos); c.mSurfaceOnRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); c.mSurfaceOnRelatedElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSurfaceOnRelatingElement) + "," + ParserSTEP.LinkToString(mSurfaceOnRelatedElement); } + } + public abstract class IfcConstraint : BaseClassIfc, IfcResourceObjectSelect //IFC4Change ABSTRACT SUPERTYPE OF(ONEOF(IfcMetric, IfcObjective)); + { + internal string mName;// : IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal IfcConstraintEnum mConstraintGrade;// : IfcConstraintEnum + internal string mConstraintSource = "$";// : OPTIONAL IfcLabel; + internal int mCreatingActor;// : OPTIONAL IfcActorSelect; + internal string mCreationTime = "$";// : OPTIONAL IfcDateTimeSelect; IFC4 IfcDateTime + internal int mSSCreationTime;// : OPTIONAL IfcDateTimeSelect; IFC4 IfcDateTime + internal string mUserDefinedGrade = "$";// : OPTIONAL IfcLabel + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "NOTDEFINED" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcConstraintEnum ConstraintGrade { get { return mConstraintGrade; } set { mConstraintGrade = value; } } + public string ConstraintSource { get { return (mConstraintSource == "$" ? "" : ParserIfc.Decode(mConstraintSource)); } set { mConstraintSource = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcActorSelect CreatingActor { get { return mDatabase.mIfcObjects[mCreatingActor] as IfcActorSelect; } set { mCreatingActor = (value == null ? 0 : value.Index); } } + //creationtime + public string UserDefinedGrade { get { return (mUserDefinedGrade == "$" ? "" : ParserIfc.Decode(mUserDefinedGrade)); } set { mUserDefinedGrade = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + // INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mPropertiesForConstraint = new List();// : SET OF IfcResourceConstraintRelationship FOR RelatingConstraint; + internal List mHasConstraintRelationships = new List(); //gg + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + protected IfcConstraint() : base() { } + protected IfcConstraint(IfcConstraint c) : base() + { + mName = c.mName; + mDescription = c.mDescription; + mConstraintGrade = c.mConstraintGrade; + mConstraintSource = c.mConstraintSource; + mCreatingActor = c.mCreatingActor; + mCreationTime = c.mCreationTime; + mSSCreationTime = c.mSSCreationTime; + mUserDefinedGrade = c.mUserDefinedGrade; + } + protected IfcConstraint(DatabaseIfc db, string name, IfcConstraintEnum constraint) : base(db) { Name = name; mConstraintGrade = constraint; } + internal static void parseFields(IfcConstraint a, List arrFields, ref int ipos, Schema schema) + { + a.mName = arrFields[ipos++].Replace("'", ""); + a.mDescription = arrFields[ipos++].Replace("'", ""); + a.mConstraintGrade = (IfcConstraintEnum)Enum.Parse(typeof(IfcConstraintEnum), arrFields[ipos++].Replace(".", "")); + a.mConstraintSource = arrFields[ipos++].Replace("'", ""); + a.mCreatingActor = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + a.mSSCreationTime = ParserSTEP.ParseLink(arrFields[ipos++]); + else + a.mCreationTime = arrFields[ipos++].Replace("'", ""); + a.mUserDefinedGrade = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + ",'" + mName + (mDescription == "$" ? "',$,." : "','" + mDescription + "',.") + mConstraintGrade.ToString() + (mConstraintSource == "$" ? ".,$," : ".,'" + mConstraintSource + "',") + ParserSTEP.LinkToString(mCreatingActor) + "," + (mDatabase.mSchema == Schema.IFC2x3 ? ParserSTEP.LinkToString(mSSCreationTime) : (mCreationTime == "$" ? "$" : "'" + mCreationTime + "'")) + (mUserDefinedGrade == "$" ? ",$" : ",'" + mUserDefinedGrade + "'"); } + } + //ENTITY IfcConstraintAggregationRelationship; // DEPRECEATED IFC4 + //ENTITY IfcConstraintclassificationRelationship; // DEPRECEATED IFC4 + //ENTITY IfcConstraintRelationship; // DEPRECEATED IFC4 + //ENTITY IfcConstructionResource + public class IfcConstructionEquipmentResource : IfcConstructionResource + { + internal IfcConstructionEquipmentResourceTypeEnum mPredefinedType = IfcConstructionEquipmentResourceTypeEnum.NOTDEFINED;// OPTIONAL : IfcRoofTypeEnum; + public IfcConstructionEquipmentResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcConstructionEquipmentResource() : base() { } + internal IfcConstructionEquipmentResource(IfcConstructionEquipmentResource r) : base(r) { mPredefinedType = r.mPredefinedType; } + internal IfcConstructionEquipmentResource(DatabaseIfc m) : base(m) { } + internal static IfcConstructionEquipmentResource Parse(string strDef, Schema schema) { IfcConstructionEquipmentResource r = new IfcConstructionEquipmentResource(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcConstructionEquipmentResource r, List arrFields, ref int ipos, Schema schema) + { + IfcConstructionResource.parseFields(r, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcConstructionEquipmentResourceTypeEnum)Enum.Parse(typeof(IfcConstructionEquipmentResourceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcConstructionEquipmentResourceType : IfcConstructionResourceType //IFC4 + { + internal IfcConstructionEquipmentResourceTypeEnum mPredefinedType = IfcConstructionEquipmentResourceTypeEnum.NOTDEFINED; + public IfcConstructionEquipmentResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcConstructionEquipmentResourceType() : base() { } + internal IfcConstructionEquipmentResourceType(IfcConstructionEquipmentResourceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcConstructionEquipmentResourceType(DatabaseIfc m, string name, IfcConstructionEquipmentResourceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcConstructionEquipmentResourceType t, List arrFields, ref int ipos) { IfcConstructionResourceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcConstructionEquipmentResourceTypeEnum)Enum.Parse(typeof(IfcConstructionEquipmentResourceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcConstructionEquipmentResourceType Parse(string strDef) { IfcConstructionEquipmentResourceType t = new IfcConstructionEquipmentResourceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcConstructionMaterialResource : IfcConstructionResource + { + internal IfcConstructionMaterialResourceTypeEnum mPredefinedType = IfcConstructionMaterialResourceTypeEnum.NOTDEFINED;// OPTIONAL : IfcRoofTypeEnum; + public IfcConstructionMaterialResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcConstructionMaterialResource() : base() { } + internal IfcConstructionMaterialResource(IfcConstructionMaterialResource o) : base(o) { mPredefinedType = o.mPredefinedType; } + internal IfcConstructionMaterialResource(DatabaseIfc m) : base(m) { } + internal static IfcConstructionMaterialResource Parse(string strDef, Schema schema) { IfcConstructionMaterialResource r = new IfcConstructionMaterialResource(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcConstructionMaterialResource r, List arrFields, ref int ipos, Schema schema) + { + IfcConstructionResource.parseFields(r, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcConstructionMaterialResourceTypeEnum)Enum.Parse(typeof(IfcConstructionMaterialResourceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcConstructionMaterialResourceType : IfcConstructionResourceType //IFC4 + { + internal IfcConstructionMaterialResourceTypeEnum mPredefinedType = IfcConstructionMaterialResourceTypeEnum.NOTDEFINED; + public IfcConstructionMaterialResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcConstructionMaterialResourceType() : base() { } + internal IfcConstructionMaterialResourceType(IfcConstructionMaterialResourceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcConstructionMaterialResourceType(DatabaseIfc m, string name, IfcConstructionMaterialResourceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcConstructionMaterialResourceType t, List arrFields, ref int ipos) { IfcConstructionResourceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcConstructionMaterialResourceTypeEnum)Enum.Parse(typeof(IfcConstructionMaterialResourceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcConstructionMaterialResourceType Parse(string strDef) { IfcConstructionMaterialResourceType t = new IfcConstructionMaterialResourceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcConstructionProductResource : IfcConstructionResource + { + internal IfcConstructionProductResourceTypeEnum mPredefinedType = IfcConstructionProductResourceTypeEnum.NOTDEFINED;// OPTIONAL : IfcRoofTypeEnum; + public IfcConstructionProductResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcConstructionProductResource() : base() { } + internal IfcConstructionProductResource(IfcConstructionProductResource r) : base(r) { mPredefinedType = r.mPredefinedType; } + internal IfcConstructionProductResource(DatabaseIfc m) : base(m) { } + internal static IfcConstructionProductResource Parse(string strDef, Schema schema) { IfcConstructionProductResource r = new IfcConstructionProductResource(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcConstructionProductResource r, List arrFields, ref int ipos, Schema schema) + { + IfcConstructionResource.parseFields(r, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcConstructionProductResourceTypeEnum)Enum.Parse(typeof(IfcConstructionProductResourceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + internal class IfcConstructionProductResourceType : IfcConstructionResourceType //IFC4 + { + internal IfcConstructionProductResourceTypeEnum mPredefinedType = IfcConstructionProductResourceTypeEnum.NOTDEFINED; + public IfcConstructionProductResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcConstructionProductResourceType() : base() { } + internal IfcConstructionProductResourceType(IfcConstructionProductResourceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcConstructionProductResourceType(DatabaseIfc m, string name, IfcConstructionProductResourceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcConstructionProductResourceType t, List arrFields, ref int ipos) { IfcConstructionResourceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcConstructionProductResourceTypeEnum)Enum.Parse(typeof(IfcConstructionProductResourceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcConstructionProductResourceType Parse(string strDef) { IfcConstructionProductResourceType t = new IfcConstructionProductResourceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract class IfcConstructionResource : IfcResource //ABSTRACT SUPERTYPE OF (ONEOF(IfcConstructionEquipmentResource, IfcConstructionMaterialResource, IfcConstructionProductResource, IfcCrewResource, IfcLaborResource, IfcSubContractResource)) + { + internal int mUsage; //: OPTIONAL IfcResourceTime; IFC4 + internal List mBaseCosts = new List();// : OPTIONAL LIST [1:?] OF IfcAppliedValue; IFC4 + internal int mBaseQuantity;// : OPTIONAL IfcPhysicalQuantity; IFC4 + + internal IfcResourceTime Usage { get { return mDatabase.mIfcObjects[mUsage] as IfcResourceTime; } set { mUsage = (value == null ? 0 : value.mIndex); } } + + protected IfcConstructionResource() : base() { } + protected IfcConstructionResource(IfcConstructionResource r) : base(r) { mUsage = r.mUsage; mBaseCosts.AddRange(r.mBaseCosts); mBaseQuantity = r.mBaseQuantity; } + protected IfcConstructionResource(DatabaseIfc m) : base(m) { } + protected IfcConstructionResource(DatabaseIfc m, IfcResourceTime usage, List baseCosts, IfcPhysicalQuantity baseQuantity) + : base(m) { if (usage != null) mUsage = usage.mIndex; if (baseCosts != null && baseCosts.Count > 0) mBaseCosts = baseCosts.ConvertAll(x => x.mIndex); if (baseQuantity != null) mBaseQuantity = baseQuantity.mIndex; } + protected static void parseFields(IfcConstructionResource c, List arrFields, ref int ipos, Schema schema) + { + IfcResource.parseFields(c, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + c.mUsage = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mBaseCosts = ParserSTEP.SplitListLinks(arrFields[ipos++]); + c.mBaseQuantity = ParserSTEP.ParseLink(arrFields[ipos++]); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mUsage == 0 ? ",$," : ",#" + mUsage + ",") + ParserSTEP.ListLinksToString(mBaseCosts) + (mBaseQuantity == 0 ? ",$" : ",#" + mBaseQuantity)); } + } + public abstract class IfcConstructionResourceType : IfcTypeResource //IFC4 + { + internal List mBaseCosts = new List();// : OPTIONAL LIST [1:?] OF IfcAppliedValue; + internal int mBaseQuantity;// : OPTIONAL IfcPhysicalQuantity; + + internal List BaseCosts { get { return mBaseCosts.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcAppliedValue); } set { mBaseCosts = (value == null ? new List() : value.ConvertAll(x => x.mIndex)); } } + internal IfcPhysicalQuantity BaseQuantity { get { return mDatabase.mIfcObjects[mBaseQuantity] as IfcPhysicalQuantity; } set { mBaseQuantity = (value == null ? 0 : value.mIndex); } } + + protected IfcConstructionResourceType() : base() { } + protected IfcConstructionResourceType(IfcConstructionResourceType t) : base(t) { mBaseCosts.AddRange(t.mBaseCosts); mBaseQuantity = t.mBaseQuantity; } + protected IfcConstructionResourceType(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcConstructionResourceType t, List arrFields, ref int ipos) { IfcTypeProcess.parseFields(t, arrFields, ref ipos); t.mBaseCosts = ParserSTEP.SplitListLinks(arrFields[ipos++]); t.mBaseQuantity = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + "," + ParserSTEP.ListLinksToString(mBaseCosts) + (mBaseQuantity == 0 ? ",$" : ",#" + mBaseQuantity)); } + } + public abstract partial class IfcContext : IfcObjectDefinition, IfcObjectDefinitionSelect//(IfcProject, IfcProjectLibrary) + { + internal string mObjectType = "$";// : OPTIONAL IfcLabel; + private string mLongName = "$";// : OPTIONAL IfcLabel; + private string mPhase = "$";// : OPTIONAL IfcLabel; + internal List mRepresentationContexts = new List();// : OPTIONAL SET [1:?] OF IfcRepresentationContext; + private int mUnitsInContext;// : OPTIONAL IfcUnitAssignment; + //INVERSE + internal List mIsDefinedBy = new List(); + internal List mDeclares = new List(); + + public string ObjectType { get { return mObjectType == "$" ? "" : ParserIfc.Decode(mObjectType); } set { mObjectType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value)); } } + public string LongName { get { return (mLongName == "$" ? "" : ParserIfc.Decode(mLongName)); } set { mLongName = (string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Phase { get { return (mPhase == "$" ? "" : ParserIfc.Decode(mPhase)); } set { mPhase = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List RepresentationContexts { get { return mRepresentationContexts.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcRepresentationContext); } } + public IfcUnitAssignment UnitsInContext { get { return mDatabase.mIfcObjects[mUnitsInContext] as IfcUnitAssignment; } set { mUnitsInContext = (value == null ? 0 : value.mIndex); } } + + public List IsDefinedBy { get { return mIsDefinedBy; } } + public List Declares { get { return mDeclares; } } + + public DatabaseIfc Model { get { return mDatabase; } } + + protected IfcContext() : base() { } + protected IfcContext(IfcContext o) : base(o) { mObjectType = o.mObjectType; mLongName = o.mLongName; mPhase = o.mPhase; mRepresentationContexts = new List(o.mRepresentationContexts.ToArray()); mUnitsInContext = o.mUnitsInContext; } + + protected IfcContext(DatabaseIfc m, string name, IfcUnitAssignment.Length length) : base(m) + { + Name = name; + if (m.mGeomRepContxt != null) + mRepresentationContexts.Add(m.mGeomRepContxt.mIndex); + IfcUnitAssignment u = new IfcUnitAssignment(m); + u.SetUnits(length); + mUnitsInContext = u.mIndex; + mIsDecomposedBy.Clear(); //??? Jon + } + protected IfcContext(DatabaseIfc m, string name) : base(m) + { + Name = name; + if (m.mGeomRepContxt != null) + mRepresentationContexts.Add(m.mGeomRepContxt.mIndex); + mIsDecomposedBy.Clear(); //??? Jon + } + internal static void parseFields(IfcContext p, List arrFields, ref int ipos) + { + IfcObjectDefinition.parseFields(p, arrFields, ref ipos); + p.mObjectType = arrFields[ipos++].Replace("'", ""); + p.mLongName = arrFields[ipos++].Replace("'", ""); + p.mPhase = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + if (s != "$") + p.mRepresentationContexts = ParserSTEP.SplitListLinks(s); + p.mUnitsInContext = ParserSTEP.ParseLink(arrFields[ipos++]); + + } + protected override string BuildString() + { + string str = base.BuildString() + (mObjectType == "$" ? ",$" : ",'" + mObjectType + "'") + (mLongName == "$" ? ",$" : ",'" + mLongName + "'") + (mPhase == "$" ? ",$" : ",'" + mPhase + "'"); + if (mRepresentationContexts.Count == 0) + return str + ",$," + (mUnitsInContext == 0 ? "$" : ParserSTEP.LinkToString(mUnitsInContext)); + { + str += ",(" + ParserSTEP.LinkToString(mRepresentationContexts[0]); + for (int icounter = 1; icounter < mRepresentationContexts.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRepresentationContexts[icounter]); + } + return str + ")," + (mUnitsInContext == 0 ? "$" : ParserSTEP.LinkToString(mUnitsInContext)); + } + + internal void setStructuralUnits() + { + IfcUnitAssignment ua = UnitsInContext; + if (ua != null) + ua.setStructuralUnits(); + } + internal double setSIScale() + { + IfcUnitAssignment ua = UnitsInContext; + if (ua != null) + return ua.LengthScaleSI; + return 1; + } + internal void initializeUnitsAndScales() + { + if (mRepresentationContexts.Count > 0) + { + for (int icounter = 0; icounter < mRepresentationContexts.Count; icounter++) + { + IfcGeometricRepresentationContext c = mDatabase.mIfcObjects[mRepresentationContexts[icounter]] as IfcGeometricRepresentationContext; + if (c != null) + { + mDatabase.Tolerance = c.mPrecision; + break; + } + } + } + setSIScale(); + } + public void AddDeclared(IfcDefinitionSelect o) + { + if (mDeclares.Count == 0) + { + IfcRelDeclares d = new IfcRelDeclares(this, o); + } + else + mDeclares[0].AddRelated(o); + } + } + //ENTITY IfcContextDependentUnit, IfcResourceObjectSelect + public abstract partial class IfcControl : IfcObject //ABSTRACT SUPERTYPE OF (ONEOF (IfcActionRequest ,IfcConditionCriterion ,IfcCostItem ,IfcCostSchedule,IfcEquipmentStandard ,IfcFurnitureStandard + { // ,IfcPerformanceHistory ,IfcPermit ,IfcProjectOrder ,IfcProjectOrderRecord ,IfcScheduleTimeControl ,IfcServiceLife ,IfcSpaceProgram ,IfcTimeSeriesSchedule,IfcWorkControl)) + internal string mIdentification = "$"; // : OPTIONAL IfcIdentifier; IFC4 + //INVERSE + internal List mControls = new List();/// : SET OF IfcRelAssignsToControl FOR RelatingControl; + + public string Identification { get { return (mIdentification == "$" ? "" : ParserIfc.Decode(mIdentification)); } set { mIdentification = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcControl() : base() { } + protected IfcControl(IfcControl o) : base(o) { mIdentification = o.mIdentification; } + protected IfcControl(DatabaseIfc m) : base(m) + { + if (mDatabase.mModelView != ModelView.Ifc4NotAssigned && mDatabase.mModelView != ModelView.If2x3NotAssigned) + throw new Exception("Invalid Model View for IfcActor : " + m.ModelView.ToString()); + } + protected static void parseFields(IfcControl c, List arrFields, ref int ipos,Schema schema) { IfcObject.parseFields(c, arrFields, ref ipos); if (schema != Schema.IFC2x3) c.mIdentification = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mIdentification == "$" ? ",$" : ",'" + mIdentification + "'")); } + + public void Assign(IfcObjectDefinition o) { if (mControls.Count == 0) mControls.Add(new IfcRelAssignsToControl(this, o)); else mControls[0].assign(o); } + + } + public class IfcController : IfcDistributionControlElement //IFC4 + { + internal IfcControllerTypeEnum mPredefinedType = IfcControllerTypeEnum.NOTDEFINED; + public IfcControllerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcController(IfcController a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcController() : base() { } + internal IfcController(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcController c, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(c, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + c.mPredefinedType = (IfcControllerTypeEnum)Enum.Parse(typeof(IfcControllerTypeEnum), s.Replace(".", "")); + } + internal new static IfcController Parse(string strDef) { IfcController d = new IfcController(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcControllerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcControllerType : IfcDistributionControlElementType + { + internal IfcControllerTypeEnum mPredefinedType = IfcControllerTypeEnum.NOTDEFINED;// : IfcControllerTypeEnum; + public IfcControllerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcControllerType() : base() { } + internal IfcControllerType(IfcControllerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcControllerType(DatabaseIfc m, string name, IfcControllerTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcControllerType t,List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcControllerTypeEnum)Enum.Parse(typeof(IfcControllerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcControllerType Parse(string strDef) { IfcControllerType t = new IfcControllerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcConversionBasedUnit : IfcNamedUnit, IfcResourceObjectSelect + { + private string mName = "";// : IfcLabel; + private int mConversionFactor;// : IfcMeasureWithUnit; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + public override string Name { get { return ParserIfc.Decode(mName); } set { mName = ParserIfc.Encode(value); } } + internal IfcMeasureWithUnit ConversionFactor { get { return mDatabase.mIfcObjects[mConversionFactor] as IfcMeasureWithUnit; } } + + internal IfcConversionBasedUnit(IfcConversionBasedUnit el) : base(el) { mName = el.mName; mConversionFactor = el.mConversionFactor; } + internal IfcConversionBasedUnit() : base() { } + internal IfcConversionBasedUnit(IfcUnitEnum unit, string name, IfcMeasureWithUnit mu) + : base(mu.mDatabase, unit, true) { Name = name.Replace("'", ""); mConversionFactor = mu.mIndex; } + internal static IfcConversionBasedUnit Parse(string strDef) { IfcConversionBasedUnit u = new IfcConversionBasedUnit(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + internal static void parseFields(IfcConversionBasedUnit u, List arrFields, ref int ipos) { IfcNamedUnit.parseFields(u, arrFields, ref ipos); u.mName = arrFields[ipos++].Replace("'", ""); u.mConversionFactor = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + ",'" + mName + "'," + ParserSTEP.LinkToString(mConversionFactor); } + internal override double getSIFactor() { return ConversionFactor.getSIFactor(); } + } + public class IfcConversionBasedUnitWithOffset : IfcConversionBasedUnit //IFC4 + { + internal double mConversionOffset = 0;// : IfcReal + internal IfcConversionBasedUnitWithOffset(IfcConversionBasedUnitWithOffset el) : base(el) { mConversionOffset = el.mConversionOffset; } + internal IfcConversionBasedUnitWithOffset() : base() { } + internal IfcConversionBasedUnitWithOffset(IfcUnitEnum unit, string name, IfcMeasureWithUnit mu, double offset) + : base(unit, name, mu) { mConversionOffset = offset; } + internal new static IfcConversionBasedUnitWithOffset Parse(string strDef) { IfcConversionBasedUnitWithOffset u = new IfcConversionBasedUnitWithOffset(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + internal static void parseFields(IfcConversionBasedUnitWithOffset u, List arrFields, ref int ipos) { IfcConversionBasedUnit.parseFields(u, arrFields, ref ipos); u.mConversionOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mConversionOffset); } + } + public class IfcCooledBeam : IfcEnergyConversionDevice //IFC4 + { + internal IfcCooledBeamTypeEnum mPredefinedType = IfcCooledBeamTypeEnum.NOTDEFINED;// OPTIONAL : IfcCooledBeamTypeEnum; + public IfcCooledBeamTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCooledBeam() : base() { } + internal IfcCooledBeam(IfcCooledBeam b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcCooledBeam(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCooledBeam s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCooledBeamTypeEnum)Enum.Parse(typeof(IfcCooledBeamTypeEnum), str); + } + internal new static IfcCooledBeam Parse(string strDef) { IfcCooledBeam s = new IfcCooledBeam(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCooledBeamTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + internal class IfcCooledBeamType : IfcEnergyConversionDeviceType + { + internal IfcCooledBeamTypeEnum mPredefinedType = IfcCooledBeamTypeEnum.NOTDEFINED;// : IfcCooledBeamTypeEnum + public IfcCooledBeamTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCooledBeamType() : base() { } + internal IfcCooledBeamType(IfcCooledBeamType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCooledBeamType(DatabaseIfc m, string name, IfcCooledBeamTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcCooledBeamType t,List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t,arrFields, ref ipos); t.mPredefinedType = (IfcCooledBeamTypeEnum)Enum.Parse(typeof(IfcCooledBeamTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCooledBeamType Parse(string strDef) { IfcCooledBeamType t = new IfcCooledBeamType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCoolingTower : IfcEnergyConversionDevice //IFC4 + { + internal IfcCoolingTowerTypeEnum mPredefinedType = IfcCoolingTowerTypeEnum.NOTDEFINED;// OPTIONAL : IfcCoolingTowerTypeEnum; + public IfcCoolingTowerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCoolingTower() : base() { } + internal IfcCoolingTower(IfcCoolingTower t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCoolingTower(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcCoolingTower s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcCoolingTowerTypeEnum)Enum.Parse(typeof(IfcCoolingTowerTypeEnum), str); + } + internal new static IfcCoolingTower Parse(string strDef) { IfcCoolingTower s = new IfcCoolingTower(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcCoolingTowerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcCoolingTowerType : IfcEnergyConversionDeviceType + { + internal IfcCoolingTowerTypeEnum mPredefinedType = IfcCoolingTowerTypeEnum.NOTDEFINED;// : IfcCoolingTowerTypeEnum + public IfcCoolingTowerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCoolingTowerType() : base() { } + internal IfcCoolingTowerType(IfcCoolingTowerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCoolingTowerType(DatabaseIfc m, string name, IfcCoolingTowerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcCoolingTowerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCoolingTowerTypeEnum)Enum.Parse(typeof(IfcCoolingTowerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCoolingTowerType Parse(string strDef) { IfcCoolingTowerType t = new IfcCoolingTowerType(); int ipos = 0; parseFields(t,ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCoordinatedUniversalTimeOffset : BaseClassIfc //DEPRECEATED IFC4 + { + internal int mHourOffset;// : IfcHourInDay; + internal int mMinuteOffset;// : OPTIONAL IfcMinuteInHour; + internal IfcAheadOrBehind mSense = IfcAheadOrBehind.AHEAD;// : IfcAheadOrBehind; + internal IfcCoordinatedUniversalTimeOffset(IfcCoordinatedUniversalTimeOffset v) : base() { mHourOffset = v.mHourOffset; mMinuteOffset = v.mMinuteOffset; mSense = v.mSense; } + internal IfcCoordinatedUniversalTimeOffset() : base() { } + internal static void parseFields(IfcCoordinatedUniversalTimeOffset s,List arrFields, ref int ipos) { s.mHourOffset = int.Parse(arrFields[ipos++]); s.mMinuteOffset = int.Parse(arrFields[ipos++]); s.mSense = (IfcAheadOrBehind)Enum.Parse(typeof(IfcAheadOrBehind),arrFields[ipos++].Replace(".","")); } + internal static IfcCoordinatedUniversalTimeOffset Parse(string strDef) { IfcCoordinatedUniversalTimeOffset t = new IfcCoordinatedUniversalTimeOffset(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + "," + mHourOffset + "," + mMinuteOffset + ",." + mSense.ToString() + "."; } + } + public abstract partial class IfcCoordinateOperation : BaseClassIfc // IFC4 ABSTRACT SUPERTYPE OF(IfcMapConversion); + { + private int mSourceCRS;// : IfcCoordinateReferenceSystemSelect; + private int mTargetCRS;// : IfcCoordinateReferenceSystem; + + public IfcCoordinateReferenceSystemSelect SourceCRS { get { return mDatabase.mIfcObjects[mSourceCRS] as IfcCoordinateReferenceSystemSelect; } } + public IfcCoordinateReferenceSystem TargetCRS { get { return mDatabase.mIfcObjects[mTargetCRS] as IfcCoordinateReferenceSystem; } } + + protected IfcCoordinateOperation() : base() { } + protected IfcCoordinateOperation(IfcCoordinateOperation p) : base() { mSourceCRS = p.mSourceCRS; mTargetCRS = p.mTargetCRS; } + protected IfcCoordinateOperation(DatabaseIfc m, IfcCoordinateReferenceSystemSelect source, IfcCoordinateReferenceSystem target) : base(m) { mSourceCRS = source.Index; mTargetCRS = target.mIndex; } + protected static void parseFields(IfcCoordinateOperation o, List arrFields, ref int ipos) + { + o.mSourceCRS = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mTargetCRS = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSourceCRS) + "," + ParserSTEP.LinkToString(mTargetCRS); } + internal void Relate() + { + SourceCRS.HasCoordinateOperation = this; + } + } + public abstract class IfcCoordinateReferenceSystem : BaseClassIfc, IfcCoordinateReferenceSystemSelect // IFC4 ABSTRACT SUPERTYPE OF(IfcProjectedCRS); + { + internal string mName = "$";//: OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal string mGeodeticDatum; // : IfcIdentifier; + internal string mVerticalDatum = "$"; //: OPTIONAL IfcIdentifier; + + //INVERSE + private IfcCoordinateOperation mHasCoordinateOperation = null; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { if (!string.IsNullOrEmpty(value)) mName = ParserIfc.Encode(value.Replace("'","")); } } + public IfcCoordinateOperation HasCoordinateOperation { get { return mHasCoordinateOperation; } set { mHasCoordinateOperation = value; } } + + protected IfcCoordinateReferenceSystem() : base() { } + protected IfcCoordinateReferenceSystem(IfcCoordinateReferenceSystem p) : base() { mName = p.mName; mDescription = p.mDescription; mGeodeticDatum = p.mGeodeticDatum; mVerticalDatum = p.mVerticalDatum; } + protected IfcCoordinateReferenceSystem(DatabaseIfc m, string name, string desc, string geodeticDatum, string verticalDatum) : base(m) + { + if (!string.IsNullOrEmpty(name)) + mName = name.Replace("'", ""); + if (!string.IsNullOrEmpty(desc)) + mDescription = desc.Replace("'", ""); + mGeodeticDatum = geodeticDatum; + if (!string.IsNullOrEmpty(verticalDatum)) + mVerticalDatum = verticalDatum; + } + protected static void parseFields(IfcCoordinateReferenceSystem o, List arrFields, ref int ipos) + { + o.mName = arrFields[ipos++]; + o.mDescription = arrFields[ipos++]; + o.mGeodeticDatum = arrFields[ipos++]; + o.mVerticalDatum = arrFields[ipos++]; + } + protected override string BuildString() + { + return base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$,'" : "'" + mDescription + "','") + + mGeodeticDatum + (mVerticalDatum == "$" ? "',$" : "','" + mVerticalDatum + "'"); + } + } + public interface IfcCoordinateReferenceSystemSelect : IfcInterface { IfcCoordinateOperation HasCoordinateOperation { get; set; } } // IfcCoordinateReferenceSystem, IfcGeometricRepresentationContext + public class IfcCostItem : IfcControl + { + internal IfcCostItemTypeEnum mPredefinedType = IfcCostItemTypeEnum.NOTDEFINED; // IFC4 + internal List mCostValues = new List();// : OPTIONAL LIST [1:?] OF IfcCostValue; IFC4 + internal List mCostQuantities = new List();// : OPTIONAL LIST [1:?] OF IfcPhysicalQuantity; IFC4 + + public IfcCostItemTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCostItem() : base() { } + internal IfcCostItem(IfcCostItem i) : base(i) { } + internal IfcCostItem( IfcCostSchedule s, List values, List quants) + : this(s.mDatabase, values, quants) { s.AddAggregated(this); } + internal IfcCostItem(IfcCostItem i, List values, List quants) + : this(i.mDatabase, values, quants) { i.AddNested(this); } + internal IfcCostItem(DatabaseIfc m, List values, List quants) : base(m) + { + if (values != null && values.Count > 0) + mCostValues = values.ConvertAll(x => x.mIndex); + if (quants != null && quants.Count > 0) + mCostQuantities = quants.ConvertAll(x => x.mIndex); + } + internal static IfcCostItem Parse(string strDef, Schema schema) { IfcCostItem c = new IfcCostItem(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return c; } + internal static void parseFields(IfcCostItem c, List arrFields, ref int ipos, Schema schema) + { + IfcControl.parseFields(c, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + c.mPredefinedType = (IfcCostItemTypeEnum)Enum.Parse(typeof(IfcCostItemTypeEnum), s.Replace(".", "")); + s = arrFields[ipos++]; + if(s != "$") + c.mCostValues = ParserSTEP.SplitListLinks(s); + s = arrFields[ipos++]; + if(s != "$") + c.mCostQuantities = ParserSTEP.SplitListLinks(s); + } + } + protected override string BuildString() + { + string s = base.BuildString(); + if (mDatabase.mSchema != Schema.IFC2x3) + { + s += ",." + mPredefinedType.ToString(); + if (mCostValues.Count == 0) + s += ".,$,"; + else + { + s += ".,(" + ParserSTEP.LinkToString(mCostValues[0]); + for (int icounter = 1; icounter < mCostValues.Count; icounter++) + s += "," + ParserSTEP.LinkToString(mCostValues[icounter]); + s += "),"; + } + if (mCostQuantities.Count == 0) + s += "$"; + else + { + s += "(" + ParserSTEP.LinkToString(mCostQuantities[0]); + for (int icounter = 1; icounter < mCostQuantities.Count; icounter++) + s += "," + ParserSTEP.LinkToString(mCostQuantities[icounter]); + s += ")"; + } + } + return s; + } + } + public class IfcCostSchedule : IfcControl + { + internal IfcCostScheduleTypeEnum mPredefinedType = IfcCostScheduleTypeEnum.NOTDEFINED;// : OPTIONAL IfcCostScheduleTypeEnum; IFC4 relocated + internal string mStatus = "$";// : OPTIONAL IfcLabel; IFC4 relocated + internal string mSubmittedOn = "$";// : OPTIONAL IfcDateTime; IFC4 relocated : OPTIONAL IfcDateTimeSelect in control + internal string mUpdateDate = "$";// : OPTIONAL IfcDateTime; IFC4 relocated + private int mSubmittedBy;// : OPTIONAL IfcActorSelect; IFC4 DELETED + private int mPreparedBy;// : OPTIONAL IfcActorSelect; IFC4 DELETED + private List< int> mTargetUsers = new List();// : OPTIONAL SET [1:?] OF IfcActorSelect; //IFC4 DELETED + //internal string mID;// : IfcIdentifier; IFC4 relocated + public IfcCostScheduleTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public string Staus { get { return (mStatus == "$" ? "" : ParserIfc.Decode( mStatus)); } set { mStatus = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode( value.Replace("'",""))); } } + + internal IfcCostSchedule() : base() { } + internal IfcCostSchedule(IfcCostSchedule s) : base(s) + { + mSubmittedBy = s.mSubmittedBy; + mPreparedBy = s.mPreparedBy; + mSubmittedBy = s.mSubmittedBy; + mStatus = s.mStatus; + mTargetUsers = new List( s.mTargetUsers.ToArray()); + mUpdateDate = s.mUpdateDate; + mPredefinedType = s.mPredefinedType; + } + internal IfcCostSchedule(DatabaseIfc m, IfcCostScheduleTypeEnum t, string status, DateTime submitted, IfcProject prj) + : base(m) + { + mPredefinedType = t; + if (!string.IsNullOrEmpty(status)) + mStatus = status.Replace("'", ""); + if (submitted != DateTime.MinValue) + mSubmittedOn = (m.mSchema == Schema.IFC2x3 ? "#" + new IfcDateAndTime(new IfcCalendarDate(m,submitted.Day,submitted.Month,submitted.Year),new IfcLocalTime(m,submitted.Hour,submitted.Minute,submitted.Second)).mIndex : IfcDateTime.Convert( submitted));// IfcDate.convert(submitted); + mUpdateDate = IfcDate.convert(DateTime.Now); + if (prj != null) + prj.AddDeclared(this); + } + internal static IfcCostSchedule Parse(string strDef) { IfcCostSchedule c = new IfcCostSchedule(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcCostSchedule c,List arrFields, ref int ipos,Schema schema) + { + IfcControl.parseFields(c,arrFields, ref ipos,schema); + if(schema == Schema.IFC2x3) + { + c.mSubmittedBy = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mPreparedBy = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mSubmittedOn = arrFields[ipos++]; + c.mStatus = arrFields[ipos++].Replace("'",""); + c.mTargetUsers = ParserSTEP.SplitListLinks(arrFields[ipos++]); + c.mUpdateDate = arrFields[ipos++]; + c.mIdentification = arrFields[ipos++].Replace("'", ""); + c.mPredefinedType = (IfcCostScheduleTypeEnum)Enum.Parse(typeof(IfcCostScheduleTypeEnum), arrFields[ipos++].Replace(".", "")); + } + else + { + c.mPredefinedType = (IfcCostScheduleTypeEnum)Enum.Parse(typeof(IfcCostScheduleTypeEnum), arrFields[ipos++].Replace(".", "")); + c.mStatus = arrFields[ipos++].Replace("'", ""); + c.mSubmittedOn = arrFields[ipos++]; + c.mUpdateDate = arrFields[ipos++]; + } + } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3) + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mSubmittedBy) + "," + ParserSTEP.LinkToString(mPreparedBy) + "," + mSubmittedOn + "," + mStatus; + if (mTargetUsers.Count > 0) + { + str += ",(" + ParserSTEP.LinkToString(mTargetUsers[0]); + for (int icounter = 1; icounter < mTargetUsers.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mTargetUsers[icounter]); + str += "),"; + } + else + str += ",$,"; + return str + mUpdateDate + (mIdentification == "$" ? ",$,." : ",'" + mIdentification + "',.") + mPredefinedType.ToString() + "."; + } + return base.BuildString() + ",." + mPredefinedType.ToString() + (mStatus == "$" ? ".,$," : ".,'" + mStatus + "',") + mSubmittedOn + "," + mUpdateDate; + } + } + public partial class IfcCostValue : IfcAppliedValue + { + //internal string mCostType;// : IfcLabel; IFC4 renamed to category + //internal string mCondition = "$";// : OPTIONAL IfcText; IFC4 moved to condition + internal IfcCostValue() : base() { } + internal IfcCostValue(IfcCostValue o) : base(o) { } + internal new static IfcCostValue Parse(string strDef, Schema schema) { IfcCostValue v = new IfcCostValue(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return v; } + internal static void parseFields(IfcCostValue v, List arrFields, ref int ipos, Schema schema) { IfcAppliedValue.parseFields(v, arrFields, ref ipos, schema); if (schema == Schema.IFC2x3) { v.mCategory = arrFields[ipos++].Replace("'", ""); v.mCondition = arrFields[ipos++].Replace("'", ""); } } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? (mCategory == "$" ? ",$," : ",'" + mCategory + "',") + (mCondition == "$" ? "$" : "'" + mCondition + "'") : ""); } + } + public partial class IfcCovering : IfcBuildingElement + { + internal IfcCoveringTypeEnum mPredefinedType = IfcCoveringTypeEnum.NOTDEFINED;// : OPTIONAL IfcCoveringTypeEnum; + //INVERSE + internal IfcRelCoversSpaces mCoversSpaces = null;// : SET [0:1] OF IfcRelCoversSpaces FOR RelatedCoverings; + internal IfcRelCoversBldgElements mCoversElements = null;// : SET [0:1] OF IfcRelCoversBldgElements FOR RelatedCoverings; + + public IfcCoveringTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCovering() : base() { } + internal IfcCovering(IfcCovering o) : base(o) { mPredefinedType = o.mPredefinedType; } + public IfcCovering(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcCovering Parse(string strDef) { IfcCovering c = new IfcCovering(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcCovering c, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(c, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str != "$") + c.mPredefinedType = (IfcCoveringTypeEnum)Enum.Parse(typeof(IfcCoveringTypeEnum), str.Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + "," + (mPredefinedType == IfcCoveringTypeEnum.NOTDEFINED ? "$" : "." + mPredefinedType.ToString() + "."); } + } + public partial class IfcCoveringType : IfcBuildingElementType + { + internal IfcCoveringTypeEnum mPredefinedType = IfcCoveringTypeEnum.NOTDEFINED; + public IfcCoveringTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcCoveringType() : base() { } + internal IfcCoveringType(IfcCoveringType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcCoveringType(DatabaseIfc m, string name, IfcCoveringTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + + internal static void parseFields(IfcCoveringType e, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(e, arrFields, ref ipos); try { e.mPredefinedType = (IfcCoveringTypeEnum)Enum.Parse(typeof(IfcCoveringTypeEnum), arrFields[ipos++].Replace(".", "")); } catch (Exception) { } } + internal new static IfcCoveringType Parse(string strDef) { IfcCoveringType t = new IfcCoveringType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCraneRailAShapeProfileDef : IfcParameterizedProfileDef + { + internal double mOverallHeight, mBaseWidth2;// : IfcPositiveLengthMeasure; + internal double mRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mHeadWidth, mHeadDepth2, mHeadDepth3, mWebThickness, mBaseWidth4, mBaseDepth1, mBaseDepth2, mBaseDepth3;// : IfcPositiveLengthMeasure; + internal double mCentreOfGravityInY;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcCraneRailAShapeProfileDef() : base() { } + internal IfcCraneRailAShapeProfileDef(IfcCraneRailAShapeProfileDef i) + : base(i) + { + mOverallHeight = i.mOverallHeight; mBaseWidth2 = i.mBaseWidth2; mRadius = i.mRadius; mHeadWidth = i.mHeadWidth; mHeadDepth2 = i.mHeadDepth2; + mHeadDepth3 = i.mHeadDepth3; mWebThickness = i.mWebThickness; mBaseWidth4 = i.mBaseWidth4; mBaseDepth1 = i.mBaseDepth1; + mBaseDepth2 = i.mBaseDepth2; mBaseDepth3 = i.mBaseDepth3; mCentreOfGravityInY = i.mCentreOfGravityInY; + } + internal static void parseFields(IfcCraneRailAShapeProfileDef p, List arrFields, ref int ipos) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); p.mOverallHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mBaseWidth2 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mHeadWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mHeadDepth2 = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mHeadDepth3 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mWebThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mBaseWidth4 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mBaseDepth1 = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mBaseDepth2 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mBaseDepth3 = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mCentreOfGravityInY = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal new static IfcCraneRailAShapeProfileDef Parse(string strDef) { IfcCraneRailAShapeProfileDef p = new IfcCraneRailAShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mOverallHeight) + "," + ParserSTEP.DoubleToString(mBaseWidth2) + "," + ParserSTEP.DoubleOptionalToString(mRadius) + "," + ParserSTEP.DoubleToString(mHeadWidth) + "," + ParserSTEP.DoubleToString(mHeadDepth2) + "," + ParserSTEP.DoubleToString(mHeadDepth3) + "," + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mBaseDepth1) + "," + ParserSTEP.DoubleToString(mBaseDepth2) + "," + ParserSTEP.DoubleToString(mBaseDepth3) + "," + ParserSTEP.DoubleOptionalToString(mCentreOfGravityInY); } + } + public class IfcCraneRailFShapeProfileDef : IfcParameterizedProfileDef + { + internal double mOverallHeight, mHeadWidth;// : IfcPositiveLengthMeasure; + internal double mRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mHeadDepth2, mHeadDepth3, mWebThickness, mBaseDepth1, mBaseDepth2;// : IfcPositiveLengthMeasure; + internal double mCentreOfGravityInY;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcCraneRailFShapeProfileDef() : base() { } + internal IfcCraneRailFShapeProfileDef(IfcCraneRailFShapeProfileDef i) + : base(i) + { + mOverallHeight = i.mOverallHeight; mHeadWidth = i.mHeadWidth; mRadius = i.mRadius; mHeadDepth2 = i.mHeadDepth2; mHeadDepth3 = i.mHeadDepth3; + mWebThickness = i.mWebThickness; mBaseDepth1 = i.mBaseDepth1; mBaseDepth2 = i.mBaseDepth2; mCentreOfGravityInY = i.mCentreOfGravityInY; + } + internal static void parseFields(IfcCraneRailFShapeProfileDef p, List arrFields, ref int ipos) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); p.mOverallHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mHeadWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mHeadDepth2 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mHeadDepth3 = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mBaseDepth1 = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mBaseDepth2 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mCentreOfGravityInY = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal new static IfcCraneRailFShapeProfileDef Parse(string strDef) { IfcCraneRailFShapeProfileDef p = new IfcCraneRailFShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mOverallHeight) + "," + ParserSTEP.DoubleToString(mHeadWidth) + "," + ParserSTEP.DoubleOptionalToString(mRadius) + "," + ParserSTEP.DoubleToString(mHeadDepth2) + "," + ParserSTEP.DoubleToString(mHeadDepth3) + "," + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mBaseDepth1) + "," + ParserSTEP.DoubleToString(mBaseDepth2) + "," + ParserSTEP.DoubleOptionalToString(mCentreOfGravityInY); } + } + public class IfcCrewResource : IfcConstructionResource + { + internal IfcCrewResourceTypeEnum mPredefinedType = IfcCrewResourceTypeEnum.NOTDEFINED;// OPTIONAL : IfcCrewResourceTypeEnum; + public IfcCrewResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCrewResource() : base() { } + internal IfcCrewResource(IfcCrewResource o) : base(o) { mPredefinedType = o.mPredefinedType; } + internal IfcCrewResource(DatabaseIfc m) : base(m) { } + internal static IfcCrewResource Parse(string strDef, Schema schema) { IfcCrewResource r = new IfcCrewResource(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcCrewResource r, List arrFields, ref int ipos,Schema schema) + { + IfcConstructionResource.parseFields(r, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcCrewResourceTypeEnum)Enum.Parse(typeof(IfcCrewResourceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcCrewResourceType : IfcConstructionResourceType //IFC4 + { + internal IfcCrewResourceTypeEnum mPredefinedType = IfcCrewResourceTypeEnum.NOTDEFINED; + public IfcCrewResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCrewResourceType() : base() { } + internal IfcCrewResourceType(IfcCrewResourceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcCrewResourceType(DatabaseIfc m, string name, IfcCrewResourceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcCrewResourceType t, List arrFields, ref int ipos) { IfcCrewResourceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCrewResourceTypeEnum)Enum.Parse(typeof(IfcCrewResourceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCrewResourceType Parse(string strDef) { IfcCrewResourceType t = new IfcCrewResourceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcCsgPrimitive3D : IfcGeometricRepresentationItem, IfcBooleanOperand, IfcCsgSelect /*ABSTRACT SUPERTYPE OF (ONEOF (IfcBlock ,IfcRectangularPyramid ,IfcRightCircularCone ,IfcRightCircularCylinder ,IfcSphere))*/ + { + private int mPosition;// : IfcAxis2Placement3D; + + internal IfcAxis2Placement3D Position { get { return mDatabase.mIfcObjects[mPosition] as IfcAxis2Placement3D; } } + + protected IfcCsgPrimitive3D() : base() { } + protected IfcCsgPrimitive3D(IfcCsgPrimitive3D p) : base(p) { mPosition = p.mPosition; } + + protected static void parseFields(IfcCsgPrimitive3D g, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(g, arrFields, ref ipos); g.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition); } + } + public partial interface IfcCsgSelect : IfcInterface { } // IfcBooleanResult, IfcCsgPrimitive3D + public partial class IfcCsgSolid : IfcSolidModel + { + private int mTreeRootExpression;// : IfcCsgSelect + + internal IfcCsgSelect TreeRootExpression { get { return mDatabase.mIfcObjects[mTreeRootExpression] as IfcCsgSelect; } set { mTreeRootExpression = value.Index; } } + + internal IfcCsgSolid() : base() { } + internal IfcCsgSolid(IfcCsgSolid p) : base(p) { mTreeRootExpression = p.mTreeRootExpression; } + public IfcCsgSolid(IfcCsgSelect csg) + : base(csg.Database) + { + if (mDatabase.mModelView != ModelView.Ifc4NotAssigned && mDatabase.mModelView != ModelView.If2x3NotAssigned && mDatabase.mModelView != ModelView.Ifc4DesignTransfer) + throw new Exception("Invalid Model View for IfcCsgSolid : " + mDatabase.ModelView.ToString()); + TreeRootExpression = csg; + } + internal static IfcCsgSolid Parse(string strDef) { IfcCsgSolid s = new IfcCsgSolid(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcCsgSolid s, List arrFields, ref int ipos) { IfcSolidModel.parseFields(s, arrFields, ref ipos); s.mTreeRootExpression = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mTreeRootExpression); } + } + public partial class IfcCShapeProfileDef : IfcParameterizedProfileDef + { + internal double mDepth, mWidth, mWallThickness, mGirth;// : IfcPositiveLengthMeasure; + internal double mInternalFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + //internal double mCentreOfGravityInX;// : OPTIONAL IfcPositiveLengthMeasure // DELETED IFC4 Superseded by respective attribute of IfcStructuralProfileProperties + internal IfcCShapeProfileDef() : base() { } + internal IfcCShapeProfileDef(IfcCShapeProfileDef c) + : base(c) + { + mDepth = c.mDepth; + mWidth = c.mWidth; + mWallThickness = c.mWallThickness; + mGirth = c.mGirth; + mInternalFilletRadius = c.mInternalFilletRadius; + } + public IfcCShapeProfileDef(DatabaseIfc m, string name, double depth, double width, double wallThickness, double girth) + : base(m) { Name = name; mDepth = depth; mWidth = width; mWallThickness = wallThickness; mGirth = girth; } + + internal static void parseFields(IfcCShapeProfileDef p, List arrFields, ref int ipos, Schema schema) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWallThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mGirth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mInternalFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + ipos++; + } + internal static IfcCShapeProfileDef Parse(string strDef, Schema schema) { IfcCShapeProfileDef p = new IfcCShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mDepth) + "," + ParserSTEP.DoubleToString(mWidth) + "," + ParserSTEP.DoubleToString(mWallThickness) + "," + ParserSTEP.DoubleToString(mGirth) + "," + ParserSTEP.DoubleOptionalToString(mInternalFilletRadius) + (mDatabase.mSchema == Schema.IFC2x3 ? ",$" : ""); } + + } + //ENTITY IfcCurrencyRelationship; + public partial class IfcCurtainWall : IfcBuildingElement + { + internal IfcCurtainWallTypeEnum mPredefinedType = IfcCurtainWallTypeEnum.NOTDEFINED;//: OPTIONAL IfcCurtainWallTypeEnum; + public IfcCurtainWallTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCurtainWall() : base() { } + internal IfcCurtainWall(IfcCurtainWall w) : base(w) { mPredefinedType = w.mPredefinedType; } + public IfcCurtainWall(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcCurtainWall Parse(string strDef, Schema schema) { IfcCurtainWall w = new IfcCurtainWall(); int ipos = 0; parseFields(w, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return w; } + internal static void parseFields(IfcCurtainWall w, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(w, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + w.mPredefinedType = (IfcCurtainWallTypeEnum)Enum.Parse(typeof(IfcCurtainWallTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? base.BuildString() : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public partial class IfcCurtainWallType : IfcBuildingElementType + { + internal IfcCurtainWallTypeEnum mPredefinedType = IfcCurtainWallTypeEnum.NOTDEFINED; + public IfcCurtainWallTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcCurtainWallType() : base() { } + internal IfcCurtainWallType(IfcCurtainWallType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcCurtainWallType(DatabaseIfc m, string name, IfcCurtainWallTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcCurtainWallType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcCurtainWallTypeEnum)Enum.Parse(typeof(IfcCurtainWallTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcCurtainWallType Parse(string strDef) { IfcCurtainWallType t = new IfcCurtainWallType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcCurve : IfcGeometricRepresentationItem, IfcGeometricSetSelect /*ABSTRACT SUPERTYPE OF (ONEOF (IfcBoundedCurve ,IfcConic ,IfcLine ,IfcOffsetCurve2D ,IfcOffsetCurve3D))*/ + { //INVERSE GeomGym + internal IfcEdgeCurve mEdge = null; + + protected IfcCurve() : base() { } + protected IfcCurve(IfcCurve c) : base(c) { } + protected IfcCurve(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcCurve c, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(c, arrFields, ref ipos); } + } + public partial class IfcCurveBoundedPlane : IfcBoundedSurface + { + internal int mBasisSurface;// : IfcPlane; + internal int mOuterBoundary;// : IfcCurve; + internal List mInnerBoundaries = new List();//: SET OF IfcCurve; + + internal IfcPlane BasisSurface { get { return mDatabase.mIfcObjects[mBasisSurface] as IfcPlane; } } + internal IfcCurve OuterBoundary { get { return mDatabase.mIfcObjects[mOuterBoundary] as IfcCurve; } } + internal List InnerBoundaries { get { return mInnerBoundaries.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCurve); } } + + internal IfcCurveBoundedPlane() : base() { } + internal IfcCurveBoundedPlane(IfcCurveBoundedPlane p) : base(p) { mBasisSurface = p.mBasisSurface; mOuterBoundary = p.mOuterBoundary; mInnerBoundaries = new List(p.mInnerBoundaries.ToArray()); } + internal IfcCurveBoundedPlane(DatabaseIfc m, IfcPlane p, IfcCurve outer, List inner) + : base(m) { mBasisSurface = p.mIndex; mOuterBoundary = outer.mIndex; mInnerBoundaries = inner.ConvertAll(x => x.mIndex); } + internal static void parseFields(IfcCurveBoundedPlane p, List arrFields, ref int ipos) + { + IfcBoundedSurface.parseFields(p, arrFields, ref ipos); + p.mBasisSurface = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mOuterBoundary = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mInnerBoundaries = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + internal static IfcCurveBoundedPlane Parse(string strDef) { IfcCurveBoundedPlane p = new IfcCurveBoundedPlane(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + string str = ",("; + if (mInnerBoundaries.Count > 0) + { + str += "#" + mInnerBoundaries[0]; + for (int icounter = 1; icounter < mInnerBoundaries.Count; icounter++) + str += ",#" + mInnerBoundaries[icounter]; + } + return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisSurface) + "," + ParserSTEP.LinkToString(mOuterBoundary) + str + ")"; + } + } + public partial class IfcCurveBoundedSurface : IfcBoundedSurface //IFC4 + { + private int mBasisSurface;// : IfcSurface;; + private List mBoundaries = new List();//: SET [1:?] OF IfcBoundaryCurve; + private bool mImplicitOuter = false;// : BOOLEAN; + + internal IfcSurface BasisSurface { get { return mDatabase.mIfcObjects[mBasisSurface] as IfcSurface; } } + internal List Boundaries { get { return mBoundaries.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcBoundaryCurve); } } + internal bool ImplicitOuter { get { return mImplicitOuter; } } + + internal IfcCurveBoundedSurface() : base() { } + internal IfcCurveBoundedSurface(IfcCurveBoundedSurface p) : base(p) { mBasisSurface = p.mBasisSurface; mBoundaries.AddRange(p.mBoundaries); } + internal IfcCurveBoundedSurface(DatabaseIfc m, IfcSurface s, List bounds) + : base(m) { mBasisSurface = s.mIndex; mBoundaries = bounds.ConvertAll(x => x.mIndex); mImplicitOuter = false; } + + internal static void parseFields(IfcCurveBoundedSurface p, List arrFields, ref int ipos) + { + IfcBoundedSurface.parseFields(p, arrFields, ref ipos); + p.mBasisSurface = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mBoundaries = ParserSTEP.SplitListLinks(arrFields[ipos++]); + p.mImplicitOuter = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcCurveBoundedSurface Parse(string strDef) { IfcCurveBoundedSurface p = new IfcCurveBoundedSurface(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisSurface) + "," + ParserSTEP.ListLinksToString(mBoundaries) + (mImplicitOuter ? ",.T." : ",.F."); } + } + public abstract partial class IfcCurveSegment2D : IfcBoundedCurve + { + private int mStartPoint;// : IfcCartesianPoint; + private double mStartDirection;// : IfcPlaneAngleMeasure; + private double mSegmentLength;// : IfcPositiveLengthMeasure; + + internal IfcCartesianPoint StartPoint { get { return mDatabase.mIfcObjects[mStartPoint] as IfcCartesianPoint; } } + + protected IfcCurveSegment2D() : base() { } + protected IfcCurveSegment2D(IfcCurveSegment2D p) : base(p) { mStartPoint = p.mStartPoint; mStartDirection = p.mStartDirection; mSegmentLength = p.mSegmentLength; } + protected IfcCurveSegment2D(IfcCartesianPoint start, double startDirection, double length) + : base(start.mDatabase) + { + mStartDirection = startDirection; + mSegmentLength = length; + } + + internal static void parseFields(IfcCurveSegment2D c, List arrFields, ref int ipos) + { + IfcBoundedCurve.parseFields(c, arrFields, ref ipos); + c.mStartPoint = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mStartDirection = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mSegmentLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",#" + mStartPoint + "," + ParserSTEP.DoubleToString(mStartDirection) + "," + ParserSTEP.DoubleToString(mSegmentLength); } + } + public partial class IfcCurveStyle : IfcPresentationStyle, IfcPresentationStyleSelect + { + internal int mCurveFont;// : OPTIONAL IfcCurveFontOrScaledCurveFontSelect; + internal string mCurveWidth = "$";// : OPTIONAL IfcSizeSelect; + internal int mCurveColour;// : OPTIONAL IfcColour; + internal bool mModelOrDraughting = true;// : OPTIONAL BOOLEAN; IFC4 CHANGE + + internal IfcColour CurveColour { get { return mDatabase.mIfcObjects[mCurveColour] as IfcColour; } } + + internal IfcCurveStyle() : base() { } + internal IfcCurveStyle(IfcCurveStyle v) : base(v) { mCurveFont = v.mCurveFont; mCurveWidth = v.mCurveWidth; mCurveColour = v.mCurveColour; mModelOrDraughting = v.mModelOrDraughting; } + internal IfcCurveStyle(DatabaseIfc m, string name, IfcCurveFontOrScaledCurveFontSelect font, IfcSizeSelect width, IfcColour col) + : base(m, name) { if (font != null) mCurveFont = font.Index; if (width != null) mCurveWidth = width.ToString(); if (col != null) mCurveColour = col.Index; } + internal static void parseFields(IfcCurveStyle s, List arrFields, ref int ipos, Schema schema) + { + IfcPresentationStyle.parseFields(s, arrFields, ref ipos); + s.mCurveFont = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mCurveWidth = arrFields[ipos++]; + s.mCurveColour = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + s.mModelOrDraughting = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcCurveStyle Parse(string strDef, Schema schema) { IfcCurveStyle s = new IfcCurveStyle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return s; } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mCurveFont) + "," + mCurveWidth + "," + ParserSTEP.LinkToString(mCurveColour)) + (mDatabase.mSchema != Schema.IFC2x3 ? "," + ParserSTEP.BoolToString(mModelOrDraughting) : ""); } + + } + public class IfcCurveStyleFont : IfcPresentationItem, IfcCurveStyleFontSelect + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal List mPatternList = new List();// : LIST [1:?] OF IfcCurveStyleFontPattern; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { if (!string.IsNullOrEmpty(value)) mName = ParserIfc.Encode(value.Replace("'", "")); } } + + internal IfcCurveStyleFont() : base() { } + internal IfcCurveStyleFont(IfcCurveStyleFont v) : base() { mName = v.mName; mPatternList = new List(v.mPatternList.ToArray()); } + internal static void parseFields(IfcCurveStyleFont s, List arrFields, ref int ipos) { s.mName = arrFields[ipos++]; s.mPatternList = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcCurveStyleFont Parse(string strDef) { IfcCurveStyleFont s = new IfcCurveStyleFont(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + string str = base.BuildString() + "," + mName + ",(" + ParserSTEP.LinkToString(mPatternList[0]); + for (int icounter = 0; icounter < mPatternList.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mPatternList[icounter]); + return str + ")"; + } + } + public class IfcCurveStyleFontAndScaling : IfcPresentationItem, IfcCurveFontOrScaledCurveFontSelect + { + internal string mName; // : OPTIONAL IfcLabel; + internal int mCurveFont;// : IfcCurveStyleFontSelect; + internal IfcPositiveRatioMeasure mCurveFontScaling;//: IfcPositiveRatioMeasure; + internal IfcCurveStyleFontAndScaling() : base() { } + internal IfcCurveStyleFontAndScaling(IfcCurveStyleFontAndScaling i) : base() { mName = i.mName; mCurveFont = i.mCurveFont; mCurveFontScaling = i.mCurveFontScaling; } + internal static IfcCurveStyleFontAndScaling Parse(string strDef) { IfcCurveStyleFontAndScaling s = new IfcCurveStyleFontAndScaling(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcCurveStyleFontAndScaling s, List arrFields, ref int ipos) { s.mName = arrFields[ipos++].Replace("'", ""); s.mCurveFont = ParserSTEP.ParseLink(arrFields[ipos++]); s.mCurveFontScaling = new IfcPositiveRatioMeasure(arrFields[ipos++]); } + protected override string BuildString() { return ",'" + mName + "'," + ParserSTEP.LinkToString(mCurveFont) + "," + mCurveFontScaling.ToString(); } + } + public interface IfcCurveFontOrScaledCurveFontSelect : IfcInterface { } //SELECT (IfcCurveStyleFontAndScaling ,IfcCurveStyleFontSelect); + public class IfcCurveStyleFontPattern : IfcPresentationItem + { + internal double mVisibleSegmentLength;// : IfcLengthMeasure; + internal double mInvisibleSegmentLength;//: IfcPositiveLengthMeasure; + internal IfcCurveStyleFontPattern() : base() { } + internal IfcCurveStyleFontPattern(IfcCurveStyleFontPattern i) : base() { mVisibleSegmentLength = i.mVisibleSegmentLength; mInvisibleSegmentLength = i.mInvisibleSegmentLength; } + internal static IfcCurveStyleFontPattern Parse(string strDef) { IfcCurveStyleFontPattern c = new IfcCurveStyleFontPattern(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcCurveStyleFontPattern c, List arrFields, ref int ipos) { c.mVisibleSegmentLength = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mInvisibleSegmentLength = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mVisibleSegmentLength) + "," + ParserSTEP.DoubleToString(mInvisibleSegmentLength); } + } + public interface IfcCurveStyleFontSelect : IfcCurveFontOrScaledCurveFontSelect { } //SELECT (IfcCurveStyleFont ,IfcPreDefinedCurveFont); +} diff --git a/IFC/IFC D.cs b/IFC/IFC D.cs new file mode 100644 index 0000000..607bf03 --- /dev/null +++ b/IFC/IFC D.cs @@ -0,0 +1,1107 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcDamper : IfcFlowController //IFC4 + { + internal IfcDamperTypeEnum mPredefinedType = IfcDamperTypeEnum.NOTDEFINED;// OPTIONAL : IfcDamperTypeEnum; + public IfcDamperTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcDamper() : base() { } + internal IfcDamper(IfcDamper b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcDamper(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcDamper s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcDamperTypeEnum)Enum.Parse(typeof(IfcDamperTypeEnum), str); + } + internal new static IfcDamper Parse(string strDef) { IfcDamper s = new IfcDamper(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDamperTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcDamperType : IfcFlowControllerType + { + internal IfcDamperTypeEnum mPredefinedType = IfcDamperTypeEnum.NOTDEFINED;// : IfcDamperTypeEnum; + public IfcDamperTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDamperType() : base() { } + internal IfcDamperType(IfcDamperType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcDamperType(DatabaseIfc m, string name, IfcDamperTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcDamperType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcDamperTypeEnum)Enum.Parse(typeof(IfcDamperTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcDamperType Parse(string strDef) { IfcDamperType t = new IfcDamperType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcDate + { + internal string mDate = "$"; + internal IfcDate(DateTime datetime) { mDate = convert(datetime); } + public override string ToString() { return mDate; } + internal static string convert(DateTime date) { return "'" + date.Year + (date.Month < 10 ? "-0" : "-") + date.Month + (date.Day < 10 ? "-0" : "-") + date.Day + "'"; } + internal static DateTime convert(string date) { return new DateTime(int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(5, 2)), int.Parse(date.Substring(8, 2))); } + } + public class IfcDateAndTime : BaseClassIfc, IfcDateTimeSelect // DEPRECEATED IFC4 + { + internal int mDateComponent;// : IfcCalendarDate; + internal int mTimeComponent;// : IfcLocalTime; + internal IfcDateAndTime(IfcDateAndTime v) : base() { mDateComponent = v.mDateComponent; mTimeComponent = v.mTimeComponent; } + internal IfcDateAndTime() : base() { } + internal IfcDateAndTime(IfcCalendarDate d, IfcLocalTime t) : base(d.mDatabase) { mDateComponent = d.mIndex; mTimeComponent = t.mIndex; } + internal static void parseFields(IfcDateAndTime d, List arrFields, ref int ipos) { d.mDateComponent = ParserSTEP.ParseLink(arrFields[ipos++]); d.mTimeComponent = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcDateAndTime Parse(string strDef) { IfcDateAndTime d = new IfcDateAndTime(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mDateComponent) + "," + ParserSTEP.LinkToString(mTimeComponent); } + public DateTime DateTime + { + get + { + IfcCalendarDate cd = mDatabase.mIfcObjects[mDateComponent] as IfcCalendarDate; + IfcLocalTime lt = mDatabase.mIfcObjects[mTimeComponent] as IfcLocalTime; + return new DateTime(cd.mYearComponent, cd.mMonthComponent, cd.mDayComponent, lt.mHourComponent, lt.mMinuteComponent, (int)lt.mSecondComponent); + } + } + } + public partial class IfcDateTime + { + internal string mDateTime = "$"; + // internal IfcDateTime(DateTime datetime) { mDateTime = Convert(datetime); } + public override string ToString() { return mDateTime; } + internal static string Convert(DateTime date) { return date.Year + (date.Month < 10 ? "-0" : "-") + date.Month + (date.Day < 10 ? "-0" : "-") + date.Day + (date.Hour < 10 ? "T0" : "T") + date.Hour + (date.Minute < 10 ? ":0" : ":") + date.Minute + (date.Second < 10 ? ":0" : ":") + date.Second; } + internal static DateTime Convert(string value) + { + if (string.IsNullOrEmpty(value) || value == "$") + return DateTime.MinValue; + try + { + int year = int.Parse(value.Substring(0, 4)), month = int.Parse(value.Substring(5, 2)), day = int.Parse(value.Substring(8, 2)); + if (value.Contains("T")) + { + int hour = int.Parse(value.Substring(11, 2)), min = int.Parse(value.Substring(14, 2)); + double seconds = double.Parse(value.Substring(17, value.Length - 17)); + return new DateTime(year, month, day, hour, min, (int)seconds); + } + return new DateTime(year, month, day); + } + catch (Exception) { } + DateTime result = DateTime.MinValue; + return (DateTime.TryParse(value, out result) ? result : DateTime.MinValue); + } + + internal static IfcDateTimeSelect convertDateTimeSelect(DatabaseIfc m, DateTime date) + { + IfcCalendarDate cd = new IfcCalendarDate(m, date.Day, date.Month, date.Year); + if (date.Hour + date.Minute + date.Second < m.Tolerance) + return cd; + return new IfcDateAndTime(cd, new IfcLocalTime(m, date.Hour, date.Minute, date.Second)); + } + } + internal interface IfcDateTimeSelect : IfcInterface { DateTime DateTime { get; } } // IFC4 IfcCalenderDate, IfcDateAndTime, IfcLocalTime removed. Date, IfcDateTime, IfcDescriptiveDate, IfcTime added + //ENTITY IfcDefinedSymbol // DEPRECEATED IFC4 + public interface IfcDefinitionSelect : IfcInterface { IfcRelDeclares HasContext { get; set; } List HasAssociations { get; } DatabaseIfc Model { get; } } // IFC4 SELECT ( IfcObjectDefinition, IfcPropertyDefinition); + public partial class IfcDerivedUnit : BaseClassIfc, IfcUnit + { + private List mElements = new List();// : SET [1:?] OF IfcDerivedUnitElement; + private IfcDerivedUnitEnum mUnitType;// : IfcDerivedUnitEnum; + private string mUserDefinedType = "$";// : OPTIONAL IfcLabel; + + public List Elements { get { return mElements.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcDerivedUnitElement); } } + public IfcDerivedUnitEnum UnitType { get { return mUnitType; } set { mUnitType = value; } } + //internal string UserDefinedType { get { } } + + internal IfcDerivedUnit(IfcDerivedUnit v) : base() { mElements = new List(v.mElements.ToArray()); mUnitType = v.mUnitType; mUserDefinedType = v.mUserDefinedType; } + internal IfcDerivedUnit() : base() { } + internal IfcDerivedUnit(IfcDerivedUnitElement element, IfcDerivedUnitEnum type) : base(element.mDatabase) { mElements.Add(element.mIndex); mUnitType = type; } + internal IfcDerivedUnit(List elements, IfcDerivedUnitEnum type) : base(elements[0].mDatabase) { mElements = elements.ConvertAll(x => x.mIndex); mUnitType = type; } + internal IfcDerivedUnit(IfcDerivedUnitElement due1, IfcDerivedUnitElement due2, IfcDerivedUnitEnum type) : base(due1.mDatabase) { mElements.Add(due1.mIndex); mElements.Add(due2.mIndex); mUnitType = type; } + internal IfcDerivedUnit(IfcDerivedUnitElement due1, IfcDerivedUnitElement due2, IfcDerivedUnitElement due3, IfcDerivedUnitEnum type) : base(due1.mDatabase) { mElements.Add(due1.mIndex); mElements.Add(due2.mIndex); mElements.Add(due3.mIndex); mUnitType = type; } + internal static void parseFields(IfcDerivedUnit u, List arrFields, ref int ipos) { u.mElements = ParserSTEP.SplitListLinks(arrFields[ipos++]); u.mUnitType = (IfcDerivedUnitEnum)Enum.Parse(typeof(IfcDerivedUnitEnum), arrFields[ipos++].Replace(".", "")); u.mUserDefinedType = arrFields[ipos++]; } + internal static IfcDerivedUnit Parse(string strDef) { IfcDerivedUnit u = new IfcDerivedUnit(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mElements[0]); + for (int icounter = 1; icounter < mElements.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mElements[icounter]); + return str + "),." + mUnitType.ToString() + ".," + mUserDefinedType; + } + internal double getSIFactor() + { + List elements = Elements; + double result = 1; + foreach (IfcDerivedUnitElement due in elements) + result *= Math.Pow(due.Unit.getSIFactor(), due.Exponent); + return result; + } + } + public partial class IfcDerivedUnitElement : BaseClassIfc + { + private int mUnit;// : IfcNamedUnit; + private int mExponent;// : INTEGER; + + internal IfcNamedUnit Unit { get { return mDatabase.mIfcObjects[mUnit] as IfcNamedUnit; } } + internal int Exponent { get { return mExponent; } } + + internal IfcDerivedUnitElement(IfcDerivedUnitElement v) : base() { mUnit = v.mUnit; mExponent = v.mExponent; } + internal IfcDerivedUnitElement() : base() { } + public IfcDerivedUnitElement(IfcNamedUnit u, int exponent) : base(u.mDatabase) { mUnit = u.mIndex; mExponent = exponent; } + internal static void parseFields(IfcDerivedUnitElement e, List arrFields, ref int ipos) { e.mUnit = ParserSTEP.ParseLink(arrFields[ipos++]); e.mExponent = ParserSTEP.ParseInt(arrFields[ipos++]); } + internal static IfcDerivedUnitElement Parse(string strDef) { IfcDerivedUnitElement e = new IfcDerivedUnitElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mUnit) + "," + ParserSTEP.IntToString(mExponent); } + } + public partial class IfcDerivedProfileDef : IfcProfileDef + { + private int mContainerProfile;// : IfcProfileDef; + private int mOperator;// : IfcCartesianTransformationOperator2D; + internal string mLabel = "$";// : OPTIONAL IfcLabel; + + internal IfcProfileDef ContainerProfile { get { return mDatabase.mIfcObjects[mContainerProfile] as IfcProfileDef; } } + internal IfcCartesianTransformationOperator2D Operator { get { return mDatabase.mIfcObjects[mOperator] as IfcCartesianTransformationOperator2D; } } + + internal IfcDerivedProfileDef() : base() { } + internal IfcDerivedProfileDef(IfcDerivedProfileDef el) : base(el) { mContainerProfile = el.mContainerProfile; mOperator = el.mOperator; mLabel = el.mLabel; } + + internal static void parseFields(IfcDerivedProfileDef p, List arrFields, ref int ipos) { IfcProfileDef.parseFields(p, arrFields, ref ipos); p.mContainerProfile = ParserSTEP.ParseLink(arrFields[ipos++]); p.mOperator = ParserSTEP.ParseLink(arrFields[ipos++]); p.mLabel = arrFields[ipos++].Replace("'", ""); } + internal new static IfcDerivedProfileDef Parse(string strDef) { int ipos = 0; IfcDerivedProfileDef p = new IfcDerivedProfileDef(); parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mContainerProfile) + "," + ParserSTEP.LinkToString(mOperator) + (mLabel == "$" ? ",$" : ",'" + mLabel + "'"); } + + } + public class IfcDiameterDimension : IfcDimensionCurveDirectedCallout // DEPRECEATED IFC4 + { + internal IfcDiameterDimension() : base() { } + internal IfcDiameterDimension(IfcDiameterDimension el) : base(el) { } + internal new static IfcDiameterDimension Parse(string strDef) { IfcDiameterDimension d = new IfcDiameterDimension(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcDiameterDimension d, List arrFields, ref int ipos) { IfcDimensionCurveDirectedCallout.parseFields(d, arrFields, ref ipos); } + } + public class IfcDimensionalExponents : BaseClassIfc + { + internal int mLengthExponent;// : INTEGER; + internal int mMassExponent;// : INTEGER; + internal int mTimeExponent;// : INTEGER; + internal int mElectricCurrentExponent;// : INTEGER; + internal int mThermodynamicTemperatureExponent;// : INTEGER; + internal int mAmountOfSubstanceExponent;// : INTEGER; + internal int mLuminousIntensityExponent;// : INTEGER; + internal IfcDimensionalExponents() : base() { } + internal IfcDimensionalExponents(IfcDimensionalExponents e) : base() + { + mLengthExponent = e.mLengthExponent; + mMassExponent = e.mMassExponent; + mTimeExponent = e.mTimeExponent; + mElectricCurrentExponent = e.mElectricCurrentExponent; + mThermodynamicTemperatureExponent = e.mThermodynamicTemperatureExponent; + mAmountOfSubstanceExponent = e.mAmountOfSubstanceExponent; + mLuminousIntensityExponent = e.mLuminousIntensityExponent; + } + internal IfcDimensionalExponents(DatabaseIfc m, int len, int mass, int time, int elecCurr, int themrmo, int amountSubs, int luminous) : base(m) + { + mLengthExponent = len; + mMassExponent = mass; + mTimeExponent = time; + mElectricCurrentExponent = elecCurr; + mThermodynamicTemperatureExponent = themrmo; + mAmountOfSubstanceExponent = amountSubs; + mLuminousIntensityExponent = luminous; + } + internal static void parseFields(IfcDimensionalExponents e, List arrFields, ref int ipos) + { + e.mLengthExponent = int.Parse(arrFields[ipos++]); + e.mMassExponent = int.Parse(arrFields[ipos++]); + e.mTimeExponent = int.Parse(arrFields[ipos++]); + e.mElectricCurrentExponent = int.Parse(arrFields[ipos++]); + e.mThermodynamicTemperatureExponent = int.Parse(arrFields[ipos++]); + e.mAmountOfSubstanceExponent = int.Parse(arrFields[ipos++]); + e.mLuminousIntensityExponent = int.Parse(arrFields[ipos++]); + } + internal static IfcDimensionalExponents Parse(string strDef) { IfcDimensionalExponents e = new IfcDimensionalExponents(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + protected override string BuildString() { return base.BuildString() + "," + mLengthExponent + "," + mMassExponent + "," + mTimeExponent + "," + mElectricCurrentExponent + "," + mThermodynamicTemperatureExponent + "," + mAmountOfSubstanceExponent + "," + mLuminousIntensityExponent; } + } + public class IfcDimensionCalloutRelationship : IfcDraughtingCalloutRelationship // DEPRECEATED IFC4 + { + internal IfcDimensionCalloutRelationship() : base() { } + internal IfcDimensionCalloutRelationship(IfcDimensionCalloutRelationship i) : base(i) { } + internal new static IfcDimensionCalloutRelationship Parse(string strDef) { IfcDimensionCalloutRelationship r = new IfcDimensionCalloutRelationship(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcDimensionCalloutRelationship r, List arrFields, ref int ipos) { IfcDraughtingCalloutRelationship.parseFields(r, arrFields, ref ipos); } + } + public class IfcDimensionCurve : IfcAnnotationCurveOccurrence // DEPRECEATED IFC4 + { + internal List mAnnotatedBySymbols = new List();// SET [0:2] OF IfcTerminatorSymbol FOR AnnotatedCurve; + internal IfcDimensionCurve() : base() { } + internal IfcDimensionCurve(IfcDimensionCurve p) : base(p) { mAnnotatedBySymbols = new List(p.mAnnotatedBySymbols.ToArray()); } + internal static void parseFields(IfcDimensionCurve fs, List arrFields, ref int ipos) { IfcAnnotationCurveOccurrence.parseFields(fs, arrFields, ref ipos); fs.mAnnotatedBySymbols = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal new static IfcDimensionCurve Parse(string strDef) { IfcDimensionCurve d = new IfcDimensionCurve(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mAnnotatedBySymbols.Count > 0) + { + str += ParserSTEP.LinkToString(mAnnotatedBySymbols[0]); + for (int icounter = 1; icounter < mAnnotatedBySymbols.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mAnnotatedBySymbols[icounter]); + } + return str + "}"; + } + } + public class IfcDimensionCurveDirectedCallout : IfcDraughtingCallout // DEPRECEATED IFC4 SUPERTYPE OF (ONEOF (IfcAngularDimension ,IfcDiameterDimension ,IfcLinearDimension ,IfcRadiusDimension)) + { + internal IfcDimensionCurveDirectedCallout() : base() { } + internal IfcDimensionCurveDirectedCallout(IfcDimensionCurveDirectedCallout el) : base(el) { } + internal new static IfcDimensionCurveDirectedCallout Parse(string strDef) { IfcDimensionCurveDirectedCallout d = new IfcDimensionCurveDirectedCallout(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcDimensionCurveDirectedCallout d, List arrFields, ref int ipos) { IfcDraughtingCallout.parseFields(d, arrFields, ref ipos); } + } + public class IfcDimensionCurveTerminator : IfcTerminatorSymbol // DEPRECEATED IFC4 + { + internal IfcDimensionExtentUsage mRole;// : IfcDimensionExtentUsage; + internal IfcDimensionCurveTerminator() : base() { } + internal IfcDimensionCurveTerminator(IfcDimensionCurveTerminator i) : base(i) { mRole = i.mRole; } + internal new static IfcDimensionCurveTerminator Parse(string strDef) { IfcDimensionCurveTerminator t = new IfcDimensionCurveTerminator(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcDimensionCurveTerminator t, List arrFields, ref int ipos) { IfcTerminatorSymbol.parseFields(t, arrFields, ref ipos); t.mRole = (IfcDimensionExtentUsage)Enum.Parse(typeof(IfcDimensionExtentUsage), arrFields[ipos++].Replace(".", "")); } + protected override string BuildString() { return base.BuildString() + ",." + mRole.ToString() + "."; } + } + public class IfcDimensionPair : IfcDraughtingCalloutRelationship // DEPRECEATED IFC4 + { + internal IfcDimensionPair() : base() { } + internal IfcDimensionPair(IfcDimensionPair i) : base((IfcDraughtingCalloutRelationship)i) { } + internal new static IfcDimensionPair Parse(string strDef) { IfcDimensionPair d = new IfcDimensionPair(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcDimensionPair d, List arrFields, ref int ipos) { IfcDraughtingCalloutRelationship.parseFields(d, arrFields, ref ipos); } + } + //ENTITY IfcDimensionalExponents; + public partial class IfcDirection : IfcGeometricRepresentationItem + { + private double mCoordinateX = 0, mCoordinateY = 0, mCoordinateZ = 0; + + public double CoordinateX { get { return mCoordinateX; } set { mCoordinateX = value; } } + public double CoordinateY { get { return mCoordinateY; } set { mCoordinateY = value; } } + public double CoordinateZ { get { return double.IsNaN( mCoordinateZ) ? 0 : mCoordinateZ; } set { mCoordinateZ = value; } } + + internal IfcDirection() : base() { } + internal IfcDirection(IfcDirection d) : base(d) { mCoordinateX = d.mCoordinateX; mCoordinateY = d.mCoordinateY; mCoordinateZ = d.mCoordinateZ; } + public IfcDirection(DatabaseIfc m, double x, double y) : base(m) { mCoordinateX = x; mCoordinateY = y; mCoordinateZ = double.NaN; } + public IfcDirection(DatabaseIfc m, double x, double y, double z) : base(m) { mCoordinateX = x; mCoordinateY = y; mCoordinateZ = z; } + + internal static void parseFields(IfcDirection d, List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(d, arrFields, ref ipos); + //int count = arrFields.Count; + string s = arrFields[ipos++]; + List arrCoords = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + if (arrCoords.Count > 0) + { + d.mCoordinateX = ParserSTEP.ParseDouble(arrCoords[0]); + if (arrCoords.Count > 1) + { + d.mCoordinateY = ParserSTEP.ParseDouble(arrCoords[1]); + d.mCoordinateZ = (arrCoords.Count > 2 ? ParserSTEP.ParseDouble(arrCoords[2]) : double.NaN); + } + } + } + internal static IfcDirection Parse(string strDef) { IfcDirection d = new IfcDirection(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + ",(" + ParserSTEP.DoubleToString(Math.Round(mCoordinateX, 8)) + "," + + ParserSTEP.DoubleToString(Math.Round(mCoordinateY, 8)) + (double.IsNaN(mCoordinateZ) ? "" : "," + ParserSTEP.DoubleToString(Math.Round(mCoordinateZ, 8))) + ")"; + } + } + public partial class IfcDiscreteAccessory : IfcElementComponent + { + internal IfcDiscreteAccessoryTypeEnum mPredefinedType = IfcDiscreteAccessoryTypeEnum.NOTDEFINED;// : OPTIONAL IfcDiscreteAccessoryTypeEnum; + public IfcDiscreteAccessoryTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDiscreteAccessory() : base() { } + internal IfcDiscreteAccessory(IfcDiscreteAccessory a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcDiscreteAccessory(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcDiscreteAccessory Parse(string strDef, Schema schema) { int ipos = 0; IfcDiscreteAccessory a = new IfcDiscreteAccessory(); parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return a; } + internal static void parseFields(IfcDiscreteAccessory a, List arrFields, ref int ipos, Schema schema) + { + IfcElementComponent.parseFields(a, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcDiscreteAccessoryTypeEnum)Enum.Parse(typeof(IfcDiscreteAccessoryTypeEnum), s.Replace(".", "")); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDiscreteAccessoryTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); } + } + public partial class IfcDiscreteAccessoryType : IfcElementComponentType + { + internal IfcDiscreteAccessoryTypeEnum mPredefinedType = IfcDiscreteAccessoryTypeEnum.NOTDEFINED;//: OPTIONAL IfcDiscreteAccessoryTypeEnum; IFC4 + public IfcDiscreteAccessoryTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDiscreteAccessoryType() : base() { } + internal IfcDiscreteAccessoryType(IfcDiscreteAccessoryType t) : base(t) { } + internal IfcDiscreteAccessoryType(DatabaseIfc m, string name, IfcDiscreteAccessoryTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static IfcDiscreteAccessoryType Parse(string strDef, Schema schema) { IfcDiscreteAccessoryType t = new IfcDiscreteAccessoryType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return t; } + internal static void parseFields(IfcDiscreteAccessoryType t, List arrFields, ref int ipos, Schema schema) + { + IfcElementComponentType.parseFields(t, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + t.mPredefinedType = (IfcDiscreteAccessoryTypeEnum)Enum.Parse(typeof(IfcDiscreteAccessoryTypeEnum), str.Replace(".", "")); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDiscreteAccessoryTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); } + } + public class IfcDistributionChamberElement : IfcDistributionFlowElement + { + internal IfcDistributionChamberElementTypeEnum mPredefinedType = IfcDistributionChamberElementTypeEnum.NOTDEFINED;// : OPTIONAL IfcDistributionChamberElementTypeEnum; + public IfcDistributionChamberElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcDistributionChamberElement() : base() { } + internal IfcDistributionChamberElement(IfcDistributionChamberElement e) : base(e) { } + internal IfcDistributionChamberElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcDistributionChamberElement e, List arrFields, ref int ipos, Schema schema) + { + IfcDistributionFlowElement.parseFields(e, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + e.mPredefinedType = (IfcDistributionChamberElementTypeEnum)Enum.Parse(typeof(IfcDistributionChamberElementTypeEnum), str); + } + } + internal static IfcDistributionChamberElement Parse(string strDef, Schema schema) { IfcDistributionChamberElement e = new IfcDistributionChamberElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return e; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDistributionChamberElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); + } + } + public class IfcDistributionChamberElementType : IfcDistributionFlowElementType + { + internal IfcDistributionChamberElementTypeEnum mPredefinedType; + public IfcDistributionChamberElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDistributionChamberElementType() : base() { } + internal IfcDistributionChamberElementType(IfcDistributionChamberElementType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal static void parseFields(IfcDistributionChamberElementType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcDistributionChamberElementTypeEnum)Enum.Parse(typeof(IfcDistributionChamberElementTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcDistributionChamberElementType Parse(string strDef) { IfcDistributionChamberElementType t = new IfcDistributionChamberElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcDistributionCircuit : IfcDistributionSystem + { + internal IfcDistributionCircuit() : base() { } + internal IfcDistributionCircuit(IfcDistributionCircuit i) : base(i) { } + internal IfcDistributionCircuit(IfcSpatialElement bldg, string name,IfcDistributionSystemEnum type) : base(bldg, name, type) { } + internal new static IfcDistributionCircuit Parse(string strDef) { IfcDistributionCircuit m = new IfcDistributionCircuit(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcDistributionCircuit c, List arrFields, ref int ipos) { IfcDistributionSystem.parseFields(c, arrFields, ref ipos); } + } + public class IfcDistributionControlElement : IfcDistributionElement // SUPERTYPE OF(ONEOF(IfcActuator, IfcAlarm, IfcController, + { // IfcFlowInstrument, IfcProtectiveDeviceTrippingUnit, IfcSensor, IfcUnitaryControlElement)) //"IFCDISTRIBUTIONCONTROLELEMENT" + public override string KeyWord { get { return mDatabase.mSchema == Schema.IFC2x3 ? "IFCDISTRIBUTIONCONTROLELEMENT" : base.KeyWord; } } + + internal new enum SubTypes { IfcActuator, IfcAlarm, IfcController, IfcFlowInstrument, IfcProtectiveDeviceTrippingUnit, IfcSensor, IfcUnitaryControlElement } + internal string mControlElementId = "$";// : OPTIONAL IfcIdentifier; + internal string ControlElementId { get { return (mControlElementId == "$" ? "" : ParserIfc.Decode(mControlElementId)); } set { mControlElementId = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcDistributionControlElement() : base() { } + internal IfcDistributionControlElement(IfcDistributionControlElement e) : base(e) { } + internal IfcDistributionControlElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcDistributionSystem system) : base(host,p,r, system) { } + internal static void parseFields(IfcDistributionControlElement e, List arrFields, ref int ipos) { IfcDistributionElement.parseFields(e, arrFields, ref ipos); e.mControlElementId = arrFields[ipos++]; } + internal new static IfcDistributionControlElement Parse(string strDef) { IfcDistributionControlElement e = new IfcDistributionControlElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + protected override string BuildString() { return base.BuildString() + "," + mControlElementId; } + } + public abstract class IfcDistributionControlElementType : IfcDistributionElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcActuatorType ,IfcAlarmType ,IfcControllerType ,IfcFlowInstrumentType ,IfcSensorType)) + { + protected IfcDistributionControlElementType() : base() { } + protected IfcDistributionControlElementType(IfcDistributionControlElementType t) : base(t) { } + protected IfcDistributionControlElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcDistributionControlElementType t, List arrFields, ref int ipos) { IfcDistributionElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcDistributionElement : IfcElement //SUPERTYPE OF (ONEOF (IfcDistributionControlElement ,IfcDistributionFlowElement)) + { + internal new enum SubTypes { IfcDistributionControlElement, IfcDistributionFlowElement } + + internal IfcDistributionElement() : base() { } + protected IfcDistributionElement(IfcDistributionElement be) : base(be) { } + internal IfcDistributionElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + internal IfcDistributionElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcDistributionSystem system) : this(host,p,r) { if (system != null) system.assign(this); } + + internal static void parseFields(IfcDiscreteAccessoryType e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + internal static IfcDistributionElement Parse(string strDef) { IfcDistributionElement e = new IfcDistributionElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal IfcDistributionSystem getSystem() + { + foreach (IfcRelAssigns ra in mHasAssignments) + { + IfcRelAssignsToGroup rag = ra as IfcRelAssignsToGroup; + if (rag != null) + { + IfcDistributionSystem ds = rag.RelatingGroup as IfcDistributionSystem; + if (ds != null) + return ds; + } + } + return null; + } + } + public partial class IfcDistributionElementType : IfcElementType //SUPERTYPE OF(ONEOF(IfcDistributionControlElementType, IfcDistributionFlowElementType)) + { + internal IfcDistributionElementType() : base() { } + protected IfcDistributionElementType(IfcDistributionElementType t) : base(t) { } + protected IfcDistributionElementType(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcDistributionElementType t, List arrFields, ref int ipos) { IfcElementType.parseFields(t, arrFields, ref ipos); } + internal new static IfcDistributionElementType Parse(string strDef) { IfcDistributionElementType t = new IfcDistributionElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public partial class IfcDistributionFlowElement : IfcDistributionElement //SUPERTYPE OF (ONEOF (IfcDistributionChamberElement ,IfcEnergyConversionDevice , + { //IfcFlowController ,IfcFlowFitting ,IfcFlowMovingDevice,IfcFlowSegment ,IfcFlowStorageDevice ,IfcFlowTerminal ,IfcFlowTreatmentDevice)) + internal new enum SubTypes { IfcDistributionChamberElement, IfcEnergyConversionDevice, IfcFlowController, IfcFlowFitting, IfcFlowMovingDevice, IfcFlowSegment, IfcFlowStorageDevice, IfcFlowTerminal, IfcFlowTreatmentDevice } + + public override string KeyWord { get { return mDatabase.mSchema == Schema.IFC2x3 ? "IFCDISTRIBUTIONFLOWELEMENT" : base.KeyWord; } } + + //INVERSE HasControlElements : SET [0:1] OF IfcRelFlowControlElements FOR RelatingFlowElement; + //GG + internal IfcDistributionPort mSourcePort, mSinkPort; + + internal IfcDistributionFlowElement() : base() { } + internal IfcDistributionFlowElement(IfcDistributionFlowElement e) : base(e) { } + internal IfcDistributionFlowElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcDistributionFlowElement e, List arrFields, ref int ipos) { IfcDistributionElement.parseFields(e, arrFields, ref ipos); } + internal new static IfcDistributionFlowElement Parse(string strDef) { IfcDistributionFlowElement e = new IfcDistributionFlowElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + } + public abstract class IfcDistributionFlowElementType : IfcDistributionElementType //IfcDistributionChamberElementType, IfcEnergyConversionDeviceType, IfcFlowControllerType, + { // IfcFlowFittingType, IfcFlowMovingDeviceType, IfcFlowSegmentType, IfcFlowStorageDeviceType, IfcFlowTerminalType, IfcFlowTreatmentDeviceType)) + protected IfcDistributionFlowElementType() : base() { } + protected IfcDistributionFlowElementType(IfcDistributionFlowElementType t) : base(t) { } + protected IfcDistributionFlowElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcDistributionFlowElementType t, List arrFields, ref int ipos) { IfcDistributionElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcDistributionPort : IfcPort + { + internal IfcFlowDirectionEnum mFlowDirection = IfcFlowDirectionEnum.NOTDEFINED; //: OPTIONAL IfcFlowDirectionEnum; + internal IfcDistributionPortTypeEnum mPredefinedType = IfcDistributionPortTypeEnum.NOTDEFINED; // IFC4 : OPTIONAL IfcDistributionPortTypeEnum; + internal IfcDistributionSystemEnum mSystemType = IfcDistributionSystemEnum.NOTDEFINED;// IFC4 : OPTIONAL IfcDistributionSystemEnum; + + public IfcFlowDirectionEnum FlowDirection { get { return mFlowDirection; } set { mFlowDirection = value; } } + public IfcDistributionPortTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public IfcDistributionSystemEnum SystemType { get { return mSystemType; } set { mSystemType = value; } } + + internal IfcDistributionPort() : base() { } + internal IfcDistributionPort(IfcDistributionPort p) : base(p) { mFlowDirection = p.mFlowDirection; mPredefinedType = p.mPredefinedType; mSystemType = p.mSystemType; } + public IfcDistributionPort(IfcElement host) : base(host) { } + public IfcDistributionPort(IfcElementType host) : base(host) { } + public IfcDistributionPort(DatabaseIfc db) : base(db) { } + internal static void parseFields(IfcDistributionPort p, List arrFields, ref int ipos, Schema schema) + { + IfcPort.parseFields(p, arrFields, ref ipos); + p.mFlowDirection = (IfcFlowDirectionEnum)Enum.Parse(typeof(IfcFlowDirectionEnum), arrFields[ipos++].Replace(".", "")); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + p.mPredefinedType = (IfcDistributionPortTypeEnum)Enum.Parse(typeof(IfcDistributionPortTypeEnum), s.Replace(".", "")); + s = arrFields[ipos++]; + if (s.StartsWith(".")) + p.mSystemType = (IfcDistributionSystemEnum)Enum.Parse(typeof(IfcDistributionSystemEnum), s.Replace(".", "")); + } + } + internal static IfcDistributionPort Parse(string strDef, Schema schema) { IfcDistributionPort p = new IfcDistributionPort(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return p; } + protected override string BuildString() { return base.BuildString() + ",." + mFlowDirection.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "." : ".,." + mPredefinedType + ".,." + mSystemType + "."); } + + public class Pset_DistributionPortTypeDuct : IfcPropertySet + { + + public PEnum_DuctConnectionType ConnectionType { set { mHasProperties.Add(new IfcPropertySingleValue(mDatabase, "ConnectionType", new IfcLabel(value.ToString())).mIndex); } } + public double NominalWidth { set { mHasProperties.Add(new IfcPropertySingleValue(mDatabase, "NominalWidth", new IfcPositiveLengthMeasure(value)).mIndex); } } + public double NominalHeight { set { mHasProperties.Add(new IfcPropertySingleValue(mDatabase, "NominalHeight", new IfcPositiveLengthMeasure(value)).mIndex); } } + //if (!string.IsNullOrEmpty(connectionSubType)) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mConnectionSubTypeLabel, "", new IfcLabel(connectionSubType))); + //if (nominalWidth > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mNominalWidthLabel, "", new IfcPositiveLengthMeasure(nominalWidth))); + //if (nominalHeight > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mNominalHeightLabel, "", new IfcPositiveLengthMeasure(nominalHeight))); + //if (Math.Abs(dryBulbTemperature) > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mDryBulbTemperatureLabel, "", new IfcThermodynamicTemperatureMeasure(dryBulbTemperature))); + //if (Math.Abs(wetBulbTemperature) > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mWetBulbTemperatureLabel, "", new IfcThermodynamicTemperatureMeasure(wetBulbTemperature))); + //if (volumetricFlowRate > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mVolumetricFlowRateLabel, "", new IfcVolumetricFlowRateMeasure(volumetricFlowRate))); + //if (velocity > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mVelocityLabel, "", new IfcLinearVelocityMeasure(velocity))); + //if (pressure > tol) + // props.Add(new IfcPropertySingleValue(mDatabase, Pset_DistributionPortTypeDuct.mPressureLabel, "", new IfcPressureMeasure(pressure))); + + + public Pset_DistributionPortTypeDuct(DatabaseIfc db) : base(db, "Pset_DistributionPortTypeDuct") { } + + } + } + public partial class IfcDistributionSystem : IfcSystem //SUPERTYPE OF(IfcDistributionCircuit) IFC4 + { + internal string mLongName = "$"; // OPTIONAL IfcLabel + internal IfcDistributionSystemEnum mPredefinedType = IfcDistributionSystemEnum.NOTDEFINED;// : OPTIONAL IfcDistributionSystemEnum + + public string LongName { get { return (mLongName == "$" ? "" : ParserIfc.Decode(mLongName)); } set { mLongName = (string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcDistributionSystemEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcDistributionSystem() : base() { } + internal IfcDistributionSystem(IfcDistributionSystem i) : base(i) { mLongName = i.mLongName; mPredefinedType = i.mPredefinedType; } + internal IfcDistributionSystem(IfcSpatialElement bldg, string name, IfcDistributionSystemEnum type) : base(bldg, name) { mPredefinedType = type; } + internal new static IfcDistributionSystem Parse(string strDef) { IfcDistributionSystem m = new IfcDistributionSystem(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcDistributionSystem c, List arrFields, ref int ipos) + { + IfcSystem.parseFields(c, arrFields, ref ipos); + c.mLongName = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + c.mPredefinedType = (IfcDistributionSystemEnum)Enum.Parse(typeof(IfcDistributionSystemEnum), s.Replace(".", "")); + } + protected override string BuildString() { return mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mLongName == "$" ? ",$,." : ",'" + mLongName + "',.") + mPredefinedType.ToString() + "."); } + } + public class IfcDocumentElectronicFormat : BaseClassIfc // DEPRECEATED IFC4 + { + internal string mFileExtension = "$";// OPTIONAL IfcLabel; + internal string mMimeContentType = "$";// OPTIONAL IfcLabel; + internal string mMimeSubtype = "$";// OPTIONAL IfcLabel; + internal IfcDocumentElectronicFormat() : base() { } + internal IfcDocumentElectronicFormat(IfcDocumentElectronicFormat i) : base() { mFileExtension = i.mFileExtension; mMimeContentType = i.mMimeContentType; mMimeSubtype = i.mMimeSubtype; } + + internal static IfcDocumentElectronicFormat Parse(string strDef) { IfcDocumentElectronicFormat d = new IfcDocumentElectronicFormat(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcDocumentElectronicFormat d, List arrFields, ref int ipos) { d.mFileExtension = arrFields[ipos++]; d.mMimeContentType = arrFields[ipos++]; d.mMimeSubtype = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mFileExtension + "," + mMimeContentType + "," + mMimeSubtype; } + } + public partial class IfcDocumentInformation : IfcExternalInformation, IfcDocumentSelect + { + internal string mIdentification = "";// : IfcIdentifier; + internal string mName;// : IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal List mDocumentReferences = new List(); // ifc2x3 : OPTIONAL SET [1:?] OF IfcDocumentReference; + internal string mLocation = "$";// : IFC4 OPTIONAL IfcURIReference; + internal string mPurpose = "$", mIntendedUse = "$", mScope = "$";// : OPTIONAL IfcText; + internal string mRevision = "$";// : OPTIONAL IfcLabel; + internal int mDocumentOwner;// : OPTIONAL IfcActorSelect; + internal List mEditors = new List();// : OPTIONAL SET [1:?] OF IfcActorSelect; + internal string mCreationTime = "$", mLastRevisionTime = "$";// : OPTIONAL IFC4 IfcDateTime; + internal string mElectronicFormat = "$";// IFC4 : OPTIONAL IfcIdentifier; IFC4 + internal int mSSElectronicFormat;// IFC2x3 : OPTIONAL IfcDocumentElectronicFormat; + internal string mValidFrom = "$", mValidUntil = "$";// : OPTIONAL IfcCalendarDate; + internal IfcDocumentConfidentialityEnum mConfidentiality = IfcDocumentConfidentialityEnum.NOTDEFINED;// : OPTIONAL IfcDocumentConfidentialityEnum; + internal IfcDocumentStatusEnum mStatus = IfcDocumentStatusEnum.NOTDEFINED;// : OPTIONAL IfcDocumentStatusEnum; + //INVERSE + internal List mDocumentInfoForObjects = new List();// : SET OF IfcRelAssociatesDocument FOR RelatingDocument; + public List Associates { get { return mDocumentInfoForObjects; } set { mDocumentInfoForObjects = value; } } + //HasDocumentReferences : SET OF IfcDocumentReference FOR ReferencedDocument; + //IsPointedTo : SET OF IfcDocumentInformationRelationship FOR RelatedDocuments; + //IsPointer : SET [0:1] OF IfcDocumentInformationRelationship FOR RelatingDocument; + + internal IfcDocumentInformation() : base() { } + internal IfcDocumentInformation(IfcDocumentInformation i) + : base(i) + { + mIdentification = i.mIdentification; + mName = i.mName; + mDescription = i.mDescription; + mDocumentReferences = new List(i.mDocumentReferences.ToArray()); + mPurpose = i.mPurpose; + mIntendedUse = i.mIntendedUse; + mScope = i.mScope; + mRevision = i.mRevision; + mDocumentOwner = i.mDocumentOwner; + mEditors = new List(i.mEditors.ToArray()); + mCreationTime = i.mCreationTime; + mLastRevisionTime = i.mLastRevisionTime; + mElectronicFormat = i.mElectronicFormat; + mSSElectronicFormat = i.mSSElectronicFormat; + mValidFrom = i.mValidFrom; + mValidUntil = i.mValidUntil; + mConfidentiality = i.mConfidentiality; + mStatus = i.mStatus; + } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3) + { + return "";//to be implemented + } + string str = base.BuildString() + "," + mIdentification + "," + mName + "," + mDescription; + if (mDocumentReferences.Count == 0) + str += ",$,"; + else + { + str += ",(" + ParserSTEP.LinkToString(mDocumentReferences[0]); + for (int icounter = 1; icounter < mDocumentReferences.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mDocumentReferences[0]); + str += "),"; + } + str += mPurpose + "," + mIntendedUse + "," + mScope + "," + mRevision + "," + ParserSTEP.LinkToString(mDocumentOwner); + if (mEditors.Count == 0) + str += ",$,"; + else + { + str += ",(" + ParserSTEP.LinkToString(mEditors[0]); + for (int icounter = 1; icounter < mEditors.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mEditors[0]); + str += "),"; + } + return str + mCreationTime + "," + mLastRevisionTime + "," + (mDatabase.mSchema == Schema.IFC2x3 ? ParserSTEP.LinkToString(mSSElectronicFormat) : (mElectronicFormat == "$" ? "$" : "'" + mElectronicFormat + "'")) + "," + + mValidFrom + "," + mValidUntil + (mConfidentiality == IfcDocumentConfidentialityEnum.NOTDEFINED ? ",$," : ",." + mConfidentiality.ToString() + ".,") + (mStatus == IfcDocumentStatusEnum.NOTDEFINED ? "$" : "." + mStatus.ToString() + "."); + } + internal static IfcDocumentInformation Parse(string strDef, Schema schema) { IfcDocumentInformation d = new IfcDocumentInformation(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return d; } + internal static void parseFields(IfcDocumentInformation d, List arrFields, ref int ipos, Schema schema) + { + IfcExternalInformation.parseFields(d, arrFields, ref ipos); + d.mIdentification = arrFields[ipos++].Replace("'", ""); + d.mName = arrFields[ipos++].Replace("'", ""); + d.mDescription = arrFields[ipos++].Replace("'", ""); + if (schema == Schema.IFC2x3) + d.mDocumentReferences = ParserSTEP.SplitListLinks(arrFields[ipos++]); + else + d.mLocation = arrFields[ipos++].Replace("'", ""); + d.mPurpose = arrFields[ipos++].Replace("'", ""); + d.mIntendedUse = arrFields[ipos++].Replace("'", ""); + d.mScope = arrFields[ipos++].Replace("'", ""); + d.mRevision = arrFields[ipos++].Replace("'", ""); + d.mDocumentOwner = ParserSTEP.ParseLink(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s[0] != '$') + d.mEditors = ParserSTEP.SplitListLinks(s); + + d.mCreationTime = arrFields[ipos++]; + d.mLastRevisionTime = arrFields[ipos++]; + if (schema == Schema.IFC2x3) + d.mSSElectronicFormat = ParserSTEP.ParseLink(arrFields[ipos++]); + else + d.mElectronicFormat = arrFields[ipos++].Replace("'", ""); + d.mValidFrom = arrFields[ipos++]; + d.mValidUntil = arrFields[ipos++]; + s = arrFields[ipos++]; + if (s[0] == '.') + d.mConfidentiality = (IfcDocumentConfidentialityEnum)Enum.Parse(typeof(IfcDocumentConfidentialityEnum), s.Substring(1, s.Length - 2)); + s = arrFields[ipos++]; + if (s[0] == '.') + d.mStatus = (IfcDocumentStatusEnum)Enum.Parse(typeof(IfcDocumentStatusEnum), s.Substring(1, s.Length - 2)); + } + } + public class IfcDocumentInformationRelationship : BaseClassIfc + { + internal int mRelatingDocument; //: IfcDocumentInformation + internal List mRelatedDocuments = new List();// : SET [1:?] OF IfcDocumentInformation; + internal string mRelationshipType = "$";// : OPTIONAL IfcLabel; + internal IfcDocumentInformationRelationship() : base() { } + internal IfcDocumentInformationRelationship(IfcDocumentInformationRelationship v) : base() { mRelatingDocument = v.mRelatingDocument; mRelatedDocuments = new List(v.mRelatedDocuments.ToArray()); mRelationshipType = v.mRelationshipType; } + internal static void parseFields(IfcDocumentInformationRelationship r, List arrFields, ref int ipos) { r.mRelatingDocument = ParserSTEP.ParseLink(arrFields[ipos++]); r.mRelatedDocuments = ParserSTEP.SplitListLinks(arrFields[ipos++]); r.mRelationshipType = arrFields[ipos++]; } + internal static IfcDocumentInformationRelationship Parse(string strDef) { IfcDocumentInformationRelationship r = new IfcDocumentInformationRelationship(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingDocument) + ",(" + ParserSTEP.LinkToString(mRelatedDocuments[0]); + for (int icounter = 0; icounter < mRelatedDocuments.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedDocuments[icounter]); + return str + ")," + mRelationshipType; + } + } + public partial class IfcDocumentReference : IfcExternalReference, IfcDocumentSelect + { + internal string mDescription = "$";// IFC4 : OPTIONAL IfcText; + internal int mReferencedDocument = 0;// IFC : OPTIONAL IfcDocumentInformation; + //INVERSE + internal List mDocumentRefForObjects = new List();// : SET OF IfcRelAssociatesDocument FOR RelatingDocument; + + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcDocumentInformation ReferencedDocumen { get { return mDatabase.mIfcObjects[mReferencedDocument] as IfcDocumentInformation; } set { mReferencedDocument = (value == null ? 0 : value.mIndex); } } + public List Associates { get { return mDocumentRefForObjects; } set { mDocumentRefForObjects = value; } } + + internal IfcDocumentReference() : base() { } + internal IfcDocumentReference(IfcDocumentReference i) : base(i) { } + public IfcDocumentReference(DatabaseIfc db) : base(db) { } + internal static IfcDocumentReference Parse(string strDef, Schema schema) { IfcDocumentReference r = new IfcDocumentReference(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return r; } + internal static void parseFields(IfcDocumentReference r, List arrFields, ref int ipos, Schema schema) + { + IfcExternalReference.parseFields(r, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + r.mDescription = arrFields[ipos++].Replace("'", ""); + r.mReferencedDocument = ParserSTEP.ParseLink(arrFields[ipos++]); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mDescription == "$" ? ",$," : ",'" + mDescription + "',") + ParserSTEP.LinkToString(mReferencedDocument)); } + } + public interface IfcDocumentSelect : IfcInterface //IFC4 SELECT ( IfcDocumentReference, IfcDocumentInformation); + { + List Associates { get; set; } + } + public partial class IfcDoor : IfcBuildingElement + { + internal double mOverallHeight;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mOverallWidth;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcDoorTypeEnum mPredefinedType = IfcDoorTypeEnum.NOTDEFINED;//: OPTIONAL IfcDoorTypeEnum; //IFC4 + internal IfcDoorTypeOperationEnum mOperationType = IfcDoorTypeOperationEnum.NOTDEFINED;// : OPTIONAL IfcDoorTypeOperationEnum; //IFC4 + internal string mUserDefinedOperationType = "$";// : OPTIONAL IfcLabel; + + public IfcDoorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcDoor() : base() { } + internal IfcDoor(IfcDoor d) : base(d) { mOverallHeight = d.mOverallHeight; mOverallWidth = d.mOverallWidth; mPredefinedType = d.mPredefinedType; mOperationType = d.mOperationType; mUserDefinedOperationType = d.mUserDefinedOperationType; } + public IfcDoor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static IfcDoor Parse(string strDef, Schema schema) { IfcDoor d = new IfcDoor(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return d; } + internal static void parseFields(IfcDoor d, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(d, arrFields, ref ipos); + d.mOverallHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + d.mOverallWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + d.mPredefinedType = (IfcDoorTypeEnum)Enum.Parse(typeof(IfcDoorTypeEnum), str.Substring(1, str.Length - 2)); + str = arrFields[ipos++]; + if (str[0] == '.') + d.mOperationType = (IfcDoorTypeOperationEnum)Enum.Parse(typeof(IfcDoorTypeOperationEnum), str.Substring(1, str.Length - 2)); + try + { + d.mUserDefinedOperationType = arrFields[ipos++].Replace("'", ""); + } + catch (Exception) { } + } + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mOverallHeight) + "," + ParserSTEP.DoubleOptionalToString(mOverallWidth) + + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType.ToString() + ".,." + mOperationType.ToString() + (mUserDefinedOperationType == "$" ? ".,$" : ".,'" + mUserDefinedOperationType + "'")); + } + } + public partial class IfcDoorLiningProperties : IfcPreDefinedPropertySet // IFC2x3 IfcPropertySetDefinition + { + internal double mLiningDepth, mLiningThickness, mThresholdDepth, mThresholdThickness, mTransomThickness;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mTransomOffset, mLiningOffset, mThresholdOffset;// : OPTIONAL IfcLengthMeasure; + internal double mCasingThickness, mCasingDepth;// : OPTIONAL IfcPositiveLengthMeasure; + private int mShapeAspectStyle;// : OPTIONAL IfcShapeAspect; // DEPRECEATED IFC4 + internal double mLiningToPanelOffsetX, mLiningToPanelOffsetY;// : OPTIONAL IfcLengthMeasure; IFC4 + internal IfcDoorLiningProperties() : base() { } + internal IfcDoorLiningProperties(IfcDoorLiningProperties p) + : base(p) + { + mLiningDepth = p.mLiningDepth; + mLiningThickness = p.mLiningThickness; + mThresholdDepth = p.mThresholdDepth; + mThresholdThickness = p.mThresholdThickness; + mTransomThickness = p.mTransomThickness; + mTransomOffset = p.mTransomOffset; + mLiningOffset = p.mLiningOffset; + mThresholdOffset = p.mThresholdOffset; + mCasingThickness = p.mCasingThickness; + mCasingDepth = p.mCasingDepth; + mShapeAspectStyle = p.mShapeAspectStyle; + mLiningToPanelOffsetX = p.mLiningToPanelOffsetX; + mLiningToPanelOffsetY = p.mLiningToPanelOffsetY; + } + internal static IfcDoorLiningProperties Parse(string strDef, Schema schema) { IfcDoorLiningProperties p = new IfcDoorLiningProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcDoorLiningProperties p, List arrFields, ref int ipos,Schema schema) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mLiningDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLiningThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThresholdDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThresholdThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTransomThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTransomOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLiningOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThresholdOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mCasingThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mCasingDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mShapeAspectStyle = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + p.mLiningToPanelOffsetX = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLiningToPanelOffsetY = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mLiningDepth) + "," + ParserSTEP.DoubleOptionalToString(mLiningThickness) + "," + ParserSTEP.DoubleOptionalToString(mThresholdDepth) + "," + ParserSTEP.DoubleOptionalToString(mThresholdThickness) + "," + ParserSTEP.DoubleOptionalToString(mTransomThickness) + "," + ParserSTEP.DoubleOptionalToString(mTransomOffset) + "," + ParserSTEP.DoubleOptionalToString(mLiningOffset) + "," + + ParserSTEP.DoubleOptionalToString(mThresholdOffset) + "," + ParserSTEP.DoubleOptionalToString(mCasingThickness) + "," + ParserSTEP.DoubleOptionalToString(mCasingDepth) + "," + ParserSTEP.LinkToString(mShapeAspectStyle) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : "," + ParserSTEP.DoubleOptionalToString(mLiningToPanelOffsetX) + "," + ParserSTEP.DoubleOptionalToString(mLiningToPanelOffsetY)); + } + } + public partial class IfcDoorPanelProperties : IfcPreDefinedPropertySet //IFC2x3 IfcPropertySetDefinition + { + internal double mPanelDepth;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcDoorPanelOperationEnum mOperationType;// : IfcDoorPanelOperationEnum; + internal double mPanelWidth;// : OPTIONAL IfcNormalisedRatioMeasure; + internal IfcDoorPanelPositionEnum mPanelPosition;// :IfcDoorPanelPositionEnume; + private int mShapeAspectStyle;// : OPTIONAL IfcShapeAspect; // DEPRECEATED IFC4 + internal IfcDoorPanelProperties() : base() { } + internal IfcDoorPanelProperties(IfcDoorPanelProperties p) : base(p) + { + mPanelDepth = p.mPanelDepth; + mOperationType = p.mOperationType; + mPanelWidth = p.mPanelWidth; + mPanelPosition = p.mPanelPosition; + mShapeAspectStyle = p.mShapeAspectStyle; + } + internal static IfcDoorPanelProperties Parse(string strDef) { IfcDoorPanelProperties p = new IfcDoorPanelProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcDoorPanelProperties p, List arrFields, ref int ipos) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mPanelDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mOperationType = (IfcDoorPanelOperationEnum)Enum.Parse(typeof(IfcDoorPanelOperationEnum), arrFields[ipos++].Replace(".", "")); + p.mPanelWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mPanelPosition = (IfcDoorPanelPositionEnum)Enum.Parse(typeof(IfcDoorPanelPositionEnum), arrFields[ipos++].Replace(".", "")); + p.mShapeAspectStyle = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mPanelDepth) + ",." + mOperationType.ToString() + ".," + ParserSTEP.DoubleOptionalToString(mPanelWidth) + ",." + mPanelPosition.ToString() + ".," + ParserSTEP.LinkToString(mShapeAspectStyle); } + } + public partial class IfcDoorStandardCase : IfcDoor + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 || mDatabase.mModelView == ModelView.Ifc4Reference ? "IFCDOOR" : base.KeyWord); } } + internal IfcDoorStandardCase() : base() { } + internal IfcDoorStandardCase(IfcDoorStandardCase o) : base(o) { } + + internal static IfcDoorStandardCase Parse(string strDef) { IfcDoorStandardCase s = new IfcDoorStandardCase(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcDoorStandardCase s, List arrFields, ref int ipos) { IfcDoor.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcDoorStyle : IfcTypeProduct //IFC2x3 + { + internal IfcDoorTypeOperationEnum mOperationType = IfcDoorTypeOperationEnum.NOTDEFINED;// : IfcDoorStyleOperationEnum; + internal IfcDoorStyleConstructionEnum mConstructionType = IfcDoorStyleConstructionEnum.NOTDEFINED;// : IfcDoorStyleConstructionEnum; //IFC2x3 + internal bool mParameterTakesPrecedence = false;// : BOOLEAN; + internal bool mSizeable = false;// : BOOLEAN; //IFC2x3 + internal IfcDoorStyle() : base() { } + internal IfcDoorStyle(IfcDoorStyle s) : base(s) { mOperationType = s.mOperationType; mConstructionType = s.mConstructionType; mParameterTakesPrecedence = s.mParameterTakesPrecedence; mSizeable = s.mSizeable; } + internal new static IfcDoorStyle Parse(string strDef) { IfcDoorStyle s = new IfcDoorStyle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcDoorStyle s, List arrFields, ref int ipos) + { + IfcTypeProduct.parseFields(s, arrFields, ref ipos); + s.mOperationType = (IfcDoorTypeOperationEnum)Enum.Parse(typeof(IfcDoorTypeOperationEnum), arrFields[ipos++].Replace(".", "")); + s.mConstructionType = (IfcDoorStyleConstructionEnum)Enum.Parse(typeof(IfcDoorStyleConstructionEnum), arrFields[ipos++].Replace(".", "")); + s.mParameterTakesPrecedence = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mSizeable = ParserSTEP.ParseBool(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",." + mOperationType.ToString() + ".,." + mConstructionType.ToString() + ".," + ParserSTEP.BoolToString(mParameterTakesPrecedence) + "," + ParserSTEP.BoolToString(mSizeable); } + + } + public partial class IfcDoorType : IfcBuildingElementType //IFC2x3 IfcDoorStyle + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCDOORSTYLE" : base.KeyWord); } } + + internal IfcDoorTypeEnum mPredefinedType = IfcDoorTypeEnum.NOTDEFINED; + internal IfcDoorTypeOperationEnum mOperationType;// : IfcDoorStyleOperationEnum; + internal bool mParameterTakesPrecedence = false;// : BOOLEAN; + internal string mUserDefinedOperationType = "$";// : OPTIONAL IfcLabel; + + public IfcDoorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public string UserDefinedOperationType { get { return (mUserDefinedOperationType == "$" ? "" : ParserIfc.Decode(mUserDefinedOperationType)); } set { mUserDefinedOperationType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcDoorType() : base() { } + internal IfcDoorType(IfcDoorType t) : base(t) { mPredefinedType = t.mPredefinedType; mOperationType = t.mOperationType; mParameterTakesPrecedence = t.mParameterTakesPrecedence; mUserDefinedOperationType = t.mUserDefinedOperationType; } + public IfcDoorType(DatabaseIfc m, string name, IfcDoorTypeEnum type) : this(m, name, type, IfcDoorTypeOperationEnum.NOTDEFINED, false) { } + internal IfcDoorType(DatabaseIfc m, string name, IfcDoorTypeEnum type, IfcDoorTypeOperationEnum operation, IfcDoorLiningProperties lp, List pps) + : base(m) + { + Name = name; + if (lp != null) mHasPropertySets.Add(lp.mIndex); + if (pps != null && pps.Count > 0) mHasPropertySets.AddRange(pps.ConvertAll(x => x.mIndex)); + mPredefinedType = type; + mOperationType = operation; + mParameterTakesPrecedence = true; + + } + internal IfcDoorType(DatabaseIfc m, string name, IfcDoorTypeEnum type, IfcDoorTypeOperationEnum operation, bool parameterTakesPrecendence) + : base(m) + { + Name = name; + mPredefinedType = type; + mOperationType = operation; + mParameterTakesPrecedence = parameterTakesPrecendence; + } + + internal static IfcDoorType Parse(string strDef, Schema schema) { IfcDoorType s = new IfcDoorType(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return s; } + internal static void parseFields(IfcDoorType s, List arrFields, ref int ipos, Schema schema) + { + if (schema == Schema.IFC2x3) + IfcTypeProduct.parseFields(s, arrFields, ref ipos); + else + { + IfcElementType.parseFields(s, arrFields, ref ipos); + s.mPredefinedType = (IfcDoorTypeEnum)Enum.Parse(typeof(IfcDoorTypeEnum), arrFields[ipos++].Replace(".", "")); + } + s.mOperationType = (IfcDoorTypeOperationEnum)Enum.Parse(typeof(IfcDoorTypeOperationEnum), arrFields[ipos++].Replace(".", "")); + s.mParameterTakesPrecedence = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mUserDefinedOperationType = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? ",." : ",." + mPredefinedType.ToString() + ".,.") + mOperationType.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? ".,.NOTDEFINED" : "") + ".," + ParserSTEP.BoolToString(mParameterTakesPrecedence) + (mDatabase.mSchema == Schema.IFC2x3 ? "," + ParserSTEP.BoolToString(false) : (mUserDefinedOperationType == "$" ? ",$" : ",'" + mUserDefinedOperationType + "'")); } + } + public class IfcDraughtingCallout : IfcGeometricRepresentationItem // DEPRECEATED IFC4 SUPERTYPE OF (ONEOF (IfcDimensionCurveDirectedCallout ,IfcStructuredDimensionCallout)) + { + internal List mContents = new List(); //: SET [1:?] OF IfcDraughtingCalloutElement + internal IfcDraughtingCallout() : base() { } + internal IfcDraughtingCallout(IfcDraughtingCallout el) : base(el) { mContents = new List(el.mContents.ToArray()); } + internal static IfcDraughtingCallout Parse(string strDef) { IfcDraughtingCallout c = new IfcDraughtingCallout(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcDraughtingCallout c, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(c, arrFields, ref ipos); c.mContents = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = ",(" + ParserSTEP.LinkToString(mContents[0]); + for (int icounter = 1; icounter < mContents.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mContents[icounter]); + return str + ")"; + } + } + public interface IfcDraughtingCalloutElement : IfcInterface { } //SELECT (IfcAnnotationCurveOccurrence ,IfcAnnotationTextOccurrence ,IfcAnnotationSymbolOccurrence); + public class IfcDraughtingCalloutRelationship : BaseClassIfc // DEPRECEATED IFC4 + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal int mRelatingDraughtingCallout;// : IfcDraughtingCallout; + internal int mRelatedDraughtingCallout;// : IfcDraughtingCallout; + internal IfcDraughtingCalloutRelationship() : base() { } + internal IfcDraughtingCalloutRelationship(IfcDraughtingCalloutRelationship o) : base() { mName = o.mName; mDescription = o.mDescription; mRelatingDraughtingCallout = o.mRelatingDraughtingCallout; mRelatedDraughtingCallout = o.mRelatedDraughtingCallout; } + internal static void parseFields(IfcDraughtingCalloutRelationship r, List arrFields, ref int ipos) { r.mName = arrFields[ipos++]; r.mDescription = arrFields[ipos++]; r.mRelatingDraughtingCallout = ParserSTEP.ParseLink(arrFields[ipos++]); r.mRelatedDraughtingCallout = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + mName + "," + mDescription + "," + ParserSTEP.LinkToString(mRelatingDraughtingCallout) + "," + ParserSTEP.LinkToString(mRelatedDraughtingCallout); } + internal static IfcDraughtingCalloutRelationship Parse(string strDef) { IfcDraughtingCalloutRelationship r = new IfcDraughtingCalloutRelationship(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + } + public class IfcDraughtingPreDefinedColour : IfcPreDefinedColour + { + internal IfcDraughtingPreDefinedColour() : base() { } + internal IfcDraughtingPreDefinedColour(IfcDraughtingPreDefinedColour i) : base(i) { } + internal static IfcDraughtingPreDefinedColour Parse(string strDef) { IfcDraughtingPreDefinedColour c = new IfcDraughtingPreDefinedColour(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcDraughtingPreDefinedColour c, List arrFields, ref int ipos) { IfcPreDefinedColour.parseFields(c, arrFields, ref ipos); } + } + public class IfcDraughtingPreDefinedCurveFont : IfcPreDefinedCurveFont + { + internal IfcDraughtingPreDefinedCurveFont() : base() { } + internal IfcDraughtingPreDefinedCurveFont(IfcDraughtingPreDefinedCurveFont i) : base(i) { } + internal static IfcDraughtingPreDefinedCurveFont Parse(string strDef) { IfcDraughtingPreDefinedCurveFont f = new IfcDraughtingPreDefinedCurveFont(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcDraughtingPreDefinedCurveFont f, List arrFields, ref int ipos) { IfcPreDefinedCurveFont.parseFields(f, arrFields, ref ipos); } + } + public class IfcDraughtingPreDefinedTextFont : IfcPreDefinedTextFont // DEPRECEATED IFC4 + { + internal IfcDraughtingPreDefinedTextFont() : base() { } + internal IfcDraughtingPreDefinedTextFont(IfcDraughtingPreDefinedTextFont el) : base(el) { } + internal static IfcDraughtingPreDefinedTextFont Parse(string strDef) { IfcDraughtingPreDefinedTextFont f = new IfcDraughtingPreDefinedTextFont(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcDraughtingPreDefinedTextFont f, List arrFields, ref int ipos) { IfcPreDefinedTextFont.parseFields(f, arrFields, ref ipos); } + } + public class IfcDuctFitting : IfcFlowFitting //IFC4 + { + internal IfcDuctFittingTypeEnum mPredefinedType = IfcDuctFittingTypeEnum.NOTDEFINED;// OPTIONAL : IfcDuctFittingTypeEnum; + public IfcDuctFittingTypeEnum Predefined { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDuctFitting() : base() { } + internal IfcDuctFitting(IfcDuctFitting b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcDuctFitting(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcDuctFitting s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcDuctFittingTypeEnum)Enum.Parse(typeof(IfcDuctFittingTypeEnum), str); + } + internal new static IfcDuctFitting Parse(string strDef) { IfcDuctFitting s = new IfcDuctFitting(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDuctFittingTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcDuctFittingType : IfcFlowFittingType + { + internal IfcDuctFittingTypeEnum mPredefinedType = IfcDuctFittingTypeEnum.NOTDEFINED;// : IfcDuctFittingTypeEnum; + public IfcDuctFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDuctFittingType() : base() { } + internal IfcDuctFittingType(IfcDuctFittingType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcDuctFittingType(DatabaseIfc m, string name, IfcDuctFittingTypeEnum t) : base(m) { Name = name; PredefinedType = t; } + internal static void parseFields(IfcDuctFittingType t, List arrFields, ref int ipos) { IfcFlowFittingType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcDuctFittingTypeEnum)Enum.Parse(typeof(IfcDuctFittingTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcDuctFittingType Parse(string strDef) { IfcDuctFittingType t = new IfcDuctFittingType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcDuctSegment : IfcFlowSegment //IFC4 + { + internal IfcDuctSegmentTypeEnum mPredefinedType = IfcDuctSegmentTypeEnum.NOTDEFINED;// OPTIONAL : IfcDuctSegmentTypeEnum; + public IfcDuctSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcDuctSegment() : base() { } + internal IfcDuctSegment(IfcDuctSegment s) : base(s) { mPredefinedType = s.mPredefinedType; } + internal IfcDuctSegment(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcDuctSegment s, List arrFields, ref int ipos) + { + IfcFlowSegment.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcDuctSegmentTypeEnum)Enum.Parse(typeof(IfcDuctSegmentTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcDuctSegment Parse(string strDef) { IfcDuctSegment s = new IfcDuctSegment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDuctSegmentTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + + } + public partial class IfcDuctSegmentType : IfcFlowSegmentType + { + internal IfcDuctSegmentTypeEnum mPredefinedType = IfcDuctSegmentTypeEnum.NOTDEFINED;// : IfcDuctSegmentTypeEnum; + public IfcDuctSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDuctSegmentType() : base() { } + internal IfcDuctSegmentType(IfcDuctSegmentType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcDuctSegmentType(DatabaseIfc m, string name, IfcDuctSegmentTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcDuctSegmentType t, List arrFields, ref int ipos) { IfcFlowSegmentType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcDuctSegmentTypeEnum)Enum.Parse(typeof(IfcDuctSegmentTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcDuctSegmentType Parse(string strDef) { IfcDuctSegmentType t = new IfcDuctSegmentType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + + } + public class IfcDuctSilencer : IfcFlowTreatmentDevice //IFC4 + { + internal IfcDuctSilencerTypeEnum mPredefinedType = IfcDuctSilencerTypeEnum.NOTDEFINED; + public IfcDuctSilencerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcDuctSilencer(IfcDuctSilencer a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcDuctSilencer() : base() { } + internal IfcDuctSilencer(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcDuctSilencer a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcDuctSilencerTypeEnum)Enum.Parse(typeof(IfcDuctSilencerTypeEnum), s.Replace(".", "")); + } + internal new static IfcDuctSilencer Parse(string strDef) { IfcDuctSilencer d = new IfcDuctSilencer(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcDuctSilencerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcDuctSilencerType : IfcFlowTreatmentDeviceType + { + internal IfcDuctSilencerTypeEnum mPredefinedType = IfcDuctSilencerTypeEnum.NOTDEFINED;// : IfcDuctSilencerTypeEnum; + internal IfcDuctSilencerType() : base() { } + internal IfcDuctSilencerType(IfcDuctSilencerType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcDuctSilencerType t, List arrFields, ref int ipos) { IfcFlowTreatmentDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcDuctSilencerTypeEnum)Enum.Parse(typeof(IfcDuctSilencerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcDuctSilencerType Parse(string strDef) { IfcDuctSilencerType t = new IfcDuctSilencerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcDuration : IfcTimeOrRatioSelect + { + internal int mYears, mMonths, mDays, mHours, mMinutes; + internal double mSeconds = 0; + public int Years { get { return mYears; } set { mYears = value; } } + public int Months { get { return mMonths; } set { mMonths = value; } } + public int Days { get { return mDays; } set { mDays = value; } } + public int Hours { get { return mHours; } set { mHours = value; } } + public int Minutes { get { return mMinutes; } set { mMinutes = value; } } + public double Seconds { get { return mSeconds; } set { mSeconds = value; } } + public IfcDuration() { } + public override string ToString() { return "'P" + mYears + "Y" + mMonths + "M" + mDays + "DT" + mHours + "H" + mMinutes + "M" + mSeconds.ToString(ParserSTEP.NumberFormat) + "S'"; } + internal double ToSeconds() { return ((((((mYears * 365) + (mMonths * 30) + mDays) * 24) + mHours) * 60) + mMinutes) * 60 + mSeconds; } + public string String { get { return getKW + "(" + ToString() + ")"; } } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCDURATION"; + } +} diff --git a/IFC/IFC E.cs b/IFC/IFC E.cs new file mode 100644 index 0000000..23f7fa5 --- /dev/null +++ b/IFC/IFC E.cs @@ -0,0 +1,1034 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcEdge : IfcTopologicalRepresentationItem //SUPERTYPE OF(ONEOF(IfcEdgeCurve, IfcOrientedEdge, IfcSubedge)) + { + internal int mEdgeStart, mEdgeEnd;// : IfcVertex; + public IfcVertex EdgeStart { get { return mDatabase.mIfcObjects[ mEdgeStart] as IfcVertex; } set { mEdgeStart = value.mIndex; } } + public IfcVertex EdgeEnd { get { return mDatabase.mIfcObjects[ mEdgeEnd] as IfcVertex; } set { mEdgeEnd = value.mIndex; } } + + internal IfcEdge() : base() { } + protected IfcEdge(DatabaseIfc db) : base(db) { } + internal IfcEdge(IfcEdge el) : base(el) { mEdgeStart = el.mEdgeStart; mEdgeEnd = el.mEdgeEnd; } + internal IfcEdge(IfcVertex start, IfcVertex end) : base(start.mDatabase) { EdgeStart = start; EdgeEnd = end; } + internal static IfcEdge Parse(string strDef) { IfcEdge e = new IfcEdge(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcEdge e, List arrFields, ref int ipos) { IfcTopologicalRepresentationItem.parseFields(e, arrFields, ref ipos); e.mEdgeStart = ParserSTEP.ParseLink(arrFields[ipos++]); e.mEdgeEnd = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() + { + IfcOrientedEdge oe = this as IfcOrientedEdge; + return base.BuildString() + (oe == null ? "," + ParserSTEP.LinkToString(mEdgeStart) + "," + ParserSTEP.LinkToString(mEdgeEnd) : ",*,*"); + } + } + public partial class IfcEdgeCurve : IfcEdge + { + internal int mEdgeGeometry;// IfcCurve; + internal bool mSameSense;// : BOOL; + internal IfcCurve EdgeGeometry { get { return mDatabase.mIfcObjects[mEdgeGeometry] as IfcCurve; } } + internal IfcEdgeCurve() : base() { } + internal IfcEdgeCurve(IfcEdgeCurve el) : base(el) { mEdgeGeometry = el.mEdgeGeometry; mSameSense = el.mSameSense; } + public IfcEdgeCurve(IfcVertexPoint start, IfcVertexPoint end, IfcCurve edge, bool sense) : base(start, end) { mEdgeGeometry = edge.mIndex; mSameSense = sense; } + // internal IfcEdgeCurve(IfcBoundedCurve ec, IfcVertexPoint s, IfcVertexPoint e,bool sense) : base(s, e) { mEdgeGeometry = ec.mIndex; mSameSense = true; } + internal new static IfcEdgeCurve Parse(string strDef) { IfcEdgeCurve ec = new IfcEdgeCurve(); int ipos = 0; parseFields(ec, ParserSTEP.SplitLineFields(strDef), ref ipos); return ec; } + internal static void parseFields(IfcEdgeCurve e, List arrFields, ref int ipos) { IfcEdge.parseFields(e, arrFields, ref ipos); e.mEdgeGeometry = ParserSTEP.ParseLink(arrFields[ipos++]); e.mSameSense = ParserSTEP.ParseBool(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mEdgeGeometry) + "," + ParserSTEP.BoolToString(mSameSense); } + + internal void associate() + { + IfcCurve c = EdgeGeometry; + if (c != null) + c.mEdge = this; + } + } + public class IfcEdgeFeature : IfcFeatureElementSubtraction // DEPRECEATED IFC4 + { + internal double mFeatureLength;// OPTIONAL IfcPositiveLengthMeasure; + protected IfcEdgeFeature() : base() { } + protected IfcEdgeFeature(IfcEdgeFeature el) : base(el) { mFeatureLength = el.mFeatureLength; } + protected static void parseFields(IfcEdgeFeature f, List arrFields, ref int ipos) { IfcFeatureElementSubtraction.parseFields(f, arrFields, ref ipos); f.mFeatureLength = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mFeatureLength); } + } + public partial class IfcEdgeLoop : IfcLoop + { + internal List mEdgeList = new List();// LIST [1:?] OF IfcOrientedEdge; + internal List EdgeList { get { return mEdgeList.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcOrientedEdge); } } + internal IfcEdgeLoop() : base() { } + internal IfcEdgeLoop(IfcEdgeLoop o) : base(o) { mEdgeList = new List(o.mEdgeList.ToArray()); } + public IfcEdgeLoop(IfcOrientedEdge edge) : base(edge.mDatabase) { mEdgeList.Add(edge.mIndex); } + public IfcEdgeLoop(IfcOrientedEdge edge1, IfcOrientedEdge edge2) : base(edge1.mDatabase) { mEdgeList.Add(edge1.mIndex); mEdgeList.Add(edge2.mIndex); } + public IfcEdgeLoop(List edges) : base(edges[0].mDatabase) { mEdgeList = edges.ConvertAll(x => x.mIndex); } + internal IfcEdgeLoop(List vertex) + : base(vertex[0].mDatabase) + { + for (int icounter = 1; icounter < vertex.Count; icounter++) + mEdgeList.Add(new IfcOrientedEdge(vertex[icounter - 1], vertex[icounter]).mIndex); + mEdgeList.Add(new IfcOrientedEdge(vertex[vertex.Count - 1], vertex[0]).mIndex); + } + internal new static IfcEdgeLoop Parse(string strDef) { IfcEdgeLoop l = new IfcEdgeLoop(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcEdgeLoop l, List arrFields, ref int ipos) { IfcLoop.parseFields(l, arrFields, ref ipos); l.mEdgeList = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mEdgeList.Count > 0) + str += ParserSTEP.LinkToString(mEdgeList[0]); + for (int icounter = 1; icounter < mEdgeList.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mEdgeList[icounter]); + return str + ")"; + } + } + public partial class IfcElectricAppliance : IfcFlowTerminal //IFC4 + { + internal IfcElectricApplianceTypeEnum mPredefinedType = IfcElectricApplianceTypeEnum.NOTDEFINED;// OPTIONAL : IfcElectricApplianceTypeEnum; + public IfcElectricApplianceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricAppliance() : base() { } + internal IfcElectricAppliance(IfcElectricAppliance a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcElectricAppliance(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcElectricAppliance s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcElectricApplianceTypeEnum)Enum.Parse(typeof(IfcElectricApplianceTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcElectricAppliance Parse(string strDef) { IfcElectricAppliance s = new IfcElectricAppliance(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcElectricApplianceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcElectricApplianceType : IfcFlowTerminalType + { + internal IfcElectricApplianceTypeEnum mPredefinedType = IfcElectricApplianceTypeEnum.NOTDEFINED;// : IfcDuctFittingTypeEnum; + public IfcElectricApplianceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricApplianceType() : base() { } + internal IfcElectricApplianceType(IfcElectricApplianceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcElectricApplianceType(DatabaseIfc m, string name, IfcElectricApplianceTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcElectricApplianceType t, List arrFields, ref int ipos) { IfcFlowTerminalType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricApplianceTypeEnum)Enum.Parse(typeof(IfcElectricApplianceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricApplianceType Parse(string strDef) { IfcElectricApplianceType t = new IfcElectricApplianceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcElectricDistributionBoard : IfcFlowController //IFC4 + { + internal IfcElectricDistributionBoardTypeEnum mPredefinedType = IfcElectricDistributionBoardTypeEnum.NOTDEFINED;// OPTIONAL : IfcDamperTypeEnum; + public IfcElectricDistributionBoardTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricDistributionBoard() : base() { } + internal IfcElectricDistributionBoard(IfcElectricDistributionBoard b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcElectricDistributionBoard(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcElectricDistributionBoard s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcElectricDistributionBoardTypeEnum)Enum.Parse(typeof(IfcElectricDistributionBoardTypeEnum), str); + } + internal new static IfcElectricDistributionBoard Parse(string strDef) { IfcElectricDistributionBoard s = new IfcElectricDistributionBoard(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcElectricDistributionBoardTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcElectricDistributionBoardType : IfcFlowControllerType + { + internal IfcElectricDistributionBoardTypeEnum mPredefinedType = IfcElectricDistributionBoardTypeEnum.NOTDEFINED;// : IfcElectricDistributionBoardTypeEnum; + public IfcElectricDistributionBoardTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcElectricDistributionBoardType() : base() { } + internal IfcElectricDistributionBoardType(IfcElectricDistributionBoardType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcElectricDistributionBoardType(DatabaseIfc m, string name, IfcElectricDistributionBoardTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcElectricDistributionBoardType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricDistributionBoardTypeEnum)Enum.Parse(typeof(IfcElectricDistributionBoardTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricDistributionBoardType Parse(string strDef) { IfcElectricDistributionBoardType t = new IfcElectricDistributionBoardType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcElectricDistributionPoint : IfcFlowController // DEPRECEATED IFC4 + { + internal IfcElectricDistributionPointFunctionEnum mDistributionPointFunction;// : IfcElectricDistributionPointFunctionEnum; + internal string mUserDefinedFunction = "$";// : OPTIONAL IfcLabel; + internal IfcElectricDistributionPoint() : base() { } + internal IfcElectricDistributionPoint(IfcElectricDistributionPoint be) : base(be) { mDistributionPointFunction = be.mDistributionPointFunction; mUserDefinedFunction = be.mUserDefinedFunction; } + internal static void parseFields(IfcElectricDistributionPoint dp, List arrFields, ref int ipos) + { + IfcFlowController.parseFields(dp, arrFields, ref ipos); + dp.mDistributionPointFunction = (IfcElectricDistributionPointFunctionEnum)Enum.Parse(typeof(IfcElectricDistributionPointFunctionEnum), arrFields[ipos++].Replace(".", "")); + dp.mUserDefinedFunction = arrFields[ipos++]; + } + internal new static IfcElectricDistributionPoint Parse(string strDef) { IfcElectricDistributionPoint p = new IfcElectricDistributionPoint(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + ",." + mDistributionPointFunction.ToString() + ".," + mUserDefinedFunction; } + } + public class IfcElectricFlowStorageDevice : IfcFlowStorageDevice //IFC4 + { + internal IfcElectricFlowStorageDeviceTypeEnum mPredefinedType = IfcElectricFlowStorageDeviceTypeEnum.NOTDEFINED;// OPTIONAL : IfcElectricFlowStorageDeviceTypeEnum; + public IfcElectricFlowStorageDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricFlowStorageDevice() : base() { } + internal IfcElectricFlowStorageDevice(IfcElectricFlowStorageDevice d) : base(d) { mPredefinedType = d.mPredefinedType; } + internal IfcElectricFlowStorageDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcElectricFlowStorageDevice s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcElectricFlowStorageDeviceTypeEnum)Enum.Parse(typeof(IfcElectricFlowStorageDeviceTypeEnum), str); + } + internal new static IfcElectricFlowStorageDevice Parse(string strDef) { IfcElectricFlowStorageDevice s = new IfcElectricFlowStorageDevice(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcElectricFlowStorageDeviceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcElectricFlowStorageDeviceType : IfcFlowStorageDeviceType + { + internal IfcElectricApplianceTypeEnum mPredefinedType = IfcElectricApplianceTypeEnum.NOTDEFINED;// : IfcDuctFittingTypeEnum; + internal IfcElectricFlowStorageDeviceType() : base() { } + internal IfcElectricFlowStorageDeviceType(IfcElectricFlowStorageDeviceType be) : base((IfcFlowStorageDeviceType)be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcElectricFlowStorageDeviceType t, List arrFields, ref int ipos) { IfcFlowStorageDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricApplianceTypeEnum)Enum.Parse(typeof(IfcElectricApplianceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricFlowStorageDeviceType Parse(string strDef) { IfcElectricFlowStorageDeviceType t = new IfcElectricFlowStorageDeviceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcElectricGenerator : IfcEnergyConversionDevice //IFC4 + { + internal IfcElectricGeneratorTypeEnum mPredefinedType = IfcElectricGeneratorTypeEnum.NOTDEFINED;// OPTIONAL : IfcElectricGeneratorTypeEnum; + public IfcElectricGeneratorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcElectricGenerator() : base() { } + internal IfcElectricGenerator(IfcElectricGenerator g) : base(g) { mPredefinedType = g.mPredefinedType; } + internal IfcElectricGenerator(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcElectricGenerator s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcElectricGeneratorTypeEnum)Enum.Parse(typeof(IfcElectricGeneratorTypeEnum), str); + } + internal new static IfcElectricGenerator Parse(string strDef) { IfcElectricGenerator s = new IfcElectricGenerator(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcElectricGeneratorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcElectricGeneratorType : IfcEnergyConversionDeviceType + { + internal IfcElectricGeneratorTypeEnum mPredefinedType = IfcElectricGeneratorTypeEnum.NOTDEFINED;// : IfcElectricGeneratorTypeEnum; + public IfcElectricGeneratorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricGeneratorType() : base() { } + internal IfcElectricGeneratorType(IfcElectricGeneratorType be) : base((IfcEnergyConversionDeviceType)be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcElectricGeneratorType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricGeneratorTypeEnum)Enum.Parse(typeof(IfcElectricGeneratorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricGeneratorType Parse(string strDef) { IfcElectricGeneratorType t = new IfcElectricGeneratorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcElectricHeaterType : IfcFlowTerminalType // DEPRECEATED IFC4 + { + internal IfcElectricHeaterTypeEnum mPredefinedType = IfcElectricHeaterTypeEnum.NOTDEFINED;// : IfcElectricHeaterTypeEnum + public IfcElectricHeaterTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricHeaterType() : base() { } + internal IfcElectricHeaterType(IfcElectricHeaterType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcElectricHeaterType t, List arrFields, ref int ipos) { IfcFlowTerminalType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricHeaterTypeEnum)Enum.Parse(typeof(IfcElectricHeaterTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricHeaterType Parse(string strDef) { IfcElectricHeaterType t = new IfcElectricHeaterType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcElectricMotor : IfcEnergyConversionDevice //IFC4 + { + internal IfcElectricMotorTypeEnum mPredefinedType = IfcElectricMotorTypeEnum.NOTDEFINED;// OPTIONAL : IfcElectricMotorTypeEnum; + public IfcElectricMotorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricMotor() : base() { } + internal IfcElectricMotor(IfcElectricMotor m) : base(m) { mPredefinedType = m.mPredefinedType; } + internal IfcElectricMotor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcElectricMotor s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcElectricMotorTypeEnum)Enum.Parse(typeof(IfcElectricMotorTypeEnum), str); + } + internal new static IfcElectricMotor Parse(string strDef) { IfcElectricMotor s = new IfcElectricMotor(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcElectricMotorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcElectricMotorType : IfcEnergyConversionDeviceType + { + internal IfcElectricMotorTypeEnum mPredefinedType = IfcElectricMotorTypeEnum.NOTDEFINED;// : IfcElectricMotorTypeEnum; + public IfcElectricMotorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricMotorType() : base() { } + internal IfcElectricMotorType(IfcElectricMotorType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal static void parseFields(IfcElectricMotorType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricMotorTypeEnum)Enum.Parse(typeof(IfcElectricMotorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricMotorType Parse(string strDef) { IfcElectricMotorType t = new IfcElectricMotorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcElectricTimeControl : IfcFlowController //IFC4 + { + internal IfcElectricTimeControlTypeEnum mPredefinedType = IfcElectricTimeControlTypeEnum.NOTDEFINED;// OPTIONAL : IfcElectricTimeControlTypeEnum; + public IfcElectricTimeControlTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcElectricTimeControl() : base() { } + internal IfcElectricTimeControl(IfcElectricTimeControl c) : base(c) { mPredefinedType = c.mPredefinedType; } + internal IfcElectricTimeControl(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcElectricTimeControl s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcElectricTimeControlTypeEnum)Enum.Parse(typeof(IfcElectricTimeControlTypeEnum), str); + } + internal new static IfcElectricTimeControl Parse(string strDef) { IfcElectricTimeControl s = new IfcElectricTimeControl(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcElectricTimeControlTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcElectricTimeControlType : IfcFlowControllerType + { + internal IfcElectricTimeControlTypeEnum mPredefinedType = IfcElectricTimeControlTypeEnum.NOTDEFINED;// : IfcElectricTimeControlTypeEnum; + public IfcElectricTimeControlTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElectricTimeControlType() : base() { } + internal IfcElectricTimeControlType(IfcElectricTimeControlType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcElectricTimeControlType(DatabaseIfc m, string name, IfcElectricTimeControlTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcElectricTimeControlType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcElectricTimeControlTypeEnum)Enum.Parse(typeof(IfcElectricTimeControlTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcElectricTimeControlType Parse(string strDef) { IfcElectricTimeControlType t = new IfcElectricTimeControlType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcElectricalBaseProperties // DEPRECEATED IFC4 + public class IfcElectricalCircuit : IfcSystem // DEPRECEATED IFC4 + { + internal IfcElectricalCircuit() : base() { } + internal IfcElectricalCircuit(IfcElectricalCircuit el) : base(el) { } + internal new static IfcElectricalCircuit Parse(string strDef) { IfcElectricalCircuit c = new IfcElectricalCircuit(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcElectricalCircuit c, List arrFields, ref int ipos) { IfcSystem.parseFields(c, arrFields, ref ipos); } + } + public class IfcElectricalElement : IfcElement /* DEPRECEATED IFC2x2*/ { } + public abstract partial class IfcElement : IfcProduct, IfcStructuralActivityAssignmentSelect //ABSTRACT SUPERTYPE OF (ONEOF(IfcBuildingElement,IfcCivilElement + { //,IfcDistributionElement,IfcElementAssembly,IfcElementComponent,IfcFeatureElement,IfcFurnishingElement,IfcGeographicElement,IfcTransportElement ,IfcVirtualElement,IfcElectricalElement SS,IfcEquipmentElement SS)) + public enum SubTypes { IfcBuildingElement, IfcCivilElement, IfcDistributionControlElement, IfcDistributionFlowElement, IfcElementAssembly, IfcElementComponent, IfcFeatureElement, IfcFurnishingElement, IfcGeographicElement, IfcTransportElement, IfcVirtualElement } + + private string mTag = "$";// : OPTIONAL IfcIdentifier; + //INVERSE ADD TO TREEVIEWER WHEN ACTIVATING + internal List mHasStructuralMemberSS = new List();// DEL IFC4 : SET OF IfcRelConnectsStructuralElement FOR RelatingElement; + internal List mFillsVoids = new List();// : SET [0:1] OF IfcRelFillsElement FOR RelatedBuildingElement; + internal List mConnectedTo = new List();// : SET OF IfcRelConnectsElements FOR RelatingElement; + //IsInterferedByElements : SET OF IfcRelInterferesElements FOR RelatedElement; + //InterferesElements : SET OF IfcRelInterferesElements FOR RelatingElement; + internal List mHasProjections = new List();// : SET OF IfcRelProjectsElement FOR RelatingElement; + //ReferencedInStructures : SET OF IfcRelReferencedInSpatialStructure FOR RelatedElements; + internal List mHasOpenings = new List(); //: SET [0:?] OF IfcRelVoidsElement FOR RelatingBuildingElement; + internal List mIsConnectionRealization = new List();// : SET OF IfcRelConnectsWithRealizingElements FOR RealizingElements; + internal List mProvidesBoundaries = new List();// : SET OF IfcRelSpaceBoundary FOR RelatedBuildingElement; + internal List mConnectedFrom = new List();// : SET OF IfcRelConnectsElements FOR RelatedElement; + internal IfcRelContainedInSpatialStructure mContainedInStructure = null; + internal List mAssignedStructuralActivity = new List();//: SET OF IfcRelConnectsStructuralActivity FOR RelatingElement; + + public List mHasCoverings = new List();// : SET OF IfcRelCoversBldgElements FOR RelatingBuildingElement; DEL IFC4 + internal List mHasPorts = new List();// : SET OF IfcRelConnectsPortToElement FOR RelatedElement; DEL IFC4 + + public string Tag { get { return mTag == "$" ? "" : mTag; } set { mTag = string.IsNullOrEmpty(value) ? "$" : value.Replace("'", ""); } } + public List HasOpenings { get { return mHasOpenings; } } + public List HasCoverings { get { return mHasCoverings; } } + //GEOMGYM + //List mAssignedStructuralActivity = new List();//: SET OF IfcRelConnectsStructuralActivity FOR RelatingElement; + + protected IfcElement() : base() { } + protected IfcElement(IfcElement e) : base(e) { mTag = e.mTag; } + protected IfcElement(DatabaseIfc m) : base(m) { } + protected IfcElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + protected static void parseFields(IfcElement e, List arrFields, ref int ipos) { IfcProduct.parseFields(e, arrFields, ref ipos); e.mTag = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + "," + (mTag == "$" ? "$" : "'" + mTag + "'"); } + + public IfcMaterialSelect MaterialSelect + { + get { return GetMaterialSelect(); } + set { this.setMaterial(value); } + } + protected override IfcMaterialSelect GetMaterialSelect() + { + IfcMaterialSelect m = base.GetMaterialSelect(); + if (m != null) + return m; + if (IsTypedBy != null) + { + IfcElementType t = RelatingType as IfcElementType; + if (t != null) + return t.MaterialSelect; + } + return null; + } + + internal IfcProduct getContainer() + { + if (mDecomposes != null) + return mDecomposes.RelatingObject as IfcProduct; + return (mContainedInStructure != null ? mContainedInStructure.RelatingStructure : null); + } + internal static IfcElement constructElement(string className, IfcProduct container, IfcObjectPlacement pl, IfcProductRepresentation r) { return constructElement(className, container, pl, r, null); } + internal static IfcElement constructElement(string className, IfcProduct container, IfcObjectPlacement pl, IfcProductRepresentation r, IfcDistributionSystem system) + { + string str = className, definedType = ""; + if (!string.IsNullOrEmpty(str)) + { + string[] fields = str.Split(".".ToCharArray()); + if (fields.Length > 1) + { + str = fields[0]; + definedType = fields[1]; + } + } + IfcElement element = null; + Type type = Type.GetType("GeometryGym.Ifc." + str); + if (type != null) + { + ConstructorInfo ctor = type.GetConstructor(new[] { typeof(IfcProduct), typeof(IfcObjectPlacement), typeof(IfcProductRepresentation) }); + if (ctor == null) + { + ctor = type.GetConstructor(new[] { typeof(IfcProduct), typeof(IfcObjectPlacement), typeof(IfcProductRepresentation), typeof(IfcDistributionSystem) }); + if (ctor == null) + throw new Exception("XXX Unrecognized Ifc Constructor for " + className); + else + element = ctor.Invoke(new object[] { container, pl, r, system }) as IfcElement; + } + else + element = ctor.Invoke(new object[] { container, pl, r }) as IfcElement; + } + if (element == null) + element = new IfcBuildingElementProxy(container, pl, r); + + if (!string.IsNullOrEmpty(definedType)) + { + if (container.mDatabase.mSchema == Schema.IFC2x3) + element.ObjectType = definedType; + else + { + type = element.GetType(); + PropertyInfo pi = type.GetProperty("PredefinedType"); + if (pi != null) + { + Type enumType = Type.GetType("GeometryGym.Ifc." + type.Name + "TypeEnum"); + if (enumType != null) + { + FieldInfo fi = enumType.GetField(definedType); + if (fi == null) + { + element.ObjectType = definedType; + fi = enumType.GetField("NOTDEFINED"); + } + if (fi != null) + { + int i = (int)fi.GetValue(enumType); + object newEnumValue = Enum.ToObject(enumType, i); + pi.SetValue(element, newEnumValue, null); + } + else + element.ObjectType = definedType; + } + else + element.ObjectType = definedType; + } + else + element.ObjectType = definedType; + } + } + return element; + } + } + public abstract partial class IfcElementarySurface : IfcSurface //ABSTRACT SUPERTYPE OF (ONEOF(IfcPlane)) + { + private int mPosition;// : IfcAxis2Placement3D; + internal IfcAxis2Placement3D Position { get { return mDatabase.mIfcObjects[mPosition] as IfcAxis2Placement3D; } } + protected IfcElementarySurface() : base() { } + protected IfcElementarySurface(IfcElementarySurface o) : base(o) { mPosition = o.mPosition; } + protected IfcElementarySurface(IfcAxis2Placement3D placement) : base(placement.mDatabase) { mPosition = placement.mIndex; } + protected static void parseFields(IfcElementarySurface s, List arrFields, ref int ipos) { IfcSurface.parseFields(s, arrFields, ref ipos); s.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition); } + } + public partial class IfcElementAssembly : IfcElement + { + //GG + private IfcProduct mHost = null; + + internal IfcAssemblyPlaceEnum mAssemblyPlace = IfcAssemblyPlaceEnum.NOTDEFINED;//: OPTIONAL IfcAssemblyPlaceEnum; + internal IfcElementAssemblyTypeEnum mPredefinedType = IfcElementAssemblyTypeEnum.NOTDEFINED;//: OPTIONAL IfcElementAssemblyTypeEnum; + public IfcAssemblyPlaceEnum AssemblyPlace { get { return mAssemblyPlace; } set { mAssemblyPlace = value; } } + public IfcElementAssemblyTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcElementAssembly() : base() { } + internal IfcElementAssembly(IfcElementAssembly a) : base(a) { mPredefinedType = a.mPredefinedType; } + public IfcElementAssembly(IfcProduct host, IfcAssemblyPlaceEnum place, IfcElementAssemblyTypeEnum type) : base(host.mDatabase) { mHost = host; AssemblyPlace = place; PredefinedType = type; } + + internal static IfcElementAssembly Parse(string strDef) { IfcElementAssembly a = new IfcElementAssembly(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcElementAssembly a, List arrFields, ref int ipos) + { + IfcElement.parseFields(a, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + a.mAssemblyPlace = (IfcAssemblyPlaceEnum)Enum.Parse(typeof(IfcAssemblyPlaceEnum), str.Replace(".", "")); + str = arrFields[ipos++]; + if (str.StartsWith(".")) + a.mPredefinedType = (IfcElementAssemblyTypeEnum)Enum.Parse(typeof(IfcElementAssemblyTypeEnum), str.Replace(".", "")); + } + protected override string BuildString() + { + bool empty = true; + for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) + if (mIsDecomposedBy[icounter].mRelatedObjects.Count > 0) + { + empty = false; + break; + } + return (empty ? "" : base.BuildString() + ",." + mAssemblyPlace.ToString() + ".,." + mPredefinedType.ToString() + "."); + } + public override bool AddElement(IfcElement s) + { + if (mIsDecomposedBy.Count == 0 || mIsDecomposedBy[0].mRelatedObjects.Count == 0) + mHost.AddElement(this); + return base.AddElement(s); + } + } + public class IfcElementAssemblyType : IfcElementType //IFC4 + { + internal IfcElementAssemblyTypeEnum mPredefinedType = IfcElementAssemblyTypeEnum.NOTDEFINED;// IfcElementAssemblyTypeEnum; + public IfcElementAssemblyTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcElementAssemblyType() : base() { } + internal IfcElementAssemblyType(IfcElementAssemblyType o) : base(o) { mPredefinedType = o.mPredefinedType; } + public IfcElementAssemblyType(DatabaseIfc m, string name, IfcElementAssemblyTypeEnum type) : base(m) { Name = name; mPredefinedType = type; if (m.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " only supported in IFC4!"); } + internal new static IfcElementAssemblyType Parse(string strDef) { IfcElementAssemblyType t = new IfcElementAssemblyType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcElementAssemblyType t, List arrFields, ref int ipos) + { + IfcElementType.parseFields(t, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + t.mPredefinedType = (IfcElementAssemblyTypeEnum)Enum.Parse(typeof(IfcElementAssemblyTypeEnum), s.Replace(".", "")); + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public abstract partial class IfcElementComponent : IfcElement // ABSTRACT SUPERTYPE OF(ONEOF(IfcBuildingElementPart, IfcDiscreteAccessory, IfcFastener, IfcMechanicalFastener, IfcReinforcingElement, IfcVibrationIsolator)) + { + internal new enum SubTypes { IfcBuildingElementPart, IfcDiscreteAccessory, IfcFastener, IfcMechanicalFastener, IfcReinforcingElement, IfcVibrationIsolator } + protected IfcElementComponent() : base() { } + protected IfcElementComponent(IfcElementComponent c) : base(c) { } + protected IfcElementComponent(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host,placement,representation) { } + + protected static void parseFields(IfcElementComponent c, List arrFields, ref int ipos) { IfcElement.parseFields(c, arrFields, ref ipos); } + } + public abstract class IfcElementComponentType : IfcElementType // ABSTRACT SUPERTYPE OF (ONEOF ((IfcBuildingElementPartType, IfcDiscreteAccessoryType, IfcFastenerType, IfcMechanicalFastenerType, IfcReinforcingElementType, IfcVibrationIsolatorType))) + { + protected IfcElementComponentType() : base() { } + protected IfcElementComponentType(IfcElementComponentType el) : base(el) { } + protected IfcElementComponentType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcElementComponentType t, List arrFields, ref int ipos) { IfcElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcElementQuantity : IfcPropertySetDefinition + { + internal string mMethodOfMeasurement = "$";// : OPTIONAL IfcLabel; + internal List mQuantities = new List();// : SET [1:?] OF IfcPhysicalQuantity; + + public string MethodOfMeasurement { get { return (mMethodOfMeasurement == "$" ? "" : mMethodOfMeasurement); } } + public List Quantities { get { return mQuantities.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcPhysicalQuantity); } } + + internal IfcElementQuantity() : base() { } + internal IfcElementQuantity(IfcElementQuantity el) : base(el) { mMethodOfMeasurement = el.mMethodOfMeasurement; mQuantities = new List(el.mQuantities.ToArray()); } + internal IfcElementQuantity(string name, string methodOfMeasurement, List quantities) + : base(quantities[0].mDatabase, name) + { + if (methodOfMeasurement != "") + mMethodOfMeasurement = methodOfMeasurement.Replace("'", ""); + mQuantities = quantities.ConvertAll(x => x.mIndex); + } + internal static IfcElementQuantity Parse(string strDef) { IfcElementQuantity q = new IfcElementQuantity(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos); return q; } + internal static void parseFields(IfcElementQuantity q, List arrFields, ref int ipos) { IfcPropertySetDefinition.parseFields(q, arrFields, ref ipos); q.mMethodOfMeasurement = arrFields[ipos++].Replace("'", ""); q.mQuantities = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + (mMethodOfMeasurement == "$" ? ",$,(" : ",'" + mMethodOfMeasurement + "',(") + (mQuantities.Count > 0 ? "#" + mQuantities[0] : ""); + for (int icounter = 1; icounter < mQuantities.Count; icounter++) + str += ",#" + mQuantities[icounter]; + return str + ")"; + } + } + public abstract partial class IfcElementType : IfcTypeProduct //ABSTRACT SUPERTYPE OF(ONEOF(IfcBuildingElementType, IfcDistributionElementType, IfcElementAssemblyType, IfcElementComponentType, IfcFurnishingElementType, IfcGeographicElementType, IfcTransportElementType)) + { + private string mElementType = "$";// : OPTIONAL IfcLabel + public string ElementType { get { return mElementType == "$" ? "" : mElementType; } set { mElementType = string.IsNullOrEmpty(value) ? "$" : value.Replace("'", ""); } } + + protected IfcElementType() : base() { } + protected IfcElementType(IfcElementType t) : base(t) { mElementType = t.mElementType; } + protected IfcElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcElementType t, List arrFields, ref int ipos) { IfcTypeProduct.parseFields(t, arrFields, ref ipos); t.mElementType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 && (this as IfcDoorType != null || this as IfcWindowType != null) ? "" : (mElementType == "$" ? ",$" : ",'" + mElementType + "'")); + } + + public IfcMaterialSelect MaterialSelect + { + get { return GetMaterialSelect(); } + set { base.setMaterial(value); } + } + + public IfcElement GenerateMappedItemElement(IfcProduct container, IfcCartesianTransformationOperator transform) + { + string typename = this.GetType().Name; + typename = typename.Substring(0, typename.Length - 4); + IfcProductDefinitionShape pds = new IfcProductDefinitionShape(new IfcShapeRepresentation(new IfcMappedItem(RepresentationMaps[0], transform))); + IfcElement element = IfcElement.constructElement(typename, container,null, pds); + element.RelatingType = this; + return element; + } + } + public partial class IfcEllipse : IfcConic + { + internal double mSemiAxis1;// : IfcPositiveLengthMeasure; + internal double mSemiAxis2;// : IfcPositiveLengthMeasure; + internal IfcEllipse() : base() { } + internal IfcEllipse(IfcEllipse c) : base(c) { mSemiAxis1 = c.mSemiAxis1; mSemiAxis2 = c.mSemiAxis2; } + internal IfcEllipse(IfcAxis2Placement pl, double axis1, double axis2) : base(pl) { mSemiAxis1 = axis1; mSemiAxis2 = axis2; } + internal static void parseFields(IfcEllipse e, List arrFields, ref int ipos) { IfcConic.parseFields(e, arrFields, ref ipos); e.mSemiAxis1 = ParserSTEP.ParseDouble(arrFields[ipos++]); e.mSemiAxis2 = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcEllipse Parse(string strDef) { IfcEllipse e = new IfcEllipse(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mSemiAxis1) + "," + ParserSTEP.DoubleToString(mSemiAxis2); } + } + public partial class IfcEllipseProfileDef : IfcParameterizedProfileDef + { + internal double mSemiAxis1;// : IfcPositiveLengthMeasure; + internal double mSemiAxis2;// : IfcPositiveLengthMeasure; + internal IfcEllipseProfileDef() : base() { } + internal IfcEllipseProfileDef(IfcEllipseProfileDef c) : base(c) { mSemiAxis1 = c.mSemiAxis1; mSemiAxis2 = c.mSemiAxis2; } + + internal static void parseFields(IfcEllipseProfileDef p, List arrFields, ref int ipos) { IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); p.mSemiAxis1 = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mSemiAxis2 = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal new static IfcEllipseProfileDef Parse(string strDef) { IfcEllipseProfileDef p = new IfcEllipseProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public partial class IfcEnergyConversionDevice : IfcDistributionFlowElement //IFC4 Abstract + { // SUPERTYPE OF(ONEOF(IfcAirToAirHeatRecovery, IfcBoiler, IfcBurner, IfcChiller, IfcCoil, IfcCondenser, IfcCooledBeam, + //IfcCoolingTower, IfcElectricGenerator, IfcElectricMotor, IfcEngine, IfcEvaporativeCooler, IfcEvaporator, IfcHeatExchanger, + //IfcHumidifier, IfcMotorConnection, IfcSolarDevice, IfcTransformer, IfcTubeBundle, IfcUnitaryEquipment)) + internal new enum SubTypes + { + IfcAirToAirHeatRecovery, IfcBoiler, IfcBurner, IfcChiller, IfcCoil, IfcCondenser, IfcCooledBeam, + IfcCoolingTower, IfcElectricGenerator, IfcElectricMotor, IfcEngine, IfcEvaporativeCooler, IfcEvaporator, IfcHeatExchanger, + IfcHumidifier, IfcMotorConnection, IfcSolarDevice, IfcTransformer, IfcTubeBundle, IfcUnitaryEquipment + } + + public override string KeyWord { get { return mDatabase.mSchema == Schema.IFC2x3 ? "IFCENERGYCONVERSIONDEVICE" : base.KeyWord; } } + + internal IfcEnergyConversionDevice() : base() { } + internal IfcEnergyConversionDevice(IfcEnergyConversionDevice be) : base(be) { } + internal IfcEnergyConversionDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcEnergyConversionDevice d, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(d, arrFields, ref ipos); } + internal new static IfcEnergyConversionDevice Parse(string strDef) { IfcEnergyConversionDevice d = new IfcEnergyConversionDevice(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + } + public abstract class IfcEnergyConversionDeviceType : IfcDistributionFlowElementType + { //ABSTRACT SUPERTYPE OF (ONEOF (IfcAirToAirHeatRecoveryType ,IfcBoilerType, IfcBurnerType ,IfcChillerType ,IfcCoilType ,IfcCondenserType ,IfcCooledBeamType + //,IfcCoolingTowerType ,IfcElectricGeneratorType ,IfcElectricMotorType ,IfcEvaporativeCoolerType ,IfcEvaporatorType ,IfcHeatExchangerType + //,IfcHumidifierType ,IfcMotorConnectionType ,IfcSpaceHeaterType ,IfcTransformerType ,IfcTubeBundleType ,IfcUnitaryEquipmentType)) + protected IfcEnergyConversionDeviceType() : base() { } + protected IfcEnergyConversionDeviceType(IfcEnergyConversionDeviceType t) : base(t) { } + protected IfcEnergyConversionDeviceType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcEnergyConversionDeviceType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + //IfcEnergyProperties // DEPRECEATED IFC4 + public class IfcEngine : IfcEnergyConversionDevice //IFC4 + { + internal IfcEngineTypeEnum mPredefinedType = IfcEngineTypeEnum.NOTDEFINED;// OPTIONAL : IfcEngineTypeEnum; + public IfcEngineTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcEngine() : base() { } + internal IfcEngine(IfcEngine e) : base(e) { mPredefinedType = e.mPredefinedType; } + internal IfcEngine(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcEngine s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcEngineTypeEnum)Enum.Parse(typeof(IfcEngineTypeEnum), str); + } + internal new static IfcEngine Parse(string strDef) { IfcEngine s = new IfcEngine(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcEngineTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcEngineType : IfcEnergyConversionDeviceType + { + internal IfcEngineTypeEnum mPredefinedType = IfcEngineTypeEnum.NOTDEFINED;// : IfcEngineTypeEnum; + public IfcEngineTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcEngineType() : base() { } + internal IfcEngineType(IfcEngineType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcEngineType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcEngineTypeEnum)Enum.Parse(typeof(IfcEngineTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcEngineType Parse(string strDef) { IfcEngineType t = new IfcEngineType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcEnvironmentalImpactValue : IfcAppliedValue //DEPRECEATED + { + internal string mImpactType;// : IfcLabel; + internal IfcEnvironmentalImpactCategoryEnum mEnvCategory = IfcEnvironmentalImpactCategoryEnum.NOTDEFINED;// IfcEnvironmentalImpactCategoryEnum + internal string mUserDefinedCategory = "$";// : OPTIONAL IfcLabel; + internal IfcEnvironmentalImpactValue() : base() { } + internal IfcEnvironmentalImpactValue(IfcEnvironmentalImpactValue o) : base(o) { mImpactType = o.mImpactType; mEnvCategory = o.mEnvCategory; mUserDefinedCategory = o.mUserDefinedCategory; } + internal new static IfcEnvironmentalImpactValue Parse(string strDef, Schema schema) { IfcEnvironmentalImpactValue v = new IfcEnvironmentalImpactValue(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return v; } + internal static void parseFields(IfcEnvironmentalImpactValue v, List arrFields, ref int ipos, Schema schema) { IfcAppliedValue.parseFields(v, arrFields, ref ipos, schema); v.mImpactType = arrFields[ipos++]; v.mEnvCategory = (IfcEnvironmentalImpactCategoryEnum)Enum.Parse(typeof(IfcEnvironmentalImpactCategoryEnum), arrFields[ipos++].Replace(".", "")); v.mUserDefinedCategory = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mImpactType + ",." + mEnvCategory.ToString() + ".," + mUserDefinedCategory; } + } + public class IfcEquipmentElement : IfcElement //IFC2x2 Depreceated + { } + public class IfcEquipmentStandard : IfcControl // DEPRECEATED IFC4 + { + internal IfcEquipmentStandard() : base() { } + internal IfcEquipmentStandard(IfcEquipmentStandard i) : base(i) { } + internal static IfcEquipmentStandard Parse(string strDef, Schema schema) { IfcEquipmentStandard s = new IfcEquipmentStandard(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return s; } + } + public class IfcEvaporativeCooler : IfcEnergyConversionDevice //IFC4 + { + internal IfcEvaporativeCoolerTypeEnum mPredefinedType = IfcEvaporativeCoolerTypeEnum.NOTDEFINED;// OPTIONAL : IfcEvaporativeCoolerTypeEnum; + public IfcEvaporativeCoolerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcEvaporativeCooler() : base() { } + internal IfcEvaporativeCooler(IfcEvaporativeCooler c) : base(c) { mPredefinedType = c.mPredefinedType; } + internal IfcEvaporativeCooler(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcEvaporativeCooler s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcEvaporativeCoolerTypeEnum)Enum.Parse(typeof(IfcEvaporativeCoolerTypeEnum), str); + } + internal new static IfcEvaporativeCooler Parse(string strDef) { IfcEvaporativeCooler s = new IfcEvaporativeCooler(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcEvaporativeCoolerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcEvaporativeCoolerType : IfcEnergyConversionDeviceType + { + internal IfcEvaporativeCoolerTypeEnum mPredefinedType = IfcEvaporativeCoolerTypeEnum.NOTDEFINED;// : IfcEvaporativeCoolerTypeEnum; + public IfcEvaporativeCoolerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcEvaporativeCoolerType() : base() { } + internal IfcEvaporativeCoolerType(IfcEvaporativeCoolerType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcEvaporativeCoolerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcEvaporativeCoolerTypeEnum)Enum.Parse(typeof(IfcEvaporativeCoolerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcEvaporativeCoolerType Parse(string strDef) { IfcEvaporativeCoolerType t = new IfcEvaporativeCoolerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcEvaporator : IfcEnergyConversionDevice //IFC4 + { + internal IfcEvaporatorTypeEnum mPredefinedType = IfcEvaporatorTypeEnum.NOTDEFINED;// OPTIONAL : IfcEvaporatorTypeEnum; + public IfcEvaporatorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcEvaporator() : base() { } + internal IfcEvaporator(IfcEvaporator e) : base(e) { mPredefinedType = e.mPredefinedType; } + internal IfcEvaporator(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcEvaporator s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcEvaporatorTypeEnum)Enum.Parse(typeof(IfcEvaporatorTypeEnum), str); + } + internal new static IfcEvaporator Parse(string strDef) { IfcEvaporator s = new IfcEvaporator(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcEvaporatorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcEvaporatorType : IfcEnergyConversionDeviceType + { + internal IfcEvaporatorTypeEnum mPredefinedType = IfcEvaporatorTypeEnum.NOTDEFINED;// : IfcEvaporatorTypeEnum; + public IfcEvaporatorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcEvaporatorType() : base() { } + internal IfcEvaporatorType(IfcEvaporatorType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcEvaporatorType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcEvaporatorTypeEnum)Enum.Parse(typeof(IfcEvaporatorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcEvaporatorType Parse(string strDef) { IfcEvaporatorType t = new IfcEvaporatorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcEvent : IfcProcess //IFC4 + { + internal IfcEventTypeEnum mPredefinedType = IfcEventTypeEnum.NOTDEFINED;// : IfcEventTypeEnum; + internal IfcEventTriggerTypeEnum mEventTriggerType = IfcEventTriggerTypeEnum.NOTDEFINED;// : IfcEventTypeEnum; + internal string mUserDefinedEventTriggerType = "$";// : OPTIONAL IfcLabel; + internal int mEventOccurenceTime;// : OPTIONAL IfcEventTime; + internal IfcEvent() : base() { } + internal IfcEvent(IfcEvent t) : base(t) { mPredefinedType = t.mPredefinedType; mEventTriggerType = t.mEventTriggerType; mUserDefinedEventTriggerType = t.mUserDefinedEventTriggerType; } + internal static void parseFields(IfcEvent e, List arrFields, ref int ipos) + { + IfcProcess.parseFields(e, arrFields, ref ipos); + e.mPredefinedType = (IfcEventTypeEnum)Enum.Parse(typeof(IfcEventTypeEnum), arrFields[ipos++].Replace(".", "")); + e.mEventTriggerType = (IfcEventTriggerTypeEnum)Enum.Parse(typeof(IfcEventTriggerTypeEnum), arrFields[ipos++].Replace(".", "")); + e.mUserDefinedEventTriggerType = arrFields[ipos++].Replace("'", ""); + e.mEventOccurenceTime = ParserSTEP.ParseLink(arrFields[ipos++]); + } + internal static IfcEvent Parse(string strDef) { IfcEvent t = new IfcEvent(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + ".,." + mEventTriggerType.ToString() + (mUserDefinedEventTriggerType == "$" ? ".,$" : (".,'" + mUserDefinedEventTriggerType + "'")) + "," + ParserSTEP.LinkToString(mEventOccurenceTime)); } + } + public class IfcEventType : IfcTypeProcess //IFC4 + { + internal IfcEventTypeEnum mPredefinedType = IfcEventTypeEnum.NOTDEFINED;// : IfcEventTypeEnum; + internal IfcEventTriggerTypeEnum mEventTriggerType = IfcEventTriggerTypeEnum.NOTDEFINED;// : IfcEventTypeEnum; + internal string mUserDefinedEventTriggerType = "$";// : OPTIONAL IfcLabel; + + public IfcEventTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public IfcEventTriggerTypeEnum EventTriggerType { get { return mEventTriggerType; } set { mEventTriggerType = value; } } + public string UserDefinedEventTriggerType { get { return (mUserDefinedEventTriggerType == "$" ? "" : ParserIfc.Decode(mUserDefinedEventTriggerType)); } set { mUserDefinedEventTriggerType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcEventType() : base() { } + internal IfcEventType(IfcEventType t) : base(t) { mPredefinedType = t.mPredefinedType; mEventTriggerType = t.mEventTriggerType; mUserDefinedEventTriggerType = t.mUserDefinedEventTriggerType; } + internal IfcEventType(DatabaseIfc m, string name, IfcEventTypeEnum t, IfcEventTriggerTypeEnum trigger) + : base(m) { Name = name; mPredefinedType = t; mEventTriggerType = trigger; } + internal static void parseFields(IfcEventType t, List arrFields, ref int ipos) + { + IfcTypeProcess.parseFields(t, arrFields, ref ipos); + t.mPredefinedType = (IfcEventTypeEnum)Enum.Parse(typeof(IfcEventTypeEnum), arrFields[ipos++].Replace(".", "")); + t.mEventTriggerType = (IfcEventTriggerTypeEnum)Enum.Parse(typeof(IfcEventTriggerTypeEnum), arrFields[ipos++].Replace(".", "")); + t.mUserDefinedEventTriggerType = arrFields[ipos++].Replace("'", ""); + } + internal new static IfcEventType Parse(string strDef) { IfcEventType t = new IfcEventType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + ".,." + mEventTriggerType.ToString() + (mUserDefinedEventTriggerType == "$" ? ".,$" : (".,'" + mUserDefinedEventTriggerType + "'"))); } + } + public partial class IfcExtendedMaterialProperties : IfcMaterialPropertiesSuperSeded // DEPRECEATED IFC4 + { + internal List mExtendedProperties = new List(); //: SET [1:?] OF IfcProperty + internal string mDescription = "$"; //: OPTIONAL IfcText; + internal string mName; //: IfcLabel; + + public List ExtendedProperties { get { return mExtendedProperties.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProperty); } set { mExtendedProperties = value.ConvertAll(x => x.mIndex); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcExtendedMaterialProperties() : base() { } + internal IfcExtendedMaterialProperties(IfcExtendedMaterialProperties el) : base(el) { mExtendedProperties = new List(el.mExtendedProperties.ToArray()); mDescription = el.mDescription; mName = el.mName; } + internal static IfcExtendedMaterialProperties Parse(string strDef) { IfcExtendedMaterialProperties p = new IfcExtendedMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcExtendedMaterialProperties p, List arrFields, ref int ipos) { IfcMaterialPropertiesSuperSeded.parseFields(p, arrFields, ref ipos); p.mExtendedProperties = ParserSTEP.SplitListLinks(arrFields[ipos++]); p.mDescription = arrFields[ipos++]; p.mName = arrFields[ipos++]; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mExtendedProperties[0]); + for (int icounter = 1; icounter < mExtendedProperties.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mExtendedProperties[icounter]); + return str + ")" + "," + mDescription + "," + mName; + } + } + public abstract partial class IfcExtendedProperties : IfcPropertyAbstraction //IFC4 ABSTRACT SUPERTYPE OF (ONEOF (IfcMaterialProperties,IfcProfileProperties)) + { + protected string mName = "$"; //: OPTIONAL IfcLabel; + private string mDescription = "$"; //: OPTIONAL IfcText; + internal List mExtendedProperties = new List(); //: SET [1:?] OF IfcProperty + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + internal List ExtendedProperties { get { return mExtendedProperties.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProperty); } } + + protected IfcExtendedProperties() : base() { } + protected IfcExtendedProperties(IfcExtendedProperties p) : base(p) { mExtendedProperties = new List(p.mExtendedProperties.ToArray()); mDescription = p.mDescription; mName = p.mName; } + protected IfcExtendedProperties(DatabaseIfc db) : base(db) { } + internal IfcExtendedProperties(string name, List props) : base(props[0].mDatabase) + { + Name = name; + if (props != null && props.Count > 0) + mExtendedProperties = props.ConvertAll(x => x.mIndex); + } + internal static void parseFields(IfcExtendedProperties p, List arrFields, ref int ipos, Schema schema) + { + IfcPropertyAbstraction.parseFields(p, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + p.mName = arrFields[ipos++].Replace("'", ""); + p.mDescription = arrFields[ipos++].Replace("'", ""); + p.mExtendedProperties = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + } + protected override string BuildString() + { + if (mExtendedProperties.Count == 0) + return ""; + if (mDatabase.mSchema == Schema.IFC2x3) + return base.BuildString(); + string str = base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$,(" : "'" + mDescription + "',(") + ParserSTEP.LinkToString(mExtendedProperties[0]); + for (int icounter = 1; icounter < mExtendedProperties.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mExtendedProperties[icounter]); + return str + ")"; + } + } + //ENTITY IfcExternallyDefinedHatchStyle + public partial class IfcExternallyDefinedSurfaceStyle : IfcExternalReference, IfcSurfaceStyleElementSelect + { + internal IfcExternallyDefinedSurfaceStyle() : base() { } + internal IfcExternallyDefinedSurfaceStyle(IfcExternallyDefinedSurfaceStyle i) : base(i) { } + internal IfcExternallyDefinedSurfaceStyle(DatabaseIfc db) : base(db) { } + internal static IfcExternallyDefinedSurfaceStyle Parse(string strDef) { IfcExternallyDefinedSurfaceStyle f = new IfcExternallyDefinedSurfaceStyle(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcExternallyDefinedSurfaceStyle f, List arrFields, ref int ipos) { IfcExternalReference.parseFields(f, arrFields, ref ipos); } + } + //ENTITY IfcExternallyDefinedSymbol // DEPRECEATED IFC4 + internal class IfcExternallyDefinedTextFont : IfcExternalReference + { + internal IfcExternallyDefinedTextFont() : base() { } + internal IfcExternallyDefinedTextFont(IfcExternallyDefinedTextFont i) : base(i) { } + internal IfcExternallyDefinedTextFont(DatabaseIfc db) : base(db) { } + internal static IfcExternallyDefinedTextFont Parse(string strDef) { IfcExternallyDefinedTextFont f = new IfcExternallyDefinedTextFont(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcExternallyDefinedTextFont f, List arrFields, ref int ipos) { IfcExternalReference.parseFields(f, arrFields, ref ipos); } + } + public abstract class IfcExternalInformation : BaseClassIfc, IfcResourceObjectSelect // NEW IFC4 ABSTRACT SUPERTYPE OF(ONEOF(IfcClassification, IfcDocumentInformation, IfcLibraryInformation)); + { //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + protected IfcExternalInformation() : base() { } + protected IfcExternalInformation(IfcExternalInformation i) : base() { } + protected IfcExternalInformation(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcExternalInformation r, List arrFields, ref int ipos) { } + } + public abstract class IfcExternalReference : BaseClassIfc, IfcLightDistributionDataSourceSelect, IfcResourceObjectSelect//ABSTRACT SUPERTYPE OF (ONEOF (IfcClassificationReference ,IfcDocumentReference ,IfcExternallyDefinedHatchStyle + { //,IfcExternallyDefinedSurfaceStyle ,IfcExternallyDefinedSymbol ,IfcExternallyDefinedTextFont ,IfcLibraryReference)); + private string mLocation = "$";// : OPTIONAL IfcURIReference; ifc2x3 ifclabel + private string mIdentification = "$";// : OPTIONAL IfcIdentifier; ifc2x3 ItemReference + private string mName = "$";// : IfcLabel; + + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 public override string Name { get { return (mName == "$" ? "" : mName); } set { if (!string.IsNullOrEmpty(value)) mName = value; } } + internal List mHasConstraintRelationships = new List(); //gg + internal List mExternalReferenceForResources = new List();// : SET [0:?] OF IfcExternalReferenceRelationship FOR RelatingReference; + + public string Location { get { return (mLocation == "$" ? "" : ParserIfc.Decode(mLocation)); } set { mLocation = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Identification { get { return (mIdentification == "$" ? "" : ParserIfc.Decode(mIdentification)); } set { mIdentification = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + protected IfcExternalReference() : base() { } + protected IfcExternalReference(IfcExternalReference i) : base() { mLocation = i.mLocation; mIdentification = i.mIdentification; mName = i.mName; } + protected IfcExternalReference(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcExternalReference r, List arrFields, ref int ipos) + { + r.mLocation = arrFields[ipos++].Replace("'", ""); + r.mIdentification = arrFields[ipos++].Replace("'", ""); + r.mName = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + (mLocation == "$" ? ",$," : ",'" + mLocation + "',") + (mIdentification == "$" ? "$" : "'" + mIdentification + "'") + (mName == "$" ? ",$" : ",'" + mName + "'"); } + } + public partial class IfcExternalReferenceRelationship : IfcResourceLevelRelationship //IFC4 + { + private int mRelatingReference;// : IfcExternalReference; + private List mRelatedResourceObjects = new List(); // : SET [1:?] OF IfcResourceObjectSelect; + + internal IfcExternalReference RelatingReference { get { return mDatabase.mIfcObjects[mRelatingReference] as IfcExternalReference; } } + internal List RelatedResourceObjects { get { return mRelatedResourceObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcResourceObjectSelect); } } + + //INVERSE + public List HasExternalReferences { get { return mHasExternalReferences; } } + internal List mHasExternalReferences = new List(); //IFC4 + internal IfcExternalReferenceRelationship() : base() { } + internal IfcExternalReferenceRelationship(IfcExternalReferenceRelationship i) : base(i) { mRelatingReference = i.mRelatingReference; mRelatedResourceObjects.AddRange(i.mRelatedResourceObjects); } + internal IfcExternalReferenceRelationship(DatabaseIfc m, string name, string description, IfcExternalReference reference, List related) + : base(m, name, description) { mRelatingReference = reference.mIndex; mRelatedResourceObjects = related.ConvertAll(x => x.Index); } + internal static IfcExternalReferenceRelationship Parse(string strDef, Schema schema) { IfcExternalReferenceRelationship m = new IfcExternalReferenceRelationship(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcExternalReferenceRelationship m, List arrFields, ref int ipos, Schema schema) + { + IfcResourceLevelRelationship.parseFields(m, arrFields, ref ipos,schema); + m.mRelatingReference = ParserSTEP.ParseLink(arrFields[ipos++]); + m.mRelatedResourceObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3) + return ""; + string result = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingReference) + ",(" + ParserSTEP.LinkToString(mRelatedResourceObjects[0]); + for (int icounter = 1; icounter < mRelatedResourceObjects.Count; icounter++) + result += "," + ParserSTEP.LinkToString(mRelatedResourceObjects[icounter]); + return result + ")"; + + } + internal void relate() + { + List ros = RelatedResourceObjects; + foreach (IfcResourceObjectSelect ro in ros) + ro.HasExternalReferences.Add(this); + IfcExternalReference er = mDatabase.mIfcObjects[mRelatingReference] as IfcExternalReference; + if (er != null) + er.mExternalReferenceForResources.Add(this); + } + } + public partial class IfcExternalSpatialElement : IfcExternalSpatialStructureElement, IfcSpaceBoundarySelect //NEW IFC4 + { + internal IfcExternalSpatialElementTypeEnum mPredefinedType = IfcExternalSpatialElementTypeEnum.NOTDEFINED; + //INVERSE + internal List mBoundedBy = new List(); // BoundedBy : SET [0:?] OF IfcRelExternalSpatialElementBoundary FOR RelatingExternalSpatialElement; + + public IfcExternalSpatialElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public List BoundedBy { get { return mBoundedBy; } } + + internal IfcExternalSpatialElement() : base() { } + internal IfcExternalSpatialElement(IfcExternalSpatialElement p) : base(p) { mPredefinedType = p.mPredefinedType; } + internal IfcExternalSpatialElement(IfcSite host, string name, IfcExternalSpatialElementTypeEnum te) + : base(host, name) { mPredefinedType = te; } + internal static void parseFields(IfcExternalSpatialElement gp, List arrFields, ref int ipos) + { + IfcSpatialStructureElement.parseFields(gp, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s[0] == '.') + gp.mPredefinedType = (IfcExternalSpatialElementTypeEnum)Enum.Parse(typeof(IfcExternalSpatialElementTypeEnum), s.Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + (mPredefinedType == IfcExternalSpatialElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + "."); } + internal static IfcExternalSpatialElement Parse(string strDef) { IfcExternalSpatialElement s = new IfcExternalSpatialElement(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public abstract partial class IfcExternalSpatialStructureElement : IfcSpatialElement // ABSTRACT SUPERTYPE OF(IfcExternalSpatialElement) + { + protected IfcExternalSpatialStructureElement() : base() { } + protected IfcExternalSpatialStructureElement(IfcExternalSpatialStructureElement p) : base(p) { } + protected IfcExternalSpatialStructureElement(DatabaseIfc m) : base(m) { } + protected IfcExternalSpatialStructureElement(IfcSite host, string name) : base(host, name) { } + protected static void parseFields(IfcExternalSpatialStructureElement s, List arrFields, ref int ipos) { IfcSpatialElement.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcExtrudedAreaSolid : IfcSweptAreaSolid // SUPERTYPE OF(IfcExtrudedAreaSolidTapered) + { + private int mExtrudedDirection;//: IfcDirection; + private double mDepth;// : IfcPositiveLengthMeasure; + + internal IfcDirection ExtrudedDirection { get { return mDatabase.mIfcObjects[mExtrudedDirection] as IfcDirection; } } + internal double Depth { get { return mDepth; } } + + internal IfcExtrudedAreaSolid() : base() { } + internal IfcExtrudedAreaSolid(IfcExtrudedAreaSolid p) : base(p) { mExtrudedDirection = p.mExtrudedDirection; mDepth = p.mDepth; } + public IfcExtrudedAreaSolid(IfcProfileDef prof, IfcAxis2Placement3D placement, IfcDirection dir, double depth) : base(prof, placement) { mExtrudedDirection = dir.mIndex; mDepth = depth; } + + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mExtrudedDirection) + "," + ParserSTEP.DoubleToString(mDepth)); } + internal static void parseFields(IfcExtrudedAreaSolid e, List arrFields, ref int ipos) { IfcSweptAreaSolid.parseFields(e, arrFields, ref ipos); e.mExtrudedDirection = ParserSTEP.ParseLink(arrFields[ipos++]); e.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcExtrudedAreaSolid Parse(string strDef) { IfcExtrudedAreaSolid e = new IfcExtrudedAreaSolid(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + } + public partial class IfcExtrudedAreaSolidTapered : IfcExtrudedAreaSolid + { + private int mEndSweptArea;//: IfcProfileDef + + internal IfcProfileDef EndSweptArea { get { return mDatabase.mIfcObjects[mEndSweptArea] as IfcProfileDef; } set { mEndSweptArea = value.mIndex; } } + + internal IfcExtrudedAreaSolidTapered() : base() { } + internal IfcExtrudedAreaSolidTapered(IfcExtrudedAreaSolidTapered p) : base(p) { mEndSweptArea = p.mEndSweptArea; } + public IfcExtrudedAreaSolidTapered(IfcParameterizedProfileDef start, IfcAxis2Placement3D placement, double depth, IfcParameterizedProfileDef end) : base(start, placement, new IfcDirection(start.mDatabase,0,0,1), depth) { EndSweptArea = end; } + public IfcExtrudedAreaSolidTapered(IfcDerivedProfileDef start, IfcAxis2Placement3D placement, double depth, IfcDerivedProfileDef end) : base(start, placement,new IfcDirection(start.mDatabase,0,0,1), depth ) { EndSweptArea = end; } + + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mEndSweptArea)); } + internal static void parseFields(IfcExtrudedAreaSolidTapered e, List arrFields, ref int ipos) { IfcExtrudedAreaSolid.parseFields(e, arrFields, ref ipos); e.mEndSweptArea = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal new static IfcExtrudedAreaSolidTapered Parse(string strDef) { IfcExtrudedAreaSolidTapered e = new IfcExtrudedAreaSolidTapered(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + } +} diff --git a/IFC/IFC F.cs b/IFC/IFC F.cs new file mode 100644 index 0000000..8dacc05 --- /dev/null +++ b/IFC/IFC F.cs @@ -0,0 +1,754 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcFace : IfcTopologicalRepresentationItem // SUPERTYPE OF(IfcFaceSurface) + { + internal List mBounds = new List();// : SET [1:?] OF IfcFaceBound; + internal List Bounds { get { return mBounds.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcFaceBound); } } + internal IfcFace() : base() { } + internal IfcFace(IfcFace i) : base(i) { mBounds = new List(i.mBounds.ToArray()); } + public IfcFace(IfcFaceOuterBound outer) : base(outer.mDatabase) { mBounds.Add(outer.mIndex); } + public IfcFace(IfcFaceOuterBound outer, IfcFaceBound inner) : this(outer) { mBounds.Add(inner.mIndex); } + internal IfcFace(List bounds) : base(bounds[0].mDatabase) { mBounds = bounds.ConvertAll(x => x.mIndex); } + internal static IfcFace Parse(string str) + { + IfcFace f = new IfcFace(); + int pos = 0; + f.mBounds = ParserSTEP.StripListLink(str, ref pos); + return f; + } + internal static void parseFields(IfcFace f, List arrFields, ref int ipos) { IfcTopologicalRepresentationItem.parseFields(f, arrFields, ref ipos); f.mBounds = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string str = base.BuildString() + ",("; + if (mBounds.Count > 0) + str += ParserSTEP.LinkToString(mBounds[0]); + for (int icounter = 1; icounter < mBounds.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mBounds[icounter]); + return str + ")"; + } + } + public partial class IfcFaceBasedSurfaceModel : IfcGeometricRepresentationItem + { + private List mFbsmFaces = new List();// : SET [1:?] OF IfcConnectedFaceSet; + public List FbsmFaces { get { return mFbsmFaces.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcConnectedFaceSet); } } + + internal IfcFaceBasedSurfaceModel() : base() { } + internal IfcFaceBasedSurfaceModel(IfcFaceBasedSurfaceModel p) : base(p) { mFbsmFaces = new List(p.mFbsmFaces.ToArray()); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mFbsmFaces[0]); + for (int icounter = 1; icounter < mFbsmFaces.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mFbsmFaces[icounter]); + return str + ")"; + } + internal static void parseFields(IfcFaceBasedSurfaceModel m, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(m, arrFields, ref ipos); m.mFbsmFaces = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcFaceBasedSurfaceModel Parse(string strDef) { IfcFaceBasedSurfaceModel m = new IfcFaceBasedSurfaceModel(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + } + public partial class IfcFaceBound : IfcTopologicalRepresentationItem //SUPERTYPE OF (ONEOF (IfcFaceOuterBound)) + { + internal int mBound;// : IfcLoop; + internal bool mOrientation = true;// : BOOLEAN; + internal IfcLoop Bound { get { return mDatabase.mIfcObjects[mBound] as IfcLoop; } } + internal IfcFaceBound() : base() { } + internal IfcFaceBound(IfcFaceBound i) : base(i) { mBound = i.mBound; mOrientation = i.mOrientation; } + public IfcFaceBound(IfcLoop l, bool orientation) : base(l.mDatabase) { mBound = l.mIndex; mOrientation = orientation; } + internal static IfcFaceBound Parse(string str) + { + IfcFaceBound b = new IfcFaceBound(); + int pos = 0; + parseString(b, str, ref pos); + return b; + } + protected static void parseString(IfcFaceBound b, string str, ref int pos) + { + b.mBound = ParserSTEP.StripLink(str, ref pos); + b.mOrientation = ParserSTEP.StripBool(str, ref pos); + } + internal static void parseFields(IfcFaceBound b, List arrFields, ref int ipos) + { + IfcTopologicalRepresentationItem.parseFields(b, arrFields, ref ipos); + b.mBound = ParserSTEP.ParseLink(arrFields[ipos++]); + b.mOrientation = ParserSTEP.ParseBool(arrFields[ipos++]); + } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + return base.BuildString() + "," + ParserSTEP.LinkToString(mBound) + "," + ParserSTEP.BoolToString(mOrientation); + } + } + public partial class IfcFaceOuterBound : IfcFaceBound + { + internal IfcFaceOuterBound() : base() { } + internal IfcFaceOuterBound(IfcFaceOuterBound i) : base(i) { } + public IfcFaceOuterBound(IfcLoop l, bool orientation) : base(l, orientation) { } + internal new static IfcFaceOuterBound Parse(string str) + { + IfcFaceOuterBound b = new IfcFaceOuterBound(); + int pos = 0; + parseString(b, str, ref pos); + return b; + } + } + public partial class IfcFaceSurface : IfcFace //SUPERTYPE OF(IfcAdvancedFace) + { + internal int mFaceSurface;// : IfcSurface; + internal bool mSameSense = true;// : BOOLEAN; + internal IfcSurface FaceSurface { get { return mDatabase.mIfcObjects[mFaceSurface] as IfcSurface; } } + internal IfcFaceSurface() : base() { } + internal IfcFaceSurface(IfcFaceSurface i) : base(i) { mFaceSurface = i.mFaceSurface; mSameSense = i.mSameSense; } + internal IfcFaceSurface(IfcFaceOuterBound bound, IfcSurface srf, bool sameSense) : base(bound) { mFaceSurface = srf.mIndex; mSameSense = sameSense; } + internal IfcFaceSurface(IfcFaceOuterBound outer, IfcFaceBound inner, IfcSurface srf, bool sameSense) : base(outer, inner) { mFaceSurface = srf.mIndex; mSameSense = sameSense; } + internal IfcFaceSurface(List bounds, IfcSurface srf, bool sameSense) + : base(bounds) { mFaceSurface = srf.mIndex; mSameSense = sameSense; } + internal new static IfcFaceSurface Parse(string strDef) { IfcFaceSurface s = new IfcFaceSurface(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcFaceSurface s, List arrFields, ref int ipos) { IfcFace.parseFields(s, arrFields, ref ipos); s.mFaceSurface = ParserSTEP.ParseLink(arrFields[ipos++]); s.mSameSense = ParserSTEP.ParseBool(arrFields[ipos]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mFaceSurface) + "," + ParserSTEP.BoolToString(mSameSense); } + } + public partial class IfcFacetedBrep : IfcManifoldSolidBrep + { + internal IfcFacetedBrep() : base() { } + internal IfcFacetedBrep(IfcFacetedBrep p) : base(p) { } + public IfcFacetedBrep(IfcClosedShell s) : base(s) { } + internal static IfcFacetedBrep Parse(string strDef) { IfcFacetedBrep b = new IfcFacetedBrep(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcFacetedBrep b, List arrFields, ref int ipos) { IfcManifoldSolidBrep.parseFields(b, arrFields, ref ipos); } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString()); } + } + public partial class IfcFacetedBrepWithVoids : IfcFacetedBrep + { + internal List mVoids = new List();// : SET [1:?] OF IfcClosedShell + internal IfcFacetedBrepWithVoids() : base() { } + internal IfcFacetedBrepWithVoids(IfcFacetedBrepWithVoids p) : base(p) { mVoids = new List(p.mVoids.ToArray()); } + internal new static IfcFacetedBrepWithVoids Parse(string strDef) { IfcFacetedBrepWithVoids b = new IfcFacetedBrepWithVoids(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcFacetedBrepWithVoids b, List arrFields, ref int ipos) { IfcManifoldSolidBrep.parseFields(b, arrFields, ref ipos); b.mVoids = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mVoids.Count > 0) + { + str += ParserSTEP.LinkToString(mVoids[0]); + for (int icounter = 1; icounter < mVoids.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mVoids[icounter]); + } + return str + ")"; + } + } + //ENTITY IfcFailureConnectionCondition + public class IfcFan : IfcFlowMovingDevice //IFC4 + { + internal IfcFanTypeEnum mPredefinedType = IfcFanTypeEnum.NOTDEFINED;// OPTIONAL : IfcFanTypeEnum; + public IfcFanTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFan() : base() { } + internal IfcFan(IfcFan f) : base(f) { mPredefinedType = f.mPredefinedType; } + internal IfcFan(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFan s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcFanTypeEnum)Enum.Parse(typeof(IfcFanTypeEnum), str); + } + internal new static IfcFan Parse(string strDef) { IfcFan s = new IfcFan(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcFanTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcFanType : IfcFlowMovingDeviceType + { + internal IfcFanTypeEnum mPredefinedType = IfcFanTypeEnum.NOTDEFINED;// : IfcFanTypeEnum; + public IfcFanTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFanType() : base() { } + internal IfcFanType(IfcFanType be) : base((IfcFlowMovingDeviceType)be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcFanType t, List arrFields, ref int ipos) { IfcFlowMovingDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcFanTypeEnum)Enum.Parse(typeof(IfcFanTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcFanType Parse(string strDef) { IfcFanType t = new IfcFanType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcFastener : IfcElementComponent + { + internal IfcFastenerTypeEnum mPredefinedType = IfcFastenerTypeEnum.NOTDEFINED;// : IfcFastenerTypeEnum; //IFC4 + public IfcFastenerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFastener() : base() { } + internal IfcFastener(IfcFastener f) : base(f) { mPredefinedType = f.mPredefinedType; } + internal IfcFastener(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static void parseFields(IfcFastener f, List arrFields, ref int ipos, Schema schema) + { + IfcElementComponent.parseFields(f, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + f.mPredefinedType = (IfcFastenerTypeEnum)Enum.Parse(typeof(IfcFastenerTypeEnum), arrFields[ipos++].Replace(".", "")); + } + internal static IfcFastener Parse(string strDef, Schema schema) { int ipos = 0; IfcFastener f = new IfcFastener(); parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return f; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcFastenerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcFastenerType : IfcElementComponentType + { + internal IfcFastenerTypeEnum mPredefinedType = IfcFastenerTypeEnum.NOTDEFINED;// : IfcFastenerTypeEnum; //IFC4 + public IfcFastenerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFastenerType() : base() { } + internal IfcFastenerType(IfcFastenerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcFastenerType(DatabaseIfc m, string name, IfcFastenerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static IfcFastenerType Parse(string strDef, Schema schema) { int ipos = 0; IfcFastenerType t = new IfcFastenerType(); parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return t; } + internal static void parseFields(IfcFastenerType t, List arrFields, ref int ipos, Schema schema) { IfcElementComponentType.parseFields(t, arrFields, ref ipos); if (schema != Schema.IFC2x3) t.mPredefinedType = (IfcFastenerTypeEnum)Enum.Parse(typeof(IfcFastenerTypeEnum), arrFields[ipos++].Replace(".", "")); } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType + "."); } + } + public abstract class IfcFeatureElement : IfcElement // ABSTRACT SUPERTYPE OF(ONEOF(IfcFeatureElementAddition, IfcFeatureElementSubtraction, IfcSurfaceFeature)) + { + protected IfcFeatureElement() : base() { } + protected IfcFeatureElement(IfcFeatureElement e) : base(e) { } + protected IfcFeatureElement(DatabaseIfc db) : base(db) { } + protected IfcFeatureElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + protected static void parseFields(IfcFeatureElement e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + } + public abstract partial class IfcFeatureElementAddition : IfcFeatureElement //ABSTRACT SUPERTYPE OF(IfcProjectionElement) + { //INVERSE + internal List mProjectsElements = new List(); + public List ProjectsElements { get { return mProjectsElements; } } + + protected IfcFeatureElementAddition() : base() { } + protected IfcFeatureElementAddition(IfcFeatureElementAddition el) : base(el) { } + protected static void parseFields(IfcFeatureElementAddition e, List arrFields, ref int ipos) { IfcFeatureElement.parseFields(e, arrFields, ref ipos); } + } + public abstract partial class IfcFeatureElementSubtraction : IfcFeatureElement //ABSTRACT SUPERTYPE OF (ONEOF (IfcOpeningElement ,IfcVoidingFeature)) + { //INVERSE + internal IfcRelVoidsElement mVoidsElement = null; + public IfcRelVoidsElement VoidsElement { get { return mVoidsElement; } } + + protected IfcFeatureElementSubtraction() : base() { } + protected IfcFeatureElementSubtraction(IfcFeatureElementSubtraction s) : base(s) { } + protected IfcFeatureElementSubtraction(DatabaseIfc db) : base(db) { } + protected IfcFeatureElementSubtraction(IfcElement host, IfcProductRepresentation rep) : base(host.mDatabase) + { + new IfcRelVoidsElement(host, this); + Representation = rep; + Placement = new IfcLocalPlacement(host.Placement, new IfcAxis2Placement3D(host.mDatabase)); + } + + protected static void parseFields(IfcFeatureElementSubtraction e, List arrFields, ref int ipos) { IfcFeatureElement.parseFields(e, arrFields, ref ipos); } + } + public class IfcFillAreaStyleHatching : IfcGeometricRepresentationItem + { + internal int mHatchLineAppearance;// : IfcCurveStyle; + internal string mStartOfNextHatchLine;// : IfcHatchLineDistanceSelect; + //IfcOneDirectionRepeatFacton,IfcPositiveLengthMeasure + internal int mPointOfReferenceHatchLine;// : OPTIONAL IfcCartesianPoint; //DEPRECEATED IFC4 + internal int mPatternStart;// : OPTIONAL IfcCartesianPoint; + internal double mHatchLineAngle;// : IfcPlaneAngleMeasure; + internal IfcFillAreaStyleHatching() : base() { } + internal IfcFillAreaStyleHatching(IfcFillAreaStyleHatching p) + : base(p) + { + mHatchLineAppearance = p.mHatchLineAppearance; + mStartOfNextHatchLine = p.mStartOfNextHatchLine; + mPointOfReferenceHatchLine = p.mPointOfReferenceHatchLine; + mPatternStart = p.mPatternStart; + mHatchLineAngle = p.mHatchLineAngle; + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mHatchLineAppearance) + "," + mStartOfNextHatchLine + "," + ParserSTEP.LinkToString(mPointOfReferenceHatchLine) + "," + ParserSTEP.LinkToString(mPatternStart) + "," + ParserSTEP.DoubleToString(mHatchLineAngle); } + internal static void parseFields(IfcFillAreaStyleHatching h, List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(h, arrFields, ref ipos); + h.mHatchLineAppearance = ParserSTEP.ParseLink(arrFields[ipos++]); + h.mStartOfNextHatchLine = arrFields[ipos++]; + h.mPointOfReferenceHatchLine = ParserSTEP.ParseLink(arrFields[ipos++]); + h.mPatternStart = ParserSTEP.ParseLink(arrFields[ipos++]); + h.mHatchLineAngle = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal static IfcFillAreaStyleHatching Parse(string strDef) { IfcFillAreaStyleHatching h = new IfcFillAreaStyleHatching(); int ipos = 0; parseFields(h, ParserSTEP.SplitLineFields(strDef), ref ipos); return h; } + } + //ENTITY IfcFillAreaStyleTileSymbolWithStyle // DEPRECEATED IFC4 + //ENTITY IfcFillAreaStyleTiles + public class IfcFilter : IfcFlowTreatmentDevice //IFC4 + { + internal IfcFilterTypeEnum mPredefinedType = IfcFilterTypeEnum.NOTDEFINED; + public IfcFilterTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcFilter() : base() { } + internal IfcFilter(IfcFilter f) : base(f) { mPredefinedType = f.mPredefinedType; } + internal IfcFilter(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcFilter a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcFilterTypeEnum)Enum.Parse(typeof(IfcFilterTypeEnum), s.Replace(".", "")); + } + internal new static IfcFilter Parse(string strDef) { IfcFilter d = new IfcFilter(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcFilterTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcFilterType : IfcFlowTreatmentDeviceType + { + internal IfcFilterTypeEnum mPredefinedType = IfcFilterTypeEnum.NOTDEFINED;// : IfcFilterTypeEnum; + internal IfcFilterType() : base() { } + internal IfcFilterType(IfcFilterType be) : base((IfcFlowTreatmentDeviceType)be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcFilterType t, List arrFields, ref int ipos) { IfcFlowTreatmentDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcFilterTypeEnum)Enum.Parse(typeof(IfcFilterTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcFilterType Parse(string strDef) { IfcFilterType t = new IfcFilterType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcFillAreaStyle : IfcPresentationStyle + { + internal List mFillStyles = new List();// : SET [1:?] OF IfcFillStyleSelect; + internal IfcFillAreaStyle() : base() { } + internal IfcFillAreaStyle(IfcFillAreaStyle i) : base(i) { mFillStyles = new List(i.mFillStyles.ToArray()); } + internal IfcFillAreaStyle(DatabaseIfc m, string name) : base(m, name) { } + internal static void parseFields(IfcFillAreaStyle s, List arrFields, ref int ipos) { IfcPresentationStyle.parseFields(s, arrFields, ref ipos); s.mFillStyles = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcFillAreaStyle Parse(string strDef) { IfcFillAreaStyle s = new IfcFillAreaStyle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mFillStyles[0]); + for (int icounter = 1; icounter < mFillStyles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mFillStyles[icounter]); + return str + ")"; + } + } + public interface IfcFillStyleSelect { } // SELECT ( IfcFillAreaStyleHatching, IfcFillAreaStyleTiles, IfcExternallyDefinedHatchStyle, IfcColour); + public class IfcFireSuppressionTerminal : IfcFlowTerminal //IFC4 + { + internal IfcFireSuppressionTerminalTypeEnum mPredefinedType = IfcFireSuppressionTerminalTypeEnum.NOTDEFINED;// OPTIONAL : IfcFireSuppressinTerminalTypeEnum; + public IfcFireSuppressionTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcFireSuppressionTerminal() : base() { } + internal IfcFireSuppressionTerminal(IfcFireSuppressionTerminal t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcFireSuppressionTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFireSuppressionTerminal s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcFireSuppressionTerminalTypeEnum)Enum.Parse(typeof(IfcFireSuppressionTerminalTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcFireSuppressionTerminal Parse(string strDef) { IfcFireSuppressionTerminal s = new IfcFireSuppressionTerminal(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcFireSuppressionTerminalTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcFireSuppressionTerminalType : IfcFlowTerminalType + { + internal IfcFireSuppressionTerminalTypeEnum mPredefinedType = IfcFireSuppressionTerminalTypeEnum.NOTDEFINED;// : IfcFireSuppressionTerminalTypeEnum; + public IfcFireSuppressionTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFireSuppressionTerminalType() : base() { } + internal IfcFireSuppressionTerminalType(IfcFireSuppressionTerminalType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcFireSuppressionTerminalType(DatabaseIfc m, string name, IfcFireSuppressionTerminalTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcFireSuppressionTerminalType t, List arrFields, ref int ipos) { IfcFlowTerminalType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcFireSuppressionTerminalTypeEnum)Enum.Parse(typeof(IfcFireSuppressionTerminalTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcFireSuppressionTerminalType Parse(string strDef) { IfcFireSuppressionTerminalType t = new IfcFireSuppressionTerminalType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcFixedReferenceSweptAreaSolid : IfcSweptAreaSolid //IFC4 + { + internal int mDirectrix; // : IfcCurve; + internal double mStartParam = 0;// : OPT IfcParameterValue; + internal double mEndParam = 0;//: OPT IfcParameterValue; + internal int mFixedReference;// : IfcDirection; + + internal IfcCurve Directrix { get { return mDatabase.mIfcObjects[mDirectrix] as IfcCurve; } } + internal IfcDirection FixedReference { get { return mDatabase.mIfcObjects[mFixedReference] as IfcDirection; } } + + internal IfcFixedReferenceSweptAreaSolid() : base() { } + internal IfcFixedReferenceSweptAreaSolid(IfcFixedReferenceSweptAreaSolid p) : base(p) { mDirectrix = p.mDirectrix; mStartParam = p.mStartParam; mEndParam = p.mEndParam; mFixedReference = p.mFixedReference; } + + internal static void parseFields(IfcFixedReferenceSweptAreaSolid s, List arrFields, ref int ipos) { IfcSweptAreaSolid.parseFields(s, arrFields, ref ipos); s.mDirectrix = ParserSTEP.ParseLink(arrFields[ipos++]); s.mStartParam = ParserSTEP.ParseDouble(arrFields[ipos++]); s.mEndParam = ParserSTEP.ParseDouble(arrFields[ipos++]); s.mFixedReference = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcFixedReferenceSweptAreaSolid Parse(string strDef) { IfcFixedReferenceSweptAreaSolid s = new IfcFixedReferenceSweptAreaSolid(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mDirectrix) + "," + ParserSTEP.DoubleToString(mStartParam) + "," + ParserSTEP.DoubleToString(mEndParam) + "," + ParserSTEP.LinkToString(mFixedReference); } + } + public class IfcFlowController : IfcDistributionFlowElement //SUPERTYPE OF(ONEOF(IfcAirTerminalBox, IfcDamper + { //, IfcElectricDistributionBoard, IfcElectricTimeControl, IfcFlowMeter, IfcProtectiveDevice, IfcSwitchingDevice, IfcValve)) + internal new enum SubTypes { IfcAirTerminalBox, IfcDamper, IfcElectricDistributionBoard, IfcElectricTimeControl, IfcFlowMeter, IfcProtectiveDevice, IfcSwitchingDevice, IfcValve } + + public override string KeyWord { get { return mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWCONTROLLER" : base.KeyWord; } } + + internal IfcFlowController() : base() { } + internal IfcFlowController(IfcFlowController c) : base(c) { } + internal IfcFlowController(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFlowController c, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(c, arrFields, ref ipos); } + internal new static IfcFlowController Parse(string strDef) { IfcFlowController c = new IfcFlowController(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public abstract class IfcFlowControllerType : IfcDistributionFlowElementType + { + protected IfcFlowControllerType() : base() { } + protected IfcFlowControllerType(IfcFlowControllerType t) : base(t) { } + protected IfcFlowControllerType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcFlowControllerType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcFlowFitting : IfcDistributionFlowElement //SUPERTYPE OF(ONEOF(IfcCableCarrierFitting, IfcCableFitting, IfcDuctFitting, IfcJunctionBox, IfcPipeFitting)) + { + internal new enum SubTypes { IfcCableCarrierFitting, IfcCableFitting, IfcDuctFitting, IfcJunctionBox, IfcPipeFitting } + + public override string KeyWord { get { return mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWFITTING" : base.KeyWord; } } + + internal IfcFlowFitting() : base() { } + internal IfcFlowFitting(IfcFlowFitting f) : base(f) { } + public IfcFlowFitting(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFlowFitting f, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(f, arrFields, ref ipos); } + internal new static IfcFlowFitting Parse(string strDef) { IfcFlowFitting f = new IfcFlowFitting(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + } + public abstract partial class IfcFlowFittingType : IfcDistributionFlowElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcCableCarrierFittingType ,IfcDuctFittingType ,IfcJunctionBoxType ,IfcPipeFittingType)) + { + protected IfcFlowFittingType() : base() { } + protected IfcFlowFittingType(IfcFlowFittingType t) : base(t) { } + protected IfcFlowFittingType(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcFlowFittingType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public class IfcFlowInstrument : IfcDistributionControlElement //IFC4 + { + internal IfcFlowInstrumentTypeEnum mPredefinedType = IfcFlowInstrumentTypeEnum.NOTDEFINED; + public IfcFlowInstrumentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcFlowInstrument() : base() { } + internal IfcFlowInstrument(IfcFlowInstrument i) : base(i) { mPredefinedType = i.mPredefinedType; } + internal IfcFlowInstrument(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcFlowInstrument a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcFlowInstrumentTypeEnum)Enum.Parse(typeof(IfcFlowInstrumentTypeEnum), s.Replace(".", "")); + } + internal new static IfcFlowInstrument Parse(string strDef) { IfcFlowInstrument d = new IfcFlowInstrument(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcFlowInstrumentTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcFlowInstrumentType : IfcDistributionControlElementType + { + internal IfcFlowInstrumentTypeEnum mPredefinedType = IfcFlowInstrumentTypeEnum.NOTDEFINED;// : IfcFlowInstrumentTypeEnum; + public IfcFlowInstrumentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFlowInstrumentType() : base() { } + internal IfcFlowInstrumentType(IfcFlowInstrumentType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcFlowInstrumentType(DatabaseIfc m, string name, IfcFlowInstrumentTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcFlowInstrumentType t, List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcFlowInstrumentTypeEnum)Enum.Parse(typeof(IfcFlowInstrumentTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcFlowInstrumentType Parse(string strDef) { IfcFlowInstrumentType t = new IfcFlowInstrumentType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcFlowMeter : IfcFlowController //IFC4 + { + internal IfcFlowMeterTypeEnum mPredefinedType = IfcFlowMeterTypeEnum.NOTDEFINED;// OPTIONAL : IfcDamperTypeEnum; + public IfcFlowMeterTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFlowMeter() : base() { } + internal IfcFlowMeter(IfcFlowMeter m) : base(m) { mPredefinedType = m.mPredefinedType; } + internal IfcFlowMeter(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFlowMeter s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcFlowMeterTypeEnum)Enum.Parse(typeof(IfcFlowMeterTypeEnum), str); + } + internal new static IfcFlowMeter Parse(string strDef) { IfcFlowMeter s = new IfcFlowMeter(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcFlowMeterTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcFlowMeterType : IfcFlowControllerType + { + internal IfcFlowMeterTypeEnum mPredefinedType = IfcFlowMeterTypeEnum.NOTDEFINED;// : IfcFlowMeterTypeEnum; + public IfcFlowMeterTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFlowMeterType() : base() { } + internal IfcFlowMeterType(IfcFlowMeterType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcFlowMeterType(DatabaseIfc m, string name, IfcFlowMeterTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcFlowMeterType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcFlowMeterTypeEnum)Enum.Parse(typeof(IfcFlowMeterTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcFlowMeterType Parse(string strDef) { IfcFlowMeterType t = new IfcFlowMeterType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcFlowMovingDevice : IfcDistributionFlowElement // SUPERTYPE OF(ONEOF(IfcCompressor, IfcFan, IfcPump)) + { + internal new enum SubTypes { IfcCompressor, IfcFan, IfcPump } + + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWMOVINGDEVICE" : base.KeyWord); } } + + internal IfcFlowMovingDevice() : base() { } + internal IfcFlowMovingDevice(IfcFlowMovingDevice be) : base((IfcDistributionFlowElement)be) { } + internal IfcFlowMovingDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFlowMovingDevice d, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(d, arrFields, ref ipos); } + internal new static IfcFlowMovingDevice Parse(string strDef) { IfcFlowMovingDevice d = new IfcFlowMovingDevice(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + } + public abstract class IfcFlowMovingDeviceType : IfcDistributionFlowElementType //ABSTRACT SUPERTYPE OF(ONEOF(IfcCompressorType, IfcFanType, IfcPumpType)) + { + protected IfcFlowMovingDeviceType() : base() { } + protected IfcFlowMovingDeviceType(IfcFlowMovingDeviceType t) : base(t) { } + protected IfcFlowMovingDeviceType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcFlowMovingDeviceType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public partial class IfcFlowSegment : IfcDistributionFlowElement // SUPERTYPE OF(ONEOF(IfcCableCarrierSegment, IfcCableSegment, IfcDuctSegment, IfcPipeSegment)) + { + internal new enum SubTypes { IfcCableCarrierSegment, IfcCableSegment, IfcDuctSegment, IfcPipeSegment } + + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWSEGMENT" : base.KeyWord); } } + + internal IfcFlowSegment() : base() { } + internal IfcFlowSegment(IfcFlowSegment s) : base(s) { } + public IfcFlowSegment(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFlowSegment s, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(s, arrFields, ref ipos); } + internal new static IfcFlowSegment Parse(string strDef) { IfcFlowSegment s = new IfcFlowSegment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public abstract partial class IfcFlowSegmentType : IfcDistributionFlowElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcCableCarrierSegmentType ,IfcCableSegmentType ,IfcDuctSegmentType ,IfcPipeSegmentType)) + { + protected IfcFlowSegmentType() : base() { } + protected IfcFlowSegmentType(IfcFlowSegmentType t) : base(t) { } + protected IfcFlowSegmentType(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcFlowSegmentType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public class IfcFlowStorageDevice : IfcDistributionFlowElement //SUPERTYPE OF(ONEOF(IfcElectricFlowStorageDevice, IfcTank)) + { + internal new enum SubTypes { IfcElectricFlowStorageDevice, IfcTank } + + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWSTORAGEDEVICE" : base.KeyWord); } } + + internal IfcFlowStorageDevice() : base() { } + internal IfcFlowStorageDevice(IfcFlowStorageDevice d) : base(d) { } + internal IfcFlowStorageDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcFlowStorageDevice d, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(d, arrFields, ref ipos); } + internal new static IfcFlowStorageDevice Parse(string strDef) { IfcFlowStorageDevice d = new IfcFlowStorageDevice(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + } + public abstract class IfcFlowStorageDeviceType : IfcDistributionFlowElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcElectricFlowStorageDeviceType ,IfcTankType)) + { + protected IfcFlowStorageDeviceType() : base() { } + protected IfcFlowStorageDeviceType(IfcFlowStorageDeviceType t) : base(t) { } + protected static void parseFields(IfcFlowStorageDeviceType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public class IfcFlowTerminal : IfcDistributionFlowElement //SUPERTYPE OF(ONEOF(IfcAirTerminal, IfcAudioVisualAppliance, IfcCommunicationsAppliance, IfcElectricAppliance, IfcFireSuppressionTerminal, IfcLamp, IfcLightFixture, IfcMedicalDevice, IfcOutlet, IfcSanitaryTerminal, IfcSpaceHeater, IfcStackTerminal, IfcWasteTerminal)) + { + internal new enum SubTypes { IfcAirTerminal, IfcAudioVisualAppliance, IfcCommunicationsAppliance, IfcElectricAppliance, IfcFireSuppressionTerminal, IfcLamp, IfcLightFixture, IfcMedicalDevice, IfcOutlet, IfcSanitaryTerminal, IfcSpaceHeater, IfcStackTerminal, IfcWasteTerminal } + + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWTERMINAL" : base.KeyWord); } } + + internal IfcFlowTerminal() : base() { } + internal IfcFlowTerminal(IfcFlowTerminal t) : base(t) { } + public IfcFlowTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcFlowTerminal t, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(t, arrFields, ref ipos); } + internal new static IfcFlowTerminal Parse(string strDef) { IfcFlowTerminal t = new IfcFlowTerminal(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public abstract partial class IfcFlowTerminalType : IfcDistributionFlowElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcAirTerminalType , + { // IfcElectricApplianceType ,IfcElectricHeaterType ,IfcFireSuppressionTerminalType,IfcLampType ,IfcLightFixtureType ,IfcOutletType ,IfcSanitaryTerminalType ,IfcStackTerminalType ,IfcWasteTerminalType)) + // IFC4 deleted ,IfcGasTerminalType + protected IfcFlowTerminalType() : base() { } + protected IfcFlowTerminalType(IfcFlowTerminalType t) : base(t) { } + protected IfcFlowTerminalType(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcFlowTerminalType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public class IfcFlowTreatmentDevice : IfcDistributionFlowElement // SUPERTYPE OF(ONEOF(IfcDuctSilencer, IfcFilter, IfcInterceptor)) + { + internal new enum SubTypes { IfcDuctSilencer, IfcFilter, IfcInterceptor } //"IFCFLOWTREATMENTDEVICE" + + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCFLOWTREATMENTDEVICE" : base.KeyWord); } } + + internal IfcFlowTreatmentDevice() : base() { } + internal IfcFlowTreatmentDevice(IfcFlowTreatmentDevice d) : base(d) { } + internal IfcFlowTreatmentDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcFlowTreatmentDevice d, List arrFields, ref int ipos) { IfcDistributionFlowElement.parseFields(d, arrFields, ref ipos); } + internal new static IfcFlowTreatmentDevice Parse(string strDef) { IfcFlowTreatmentDevice d = new IfcFlowTreatmentDevice(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + } + public abstract class IfcFlowTreatmentDeviceType : IfcDistributionFlowElementType //ABSTRACT SUPERTYPE OF(ONEOF(IfcDuctSilencerType, IfcFilterType, IfcInterceptorType)) + { + protected IfcFlowTreatmentDeviceType() : base() { } + protected IfcFlowTreatmentDeviceType(IfcFlowTreatmentDeviceType be) : base(be) { } + protected static void parseFields(IfcFlowTreatmentDeviceType t, List arrFields, ref int ipos) { IfcDistributionFlowElementType.parseFields(t, arrFields, ref ipos); } + } + public class IfcFluidFlowProperties : IfcPropertySetDefinition // DEPRECEATED IFC4 + { + internal IfcPropertySourceEnum mPropertySource;// : IfcPropertySourceEnum; + internal int mFlowConditionTimeSeries, mVelocityTimeSeries, mFlowrateTimeSeries;// : OPTIONAL IfcTimeSeries; + internal int mFluid;// : IfcMaterial; + internal int mPressureTimeSeries;// : OPTIONAL IfcTimeSeries; + internal string mUserDefinedPropertySource = "$";// : OPTIONAL IfcLabel; + internal int mTemperatureSingleValue, mWetBulbTemperatureSingleValue;// : OPTIONAL IfcThermodynamicTemperatureMeasure; + internal int mWetBulbTemperatureTimeSeries, mTemperatureTimeSeries;// : OPTIONAL IfcTimeSeries; + internal int mFlowrateSingleValue;// : OPTIONAL IfcDerivedMeasureValue; + internal int mFlowConditionSingleValue;// : OPTIONAL IfcPositiveRatioMeasure; + internal int mVelocitySingleValue;// : OPTIONAL IfcLinearVelocityMeasure; + internal int mPressureSingleValue;// : OPTIONAL IfcPressureMeasure; + internal IfcFluidFlowProperties() : base() { } + internal IfcFluidFlowProperties(IfcFluidFlowProperties p) + : base(p) + { + mPropertySource = p.mPropertySource; + mFlowConditionTimeSeries = p.mFlowConditionTimeSeries; + mVelocityTimeSeries = p.mVelocityTimeSeries; + mFlowrateTimeSeries = p.mFlowrateTimeSeries; + mFluid = p.mFluid; + mPressureTimeSeries = p.mPressureTimeSeries; + mUserDefinedPropertySource = p.mUserDefinedPropertySource; + mTemperatureSingleValue = p.mTemperatureSingleValue; + mWetBulbTemperatureSingleValue = p.mWetBulbTemperatureSingleValue; + mWetBulbTemperatureTimeSeries = p.mWetBulbTemperatureTimeSeries; + mTemperatureTimeSeries = p.mTemperatureTimeSeries; + mFlowrateSingleValue = p.mFlowrateSingleValue; + mFlowConditionSingleValue = p.mFlowConditionSingleValue; + mVelocitySingleValue = p.mVelocitySingleValue; + mPressureSingleValue = p.mPressureSingleValue; + } + internal static IfcFluidFlowProperties Parse(string strDef) { IfcFluidFlowProperties p = new IfcFluidFlowProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcFluidFlowProperties p, List arrFields, ref int ipos) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mPropertySource = (IfcPropertySourceEnum)Enum.Parse(typeof(IfcPropertySourceEnum), arrFields[ipos++].Replace(".", "")); + p.mFlowConditionTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mVelocityTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mFlowrateTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mFluid = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mPressureTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mUserDefinedPropertySource = arrFields[ipos++]; + p.mTemperatureSingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mWetBulbTemperatureSingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mWetBulbTemperatureTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mTemperatureTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mFlowrateSingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mFlowConditionSingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mVelocitySingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mPressureSingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); + + } + protected override string BuildString() + { + return base.BuildString() + ",." + mPropertySource.ToString() + ".," + ParserSTEP.LinkToString(mFlowConditionTimeSeries) + "," + ParserSTEP.LinkToString(mVelocityTimeSeries) + "," + ParserSTEP.LinkToString(mFlowrateTimeSeries) + + "," + ParserSTEP.LinkToString(mFluid) + "," + ParserSTEP.LinkToString(mPressureTimeSeries) + "," + mUserDefinedPropertySource + "," + ParserSTEP.LinkToString(mTemperatureSingleValue) + + "," + ParserSTEP.LinkToString(mWetBulbTemperatureSingleValue) + "," + ParserSTEP.LinkToString(mWetBulbTemperatureTimeSeries) + "," + ParserSTEP.LinkToString(mTemperatureTimeSeries) + "," + ParserSTEP.LinkToString(mFlowrateSingleValue) + + "," + ParserSTEP.LinkToString(mFlowConditionSingleValue) + "," + ParserSTEP.LinkToString(mVelocitySingleValue) + "," + ParserSTEP.LinkToString(mPressureSingleValue); + } + } + public partial class IfcFooting : IfcBuildingElement + { + internal IfcFootingTypeEnum mPredefinedType = IfcFootingTypeEnum.NOTDEFINED;// OPTIONAL : IfcFootingTypeEnum; + public IfcFootingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcFooting() : base() { } + internal IfcFooting(IfcFooting b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcFooting(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcFooting Parse(string strDef) { IfcFooting f = new IfcFooting(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + internal static void parseFields(IfcFooting f, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(f, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + f.mPredefinedType = (IfcFootingTypeEnum)Enum.Parse(typeof(IfcFootingTypeEnum), str.Substring(1, str.Length - 2)); + } + } + public partial class IfcFootingType : IfcBuildingElementType + { + internal IfcFootingTypeEnum mPredefinedType = IfcFootingTypeEnum.NOTDEFINED; + public IfcFootingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcFootingType() : base() { } + internal IfcFootingType(IfcFootingType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcFootingType(DatabaseIfc m, string name, IfcFootingTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + + internal static void parseFields(IfcFootingType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcFootingTypeEnum)Enum.Parse(typeof(IfcFootingTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcFootingType Parse(string strDef) { IfcFootingType t = new IfcFootingType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + + } + //ENTITY IfcFuelProperties // DEPRECEATED IFC4 + public partial class IfcFurnishingElement : IfcElement // DEPRECEATED IFC4 to make abstract SUPERTYPE OF(ONEOF(IfcFurniture, IfcSystemFurnitureElement)) + { + internal new enum SubTypes { IfcFurniture, IfcSystemFurnitureElement } + + internal IfcFurnishingElement() : base() { } + internal IfcFurnishingElement(IfcFurnishingElement f) : base(f) { } + internal IfcFurnishingElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static void parseFields(IfcFurnishingElement e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + internal static IfcFurnishingElement Parse(string strDef) { IfcFurnishingElement e = new IfcFurnishingElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + } + public class IfcFurnishingElementType : IfcElementType //IFC4 Depreceated //SUPERTYPE OF (ONEOF (IfcFurnitureType ,IfcSystemFurnitureElementType)) + { + internal IfcFurnishingElementType() : base() { } + internal IfcFurnishingElementType(IfcFurnishingElementType t) : base(t) { } + internal IfcFurnishingElementType(DatabaseIfc db,string name) : base(db) { Name = name; } + internal static void parseFields(IfcFurnishingElementType t, List arrFields, ref int ipos) { IfcElementType.parseFields(t, arrFields, ref ipos); } + internal new static IfcFurnishingElementType Parse(string strDef) { IfcFurnishingElementType t = new IfcFurnishingElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public partial class IfcFurniture : IfcFurnishingElement + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCFURNISHINGELEMENT" : base.KeyWord); } } + internal IfcFurnitureTypeEnum mPredefinedType = IfcFurnitureTypeEnum.NOTDEFINED;//: OPTIONAL IfcFurnitureTypeEnum; + internal IfcFurniture() : base() { } + internal IfcFurniture(IfcFurniture f) : base(f) { mPredefinedType = f.mPredefinedType; } + internal IfcFurniture(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static void parseFields(IfcFurniture e, List arrFields, ref int ipos) + { + IfcFurnishingElement.parseFields(e, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + e.mPredefinedType = (IfcFurnitureTypeEnum)Enum.Parse(typeof(IfcFurnitureTypeEnum), s.Replace(".", "")); + } + internal new static IfcFurniture Parse(string strDef) { IfcFurniture e = new IfcFurniture(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType + "."); } + } + internal class IfcFurnitureStandard : IfcControl // DEPRECEATED IFC4 + { + internal IfcFurnitureStandard() : base() { } + internal IfcFurnitureStandard(IfcFurnitureStandard i) : base((IfcControl)i) { } + internal static IfcFurnitureStandard Parse(string strDef, Schema schema) { IfcFurnitureStandard s = new IfcFurnitureStandard(); int ipos = 0; IfcControl.parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return s; } + } + public partial class IfcFurnitureType : IfcFurnishingElementType + { + internal IfcAssemblyPlaceEnum mAssemblyPlace = IfcAssemblyPlaceEnum.NOTDEFINED; + internal IfcFurnitureTypeEnum mPredefinedType = IfcFurnitureTypeEnum.NOTDEFINED; // IFC4 OPTIONAL + internal IfcFurnitureType() : base() { } + internal IfcFurnitureType(IfcFurnitureType be) : base(be) { } + internal IfcFurnitureType(DatabaseIfc m, string name, IfcAssemblyPlaceEnum a, IfcFurnitureTypeEnum type) + : base(m,name) + { + mAssemblyPlace = a; + mPredefinedType = type; + if (mDatabase.mSchema == Schema.IFC2x3 && string.IsNullOrEmpty(ElementType) && type != IfcFurnitureTypeEnum.NOTDEFINED) + ElementType = type.ToString(); + } + + internal static void parseFields(IfcFurnitureType t, List arrFields, ref int ipos,Schema schema) + { + IfcFurnishingElementType.parseFields(t, arrFields, ref ipos); + t.mAssemblyPlace = (IfcAssemblyPlaceEnum)Enum.Parse(typeof(IfcAssemblyPlaceEnum), arrFields[ipos++].Replace(".", "")); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + t.mPredefinedType = (IfcFurnitureTypeEnum)Enum.Parse(typeof(IfcFurnitureTypeEnum), s.Replace(".", "")); + } + } + internal static IfcFurnitureType Parse(string strDef, Schema schema) { IfcFurnitureType t = new IfcFurnitureType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mAssemblyPlace.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "." : ".,." + mPredefinedType + "."); } + } +} diff --git a/IFC/IFC G.cs b/IFC/IFC G.cs new file mode 100644 index 0000000..226eff5 --- /dev/null +++ b/IFC/IFC G.cs @@ -0,0 +1,385 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcGasTerminalType : IfcFlowTerminalType // DEPRECEATED IFC4 + { + internal IfcGasTerminalTypeEnum mPredefinedType = IfcGasTerminalTypeEnum.NOTDEFINED;// : IfcGasTerminalBoxTypeEnum; + internal IfcGasTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcGasTerminalType() : base() { } + internal IfcGasTerminalType(IfcGasTerminalType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcGasTerminalType(DatabaseIfc m, string name, IfcGasTerminalTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcGasTerminalType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcGasTerminalTypeEnum)Enum.Parse(typeof(IfcGasTerminalTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcGasTerminalType Parse(string strDef) { IfcGasTerminalType t = new IfcGasTerminalType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcGeneralMaterialProperties : IfcMaterialPropertiesSuperSeded // DEPRECEATED IFC4 + { + internal double mMolecularWeight; //: OPTIONAL IfcMolecularWeightMeasure; + internal double mPorosity; //: OPTIONAL IfcNormalisedRatioMeasure; + internal double mMassDensity;//OPTIONAL IfcMassDensityMeasure + internal IfcGeneralMaterialProperties() : base() { } + internal IfcGeneralMaterialProperties(IfcGeneralMaterialProperties el) : base(el) { mMolecularWeight = el.mMolecularWeight; mPorosity = el.mPorosity; mMassDensity = el.mMassDensity; } + internal IfcGeneralMaterialProperties(IfcMaterial mat, double molecularWeight, double porosity, double massDensity) : base(mat) + { + mMolecularWeight = molecularWeight; + mPorosity = porosity; + mMassDensity = massDensity; + } + internal static IfcGeneralMaterialProperties Parse(string strDef) { IfcGeneralMaterialProperties p = new IfcGeneralMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcGeneralMaterialProperties p, List arrFields, ref int ipos) { IfcMaterialPropertiesSuperSeded.parseFields(p, arrFields, ref ipos); p.mMolecularWeight = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mPorosity = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mMassDensity = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mMolecularWeight) + "," + ParserSTEP.DoubleOptionalToString(mPorosity) + "," + ParserSTEP.DoubleOptionalToString(mMassDensity); } + } + public class IfcGeneralProfileProperties : IfcProfileProperties //DELETED IFC4 SUPERTYPE OF (IfcStructuralProfileProperties) + { + internal double mPhysicalWeight;// : OPTIONAL IfcMassPerLengthMeasure; + internal double mPerimeter;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mMinimumPlateThickness;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mMaximumPlateThickness;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mCrossSectionArea;// : OPTIONAL IfcAreaMeasure; + internal IfcGeneralProfileProperties() : base() { } + internal IfcGeneralProfileProperties(IfcGeneralProfileProperties p) : base(p) { mPhysicalWeight = p.mPhysicalWeight; mPerimeter = p.mPerimeter; mMinimumPlateThickness = p.mMinimumPlateThickness; mMaximumPlateThickness = p.mMaximumPlateThickness; mCrossSectionArea = p.mCrossSectionArea; } + internal IfcGeneralProfileProperties(string name, IfcProfileDef p) : base(name, p) { } + internal IfcGeneralProfileProperties(string name, List props, IfcProfileDef p) : base(name, props, p) { } + + internal static IfcGeneralProfileProperties Parse(string strDef) { IfcGeneralProfileProperties p = new IfcGeneralProfileProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcGeneralProfileProperties gp, List arrFields, ref int ipos,Schema schema) + { + IfcProfileProperties.parseFields(gp, arrFields, ref ipos,schema); + gp.mPhysicalWeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mPerimeter = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mMinimumPlateThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mMaximumPlateThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return (mDatabase.mSchema != Schema.IFC2x3 ? "" : base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mPhysicalWeight) + "," + ParserSTEP.DoubleOptionalToString(mPerimeter) + "," + ParserSTEP.DoubleOptionalToString(mMinimumPlateThickness) + "," + ParserSTEP.DoubleOptionalToString(mMaximumPlateThickness) + "," + ParserSTEP.DoubleOptionalToString(mCrossSectionArea)); } + } + public partial class IfcGeographicElement : IfcElement //IFC4 + { + internal IfcGeographicElementTypeEnum mPredefinedType = IfcGeographicElementTypeEnum.NOTDEFINED;// OPTIONAL IfcGeographicElementTypeEnum; + public IfcGeographicElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcGeographicElement() : base() { } + internal IfcGeographicElement(IfcGeographicElement e) : base(e) { mPredefinedType = e.mPredefinedType; } + internal IfcGeographicElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " only supported in IFC4!"); } + + internal static IfcGeographicElement Parse(string strDef) { IfcGeographicElement e = new IfcGeographicElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcGeographicElement e, List arrFields, ref int ipos) + { + IfcElement.parseFields(e, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + e.mPredefinedType = (IfcGeographicElementTypeEnum)Enum.Parse(typeof(IfcGeographicElementTypeEnum), s.Replace(".", "")); + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType + "."); } + } + public partial class IfcGeographicElementType : IfcElementType //IFC4 + { + internal IfcGeographicElementTypeEnum mPredefinedType = IfcGeographicElementTypeEnum.NOTDEFINED;// IfcGeographicElementTypeEnum; + internal IfcGeographicElementType() : base() { } + internal IfcGeographicElementType(IfcGeographicElementType o) : base(o) { mPredefinedType = o.mPredefinedType; } + internal IfcGeographicElementType(DatabaseIfc m, string name, IfcGeographicElementTypeEnum type) : base(m) { Name = name; mPredefinedType = type; if (m.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " only supported in IFC4!"); } + internal new static IfcGeographicElementType Parse(string strDef) { IfcGeographicElementType t = new IfcGeographicElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcGeographicElementType t, List arrFields, ref int ipos) + { + IfcElementType.parseFields(t, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + t.mPredefinedType = (IfcGeographicElementTypeEnum)Enum.Parse(typeof(IfcGeographicElementTypeEnum), s.Replace(".", "")); + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public class IfcGeometricCurveSet : IfcGeometricSet + { + internal IfcGeometricCurveSet() : base() { } + internal IfcGeometricCurveSet(IfcGeometricCurveSet p) : base(p) { } + internal IfcGeometricCurveSet(List set) : base(set) + { + for (int icounter = 0; icounter < set.Count; icounter++) + { + IfcSurface s = set[icounter] as IfcSurface; + if (s != null) + throw new Exception("XXX Error, IfcSurface cannot be added to IfcGeometricCurveSet " + mIndex); + } + } + internal static void parseFields(IfcGeometricCurveSet s, List arrFields, ref int ipos) { IfcGeometricSet.parseFields(s, arrFields, ref ipos); } + internal new static IfcGeometricCurveSet Parse(string strDef) { IfcGeometricCurveSet s = new IfcGeometricCurveSet(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public partial class IfcGeometricRepresentationContext : IfcRepresentationContext, IfcCoordinateReferenceSystemSelect + { + internal int mCoordinateSpaceDimension;// : IfcDimensionCount; + internal double mPrecision = 1e-8;// : OPTIONAL REAL; + internal int mWorldCoordinateSystem;// : IfcAxis2Placement; + internal int mTrueNorth;// : OPTIONAL IfcDirection; + //INVERSE + private List mHasSubContexts = new List();// : SET OF IfcGeometricRepresentationSubContext FOR ParentContext; + private IfcCoordinateOperation mHasCoordinateOperation = null; //IFC4 + + public int CoordinateSpaceDimension { get { return mCoordinateSpaceDimension; } set { mCoordinateSpaceDimension = value; } } + public double Precision { get { return mPrecision; } set { mPrecision = value; } } + public IfcAxis2Placement WorldCoordinateSystem { get { return mDatabase.mIfcObjects[mWorldCoordinateSystem] as IfcAxis2Placement; } set { mWorldCoordinateSystem = (value == null ? 0 : value.Index); } } + public IfcDirection TrueNorth + { + get { return mDatabase.mIfcObjects[mTrueNorth] as IfcDirection; } + set + { + if (value == null) + mTrueNorth = 0; + else + { + if (Math.Abs(value.CoordinateZ) > mDatabase.Tolerance) + throw new Exception("True North direction must be 2 dimensional direction"); + mTrueNorth = value.mIndex; + } + } + } + public List HasSubContexts { get { return mHasSubContexts; } } + public IfcCoordinateOperation HasCoordinateOperation { get { return mHasCoordinateOperation; } set { mHasCoordinateOperation = value; } } + + + internal IfcGeometricRepresentationContext() : base() { } + internal IfcGeometricRepresentationContext(IfcGeometricRepresentationContext p) : base(p) { mCoordinateSpaceDimension = p.mCoordinateSpaceDimension; mPrecision = p.mPrecision; mTrueNorth = p.mTrueNorth; } + protected IfcGeometricRepresentationContext(DatabaseIfc m) : base(m) { } + internal IfcGeometricRepresentationContext(DatabaseIfc m, int SpaceDimension, double precision) + : base(m) + { + mCoordinateSpaceDimension = SpaceDimension; + mPrecision = Math.Max(1e-8, precision); + WorldCoordinateSystem = mDatabase.WorldCoordinatePlacement; + } + + internal static void parseFields(IfcGeometricRepresentationContext c, List arrFields, ref int ipos) + { + IfcRepresentationContext.parseFields(c, arrFields, ref ipos); + c.mCoordinateSpaceDimension = ParserSTEP.ParseInt(arrFields[ipos++]); + c.mPrecision = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mWorldCoordinateSystem = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mTrueNorth = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() + { + if (this as IfcGeometricRepresentationSubContext != null) + return base.BuildString() + ",*,*,*,*"; + + return base.BuildString() + "," + (mCoordinateSpaceDimension == 0 ? "*" : mCoordinateSpaceDimension.ToString()) + "," + (mPrecision == 0 ? "*" : ParserSTEP.DoubleToString(mPrecision)) + "," + ParserSTEP.LinkToString(mWorldCoordinateSystem) + "," + ParserSTEP.LinkToString(mTrueNorth); + } + internal static IfcGeometricRepresentationContext Parse(string strDef) { IfcGeometricRepresentationContext c = new IfcGeometricRepresentationContext(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public abstract partial class IfcGeometricRepresentationItem : IfcRepresentationItem //ABSTRACT SUPERTYPE OF (ONEOF (IfcAnnotationFillArea ,IfcAnnotationSurface >,IfcBooleanResult >,IfcBoundingBox >,IfcCartesianTransformationOperator + { // >,IfcCompositeCurveSegment >,IfcCsgPrimitive3D >,IfcCurve ,IfcDefinedSymbol >,IfcDirection >,IfcDraughtingCallout >,IfcFaceBasedSurfaceModel ,IfcFillAreaStyleHatching ,IfcFillAreaStyleTileSymbolWithStyle ,IfcFillAreaStyleTiles + //>,IfcGeometricSet >,IfcHalfSpaceSolid ,IfcLightSource >,IfcOneDirectionRepeatFactor >,IfcPlacement >,IfcPlanarExtent >,IfcPoint >,IfcSectionedSpine >,IfcShellBasedSurfaceModel >,IfcSolidModel >,IfcSurface ,IfcTextLiteral >,IfcVector))*/ + protected IfcGeometricRepresentationItem() : base() { } + protected IfcGeometricRepresentationItem(IfcGeometricRepresentationItem p) : base(p) { } + protected IfcGeometricRepresentationItem(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcGeometricRepresentationItem i, List arrFields, ref int ipos) { IfcRepresentationItem.parseFields(i, arrFields, ref ipos); } + protected override void Parse(string str, ref int ipos) { base.Parse(str, ref ipos); } + } + public class IfcGeometricRepresentationSubContext : IfcGeometricRepresentationContext + { + internal int mContainerContext;// : IfcGeometricRepresentationContext; + internal double mTargetScale;// : OPTIONAL IfcPositiveRatioMeasure; + private IfcGeometricProjectionEnum mTargetView;// : IfcGeometricProjectionEnum; + internal string mUserDefinedTargetView = "$";// : OPTIONAL IfcLabel; + + internal IfcGeometricProjectionEnum TargetView { get { return mTargetView; } } + public string UserDefinedTargetView { get { return (mUserDefinedTargetView == "$" ? "" : ParserIfc.Decode(mUserDefinedTargetView)); } set { mUserDefinedTargetView = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcGeometricRepresentationSubContext() : base() { } + internal IfcGeometricRepresentationSubContext(IfcGeometricRepresentationSubContext p) + : base(p) + { + mContainerContext = p.mContainerContext; + mTargetScale = p.mTargetScale; + mTargetView = p.mTargetView; + mUserDefinedTargetView = p.mUserDefinedTargetView; + } + internal IfcGeometricRepresentationSubContext(IfcGeometricRepresentationContext container, double scale, IfcGeometricProjectionEnum view) + : base(container.mDatabase) + { + mContainerContext = container.mIndex; + mContextType = container.mContextType; + mTargetScale = scale; + mTargetView = view; + } + internal static void parseFields(IfcGeometricRepresentationSubContext c, List arrFields, ref int ipos) + { + IfcGeometricRepresentationContext.parseFields(c, arrFields, ref ipos); + c.mContainerContext = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mTargetScale = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mTargetView = (IfcGeometricProjectionEnum)Enum.Parse(typeof(IfcGeometricProjectionEnum), arrFields[ipos++].Replace(".", "")); + c.mUserDefinedTargetView = arrFields[ipos++]; + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mContainerContext) + "," + ParserSTEP.DoubleOptionalToString(mTargetScale) + ",." + mTargetView.ToString() + (mUserDefinedTargetView == "$" ? ".,$" : ".,'" + mUserDefinedTargetView + "'"); } + internal new static IfcGeometricRepresentationSubContext Parse(string strDef) { IfcGeometricRepresentationSubContext c = new IfcGeometricRepresentationSubContext(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal void relate() + { + IfcGeometricRepresentationContext gc = mDatabase.mIfcObjects[mContainerContext] as IfcGeometricRepresentationContext; + if (gc != null) + { + mActive = gc.Active; + gc.HasSubContexts.Add(this); + } + } + } + public partial class IfcGeometricSet : IfcGeometricRepresentationItem //SUPERTYPE OF(IfcGeometricCurveSet) + { + private List mElements = new List(); //SET [1:?] OF IfcGeometricSetSelect; + internal List Elements { get { return mElements.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcGeometricSetSelect); } } + internal IfcGeometricSet() : base() { } + internal IfcGeometricSet(IfcGeometricSet p) : base(p) { mElements = new List(p.mElements.ToArray()); } + internal IfcGeometricSet(List set) : base(set[0].Database) { mElements = set.ConvertAll(x => x.Index); } + protected override string BuildString() + { + if (mElements.Count == 0) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mElements[0]); + for (int icounter = 1; icounter < mElements.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mElements[icounter]); + return str + ")"; + } + internal static void parseFields(IfcGeometricSet s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); s.mElements = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcGeometricSet Parse(string strDef) { IfcGeometricSet s = new IfcGeometricSet(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public partial interface IfcGeometricSetSelect : IfcInterface { } //SELECT ( IfcPoint, IfcCurve, IfcSurface); + public partial class IfcGrid : IfcProduct + { + private List mUAxes = new List();// : LIST [1:?] OF UNIQUE IfcGridAxis; + private List mVAxes = new List();// : LIST [1:?] OF UNIQUE IfcGridAxis; + private List mWAxes = new List();// : OPTIONAL LIST [1:?] OF UNIQUE IfcGridAxis; + internal IfcGridTypeEnum mPredefinedType = IfcGridTypeEnum.NOTDEFINED;// :OPTIONAL IfcGridTypeEnum; + //INVERSE + internal IfcRelContainedInSpatialStructure mContainedInStructure = null; + + internal IfcGridTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal List UAxes { get { return mUAxes.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcGridAxis); } } + internal List VAxes { get { return mVAxes.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcGridAxis); } } + internal List WAxes { get { return mWAxes.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcGridAxis); } } + + internal IfcGrid() : base() { } + internal IfcGrid(IfcGrid g) : base(g) { mUAxes = new List(g.mUAxes.ToArray()); mVAxes = new List(g.mVAxes.ToArray()); mWAxes = new List(g.mWAxes.ToArray()); mPredefinedType = g.mPredefinedType; } + + internal static IfcGrid Parse(string strDef, Schema schema) { IfcGrid g = new IfcGrid(); int ipos = 0; parseFields(g, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return g; } + internal static void parseFields(IfcGrid g, List arrFields, ref int ipos, Schema schema) + { + IfcProduct.parseFields(g, arrFields, ref ipos); + g.mUAxes = ParserSTEP.SplitListLinks(arrFields[ipos++]); + g.mVAxes = ParserSTEP.SplitListLinks(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s != "$") + g.mWAxes = ParserSTEP.SplitListLinks(s); + if (schema != Schema.IFC2x3) + { + s = arrFields[ipos++]; + if (s[0] == '.') + g.mPredefinedType = (IfcGridTypeEnum)Enum.Parse(typeof(IfcGridTypeEnum), s.Replace(".", "")); + } + } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mUAxes.Count > 0) + { + str += ParserSTEP.LinkToString(mUAxes[0]); + for (int icounter = 1; icounter < mUAxes.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mUAxes[icounter]); + } + str += "),("; + if (mVAxes.Count > 0) + { + str += ParserSTEP.LinkToString(mVAxes[0]); + for (int icounter = 1; icounter < mVAxes.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mVAxes[icounter]); + } + str += "),"; + if (mWAxes.Count > 0) + { + str += "(" + ParserSTEP.LinkToString(mWAxes[0]); + for (int icounter = 1; icounter < mWAxes.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mWAxes[icounter]); + return str + ")"; + } + return str + "$" + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType.ToString() + "."); + } + + internal void AddUAxis(IfcGridAxis a) { mUAxes.Add(a.mIndex); a.mPartOfU = this; } + internal void AddVAxis(IfcGridAxis a) { mVAxes.Add(a.mIndex); a.mPartOfV = this; } + internal void AddWAxis(IfcGridAxis a) { mWAxes.Add(a.mIndex); a.mPartOfW = this; } + internal void RemoveUAxis(IfcGridAxis a) { mUAxes.Remove(a.mIndex); a.mPartOfU = null; } + internal void RemoveVAxis(IfcGridAxis a) { mVAxes.Remove(a.mIndex); a.mPartOfV = null; } + internal void RemoveWAxis(IfcGridAxis a) { mWAxes.Remove(a.mIndex); a.mPartOfW = null; } + } + public partial class IfcGridAxis : BaseClassIfc + { + private string mAxisTag = "$";// : OPTIONAL IfcLabel; + private int mAxisCurve;// : IfcCurve; + internal bool mSameSense;// : IfcBoolean; + + //INVERSE + internal IfcGrid mPartOfW = null;// : SET [0:1] OF IfcGrid FOR WAxes; + internal IfcGrid mPartOfV = null;// : SET [0:1] OF IfcGrid FOR VAxes; + internal IfcGrid mPartOfU = null;// : SET [0:1] OF IfcGrid FOR UAxes; + internal List mHasIntersections = new List();//: SET OF IfcVirtualGridIntersection FOR IntersectingAxes; + + internal string AxisTag { get { return mAxisTag == "$" ? "" : mAxisTag; } } + internal IfcCurve AxisCurve { get { return mDatabase.mIfcObjects[mAxisCurve] as IfcCurve; } } + + internal IfcGridAxis() : base() { } + internal IfcGridAxis(IfcGridAxis p) : base() { mAxisTag = p.mAxisTag; mAxisCurve = p.mAxisCurve; mSameSense = p.mSameSense; } + internal IfcGridAxis(DatabaseIfc m, string tag, IfcCurve axis, bool sameSense) : base(m) { if (!string.IsNullOrEmpty(tag)) mAxisTag = tag.Replace("'", ""); mAxisCurve = axis.mIndex; mSameSense = sameSense; } + internal static IfcGridAxis Parse(string strDef) { IfcGridAxis a = new IfcGridAxis(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcGridAxis a, List arrFields, ref int ipos) { a.mAxisTag = arrFields[ipos++].Replace("'", ""); a.mAxisCurve = ParserSTEP.ParseLink(arrFields[ipos++]); a.mSameSense = ParserSTEP.ParseBool(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + (mAxisTag == "$" ? ",$," : ",'" + mAxisTag + "',") + ParserSTEP.LinkToString(mAxisCurve) + "," + ParserSTEP.BoolToString(mSameSense); } + } + public partial class IfcGridPlacement : IfcObjectPlacement + { + internal int mPlacementLocation;// : IfcVirtualGridIntersection ; + internal int mPlacementRefDirection;// : OPTIONAL IfcVirtualGridIntersection; + internal IfcGridPlacement() : base() { } + internal IfcGridPlacement(IfcGridPlacement p) : base(p) { mPlacementLocation = p.mPlacementLocation; mPlacementRefDirection = p.mPlacementRefDirection; } + internal static IfcGridPlacement Parse(string strDef) { IfcGridPlacement p = new IfcGridPlacement(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcGridPlacement p, List arrFields, ref int ipos) { IfcObjectPlacement.parseFields(p, arrFields, ref ipos); p.mPlacementLocation = ParserSTEP.ParseLink(arrFields[ipos++]); p.mPlacementRefDirection = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mOutputEssential || mPlacesObject.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mPlacementLocation) + "," + ParserSTEP.LinkToString(mPlacementRefDirection)); } + } + public partial class IfcGroup : IfcObject //SUPERTYPE OF (ONEOF (IfcAsset ,IfcCondition ,IfcInventory ,IfcStructuralLoadGroup ,IfcStructuralResultGroup ,IfcSystem ,IfcZone)) + { + //INVERSE + internal List mIsGroupedBy = new List();// IFC4 SET : IfcRelAssignsToGroup FOR RelatingGroup; + public List IsGroupedBy { get { return mIsGroupedBy; } } + + internal IfcGroup() : base() { } + internal IfcGroup(IfcGroup p) : base(p) { } + public IfcGroup(DatabaseIfc m, string name) : base(m) { Name = name; mIsGroupedBy.Add(new IfcRelAssignsToGroup(this)); } + internal IfcGroup(List ods) : base(ods[0].mDatabase) { mIsGroupedBy.Add(new IfcRelAssignsToGroup(this, ods)); } + + internal static IfcGroup Parse(string strDef) { IfcGroup g = new IfcGroup(); int ipos = 0; parseFields(g, ParserSTEP.SplitLineFields(strDef), ref ipos); return g; } + internal static void parseFields(IfcGroup g, List arrFields, ref int ipos) { IfcObject.parseFields(g, arrFields, ref ipos); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination ? "" : base.BuildString()); } + internal void assign(IfcObjectDefinition o) { mIsGroupedBy[0].assign(o); } + } +} diff --git a/IFC/IFC H.cs b/IFC/IFC H.cs new file mode 100644 index 0000000..84a3aa2 --- /dev/null +++ b/IFC/IFC H.cs @@ -0,0 +1,139 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcHalfSpaceSolid : IfcGeometricRepresentationItem, IfcBooleanOperand /* SUPERTYPE OF (ONEOF (IfcBoxedHalfSpace ,IfcPolygonalBoundedHalfSpace)) */ + { + private int mBaseSurface;// : IfcSurface; + private bool mAgreementFlag;// : BOOLEAN; + + internal IfcSurface BaseSurface { get { return mDatabase.mIfcObjects[mBaseSurface] as IfcSurface; } } + internal bool AgreementFlag { get { return mAgreementFlag; } } + + internal IfcHalfSpaceSolid() : base() { } + internal IfcHalfSpaceSolid(IfcHalfSpaceSolid pl) : base(pl) { mBaseSurface = pl.mBaseSurface; mAgreementFlag = pl.mAgreementFlag; } + + internal static void parseFields(IfcHalfSpaceSolid s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); s.mBaseSurface = ParserSTEP.ParseLink(arrFields[ipos++]); s.mAgreementFlag = ParserSTEP.ParseBool(arrFields[ipos++]); } + internal static IfcHalfSpaceSolid Parse(string strDef) { IfcHalfSpaceSolid s = new IfcHalfSpaceSolid(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBaseSurface) + "," + ParserSTEP.BoolToString(mAgreementFlag); } + } + public class IfcHeatExchanger : IfcEnergyConversionDevice //IFC4 + { + internal IfcHeatExchangerTypeEnum mPredefinedType = IfcHeatExchangerTypeEnum.NOTDEFINED;// OPTIONAL : IfcHeatExchangerTypeEnum; + public IfcHeatExchangerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcHeatExchanger() : base() { } + internal IfcHeatExchanger(IfcHeatExchanger b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcHeatExchanger(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcHeatExchanger s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcHeatExchangerTypeEnum)Enum.Parse(typeof(IfcHeatExchangerTypeEnum), str); + } + internal new static IfcHeatExchanger Parse(string strDef) { IfcHeatExchanger s = new IfcHeatExchanger(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcHeatExchangerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcHeatExchangerType : IfcEnergyConversionDeviceType + { + internal IfcHeatExchangerTypeEnum mPredefinedType = IfcHeatExchangerTypeEnum.NOTDEFINED;// : IfcHeatExchangerTypeEnum; + public IfcHeatExchangerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcHeatExchangerType() : base() { } + internal IfcHeatExchangerType(IfcHeatExchangerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcHeatExchangerType(DatabaseIfc m, string name, IfcHeatExchangerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcHeatExchangerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcHeatExchangerTypeEnum)Enum.Parse(typeof(IfcHeatExchangerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcHeatExchangerType Parse(string strDef) { IfcHeatExchangerType t = new IfcHeatExchangerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcHumidifier : IfcEnergyConversionDevice //IFC4 + { + internal IfcHumidifierTypeEnum mPredefinedType = IfcHumidifierTypeEnum.NOTDEFINED;// OPTIONAL : IfcHumidifierTypeEnum; + public IfcHumidifierTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcHumidifier() : base() { } + internal IfcHumidifier(IfcHumidifier b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcHumidifier(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcHumidifier s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcHumidifierTypeEnum)Enum.Parse(typeof(IfcHumidifierTypeEnum), str); + } + internal new static IfcHumidifier Parse(string strDef) { IfcHumidifier s = new IfcHumidifier(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcHumidifierTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcHumidifierType : IfcEnergyConversionDeviceType + { + internal IfcHumidifierTypeEnum mPredefinedType = IfcHumidifierTypeEnum.NOTDEFINED;// : IfcHumidifierExchangerEnum; + public IfcHumidifierTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcHumidifierType() : base() { } + internal IfcHumidifierType(IfcHumidifierType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcHumidifierType(DatabaseIfc m, string name, IfcHumidifierTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcHumidifierType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcHumidifierTypeEnum)Enum.Parse(typeof(IfcHumidifierTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcHumidifierType Parse(string strDef) { IfcHumidifierType t = new IfcHumidifierType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcHygroscopicMaterialProperties : IfcMaterialPropertiesSuperSeded // DEPRECEATED IFC4 + { + internal double mUpperVaporResistanceFactor, mLowerVaporResistanceFactor; //: OPTIONAL IfcPositiveRatioMeasure; + internal double mIsothermalMoistureCapacity; //: : OPTIONAL IfcIsothermalMoistureCapacityMeasure; + internal double mVaporPermeability;//: OPTIONAL IfcVaporPermeabilityMeasure; + internal double mMoistureDiffusivity;// : OPTIONAL IfcMoistureDiffusivityMeasure;*/ + internal IfcHygroscopicMaterialProperties() : base() { } + internal IfcHygroscopicMaterialProperties(IfcHygroscopicMaterialProperties el) + : base(el) + { + mUpperVaporResistanceFactor = el.mUpperVaporResistanceFactor; + mLowerVaporResistanceFactor = el.mLowerVaporResistanceFactor; + mIsothermalMoistureCapacity = el.mIsothermalMoistureCapacity; + mVaporPermeability = el.mVaporPermeability; + mMoistureDiffusivity = el.mMoistureDiffusivity; + } + internal static IfcHygroscopicMaterialProperties Parse(string strDef) { IfcHygroscopicMaterialProperties p = new IfcHygroscopicMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcHygroscopicMaterialProperties p, List arrFields, ref int ipos) + { + IfcMaterialPropertiesSuperSeded.parseFields(p, arrFields, ref ipos); + p.mUpperVaporResistanceFactor = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLowerVaporResistanceFactor = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mIsothermalMoistureCapacity = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mVaporPermeability = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mMoistureDiffusivity = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mUpperVaporResistanceFactor) + "," + ParserSTEP.DoubleOptionalToString(mLowerVaporResistanceFactor) + "," + ParserSTEP.DoubleOptionalToString(mIsothermalMoistureCapacity) + "," + ParserSTEP.DoubleOptionalToString(mVaporPermeability) + "," + ParserSTEP.DoubleOptionalToString(mMoistureDiffusivity); } + } +} diff --git a/IFC/IFC I.cs b/IFC/IFC I.cs new file mode 100644 index 0000000..39b1e3b --- /dev/null +++ b/IFC/IFC I.cs @@ -0,0 +1,273 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcImageTexture : IfcSurfaceTexture + { + internal string mUrlReference;// : IfcIdentifier; + internal IfcImageTexture() : base() { } + internal IfcImageTexture(IfcImageTexture i) : base((IfcSurfaceTexture)i) { mUrlReference = i.mUrlReference; } + internal static IfcImageTexture Parse(string strDef, Schema schema) { IfcImageTexture t = new IfcImageTexture(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return t; } + internal static void parseFields(IfcImageTexture t, List arrFields, ref int ipos,Schema schema) + { + try + { + IfcSurfaceTexture.parseFields(t, arrFields, ref ipos,schema); + t.mUrlReference = arrFields[ipos++].Replace("'", ""); + } + catch (Exception) { } + } + protected override string BuildString() { return base.BuildString() + ",'" + mUrlReference + "'"; } + } + public class IfcIndexedColourMap : IfcPresentationItem + { + internal int mMappedTo;// : IfcTessellatedFaceSet; + // Overrides : OPTIONAL IfcStrippedOptional; + internal int mColours;// : IfcColourRgbList; + internal List mColourIndex = new List();// : LIST [1:?] OF IfcPositiveInteger; + + public IfcColourRgbList Colours { get { return mDatabase.mIfcObjects[mColours] as IfcColourRgbList; } } + + internal IfcIndexedColourMap() : base() { } + internal IfcIndexedColourMap(IfcIndexedColourMap v) : base(v) { mMappedTo = v.mMappedTo; mColours = v.mColours; } + public IfcIndexedColourMap(IfcTessellatedFaceSet fs, IfcColourRgbList colours, IEnumerable colourindex) + : base(fs.mDatabase) { mMappedTo = fs.mIndex; mColours = colours.mIndex; mColourIndex.AddRange(colourindex); } + protected override void parseFields(List arrFields, ref int ipos) + { + base.parseFields(arrFields, ref ipos); + mMappedTo = ParserSTEP.ParseLink(arrFields[ipos++]); + ipos++; + mColours = ParserSTEP.ParseLink(arrFields[ipos++]); + mColourIndex = ParserSTEP.SplitListSTPIntegers(arrFields[ipos++]); + } + internal static IfcIndexedColourMap Parse(string strDef) { IfcIndexedColourMap s = new IfcIndexedColourMap(); int ipos = 0; s.parseFields(ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string result = base.BuildString() + "," + ParserSTEP.LinkToString(mMappedTo) + ",$," + ParserSTEP.LinkToString(mColours) + ",(" + mColourIndex[0]; + for (int icounter = 1; icounter < mColourIndex.Count; icounter++) + result += "," + mColourIndex[icounter]; + return result + ")"; + } + internal void relate() { (mDatabase.mIfcObjects[mMappedTo] as IfcTessellatedFaceSet).mHasColours = this; } + } + public partial class IfcIndexedPolyCurve : IfcBoundedCurve + { + private int mPoints; // IfcCartesianPointList + internal List mSegments = new List();// OPTIONAL LIST [1:?] OF IfcSegmentIndexSelect; + internal IfcLogicalEnum mSelfIntersect = IfcLogicalEnum.UNKNOWN;// Optional IfcBoolean + + public IfcCartesianPointList Points { get { return mDatabase.mIfcObjects[mPoints] as IfcCartesianPointList; } set { mPoints = value.mIndex; } } + public List Segments { get { return mSegments; } set { mSegments = new List() { }; mSegments.AddRange(value); } } + public bool SelfIntersect { get { return mSelfIntersect == IfcLogicalEnum.TRUE; } set { mSelfIntersect = (value ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); }} + + internal IfcIndexedPolyCurve() : base() { } + internal IfcIndexedPolyCurve(IfcIndexedPolyCurve p) : base(p) { mPoints = p.mPoints; mSegments.AddRange(p.mSegments); mSelfIntersect = p.mSelfIntersect; } + internal IfcIndexedPolyCurve(IfcCartesianPointList pl) : base(pl.mDatabase) { Points = pl; } + internal IfcIndexedPolyCurve(IfcCartesianPointList pl, List segs) : this(pl) { Segments = segs; } + internal static void parseFields(IfcIndexedPolyCurve c, List arrFields, ref int ipos) + { + IfcBoundedCurve.parseFields(c, arrFields, ref ipos); + c.mPoints = ParserSTEP.ParseLink(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (str != "$") + { + List strs = ParserSTEP.SplitLineFields(str.Substring(1, str.Length - 2)); + foreach (string s in strs) + { + if (s.ToUpper().StartsWith("IFCLINEINDEX")) + c.mSegments.Add(new IfcLineIndex(ParserSTEP.SplitListSTPIntegers(s.Substring(13, s.Length - 14)))); + else + { + List ints = ParserSTEP.SplitListSTPIntegers(s.Substring(12, s.Length - 13)); + c.mSegments.Add(new IfcArcIndex(ints[0], ints[1], ints[2])); + } + + } + } + str = arrFields[ipos++]; + if (str[0] == '.') + c.mSelfIntersect = str[1] == 'T' ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE; + } + internal static IfcIndexedPolyCurve Parse(string strDef) { IfcIndexedPolyCurve c = new IfcIndexedPolyCurve(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() + { + + string str = base.BuildString() + ",#" + mPoints; + if (mSegments.Count > 0) + { + str += ",(" + mSegments[0].ToString(); + for (int icounter = 1; icounter < mSegments.Count; icounter++) + str += "," + mSegments[icounter].ToString(); + str += "),"; + } + else + str += ",$,"; + str += (mSelfIntersect == IfcLogicalEnum.UNKNOWN ? "$" : (mSelfIntersect == IfcLogicalEnum.TRUE ? ".T." : ".F.")); + return base.BuildString() + str; + } + } + public abstract partial class IfcIndexedTextureMap : IfcTextureCoordinate // ABSTRACT SUPERTYPE OF(IfcIndexedTriangleTextureMap) + { + internal int mMappedTo = 0;// : IfcTessellatedFaceSet; + internal int mTexCoords = 0;// : IfcTextureVertexList; + + public IfcTessellatedFaceSet MappedTo { get { return mDatabase.mIfcObjects[mMappedTo] as IfcTessellatedFaceSet; } } + + protected IfcIndexedTextureMap() : base() { } + protected IfcIndexedTextureMap(IfcIndexedTextureMap m) : base(m) { mMappedTo = m.mMappedTo; mTexCoords = m.mTexCoords; } + //internal IfcIndexedTextureMap(IfcTessellatedFaceSet mappedTo, ifctext) : this(pl, nll, selfIntersect, new List()) { } + //internal IfcIndexedTextureMap(IfcCartesianPointList pl, List segs, IfcLogicalEnum selfIntersect) : this(pl, segs, selfIntersect, new List()) { } + protected override void parseFields(List arrFields, ref int ipos) + { + base.parseFields(arrFields, ref ipos); + mMappedTo = ParserSTEP.ParseLink(arrFields[ipos++]); + mTexCoords = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",#" + mMappedTo + ",#" + mTexCoords; } + + internal void relate() { MappedTo.mHasTextures.Add(this); } + } + public class IfcIndexedTriangleTextureMap : IfcIndexedTextureMap + { + internal Tuple[] mTexCoordList = new Tuple[0];// : OPTIONAL LIST [1:?] OF LIST [3:3] OF IfcPositiveInteger; + + internal IfcIndexedTriangleTextureMap() : base() { } + internal IfcIndexedTriangleTextureMap(IfcIndexedTriangleTextureMap c) : base() { mTexCoordList = c.mTexCoordList; } + //public IfcIndexedTriangleTextureMap(DatabaseIfc m, IEnumerable> coords) : base(m) { mTexCoordList = coords.ToArray(); } + + internal static IfcIndexedTriangleTextureMap Parse(string str) { IfcIndexedTriangleTextureMap m = new IfcIndexedTriangleTextureMap(); int pos = 0; m.parseFields(ParserSTEP.SplitLineFields(str), ref pos); return m; } + protected override void parseFields(List arrFields, ref int ipos) { base.parseFields(arrFields, ref ipos); mTexCoordList = ParserSTEP.SplitListSTPIntTriple(arrFields[ipos++]); } + protected override string BuildString() + { + if (mTexCoordList.Length == 0) + return base.BuildString() + ",$"; + Tuple triple = mTexCoordList[0]; + string result = base.BuildString() + ",((" + triple.Item1 + "," + triple.Item2 + "," + triple.Item3; + for (int icounter = 1; icounter < mTexCoordList.Length; icounter++) + { + triple = mTexCoordList[icounter]; + result += "),(" + triple.Item1 + "," + triple.Item2 + "," + triple.Item3; + } + + return result + "))"; + } + } + public class IfcInterceptor : IfcFlowTreatmentDevice //IFC4 + { + internal IfcInterceptorTypeEnum mPredefinedType = IfcInterceptorTypeEnum.NOTDEFINED; + public IfcInterceptorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcInterceptor(IfcInterceptor a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcInterceptor() : base() { } + internal IfcInterceptor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcInterceptor a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcInterceptorTypeEnum)Enum.Parse(typeof(IfcInterceptorTypeEnum), s.Replace(".", "")); + } + internal new static IfcInterceptor Parse(string strDef) { IfcInterceptor d = new IfcInterceptor(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcInterceptorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcInterceptorType : IfcFlowTreatmentDeviceType + { + internal IfcInterceptorTypeEnum mPredefinedType = IfcInterceptorTypeEnum.NOTDEFINED;// : IfcInterceptorTypeEnum; + public IfcInterceptorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcInterceptorType() : base() { } + internal IfcInterceptorType(IfcInterceptorType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcInterceptorType t, List arrFields, ref int ipos) { IfcFlowTreatmentDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcInterceptorTypeEnum)Enum.Parse(typeof(IfcInterceptorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcInterceptorType Parse(string strDef) { IfcInterceptorType t = new IfcInterceptorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcInventory : IfcGroup + { + internal IfcInventoryTypeEnum mInventoryType;// : IfcInventoryTypeEnum; + internal int mJurisdiction;// : IfcActorSelect; + internal List mResponsiblePersons = new List();// : SET [1:?] OF IfcPerson; + internal int mLastUpdateDate;// : IfcCalendarDate; + internal int mCurrentValue;// : OPTIONAL IfcCostValue; + internal int mOriginalValue;// : OPTIONAL IfcCostValue; + internal IfcInventory() : base() { } + internal IfcInventory(IfcInventory p) : base(p) { mInventoryType = p.mInventoryType; mJurisdiction = p.mJurisdiction; mResponsiblePersons = new List(p.mResponsiblePersons.ToArray()); mLastUpdateDate = p.mLastUpdateDate; mCurrentValue = p.mCurrentValue; mOriginalValue = p.mOriginalValue; } + internal IfcInventory(DatabaseIfc m, string name) : base(m, name) { } + internal new static IfcInventory Parse(string strDef) { IfcInventory i = new IfcInventory(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcInventory i, List arrFields, ref int ipos) + { + IfcGroup.parseFields(i, arrFields, ref ipos); + i.mInventoryType = (IfcInventoryTypeEnum)Enum.Parse(typeof(IfcInventoryTypeEnum), arrFields[ipos++].Replace(".", "")); + i.mJurisdiction = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mResponsiblePersons = ParserSTEP.SplitListLinks(arrFields[ipos++]); + i.mLastUpdateDate = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mCurrentValue = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mOriginalValue = ParserSTEP.ParseLink(arrFields[ipos++]); + } + } + //ENTITY IfcIrregularTimeSeries + //ENTITY IfcIrregularTimeSeriesValue;ductFittingTypeEnum; + public partial class IfcIShapeProfileDef : IfcParameterizedProfileDef //Ifc2x3 SUBTYPE OF ( IfcParameterizedProfileDef); + { + internal double mOverallWidth, mOverallDepth, mWebThickness, mFlangeThickness;// : IfcPositiveLengthMeasure; + internal double mFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mFlangeEdgeRadius;// : OPTIONAL IfcNonNegativeLengthMeasure; + internal double mFlangeSlope;// : OPTIONAL IfcPlaneAngleMeasure; + + public double FlangeEdgeRadius { get { return mFlangeEdgeRadius; } set { mFlangeEdgeRadius = value; } } + public double FlangeSlope { get { return mFlangeSlope; } set { mFlangeSlope = value; } } + + internal IfcIShapeProfileDef() : base() { } + internal IfcIShapeProfileDef(IfcIShapeProfileDef i) : base(i) { mOverallWidth = i.mOverallWidth; mOverallDepth = i.mOverallDepth; mWebThickness = i.mWebThickness; mFlangeThickness = i.mFlangeThickness; mFilletRadius = i.mFilletRadius; mFlangeEdgeRadius = i.mFlangeEdgeRadius; mFlangeSlope = i.mFlangeSlope; } + public IfcIShapeProfileDef(DatabaseIfc m, string name, double overallDepth, double overalWidth, double webThickness, double flangeThickness, double filletRadius) + : base(m) { Name = name; mOverallDepth = overallDepth; mOverallWidth = overalWidth; mWebThickness = webThickness; mFlangeThickness = flangeThickness; mFilletRadius = filletRadius; } + internal static IfcIShapeProfileDef Parse(string strDef, Schema schema) { IfcIShapeProfileDef p = new IfcIShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcIShapeProfileDef p, List arrFields, ref int ipos, Schema schema) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mOverallWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mOverallDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + p.mFlangeEdgeRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeSlope = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleToString(mOverallWidth) + "," + ParserSTEP.DoubleToString(mOverallDepth) + "," + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mFlangeThickness) + "," + ParserSTEP.DoubleToString(mFilletRadius) + + (mDatabase.mSchema == Schema.IFC2x3 ? "" : "," + ParserSTEP.DoubleOptionalToString(mFlangeEdgeRadius) + "," + ParserSTEP.DoubleOptionalToString(mFlangeSlope)); + } + } +} diff --git a/IFC/IFC J.cs b/IFC/IFC J.cs new file mode 100644 index 0000000..dc1bd3a --- /dev/null +++ b/IFC/IFC J.cs @@ -0,0 +1,63 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcJunctionBox : IfcFlowFitting //IFC4 + { + internal IfcJunctionBoxTypeEnum mPredefinedType = IfcJunctionBoxTypeEnum.NOTDEFINED;// OPTIONAL : IfcJunctionBoxTypeEnum; + public IfcJunctionBoxTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcJunctionBox() : base() { } + internal IfcJunctionBox(IfcJunctionBox b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcJunctionBox(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcJunctionBox s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcJunctionBoxTypeEnum)Enum.Parse(typeof(IfcJunctionBoxTypeEnum), str); + } + internal new static IfcJunctionBox Parse(string strDef) { IfcJunctionBox s = new IfcJunctionBox(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcJunctionBoxTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + internal class IfcJunctionBoxType : IfcFlowFittingType + { + internal IfcJunctionBoxTypeEnum mPredefinedType = IfcJunctionBoxTypeEnum.NOTDEFINED;// : IfcJunctionBoxTypeEnum; + public IfcJunctionBoxTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcJunctionBoxType() : base() { } + internal IfcJunctionBoxType(IfcJunctionBoxType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcJunctionBoxType(DatabaseIfc m, string name, IfcJunctionBoxTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcJunctionBoxType t, List arrFields, ref int ipos) { IfcFlowFittingType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcJunctionBoxTypeEnum)Enum.Parse(typeof(IfcJunctionBoxTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcJunctionBoxType Parse(string strDef) { IfcJunctionBoxType t = new IfcJunctionBoxType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } +} diff --git a/IFC/IFC L.cs b/IFC/IFC L.cs new file mode 100644 index 0000000..4ecb3bb --- /dev/null +++ b/IFC/IFC L.cs @@ -0,0 +1,441 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcLaborResource : IfcConstructionResource + { + internal IfcLaborResourceTypeEnum mPredefinedType = IfcLaborResourceTypeEnum.NOTDEFINED;// OPTIONAL : IfcRoofTypeEnum; + public IfcLaborResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcLaborResource() : base() { } + internal IfcLaborResource(IfcLaborResource o) : base(o) { mPredefinedType = o.mPredefinedType; } + internal IfcLaborResource(DatabaseIfc m) : base(m) { } + internal static IfcLaborResource Parse(string strDef, Schema schema) { IfcLaborResource r = new IfcLaborResource(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return r; } + internal static void parseFields(IfcLaborResource r, List arrFields, ref int ipos, Schema schema) + { + IfcConstructionResource.parseFields(r, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcLaborResourceTypeEnum)Enum.Parse(typeof(IfcLaborResourceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcLaborResourceType : IfcConstructionResourceType //IFC4 + { + internal IfcLaborResourceTypeEnum mPredefinedType = IfcLaborResourceTypeEnum.NOTDEFINED; + internal IfcLaborResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcLaborResourceType() : base() { } + internal IfcLaborResourceType(IfcLaborResourceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcLaborResourceType(DatabaseIfc m, string name, IfcLaborResourceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcLaborResourceType t, List arrFields, ref int ipos) { IfcLaborResourceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcLaborResourceTypeEnum)Enum.Parse(typeof(IfcLaborResourceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcLaborResourceType Parse(string strDef) { IfcLaborResourceType t = new IfcLaborResourceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcLagTime : IfcSchedulingTime //IFC4 + { + internal IfcTimeOrRatioSelect mLagValue;// IfcTimeOrRatioSelect + internal IfcTaskDurationEnum mDurationType = IfcTaskDurationEnum.NOTDEFINED;// IfcTaskDurationEnum; + internal IfcLagTime() : base() { } + internal IfcLagTime(IfcLagTime i) : base(i) { mLagValue = i.mLagValue; mDurationType = i.mDurationType; } + internal IfcLagTime(DatabaseIfc m, string name, IfcDataOriginEnum origin, string userOrigin, IfcTimeOrRatioSelect lag, IfcTaskDurationEnum nature) : base(m, name, origin, userOrigin) { mLagValue = lag; mDurationType = nature; } + internal static IfcLagTime Parse(string strDef) { IfcLagTime f = new IfcLagTime(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcLagTime f, List arrFields, ref int ipos) { IfcSchedulingTime.parseFields(f, arrFields, ref ipos); } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + "," + mLagValue.String + ",." + mDurationType.ToString() + "."); } + internal double getSecondsDuration() { IfcDuration d = mLagValue as IfcDuration; return (d == null ? 0 : d.ToSeconds()); } + internal TimeSpan getLag() { return new TimeSpan(0, 0, (int)getSecondsDuration()); } + } + public class IfcLamp : IfcFlowTerminal //IFC4 + { + internal IfcLampTypeEnum mPredefinedType = IfcLampTypeEnum.NOTDEFINED;// OPTIONAL : IfcLampTypeEnum; + public IfcLampTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcLamp() : base() { } + internal IfcLamp(IfcLamp l) : base(l) { mPredefinedType = l.mPredefinedType; } + internal IfcLamp(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcLamp s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcLampTypeEnum)Enum.Parse(typeof(IfcLampTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcLamp Parse(string strDef) { IfcLamp s = new IfcLamp(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcLampTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + + } + public class IfcLampType : IfcFlowTerminalType + { + internal IfcLampTypeEnum mPredefinedType = IfcLampTypeEnum.NOTDEFINED;// : IfcLampTypeEnum; + public IfcLampTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcLampType() : base() { } + internal IfcLampType(IfcLampType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcLampType(DatabaseIfc m, string name, IfcLampTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcLampType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcLampTypeEnum)Enum.Parse(typeof(IfcLampTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcLampType Parse(string strDef) { IfcLampType t = new IfcLampType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public interface IfcLayeredItem : IfcInterface { List LayerAssignments { get; } }// = SELECT(IfcRepresentationItem, IfcRepresentation); + public class IfcLibraryInformation : IfcExternalInformation + { + internal string mName;// : IfcLabel; + internal string mVersion = "$";//: OPTIONAL IfcLabel; + internal int mPublisher;// : OPTIONAL IfcActorSelect; + internal string mVersionDate = "$"; // : OPTIONAL IfcDateTime; + internal string mLocation = "$";// : OPTIONAL IfcURIReference; + internal string mDescription = "$";// : OPTIONAL IfcText; + //INVERSE + internal List mLibraryRefForObjects = new List();//IFC4 : SET [0:?] OF IfcRelAssociatesLibrary FOR RelatingLibrary; + internal IfcLibraryInformation() : base() { } + internal IfcLibraryInformation(IfcLibraryInformation i) : base(i) { mName = i.mName; mVersion = i.mVersion; mPublisher = i.mPublisher; mVersionDate = i.mVersionDate; mLocation = i.mLocation; mDescription = i.mDescription; } + internal static IfcLibraryInformation Parse(string strDef) { IfcLibraryInformation f = new IfcLibraryInformation(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcLibraryInformation f, List arrFields, ref int ipos) { IfcExternalInformation.parseFields(f, arrFields, ref ipos); } + protected override string BuildString() + { + return base.BuildString() + ".'" + mName + (mVersion == "$" ? "',$," : "','" + mVersion + "',") + ParserSTEP.LinkToString(mPublisher) + (mVersionDate == "$" ? ",$," : ",'" + mVersionDate + "',") + + (mLocation == "$" ? "$," : "'" + mLocation + "',") + (mDescription == "$" ? "$" : "'" + mDescription + "'"); + } + + } + public class IfcLibraryReference : IfcExternalReference, IfcLibrarySelect + { + internal string mDescription = "$";//IFC4 : OPTIONAL IfcText; + internal string mLanguage = "$";//IFC4 : OPTIONAL IfcLanguageId; + internal int mReferencedLibrary;// : OPTIONAL IfcLibraryInformation; + //INVERSE + internal List mLibraryRefForObjects = new List();//IFC4 : SET [0:?] OF IfcRelAssociatesLibrary FOR RelatingLibrary; + + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Language { get { return (mLanguage == "$" ? "" : ParserIfc.Decode(mLanguage)); } set { mLanguage = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcLibraryReference() : base() { } + internal IfcLibraryReference(IfcLibraryReference i) : base(i) { mDescription = i.mDescription; mLanguage = i.mLanguage; mReferencedLibrary = i.mReferencedLibrary; } + internal IfcLibraryReference(DatabaseIfc db) : base(db) { } + internal static IfcLibraryReference Parse(string strDef) { IfcLibraryReference f = new IfcLibraryReference(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcLibraryReference f, List arrFields, ref int ipos) { IfcExternalReference.parseFields(f, arrFields, ref ipos); } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "," : (mDescription == "$" ? ",$," : ",'" + mDescription + "',") + (mLanguage == "$" ? "$," : "'" + mLanguage + "',")) + ParserSTEP.LinkToString(mReferencedLibrary); } + } + public interface IfcLibrarySelect //SELECT ( IfcLibraryReference, IfcLibraryInformation); + { + int Index { get; } + //IfcRelAssociatesLibrary Associates { get; } + //string Name { get; } + } + //ENTITY IfcLightDistributionData; + public interface IfcLightDistributionDataSourceSelect : IfcInterface { } //SELECT(IfcExternalReference,IfcLightIntensityDistribution); + public partial class IfcLightFixture : IfcFlowTerminal + { + internal IfcLightFixtureTypeEnum mPredefinedType = IfcLightFixtureTypeEnum.NOTDEFINED;// : OPTIONAL IfcLightFixtureTypeEnum; + public IfcLightFixtureTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcLightFixture() : base() { } + internal IfcLightFixture(IfcLightFixture f) : base(f) { mPredefinedType = f.mPredefinedType; } + internal IfcLightFixture(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcLightFixture t, List arrFields, ref int ipos) { IfcFlowTerminal.parseFields(t, arrFields, ref ipos); string s = arrFields[ipos++]; if (s[0] == '.') t.mPredefinedType = (IfcLightFixtureTypeEnum)Enum.Parse(typeof(IfcLightFixtureTypeEnum), s.Substring(1, s.Length - 2)); } + internal new static IfcLightFixture Parse(string strDef) { IfcLightFixture t = new IfcLightFixture(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcLightFixtureTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcLightFixtureType : IfcFlowTerminalType + { + internal IfcLightFixtureTypeEnum mPredefinedType = IfcLightFixtureTypeEnum.NOTDEFINED;// : IfcLightFixtureTypeEnum; + public IfcLightFixtureTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcLightFixtureType() : base() { } + internal IfcLightFixtureType(IfcLightFixtureType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcLightFixtureType(DatabaseIfc m, string name, IfcLightFixtureTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcLightFixtureType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcLightFixtureTypeEnum)Enum.Parse(typeof(IfcLightFixtureTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcLightFixtureType Parse(string strDef) { IfcLightFixtureType t = new IfcLightFixtureType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcLightIntensityDistribution ,IfcLightDistributionDataSourceSelect + public abstract class IfcLightSource : IfcGeometricRepresentationItem //ABSTRACT SUPERTYPE OF (ONEOF (IfcLightSourceAmbient ,IfcLightSourceDirectional ,IfcLightSourceGoniometric ,IfcLightSourcePositional)) + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal int mLightColour;// : IfcColourRgb; + internal double mAmbientIntensity;// : OPTIONAL IfcNormalisedRatioMeasure; + internal double mIntensity;// : OPTIONAL IfcNormalisedRatioMeasure; + protected IfcLightSource() : base() { } + protected IfcLightSource(IfcLightSource p) : base(p) { mName = p.mName; mLightColour = p.mLightColour; mAmbientIntensity = p.mAmbientIntensity; mIntensity = p.mIntensity; } + protected static void parseFields(IfcLightSource l, List arrFields, ref int ipos) + { + IfcGeometricRepresentationItem.parseFields(l, arrFields, ref ipos); + l.mName = arrFields[ipos++]; + l.mLightColour = ParserSTEP.ParseLink(arrFields[ipos++]); + l.mAmbientIntensity = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mIntensity = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + mName + "," + ParserSTEP.LinkToString(mLightColour) + "," + ParserSTEP.DoubleOptionalToString(mAmbientIntensity) + "," + ParserSTEP.DoubleOptionalToString(mIntensity); } + } + public class IfcLightSourceAmbient : IfcLightSource + { + internal IfcLightSourceAmbient() : base() { } + internal IfcLightSourceAmbient(IfcLightSourceAmbient el) : base((IfcLightSourceAmbient)el) { } + internal static IfcLightSourceAmbient Parse(string strDef) { IfcLightSourceAmbient l = new IfcLightSourceAmbient(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLightSourceAmbient l, List arrFields, ref int ipos) { IfcLightSource.parseFields(l, arrFields, ref ipos); } + } + public class IfcLightSourceDirectional : IfcLightSource + { + internal int mOrientation;// : IfcDirection; + internal IfcLightSourceDirectional() : base() { } + internal IfcLightSourceDirectional(IfcLightSourceDirectional el) : base((IfcLightSource)el) { mOrientation = el.mOrientation; } + internal static IfcLightSourceDirectional Parse(string strDef) { IfcLightSourceDirectional l = new IfcLightSourceDirectional(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLightSourceDirectional l, List arrFields, ref int ipos) { IfcLightSource.parseFields(l, arrFields, ref ipos); l.mOrientation = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mOrientation); } + } + public class IfcLightSourceGoniometric : IfcLightSource + { + internal int mPosition;// : IfcAxis2Placement3D; + internal int mColourAppearance;// : OPTIONAL IfcColourRgb; + internal double mColourTemperature;// : IfcReal; + internal double mLuminousFlux;// : IfcLuminousFluxMeasure; + internal IfcLightEmissionSourceEnum mLightEmissionSource;// : IfcLightEmissionSourceEnum; + internal int mLightDistributionDataSource; // IfcLightDistributionDataSourceSelect; + internal IfcLightSourceGoniometric() : base() { } + internal IfcLightSourceGoniometric(IfcLightSourceGoniometric el) + : base(el) + { + mPosition = el.mPosition; + mColourAppearance = el.mColourAppearance; + mColourTemperature = el.mColourTemperature; + mLuminousFlux = el.mLuminousFlux; + mLightEmissionSource = el.mLightEmissionSource; + mLightDistributionDataSource = el.mLightDistributionDataSource; + } + internal static IfcLightSourceGoniometric Parse(string strDef) { IfcLightSourceGoniometric l = new IfcLightSourceGoniometric(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLightSourceGoniometric l, List arrFields, ref int ipos) + { + IfcLightSource.parseFields(l, arrFields, ref ipos); + l.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); + l.mColourAppearance = ParserSTEP.ParseLink(arrFields[ipos++]); + l.mColourTemperature = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mLuminousFlux = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mLightEmissionSource = (IfcLightEmissionSourceEnum)Enum.Parse(typeof(IfcLightEmissionSourceEnum), arrFields[ipos++].Replace(".", "")); + l.mLightDistributionDataSource = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition) + "," + ParserSTEP.LinkToString(mColourAppearance) + "," + + ParserSTEP.DoubleToString(mColourTemperature) + "," + ParserSTEP.DoubleToString(mLuminousFlux) + ",." + + mLightEmissionSource.ToString() + ".," + ParserSTEP.LinkToString(mLightDistributionDataSource); + } + } + public class IfcLightSourcePositional : IfcLightSource + { + internal int mPosition;// : IfcCartesianPoint; + internal double mRadius;// : IfcPositiveLengthMeasure; + internal double mConstantAttenuation;// : IfcReal; + internal double mDistanceAttenuation;// : IfcReal; + internal double mQuadricAttenuation;// : IfcReal; + internal IfcLightSourcePositional() : base() { } + internal IfcLightSourcePositional(IfcLightSourcePositional el) + : base((IfcLightSource)el) + { + mPosition = el.mPosition; + mRadius = el.mRadius; + mConstantAttenuation = el.mConstantAttenuation; + mDistanceAttenuation = el.mDistanceAttenuation; + mQuadricAttenuation = el.mQuadricAttenuation; + } + internal static IfcLightSourcePositional Parse(string strDef) { IfcLightSourcePositional l = new IfcLightSourcePositional(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLightSourcePositional l, List arrFields, ref int ipos) + { + IfcLightSource.parseFields(l, arrFields, ref ipos); + l.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); + l.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mConstantAttenuation = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mDistanceAttenuation = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mQuadricAttenuation = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition) + "," + ParserSTEP.DoubleToString(mRadius) + "," + + ParserSTEP.DoubleToString(mConstantAttenuation) + "," + ParserSTEP.DoubleToString(mDistanceAttenuation) + "," + + ParserSTEP.DoubleToString(mQuadricAttenuation); + } + } + public class IfcLightSourceSpot : IfcLightSource + { + internal int mOrientation;// : IfcDirection; + internal double mConcentrationExponent;// : IfcReal; + internal double mSpreadAngle;// : IfcPositivePlaneAngleMeasure; + internal double mBeamWidthAngle;// : IfcPositivePlaneAngleMeasure; + internal IfcLightSourceSpot() : base() { } + internal IfcLightSourceSpot(IfcLightSourceSpot el) : base(el) { mOrientation = el.mOrientation; mConcentrationExponent = el.mConcentrationExponent; mSpreadAngle = el.mSpreadAngle; mBeamWidthAngle = el.mBeamWidthAngle; } + internal static IfcLightSourceSpot Parse(string strDef) { IfcLightSourceSpot l = new IfcLightSourceSpot(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLightSourceSpot l, List arrFields, ref int ipos) { IfcLightSource.parseFields(l, arrFields, ref ipos); l.mOrientation = ParserSTEP.ParseLink(arrFields[ipos++]); l.mConcentrationExponent = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mSpreadAngle = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mBeamWidthAngle = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mOrientation) + "," + ParserSTEP.DoubleToString(mConcentrationExponent) + "," + ParserSTEP.DoubleToString(mSpreadAngle) + "," + ParserSTEP.DoubleToString(mBeamWidthAngle); } + } + public partial class IfcLine : IfcCurve + { + internal int mPnt;// : IfcCartesianPoint; + internal int mDir;// : IfcVector; + + public IfcCartesianPoint Pnt { get { return mDatabase.mIfcObjects[mPnt] as IfcCartesianPoint; } set { mPnt = value.mIndex; } } + public IfcVector Dir { get { return mDatabase.mIfcObjects[mDir] as IfcVector; } set { mDir = value.mIndex; } } + + internal IfcLine() : base() { } + internal IfcLine(IfcLine l) : base(l) { mPnt = l.mPnt; mDir = l.mDir; } + internal static IfcLine Parse(string strDef) { IfcLine l = new IfcLine(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLine l, List arrFields, ref int ipos) { IfcCurve.parseFields(l, arrFields, ref ipos); l.mPnt = ParserSTEP.ParseLink(arrFields[ipos++]); l.mDir = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPnt) + "," + ParserSTEP.LinkToString(mDir); } + } + public class IfcLinearDimension : IfcDimensionCurveDirectedCallout // DEPRECEATED IFC4 + { + internal IfcLinearDimension() : base() { } + internal IfcLinearDimension(IfcAngularDimension el) : base((IfcDimensionCurveDirectedCallout)el) { } + internal new static IfcLinearDimension Parse(string strDef) { IfcLinearDimension d = new IfcLinearDimension(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcLinearDimension d, List arrFields, ref int ipos) { IfcDimensionCurveDirectedCallout.parseFields(d, arrFields, ref ipos); } + } + public class IfcLineIndex : IfcSegmentIndexSelect + { + internal List mIndices = new List(); + public IfcLineIndex(int a, int b) { mIndices.Add(a); mIndices.Add(b); } + public IfcLineIndex(IEnumerable indices) { mIndices.AddRange(indices); } + public override string ToString() + { + string indices = ""; + for (int icounter = 1; icounter < mIndices.Count; icounter++) + indices += "," + mIndices[icounter]; + return "IFCLINEINDEX((" + mIndices[0] + indices + "))"; + } + } + public partial class IfcLineSegment2D : IfcCurveSegment2D //IFC4x1 + { + internal IfcLineSegment2D() : base() { } + internal IfcLineSegment2D(IfcCircularArcSegment2D p) : base(p) { } + internal IfcLineSegment2D(IfcCartesianPoint start, double startDirection, double length) + : base(start, startDirection, length) { } + internal static void parseFields(IfcLineSegment2D c, List arrFields, ref int ipos) { IfcCurveSegment2D.parseFields(c, arrFields, ref ipos); } + internal static IfcLineSegment2D Parse(string strDef) { IfcLineSegment2D c = new IfcLineSegment2D(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + } + public partial class IfcLocalPlacement : IfcObjectPlacement + { + private int mPlacementRelTo;// : OPTIONAL IfcObjectPlacement; + private int mRelativePlacement;// : IfcAxis2Placement; + + private bool mSet = false; + + internal IfcObjectPlacement PlacementRelTo + { + get { return mDatabase.mIfcObjects[mPlacementRelTo] as IfcObjectPlacement; } + set { mPlacementRelTo = (value == null ? 0 : value.mIndex); } + } + internal IfcAxis2Placement RelativePlacement + { + get { return mDatabase.mIfcObjects[mRelativePlacement] as IfcAxis2Placement; } + set { mRelativePlacement = value.Index; mSet = false; } + } + + internal IfcLocalPlacement() : base() { } + internal IfcLocalPlacement(IfcLocalPlacement p) : base(p) { mPlacementRelTo = p.mPlacementRelTo; mRelativePlacement = p.mRelativePlacement; } + public IfcLocalPlacement(IfcAxis2Placement placement) : base(placement.Database, null) { mRelativePlacement = placement.Index; } + public IfcLocalPlacement(IfcObjectPlacement relativeTo, IfcAxis2Placement placement) : this(placement) { if(relativeTo != null) mPlacementRelTo = relativeTo.mIndex; } + + internal static IfcLocalPlacement Parse(string strDef) { IfcLocalPlacement p = new IfcLocalPlacement(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcLocalPlacement p, List arrFields, ref int ipos) { IfcObjectPlacement.parseFields(p, arrFields, ref ipos); p.mPlacementRelTo = ParserSTEP.ParseLink(arrFields[ipos++]); p.mRelativePlacement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mOutputEssential || (mPlacesObject.Count == 0 && mReferencedByPlacements.Count == 0)) + return ""; + return base.BuildString() + "," + ParserSTEP.LinkToString(mPlacementRelTo) + "," + ParserSTEP.LinkToString(mRelativePlacement == 0 ? mDatabase.WorldCoordinatePlacement.mIndex : mRelativePlacement); + } + + internal void setReference() { if (mPlacementRelTo > 0) PlacementRelTo.mReferencedByPlacements.Add(this); } + } + public class IfcLocalTime : BaseClassIfc // DEPRECEATED IFC4 + { + internal int mHourComponent;// : IfcHourInDay; + internal int mMinuteComponent;// : OPTIONAL IfcMinuteInHour; + internal double mSecondComponent;// : OPTIONAL IfcSecondInMinute; + internal int mZone;// OPTIONAL IfcCoordinatedUniversalTimeOffset; + internal int mDaylightSavingOffset;// : OPTIONAL IfcDaylightSavingHour; + + public IfcCoordinatedUniversalTimeOffset Zone { get { return mDatabase.mIfcObjects[mZone] as IfcCoordinatedUniversalTimeOffset; } set { mZone = (value == null ? 0 : value.mIndex); } } + public int DaylightSavingOffset { get { return mDaylightSavingOffset; } set { mDaylightSavingOffset = value; } } + internal IfcLocalTime() : base() { } + internal IfcLocalTime(IfcLocalTime t) : base() + { + mHourComponent = t.mHourComponent; + mMinuteComponent = t.mMinuteComponent; + mSecondComponent = t.mSecondComponent; + mZone = t.mZone; + mDaylightSavingOffset = t.mDaylightSavingOffset; + } + internal IfcLocalTime(DatabaseIfc m, int hour, int min, int sec) : base(m) { mHourComponent = hour; mMinuteComponent = min; mSecondComponent = sec; } + internal static void parseFields(IfcLocalTime s, List arrFields, ref int ipos) + { + s.mHourComponent = int.Parse(arrFields[ipos++]); + s.mMinuteComponent = ParserSTEP.ParseInt(arrFields[ipos++]); + s.mSecondComponent = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mZone = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mDaylightSavingOffset = int.Parse(arrFields[ipos++]); + } + internal static IfcLocalTime Parse(string strDef) { IfcLocalTime t = new IfcLocalTime(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + "," + mHourComponent + "," + mMinuteComponent + "," + ParserSTEP.DoubleToString(mSecondComponent) + "," + ParserSTEP.LinkToString(mZone) + "," + mDaylightSavingOffset; } + } + public partial class IfcLoop : IfcTopologicalRepresentationItem /*SUPERTYPE OF (ONEOF (IfcEdgeLoop ,IfcPolyLoop ,IfcVertexLoop))*/ + { + internal IfcLoop() : base() { } + internal IfcLoop(IfcLoop o) : base(o) { } + internal IfcLoop(DatabaseIfc m) : base(m) { } + internal static IfcLoop Parse(string strDef) { IfcLoop l = new IfcLoop(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcLoop l, List arrFields, ref int ipos) { IfcTopologicalRepresentationItem.parseFields(l, arrFields, ref ipos); } + } + public partial class IfcLShapeProfileDef : IfcParameterizedProfileDef + { + internal double mDepth, mWidth, mThickness;// : IfcPositiveLengthMeasure; + internal double mFilletRadius, mEdgeRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mLegSlope;// : OPTIONAL IfcPlaneAngleMeasure; + //internal double mCentreOfGravityInX, mCentreOfGravityInY;// : OPTIONAL IfcPositiveLengthMeasure + internal IfcLShapeProfileDef() : base() { } + internal IfcLShapeProfileDef(IfcLShapeProfileDef p) + : base(p) + { + mDepth = p.mDepth; + mWidth = p.mWidth; + mThickness = p.mThickness; + mFilletRadius = p.mFilletRadius; + mEdgeRadius = p.mEdgeRadius; + mLegSlope = p.mLegSlope; + } + + internal static void parseFields(IfcLShapeProfileDef p, List arrFields, ref int ipos, Schema schema) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mEdgeRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLegSlope = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + ipos += 2; + } + internal static IfcLShapeProfileDef Parse(string strDef, Schema schema) { IfcLShapeProfileDef p = new IfcLShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mDepth) + "," + ParserSTEP.DoubleToString(mWidth) + "," + ParserSTEP.DoubleToString(mThickness) + "," + ParserSTEP.DoubleToString(mFilletRadius) + "," + ParserSTEP.DoubleToString(mEdgeRadius) + "," + ParserSTEP.DoubleToString(mLegSlope) + (mDatabase.mSchema == Schema.IFC2x3 ? ",$,$" : ""); } + } +} diff --git a/IFC/IFC M.cs b/IFC/IFC M.cs new file mode 100644 index 0000000..cd2613c --- /dev/null +++ b/IFC/IFC M.cs @@ -0,0 +1,1113 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public abstract partial class IfcManifoldSolidBrep : IfcSolidModel /*ABSTRACT SUPERTYPE OF (ONEOF(IfcFacetedBrep,IfcFacetedBrepWithVoids, IFC4 IfcAdvancedBrep))*/ + { + private int mOuter;// : IfcClosedShell; + + internal IfcClosedShell Outer { get { return mDatabase.mIfcObjects[mOuter] as IfcClosedShell; } set { mOuter = value.mIndex; } } + + protected IfcManifoldSolidBrep() : base() { } + protected IfcManifoldSolidBrep(IfcManifoldSolidBrep p) : base() { mOuter = p.mOuter; } + protected IfcManifoldSolidBrep(IfcClosedShell s) : base(s.mDatabase) { Outer = s; } + + internal static void parseFields(IfcManifoldSolidBrep b, List arrFields, ref int ipos) { IfcSolidModel.parseFields(b, arrFields, ref ipos); b.mOuter = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mOuter); } + } + public class IfcMapConversion : IfcCoordinateOperation //IFC4 + { + internal double mEastings, mNorthings, mOrthogonalHeight;// : IfcLengthMeasure; + internal double mXAxisAbscissa, mXAxisOrdinate, mScale;// : OPTIONAL IfcReal; + internal IfcMapConversion() : base() { } + internal IfcMapConversion(IfcMapConversion i) : base(i) { mEastings = i.mEastings; mNorthings = i.mNorthings; mOrthogonalHeight = i.mOrthogonalHeight; mXAxisAbscissa = i.mXAxisAbscissa; mXAxisOrdinate = i.mXAxisOrdinate; mScale = i.mScale; } + internal IfcMapConversion(DatabaseIfc m, IfcCoordinateReferenceSystemSelect source, IfcCoordinateReferenceSystem target, double eastings, double northings, double orthogonalHeight, double XAxisAbscissa, double XAxisOrdinate, double scale) + : base(m, source, target) + { + mEastings = eastings; + mNorthings = northings; + mOrthogonalHeight = orthogonalHeight; + mXAxisAbscissa = XAxisAbscissa; + mXAxisOrdinate = XAxisOrdinate; + mScale = scale; + } + internal static IfcMapConversion Parse(string strDef) { IfcMapConversion b = new IfcMapConversion(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcMapConversion b, List arrFields, ref int ipos) + { + IfcCoordinateOperation.parseFields(b, arrFields, ref ipos); + b.mEastings = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mNorthings = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mOrthogonalHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mXAxisAbscissa = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mXAxisOrdinate = ParserSTEP.ParseDouble(arrFields[ipos++]); + b.mScale = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mEastings) + "," + ParserSTEP.DoubleToString(mNorthings) + "," + ParserSTEP.DoubleToString(mOrthogonalHeight) + "," + ParserSTEP.DoubleOptionalToString(mXAxisAbscissa) + "," + ParserSTEP.DoubleOptionalToString(mXAxisOrdinate) + "," + ParserSTEP.DoubleOptionalToString(mScale); } + } + public partial class IfcMappedItem : IfcRepresentationItem + { + private int mMappingSource;// : IfcRepresentationMap; + private int mMappingTarget;// : IfcCartesianTransformationOperator; + + public IfcRepresentationMap MappingSource { get { return mDatabase.mIfcObjects[mMappingSource] as IfcRepresentationMap; } } + internal IfcCartesianTransformationOperator MappingTarget { get { return mDatabase.mIfcObjects[mMappingTarget] as IfcCartesianTransformationOperator; } } + + internal IfcMappedItem() : base() { } + internal IfcMappedItem(IfcMappedItem i) : base(i) { mMappingSource = i.mMappingSource; mMappingTarget = i.mMappingTarget; } + internal IfcMappedItem(IfcRepresentationMap rm, IfcCartesianTransformationOperator co) : base(rm.mDatabase) { mMappingSource = rm.mIndex; mMappingTarget = co.mIndex; } + + internal static void parseFields(IfcMappedItem i, List arrFields, ref int ipos) { IfcRepresentationItem.parseFields(i, arrFields, ref ipos); i.mMappingSource = ParserSTEP.ParseLink(arrFields[ipos++]); i.mMappingTarget = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcMappedItem Parse(string strDef) { IfcMappedItem i = new IfcMappedItem(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mMappingSource) + "," + ParserSTEP.LinkToString(mMappingTarget); } + } + public partial class IfcMaterial : IfcMaterialDefinition + { + //internal IfcRelAssociatesMaterial mRelAssociates = null; + private string mName = "";// : IfcLabel; + private string mDescription = "$";// : OPTIONAL IfcText; + private string mCategory = "$";// : OPTIONAL IfcLabel; + + //INVERSE + internal IfcMaterialDefinitionRepresentation mHasRepresentation = null;// : SET [0:1] OF IfcMaterialDefinitionRepresentation FOR RepresentedMaterial; + //internal IfcMaterialclassificationRelationship mClassifiedAs = null;// : SET [0:1] OF IfcMaterialClassificationRelationship FOR classifiedMaterial; + internal List mHasPropertiesSS = new List(); + internal List mIsRelatedWith = new List();// : SET OF IfcMaterialRelationship FOR RelatedMaterials; + internal IfcMaterialRelationship mRelatesTo = null;// : SET [0:1] OF IfcMaterialRelationship FOR RelatingMaterial; + + public override string Name { get { return ParserIfc.Decode(mName); } set { mName = (string.IsNullOrEmpty(value) ? "UNKNOWN NAME" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Category { get { return (mCategory == "$" ? "" : ParserIfc.Decode(mCategory)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcMaterialDefinitionRepresentation HasRepresentation { get { return mHasRepresentation; } } + + public override IfcMaterial PrimaryMaterial { get { return this; } } + + public IfcMaterial() : base() { } + internal IfcMaterial(IfcMaterial m) : base(m) { mName = m.mName; mDescription = m.mDescription; mCategory = m.mCategory; } + public IfcMaterial(DatabaseIfc m, string name) : base(m) { Name = name; } + + internal static IfcMaterial Parse(string strDef, Schema schema) { IfcMaterial m = new IfcMaterial(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return m; } + internal static void parseFields(IfcMaterial m, List arrFields, ref int ipos, Schema schema) + { + IfcMaterialDefinition.parseFields(m, arrFields, ref ipos); + m.mName = arrFields[ipos++].Replace("'", ""); + if (schema != Schema.IFC2x3) + { + try + { + m.mDescription = arrFields[ipos++].Replace("'", ""); + m.mCategory = arrFields[ipos++].Replace("'", ""); + } + catch (Exception) { } + } + } + protected override string BuildString() { return base.BuildString() + ",'" + mName + (mDatabase.mSchema == Schema.IFC2x3 ? "'" : (mDescription == "$" ? "',$," : "','" + mDescription + "',") + (mCategory == "$" ? "$" : "'" + mCategory + "'")); } + internal void associateElement(IfcElement el) { Associates.mRelatedObjects.Add(el.mIndex); } + internal void associateElement(IfcElementType eltype) { Associates.mRelatedObjects.Add(eltype.mIndex); } + internal void associateElement(IfcStructuralMember memb) { Associates.mRelatedObjects.Add(memb.mIndex); } + } + public class IfcMaterialClassificationRelationship : BaseClassIfc + { + internal List mMaterialClassifications = new List();// : SET [1:?] OF IfcClassificationNotationSelect; + internal int mClassifiedMaterial;// : IfcMaterial; + internal IfcMaterialClassificationRelationship() : base() { } + internal IfcMaterialClassificationRelationship(IfcMaterialClassificationRelationship m) : base() { mMaterialClassifications = new List(m.mMaterialClassifications.ToArray()); mClassifiedMaterial = m.mClassifiedMaterial; } + internal IfcMaterialClassificationRelationship(DatabaseIfc db) : base(db) { } + internal static IfcMaterialClassificationRelationship Parse(string strDef) { IfcMaterialClassificationRelationship r = new IfcMaterialClassificationRelationship(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcMaterialClassificationRelationship r, List arrFields, ref int ipos) { r.mMaterialClassifications = ParserSTEP.SplitListLinks(arrFields[ipos++]); r.mClassifiedMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mMaterialClassifications[0]); + for (int icounter = 1; icounter < mMaterialClassifications.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mMaterialClassifications[icounter]); + return str + ")," + ParserSTEP.LinkToString(mClassifiedMaterial); + } + } + public partial class IfcMaterialConstituent : IfcMaterialDefinition //IFC4 + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText + internal int mMaterial;// : IfcMaterial; + internal double mFraction;// : OPTIONAL IfcNormalisedRatioMeasure; + internal string mCategory = "$";// : OPTIONAL IfcLabel; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcMaterial Material { get { return mDatabase.mIfcObjects[mMaterial] as IfcMaterial; } set { mMaterial = (value == null ? 0 : value.mIndex); } } + public double Fraction { get { return mFraction; } set { mFraction = value; } } + public string Category { get { return (mCategory == "$" ? "" : ParserIfc.Decode(mCategory)); } set { mCategory = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + public override IfcMaterial PrimaryMaterial { get { return Material; } } + + internal IfcMaterialConstituent() : base() { } + internal IfcMaterialConstituent(IfcMaterialConstituent m) : base(m) { mName = m.mName; mDescription = m.mDescription; mMaterial = m.mMaterial; mFraction = m.mFraction; mCategory = m.mCategory; } + public IfcMaterialConstituent(string name, string desc, IfcMaterial mat, double fraction, string category) + : base(mat.mDatabase) + { + Name = name; + Description = desc; + mMaterial = mat.mIndex; + mFraction = fraction; + Category = category; + } + internal static IfcMaterialConstituent Parse(string strDef) { IfcMaterialConstituent m = new IfcMaterialConstituent(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMaterialConstituent m, List arrFields, ref int ipos) + { + IfcMaterialDefinition.parseFields(m, arrFields, ref ipos); + m.mName = arrFields[ipos++].Replace("'", ""); + m.mDescription = arrFields[ipos++].Replace("'", ""); + m.mMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); + m.mFraction = ParserSTEP.ParseDouble(arrFields[ipos++]); + m.mCategory = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + ParserSTEP.LinkToString(mMaterial) + "," + ParserSTEP.DoubleToString(mFraction) + (mCategory == "$" ? ",$" : ",'" + mDescription + "'"); } + } + public partial class IfcMaterialConstituentSet : IfcMaterialDefinition + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText + internal List mMaterialConstituents = new List();// LIST [1:?] OF IfcMaterialConstituent; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List MaterialConstituents { get { return mMaterialConstituents.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcMaterialConstituent); } } + + public override IfcMaterial PrimaryMaterial { get { return MaterialConstituents[0].PrimaryMaterial; } } + + internal IfcMaterialConstituentSet() : base() { } + internal IfcMaterialConstituentSet(IfcMaterialConstituentSet m) : base(m) { mMaterialConstituents = new List(m.mMaterialConstituents.ToArray()); mName = m.mName; mDescription = m.mDescription; } + public IfcMaterialConstituentSet(string name, string desc, List mcs) + : base(mcs[0].mDatabase) + { + Name = name; + Description = desc; + mMaterialConstituents = mcs.ConvertAll(x => x.mIndex); + } + internal static IfcMaterialConstituentSet Parse(string strDef) { IfcMaterialConstituentSet m = new IfcMaterialConstituentSet(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMaterialConstituentSet m, List arrFields, ref int ipos) + { + IfcMaterialDefinition.parseFields(m, arrFields, ref ipos); + m.mName = arrFields[ipos++].Replace("'", ""); + m.mDescription = arrFields[ipos++].Replace("'", ""); + m.mMaterialConstituents = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = ParserSTEP.LinkToString(mMaterialConstituents[0]); + for (int icounter = 1; icounter < mMaterialConstituents.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mMaterialConstituents[icounter]); + return base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$,(" : "'" + mDescription + "',(") + str + ")"; + } + } + public abstract partial class IfcMaterialDefinition : BaseClassIfc, IfcMaterialSelect, IfcResourceObjectSelect // ABSTRACT SUPERTYPE OF (ONEOF (IfcMaterial ,IfcMaterialConstituent ,IfcMaterialConstituentSet ,IfcMaterialLayer ,IfcMaterialProfile ,IfcMaterialProfileSet)); + { + //INVERSE + internal List mAssociatedTo = new List(); + internal List mHasExternalReferences = new List(); //IFC4 + private List mHasProperties = new List(); + internal List mHasConstraintRelationships = new List(); //gg + public IfcRelAssociatesMaterial Associates + { + get + { + if (mAssociatedTo.Count == 0) + { + new IfcRelAssociatesMaterial(this); + } + return mAssociatedTo[0]; + } + set { mAssociatedTo.Add(value); } + } + public List HasExternalReferences { get { return mHasExternalReferences; } } + internal List HasProperties { get { return mHasProperties; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + public virtual IfcMaterial PrimaryMaterial { get { return null; } } + + protected IfcMaterialDefinition() : base() { } + protected IfcMaterialDefinition(IfcMaterialDefinition i) : base() { } + protected IfcMaterialDefinition(DatabaseIfc m) : base(m) { new IfcRelAssociatesMaterial(this); } + protected static void parseFields(IfcMaterialDefinition m, List arrFields, ref int ipos) { } + + internal void AddProperties(IfcMaterialProperties mp) { mHasProperties.Add(mp); } + } + public class IfcMaterialDefinitionRepresentation : IfcProductRepresentation + { + internal int mRepresentedMaterial;// : IfcMaterial; + + internal new List Representations { get { return mRepresentations.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcStyledRepresentation); } } + internal IfcMaterial RepresentedMaterial { get { return mDatabase.mIfcObjects[mRepresentedMaterial] as IfcMaterial; } } + + internal IfcMaterialDefinitionRepresentation() : base() { } + internal IfcMaterialDefinitionRepresentation(IfcMaterialDefinitionRepresentation i) : base(i) { mRepresentedMaterial = i.mRepresentedMaterial; } + internal IfcMaterialDefinitionRepresentation(IfcStyledRepresentation representation, IfcMaterial mat) : base(representation) { mRepresentedMaterial = mat.mIndex; mat.mHasRepresentation = this; } + public IfcMaterialDefinitionRepresentation(List representations, IfcMaterial mat) : base(representations.ConvertAll(x => x as IfcRepresentation)) { mRepresentedMaterial = mat.mIndex; mat.mHasRepresentation = this; } + + internal new static IfcMaterialDefinitionRepresentation Parse(string strDef) { IfcMaterialDefinitionRepresentation m = new IfcMaterialDefinitionRepresentation(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMaterialDefinitionRepresentation m, List arrFields, ref int ipos) { IfcProductRepresentation.parseFields(m, arrFields, ref ipos); m.mRepresentedMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRepresentedMaterial); } + + internal override void relate() + { + base.relate(); + IfcMaterial m = RepresentedMaterial; + if (m != null) + m.mHasRepresentation = this; + } + } + public partial class IfcMaterialLayer : IfcMaterialDefinition + { + internal int mMaterial;// : OPTIONAL IfcMaterial; + internal double mLayerThickness;// :: IfcNonNegativeLengthMeasure IFC4Chagne IfcPositiveLengthMeasure; + internal IfcLogicalEnum mIsVentilated = IfcLogicalEnum.UNKNOWN;// : OPTIONAL IfcLogical; + internal string mName = "$";// : OPTIONAL IfcLabel; IFC4 + internal string mDescription = "$";// : OPTIONAL IfcText; IFC4 + internal string mCategory = "$";// : OPTIONAL IfcLabel; IFC4 + internal double mPriority = 0;// : OPTIONAL IfcNormalisedRatioMeasure; + + public IfcMaterial Material { get { return mDatabase.mIfcObjects[mMaterial] as IfcMaterial; } set { mMaterial = (value == null ? 0 : value.mIndex); } } + public double LayerThickness { get { return mLayerThickness; } set { mLayerThickness = value; } } + public IfcLogicalEnum IsVentilated { get { return mIsVentilated; } set { mIsVentilated = value; } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Category { get { return (mCategory == "$" ? "" : ParserIfc.Decode(mCategory)); } set { mCategory = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public double Priority { get { return mPriority; } set { mPriority = value; } } + + public override IfcMaterial PrimaryMaterial { get { return Material; } } + + internal IfcMaterialLayer() : base() { } + internal IfcMaterialLayer(IfcMaterialLayer m) : base(m) { mMaterial = m.mMaterial; mLayerThickness = m.mLayerThickness; mIsVentilated = m.mIsVentilated; } + public IfcMaterialLayer(DatabaseIfc db, double thickness, string name) : base(db) { mLayerThickness = Math.Abs(thickness); Name = name; } + public IfcMaterialLayer(IfcMaterial mat, double thickness, string name) + : base(mat.mDatabase) + { + mName = mat.Name; + Material = mat; + mLayerThickness = Math.Abs(thickness); + if(!string.IsNullOrEmpty(name)) + Name = name; + } + internal static IfcMaterialLayer Parse(string strDef,Schema schema) { IfcMaterialLayer m = new IfcMaterialLayer(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcMaterialLayer m, List arrFields, ref int ipos,Schema schema) + { + IfcMaterialDefinition.parseFields(m, arrFields, ref ipos); + m.mMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); + m.mLayerThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + m.mIsVentilated = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + try + { + if (schema != Schema.IFC2x3) + { + m.mName = arrFields[ipos++].Replace("'", ""); + m.mDescription = arrFields[ipos++].Replace("'", ""); + m.mCategory = arrFields[ipos++].Replace("'", ""); + m.mPriority = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + } + catch (Exception) { } + } + protected override string BuildString() + { + string s = (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + (mCategory == "$" ? "$," : "'" + mCategory + "',") + ParserSTEP.DoubleOptionalToString(mPriority)); + return base.BuildString() + "," + ParserSTEP.LinkToString(mMaterial) + "," + ParserSTEP.DoubleToString(mLayerThickness) + "," + ParserIfc.LogicalToString(mIsVentilated) + s; + } + } + public partial class IfcMaterialLayerSet : IfcMaterialDefinition + { + private List mMaterialLayers = new List();// LIST [1:?] OF IfcMaterialLayer; + private string mLayerSetName = "$";// : OPTIONAL IfcLabel; + private string mDescription = "$";// : OPTIONAL IfcText + + internal List MaterialLayers { get { return mMaterialLayers.ConvertAll(x => (IfcMaterialLayer)mDatabase.mIfcObjects[x]); } } + internal string LayerSetName { get { return (mLayerSetName == "$" ? "" : ParserIfc.Decode(mLayerSetName)); } set { mLayerSetName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + public override string Name { get { return LayerSetName; } set { LayerSetName = value; } } + public override IfcMaterial PrimaryMaterial { get { return (mMaterialLayers.Count != 1 ? null : MaterialLayers[0].Material); } } + + internal IfcMaterialLayerSet() : base() { } + internal IfcMaterialLayerSet(IfcMaterialLayerSet m) : base(m) { mMaterialLayers = new List(m.mMaterialLayers.ToArray()); mLayerSetName = m.mLayerSetName; mDescription = m.mDescription; } + protected IfcMaterialLayerSet(DatabaseIfc db) : base(db) { } + public IfcMaterialLayerSet(IfcMaterialLayer layer, string name) : base(layer.mDatabase) { mMaterialLayers.Add(layer.mIndex); Name = name; } + public IfcMaterialLayerSet(List layers, string name) : base(layers[0].mDatabase) + { + Name = name; + mMaterialLayers = layers.ConvertAll(x => x.mIndex); + } + internal static IfcMaterialLayerSet Parse(string strDef, Schema schema) { IfcMaterialLayerSet m = new IfcMaterialLayerSet(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcMaterialLayerSet m, List arrFields, ref int ipos, Schema schema) + { + IfcMaterialDefinition.parseFields(m, arrFields, ref ipos); + m.mMaterialLayers = ParserSTEP.SplitListLinks(arrFields[ipos++]); + m.mLayerSetName = arrFields[ipos++].Replace("'", ""); + if (schema != Schema.IFC2x3) + m.mDescription = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mMaterialLayers[0]); + for (int icounter = 1; icounter < mMaterialLayers.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mMaterialLayers[icounter]); + return str + (mLayerSetName == "$" ? "),$" : "),'" + mLayerSetName + "'") + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mDescription == "$" ? ",$" : ",'" + mDescription + "'")); + } + } + public partial class IfcMaterialLayerSetUsage : IfcMaterialUsageDefinition + { + private int mForLayerSet;// : IfcMaterialLayerSet; + private IfcLayerSetDirectionEnum mLayerSetDirection = IfcLayerSetDirectionEnum.AXIS1;// : IfcLayerSetDirectionEnum; + private IfcDirectionSenseEnum mDirectionSense = IfcDirectionSenseEnum.POSITIVE;// : IfcDirectionSenseEnum; + private double mOffsetFromReferenceLine;// : IfcLengthMeasure; + private double mReferenceExtent = 0;// : IFC4 OPTIONAL IfcPositiveLengthMeasure; + + internal IfcMaterialLayerSet ForLayerSet { get { return mDatabase.mIfcObjects[mForLayerSet] as IfcMaterialLayerSet; } set { mForLayerSet = value.mIndex; } } + internal IfcLayerSetDirectionEnum LayerSetDirection { get { return mLayerSetDirection; } } + internal IfcDirectionSenseEnum DirectionSense { get { return mDirectionSense; } } + internal double OffsetFromReferenceLine { get { return mOffsetFromReferenceLine; } set { mOffsetFromReferenceLine = value; } } + internal double ReferenceExtent { get { return mReferenceExtent; } } + + public override IfcMaterial PrimaryMaterial { get { return ForLayerSet.PrimaryMaterial; } } + + internal IfcMaterialLayerSetUsage() : base() { } + internal IfcMaterialLayerSetUsage(IfcMaterialLayerSetUsage m) : base(m) { mForLayerSet = m.mForLayerSet; mLayerSetDirection = m.mLayerSetDirection; mDirectionSense = m.mDirectionSense; mOffsetFromReferenceLine = m.mOffsetFromReferenceLine; mReferenceExtent = m.mReferenceExtent; } + internal IfcMaterialLayerSetUsage(DatabaseIfc m, IfcMaterialLayerSet ls, IfcLayerSetDirectionEnum dir, IfcDirectionSenseEnum sense, double offset) : base(m) + { + mForLayerSet = ls.mIndex; + mLayerSetDirection = dir; + mDirectionSense = sense; + mOffsetFromReferenceLine = offset; + } + internal static IfcMaterialLayerSetUsage Parse(string strDef,Schema schema) { IfcMaterialLayerSetUsage u = new IfcMaterialLayerSetUsage(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return u; } + internal static void parseFields(IfcMaterialLayerSetUsage m, List arrFields, ref int ipos,Schema schema) + { + IfcMaterialUsageDefinition.parseFields(m, arrFields, ref ipos); + m.mForLayerSet = ParserSTEP.ParseLink(arrFields[ipos++]); + m.mLayerSetDirection = (IfcLayerSetDirectionEnum)Enum.Parse(typeof(IfcLayerSetDirectionEnum), arrFields[ipos++].Replace(".", "")); + m.mDirectionSense = (IfcDirectionSenseEnum)Enum.Parse(typeof(IfcDirectionSenseEnum), arrFields[ipos++].Replace(".", "")); + m.mOffsetFromReferenceLine = ParserSTEP.ParseDouble(arrFields[ipos++]); + try + { + if (schema != Schema.IFC2x3 && ipos + 1 < arrFields.Count) + m.mReferenceExtent = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + catch (Exception) { } + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mForLayerSet) + ",." + mLayerSetDirection.ToString() + ".,." + mDirectionSense.ToString() + ".," + ParserSTEP.DoubleToString(mOffsetFromReferenceLine) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : "," + ParserSTEP.DoubleOptionalToString(mReferenceExtent)); } + } + public class IfcMaterialLayerSetWithOffsets : IfcMaterialLayerSet + { + internal IfcLayerSetDirectionEnum mOffsetDirection = IfcLayerSetDirectionEnum.AXIS1; + internal double[] mOffsetValues = new double[2];// LIST [1:2] OF IfcLengthMeasure; + internal IfcMaterialLayerSetWithOffsets() : base() { } + internal IfcMaterialLayerSetWithOffsets(IfcMaterialLayerSetWithOffsets m) : base(m) { mOffsetDirection = m.mOffsetDirection; mOffsetValues = m.mOffsetValues; } + internal IfcMaterialLayerSetWithOffsets(IfcMaterialLayer layer, string name, IfcLayerSetDirectionEnum dir, double offset) + : base(layer, name) { mOffsetDirection = dir; mOffsetValues[0] = offset; } + internal IfcMaterialLayerSetWithOffsets(IfcMaterialLayer layer, string name, IfcLayerSetDirectionEnum dir, double offset1, double offset2) + : this(layer, name,dir,offset1) { mOffsetValues[1] = offset2; } + internal IfcMaterialLayerSetWithOffsets(List layers, string name, IfcLayerSetDirectionEnum dir, double offset) + : base(layers, name) { mOffsetDirection = dir; mOffsetValues[0] = offset; } + internal IfcMaterialLayerSetWithOffsets(List layers, string name, IfcLayerSetDirectionEnum dir, double offset1,double offset2) + : this(layers, name,dir,offset1) { mOffsetValues[1] = offset2; } + internal new static IfcMaterialLayerSetWithOffsets Parse(string strDef,Schema schema) { IfcMaterialLayerSetWithOffsets m = new IfcMaterialLayerSetWithOffsets(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcMaterialLayerSetWithOffsets m, List arrFields, ref int ipos,Schema schema) + { + IfcMaterialLayerSet.parseFields(m, arrFields, ref ipos,schema); + m.mOffsetDirection = (IfcLayerSetDirectionEnum)Enum.Parse(typeof(IfcLayerSetDirectionEnum), arrFields[ipos++].Replace(".", "")); + string s = arrFields[ipos++]; + string[] ss = s.Substring(1, s.Length - 2).Split(",".ToCharArray()); + m.mOffsetValues[0] = ParserSTEP.ParseDouble(ss[0]); + if(ss.Length > 1) + m.mOffsetValues[1] = ParserSTEP.ParseDouble(ss[1]); + } + protected override string BuildString() { return base.BuildString() + ",." + mOffsetDirection.ToString() + ".,(" + ParserSTEP.DoubleToString( mOffsetValues[0]) + (Math.Abs(mOffsetValues[1]) > mDatabase.Tolerance ? "," + ParserSTEP.DoubleToString( mOffsetValues[1]) : "") + ")"; } + } + public class IfcMaterialLayerWithOffsets : IfcMaterialLayer + { + internal IfcLayerSetDirectionEnum mOffsetDirection = IfcLayerSetDirectionEnum.AXIS1;// : IfcLayerSetDirectionEnum; + internal double[] mOffsetValues = new double[2];// : ARRAY [1:2] OF IfcLengthMeasure; + internal IfcMaterialLayerWithOffsets() : base() { } + internal IfcMaterialLayerWithOffsets(IfcMaterialLayerWithOffsets m) : base(m) { mOffsetDirection = m.mOffsetDirection; mOffsetValues = m.mOffsetValues; } + internal IfcMaterialLayerWithOffsets(IfcMaterial mat, double thickness, string name, IfcLayerSetDirectionEnum d, double startOffset) + : base(mat, thickness, name) { mOffsetDirection = d; mOffsetValues = new double[]{ startOffset}; } + internal IfcMaterialLayerWithOffsets(IfcMaterial mat, double thickness, string name, IfcLayerSetDirectionEnum d, double startOffset,double endOffset) + : base(mat, thickness, name) { mOffsetDirection = d; mOffsetValues = new double[]{ startOffset,endOffset}; } + internal static IfcMaterialLayerWithOffsets Parse(string strDef) { IfcMaterialLayerWithOffsets m = new IfcMaterialLayerWithOffsets(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMaterialLayerWithOffsets m, List arrFields, ref int ipos) + { + IfcMaterialLayer.parseFields(m, arrFields, ref ipos); + m.mOffsetDirection = (IfcLayerSetDirectionEnum)Enum.Parse(typeof(IfcLayerSetDirectionEnum), arrFields[ipos++].Replace(".", "")); + string s = arrFields[ipos++]; + List arrNodes = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + m.mOffsetValues = arrNodes.ConvertAll(x => ParserSTEP.ParseDouble(x)).ToArray(); + } + protected override string BuildString() { return base.BuildString() + ",." + mOffsetDirection.ToString() + ".(," + ParserSTEP.DoubleToString(mOffsetValues[0]) + (mOffsetValues.Length > 1 ? "," + ParserSTEP.DoubleToString(mOffsetValues[1]) : "") + ")"; } + } + public partial class IfcMaterialList : BaseClassIfc, IfcMaterialSelect //DEPRECEATED IFC4 + { + internal List mMaterials = new List();// LIST [1:?] OF IfcMaterial; + + internal List Materials { get { return mMaterials.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcMaterial); } } + + internal List mAssociatedTo = new List(); + public IfcRelAssociatesMaterial Associates + { + get + { + if (mAssociatedTo.Count == 0) + { + new IfcRelAssociatesMaterial(this); + } + return mAssociatedTo[0]; + } + set { mAssociatedTo.Add(value); } + } + + public IfcMaterial PrimaryMaterial { get { return mDatabase.mIfcObjects[mMaterials[0]] as IfcMaterial; } } + + internal IfcMaterialList() : base() { } + internal IfcMaterialList(IfcMaterialList m) : base() { mMaterials = new List(m.mMaterials.ToArray()); } + internal static IfcMaterialList Parse(string strDef) { IfcMaterialList m = new IfcMaterialList(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMaterialList m, List arrFields, ref int ipos) { m.mMaterials = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mMaterials[0]); + for (int icounter = 1; icounter < mMaterials.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mMaterials[icounter]); + return str + ")"; + } + } + public partial class IfcMaterialProfile : IfcMaterialDefinition // IFC4 + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal int mMaterial;// : OPTIONAL IfcMaterial; + internal int mProfile;// : OPTIONAL IfcProfileDef; + internal double mPriority;// : OPTIONAL IfcNormalisedRatioMeasure + internal string mCategory = "$";// : OPTIONAL IfcLabel + // INVERSE + private IfcMaterialProfileSet mToMaterialProfileSet = null;// : IfcMaterialProfileSet FOR + + public IfcMaterial Material { get { return mDatabase.mIfcObjects[mMaterial] as IfcMaterial; } set { mMaterial = (value == null ? 0 : value.mIndex); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcProfileDef Profile { get { return mDatabase.mIfcObjects[mProfile] as IfcProfileDef; } set { mProfile = (value == null ? 0 : value.mIndex); } } + public string Category { get { return (mCategory == "$" ? "" : ParserIfc.Decode(mCategory)); } set { mCategory = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public double Priority { get { return mPriority; } set { mPriority = value; } } + public IfcMaterialProfileSet ToMaterialProfileSet { get { return mToMaterialProfileSet; } set { mToMaterialProfileSet = value; } } + + public override IfcMaterial PrimaryMaterial { get { return Material; } } + + internal IfcMaterialProfile() : base() { } + internal IfcMaterialProfile(IfcMaterialProfile p) : base(p) { mName = p.mName; mDescription = p.mDescription; mMaterial = p.mMaterial; mProfile = p.mProfile; mPriority = p.mPriority; mCategory = p.mCategory; } + public IfcMaterialProfile(DatabaseIfc db) : base(db) { } + public IfcMaterialProfile(string name, IfcMaterial mat, IfcProfileDef p) : base(mat == null ? p.mDatabase : mat.mDatabase) + { + Name = name; + Material = mat; + Profile = p; + } + protected static void parseFields(IfcMaterialProfile l, List arrFields, ref int ipos) + { + IfcMaterialDefinition.parseFields(l, arrFields, ref ipos); + l.mName = arrFields[ipos++].Replace("'", ""); + l.mDescription = arrFields[ipos++].Replace("'", ""); + l.mMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); + l.mProfile = ParserSTEP.ParseLink(arrFields[ipos++]); + l.mPriority = ParserSTEP.ParseDouble(arrFields[ipos++]); + l.mCategory = arrFields[ipos++].Replace("'", ""); + } + internal static IfcMaterialProfile Parse(string strDef) { IfcMaterialProfile m = new IfcMaterialProfile(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + ParserSTEP.LinkToString(mMaterial) + "," + ParserSTEP.LinkToString(mProfile) + "," + ParserSTEP.DoubleToString(mPriority) + (mCategory == "$" ? ",$" : ",'" + mCategory + "'")); } + } + public partial class IfcMaterialProfileSet : IfcMaterialDefinition //IFC4 + { + internal string mName = "$"; //: OPTIONAL IfcLabel; + internal string mDescription = "$"; //: OPTIONAL IfcText; + internal List mMaterialProfiles = new List();// LIST [1:?] OF IfcMaterialProfile; + internal int mCompositeProfile;// : OPTIONAL IfcCompositeProfileDef; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List MaterialProfiles { get { return mMaterialProfiles.ConvertAll(x=>mDatabase.mIfcObjects[x] as IfcMaterialProfile); } } + + public override IfcMaterial PrimaryMaterial { get { return (mMaterialProfiles.Count != 1 ? null : MaterialProfiles[0].Material); } } + + + internal IfcMaterialProfileSet() : base() { } + internal IfcMaterialProfileSet(IfcMaterialProfileSet m) : base(m) { mName = m.mName; mDescription = m.mDescription; mMaterialProfiles = new List(m.mMaterialProfiles.ToArray()); mCompositeProfile = m.mCompositeProfile; } + private IfcMaterialProfileSet(DatabaseIfc m, string name) : base(m) { Name = name; } + internal IfcMaterialProfileSet(string name, IfcMaterialProfile profile) + : base(profile.mDatabase) + { + Name = name; + + if (profile.ToMaterialProfileSet == null) + profile.ToMaterialProfileSet = this; + else + throw new Exception("Material Profile can be assigned to only a single profile set"); + mMaterialProfiles.Add(profile.mIndex); + } + internal IfcMaterialProfileSet(string name, List profiles) + : base(profiles[0].mDatabase) + { + List defs = new List(profiles.Count); + for (int icounter = 0; icounter < profiles.Count; icounter++) + { + IfcMaterialProfile mp = profiles[icounter]; + if (mp.ToMaterialProfileSet == null) + mp.ToMaterialProfileSet = this; + else + throw new Exception("Material Profile can be assigned to only a single profile set"); + mMaterialProfiles.Add(mp.mIndex); + if (mp.mProfile > 0) + defs.Add(mDatabase.mIfcObjects[mp.mProfile] as IfcProfileDef); + } + if (defs.Count > 0) + mCompositeProfile = new IfcCompositeProfileDef(name, defs, "").mIndex; + } + internal static IfcMaterialProfileSet Parse(string strDef) { IfcMaterialProfileSet m = new IfcMaterialProfileSet(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMaterialProfileSet m, List arrFields, ref int ipos) { IfcMaterialDefinition.parseFields(m, arrFields, ref ipos); m.mName = arrFields[ipos++].Replace("'", ""); m.mDescription = arrFields[ipos++].Replace("'", ""); m.mMaterialProfiles = ParserSTEP.SplitListLinks(arrFields[ipos++]); m.mCompositeProfile = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3 || mMaterialProfiles.Count == 0) + return ""; + string str = base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$,(" : "'" + mDescription + "',(") + ParserSTEP.LinkToString(mMaterialProfiles[0]); + for (int icounter = 1; icounter < mMaterialProfiles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mMaterialProfiles[icounter]); + return str + ")," + ParserSTEP.LinkToString(mCompositeProfile); + } + } + public partial class IfcMaterialProfileSetUsage : IfcMaterialUsageDefinition //IFC4 + { + internal int mForProfileSet;// : IfcMaterialProfileSet; + internal IfcCardinalPointReference mCardinalPoint = IfcCardinalPointReference.MID;// : IfcCardinalPointReference + internal double mReferenceExtent;// : IfcPositiveLengthMeasure; + + internal IfcMaterialProfileSet ForProfileSet { get { return mDatabase.mIfcObjects[mForProfileSet] as IfcMaterialProfileSet; } } + + public override IfcMaterial PrimaryMaterial { get { return ForProfileSet.PrimaryMaterial; } } + + internal IfcMaterialProfileSetUsage() : base() { } + internal IfcMaterialProfileSetUsage(IfcMaterialProfileSetUsage m) : base(m) { mForProfileSet = m.mForProfileSet; mCardinalPoint = m.mCardinalPoint; mReferenceExtent = m.mReferenceExtent; } + public IfcMaterialProfileSetUsage(DatabaseIfc m, IfcMaterialProfileSet ps, IfcCardinalPointReference ip, double refExtent) + : base(m) { mForProfileSet = ps.mIndex; mCardinalPoint = ip; mReferenceExtent = refExtent; } + internal static IfcMaterialProfileSetUsage Parse(string strDef) { IfcMaterialProfileSetUsage u = new IfcMaterialProfileSetUsage(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + internal static void parseFields(IfcMaterialProfileSetUsage m, List arrFields, ref int ipos) { IfcMaterialUsageDefinition.parseFields(m, arrFields, ref ipos); m.mForProfileSet = ParserSTEP.ParseLink(arrFields[ipos++]); m.mCardinalPoint = (IfcCardinalPointReference)ParserSTEP.ParseInt(arrFields[ipos++]); m.mReferenceExtent = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 || mAssociatedTo == null || Associates.mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mForProfileSet) + "," + (mCardinalPoint == IfcCardinalPointReference.DEFAULT ? "$" : ((int)mCardinalPoint).ToString()) + "," + ParserSTEP.DoubleOptionalToString(mReferenceExtent)); } + + } + public partial class IfcMaterialProfileSetUsageTapering : IfcMaterialProfileSetUsage //IFC4 + { + internal int mForProfileEndSet;// : IfcMaterialProfileSet; + internal IfcCardinalPointReference mCardinalEndPoint = IfcCardinalPointReference.MID;// : IfcCardinalPointReference + internal IfcMaterialProfileSet ForProfileEndSet { get { return mDatabase.mIfcObjects[mForProfileEndSet] as IfcMaterialProfileSet; } } + internal IfcMaterialProfileSetUsageTapering() : base() { } + internal IfcMaterialProfileSetUsageTapering(IfcMaterialProfileSetUsageTapering m) : base(m) { mForProfileSet = m.mForProfileSet; mCardinalEndPoint = m.mCardinalEndPoint; } + public IfcMaterialProfileSetUsageTapering(DatabaseIfc m, IfcMaterialProfileSet ps, IfcCardinalPointReference ip, double refExtent, IfcMaterialProfileSet eps, IfcCardinalPointReference eip) + : base(m, ps, ip, refExtent) { mForProfileEndSet = eps.mIndex; mCardinalEndPoint = eip; } + internal new static IfcMaterialProfileSetUsageTapering Parse(string strDef) { IfcMaterialProfileSetUsageTapering u = new IfcMaterialProfileSetUsageTapering(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + internal static void parseFields(IfcMaterialProfileSetUsageTapering m, List arrFields, ref int ipos) { IfcMaterialProfileSetUsage.parseFields(m, arrFields, ref ipos); m.mForProfileEndSet = ParserSTEP.ParseLink(arrFields[ipos++]); m.mCardinalEndPoint = (IfcCardinalPointReference)ParserSTEP.ParseInt(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 || mAssociatedTo == null || Associates.mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mForProfileEndSet) + "," + (int)mCardinalEndPoint); } + } + public class IfcMaterialProfileWithOffsets : IfcMaterialProfile //IFC4 + { + internal double[] mOffsetValues = new double[2];// ARRAY [1:2] OF IfcLengthMeasure; + internal IfcMaterialProfileWithOffsets() : base() { } + internal IfcMaterialProfileWithOffsets(IfcMaterialProfileWithOffsets m) : base(m) { mOffsetValues = m.mOffsetValues; } + public IfcMaterialProfileWithOffsets(string name, IfcMaterial mat, IfcProfileDef p, double startOffset) + : base(name, mat, p) { mOffsetValues = new double[] { startOffset }; } + public IfcMaterialProfileWithOffsets(string name, IfcMaterial mat, IfcProfileDef p, double startOffset,double endOffset) + : base(name, mat, p) { mOffsetValues = new double[] { startOffset,endOffset }; } + internal new static IfcMaterialProfileWithOffsets Parse(string strDef) { IfcMaterialProfileWithOffsets u = new IfcMaterialProfileWithOffsets(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + internal static void parseFields(IfcMaterialProfileWithOffsets m, List arrFields, ref int ipos) + { + IfcMaterialProfile.parseFields(m, arrFields, ref ipos); + string s = arrFields[ipos++]; + List arrNodes = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + m.mOffsetValues = arrNodes.ConvertAll(x => ParserSTEP.ParseDouble(x)).ToArray(); + } + protected override string BuildString() { return base.BuildString() + ",(" + ParserSTEP.DoubleToString(mOffsetValues[0]) + (mOffsetValues.Length > 1 ? "," + ParserSTEP.DoubleToString(mOffsetValues[1]) + ")" : ")"); } + } + public abstract class IfcMaterialPropertiesSuperSeded : BaseClassIfc //ABSTRACT SUPERTYPE OF (ONE(IfcExtendedMaterialProperties,IfcFuelProperties,IfcGeneralMaterialProperties,IfcHygroscopicMaterialProperties,IfcMechanicalMaterialProperties,IfcOpticalMaterialProperties,IfcProductsOfCombustionProperties,IfcThermalMaterialProperties,IfcWaterProperties)); + { + internal int mMaterial;// : IfcMaterial; + protected IfcMaterialPropertiesSuperSeded() : base() { } + protected IfcMaterialPropertiesSuperSeded(IfcMaterialPropertiesSuperSeded m) : base() { mMaterial = m.mMaterial; } + protected IfcMaterialPropertiesSuperSeded(IfcMaterial mat) : base(mat.mDatabase) { if (mat.mDatabase.mSchema != Schema.IFC2x3) throw new Exception(KeyWord + " Depreceated IFC4!"); mMaterial = mat.mIndex; } + protected static void parseFields(IfcMaterialPropertiesSuperSeded p, List arrFields, ref int ipos) { p.mMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mMaterial); } + internal void relate() + { + IfcMaterial m = mDatabase.mIfcObjects[mMaterial] as IfcMaterial; + if (m != null) + m.mHasPropertiesSS.Add(this); + } + } + public partial class IfcMaterialProperties : IfcExtendedProperties //IFC4 + { + private int mMaterial;// : IfcMaterialDefinition; + internal IfcMaterialDefinition Material { get { return mDatabase.mIfcObjects[mMaterial] as IfcMaterialDefinition; } } + + internal IfcMaterialProperties() : base() { } + internal IfcMaterialProperties(IfcMaterialProperties i) : base(i) { mMaterial = i.mMaterial; } + internal IfcMaterialProperties(string name, List props, IfcMaterialDefinition mat) : base(name, props) { mMaterial = mat.mIndex; } + + internal static IfcMaterialProperties Parse(string strDef, Schema schema) { IfcMaterialProperties b = new IfcMaterialProperties(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return b; } + internal static void parseFields(IfcMaterialProperties b, List arrFields, ref int ipos, Schema schema) { IfcExtendedProperties.parseFields(b, arrFields, ref ipos,schema); b.mMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3) + return ""; + return base.BuildString() + "," + ParserSTEP.LinkToString(mMaterial); + } + internal void relate() + { + IfcMaterialDefinition md = Material; + if (md != null) + md.AddProperties(this); + } + } + public class IfcMaterialRelationship : IfcResourceLevelRelationship //IFC4 + { + internal int mRelatingMaterial;// : IfcMaterial; + internal List mRelatedMaterials = new List(); // : SET [1:?] OF IfcMaterial; + internal string mExpression = "$";//: OPTIONAL IfcLabel; + internal IfcMaterialRelationship() : base() { } + internal IfcMaterialRelationship(IfcMaterialRelationship i) : base(i) { mRelatingMaterial = i.mRelatingMaterial; mRelatedMaterials.AddRange(i.mRelatedMaterials); mExpression = i.mExpression; } + internal IfcMaterialRelationship(string name, string description, IfcMaterial mat, List related, string expr) + : base(mat.mDatabase, name, description) { mRelatingMaterial = mat.mIndex; mRelatedMaterials = related.ConvertAll(x => x.mIndex); if (!string.IsNullOrEmpty(expr)) mExpression = expr.Replace("'", ""); } + internal static IfcMaterialRelationship Parse(string strDef, Schema schema) { IfcMaterialRelationship m = new IfcMaterialRelationship(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcMaterialRelationship m, List arrFields, ref int ipos, Schema schema) + { + IfcResourceLevelRelationship.parseFields(m, arrFields, ref ipos,schema); + m.mRelatingMaterial = ParserSTEP.ParseLink(arrFields[ipos++]); + m.mRelatedMaterials = ParserSTEP.SplitListLinks(arrFields[ipos++]); + m.mExpression = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3) + return ""; + string result = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingMaterial) + ",(" + ParserSTEP.LinkToString(mRelatedMaterials[0]); + for (int icounter = 1; icounter < mRelatedMaterials.Count; icounter++) + result += "," + ParserSTEP.LinkToString(mRelatedMaterials[icounter]); + return result += mExpression == "$" ? "),$" : "),'" + mExpression + "'"; + + } + //internal override void relate() + //{ + // base.relate(); + // IfcMaterial m = mModel.mIFCobjs[mRelatingMaterial] as IfcMaterial; + // if (m != null) + // m.mHasRepresentation = this; + //} + } + public partial interface IfcMaterialSelect : IfcInterface //IFC4 SELECT (IfcMaterialDefinition ,IfcMaterialList ,IfcMaterialUsageDefinition); + { + IfcRelAssociatesMaterial Associates { get; set; } + + IfcMaterial PrimaryMaterial { get; } //Geometry Gym Property + } + public abstract partial class IfcMaterialUsageDefinition : BaseClassIfc, IfcMaterialSelect // ABSTRACT SUPERTYPE OF(ONEOF(IfcMaterialLayerSetUsage, IfcMaterialProfileSetUsage)); + { //INVERSE + internal List mAssociatedTo = new List(); + public IfcRelAssociatesMaterial Associates + { + get + { + if (mAssociatedTo.Count == 0) + { + new IfcRelAssociatesMaterial(this); + } + return mAssociatedTo[0]; + } + set { mAssociatedTo.Add(value); } + } + + public abstract IfcMaterial PrimaryMaterial { get; } + + protected IfcMaterialUsageDefinition() : base() { } + protected IfcMaterialUsageDefinition(IfcMaterialUsageDefinition i) : base() { } + protected IfcMaterialUsageDefinition(DatabaseIfc m) : base(m) { IfcRelAssociatesMaterial am = new IfcRelAssociatesMaterial(this); } + protected static void parseFields(IfcMaterialUsageDefinition m, List arrFields, ref int ipos) { } + } + public class IfcMeasureWithUnit : BaseClassIfc, IfcAppliedValueSelect + { + internal IfcValue mValueComponent;// : IfcValue; + private int mUnitComponent;// : IfcUnit; + + internal IfcUnit UnitComponent { get { return mDatabase.mIfcObjects[mUnitComponent] as IfcUnit; } } + private string mVal; + internal IfcMeasureWithUnit(IfcMeasureWithUnit m) : base() { mValueComponent = m.mValueComponent; mUnitComponent = m.mUnitComponent; } + internal IfcMeasureWithUnit() : base() { } + internal IfcMeasureWithUnit(IfcValue v, IfcUnit u) : base(u.Database) { mValueComponent = v; mUnitComponent = u.Index; } + internal IfcMeasureWithUnit(double value, IfcUnit u) : base(u.Database) { mValueComponent = new IfcReal(value); mUnitComponent = u.Index; } + internal static IfcMeasureWithUnit Parse(string strDef) { IfcMeasureWithUnit m = new IfcMeasureWithUnit(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcMeasureWithUnit m, List arrFields, ref int ipos) + { + string s = arrFields[ipos++]; + m.mValueComponent = ParserIfc.parseValue(s); + if (m.mValueComponent == null) + m.mVal = s; m.mUnitComponent = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + (mValueComponent != null ? mValueComponent.ToString() : mVal) + "," + ParserSTEP.LinkToString(mUnitComponent); } + internal double getSIFactor() + { + IfcUnit u = UnitComponent; + IfcSIUnit si = u as IfcSIUnit; + double sif = (si == null ? 1 : si.getSIFactor()); + IfcMeasureValue m = mValueComponent as IfcMeasureValue; + + if (m != null) + return m.Measure * sif; + IfcDerivedMeasureValue dm = mValueComponent as IfcDerivedMeasureValue; + if (dm != null) + return dm.Measure * sif; + return sif; + } + } + public class IfcMechanicalConcreteMaterialProperties : IfcMechanicalMaterialProperties // DEPRECEATED IFC4 + { + internal double mCompreggveStrength;// : OPTIONAL IfcPressureMeasure; + internal double mMaxAggregateSize;// : OPTIONAL IfcPositiveLengthMeasure; + internal string mAdmixturesDescription, mWorkability;// : OPTIONAL IfcText + internal double mProtectivePoreRatio;// : OPTIONAL IfcNormalisedRatioMeasure; + internal string mWaterImpermeability;// : OPTIONAL IfcText; + internal IfcMechanicalConcreteMaterialProperties() : base() { } + internal IfcMechanicalConcreteMaterialProperties(IfcMechanicalConcreteMaterialProperties be) + : base(be) + { + mCompreggveStrength = be.mCompreggveStrength; + mMaxAggregateSize = be.mMaxAggregateSize; + mAdmixturesDescription = be.mAdmixturesDescription; + mWorkability = be.mWorkability; + mProtectivePoreRatio = be.mProtectivePoreRatio; + mWaterImpermeability = be.mWaterImpermeability; + } + internal new static IfcMechanicalConcreteMaterialProperties Parse(string strDef) { IfcMechanicalConcreteMaterialProperties p = new IfcMechanicalConcreteMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcMechanicalConcreteMaterialProperties p, List arrFields, ref int ipos) + { + IfcMechanicalMaterialProperties.parseFields(p, arrFields, ref ipos); + p.mCompreggveStrength = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mMaxAggregateSize = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mAdmixturesDescription = arrFields[ipos++]; + p.mWorkability = arrFields[ipos++]; + p.mProtectivePoreRatio = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWaterImpermeability = arrFields[ipos++]; + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mCompreggveStrength) + "," + ParserSTEP.DoubleOptionalToString(mMaxAggregateSize) + "," + mAdmixturesDescription + "," + mWorkability + "," + ParserSTEP.DoubleOptionalToString(mProtectivePoreRatio) + "," + mWaterImpermeability; } + } + public partial class IfcMechanicalFastener : IfcElementComponent //IFC4 change + { + internal double mNominalDiameter;// : OPTIONAL IfcPositiveLengthMeasure; IFC4 depreceated + internal double mNominalLength;// : OPTIONAL IfcPositiveLengthMeasure; IFC4 depreceated + internal IfcMechanicalFastenerTypeEnum mPredefinedType = IfcMechanicalFastenerTypeEnum.NOTDEFINED;// : OPTIONAL IfcMechanicalFastenerTypeEnum; + public IfcMechanicalFastenerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcMechanicalFastener() : base() { } + internal IfcMechanicalFastener(IfcMechanicalFastener f) : base(f) { mNominalDiameter = f.mNominalDiameter; mNominalLength = f.mNominalLength; } + internal IfcMechanicalFastener(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcMechanicalFastener Parse(string strDef,Schema schema) { IfcMechanicalFastener f = new IfcMechanicalFastener(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return f; } + internal static void parseFields(IfcMechanicalFastener f, List arrFields, ref int ipos,Schema schema) + { + IfcElementComponent.parseFields(f, arrFields, ref ipos); + f.mNominalDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + f.mNominalLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + f.mPredefinedType = (IfcMechanicalFastenerTypeEnum)Enum.Parse(typeof(IfcMechanicalFastenerTypeEnum), s.Replace(".", "")); + } + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mNominalDiameter) + "," + ParserSTEP.DoubleOptionalToString(mNominalLength) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcMechanicalFastenerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); } + } + public partial class IfcMechanicalFastenerType : IfcElementComponentType //IFC4 change + { + internal double mNominalDiameter;// : OPTIONAL IfcPositiveLengthMeasure; IFC4 + internal double mNominalLength;// : OPTIONAL IfcPositiveLengthMeasure; IFC4 + internal IfcMechanicalFastenerTypeEnum mPredefinedType = IfcMechanicalFastenerTypeEnum.NOTDEFINED;// : IfcMechanicalFastenerTypeEnum; IFC4 + public IfcMechanicalFastenerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcMechanicalFastenerType() : base() { } + internal IfcShapeRepresentation mProfileRep = null; + internal IfcMechanicalFastenerType(IfcMechanicalFastenerType t) : base(t) { mNominalDiameter = t.mNominalDiameter; mNominalLength = t.mNominalLength; mPredefinedType = t.mPredefinedType; } + + internal static IfcMechanicalFastenerType Parse(string strDef,Schema schema) { IfcMechanicalFastenerType t = new IfcMechanicalFastenerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return t; } + internal static void parseFields(IfcMechanicalFastenerType t, List arrFields, ref int ipos,Schema schema) + { + IfcElementComponentType.parseFields(t, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + t.mPredefinedType = (IfcMechanicalFastenerTypeEnum)Enum.Parse(typeof(IfcMechanicalFastenerTypeEnum), arrFields[ipos++].Replace(".", "")); + t.mNominalDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + t.mNominalLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : "," + ParserSTEP.DoubleOptionalToString(mNominalDiameter) + "," + ParserSTEP.DoubleOptionalToString(mNominalLength) + ",." + mPredefinedType.ToString() + "."); } + } + public partial class IfcMechanicalMaterialProperties : IfcMaterialPropertiesSuperSeded // DEPRECEATED IFC4 + { + internal double mDynamicViscosity;// : OPTIONAL IfcDynamicViscosityMeasure; + internal double mYoungModulus;// : OPTIONAL IfcModulusOfElasticityMeasure; + internal double mShearModulus;// : OPTIONAL IfcModulusOfElasticityMeasure; + internal double mPoissonRatio;// : OPTIONAL IfcPositiveRatioMeasure; + internal double mThermalExpansionCoefficient;// : OPTIONAL IfcThermalExpansionCoefficientMeasure; + internal IfcMechanicalMaterialProperties() : base() { } + internal IfcMechanicalMaterialProperties(IfcMechanicalMaterialProperties be) : base(be) { mDynamicViscosity = be.mDynamicViscosity; mYoungModulus = be.mYoungModulus; mShearModulus = be.mShearModulus; mPoissonRatio = be.mPoissonRatio; mThermalExpansionCoefficient = be.mThermalExpansionCoefficient; } + internal IfcMechanicalMaterialProperties(IfcMaterial mat, double dynVisc, double youngs, double shear, double poisson, double thermalExp) + : base(mat) { mDynamicViscosity = dynVisc; mYoungModulus = youngs; mShearModulus = shear; mPoissonRatio = poisson; mThermalExpansionCoefficient = thermalExp; } + internal static IfcMechanicalMaterialProperties Parse(string strDef) { IfcMechanicalMaterialProperties p = new IfcMechanicalMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcMechanicalMaterialProperties p, List arrFields, ref int ipos) + { + IfcMaterialPropertiesSuperSeded.parseFields(p, arrFields, ref ipos); + p.mDynamicViscosity = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mYoungModulus = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mShearModulus = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mPoissonRatio = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThermalExpansionCoefficient = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mDynamicViscosity) + "," + ParserSTEP.DoubleOptionalToString(mYoungModulus) + "," + ParserSTEP.DoubleOptionalToString(mShearModulus) + "," + ParserSTEP.DoubleOptionalToString(mPoissonRatio) + "," + ParserSTEP.DoubleOptionalToString(mThermalExpansionCoefficient); } + } + public partial class IfcMechanicalSteelMaterialProperties : IfcMechanicalMaterialProperties // DEPRECEATED IFC4 + { + internal double mYieldStress, mUltimateStress;// : OPTIONAL IfcPressureMeasure; + internal double mUltimateStrain;// : OPTIONAL IfcPositiveRatioMeasure; + internal double mHardeningModule;// : OPTIONAL IfcModulusOfElasticityMeasure + internal double mProportionalStress;// : OPTIONAL IfcPressureMeasure; + internal double mPlasticStrain;// : OPTIONAL IfcPositiveRatioMeasure; + internal List mRelaxations = new List();// : OPTIONAL SET [1:?] OF IfcRelaxation + internal IfcMechanicalSteelMaterialProperties() : base() { } + internal IfcMechanicalSteelMaterialProperties(IfcMechanicalSteelMaterialProperties p) + : base(p) + { + mYieldStress = p.mYieldStress; + mUltimateStress = p.mUltimateStress; + mUltimateStrain = p.mUltimateStrain; + mHardeningModule = p.mHardeningModule; + mProportionalStress = p.mProportionalStress; + mPlasticStrain = p.mPlasticStrain; + mRelaxations = new List(p.mRelaxations); + } + internal IfcMechanicalSteelMaterialProperties(IfcMaterial mat, double dynVisc, double youngs, double shear, double poisson, double thermalExp, double yieldStress, double ultimateStress, double ultimateStrain, double hardeningModule, double proportionalStress, double plasticStrain) + : base(mat, dynVisc, youngs, shear, poisson, thermalExp) + { + mYieldStress = yieldStress; + mUltimateStress = ultimateStress; + mUltimateStrain = ultimateStrain; + mHardeningModule = hardeningModule; + mProportionalStress = proportionalStress; + mPlasticStrain = plasticStrain; + } + internal new static IfcMechanicalSteelMaterialProperties Parse(string strDef) { IfcMechanicalSteelMaterialProperties p = new IfcMechanicalSteelMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcMechanicalSteelMaterialProperties p, List arrFields, ref int ipos) + { + IfcMechanicalMaterialProperties.parseFields(p, arrFields, ref ipos); + p.mYieldStress = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mUltimateStress = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mUltimateStrain = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mHardeningModule = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mProportionalStress = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mPlasticStrain = ParserSTEP.ParseDouble(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (str != "$") + p.mRelaxations = ParserSTEP.SplitListLinks(str); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mYieldStress) + "," + ParserSTEP.DoubleOptionalToString(mUltimateStress) + "," + ParserSTEP.DoubleOptionalToString(mUltimateStrain) + "," + ParserSTEP.DoubleOptionalToString(mHardeningModule) + "," + ParserSTEP.DoubleOptionalToString(mProportionalStress) + "," + ParserSTEP.DoubleOptionalToString(mPlasticStrain); + if (mRelaxations.Count == 0) + return str + ",$"; + str += ",(" + ParserSTEP.LinkToString(mRelaxations[0]); + for (int icounter = 1; icounter < mRelaxations.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelaxations[icounter]); + return str += ")"; + } + } + public class IfcMedicalDevice : IfcFlowTerminal //IFC4 + { + internal IfcMedicalDeviceTypeEnum mPredefinedType = IfcMedicalDeviceTypeEnum.NOTDEFINED;// OPTIONAL : IfcMedicalDeviceTypeEnum; + public IfcMedicalDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcMedicalDevice(IfcMedicalDevice be) : base(be) { } + internal IfcMedicalDevice() : base() { } + internal static void parseFields(IfcMedicalDevice s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcMedicalDeviceTypeEnum)Enum.Parse(typeof(IfcMedicalDeviceTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcMedicalDevice Parse(string strDef) { IfcMedicalDevice s = new IfcMedicalDevice(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcMedicalDeviceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcMedicalDeviceType : IfcFlowTerminalType + { + internal IfcMedicalDeviceTypeEnum mPredefinedType = IfcMedicalDeviceTypeEnum.NOTDEFINED;// : IfcMedicalDeviceBoxTypeEnum; + public IfcMedicalDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcMedicalDeviceType(IfcMedicalDeviceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcMedicalDeviceType() : base() { } + internal IfcMedicalDeviceType(DatabaseIfc m, string name, IfcMedicalDeviceTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcMedicalDeviceType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcMedicalDeviceTypeEnum)Enum.Parse(typeof(IfcMedicalDeviceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcMedicalDeviceType Parse(string strDef) { IfcMedicalDeviceType t = new IfcMedicalDeviceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + + } + public partial class IfcMember : IfcBuildingElement + { + internal IfcMemberTypeEnum mPredefinedType = IfcMemberTypeEnum.NOTDEFINED;//: OPTIONAL IfcMemberTypeEnum; + internal IfcMemberTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcMember() : base() { } + internal IfcMember(IfcMember m) : base(m) { mPredefinedType = m.mPredefinedType; } + public IfcMember(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcMember Parse(string strDef, Schema schema) { IfcMember m = new IfcMember(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcMember m, List arrFields, ref int ipos,Schema schema) + { + IfcBuildingElement.parseFields(m, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + m.mPredefinedType = (IfcMemberTypeEnum)Enum.Parse(typeof(IfcMemberTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcMemberTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + + } + public partial class IfcMemberStandardCase : IfcMember + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 || mDatabase.mModelView == ModelView.Ifc4Reference ? "IFCMEMBER" : base.KeyWord); } } + internal IfcMemberStandardCase() : base() { } + internal IfcMemberStandardCase(IfcMemberStandardCase o) : base(o) { } + + internal new static IfcMemberStandardCase Parse(string strDef,Schema schema) { IfcMemberStandardCase c = new IfcMemberStandardCase(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return c; } + internal static void parseFields(IfcMemberStandardCase c, List arrFields, ref int ipos,Schema schema) { IfcMember.parseFields(c, arrFields, ref ipos,schema); } + } + public partial class IfcMemberType : IfcBuildingElementType + { + internal IfcMemberTypeEnum mPredefinedType = IfcMemberTypeEnum.NOTDEFINED; + public IfcMemberTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcMemberType() : base() { } + internal IfcMemberType(IfcMemberType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcMemberType(string name, IfcMaterialProfileSet ps, IfcMemberTypeEnum type) : base(ps.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = ps; } + public IfcMemberType(DatabaseIfc m, string name, IfcMemberTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + public IfcMemberType(string name, IfcMaterialProfile mp, IfcMemberTypeEnum type) : base(mp.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = mp; } + + internal static void parseFields(IfcMemberType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcMemberTypeEnum)Enum.Parse(typeof(IfcMemberTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcMemberType Parse(string strDef) { IfcMemberType t = new IfcMemberType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + + } + public partial class IfcMetric : IfcConstraint//, IfcAppliedValueSelect + { + internal IfcBenchmarkEnum mBenchMark = IfcBenchmarkEnum.EQUALTO;// : OPTIONAL IfcLogicalOperatorEnum; + internal string mValueSource = "$"; // : OPTIONAL IfcLabel; + private int mDataValue;// : IfcMetricValueSelect; + internal IfcValue mDataValueValue = null; + private int mReferencePath;// : OPTIONAL IfcReference; + + public IfcBenchmarkEnum BenchMark { get { return mBenchMark; } set { mBenchMark = value; } } + public string ValueSource { get { return (mValueSource == "$" ? "" : ParserIfc.Decode(mValueSource)); } set { mValueSource = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcMetricValueSelect DataValue { get { return mDatabase.mIfcObjects[mDataValue] as IfcMetricValueSelect; } set { mDataValue = value.Index; } } + public IfcReference ReferencePath { get { return mDatabase.mIfcObjects[mReferencePath] as IfcReference; } set { mReferencePath = (value == null ? 0 : value.mIndex); } } + + internal IfcMetric() : base() { } + internal IfcMetric(IfcMetric m) : base(m) { mBenchMark = m.mBenchMark; mValueSource = m.mValueSource; mDataValue = m.mDataValue; mDataValueValue = m.mDataValueValue; mReferencePath = m.mReferencePath; } + public IfcMetric(DatabaseIfc db, string name, IfcConstraintEnum constraint, IfcMetricValueSelect dataValue) : base(db, name, constraint) { DataValue = dataValue; } + public IfcMetric(DatabaseIfc db, string name, IfcConstraintEnum constraint, IfcValue dataValue) : base(db, name, constraint) { mDataValueValue = dataValue; } + + internal static IfcMetric Parse(string strDef, Schema schema) { IfcMetric m = new IfcMetric(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcMetric m, List arrFields, ref int ipos, Schema schema) + { + IfcConstraint.parseFields(m, arrFields, ref ipos,schema); + m.mBenchMark = (IfcBenchmarkEnum)Enum.Parse(typeof(IfcBenchmarkEnum), arrFields[ipos++].Replace(".", "")); + m.mValueSource = arrFields[ipos++].Replace("'", ""); + string str = arrFields[ipos++]; + m.mDataValueValue = ParserIfc.parseValue(str); + if (m.mDataValueValue == null) + m.mDataValue = ParserSTEP.ParseLink(str); + m.mReferencePath = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",." + mBenchMark.ToString() + (mValueSource == "$" ? ".,$," : ".,'" + mValueSource + "',") + (mDataValueValue == null ? ParserSTEP.LinkToString(mDataValue) : mDataValueValue.ToString()) + "," + ParserSTEP.LinkToString(mReferencePath); } + } + public interface IfcMetricValueSelect : IfcInterface { } //SELECT ( IfcMeasureWithUnit, IfcTable, IfcTimeSeries, IfcAppliedValue, IfcValue, IfcReference); + public partial class IfcMirroredProfileDef : IfcDerivedProfileDef + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCDERIVEDPROFILE" : base.KeyWord); } } + internal IfcMirroredProfileDef() : base() { } + internal IfcMirroredProfileDef(IfcMirroredProfileDef el) : base(el) { } + + internal static void parseFields(IfcMirroredProfileDef p, List arrFields, ref int ipos) { IfcDerivedProfileDef.parseFields(p, arrFields, ref ipos); } + internal new static IfcMirroredProfileDef Parse(string strDef) { int ipos = 0; IfcMirroredProfileDef p = new IfcMirroredProfileDef(); parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public class IfcMonetaryUnit : BaseClassIfc, IfcUnit + { + internal string mCurrency = "USD"; //: IFC4 change Ifc2x3 IfcCurrencyEnum + + internal IfcMonetaryUnit(IfcMonetaryUnit p) : base(p) { } + internal IfcMonetaryUnit() : base() { } + internal IfcMonetaryUnit(DatabaseIfc m, string currency) : base(m) { mCurrency = currency; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? ",." + mCurrency + "." : ",'" + mCurrency + "'"); } + internal static void parseFields(IfcMonetaryUnit u, List arrFields, ref int ipos,Schema schema) { u.mCurrency = arrFields[ipos++].Replace(schema == Schema.IFC2x3 ? "." : "'", ""); } + internal static IfcMonetaryUnit Parse(string strDef,Schema schema) { IfcMonetaryUnit u = new IfcMonetaryUnit(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return u; } + } + public class IfcMotorConnection : IfcEnergyConversionDevice //IFC4 + { + internal IfcMotorConnectionTypeEnum mPredefinedType = IfcMotorConnectionTypeEnum.NOTDEFINED;// OPTIONAL : IfcMotorConnectionTypeEnum; + public IfcMotorConnectionTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcMotorConnection() : base() { } + internal IfcMotorConnection(IfcMotorConnection c) : base(c) { mPredefinedType = c.mPredefinedType; } + internal IfcMotorConnection(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcMotorConnection s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcMotorConnectionTypeEnum)Enum.Parse(typeof(IfcMotorConnectionTypeEnum), str); + } + internal new static IfcMotorConnection Parse(string strDef) { IfcMotorConnection s = new IfcMotorConnection(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcMotorConnectionTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcMotorConnectionType : IfcEnergyConversionDeviceType + { + internal IfcMotorConnectionTypeEnum mPredefinedType = IfcMotorConnectionTypeEnum.NOTDEFINED;// : IfcMotorConnectionTypeEnum; + public IfcMotorConnectionTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcMotorConnectionType() : base() { } + internal IfcMotorConnectionType(IfcMotorConnectionType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcMotorConnectionType(DatabaseIfc m, string name, IfcMotorConnectionTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcMotorConnectionType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcMotorConnectionTypeEnum)Enum.Parse(typeof(IfcMotorConnectionTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcMotorConnectionType Parse(string strDef) { IfcMotorConnectionType t = new IfcMotorConnectionType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcMove // DEPRECEATED IFC4 +} diff --git a/IFC/IFC N.cs b/IFC/IFC N.cs new file mode 100644 index 0000000..680a1ee --- /dev/null +++ b/IFC/IFC N.cs @@ -0,0 +1,59 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public abstract partial class IfcNamedUnit : BaseClassIfc, IfcUnit //ABSTRACT SUPERTYPE OF (ONEOF(IfcContextDependentUnit,IfcConversionBasedUnit,IfcSIUnit)); + { + internal int mDimensions;// : IfcDimensionalExponents; + private IfcUnitEnum mUnitType;// : IfcUnitEnum + + internal IfcUnitEnum UnitType { get { return mUnitType; } } + + protected IfcNamedUnit(IfcNamedUnit p) : base() { mDimensions = p.mDimensions; mUnitType = p.mUnitType; } + protected IfcNamedUnit() : base() { } + protected IfcNamedUnit(DatabaseIfc m, IfcUnitEnum unitEnum, bool gendims) : base(m) + { + mUnitType = unitEnum; + if (gendims) + { + if (unitEnum == IfcUnitEnum.LENGTHUNIT) + mDimensions = new IfcDimensionalExponents(m, 1, 0, 0, 0, 0, 0, 0).mIndex; + else if (unitEnum == IfcUnitEnum.AREAUNIT) + mDimensions = new IfcDimensionalExponents(m, 2, 0, 0, 0, 0, 0, 0).mIndex; + else if (unitEnum == IfcUnitEnum.VOLUMEUNIT) + mDimensions = new IfcDimensionalExponents(m, 3, 0, 0, 0, 0, 0, 0).mIndex; + else if (unitEnum == IfcUnitEnum.PLANEANGLEUNIT) + mDimensions = new IfcDimensionalExponents(m, 0, 0, 0, 0, 0, 0, 0).mIndex; + } + } + protected override string BuildString() { return base.BuildString() + "," + (mDimensions == 0 ? "*" : ParserSTEP.LinkToString(mDimensions)) + ",." + mUnitType.ToString() + "."; } + protected static void parseFields(IfcNamedUnit u, List arrFields, ref int ipos) { u.mDimensions = ParserSTEP.ParseLink(arrFields[ipos++]); u.mUnitType = (IfcUnitEnum)Enum.Parse(typeof(IfcUnitEnum), arrFields[ipos++].Replace(".", "")); } + internal virtual double getSIFactor() { return 1; } + } +} diff --git a/IFC/IFC O.cs b/IFC/IFC O.cs new file mode 100644 index 0000000..fcf2f5d --- /dev/null +++ b/IFC/IFC O.cs @@ -0,0 +1,516 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public abstract partial class IfcObject : IfcObjectDefinition, IfcObjectDefinitionSelect //ABSTRACT SUPERTYPE OF (ONEOF (IfcActor ,IfcControl ,IfcGroup ,IfcProcess ,IfcProduct ,IfcProject ,IfcResource)) + { + internal string mObjectType = "$"; //: OPTIONAL IfcLabel; + //INVERSE + internal IfcRelDefinesByObject mIsDeclaredBy = null; + internal List mDeclares = new List(); + private IfcRelDefinesByType mIsTypedBy = null; + internal List mIsDefinedBy = new List(); + + public string ObjectType { get { return mObjectType == "$" ? "" : ParserIfc.Decode(mObjectType); } set { mObjectType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value)); } } + internal IfcRelDefinesByType IsTypedBy { get { return mIsTypedBy; } set { mIsTypedBy = value; } } + public List IsDefinedBy { get { return mIsDefinedBy; } } + + internal IfcTypeObject RelatingType + { + get { return (mIsTypedBy == null ? null : mIsTypedBy.RelatingType); } + set + { + if (mIsTypedBy != null) + mIsTypedBy.mRelatedObjects.Remove(mIndex); + if (value == null) + mIsTypedBy = null; + else //TODO CHECK CLASS NAME MATCHES INSTANCE + { + if (value.mObjectTypeOf == null) + value.mObjectTypeOf = new IfcRelDefinesByType(this,value); + else + value.mObjectTypeOf.assignObj(this); + } + } + } + + protected IfcObject() : base() { } + protected IfcObject(IfcObject obj) : base(obj) { mObjectType = obj.mObjectType; } + internal IfcObject(DatabaseIfc m) : base(m) { } + + protected static void parseFields(IfcObject obj, List arrFields, ref int ipos) { IfcObjectDefinition.parseFields(obj, arrFields, ref ipos); obj.mObjectType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mObjectType == "$" ? ",$" : ",'" + mObjectType + "'"); } + + } + public abstract partial class IfcObjectDefinition : IfcRoot, IfcDefinitionSelect //ABSTRACT SUPERTYPE OF (ONEOF ((IfcContext, IfcObject, IfcTypeObject)))) + { //INVERSE + internal List mHasAssignments = new List();// : SET OF IfcRelAssigns FOR RelatedObjects; + internal IfcRelNests mNests = null;// : SET [0:1] OF IfcRelNests FOR RelatedObjects; + internal List mIsNestedBy = new List();// : SET OF IfcRelNests FOR RelatingObject; + internal IfcRelDeclares mHasContext = null;// : SET [0:1] OF IfcRelDeclares FOR RelatedDefinitions; + internal List mIsDecomposedBy = new List();// : SET OF IfcRelDecomposes FOR RelatingObject; + internal IfcRelAggregates mDecomposes = null;// : SET [0:1] OF IfcRelDecomposes FOR RelatedObjects; IFC4 IfcRelAggregates + internal List mHasAssociations = new List();// : SET OF IfcRelAssociates FOR RelatedObjects; + + public List HasAssignments { get { return mHasAssignments; } } + public List IsNestedBy { get { return mIsNestedBy; } } + public IfcRelDeclares HasContext { get { return mHasContext; } set { mHasContext = value; } } + public List IsDecomposedBy { get { return mIsDecomposedBy; } } + public List HasAssociations { get { return mHasAssociations; } } + + DatabaseIfc IfcDefinitionSelect.Model { get { return mDatabase; } } + internal IfcRelAssociatesMaterial RelatedMaterialAssociation + { + get + { + for (int icounter = 0; icounter < mHasAssociations.Count; icounter++) + { + IfcRelAssociatesMaterial rm = mHasAssociations[icounter] as IfcRelAssociatesMaterial; + if (rm != null) + return rm; + } + return null; + } + } + + protected IfcObjectDefinition() : base() { } + protected IfcObjectDefinition(IfcObjectDefinition od) : base(od) { } + protected IfcObjectDefinition(DatabaseIfc db) : base(db) { } + + protected static void parseFields(IfcObjectDefinition objDef, List arrFields, ref int ipos) { IfcRoot.parseFields(objDef, arrFields, ref ipos); } + + public void AddNested(IfcObjectDefinition o) + { + if (mIsNestedBy.Count == 0) + { + IfcRelNests rn = new IfcRelNests(this, o); + } + else mIsNestedBy[0].addObject(o); + } + public void AddAggregated(IfcObjectDefinition o) { if (mDecomposes == null) mDecomposes = new IfcRelAggregates(this, o); else mDecomposes.addObject(o); } + + internal virtual void relateNested(IfcRelNests n) { mIsNestedBy.Add(n); } + + protected virtual IfcMaterialSelect GetMaterialSelect() + { + List has = HasAssociations; + foreach (IfcRelAssociates ra in has) + { + IfcRelAssociatesMaterial rm = ra as IfcRelAssociatesMaterial; + if (rm != null) + return rm.RelatingMaterial; + } + return null; + } + private IfcMaterialSelect mMaterialSelectIFC4 = null; + internal void setMaterial(IfcMaterialSelect material) + { + IfcMaterialSelect m = material; + if (mDatabase.mSchema == Schema.IFC2x3) + { + IfcMaterialProfile profile = material as IfcMaterialProfile; + if (profile != null) + { + m = profile.Material; + mMaterialSelectIFC4 = profile; + IfcProfileDef pd = profile.Profile; + if (pd != null) + { + if (pd.mHasProperties.Count == 0) + { + IfcProfileProperties pp = new IfcProfileProperties(pd.Name, null, pd); + } + pd.mHasProperties[0].mAssociates.addAssociation(this); + } + } + else + { + IfcMaterialProfileSet profileSet = material as IfcMaterialProfileSet; + if (profileSet == null) + { + IfcMaterialProfileSetUsage profileSetUsage = material as IfcMaterialProfileSetUsage; + if (profileSetUsage != null) + profileSet = profileSetUsage.ForProfileSet; + } + if (profileSet != null) + { + m = profileSet.PrimaryMaterial; + mMaterialSelectIFC4 = profileSet; + foreach (IfcMaterialProfile matp in profileSet.MaterialProfiles) + { + IfcProfileDef pd = matp.Profile; + if (pd != null) + { + if (pd.mHasProperties.Count == 0) + { + IfcProfileProperties pp = new IfcProfileProperties(pd.Name, null, pd); + } + pd.mHasProperties[0].mAssociates.addAssociation(this); + } + } + } + else + { + //constituentset.... + } + } + + + } + for (int icounter = 0; icounter < mHasAssociations.Count; icounter++) + { + IfcRelAssociatesMaterial rm = mHasAssociations[icounter] as IfcRelAssociatesMaterial; + if (rm != null) + rm.unassign(this); + } + if (m != null) + m.Associates.addAssociation(this); + } + } + public interface IfcObjectDefinitionSelect : IfcInterface { List IsDefinedBy { get; } } // IFC4 SELECT (IfcContext, IfcObject); + public abstract partial class IfcObjectPlacement : BaseClassIfc // ABSTRACT SUPERTYPE OF (ONEOF (IfcGridPlacement ,IfcLocalPlacement)); + { //INVERSE + internal List mPlacesObject = new List();// : SET [1:?] OF IfcProduct FOR ObjectPlacement; + internal List mReferencedByPlacements = new List();// : SET [0:?] OF IfcLocalPlacement FOR PlacementRelTo; + internal IfcProduct mContainerHost = null; + protected IfcObjectPlacement() : base() { } + protected IfcObjectPlacement(IfcObjectPlacement o) : base() { } + protected IfcObjectPlacement(DatabaseIfc m, IfcProduct p) + : base(m) + { + if (p != null) + { + p.Placement = this; + if (!mPlacesObject.Contains(p)) + mPlacesObject.Add(p); + } + } + protected static void parseFields(IfcObjectPlacement p, List arrFields, ref int ipos) { } + } + public partial class IfcObjective : IfcConstraint + { + internal List mBenchmarkValues = new List();// : OPTIONAL LIST [1:?] OF IfcConstraint; + internal IfcLogicalOperatorEnum mLogicalAggregator = IfcLogicalOperatorEnum.NONE;// : OPTIONAL IfcLogicalOperatorEnum; + internal IfcObjectiveEnum mObjectiveQualifier = IfcObjectiveEnum.NOTDEFINED;// : IfcObjectiveEnum + internal string mUserDefinedQualifier = "$"; + + internal List BenchMarks { get { return mBenchmarkValues.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcConstraint); } } + + internal IfcObjective() : base() { } + internal IfcObjective(IfcObjective m) : base(m) { mBenchmarkValues = new List(m.mBenchmarkValues.ToArray()); mLogicalAggregator = m.mLogicalAggregator; mObjectiveQualifier = m.mObjectiveQualifier; mUserDefinedQualifier = m.mUserDefinedQualifier; } + public IfcObjective(DatabaseIfc db, string name, IfcConstraintEnum constraint, List benchmarks, IfcObjectiveEnum qualifier, string userQualifier) + : base(db, name, constraint) + { + if (benchmarks != null && benchmarks.Count > 0) + mBenchmarkValues = benchmarks.ConvertAll(x => x.mIndex); + mObjectiveQualifier = qualifier; + if (!string.IsNullOrEmpty(userQualifier)) + mUserDefinedQualifier = userQualifier.Replace("'", ""); + } + + internal static IfcObjective Parse(string strDef, Schema schema) { IfcObjective m = new IfcObjective(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcObjective m, List arrFields, ref int ipos, Schema schema) + { + IfcConstraint.parseFields(m, arrFields, ref ipos,schema); + m.mBenchmarkValues = ParserSTEP.SplitListLinks(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s[0] == '.') + m.mLogicalAggregator = (IfcLogicalOperatorEnum)Enum.Parse(typeof(IfcLogicalOperatorEnum), s.Substring(1, s.Length - 2)); + m.mObjectiveQualifier = (IfcObjectiveEnum)Enum.Parse(typeof(IfcObjectiveEnum), arrFields[ipos++].Replace(".", "")); + m.mUserDefinedQualifier = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() + { + string str = base.BuildString(); + if (mBenchmarkValues.Count > 0) + { + str += ",(" + ParserSTEP.LinkToString(mBenchmarkValues[0]); + for (int icounter = 1; icounter < mBenchmarkValues.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mBenchmarkValues[icounter]); + str += "),"; + } + else + str += ",$,"; + return str + (mLogicalAggregator != IfcLogicalOperatorEnum.NONE ? "." + mLogicalAggregator.ToString() + ".,." : "$,.") + mObjectiveQualifier + (mUserDefinedQualifier == "$" ? ".,$" : ".,'" + mUserDefinedQualifier + "'"); + } + } + public class IfcOccupant : IfcActor + { + internal IfcOccupantTypeEnum mPredefinedType = IfcOccupantTypeEnum.NOTDEFINED;// : OPTIONAL IfcOccupantTypeEnum; + public IfcOccupantTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcOccupant(IfcOccupant o) : base(o) { } + internal IfcOccupant() : base() { } + internal IfcOccupant(IfcActorSelect a, IfcOccupantTypeEnum type) : base(a) { mPredefinedType = type; } + internal new static IfcOccupant Parse(string strDef) { IfcOccupant a = new IfcOccupant(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcOccupant a, List arrFields, ref int ipos) { IfcObject.parseFields(a, arrFields, ref ipos); a.mTheActor = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 || mPredefinedType != IfcOccupantTypeEnum.NOTDEFINED ? ",." + mPredefinedType.ToString() + "." : ",$"); } + } + //ENTITY IfcOffsetCurve2D + //ENTITY IfcOffsetCurve3D + public class IfcOneDirectionRepeatFactor : IfcGeometricRepresentationItem // DEPRECEATED IFC4 + { + internal int mRepeatFactor;// : IfcVector + internal IfcOneDirectionRepeatFactor() : base() { } + internal IfcOneDirectionRepeatFactor(IfcOneDirectionRepeatFactor p) : base((IfcGeometricRepresentationItem)p) { mRepeatFactor = p.mRepeatFactor; } + internal static void parseFields(IfcOneDirectionRepeatFactor f, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(f, arrFields, ref ipos); f.mRepeatFactor = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcOneDirectionRepeatFactor Parse(string strDef) { IfcOneDirectionRepeatFactor f = new IfcOneDirectionRepeatFactor(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRepeatFactor); } + } + public partial class IfcOpeningElement : IfcFeatureElementSubtraction + { + internal IfcOpeningElementTypeEnum mPredefinedType = IfcOpeningElementTypeEnum.NOTDEFINED;// : OPTIONAL IfcOpeningElementTypeEnum; //IFC4 + //INVERSE + internal List mHasFillings = new List(); + + public IfcOpeningElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcOpeningElement() : base() { } + internal IfcOpeningElement(IfcOpeningElement od) : base(od) { mPredefinedType = od.mPredefinedType; } + internal IfcOpeningElement(DatabaseIfc db) : base(db) { } + public IfcOpeningElement(IfcElement host, IfcObjectPlacement placement, IfcProductRepresentation rep) : base(host.mDatabase) { Placement = placement; Representation = rep; IfcRelVoidsElement rve = new IfcRelVoidsElement(host, this); } + + internal static IfcOpeningElement Parse(string strDef, Schema schema) { IfcOpeningElement e = new IfcOpeningElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcOpeningElement e, List arrFields, ref int ipos, Schema schema) + { + IfcFeatureElementSubtraction.parseFields(e, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + e.mPredefinedType = (IfcOpeningElementTypeEnum)Enum.Parse(typeof(IfcOpeningElementTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcOpeningElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); } + } + public class IfcOpeningStandardCase : IfcOpeningElement //IFC4 + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCOPENINGELEMENT" : base.KeyWord); } } + internal IfcOpeningStandardCase() : base() { } + internal IfcOpeningStandardCase(IfcOpeningStandardCase o) : base(o) { } + public IfcOpeningStandardCase(IfcElement host, IfcObjectPlacement placement, IfcExtrudedAreaSolid eas) : base(host, placement, new IfcProductDefinitionShape(new IfcShapeRepresentation(eas))) { } + public IfcOpeningStandardCase(DatabaseIfc db, IfcObjectPlacement placement, IfcExtrudedAreaSolid eas) : base(db) { Placement = placement; Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(eas)); } + internal static IfcOpeningStandardCase Parse(string strDef) { IfcOpeningStandardCase c = new IfcOpeningStandardCase(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcOpeningStandardCase c, List arrFields, ref int ipos) { IfcOpeningElement.parseFields(c, arrFields, ref ipos); } + } + //ENTITY IfcOpticalMaterialProperties // DEPRECEATED IFC4 + //ENTITY IfcOrderAction // DEPRECEATED IFC4 + public partial class IfcOpenShell : IfcConnectedFaceSet, IfcShell + { + internal IfcOpenShell() : base() { } + internal IfcOpenShell(IfcOpenShell od) : base(od) { } + internal new static IfcOpenShell Parse(string str) + { + IfcOpenShell s = new IfcOpenShell(); + int pos = 0; + s.Parse(str, ref pos); + return s; + } + } + public class IfcOrganization : BaseClassIfc, IfcActorSelect, IfcResourceObjectSelect + { + internal string mIdentification = "$";// : OPTIONAL IfcIdentifier; + private string mName;// : IfcLabel; + private string mDescription = "$";// : OPTIONAL IfcText; + private List mRoles = new List();// : OPTIONAL LIST [1:?] OF IfcActorRole; + private List mAddresses = new List();// : OPTIONAL LIST [1:?] OF IfcAddress; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public override string Name + { + get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } + set { mName = (string.IsNullOrEmpty(value) ? "UNKNOWN" : ParserIfc.Encode(value.Replace("'", ""))); } + } + internal List Roles { get { return mRoles.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcActorRole); } set { mRoles = (value == null ? new List() : value.ConvertAll(x => x.mIndex)); } } + internal List Addresses { get { return mAddresses.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcAddress); } set { mAddresses = (value == null ? new List() : value.ConvertAll(x => x.mIndex)); } } + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + internal IfcOrganization() : base() { } + internal IfcOrganization(IfcOrganization i) : base() { mIdentification = i.mIdentification; mName = i.mName; mDescription = i.mDescription; mRoles = i.mRoles; mAddresses = i.mAddresses; } + internal IfcOrganization(DatabaseIfc db) : base(db) + { + mName = "UNKNOWN"; + try + { + mName = ((string)Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", "")).Replace("'", ""); + if (string.IsNullOrEmpty(mName) || mName == "Microsoft") + mName = "UNKNOWN"; + } + catch (Exception) { } + } + internal IfcOrganization(DatabaseIfc m, string name) : base(m) { Name = name; } + internal static void parseFields(IfcOrganization o, List arrFields, ref int ipos) + { + o.mIdentification = arrFields[ipos++]; + o.mName = arrFields[ipos++].Replace("'", ""); + o.mDescription = arrFields[ipos++]; + o.mRoles = ParserSTEP.SplitListLinks(arrFields[ipos++]); + o.mAddresses = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + internal static IfcOrganization Parse(string strDef) { IfcOrganization o = new IfcOrganization(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + protected override string BuildString() + { + string str = base.BuildString() + "," + mIdentification + ",'" + mName + "'," + mDescription + (mRoles.Count == 0 ? ",$" : ",(#" + mRoles[0]); + + for (int icounter = 1; icounter < mRoles.Count; icounter++) + str += ",#" + mRoles; + str += (mRoles.Count == 0 ? "" : "),") + (mAddresses.Count == 0 ? ",$" : "(#" + mAddresses[0]); + for (int icounter = 1; icounter < mAddresses.Count; icounter++) + str += ",#" + mAddresses[icounter]; + return str + (mAddresses.Count > 0 ? ")" : ""); + } + } + //ENTITY IfcOrganizationRelationship; //optional name + public partial class IfcOrientedEdge : IfcEdge + { + internal int mEdgeElement;// IfcEdge; + internal bool mOrientation = true;// : BOOL; + internal IfcEdge EdgeElement { get { return mDatabase.mIfcObjects[mEdgeElement] as IfcEdge; } } + internal IfcOrientedEdge() : base() { } + internal IfcOrientedEdge(IfcOrientedEdge el) : base(el) { mEdgeElement = el.mEdgeElement; mOrientation = el.mOrientation; } + public IfcOrientedEdge(IfcEdge e, bool sense) : base(e.mDatabase) { mEdgeElement = e.mIndex; mOrientation = sense; } + internal IfcOrientedEdge(IfcVertexPoint a, IfcVertexPoint b) : base(a.mDatabase) { mEdgeElement = new IfcEdge(a, b).mIndex; } + internal new static IfcOrientedEdge Parse(string strDef) { IfcOrientedEdge e = new IfcOrientedEdge(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcOrientedEdge e, List arrFields, ref int ipos) + { + if (arrFields.Count > 2) + IfcEdge.parseFields(e, arrFields, ref ipos); + e.mEdgeElement = ParserSTEP.ParseLink(arrFields[ipos++]); + e.mOrientation = ParserSTEP.ParseBool(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mEdgeElement) + "," + ParserSTEP.BoolToString(mOrientation); } + } + public class IfcOuterBoundaryCurve : IfcBoundaryCurve + { + internal IfcOuterBoundaryCurve() : base() { } + internal IfcOuterBoundaryCurve(IfcOuterBoundaryCurve i) : base(i) { } + internal IfcOuterBoundaryCurve(List segs) : base(segs) { } + internal new static IfcOuterBoundaryCurve Parse(string strDef) { IfcOuterBoundaryCurve b = new IfcOuterBoundaryCurve(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcOuterBoundaryCurve b, List arrFields, ref int ipos) { IfcBoundaryCurve.parseFields(b, arrFields, ref ipos); } + } + public class IfcOutlet : IfcFlowTerminal //IFC4 + { + internal IfcOutletTypeEnum mPredefinedType = IfcOutletTypeEnum.NOTDEFINED;// OPTIONAL : IfcOutletTypeEnum; + public IfcOutletTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcOutlet() : base() { } + internal IfcOutlet(IfcOutlet o) : base(o) { mPredefinedType = o.mPredefinedType; } + internal IfcOutlet(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcOutlet s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcOutletTypeEnum)Enum.Parse(typeof(IfcOutletTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcOutlet Parse(string strDef) { IfcOutlet s = new IfcOutlet(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcOutletTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcOutletType : IfcFlowTerminalType + { + internal IfcOutletTypeEnum mPredefinedType = IfcOutletTypeEnum.NOTDEFINED;// : IfcOutletTypeEnum; + public IfcOutletTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcOutletType() : base() { } + internal IfcOutletType(IfcOutletType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcOutletType(DatabaseIfc m, string name, IfcOutletTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcOutletType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcOutletTypeEnum)Enum.Parse(typeof(IfcOutletTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcOutletType Parse(string strDef) { IfcOutletType t = new IfcOutletType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcOwnerHistory : BaseClassIfc + { + internal int mOwningUser;// : IfcPersonAndOrganization; + internal int mOwningApplication;// : IfcApplication; + internal IfcStateEnum mState = IfcStateEnum.NA;// : OPTIONAL IfcStateEnum; + internal IfcChangeActionEnum mChangeAction;// : IfcChangeActionEnum; + internal int mLastModifiedDate;// : OPTIONAL IfcTimeStamp; + internal int mLastModifyingUser;// : OPTIONAL IfcPersonAndOrganization; + internal int mLastModifyingApplication;// : OPTIONAL IfcApplication; + internal int mCreationDate;// : IfcTimeStamp; + + public IfcStateEnum State { get { return mState; } } + public IfcChangeActionEnum ChangeAction { get { return mChangeAction; } } + + internal IfcOwnerHistory() : base() { } + internal IfcOwnerHistory(IfcOwnerHistory o) : base() + { + mOwningUser = o.mOwningUser; + mOwningApplication = o.mOwningApplication; + mState = o.mState; + mChangeAction = o.mChangeAction; + mLastModifiedDate = o.mLastModifiedDate; + mLastModifyingUser = o.mLastModifyingUser; + mLastModifyingApplication = o.mLastModifyingApplication; + mCreationDate = o.mCreationDate; + } + internal IfcOwnerHistory(IfcPersonAndOrganization po, IfcApplication app, IfcChangeActionEnum ca) : base(po.mDatabase) + { + mOwningUser = po.mIndex; + mOwningApplication = app.mIndex; + mState = IfcStateEnum.NA; + mChangeAction = ca; + TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0); + //if(ca == IfcChangeActionEnum.ADDED) + mCreationDate = (int)ts.TotalSeconds; + //if (ca != IfcChangeActionEnum.NOTDEFINED) + mLastModifiedDate = (int)ts.TotalSeconds; + } + internal static void parseFields(IfcOwnerHistory o, List arrFields, ref int ipos) + { + o.mOwningUser = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mOwningApplication = ParserSTEP.ParseLink(arrFields[ipos++]); + string str = arrFields[ipos++].Replace(".", ""); + str = str.Trim(); + if (str == "" || str.StartsWith("$")) + o.mState = IfcStateEnum.NA; + else + o.mState = (IfcStateEnum)Enum.Parse(typeof(IfcStateEnum), str); + str = arrFields[ipos++].Replace(".", ""); + if (str.EndsWith("ADDED")) + o.mChangeAction = IfcChangeActionEnum.ADDED; + if (str.EndsWith("DELETED")) + o.mChangeAction = IfcChangeActionEnum.DELETED; + else + o.mChangeAction = (IfcChangeActionEnum)Enum.Parse(typeof(IfcChangeActionEnum), str); + o.mLastModifiedDate = ParserSTEP.ParseInt(arrFields[ipos++]); + o.mLastModifyingUser = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mLastModifyingApplication = ParserSTEP.ParseLink(arrFields[ipos++]); + o.mCreationDate = ParserSTEP.ParseInt(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mOwningUser) + "," + ParserSTEP.LinkToString(mOwningApplication) + ","; + if (mState == IfcStateEnum.NA) + str += "$"; + else + str += "." + mState.ToString() + "."; + return str + ",." + (mDatabase.mSchema == Schema.IFC2x3 && mChangeAction == IfcChangeActionEnum.NOTDEFINED ? IfcChangeActionEnum.NOCHANGE : mChangeAction).ToString() + ".," + ParserSTEP.IntOptionalToString(mLastModifiedDate) + "," + + ParserSTEP.LinkToString(mLastModifyingUser) + "," + ParserSTEP.LinkToString(mLastModifyingApplication) + "," + ParserSTEP.IntToString(mCreationDate); + } + internal static IfcOwnerHistory Parse(string strDef) { IfcOwnerHistory o = new IfcOwnerHistory(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + } +} diff --git a/IFC/IFC P.cs b/IFC/IFC P.cs new file mode 100644 index 0000000..947a786 --- /dev/null +++ b/IFC/IFC P.cs @@ -0,0 +1,1860 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public abstract partial class IfcParameterizedProfileDef : IfcProfileDef //GG //ABSTRACT SUPERTYPE OF (ONEOF (IfcCShapeProfileDef ,IfcCircleProfileDef ,IfcCraneRailAShapeProfileDef ,IfcCraneRailFShapeProfileDef , + {//IfcEllipseProfileDef ,IfcIShapeProfileDef ,IfcLShapeProfileDef ,IfcRectangleProfileDef ,IfcTShapeProfileDef ,IfcTrapeziumProfileDef ,IfcUShapeProfileDef ,IfcZShapeProfileDef))*/ + internal int mPosition;// : IfcAxis2Placement2D //IFC4 OPTIONAL + + public IfcAxis2Placement2D Position + { + get { return (mPosition > 0 ? mDatabase.mIfcObjects[mPosition] as IfcAxis2Placement2D : null); } + set { mPosition = (value == null ? (mDatabase.mSchema == Schema.IFC2x3 ? mDatabase.m2DPlaceOrigin.mIndex : 0) : value.mIndex); } + } + + protected IfcParameterizedProfileDef() : base() { } + protected IfcParameterizedProfileDef(IfcParameterizedProfileDef i) : base(i) { mPosition = i.mPosition; } + protected IfcParameterizedProfileDef(DatabaseIfc m) + : base(m) + { + if (mDatabase.mModelView == ModelView.Ifc4Reference) + throw new Exception("Invalid Model View for IfcParameterizedProfileDef : " + m.ModelView.ToString()); + if (mDatabase.mSchema == Schema.IFC2x3) + Position = (mDatabase.m2DPlaceOrigin == null ? new IfcAxis2Placement2D(m) : mDatabase.m2DPlaceOrigin); + } + + protected static void parseFields(IfcParameterizedProfileDef p, List arrFields, ref int ipos) { IfcProfileDef.parseFields(p, arrFields, ref ipos); p.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition); } + } + public class IfcPath : IfcTopologicalRepresentationItem + { + internal List mEdgeList = new List();// : SET [1:?] OF IfcOrientedEdge; + internal IfcPath() : base() { } + internal IfcPath(IfcPath i) : base(i) { mEdgeList = new List(i.mEdgeList.ToArray()); } + internal IfcPath(List edges) : base(edges[0].mDatabase) { mEdgeList = edges.ConvertAll(x => x.mIndex); } + internal IfcPath(IfcOrientedEdge edge) : base(edge.mDatabase) { mEdgeList.Add(edge.mIndex); } + internal static IfcPath Parse(string strDef) { IfcPath p = new IfcPath(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcPath p, List arrFields, ref int ipos) { IfcTopologicalRepresentationItem.parseFields(p, arrFields, ref ipos); p.mEdgeList = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mEdgeList.Count > 0) + str += ParserSTEP.LinkToString(mEdgeList[0]); + for (int icounter = 1; icounter < mEdgeList.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mEdgeList[icounter]); + return str + ")"; + } + } + public partial class IfcPCurve : IfcCurve + { + internal int mBasisSurface;// : IfcSurface; + internal int mReferenceCurve;// : IfcCurve; + internal IfcPCurve() : base() { } + internal IfcPCurve(IfcPCurve el) : base(el) { mBasisSurface = el.mBasisSurface; mReferenceCurve = el.mReferenceCurve; } + + internal static IfcPCurve Parse(string strDef) { IfcPCurve l = new IfcPCurve(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcPCurve l, List arrFields, ref int ipos) { IfcCurve.parseFields(l, arrFields, ref ipos); l.mBasisSurface = ParserSTEP.ParseLink(arrFields[ipos++]); l.mReferenceCurve = ParserSTEP.ParseLink(arrFields[ipos++]); } + + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisSurface) + "," + ParserSTEP.LinkToString(mReferenceCurve); } + } + public class IfcPerformanceHistory : IfcControl + { + internal string mLifeCyclePhase;// : IfcLabel; + internal IfcPerformanceHistory() : base() { } + internal IfcPerformanceHistory(IfcPerformanceHistory i) : base((IfcControl)i) { mLifeCyclePhase = i.mLifeCyclePhase; } + internal static IfcPerformanceHistory Parse(string strDef, Schema schema) { IfcPerformanceHistory h = new IfcPerformanceHistory(); int ipos = 0; parseFields(h, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return h; } + internal static void parseFields(IfcPerformanceHistory h, List arrFields, ref int ipos, Schema schema) { IfcControl.parseFields(h, arrFields, ref ipos,schema); h.mLifeCyclePhase = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mLifeCyclePhase; } + } + //ENTITY IfcPermeableCoveringProperties : IfcPreDefinedPropertySet //IFC2x3 + public class IfcPermit : IfcControl + { + internal string mPermitID;// : IfcIdentifier; + internal IfcPermit() : base() { } + internal IfcPermit(IfcPermit i) : base((IfcControl)i) { mPermitID = i.mPermitID; } + internal static IfcPermit Parse(string strDef, Schema schema) { IfcPermit p = new IfcPermit(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcPermit p, List arrFields, ref int ipos, Schema schema) { IfcControl.parseFields(p, arrFields, ref ipos,schema); p.mPermitID = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mPermitID; } + } + public partial class IfcPerson : BaseClassIfc, IfcActorSelect, IfcResourceObjectSelect + { + private string mIdentification = "$";// : OPTIONAL IfcIdentifier; + private string mFamilyName = "$", mGivenName = "$";// : OPTIONAL IfcLabel; + private List mMiddleNames = new List(), mPrefixTitles = new List(), mSuffixTitles = new List();// : OPTIONAL LIST [1:?] OF IfcLabel; + private List mRoles = new List();// : OPTIONAL LIST [1:?] OF IfcActorRole; + private List mAddresses = new List();//: OPTIONAL LIST [1:?] OF IfcAddress; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public string Identification { get { return (mIdentification == "$" ? "" : ParserIfc.Decode(mIdentification)); } set { mIdentification = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string FamilyName { get { return (mFamilyName == "$" ? "" : ParserIfc.Decode(mFamilyName)); } set { mFamilyName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string GivenName { get { return (mGivenName == "$" ? "" : ParserIfc.Decode(mGivenName)); } set { mGivenName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List MiddleNames { get { return mMiddleNames.ConvertAll(x => ParserIfc.Decode(x)); } set { mMiddleNames = (value == null ? new List() : value.ConvertAll(x => ParserIfc.Encode(x.Replace("'", "")))); } } + public List PrefixTitles { get { return mPrefixTitles.ConvertAll(x => ParserIfc.Decode(x)); } set { mPrefixTitles = (value == null ? new List() : value.ConvertAll(x => ParserIfc.Encode(x.Replace("'", "")))); } } + public List SuffixTitles { get { return mSuffixTitles.ConvertAll(x => ParserIfc.Decode(x)); } set { mSuffixTitles = (value == null ? new List() : value.ConvertAll(x => ParserIfc.Encode(x.Replace("'", "")))); } } + + public List Roles { get { return mRoles.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcActorRole); } set { mRoles = (value == null ? new List() : value.ConvertAll(x => x.mIndex)); } } + public List Addresses { get { return mAddresses.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcAddress); } set { mAddresses = (value == null ? new List() : value.ConvertAll(x => x.mIndex)); } } + + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + internal IfcPerson() : base() { } + internal IfcPerson(IfcPerson i) + : base() + { + mIdentification = i.mIdentification; + mFamilyName = i.mFamilyName; + mGivenName = i.mGivenName; + mMiddleNames = i.mMiddleNames; + mPrefixTitles = i.mPrefixTitles; + mSuffixTitles = i.mSuffixTitles; + mRoles = i.mRoles; + mAddresses = i.mAddresses; + } + internal IfcPerson(DatabaseIfc m) : base(m) + { + mIdentification = System.Environment.UserName.Replace("'", ""); +#if(IFCMODEL && !IFCIMPORTONLY && (RHINO ||GH)) + string str = GGYM.ggAssembly.mOptions.OwnerRole; + if (!string.IsNullOrEmpty(str)) + { + IfcRoleEnum role = IfcRoleEnum.NOTDEFINED; + if (Enum.TryParse(str, out role)) + { + if (role != IfcRoleEnum.NOTDEFINED) + Roles = new List() { new IfcActorRole(m, role, "", "", new List()) }; + } + else + Roles = new List() { new IfcActorRole(m, IfcRoleEnum.USERDEFINED, str, "", new List()) }; + } +#endif + } + internal IfcPerson(DatabaseIfc m, string id, string familyname, string givenName) : base(m) + { + Identification = id; + FamilyName = familyname; + GivenName = givenName; + } + internal static void parseFields(IfcPerson p, List arrFields, ref int ipos) + { + p.mIdentification = arrFields[ipos++].Replace("'", ""); + p.mFamilyName = arrFields[ipos++].Replace("'", ""); + p.mGivenName = arrFields[ipos++].Replace("'", ""); + p.mMiddleNames = ParserSTEP.SplitListStrings(arrFields[ipos++]).ConvertAll(x => x.Replace("'", "")); + p.mPrefixTitles = ParserSTEP.SplitListStrings(arrFields[ipos++]).ConvertAll(x => x.Replace("'", "")); + p.mSuffixTitles = ParserSTEP.SplitListStrings(arrFields[ipos++]).ConvertAll(x => x.Replace("'", "")); + p.mRoles = ParserSTEP.SplitListLinks(arrFields[ipos++]); + p.mAddresses = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + (mIdentification == "$" ? ",$," : ",'" + mIdentification + "',"); + if (mFamilyName == "$" && mGivenName == "$") + str += (mIdentification == "$" ? "'Unknown',$," : "'" + mIdentification + "',$,"); + else + str += (mFamilyName == "$" ? "$," : "'" + mFamilyName + "',") + (mGivenName == "$" ? "$," : "'" + mGivenName + "',"); + if (mMiddleNames.Count == 0) + str += "$,"; + else + { + str += "('" + mMiddleNames[0]; + for (int icounter = 1; icounter < mMiddleNames.Count; icounter++) + str += "','" + mMiddleNames[icounter]; + str += "'),"; + } + if (mPrefixTitles.Count == 0) + str += "$,"; + else + { + str += "('" + mPrefixTitles[0]; + for (int icounter = 1; icounter < mPrefixTitles.Count; icounter++) + str += "','" + mPrefixTitles[icounter]; + str += "'),"; + } + if (mSuffixTitles.Count == 0) + str += "$,"; + else + { + str += "('" + mSuffixTitles[0]; + for (int icounter = 1; icounter < mSuffixTitles.Count; icounter++) + str += "','" + mSuffixTitles[icounter]; + str += "'),"; + } + if (mRoles.Count == 0) + str += "$,"; + else + { + str += "(" + ParserSTEP.LinkToString(mRoles[0]); + for (int icounter = 1; icounter < mRoles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRoles[icounter]); + str += "),"; + } + if (mAddresses.Count == 0) + str += "$"; + else + { + str += "(" + ParserSTEP.LinkToString(mAddresses[0]); + for (int icounter = 1; icounter < mAddresses.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mAddresses[icounter]); + str += ")"; + } + return str; + } + internal static IfcPerson Parse(string strDef) { IfcPerson p = new IfcPerson(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public class IfcPersonAndOrganization : BaseClassIfc, IfcActorSelect, IfcResourceObjectSelect + { + internal int mThePerson;// : IfcPerson; + internal int mTheOrganization;// : IfcOrganization; + internal string mRoles = "$";// TODO : OPTIONAL LIST [1:?] OF IfcActorRole + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + internal IfcPersonAndOrganization() : base() { } + internal IfcPersonAndOrganization(IfcPersonAndOrganization i) : base() { mThePerson = i.mThePerson; mTheOrganization = i.mTheOrganization; mRoles = i.mRoles; } + internal IfcPersonAndOrganization(DatabaseIfc m) : base(m) { mThePerson = new IfcPerson(m).mIndex; mTheOrganization = new IfcOrganization(m).mIndex; } + internal static void parseFields(IfcPersonAndOrganization c, List arrFields, ref int ipos) { c.mThePerson = ParserSTEP.ParseLink(arrFields[ipos++]); c.mTheOrganization = ParserSTEP.ParseLink(arrFields[ipos++]); c.mRoles = arrFields[ipos++]; } + internal static IfcPersonAndOrganization Parse(string strDef) { IfcPersonAndOrganization c = new IfcPersonAndOrganization(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mThePerson) + "," + ParserSTEP.LinkToString(mTheOrganization) + "," + mRoles; } + } + //ENTITY IfcPhysicalComplexQuantity + public abstract class IfcPhysicalQuantity : BaseClassIfc, IfcResourceObjectSelect //ABSTRACT SUPERTYPE OF(ONEOF(IfcPhysicalComplexQuantity, IfcPhysicalSimpleQuantity)); + { + internal string mName = "NoName";// : IfcLabel; + internal string mDescription = "$"; // : OPTIONAL IfcText; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public override string Name + { + get { return ParserIfc.Decode(mName); } + set { mName = (string.IsNullOrEmpty(value) ? "NoName" : ParserIfc.Encode(value.Replace("'", ""))); } + } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + protected IfcPhysicalQuantity() : base() { } + protected IfcPhysicalQuantity(IfcPhysicalQuantity q) : base() { mName = q.mName; mDescription = q.mDescription; } + protected IfcPhysicalQuantity(DatabaseIfc m, string name, string desc) : base(m) { Name = name; Description = desc; } + protected static void parseFields(IfcPhysicalQuantity q, List arrFields, ref int ipos) { q.mName = arrFields[ipos++].Replace("'", ""); q.mDescription = arrFields[ipos++].Replace("'",""); } + protected override string BuildString() { return base.BuildString() + ",'" + mName + (mDescription == "$" ? "',$" : "','" + mDescription + "'"); } + } + public abstract class IfcPhysicalSimpleQuantity : IfcPhysicalQuantity //ABSTRACT SUPERTYPE OF (ONEOF (IfcQuantityArea ,IfcQuantityCount ,IfcQuantityLength ,IfcQuantityTime ,IfcQuantityVolume ,IfcQuantityWeight)) + { + internal int mUnit = 0;// : OPTIONAL IfcNamedUnit; + + public IfcNamedUnit Unit { get { return mDatabase.mIfcObjects[mUnit] as IfcNamedUnit; } set { mUnit = (value == null ? 0 : value.mIndex); } } + + protected IfcPhysicalSimpleQuantity() : base() { } + protected IfcPhysicalSimpleQuantity(IfcPhysicalSimpleQuantity q) : base(q) { mUnit = q.mUnit; } + protected IfcPhysicalSimpleQuantity(DatabaseIfc m, string name, string desc, IfcNamedUnit unit) : base(m, name, desc) { Unit = unit; } + protected static void parseFields(IfcPhysicalSimpleQuantity q, List arrFields, ref int ipos) { IfcPhysicalQuantity.parseFields(q, arrFields, ref ipos); q.mUnit = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mUnit); } + } + public partial class IfcPile : IfcBuildingElement + { + internal IfcPileTypeEnum mPredefinedType = IfcPileTypeEnum.NOTDEFINED;// OPTIONAL : IfcPileTypeEnum; + internal IfcPileConstructionEnum mConstructionType = IfcPileConstructionEnum.NOTDEFINED;// : OPTIONAL IfcPileConstructionEnum; + + public IfcPileTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcPile() : base() { } + internal IfcPile(IfcPile p) : base(p) { mPredefinedType = p.mPredefinedType; mConstructionType = p.mConstructionType; } + internal IfcPile(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcPile Parse(string strDef) { IfcPile p = new IfcPile(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema != Schema.IFC2x3 && mPredefinedType == IfcPileTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType.ToString() + ".,") + + (mConstructionType == IfcPileConstructionEnum.NOTDEFINED ? "$" : "." + mConstructionType.ToString() + "."); + } + internal static void parseFields(IfcPile p, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(p, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s[0] == '.') + p.mPredefinedType = (IfcPileTypeEnum)Enum.Parse(typeof(IfcPileTypeEnum), s.Replace(".", "")); + s = arrFields[ipos++]; + if (s[0] == '.') + p.mConstructionType = (IfcPileConstructionEnum)Enum.Parse(typeof(IfcPileConstructionEnum), s.Replace(".", "")); + } + } + public partial class IfcPileType : IfcBuildingElementType + { + internal IfcPileTypeEnum mPredefinedType = IfcPileTypeEnum.NOTDEFINED; + public IfcPileTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPileType() : base() { } + internal IfcPileType(IfcPileType b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcPileType(DatabaseIfc m, string name, IfcPileTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal IfcPileType(string name, IfcMaterialProfileSet mps, IfcPileTypeEnum type) : base(mps.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = mps; } + + internal static void parseFields(IfcStairType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcStairTypeEnum)Enum.Parse(typeof(IfcStairTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcStairType Parse(string strDef) { IfcStairType t = new IfcStairType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public partial class IfcPipeFitting : IfcFlowFitting //IFC4 + { + internal IfcPipeFittingTypeEnum mPredefinedType = IfcPipeFittingTypeEnum.NOTDEFINED; // : OPTIONAL IfcPipeFittingTypeEnum; + public IfcPipeFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPipeFitting() : base() { } + internal IfcPipeFitting(IfcPipeFitting t) : base(t) { } + + internal static void parseFields(IfcPipeFitting s, List arrFields, ref int ipos) + { + IfcFlowFitting.parseFields(s, arrFields, ref ipos); + if (ipos < arrFields.Count) + { + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + s.mPredefinedType = (IfcPipeFittingTypeEnum)Enum.Parse(typeof(IfcPipeFittingTypeEnum), str.Substring(1, str.Length - 2)); + } + } + internal new static IfcPipeFitting Parse(string strDef) { IfcPipeFitting s = new IfcPipeFitting(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcPipeFittingTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcPipeFittingType : IfcFlowFittingType + { + internal IfcPipeFittingTypeEnum mPredefinedType = IfcPipeFittingTypeEnum.NOTDEFINED;// : IfcPipeFittingTypeEnum; + public IfcPipeFittingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcPipeFittingType() : base() { } + internal IfcPipeFittingType(IfcPipeFittingType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcPipeFittingType(DatabaseIfc m, string name, double radius, double bendAngle) : base(m) + { + Name = name; + mHasPropertySets.Add(genPSetBend(m, bendAngle, radius).mIndex); + mPredefinedType = IfcPipeFittingTypeEnum.BEND; + } + internal IfcPipeFittingType(DatabaseIfc m, string name, IfcPipeFittingTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcPipeFittingType t, List arrFields, ref int ipos) { IfcFlowFittingType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcPipeFittingTypeEnum)Enum.Parse(typeof(IfcPipeFittingTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcPipeFittingType Parse(string strDef) { IfcPipeFittingType t = new IfcPipeFittingType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + + internal static IfcPropertySet genPSetBend(DatabaseIfc m, double bendAngle, double bendRadius) + { + List props = new List(); + if (bendAngle > 0) + props.Add(new IfcPropertySingleValue(m, "BendAngle", "", new IfcPlaneAngleMeasure(bendAngle / m.mPlaneAngleToRadians), null)); + if (bendRadius > 0) + props.Add(new IfcPropertySingleValue(m, "BendRadius", "", new IfcPositiveLengthMeasure(bendRadius), null)); + if (props.Count == 0) + return null; + return new IfcPropertySet("Pset_PipeFittingTypeBend", props); + + } + } + public partial class IfcPipeSegment : IfcFlowSegment //IFC4 + { + internal IfcPipeSegmentTypeEnum mPredefinedType = IfcPipeSegmentTypeEnum.NOTDEFINED;// OPTIONAL : IfcPipeSegmentTypeEnum; + public IfcPipeSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPipeSegment() : base() { } + internal IfcPipeSegment(IfcPipeSegment s) : base(s) { mPredefinedType = s.mPredefinedType; } + + internal static void parseFields(IfcPipeSegment s, List arrFields, ref int ipos) + { + IfcFlowSegment.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcPipeSegmentTypeEnum)Enum.Parse(typeof(IfcPipeSegmentTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcPipeSegment Parse(string strDef) { IfcPipeSegment s = new IfcPipeSegment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcPipeSegmentTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcPipeSegmentType : IfcFlowSegmentType + { + internal IfcPipeSegmentTypeEnum mPredefinedType = IfcPipeSegmentTypeEnum.NOTDEFINED;// : IfcPipeSegmentTypeEnum; + public IfcPipeSegmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPipeSegmentType() : base() { } + internal IfcPipeSegmentType(IfcPipeSegmentType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcPipeSegmentType(DatabaseIfc m, string name, IfcPipeSegmentTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcPipeSegmentType t, List arrFields, ref int ipos) { IfcFlowSegmentType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcPipeSegmentTypeEnum)Enum.Parse(typeof(IfcPipeSegmentTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcPipeSegmentType Parse(string strDef) { IfcPipeSegmentType t = new IfcPipeSegmentType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcPixelTexture + public abstract partial class IfcPlacement : IfcGeometricRepresentationItem /*ABSTRACT SUPERTYPE OF (ONEOF (IfcAxis1Placement ,IfcAxis2Placement2D ,IfcAxis2Placement3D))*/ + { + private int mLocation;// : IfcCartesianPoint; + internal IfcCartesianPoint Location { get { return (IfcCartesianPoint)mDatabase.mIfcObjects[mLocation]; } set { mLocation = value.mIndex; } } + protected IfcPlacement(IfcPlacement o) : base(o) { mLocation = o.mLocation; } + protected IfcPlacement() : base() { } + protected IfcPlacement(DatabaseIfc m) : base(m) { mLocation = m.WorldOrigin.mIndex; } + protected IfcPlacement(IfcCartesianPoint p) : base(p.mDatabase) { mLocation = p.mIndex; } + protected static void parseFields(IfcPlacement p, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(p, arrFields, ref ipos); p.mLocation = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mLocation); } + } + public class IfcPlanarBox : IfcPlanarExtent + { + internal int mPlacement;// : IfcAxis2Placement; + internal IfcPlanarBox() : base() { } + internal IfcPlanarBox(IfcPlanarBox p) : base((IfcPlanarExtent)p) { mPlacement = p.mPlacement; } + internal static void parseFields(IfcPlanarBox b, List arrFields, ref int ipos) { IfcPlanarExtent.parseFields(b, arrFields, ref ipos); b.mPlacement = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal new static IfcPlanarBox Parse(string strDef) { IfcPlanarBox b = new IfcPlanarBox(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPlacement); } + } + public class IfcPlanarExtent : IfcGeometricRepresentationItem + { + internal double mSizeInX;// : IfcLengthMeasure; + internal double mSizeInY;// : IfcLengthMeasure; + internal IfcPlanarExtent() : base() { } + internal IfcPlanarExtent(IfcPlanarExtent p) : base(p) { mSizeInX = p.mSizeInX; mSizeInY = p.mSizeInY; } + internal static void parseFields(IfcPlanarExtent p, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(p, arrFields, ref ipos); p.mSizeInX = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mSizeInY = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcPlanarExtent Parse(string strDef) { IfcPlanarExtent p = new IfcPlanarExtent(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mSizeInX) + "," + ParserSTEP.DoubleToString(mSizeInY); } + } + public partial class IfcPlane : IfcElementarySurface + { + internal IfcPlane() : base() { } + internal IfcPlane(IfcPlane o) : base(o) { } + public IfcPlane(IfcAxis2Placement3D placement) : base(placement) { } + internal static IfcPlane Parse(string strDef) { IfcPlane p = new IfcPlane(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcPlane p, List arrFields, ref int ipos) { IfcElementarySurface.parseFields(p, arrFields, ref ipos); } + } + public partial class IfcPlate : IfcBuildingElement + { + internal IfcPlateTypeEnum mPredefinedType = IfcPlateTypeEnum.NOTDEFINED;//: OPTIONAL IfcPlateTypeEnum; + public IfcPlateTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcPlate() : base() { } + internal IfcPlate(IfcPlate o) : base(o) { mPredefinedType = o.mPredefinedType; } + public IfcPlate(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcPlate Parse(string strDef, Schema schema) { IfcPlate p = new IfcPlate(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return p; } + internal static void parseFields(IfcPlate p, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(p, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + p.mPredefinedType = (IfcPlateTypeEnum)Enum.Parse(typeof(IfcPlateTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? base.BuildString() : base.BuildString() + (mPredefinedType == IfcPlateTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcPlateStandardCase : IfcPlate //IFC4 + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 || mDatabase.mModelView == ModelView.Ifc4Reference ? "IFCPLATE" : base.KeyWord); } } + internal IfcPlateStandardCase() : base() { } + internal IfcPlateStandardCase(IfcPlateStandardCase o) : base(o) { } + + internal static IfcPlateStandardCase Parse(string strDef) { IfcPlateStandardCase s = new IfcPlateStandardCase(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcPlateStandardCase s, List arrFields, ref int ipos) { IfcPlate.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcPlateType : IfcBuildingElementType + { + internal IfcPlateTypeEnum mPredefinedType = IfcPlateTypeEnum.NOTDEFINED; + public IfcPlateTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPlateType() : base() { } + internal IfcPlateType(IfcPlateType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcPlateType(DatabaseIfc m, string name, IfcPlateTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal IfcPlateType(string name, IfcMaterialLayerSet mls, IfcPlateTypeEnum type) : this(mls.mDatabase, name, type) { MaterialSelect = mls; } + internal static void parseFields(IfcPlateType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcPlateTypeEnum)Enum.Parse(typeof(IfcPlateTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcPlateType Parse(string strDef) { IfcPlateType t = new IfcPlateType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcPoint : IfcGeometricRepresentationItem, IfcGeometricSetSelect, IfcPointOrVertexPoint /*ABSTRACT SUPERTYPE OF (ONEOF (IfcCartesianPoint ,IfcPointOnCurve ,IfcPointOnSurface))*/ + { + protected IfcPoint() : base() { } + protected IfcPoint(IfcPoint p) : base(p) { } + protected IfcPoint(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcPoint p, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(p, arrFields, ref ipos); } + } + public partial class IfcPointOnCurve : IfcPoint + { + internal int mBasisCurve;// : IfcCurve; + internal double mPointParameter;// : IfcParameterValue; + + public IfcCurve BasisCurve { get { return mDatabase.mIfcObjects[mBasisCurve] as IfcCurve; } set { mBasisCurve = value.mIndex; } } + internal IfcPointOnCurve() : base() { } + internal IfcPointOnCurve(IfcPointOnCurve cp) : base() { mBasisCurve = cp.mBasisCurve; mPointParameter = cp.mPointParameter; } + internal IfcPointOnCurve(DatabaseIfc m, IfcCurve c, double p) : base(m) { mBasisCurve = c.mIndex; mPointParameter = p; } + internal static void parseFields(IfcPointOnCurve p, List arrFields, ref int ipos) { IfcPoint.parseFields(p, arrFields, ref ipos); p.mBasisCurve = ParserSTEP.ParseLink(arrFields[ipos++]); p.mPointParameter = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcPointOnCurve Parse(string strDef) { IfcPointOnCurve p = new IfcPointOnCurve(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisCurve) + "," + ParserSTEP.DoubleToString(mPointParameter); } + } + public partial class IfcPointOnSurface : IfcPoint + { + internal int mBasisSurface;// : IfcSurface; + internal double mPointParameterU, mPointParameterV;// : IfcParameterValue; + public IfcSurface BasisSurface { get { return mDatabase.mIfcObjects[mBasisSurface] as IfcSurface; } set { mBasisSurface = value.mIndex; } } + internal IfcPointOnSurface() : base() { } + internal IfcPointOnSurface(IfcPointOnSurface cp) : base() { mBasisSurface = cp.mBasisSurface; mPointParameterU = cp.mPointParameterU; mPointParameterV = cp.mPointParameterV; } + internal static void parseFields(IfcPointOnSurface p, List arrFields, ref int ipos) { IfcPoint.parseFields(p, arrFields, ref ipos); p.mBasisSurface = ParserSTEP.ParseLink(arrFields[ipos++]); p.mPointParameterU = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mPointParameterV = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcPointOnSurface Parse(string strDef) { IfcPointOnSurface p = new IfcPointOnSurface(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisSurface) + "," + ParserSTEP.DoubleToString(mPointParameterU) + "," + ParserSTEP.DoubleToString(mPointParameterV); } + } + public interface IfcPointOrVertexPoint : IfcInterface { } + public partial class IfcPolygonalBoundedHalfSpace : IfcHalfSpaceSolid + { + internal int mPosition;// : IfcAxis2Placement3D; + internal int mPolygonalBoundary;// : IfcBoundedCurve; + internal IfcPolygonalBoundedHalfSpace() : base() { } + internal IfcPolygonalBoundedHalfSpace(IfcPolygonalBoundedHalfSpace pl) : base(pl) { mPosition = pl.mPosition; mPolygonalBoundary = pl.mPolygonalBoundary; } + internal static void parseFields(IfcPolygonalBoundedHalfSpace s, List arrFields, ref int ipos) { IfcHalfSpaceSolid.parseFields(s, arrFields, ref ipos); s.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); s.mPolygonalBoundary = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal new static IfcPolygonalBoundedHalfSpace Parse(string strDef) { IfcPolygonalBoundedHalfSpace s = new IfcPolygonalBoundedHalfSpace(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPosition) + "," + ParserSTEP.LinkToString(mPolygonalBoundary); } + } + public partial class IfcPolyline : IfcBoundedCurve + { + private List mPoints = new List();// : LIST [2:?] OF IfcCartesianPoint; + + internal List Points { get { return mPoints.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCartesianPoint); } } + + internal IfcPolyline() : base() { } + internal IfcPolyline(IfcPolyline pl) : base(pl) { mPoints = new List(pl.mPoints.ToArray()); } + public IfcPolyline(IfcCartesianPoint start, IfcCartesianPoint end) : base(start.mDatabase) { mPoints.Add(start.mIndex); mPoints.Add(end.mIndex); } + internal IfcPolyline(List pts) : base(pts[1].mDatabase) { mPoints = pts.ConvertAll(x => x.mIndex); } + internal static void parseFields(IfcPolyline p, List arrFields, ref int ipos) { IfcBoundedCurve.parseFields(p, arrFields, ref ipos); p.mPoints = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcPolyline Parse(string strDef) { IfcPolyline p = new IfcPolyline(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string str = base.BuildString() + ",("; + if (mPoints.Count > 0) + str += ParserSTEP.LinkToString(mPoints[0]); + for (int icounter = 1; icounter < mPoints.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mPoints[icounter]); + str += ")"; + return base.BuildString() + str; + } + } + public partial class IfcPolyloop : IfcLoop + { + internal List mPolygon = new List();// : LIST [3:?] OF UNIQUE IfcCartesianPoint; + + internal List Polygon { get { return mPolygon.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCartesianPoint); } } + + internal IfcPolyloop() : base() { } + internal IfcPolyloop(IfcPolyloop o) : base(o) { mPolygon = new List(o.mPolygon.ToArray()); } + public IfcPolyloop(List polygon) : base(polygon[0].mDatabase) { mPolygon = polygon.ConvertAll(x => x.mIndex); } + public IfcPolyloop(IfcCartesianPoint cp1, IfcCartesianPoint cp2, IfcCartesianPoint cp3) : base(cp1.mDatabase) { mPolygon = new List() { cp1.mIndex, cp2.mIndex, cp3.mIndex }; } + internal new static IfcPolyloop Parse(string strDef) { IfcPolyloop l = new IfcPolyloop(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcPolyloop l, List arrFields, ref int ipos) { IfcLoop.parseFields(l, arrFields, ref ipos); l.mPolygon = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string str = base.BuildString() + ",("; + if (mPolygon.Count > 0) + str += "#" + mPolygon[0]; + for (int icounter = 1; icounter < mPolygon.Count; icounter++) + str += ",#" + mPolygon[icounter]; + return str + ")"; + } + } + public abstract partial class IfcPort : IfcProduct + { //INVERSE + internal IfcRelConnectsPortToElement mContainedIn = null;// : SET [0:1] OF IfcRelConnectsPortToElement FOR RelatingPort; + internal IfcRelConnectsPorts mConnectedFrom = null;// : SET [0:1] OF IfcRelConnectsPorts FOR RelatedPort; + internal IfcRelConnectsPorts mConnectedTo = null;// : SET [0:1] OF IfcRelConnectsPorts FOR RelatingPort; + + protected IfcPort() : base() { } + protected IfcPort(IfcPort q) : base(q) { } + protected IfcPort(DatabaseIfc db) : base(db) { } + protected IfcPort(IfcElement e) : base(e.mDatabase) + { + if (mDatabase.mSchema == Schema.IFC2x3) + { + new IfcRelConnectsPortToElement(this, e); + } + else + { + if (e.mIsNestedBy.Count == 0) + e.mIsNestedBy.Add(new IfcRelNests(e, this)); + else + e.mIsNestedBy[0].addObject(this); + } + } + protected IfcPort(IfcElementType t) + : base(t.mDatabase) + { + if (t.mIsNestedBy.Count == 0) + t.mIsNestedBy.Add(new IfcRelNests(t, this)); + else + t.mIsNestedBy[0].addObject(this); + } + + protected static void parseFields(IfcPort p, List arrFields, ref int ipos) { IfcProduct.parseFields(p, arrFields, ref ipos); } + + internal IfcElement getElement() + { + if (mDatabase.mSchema == Schema.IFC2x3) + { + } + else if (mNests != null) + return mNests.RelatingObject as IfcElement; + return null; + } + } + public abstract class IfcPositioningElement : IfcProduct //IFC4.1 + { + protected IfcPositioningElement() : base() { } + protected IfcPositioningElement(IfcPositioningElement q) : base(q) { } + protected static void parseFields(IfcPositioningElement p, List arrFields, ref int ipos) { IfcProduct.parseFields(p, arrFields, ref ipos); } + } + public partial class IfcPostalAddress : IfcAddress + { + internal string mInternalLocation = "$";// : OPTIONAL IfcLabel; + internal List mAddressLines = new List();// : OPTIONAL LIST [1:?] OF IfcLabel; + internal string mPostalBox = "$";// :OPTIONAL IfcLabel; + internal string mTown = "$";// : OPTIONAL IfcLabel; + internal string mRegion = "$";// : OPTIONAL IfcLabel; + internal string mPostalCode = "$";// : OPTIONAL IfcLabel; + internal string mCountry = "$";// : OPTIONAL IfcLabel; + + public string InternalLocation { get { return (mInternalLocation == "$" ? "" : ParserIfc.Decode(mInternalLocation)); } set { mInternalLocation = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List AddressLines { get { return mAddressLines.ConvertAll(x => ParserIfc.Decode(x)); } set { mAddressLines = (value == null ? new List() : value.ConvertAll(x => ParserIfc.Encode(x))); } } + public string PostalBox { get { return (mPostalBox == "$" ? "" : ParserIfc.Decode(mPostalBox)); } set { mPostalBox = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Town { get { return (mTown == "$" ? "" : ParserIfc.Decode(mTown)); } set { mTown = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Region { get { return (mRegion == "$" ? "" : ParserIfc.Decode(mRegion)); } set { mRegion = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string PostalCode { get { return (mPostalCode == "$" ? "" : ParserIfc.Decode(mPostalCode)); } set { mPostalCode = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Country { get { return (mCountry == "$" ? "" : ParserIfc.Decode(mCountry)); } set { mCountry = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcPostalAddress() : base() { } + internal IfcPostalAddress(IfcPostalAddress o) + : base(o) + { + mInternalLocation = o.mInternalLocation; mAddressLines = o.mAddressLines; mPostalBox = o.mPostalBox; + mTown = o.mTown; mRegion = o.mRegion; mPostalCode = o.mPostalCode; mCountry = o.mCountry; + } + public IfcPostalAddress(DatabaseIfc m, IfcAddressTypeEnum purpose) : base(m, purpose) { } + + internal static void parseFields(IfcPostalAddress a, List arrFields, ref int ipos) + { + IfcAddress.parseFields(a, arrFields, ref ipos); + a.mInternalLocation = arrFields[ipos++].Replace("'", ""); + if (string.IsNullOrEmpty(a.mInternalLocation)) + a.mInternalLocation = "$"; + string str = arrFields[ipos++]; + if (str != "$") + { + List lst = ParserSTEP.SplitLineFields(str); + for (int icounter = 0; icounter < lst.Count; icounter++) + a.mAddressLines.Add(lst[icounter].Replace("'", "")); + } + a.mPostalBox = arrFields[ipos++].Replace("'", ""); + if (string.IsNullOrEmpty(a.mPostalBox)) + a.mPostalBox = "$"; + a.mTown = arrFields[ipos++].Replace("'", ""); + if (string.IsNullOrEmpty(a.mTown)) + a.mTown = "$"; + a.mRegion = arrFields[ipos++].Replace("'", ""); + if (string.IsNullOrEmpty(a.mRegion)) + a.mRegion = "$"; + a.mPostalCode = arrFields[ipos++].Replace("'", ""); + if (string.IsNullOrEmpty(a.mPostalCode)) + a.mPostalCode = "$"; + a.mCountry = arrFields[ipos++].Replace("'", ""); + if (string.IsNullOrEmpty(a.mCountry)) + a.mCountry = "$"; + } + protected override string BuildString() + { + string str = base.BuildString() + (mInternalLocation == "$" ? ",$," : ",'" + mInternalLocation + "',"); + if (mAddressLines.Count == 0) + str += "$"; + else + { + str += "('" + mAddressLines[0]; + for (int icounter = 1; icounter < mAddressLines.Count; icounter++) + str += "','" + mAddressLines[icounter]; + str += "')"; + } + return str + (mPostalBox == "$" ? ",$" : ",'" + mPostalBox + "'") + (mTown == "$" ? ",$" : ",'" + mTown + "'") + (mRegion == "$" ? ",$" : ",'" + mRegion + "'") + (mPostalCode == "$" ? ",$" : ",'" + mPostalCode + "'") + (mCountry == "$" ? ",$" : ",'" + mCountry + "'"); + } + internal static IfcPostalAddress Parse(string strDef) { IfcPostalAddress a = new IfcPostalAddress(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + } + public abstract class IfcPreDefinedColour : IfcPreDefinedItem, IfcColour // ABSTRACT SUPERTYPE OF(IfcDraughtingPreDefinedColour) + { + protected IfcPreDefinedColour() : base() { } + protected IfcPreDefinedColour(IfcPreDefinedColour c) : base(c) { } + protected static void parseFields(IfcPreDefinedColour c, List arrFields, ref int ipos) { IfcPreDefinedItem.parseFields(c, arrFields, ref ipos); } + public Color Colour { get { return Color.Empty; } } + } + public abstract class IfcPreDefinedCurveFont : IfcPreDefinedItem, IfcCurveStyleFontSelect + { + protected IfcPreDefinedCurveFont() : base() { } + protected IfcPreDefinedCurveFont(IfcPreDefinedCurveFont f) : base(f) { } + protected static void parseFields(IfcPreDefinedCurveFont f, List arrFields, ref int ipos) { IfcPreDefinedItem.parseFields(f, arrFields, ref ipos); } + } + public class IfcPreDefinedDimensionSymbol : IfcPreDefinedSymbol // DEPRECEATED IFC4 + { + internal IfcPreDefinedDimensionSymbol() : base() { } + internal IfcPreDefinedDimensionSymbol(IfcPreDefinedDimensionSymbol s) : base(s) { } + internal static IfcPreDefinedDimensionSymbol Parse(string strDef) { IfcPreDefinedDimensionSymbol s = new IfcPreDefinedDimensionSymbol(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcPreDefinedDimensionSymbol s, List arrFields, ref int ipos) { IfcPreDefinedSymbol.parseFields(s, arrFields, ref ipos); } + } + public abstract class IfcPreDefinedItem : IfcPresentationItem + { + internal string mName = "";//: IfcLabel; + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcPreDefinedItem() : base() { } + protected IfcPreDefinedItem(IfcPreDefinedItem i) : base() { mName = i.mName; } + protected static void parseFields(IfcPreDefinedItem i, List arrFields, ref int ipos) { i.mName = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mName; } + } + public class IfcPreDefinedPointMarkerSymbol : IfcPreDefinedSymbol // DEPRECEATED IFC4 + { + internal IfcPreDefinedPointMarkerSymbol() : base() { } + internal IfcPreDefinedPointMarkerSymbol(IfcPreDefinedPointMarkerSymbol s) : base(s) { } + internal static IfcPreDefinedPointMarkerSymbol Parse(string strDef) { IfcPreDefinedPointMarkerSymbol s = new IfcPreDefinedPointMarkerSymbol(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcPreDefinedPointMarkerSymbol s, List arrFields, ref int ipos) { IfcPreDefinedSymbol.parseFields(s, arrFields, ref ipos); } + } + public abstract class IfcPreDefinedProperties : IfcPropertyAbstraction // IFC4 ABSTRACT SUPERTYPE OF(ONEOF(IfcReinforcementBarProperties, IfcSectionProperties, IfcSectionReinforcementProperties)) + { + protected IfcPreDefinedProperties() : base() { } + protected IfcPreDefinedProperties(IfcPreDefinedProperties i) : base(i) { } + protected IfcPreDefinedProperties(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcPreDefinedProperties p, List arrFields, ref int ipos) { IfcPropertyAbstraction.parseFields(p, arrFields, ref ipos); } + } + public abstract class IfcPreDefinedPropertySet : IfcPropertySetDefinition // IFC4 ABSTRACT SUPERTYPE OF(ONEOF(IfcDoorLiningProperties, + { //IfcDoorPanelProperties, IfcPermeableCoveringProperties, IfcReinforcementDefinitionProperties, IfcWindowLiningProperties, IfcWindowPanelProperties)) + protected IfcPreDefinedPropertySet() : base() { } + protected IfcPreDefinedPropertySet(IfcPreDefinedPropertySet el) : base(el) { } + protected IfcPreDefinedPropertySet(DatabaseIfc m, string name) : base(m, name) { } + protected static void parseFields(IfcPreDefinedPropertySet s, List arrFields, ref int ipos) { IfcPropertySetDefinition.parseFields(s, arrFields, ref ipos); } + } + public abstract class IfcPreDefinedSymbol : IfcPreDefinedItem // DEPRECEATED IFC4 + { + protected IfcPreDefinedSymbol() : base() { } + protected IfcPreDefinedSymbol(IfcPreDefinedSymbol el) : base(el) { } + protected static void parseFields(IfcPreDefinedSymbol s, List arrFields, ref int ipos) { IfcPreDefinedItem.parseFields(s, arrFields, ref ipos); } + } + public class IfcPreDefinedTerminatorSymbol : IfcPreDefinedSymbol // DEPRECEATED IFC4 + { + internal IfcPreDefinedTerminatorSymbol() : base() { } + internal IfcPreDefinedTerminatorSymbol(IfcPreDefinedTerminatorSymbol i) : base(i) { } + internal static IfcPreDefinedTerminatorSymbol Parse(string strDef) { IfcPreDefinedTerminatorSymbol s = new IfcPreDefinedTerminatorSymbol(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcPreDefinedTerminatorSymbol s, List arrFields, ref int ipos) { IfcPreDefinedSymbol.parseFields(s, arrFields, ref ipos); } + } + public abstract class IfcPreDefinedTextFont : IfcPreDefinedItem + { + protected IfcPreDefinedTextFont() : base() { } + protected IfcPreDefinedTextFont(IfcPreDefinedTextFont el) : base(el) { } + protected static void parseFields(IfcPreDefinedTextFont f, List arrFields, ref int ipos) { IfcPreDefinedItem.parseFields(f, arrFields, ref ipos); } + } + public abstract class IfcPresentationItem : BaseClassIfc // ABSTRACT SUPERTYPE OF(ONEOF(IfcColourRgbList, IfcColourSpecification, + { // IfcCurveStyleFont, IfcCurveStyleFontAndScaling, IfcCurveStyleFontPattern, IfcIndexedColourMap, IfcPreDefinedItem, IfcSurfaceStyleLighting, IfcSurfaceStyleRefraction, IfcSurfaceStyleShading, IfcSurfaceStyleWithTextures, IfcSurfaceTexture, IfcTextStyleForDefinedFont, IfcTextStyleTextModel, IfcTextureCoordinate, IfcTextureVertex, IfcTextureVertexList)); + protected IfcPresentationItem() : base() { } + protected IfcPresentationItem(IfcPresentationItem i) : base() { } + protected IfcPresentationItem(DatabaseIfc m) : base(m) { } + protected virtual void parseFields(List arrFields, ref int ipos) { } + } + public partial class IfcPresentationLayerAssignment : BaseClassIfc //SUPERTYPE OF (IfcPresentationLayerWithStyle); + { + private string mName = "$";// : IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal List mAssignedItems = new List();// : SET [1:?] OF IfcLayeredItem; + internal string mIdentifier = "$";// : OPTIONAL IfcIdentifier; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "Default Layer" : mName = ParserIfc.Encode(value.Replace("'", ""))); } } + public List AssignedItems { get { return mAssignedItems.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcLayeredItem); } } + + internal IfcPresentationLayerAssignment() : base() { } + internal IfcPresentationLayerAssignment(IfcPresentationLayerAssignment o) : base() { mName = o.mName; mDescription = o.mDescription; mAssignedItems = new List(o.mAssignedItems.ToArray()); mIdentifier = o.mIdentifier; } + internal IfcPresentationLayerAssignment(DatabaseIfc db, string name, string desc, string identifier) : base(db) + { + Name = name; + if (!string.IsNullOrEmpty(desc)) + mDescription = desc.Replace("'", ""); + if (!string.IsNullOrEmpty(identifier)) + mIdentifier = identifier.Replace("'", ""); + } + internal IfcPresentationLayerAssignment(string name, string desc, List items, string identifier) : this(items[0].Database,name,desc,identifier) + { + if (items != null) + mAssignedItems = items.ConvertAll(x => x.Index); + } + internal static IfcPresentationLayerAssignment Parse(string str) + { + IfcPresentationLayerAssignment a = new IfcPresentationLayerAssignment(); + int pos = 0; + parseString(a, str, ref pos); + return a; + } + protected static void parseString(IfcPresentationLayerAssignment a, string str, ref int pos) + { + a.mName = ParserSTEP.StripString(str, ref pos); + a.mDescription = ParserSTEP.StripString(str, ref pos); + a.mAssignedItems = ParserSTEP.StripListLink(str, ref pos); + a.mIdentifier = ParserSTEP.StripString(str, ref pos); + } + protected override string BuildString() + { + if (mAssignedItems.Count < 1 || mDatabase.mOutputEssential) + return ""; + string str = base.BuildString() + ",'" + mName + (mDescription == "$" ? "',$,(" : "'," + mDescription + ",(") + ParserSTEP.LinkToString(mAssignedItems[0]); + if (mAssignedItems.Count > 100) + { + StringBuilder sb = new StringBuilder(); + for (int icounter = 1; icounter < mAssignedItems.Count; icounter++) + sb.Append(",#" + mAssignedItems[icounter]); + str += sb.ToString(); + } + else + { + for (int icounter = 1; icounter < mAssignedItems.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mAssignedItems[icounter]); + } + return str + (mIdentifier == "$" ? "),$" : "),'" + mIdentifier + "'"); + } + internal void addItem(IfcRepresentation rep) { mAssignedItems.Add(rep.mIndex); } + internal void relate() + { + List items = AssignedItems; + for (int icounter = 0; icounter < items.Count; icounter++) + items[icounter].LayerAssignments.Add(this); + } + } + public partial class IfcPresentationLayerWithStyle : IfcPresentationLayerAssignment + { + internal IfcLogicalEnum mLayerOn = IfcLogicalEnum.UNKNOWN;// : LOGICAL; + internal IfcLogicalEnum mLayerFrozen = IfcLogicalEnum.UNKNOWN;// : LOGICAL; + internal IfcLogicalEnum mLayerBlocked = IfcLogicalEnum.UNKNOWN;// LOGICAL; + internal List mLayerStyles = new List();// SET OF IfcPresentationStyleSelect; IFC4 IfcPresentationStyle + internal List LayerStyles { get { return mLayerStyles.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcPresentationStyleSelect); } } + internal IfcPresentationLayerWithStyle() : base() { } + internal IfcPresentationLayerWithStyle(IfcPresentationLayerWithStyle o) : base(o) { mLayerOn = o.mLayerOn; mLayerFrozen = o.mLayerFrozen; mLayerBlocked = o.mLayerBlocked; mLayerStyles = new List(o.mLayerStyles.ToArray()); } + internal IfcPresentationLayerWithStyle(DatabaseIfc db, string name, string desc, string identifier, bool on, bool frozen, bool blocked, List styles ) + : base(db,name, desc, identifier) { mLayerOn = (on ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); mLayerFrozen = (frozen ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); mLayerBlocked = (blocked ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); if (styles != null && styles.Count > 0) mLayerStyles = styles.ConvertAll(x => x.Index); } + internal IfcPresentationLayerWithStyle(string name, string desc, List items, string identifier, bool on, bool frozen, bool blocked, List styles ) + : base(name, desc, items, identifier) { mLayerOn = (on ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); mLayerFrozen = (frozen ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); mLayerBlocked = (blocked ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); if (styles != null && styles.Count > 0) mLayerStyles = styles.ConvertAll(x => x.Index); } + internal new static IfcPresentationLayerWithStyle Parse(string str) + { + IfcPresentationLayerWithStyle s = new IfcPresentationLayerWithStyle(); + int pos = 0; + IfcPresentationLayerAssignment.parseString(s, str, ref pos); + s.mLayerOn = ParserIfc.StripLogical(str, ref pos); + s.mLayerFrozen = ParserIfc.StripLogical(str, ref pos); + s.mLayerBlocked = ParserIfc.StripLogical(str, ref pos); + s.mLayerStyles = ParserSTEP.StripListLink(str, ref pos); + return s; + } + protected override string BuildString() + { + if (mDatabase.mOutputEssential || mAssignedItems.Count < 1 || mLayerStyles.Count == 0) + return ""; + string str = base.BuildString() + "," + ParserIfc.LogicalToString(mLayerOn) + "," + + ParserIfc.LogicalToString(mLayerFrozen) + "," + ParserIfc.LogicalToString(mLayerBlocked); + str += ",(" + ParserSTEP.LinkToString(mLayerStyles[0]); + for (int icounter = 1; icounter < mLayerStyles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mLayerStyles[icounter]); + return str + ")"; + } + } + public abstract partial class IfcPresentationStyle : BaseClassIfc, IfcStyleAssignmentSelect //ABSTRACT SUPERTYPE OF (ONEOF(IfcCurveStyle,IfcFillAreaStyle,IfcSurfaceStyle,IfcSymbolStyle,IfcTextStyle)); + { + private string mName = "$";// : OPTIONAL IfcLabel; + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + //INVERSE + internal List mStyledItems = new List(); + public List StyledItems { get { return mStyledItems; } } + protected IfcPresentationStyle() : base() { } + protected IfcPresentationStyle(IfcPresentationStyle i) : base() { mName = i.mName; } + protected IfcPresentationStyle(DatabaseIfc m, string name) : base(m) { Name = name; } + protected static void parseFields(IfcPresentationStyle s, List arrFields, ref int ipos) { s.mName = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$" : ",'" + mName + "'"); } + } + public partial class IfcPresentationStyleAssignment : BaseClassIfc, IfcStyleAssignmentSelect //DEPRECEATED IFC4 + { + internal List mStyles = new List();// : SET [1:?] OF IfcPresentationStyleSelect; + + internal List Styles { get { return mStyles.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcPresentationStyleSelect); } } + //INVERSE + internal List mStyledItems = new List(); + public List StyledItems { get { return mStyledItems; } } + + internal IfcPresentationStyleAssignment() : base() { } + internal IfcPresentationStyleAssignment(IfcPresentationStyleAssignment o) : base() { mStyles = new List(o.mStyles.ToArray()); } + internal IfcPresentationStyleAssignment(DatabaseIfc m, IfcPresentationStyle style) : base(m) { mStyles.Add(style.Index); } + internal IfcPresentationStyleAssignment(DatabaseIfc m, List styles) : base(m) { mStyles = styles.ConvertAll(x => x.Index); } + internal static IfcPresentationStyleAssignment Parse(string strDef) { IfcPresentationStyleAssignment s = new IfcPresentationStyleAssignment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcPresentationStyleAssignment s, List arrFields, ref int ipos) { s.mStyles = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mStyles[0]); + for (int icounter = 1; icounter < mStyles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mStyles[icounter]); + return str + ")"; + } + } + public interface IfcPresentationStyleSelect : IfcInterface { } //DEPRECEATED IFC4 TYPE = SELECT(IfcNullStyle, IfcCurveStyle, IfcSymbolStyle, IfcFillAreaStyle, IfcTextStyle, IfcSurfaceStyle); + public interface IfcSpecularHighlightSelect { } //SELECT ( IfcSpecularExponent, IfcSpecularRoughness); + public class IfcProcedure : IfcProcess + { + internal string mProcedureID;// : IfcIdentifier; + internal IfcProcedureTypeEnum mProcedureType;// : IfcProcedureTypeEnum; + internal string mUserDefinedProcedureType = "$";// : OPTIONAL IfcLabel; + internal IfcProcedure() : base() { } + internal IfcProcedure(IfcProcedure o) : base(o) { mProcedureID = o.mProcedureID; mProcedureType = o.mProcedureType; mUserDefinedProcedureType = o.mUserDefinedProcedureType; } + internal static IfcProcedure Parse(string strDef) { IfcProcedure p = new IfcProcedure(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcProcedure p, List arrFields, ref int ipos) { IfcProcess.parseFields(p, arrFields, ref ipos); p.mProcedureID = arrFields[ipos++]; p.mProcedureType = (IfcProcedureTypeEnum)Enum.Parse(typeof(IfcProcedureTypeEnum), arrFields[ipos++].Replace(".", "")); p.mUserDefinedProcedureType = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + mProcedureID + ",." + mProcedureType.ToString() + ".," + mUserDefinedProcedureType; } + } + public class IfcProcedureType : IfcTypeProcess //IFC4 + { + internal IfcProcedureTypeEnum mPredefinedType = IfcProcedureTypeEnum.NOTDEFINED;// : IfcProcedureTypeEnum; + public IfcProcedureTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcProcedureType() : base() { } + internal IfcProcedureType(IfcProcedureType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcProcedureType(DatabaseIfc m, string name, IfcProcedureTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcProcedureType t, List arrFields, ref int ipos) { IfcTypeProcess.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcProcedureTypeEnum)Enum.Parse(typeof(IfcProcedureTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcProcedureType Parse(string strDef) { IfcProcedureType t = new IfcProcedureType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public abstract partial class IfcProcess : IfcObject // ABSTRACT SUPERTYPE OF (ONEOF (IfcProcedure ,IfcTask)) + { + internal string mIdentification = "$";// :OPTIONAL IfcIdentifier; + internal string mLongDescription = "$";//: OPTIONAL IfcText; + //INVERSE + internal List mIsSuccessorFrom = new List();// : SET [0:?] OF IfcRelSequence FOR RelatedProcess; + internal List mIsPredecessorTo = new List();// : SET [0:?] OF IfcRelSequence FOR RelatingProcess; + internal List mOperatesOn = new List();// : SET [0:?] OF IfcRelAssignsToProcess FOR RelatingProcess; + + public string Identification { get { return (mIdentification == "$" ? "" : ParserIfc.Decode(mIdentification)); } set { mIdentification = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string LongDescription { get { return (mLongDescription == "$" ? "" : ParserIfc.Decode(mLongDescription)); } set { mLongDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcProcess() : base() { } + protected IfcProcess(IfcProcess o) : base(o) { } + protected IfcProcess(DatabaseIfc m) : base(m) + { + if (mDatabase.mModelView != ModelView.Ifc4NotAssigned && mDatabase.mModelView != ModelView.If2x3NotAssigned) + throw new Exception("Invalid Model View for IfcProcess : " + m.ModelView.ToString()); + } + + protected static void parseFields(IfcProcess p, List arrFields, ref int ipos,Schema schema) + { + IfcObject.parseFields(p, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + p.mIdentification = arrFields[ipos++].Replace("'", ""); + p.mLongDescription = arrFields[ipos++].Replace("'", ""); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema != Schema.IFC2x3 ? (mIdentification == "$" ? ",$," : ",'" + mIdentification + "',") + (mLongDescription == "$" ? "$" : "'" + mLongDescription + "'") : ""); } + } + public abstract partial class IfcProduct : IfcObject, IfcProductSelect // ABSTRACT SUPERTYPE OF (ONEOF (IfcAnnotation ,IfcElement ,IfcGrid ,IfcPort ,IfcProxy ,IfcSpatialElement ,IfcStructuralActivity ,IfcStructuralItem)) + { + private int mPlacement = 0; //: OPTIONAL IfcObjectPlacement; + private int mRepresentation = 0; //: OPTIONAL IfcProductRepresentation + //INVERSE + internal List mReferencedBy = new List();// : SET OF IfcRelAssignsToProduct FOR RelatingProduct; + //internal List mContainedInStructure = new List(); //ERR IFC4 change to Element + public IfcObjectPlacement Placement + { + get { return (mPlacement == 0 ? null : (IfcObjectPlacement)mDatabase.mIfcObjects[mPlacement]); } + set + { + if (value == null) + mPlacement = 0; + else + { + mPlacement = value.mIndex; + value.mPlacesObject.Add(this); + } + } + } + public IfcProductRepresentation Representation + { + get { return mDatabase.mIfcObjects[mRepresentation] as IfcProductRepresentation; } + set + { + if(value == null) + mRepresentation = 0; + else + { + mRepresentation = value.mIndex; + IfcProductDefinitionShape pds = value as IfcProductDefinitionShape; + + if (pds != null && mPlacement == 0) + { + IfcElement element = this as IfcElement; + if (element == null) + Placement = new IfcLocalPlacement(new IfcAxis2Placement3D(mDatabase)); + else + { + IfcProduct product = element.getContainer(); + Placement = (product == null ? new IfcLocalPlacement(new IfcAxis2Placement3D(mDatabase)) : new IfcLocalPlacement(product.Placement, new IfcAxis2Placement3D(mDatabase))); + } + } + } + } + } + public List ReferencedBy { get { return mReferencedBy; } } + + internal IfcObjectPlacement mContainerCommonPlacement = null; //GeometryGym common Placement reference for aggregated items + + protected IfcProduct() : base() { } + protected IfcProduct(IfcProduct o) : base(o) { mPlacement = o.mPlacement; mRepresentation = o.mRepresentation; } + protected IfcProduct(IfcProductRepresentation rep) : base(rep.mDatabase) { mRepresentation = rep.mIndex; } + protected IfcProduct(IfcObjectPlacement placement) : base(placement.mDatabase) { mPlacement = placement.mIndex; } + protected IfcProduct(IfcObjectPlacement placement, IfcProductRepresentation rep) : base(rep.mDatabase) { mPlacement = placement.mIndex; mRepresentation = rep.mIndex; } + protected IfcProduct(DatabaseIfc db) : base(db) { } + protected IfcProduct(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host.mDatabase) + { + IfcElement el = this as IfcElement; + if (el != null) + host.AddElement(el); + else + { + if (host.mIsDecomposedBy.Count == 0) + { + new IfcRelAggregates(host, this); + } + else + host.mIsDecomposedBy[0].addObject(this); + } + Placement = p; + Representation = r; + } + + protected static void parseFields(IfcProduct p, List arrFields, ref int ipos) { IfcObject.parseFields(p, arrFields, ref ipos); p.mPlacement = ParserSTEP.ParseLink(arrFields[ipos++]); p.mRepresentation = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mPlacement) + "," + ParserSTEP.LinkToString((mDatabase.mOutputEssential ? 0 : mRepresentation)); } + + public virtual bool AddElement(IfcElement s) + { + for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) + { + IfcRelAggregates a = mIsDecomposedBy[icounter] as IfcRelAggregates; + if (a.Description.EndsWith("Elements", true, System.Globalization.CultureInfo.CurrentCulture)) + { + a.addObject(s); + return true; + } + } + IfcRelAggregates ra = new IfcRelAggregates(mDatabase, KeyWord.Substring(3), "Element", this); + ra.addObject(s); + return true; + } + internal void relate() + { + if (mPlacement > 0) + Placement.mPlacesObject.Add(this); + if (mRepresentation > 0) + { + IfcProductDefinitionShape pds = Representation as IfcProductDefinitionShape; + if (pds != null) + pds.mShapeOfProduct.Add(this); + } + } + } + //ENTITY IfcProductsOfCombustionProperties // DEPRECEATED IFC4 + public partial class IfcProductDefinitionShape : IfcProductRepresentation, IfcProductRepresentationSelect + { + //INVERSE + internal List mShapeOfProduct = new List(); + internal List mHasShapeAspects = new List(); + + public List HasShapeAspects { get { return mHasShapeAspects; } } + + public new List Representations + { + get { return base.Representations.ConvertAll(x => (IfcShapeModel)x); } + set { base.Representations = value.ConvertAll(x => x as IfcRepresentation); } + } + + internal IfcProductDefinitionShape() : base() { } + internal IfcProductDefinitionShape(IfcProductDefinitionShape i) : base(i) { } + public IfcProductDefinitionShape(IfcShapeModel rep) : base(rep) { } + public IfcProductDefinitionShape(List reps) : base(reps.ConvertAll(x => x as IfcRepresentation)) { } + internal new static IfcProductDefinitionShape Parse(string strDef) { IfcProductDefinitionShape s = new IfcProductDefinitionShape(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcProductDefinitionShape s, List arrFields, ref int ipos) { IfcProductRepresentation.parseFields(s, arrFields, ref ipos); } + protected override string BuildString() { if (mDatabase.mOutputEssential) return ""; else return base.BuildString(); } + } + public partial class IfcProductRepresentation : BaseClassIfc //(IfcMaterialDefinitionRepresentation ,IfcProductDefinitionShape)); + { + private string mName = "$";// : OPTIONAL IfcLabel; + private string mDescription = "$";// : OPTIONAL IfcText; + internal List mRepresentations = new List();// : LIST [1:?] OF IfcRepresentation; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List Representations + { + get { return mRepresentations.ConvertAll(x => (IfcRepresentation)mDatabase.mIfcObjects[x]); } + set { mRepresentations = value.ConvertAll(x => x.mIndex); } + } + + public IfcRepresentation Representation { set { mRepresentations = new List() { value.mIndex }; } } + + internal IfcProductRepresentation() : base() { } + internal IfcProductRepresentation(IfcProductRepresentation i) : base() { mName = i.mName; mDescription = i.mDescription; mRepresentations.AddRange(i.mRepresentations.ToArray()); } + public IfcProductRepresentation(IfcRepresentation r) : base(r.mDatabase) { mRepresentations.Add(r.mIndex); } + public IfcProductRepresentation(List reps) : base(reps[0].mDatabase) { Representations = reps; } + + internal static IfcProductRepresentation Parse(string strDef) { IfcProductRepresentation r = new IfcProductRepresentation(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcProductRepresentation r, List arrFields, ref int ipos) { r.mName = arrFields[ipos++].Replace("'", ""); r.mDescription = arrFields[ipos++].Replace("'", ""); r.mRepresentations = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$,(" : "'" + mDescription + "',("); + if (mRepresentations.Count > 0) + { + str += ParserSTEP.LinkToString(mRepresentations[0]); + for (int icounter = 1; icounter < mRepresentations.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRepresentations[icounter]); + } + return str + ")"; + } + + internal virtual void relate() + { + List reps = Representations; + foreach (IfcRepresentation r in reps) + { + if (r != null) + r.OfProductRepresentation.Add(this); + } + } + } + public interface IfcProductRepresentationSelect : IfcInterface { List HasShapeAspects { get; } }// IfcProductDefinitionShape, IfcRepresentationMap); + public interface IfcProductSelect : IfcInterface { List ReferencedBy { get; } string GlobalId { get; } } // IfcProduct, IfcTypeProduct); + public partial class IfcProfileDef : BaseClassIfc, IfcResourceObjectSelect // SUPERTYPE OF (ONEOF (IfcArbitraryClosedProfileDef ,IfcArbitraryOpenProfileDef + { //,IfcCompositeProfileDef ,IfcDerivedProfileDef ,IfcParameterizedProfileDef)); IFC2x3 abstract + internal IfcProfileTypeEnum mProfileType = IfcProfileTypeEnum.AREA;// : IfcProfileTypeEnum; + private string mProfileName = "$";// : OPTIONAL IfcLabel; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasProperties = new List(); + internal List mHasConstraintRelationships = new List(); //gg + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + public IfcProfileTypeEnum ProfileType { get { return mProfileType; } set { mProfileType = value; } } + public string ProfileName { get { return mProfileName == "$" ? "" : ParserIfc.Decode(mProfileName); } set { mProfileName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public override string Name { get { return ProfileName; } set { ProfileName = value; } } + public List HasExternalReferences { get { return mHasExternalReferences; } } + + protected IfcProfileDef() : base() { } + protected IfcProfileDef(IfcProfileDef i) : base(i) { mProfileType = i.mProfileType; mProfileName = i.mProfileName; } + protected IfcProfileDef(DatabaseIfc m) : base(m) + { + if (mDatabase.mSchema == Schema.IFC2x3) + mHasProperties.Add(new IfcGeneralProfileProperties(mProfileName, this)); + } + internal static IfcProfileDef Parse(string strDef) { IfcProfileDef p = new IfcProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected static void parseFields(IfcProfileDef p, List arrFields, ref int ipos) + { + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + p.mProfileType = (IfcProfileTypeEnum)Enum.Parse(typeof(IfcProfileTypeEnum), str.Replace(".", "")); + p.mProfileName = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + ",." + mProfileType.ToString() + (mProfileName == "$" ? ".,$" : ".,'" + mProfileName + "'"); } + } + public partial class IfcProfileProperties : IfcExtendedProperties //IFC2x3 Abstract : BaseClassIfc ABSTRACT SUPERTYPE OF (ONEOF(IfcGeneralProfileProperties, IfcRibPlateProfileProperties)); + { + //internal string mProfileName = "$";// : OPTIONAL IfcLabel; DELETED IFC4 + private int mProfileDefinition;// : OPTIONAL IfcProfileDef; + + internal IfcProfileDef ProfileDefinition { get { return mDatabase.mIfcObjects[mProfileDefinition] as IfcProfileDef; } set { mProfileDefinition = value == null ? 0 : value.mIndex; } } + + internal IfcRelAssociatesProfileProperties mAssociates = null; //GeometryGym attribute + + internal IfcProfileProperties() : base() { } + internal IfcProfileProperties(IfcProfileProperties p) : base() { mProfileDefinition = p.mProfileDefinition; } + internal IfcProfileProperties(string name, IfcProfileDef p) + : base(p.mDatabase) + { + Name = name; + mProfileDefinition = p.mIndex; + if (p.mDatabase.mSchema == Schema.IFC2x3) + mAssociates = new IfcRelAssociatesProfileProperties(this) { Name = p.ProfileName }; + } + internal IfcProfileProperties(string name, List props, IfcProfileDef p) + : base(name, props) + { + mProfileDefinition = p.mIndex; + if (p.mDatabase.mSchema == Schema.IFC2x3) + mAssociates = new IfcRelAssociatesProfileProperties(this) { Name = p.ProfileName }; + } + internal static IfcProfileProperties Parse(string strDef, Schema schema) { IfcProfileProperties p = new IfcProfileProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return p; } + internal static void parseFields(IfcProfileProperties p, List arrFields, ref int ipos, Schema schema) + { + if (schema == Schema.IFC2x3) + { + p.mName = arrFields[ipos++].Replace("'", ""); + p.mProfileDefinition = ParserSTEP.ParseLink(arrFields[ipos++]); + } + else + { + IfcExtendedProperties.parseFields(p, arrFields, ref ipos,schema); + p.mProfileDefinition = ParserSTEP.ParseLink(arrFields[ipos++]); + } + } + protected override string BuildString() { return (ProfileDefinition == null ? "" : base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? (mName == "$" ? ",$," : ",'" + mName + "',") : ",") + ParserSTEP.LinkToString(mProfileDefinition)); } + + internal static IfcPropertySet genPSetMechanical(DatabaseIfc m, double massPerLength, double crossSectionArea, double perimeter, double minPlThck, double maxPlThck, double cogX, double cogY, double shearZ, double momIntertiaY, double momIntertiaZ, double momIntertiaYZ, + double torsionalConst, double warpingConst, double shearDeformAreaZ, double shearDeformAreaY, double maxSectModY, double minSectModY, double maxSectModZ, double minSectModZ, double torsSectMod, double shearAreaZ, double shearAreaY, double plasticFactorY, double plasticFactorZ) + { + List props = new List(); + if (massPerLength > 0) + props.Add(new IfcPropertySingleValue(m, "MassPerLength", "", new IfcMassPerLengthMeasure(massPerLength))); + if (crossSectionArea > 0) + props.Add(new IfcPropertySingleValue(m, "CrossSectionArea", "", new IfcAreaMeasure(crossSectionArea))); + if (perimeter > 0) + props.Add(new IfcPropertySingleValue(m, "Perimeter", "", new IfcPositiveLengthMeasure(perimeter))); + if (minPlThck > 0) + props.Add(new IfcPropertySingleValue(m, "MinimumPlateThickness", "", new IfcPositiveLengthMeasure(minPlThck))); + if (maxPlThck > 0) + props.Add(new IfcPropertySingleValue(m, "MaximumPlateThickness", "", new IfcPositiveLengthMeasure(maxPlThck))); + props.Add(new IfcPropertySingleValue(m, "CentreOfGravityInX", "", new IfcLengthMeasure(cogX))); + props.Add(new IfcPropertySingleValue(m, "CentreOfGravityInY", "", new IfcLengthMeasure(cogY))); + props.Add(new IfcPropertySingleValue(m, "ShearCentreZ", "", new IfcLengthMeasure(cogX))); + props.Add(new IfcPropertySingleValue(m, "ShearCentreY", "", new IfcLengthMeasure(cogY))); + if (momIntertiaY > 0) + props.Add(new IfcPropertySingleValue(m, "MomentOfInertiaY", "", new IfcMomentOfInertiaMeasure(momIntertiaY))); + if (momIntertiaZ > 0) + props.Add(new IfcPropertySingleValue(m, "MomentOfInertiaZ", "", new IfcMomentOfInertiaMeasure(momIntertiaZ))); + if (momIntertiaYZ > 0) + props.Add(new IfcPropertySingleValue(m, "MomentOfInertiaYZ", "", new IfcMomentOfInertiaMeasure(momIntertiaYZ))); + if (torsionalConst > 0) + props.Add(new IfcPropertySingleValue(m, "TorsionalConstantX", "", new IfcMomentOfInertiaMeasure(torsionalConst))); + if (warpingConst > 0) + props.Add(new IfcPropertySingleValue(m, "WarpingConstant", "", new IfcWarpingConstantMeasure(warpingConst))); + if (shearDeformAreaZ > 0) + props.Add(new IfcPropertySingleValue(m, "ShearDeformationAreaZ", "", new IfcAreaMeasure(shearDeformAreaZ))); + if (shearDeformAreaY > 0) + props.Add(new IfcPropertySingleValue(m, "ShearDeformationAreaY", "", new IfcAreaMeasure(shearDeformAreaY))); + if (maxSectModY > 0) + props.Add(new IfcPropertySingleValue(m, "MaximumSectionModulusY", "", new IfcSectionModulusMeasure(maxSectModY))); + if (minSectModY > 0) + props.Add(new IfcPropertySingleValue(m, "MinimumSectionModulusY", "", new IfcSectionModulusMeasure(minSectModY))); + if (maxSectModZ > 0) + props.Add(new IfcPropertySingleValue(m, "MaximumSectionModulusZ", "", new IfcSectionModulusMeasure(maxSectModZ))); + if (minSectModZ > 0) + props.Add(new IfcPropertySingleValue(m, "MinimumSectionModulusZ", "", new IfcSectionModulusMeasure(minSectModZ))); + if (torsSectMod > 0) + props.Add(new IfcPropertySingleValue(m, "TorsionalSectionModulus", "", new IfcSectionModulusMeasure(torsSectMod))); + if (shearAreaZ > 0) + props.Add(new IfcPropertySingleValue(m, "ShearAreaZ", "", new IfcAreaMeasure(shearAreaZ))); + if (shearAreaY > 0) + props.Add(new IfcPropertySingleValue(m, "ShearAreaY", "", new IfcAreaMeasure(shearAreaY), null)); + if (plasticFactorY > 0) + props.Add(new IfcPropertySingleValue(m, "PlasticShapeFactorY", "", new IfcPositiveRatioMeasure(plasticFactorY))); + if (plasticFactorZ > 0) + props.Add(new IfcPropertySingleValue(m, "PlasticShapeFactorZ", "", new IfcPositiveRatioMeasure(plasticFactorZ))); + return new IfcPropertySet("Pset_ProfileMechanical", props); + } + } + public partial class IfcProject : IfcContext + { + internal IfcProject() : base() { } + internal IfcProject(IfcProject o) : base(o) { } + + public IfcProject(IfcBuilding building, string name) : this(building.mDatabase, name) { new IfcRelAggregates(building.mDatabase, "Project", "Building", this, building); } + public IfcProject(IfcSite site, string name) : this(site.mDatabase, name) { new IfcRelAggregates(site.mDatabase, "Project", "Site", this, site); } + public IfcProject(IfcBuilding building, string name, IfcUnitAssignment.Length length) : this(building.mDatabase, name, length) { IfcRelAggregates ra = new IfcRelAggregates(building.mDatabase, "Project", "Building", this, building); } + public IfcProject(IfcSite site, string name, IfcUnitAssignment.Length length) : this(site.mDatabase, name, length) { IfcRelAggregates ra = new IfcRelAggregates(site.mDatabase, "Project", "Site", this, site); } + public IfcProject(DatabaseIfc m, string name) : base(m, name) + { + m.mContext = this; + if (string.IsNullOrEmpty(Name)) + Name = "UNKNOWN PROJECT"; + } + private IfcProject(DatabaseIfc m, string name, IfcUnitAssignment.Length length) + : base(m, name, length) + { + m.mContext = this; + if (string.IsNullOrEmpty(Name)) + Name = "UNKNOWN PROJECT"; + } + + internal static void parseFields(IfcProject p, List arrFields, ref int ipos) { IfcContext.parseFields(p, arrFields, ref ipos); } + internal static IfcProject Parse(string strDef) { IfcProject p = new IfcProject(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + + public IfcSpatialElement RootElement { get { return (mIsDecomposedBy.Count == 0 ? null : mIsDecomposedBy[0].RelatedObjects[0] as IfcSpatialElement); } } + internal IfcSite getSite() { return (mIsDecomposedBy.Count == 0 ? null : mIsDecomposedBy[0].RelatedObjects[0] as IfcSite); } + public IfcSite UppermostSite { get { return getSite(); } } + public IfcBuilding UppermostBuilding + { + get + { + if (mIsDecomposedBy.Count == 0) + return null; + BaseClassIfc ent = mDatabase.mIfcObjects[mIsDecomposedBy[0].mRelatedObjects[0]]; + IfcBuilding result = ent as IfcBuilding; + if (result != null) + return result; + IfcSite s = ent as IfcSite; + if (s != null) + { + List bs = s.getBuildings(); + if (bs.Count > 0) + return bs[0]; + } + return null; + } + } + } + public class IfcProjectedCRS : IfcCoordinateReferenceSystem //IFC4 + { + internal string mMapProjection = "$";// : OPTIONAL IfcIdentifier; + internal string mMapZone = "$";// : OPTIONAL IfcIdentifier + internal IfcNamedUnit mMapUnit = null;// : OPTIONAL IfcNamedUnit; + internal IfcProjectedCRS() : base() { } + internal IfcProjectedCRS(IfcProjectedCRS m) : base(m) { mName = m.mName; mMapZone = m.mMapZone; mMapUnit = m.mMapUnit; } + internal IfcProjectedCRS(DatabaseIfc m, string name, string desc, string geodeticDatum, string verticalDatum, string mapProjection, string mapZone, IfcLengthMeasure optMeasure) + : base(m, name, desc, geodeticDatum, verticalDatum) + { + if (mapProjection != "") + mMapProjection = mapProjection.Replace("'", ""); + if (desc != "") + mMapZone = desc.Replace("'", ""); + } + internal static IfcProjectedCRS Parse(string strDef) { IfcProjectedCRS m = new IfcProjectedCRS(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcProjectedCRS m, List arrFields, ref int ipos) + { + IfcCoordinateReferenceSystem.parseFields(m, arrFields, ref ipos); + m.mName = arrFields[ipos++].Replace("'", ""); + m.mMapZone = arrFields[ipos++].Replace("'", ""); + //m.mMapUnit = IFCModel.mSTP.parseSTPLink(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + (mMapProjection == "$" ? ",$," : ",'" + mMapProjection + "',") + + (mMapZone == "$" ? "$," : "'" + mMapZone + "',") + + (mMapUnit == null ? "$" : mMapUnit.ToString()); + } + } + //ENTITY IfcProjectionCurve // DEPRECEATED IFC4 + public partial class IfcProjectionElement : IfcFeatureElementAddition + { + internal IfcProjectionElementTypeEnum mPredefinedType = IfcProjectionElementTypeEnum.NOTDEFINED;// : OPTIONAL IfcProjectionElementTypeEnum; //IFC4 + //INVERSE + internal IfcProjectionElement() : base() { } + internal IfcProjectionElement(IfcProjectionElement od) : base(od) { mPredefinedType = od.mPredefinedType; } + + internal static IfcProjectionElement Parse(string strDef, Schema schema) { IfcProjectionElement e = new IfcProjectionElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return e; } + internal static void parseFields(IfcProjectionElement e, List arrFields, ref int ipos, Schema schema) + { + IfcFeatureElementAddition.parseFields(e, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + e.mPredefinedType = (IfcProjectionElementTypeEnum)Enum.Parse(typeof(IfcProjectionElementTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcProjectionElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); } + } + public partial class IfcProjectLibrary : IfcContext + { + internal IfcProjectLibrary() : base() { } + internal IfcProjectLibrary(IfcProjectLibrary o) : base(o) { } + public IfcProjectLibrary(DatabaseIfc m, string name, IfcUnitAssignment.Length length) + : base(m, name, length) + { + if (m.ModelView == ModelView.Ifc4Reference || m.ModelView == ModelView.Ifc2x3Coordination) + throw new Exception("Invalid Model View for IfcProjectLibrary : " + m.ModelView.ToString()); + if (string.IsNullOrEmpty(Name)) + Name = "UNKNOWN PROJECTLIBRARY"; + } + internal static IfcProjectLibrary Parse(string strDef) { IfcProjectLibrary p = new IfcProjectLibrary(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public class IfcProjectOrder : IfcControl + { + //internal string mID;// : IfcIdentifier; IFC4 relocated + internal IfcProjectOrderTypeEnum mPredefinedType;// : IfcProjectOrderTypeEnum; + internal string mStatus = "$";// : OPTIONAL IfcLabel; + internal string mLongDescription = "$"; // : OPTIONAL IfcText; + internal IfcProjectOrder() : base() { } + internal IfcProjectOrder(IfcProjectOrder i) : base(i) { mPredefinedType = i.mPredefinedType; mStatus = i.mStatus; mLongDescription = i.mLongDescription; } + internal static IfcProjectOrder Parse(string strDef,Schema schema) { IfcProjectOrder p = new IfcProjectOrder(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcProjectOrder p, List arrFields, ref int ipos,Schema schema) + { + IfcControl.parseFields(p, arrFields, ref ipos,schema); + if (schema == Schema.IFC2x3) + p.mIdentification = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + p.mPredefinedType = (IfcProjectOrderTypeEnum)Enum.Parse(typeof(IfcProjectOrderTypeEnum), s.Replace(".", "")); + p.mStatus = arrFields[ipos++].Replace("'", ""); + if (schema != Schema.IFC2x3) + p.mLongDescription = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? ",'" + mIdentification + "',." : ",.") + mPredefinedType.ToString() + (mStatus == "$" ? ".,$" : ".," + mStatus + "'") + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mLongDescription == "$" ? ",$" : ",'" + mLongDescription + "'")); } + } + public class IfcProjectOrderRecord : IfcControl // DEPRECEATED IFC4 + { + internal List mRecords = new List();// : LIST [1:?] OF UNIQUE IfcRelAssignsToProjectOrder; + internal IfcProjectOrderRecordTypeEnum mPredefinedType;// : IfcProjectOrderRecordTypeEnum; + internal IfcProjectOrderRecord() : base() { } + internal IfcProjectOrderRecord(IfcProjectOrderRecord i) : base(i) { mRecords = new List(i.mRecords.ToArray()); mPredefinedType = i.mPredefinedType; } + internal static IfcProjectOrderRecord Parse(string strDef, Schema schema) { IfcProjectOrderRecord r = new IfcProjectOrderRecord(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcProjectOrderRecord r, List arrFields, ref int ipos, Schema schema) + { + IfcControl.parseFields(r, arrFields, ref ipos,schema); + r.mRecords = ParserSTEP.SplitListLinks(arrFields[ipos++]); + r.mPredefinedType = (IfcProjectOrderRecordTypeEnum)Enum.Parse(typeof(IfcProjectOrderRecordTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mRecords[0]); + for (int icounter = 1; icounter < mRecords.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRecords[icounter]); + return str + "),." + mPredefinedType.ToString() + "."; + } + } + public abstract partial class IfcProperty : IfcPropertyAbstraction //ABSTRACT SUPERTYPE OF (ONEOF(IfcComplexProperty,IfcSimpleProperty)); + { + internal string mName = ""; //: IfcIdentifier; + internal string mDescription = "$"; //: OPTIONAL IfcText; + //INVERSE + internal List mPartOfPset = new List();// : SET OF IfcPropertySet FOR HasProperties; + //internal List mPropertyForDependance : SET OF IfcPropertyDependencyRelationship FOR DependingProperty; + //PropertyDependsOn : SET OF IfcPropertyDependencyRelationship FOR DependantProperty; + internal List mPartOfComplex = new List();// : SET OF IfcComplexProperty FOR HasProperties; + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { if (!string.IsNullOrEmpty(value)) mName = ParserIfc.Encode(value.Replace("'", "")); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcProperty(IfcProperty r) { mName = r.mName; mDescription = r.mDescription; } + protected IfcProperty() : base() { } + protected IfcProperty(DatabaseIfc db, string name, string desc) : base(db) { Name = name; Description = desc; } + protected static void parseFields(IfcProperty p, List arrFields, ref int ipos) { p.mName = arrFields[ipos++].Replace("'", ""); p.mDescription = arrFields[ipos++].Replace("'", ""); } + protected override void parseString(string str, ref int pos) + { + mName = ParserSTEP.StripString(str, ref pos); + mDescription = ParserSTEP.StripString(str, ref pos); + } + protected override string BuildString() { return base.BuildString() + ",'" + mName + (mDescription == "$" ? "',$" : "','" + mDescription + "'"); } + } + public abstract class IfcPropertyAbstraction : BaseClassIfc, IfcResourceObjectSelect //ABSTRACT SUPERTYPE OF (ONEOF (IfcExtendedProperties ,IfcPreDefinedProperties ,IfcProperty ,IfcPropertyEnumeration)); + { //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + protected IfcPropertyAbstraction(IfcPropertyAbstraction p) : base() { } + protected IfcPropertyAbstraction() : base() { } + protected IfcPropertyAbstraction(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcPropertyAbstraction p, List arrFields, ref int ipos) { } + protected virtual void parseString(string str, ref int pos) { } + } + public partial class IfcPropertyBoundedValue : IfcSimpleProperty + { + internal IfcValue mUpperBoundValue;// : OPTIONAL IfcValue; + internal IfcValue mLowerBoundValue;// : OPTIONAL IfcValue; + internal int mUnit;// : OPTIONAL IfcUnit; + internal IfcValue mSetPointValue;// OPTIONAL IfcValue; IFC4 + internal IfcPropertyBoundedValue(IfcPropertyBoundedValue q) : base(q) { mUpperBoundValue = q.mUpperBoundValue; mLowerBoundValue = q.mLowerBoundValue; mUnit = q.mUnit; mSetPointValue = q.mSetPointValue; } + internal IfcPropertyBoundedValue() : base() { } + internal IfcPropertyBoundedValue(DatabaseIfc m, string name, string desc, IfcValue upper, IfcValue lower, IfcNamedUnit unit, IfcValue set) + : base(m, name, desc) + { + mUpperBoundValue = upper; + mLowerBoundValue = lower; + mSetPointValue = set; + if (unit != null) + mUnit = unit.mIndex; + } + internal static void parseFields(IfcPropertyBoundedValue p, List arrFields, ref int ipos, Schema schema) + { + IfcSimpleProperty.parseFields(p, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s != "$") + p.mUpperBoundValue = ParserIfc.parseValue(s); + s = arrFields[ipos++]; + if (s != "$") + p.mLowerBoundValue = ParserIfc.parseValue(s); + s = arrFields[ipos++]; + if (s != "$") + p.mUnit = ParserSTEP.ParseLink(s); + if (schema != Schema.IFC2x3) + { + s = arrFields[ipos++]; + if (s != "$") + p.mSetPointValue = ParserIfc.parseValue(arrFields[ipos++]); + } + } + internal static IfcPropertyBoundedValue Parse(string strDef, Schema schema) { IfcPropertyBoundedValue p = new IfcPropertyBoundedValue(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + protected override string BuildString() { return base.BuildString() + (mUpperBoundValue == null ? ",$," : "," + mUpperBoundValue.ToString() + ",") + (mLowerBoundValue == null ? "$," : mLowerBoundValue.ToString() + ",") + ParserSTEP.LinkToString(mUnit) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mSetPointValue == null ? ",$" : "," + mSetPointValue.ToString())); } + } + public abstract partial class IfcPropertyDefinition : IfcRoot, IfcDefinitionSelect //(IfcPropertySetDefinition, IfcPropertyTemplateDefinition) + { //INVERSE + internal IfcRelDeclares mHasContext = null;// : SET [0:1] OF IfcRelDeclares FOR RelatedDefinitions; + internal List mHasAssociations = new List();// : SET OF IfcRelAssociates FOR RelatedObjects; + public IfcRelDeclares HasContext { get { return mHasContext; } set { mHasContext = value; } } + public List HasAssociations { get { return mHasAssociations; } } + + DatabaseIfc IfcDefinitionSelect.Model { get { return mDatabase; } } + + protected IfcPropertyDefinition() : base() { } + protected IfcPropertyDefinition(IfcPropertyDefinition i) : base(i) { } + internal IfcPropertyDefinition(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcPropertyDefinition p, List arrFields, ref int ipos) { IfcRoot.parseFields(p, arrFields, ref ipos); } + internal virtual void Associate(IfcRelAssociates a) { mHasAssociations.Add(a); } + } + //ENTITY IfcPropertyDependencyRelationship; + public partial class IfcPropertyEnumeratedValue : IfcSimpleProperty + { + //internal List mEnumerationValues = new List();// : LIST [1:?] OF IfcValue; + internal string mEnumerationValues = "";// : LIST [1:?] OF IfcValue; + internal int mEnumerationReference;// : OPTIONAL IfcPropertyEnumeration; + + internal IfcPropertyEnumeratedValue(IfcPropertyEnumeratedValue q) : base(q) { mEnumerationValues = q.mEnumerationValues; /*mEnumerationValues = new List( q.mEnumerationValues.ToArray());*/ mEnumerationReference = q.mEnumerationReference; } + internal IfcPropertyEnumeratedValue() : base() { } + internal static void parseFields(IfcPropertyEnumeratedValue p, List arrFields, ref int ipos) { IfcSimpleProperty.parseFields(p, arrFields, ref ipos); string str = arrFields[ipos++]; p.mEnumerationValues = str; p.mEnumerationReference = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcPropertyEnumeratedValue Parse(string strDef) { IfcPropertyEnumeratedValue p = new IfcPropertyEnumeratedValue(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + mEnumerationValues + "," + ParserSTEP.LinkToString(mEnumerationReference); } + } + public class IfcPropertyEnumeration : IfcPropertyAbstraction + { + internal string mName;// : IfcLabel; + internal List mEnumerationValues = new List();// : LIST [1:?] OF UNIQUE IfcValue + internal int mUnit; // : OPTIONAL IfcUnit; + internal IfcPropertyEnumeration(IfcPropertyEnumeration q) : base(q) { mName = q.mName; mEnumerationValues.AddRange(q.mEnumerationValues); mUnit = q.mUnit; } + internal IfcPropertyEnumeration() : base() { } + internal static void parseFields(IfcPropertyEnumeration p, List arrFields, ref int ipos) + { + IfcPropertyAbstraction.parseFields(p, arrFields, ref ipos); + p.mName = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + p.mEnumerationValues = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)).ConvertAll(x => ParserIfc.parseValue(x)); + p.mUnit = ParserSTEP.ParseLink(arrFields[ipos++]); + } + internal static IfcPropertyEnumeration Parse(string strDef) { IfcPropertyEnumeration p = new IfcPropertyEnumeration(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + string s = base.BuildString() + ",'" + mName + "',(" + mEnumerationValues[0].ToString(); + for (int icounter = 1; icounter < mEnumerationValues.Count; icounter++) + s += "," + mEnumerationValues[icounter].ToString(); + return s + ")," + ParserSTEP.LinkToString(mUnit); + } + } + public class IfcPropertyListValue : IfcSimpleProperty + { + internal List mNominalValue = new List();// : OPTIONAL LIST [1:?] OF IfcValue; + internal int mUnit;// : OPTIONAL IfcUnit; + internal IfcPropertyListValue(IfcPropertyListValue q) : base(q) { mNominalValue = q.mNominalValue; mUnit = q.mUnit; } + internal IfcPropertyListValue(IfcSimpleProperty bc) : base(bc) { } + internal IfcPropertyListValue() : base() { } + internal IfcPropertyListValue(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, List values) + : base(m, name, desc) { if (unit != null) mUnit = unit.mIndex; mNominalValue = values; } + internal static IfcPropertyListValue parseFields(IfcPropertyListValue p, List arrFields, ref int ipos) + { + IfcSimpleProperty.parseFields(p, arrFields, ref ipos); + String str = arrFields[ipos++]; + List values = ParserSTEP.SplitLineFields(str.Substring(1, str.Length - 2)); + for (int icounter = 0; icounter < values.Count; icounter++) + { + IfcValue value = ParserIfc.parseValue(values[icounter]); + if (value != null) + p.mNominalValue.Add(value); + } + p.mUnit = ParserSTEP.ParseLink(arrFields[ipos++]); + return p; + } + internal static IfcPropertyListValue Parse(string strDef) { int ipos = 0; IfcPropertyListValue p = new IfcPropertyListValue(); parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + string result = base.BuildString() + ",(" + mNominalValue[0].ToString(); + for (int icounter = 1; icounter < mNominalValue.Count; icounter++) + result += "," + mNominalValue[icounter].ToString(); + return result + (mUnit == 0 ? "),$" : "),#" + mUnit); + } + } + public partial class IfcPropertyReferenceValue : IfcSimpleProperty + { + internal string mUsageName;// : OPTIONAL IfcText; + internal int mPropertyReference = 0;// : OPTIONAL IfcObjectReferenceSelect; + + internal IfcPropertyReferenceValue(IfcPropertyReferenceValue p) : base(p) { mUsageName = p.mUsageName; mPropertyReference = p.mPropertyReference; } + internal IfcPropertyReferenceValue() : base() { } + internal IfcPropertyReferenceValue(DatabaseIfc m, string name, string desc) : base(m, name, desc) { } + internal static void parseFields(IfcPropertyReferenceValue p, List arrFields, ref int ipos) { IfcSimpleProperty.parseFields(p, arrFields, ref ipos); p.mUsageName = arrFields[ipos++]; p.mPropertyReference = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcPropertyReferenceValue Parse(string strDef) { IfcPropertyReferenceValue p = new IfcPropertyReferenceValue(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + mUsageName + "," + ParserSTEP.LinkToString(mPropertyReference); } + } + public partial class IfcPropertySet : IfcPropertySetDefinition + { + protected List mHasProperties = new List(1);// : SET [1:?] OF IfcProperty; + + public List HasProperties { get { return mHasProperties.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProperty); } } + + internal IfcPropertySet() : base() { } + internal IfcPropertySet(IfcPropertySet i) : base(i) { mHasProperties = new List(i.mHasProperties.ToArray()); } + public IfcPropertySet(DatabaseIfc db, string name) : base(db, name) { } + public IfcPropertySet(string name, List props) : base(props[0].mDatabase, name) { mHasProperties = props.ConvertAll(x => x.mIndex); } + internal static IfcPropertySet Parse(string str) + { + IfcPropertySet p = new IfcPropertySet(); + int pos = 0; + p.parseString(str, ref pos); + p.mHasProperties = ParserSTEP.StripListLink(str, ref pos); + return p; + } + protected override string BuildString() + { + if (mHasProperties.Count == 0) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mHasProperties[0]); + for (int icounter = 1; icounter < mHasProperties.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mHasProperties[icounter]); + return str + ")"; + } + + internal void relate() + { + List props = HasProperties; + for (int icounter = 0; icounter < props.Count; icounter++) + props[icounter].mPartOfPset.Add(this); + } + + public IfcProperty FindProperty(string name) + { + List props = HasProperties; + foreach (IfcProperty p in props) + { + if (string.Compare(p.mName, name, true) == 0) + return p; + } + return null; + } + } + public abstract partial class IfcPropertySetDefinition : IfcPropertyDefinition //ABSTRACT SUPERTYPE OF (ONEOF (IfcElementQuantity,IfcEnergyProperties , + { // IfcFluidFlowProperties,IfcPropertySet, IfcServiceLifeFactor ,IfcSoundProperties ,IfcSoundValue ,IfcSpaceThermalLoadProperties )) + //INVERSE + internal List mDefinesType = new List();// : SET OF IfcTypeObject FOR HasPropertySets; IFC4change + //internal List mIsDefinedBy = new List();//IsDefinedBy : SET OF IfcRelDefinesByTemplate FOR RelatedPropertySets; + private IfcRelDefinesByProperties mDefinesOccurrence = null; //: SET [0:1] OF IfcRelDefinesByProperties FOR RelatingPropertyDefinition; + internal IfcRelDefinesByProperties DefinesOccurrence { get { if (mDefinesOccurrence == null) mDefinesOccurrence = new IfcRelDefinesByProperties(this) { Name = Name }; return mDefinesOccurrence; } set { mDefinesOccurrence = value; } } + protected IfcPropertySetDefinition() : base() { } + protected IfcPropertySetDefinition(IfcPropertySetDefinition i) : base(i) { } + protected IfcPropertySetDefinition(DatabaseIfc m, string name) : base(m) { Name = name; } + internal static void parseFields(IfcPropertySetDefinition d, List arrFields, ref int ipos) { IfcPropertyDefinition.parseFields(d, arrFields, ref ipos); } + } + public interface IfcPropertySetDefinitionSelect : IfcInterface { }// = SELECT ( IfcPropertySetDefinitionSet, IfcPropertySetDefinition); + // IfcPropertySetDefinitionSet + public partial class IfcPropertySingleValue : IfcSimpleProperty + { + private IfcValue mNominalValue;// : OPTIONAL IfcValue; + private int mUnit;// : OPTIONAL IfcUnit; + + public IfcValue NominalValue { get { return mNominalValue; } set { mNominalValue = value; } } + internal IfcUnit Unit { get { return mDatabase.mIfcObjects[mUnit] as IfcUnit; } set { mUnit = (value == null ? 0 : value.Index); } } + + private string mVal; + internal IfcPropertySingleValue(IfcPropertySingleValue q) : base(q) { mNominalValue = q.mNominalValue; mUnit = q.mUnit; } + internal IfcPropertySingleValue() : base() { } + public IfcPropertySingleValue(DatabaseIfc m, string name, IfcValue value) : base(m, name,"") { mNominalValue = value; } + public IfcPropertySingleValue(DatabaseIfc m, string name, string desc, IfcValue value) : base(m, name, desc) { mNominalValue = value; } + public IfcPropertySingleValue(DatabaseIfc m, string name, string desc, bool value) : this(m, name, desc, new IfcBoolean(value)) { } + public IfcPropertySingleValue(DatabaseIfc m, string name, string desc, int value) : this(m, name, desc, new IfcInteger(value)) { } + public IfcPropertySingleValue(DatabaseIfc m, string name, string desc, double value) : this(m, name, desc, new IfcReal(value)) { } + public IfcPropertySingleValue(DatabaseIfc m, string name, string desc, string value) : this(m, name, desc, new IfcLabel(value)) { } + public IfcPropertySingleValue(DatabaseIfc m, string name, string desc, IfcValue val, IfcUnit unit) : this(m, name, desc,val) { Unit = unit; } + + + internal static IfcPropertySingleValue Parse(string str) + { + IfcPropertySingleValue p = new IfcPropertySingleValue(); + int pos = 0; + p.parseString(str, ref pos); + string s = ParserSTEP.StripField(str, ref pos);// arrFields[ipos++]; + p.mNominalValue = ParserIfc.parseValue(s); + if (p.mNominalValue == null) + p.mVal = s; + p.mUnit = ParserSTEP.StripLink(str, ref pos); //ParserSTEP.ParseSTPLink(arrFields[ipos++]); + return p; + } + protected override string BuildString() { return base.BuildString() + "," + (mNominalValue == null ? mVal : mNominalValue.ToString()) + "," + ParserSTEP.LinkToString(mUnit); } + } + public class IfcPropertyTableValue : IfcSimpleProperty + { + internal List mDefiningValues = new List();// : OPTIONAL LIST [1:?] OF UNIQUE IfcValue; + internal List mDefinedValues = new List();// : OPTIONAL LIST [1:?] OF IfcValue; + internal string mExpression = "$";// :: OPTIONAL IfcText; + internal int mDefiningUnit;// : : OPTIONAL IfcUnit; + internal int mDefinedUnit;// : : OPTIONAL IfcUnit; + internal IfcCurveInterpolationEnum mCurveInterpolation = IfcCurveInterpolationEnum.NOTDEFINED;// : : OPTIONAL IfcCurveInterpolationEnum; + + internal IfcPropertyTableValue(IfcPropertyTableValue q) : base(q) { mDefiningValues = new List(q.mDefiningValues.ToArray()); mDefinedValues = new List(q.mDefinedValues.ToArray()); mExpression = q.mExpression; mDefiningUnit = q.mDefiningUnit; mDefinedUnit = q.mDefinedUnit; mCurveInterpolation = q.mCurveInterpolation; } + internal IfcPropertyTableValue() : base() { } + internal static void parseFields(IfcPropertyTableValue p, List arrFields, ref int ipos) + { + IfcSimpleProperty.parseFields(p, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] != '$') + { + List ss = ParserSTEP.SplitLineFields(str); + for (int icounter = 0; icounter < ss.Count; icounter++) + { + IfcValue v = ParserIfc.parseValue(ss[icounter]); + if (v != null) + p.mDefiningValues.Add(v); + } + } + str = arrFields[ipos++]; + if (str[0] != '$') + { + List ss = ParserSTEP.SplitLineFields(arrFields[ipos++]); + for (int icounter = 0; icounter < ss.Count; icounter++) + { + IfcValue v = ParserIfc.parseValue(ss[icounter]); + if (v != null) + p.mDefinedValues.Add(v); + } + } + p.mExpression = arrFields[ipos++]; + p.mDefiningUnit = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mDefinedUnit = ParserSTEP.ParseLink(arrFields[ipos++]); + str = arrFields[ipos++]; + if (str[0] != '$') + p.mCurveInterpolation = (IfcCurveInterpolationEnum)Enum.Parse(typeof(IfcCurveInterpolationEnum), str.Replace(".", "")); + } + internal static IfcPropertyTableValue Parse(string strDef) { IfcPropertyTableValue p = new IfcPropertyTableValue(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + string result = base.BuildString() + (mDefiningValues.Count > 0 ? ",(" + mDefiningValues[0].ToString() : ",$,"); + for (int icounter = 1; icounter < mDefiningValues.Count; icounter++) + result += "," + mDefiningValues[icounter].ToString(); + result += (mDefiningValues.Count > 0 ? ")," : "") + (mDefinedValues.Count > 0 ? "(" + mDefinedValues[0].ToString() : "$,"); + for (int icounter = 1; icounter < mDefinedValues.Count; icounter++) + result += "," + mDefinedValues[icounter].ToString(); + return result + (mDefinedValues.Count > 0 ? ")," : "") + mExpression + "," + ParserSTEP.LinkToString(mDefiningUnit) + "," + ParserSTEP.LinkToString(mDefinedUnit) + ",." + mCurveInterpolation.ToString() + "."; + } + } + public class IfcProtectiveDevice : IfcFlowController //IFC4 + { + internal IfcProtectiveDeviceTypeEnum mPredefinedType = IfcProtectiveDeviceTypeEnum.NOTDEFINED;// OPTIONAL : IfcProtectiveDeviceTypeEnum; + public IfcProtectiveDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcProtectiveDevice() : base() { } + internal IfcProtectiveDevice(IfcProtectiveDevice d) : base(d) { mPredefinedType = d.mPredefinedType; } + internal IfcProtectiveDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcProtectiveDevice s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcProtectiveDeviceTypeEnum)Enum.Parse(typeof(IfcProtectiveDeviceTypeEnum), str); + } + internal new static IfcProtectiveDevice Parse(string strDef) { IfcProtectiveDevice s = new IfcProtectiveDevice(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcProtectiveDeviceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcProtectiveDeviceTrippingUnit : IfcDistributionControlElement //IFC4 + { + internal IfcProtectiveDeviceTrippingUnitTypeEnum mPredefinedType = IfcProtectiveDeviceTrippingUnitTypeEnum.NOTDEFINED; + public IfcProtectiveDeviceTrippingUnitTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcProtectiveDeviceTrippingUnit() : base() { } + internal IfcProtectiveDeviceTrippingUnit(IfcProtectiveDeviceTrippingUnit u) : base(u) { mPredefinedType = u.mPredefinedType; } + internal IfcProtectiveDeviceTrippingUnit(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcProtectiveDeviceTrippingUnit a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcProtectiveDeviceTrippingUnitTypeEnum)Enum.Parse(typeof(IfcProtectiveDeviceTrippingUnitTypeEnum), s.Replace(".", "")); + } + internal new static IfcProtectiveDeviceTrippingUnit Parse(string strDef) { IfcProtectiveDeviceTrippingUnit d = new IfcProtectiveDeviceTrippingUnit(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcProtectiveDeviceTrippingUnitTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcProtectiveDeviceTrippingUnitType : IfcDistributionControlElementType + { + internal IfcProtectiveDeviceTrippingUnitTypeEnum mPredefinedType = IfcProtectiveDeviceTrippingUnitTypeEnum.NOTDEFINED;// : IfcProtectiveDeviceTrippingUnitTypeEnum; + public IfcProtectiveDeviceTrippingUnitTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcProtectiveDeviceTrippingUnitType() : base() { } + internal IfcProtectiveDeviceTrippingUnitType(IfcProtectiveDeviceTrippingUnitType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcProtectiveDeviceTrippingUnitType(DatabaseIfc m, string name, IfcProtectiveDeviceTrippingUnitTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcProtectiveDeviceTrippingUnitType t, List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcProtectiveDeviceTrippingUnitTypeEnum)Enum.Parse(typeof(IfcProtectiveDeviceTrippingUnitTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcProtectiveDeviceTrippingUnitType Parse(string strDef) { IfcProtectiveDeviceTrippingUnitType t = new IfcProtectiveDeviceTrippingUnitType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcProtectiveDeviceType : IfcFlowControllerType + { + internal IfcProtectiveDeviceTypeEnum mPredefinedType = IfcProtectiveDeviceTypeEnum.NOTDEFINED;// : IfcProtectiveDeviceTypeEnum; + public IfcProtectiveDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcProtectiveDeviceType() : base() { } + internal IfcProtectiveDeviceType(IfcProtectiveDeviceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcProtectiveDeviceType(DatabaseIfc m, string name, IfcProtectiveDeviceTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcProtectiveDeviceType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcProtectiveDeviceTypeEnum)Enum.Parse(typeof(IfcProtectiveDeviceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcProtectiveDeviceType Parse(string strDef) { IfcProtectiveDeviceType t = new IfcProtectiveDeviceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcProxy : IfcProduct + { + internal IfcObjectTypeEnum mProxyType;// : IfcObjectTypeEnum; + internal string mTag = "$";// : OPTIONAL IfcLabel; + internal IfcProxy() : base() { } + internal IfcProxy(IfcProxy q) : base(q) { mProxyType = q.mProxyType; mTag = q.mTag; } + internal static void parseFields(IfcProxy p, List arrFields, ref int ipos) { IfcProduct.parseFields(p, arrFields, ref ipos); p.mProxyType = (IfcObjectTypeEnum)Enum.Parse(typeof(IfcObjectTypeEnum), arrFields[ipos++].Replace(".", "")); p.mTag = arrFields[ipos++].Replace("'", ""); } + internal static IfcProxy Parse(string strDef) { IfcProxy p = new IfcProxy(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + ",." + mProxyType.ToString() + ".," + (mTag == "$" ? "$" : "'" + mTag + "'"); } + } + public class IfcPump : IfcFlowMovingDevice //IFC4 + { + internal IfcPumpTypeEnum mPredefinedType = IfcPumpTypeEnum.NOTDEFINED;// OPTIONAL : IfcPumpTypeEnum; + public IfcPumpTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPump() : base() { } + internal IfcPump(IfcPump p) : base(p) { mPredefinedType = p.mPredefinedType; } + internal IfcPump(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcPump s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcPumpTypeEnum)Enum.Parse(typeof(IfcPumpTypeEnum), str); + } + internal new static IfcPump Parse(string strDef) { IfcPump s = new IfcPump(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcPumpTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcPumpType : IfcFlowMovingDeviceType + { + internal IfcPumpTypeEnum mPredefinedType = IfcPumpTypeEnum.NOTDEFINED;// : IfcPumpTypeEnum; + public IfcPumpTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcPumpType() : base() { } + internal IfcPumpType(IfcPumpType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcPumpType t, List arrFields, ref int ipos) { IfcFlowMovingDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcPumpTypeEnum)Enum.Parse(typeof(IfcPumpTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcPumpType Parse(string strDef) { IfcPumpType t = new IfcPumpType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } +} diff --git a/IFC/IFC Q.cs b/IFC/IFC Q.cs new file mode 100644 index 0000000..afe9a62 --- /dev/null +++ b/IFC/IFC Q.cs @@ -0,0 +1,160 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcQuantityArea : IfcPhysicalSimpleQuantity + { + internal double mAreaValue;// : IfcAreaMeasure; + internal string mFormula = "$"; //: OPTIONAL IfcLabel; IFC4 + + public double AreaValue { get { return mAreaValue; } } + public string Forumla { get { return mFormula == "$" ? "" : mFormula; } } + + internal IfcQuantityArea() : base() { } + internal IfcQuantityArea(IfcQuantityArea q) : base(q) { mAreaValue = q.mAreaValue; } + internal IfcQuantityArea(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, double area, string formula) : base(m, name, desc, unit) { mAreaValue = area; mFormula = formula; } + internal static void parseFields(IfcQuantityArea q, List arrFields, ref int ipos, Schema schema) + { + IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (!double.TryParse(str, System.Globalization.NumberStyles.Any, ParserSTEP.NumberFormat, out q.mAreaValue)) + { + if (str.StartsWith("IFCAREAMEASURE")) + { + str = str.Substring(15, str.Length - 16); + double.TryParse(str, out q.mAreaValue); + } + } + if (schema != Schema.IFC2x3) + q.mFormula = arrFields[ipos++].Replace("'", ""); + } + internal static IfcQuantityArea Parse(string strDef, Schema schema) { IfcQuantityArea q = new IfcQuantityArea(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return q; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mAreaValue) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mFormula == "$" ? ",$" : ",'" + mFormula + "'")); } + } + public class IfcQuantityCount : IfcPhysicalSimpleQuantity + { + internal double mCountValue;// : IfcCountMeasure; + internal string mFormula = "$"; //: OPTIONAL IfcLabel; IFC4 + + public double CountValue { get { return mCountValue; } } + public string Forumla { get { return mFormula == "$" ? "" : mFormula; } } + + internal IfcQuantityCount() : base() { } + internal IfcQuantityCount(IfcQuantityCount q) : base(q) { mCountValue = q.mCountValue; } + internal IfcQuantityCount(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, double count, string formula) : base(m, name, desc, unit) { mCountValue = count; mFormula = formula; } + internal static void parseFields(IfcQuantityCount q, List arrFields, ref int ipos, Schema schema) { IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos); q.mCountValue = ParserSTEP.ParseDouble(arrFields[ipos++]); if (schema != Schema.IFC2x3) q.mFormula = arrFields[ipos++].Replace("'", ""); } + internal static IfcQuantityCount Parse(string strDef, Schema schema) { IfcQuantityCount q = new IfcQuantityCount(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return q; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mCountValue) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mFormula == "$" ? ",$" : ",'" + mFormula + "'")); } + } + public class IfcQuantityLength : IfcPhysicalSimpleQuantity + { + internal double mLengthValue;// : IfcLengthMeasure; + internal string mFormula = "$"; //: OPTIONAL IfcLabel; IFC4 + + public double LengthValue { get { return mLengthValue; } } + public string Forumla { get { return mFormula == "$" ? "" : mFormula; } } + + internal IfcQuantityLength() : base() { } + internal IfcQuantityLength(IfcQuantityLength q) : base(q) { mLengthValue = q.mLengthValue; } + internal IfcQuantityLength(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, double length, string formula) : base(m, name, desc, unit) { mLengthValue = length; mFormula = formula; } + internal static void parseFields(IfcQuantityLength q, List arrFields, ref int ipos, Schema schema) + { + IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (!double.TryParse(str, out q.mLengthValue)) + { + if (str.StartsWith("IFCLENGTHMEASURE")) + { + str = str.Substring(17, str.Length - 18); + double.TryParse(str, out q.mLengthValue); + } + } + if (schema != Schema.IFC2x3) + q.mFormula = arrFields[ipos++].Replace("'", ""); + } + internal static IfcQuantityLength Parse(string strDef, Schema schema) { IfcQuantityLength q = new IfcQuantityLength(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return q; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(Math.Max(0, mLengthValue)) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mFormula == "$" ? ",$" : ",'" + mFormula + "'")); } + } + public class IfcQuantityTime : IfcPhysicalSimpleQuantity + { + internal int mTimeValue;// : IfcTimeMeasure; + internal string mFormula = "$"; //: OPTIONAL IfcLabel; IFC4 + + public int TimeValue { get { return mTimeValue; } } + public string Forumla { get { return mFormula == "$" ? "" : mFormula; } } + + internal IfcQuantityTime() : base() { } + internal IfcQuantityTime(IfcQuantityTime q) : base((IfcPhysicalSimpleQuantity)q) { mTimeValue = q.mTimeValue; } + internal IfcQuantityTime(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, int ifctimemeasure, string formula) : base(m, name, desc, unit) { mTimeValue = ifctimemeasure; mFormula = formula; } + internal static void parseFields(IfcQuantityTime q, List arrFields, ref int ipos, Schema schema) { IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos); q.mTimeValue = int.Parse(arrFields[ipos++]); if (schema != Schema.IFC2x3) q.mFormula = arrFields[ipos++].Replace("'", ""); } + internal static IfcQuantityTime Parse(string strDef, Schema schema) { IfcQuantityTime q = new IfcQuantityTime(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return q; } + protected override string BuildString() { return base.BuildString() + "," + mTimeValue.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mFormula == "$" ? ",$" : ",'" + mFormula + "'")); } + } + public class IfcQuantityVolume : IfcPhysicalSimpleQuantity + { + internal double mVolumeValue;// : IfcVolumeMeasure; + internal string mFormula = "$"; //: OPTIONAL IfcLabel; IFC4 + + public double VolumeValue { get { return mVolumeValue; } } + public string Forumla { get { return mFormula == "$" ? "" : mFormula; } } + + internal IfcQuantityVolume() : base() { } + internal IfcQuantityVolume(IfcQuantityVolume q) : base(q) { mVolumeValue = q.mVolumeValue; } + internal IfcQuantityVolume(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, double vol, string formula) : base(m, name, desc, unit) { mVolumeValue = vol; mFormula = formula; } + internal static void parseFields(IfcQuantityVolume q, List arrFields, ref int ipos, Schema schema) + { + IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos); + string str = arrFields[ipos++]; + double vol; + if (double.TryParse(str, out vol)) + q.mVolumeValue = vol; + else + { + IfcMeasureValue mv = ParserIfc.parseMeasureValue(str); + if (mv != null) + q.mVolumeValue = mv.Measure; + } + if (schema != Schema.IFC2x3) + q.mFormula = arrFields[ipos++].Replace("'", ""); + } + internal static IfcQuantityVolume Parse(string strDef, Schema schema) { IfcQuantityVolume q = new IfcQuantityVolume(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return q; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mVolumeValue) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mFormula == "$" ? ",$" : ",'" + mFormula + "'")); } + } + public class IfcQuantityWeight : IfcPhysicalSimpleQuantity + { + internal double mWeightValue;// : IfcWeightMeasure; + internal string mFormula = "$"; //: OPTIONAL IfcLabel; IFC4 + internal IfcQuantityWeight() : base() { } + internal IfcQuantityWeight(IfcQuantityWeight q) : base(q) { mWeightValue = q.mWeightValue; } + internal IfcQuantityWeight(DatabaseIfc m, string name, string desc, IfcNamedUnit unit, double weight, string formula) : base(m, name, desc, unit) { mWeightValue = weight; mFormula = formula; } + internal static void parseFields(IfcQuantityWeight q, List arrFields, ref int ipos, Schema schema) { IfcPhysicalSimpleQuantity.parseFields(q, arrFields, ref ipos); q.mWeightValue = ParserSTEP.ParseDouble(arrFields[ipos++]); if (schema != Schema.IFC2x3) q.mFormula = arrFields[ipos++].Replace("'", ""); } + internal static IfcQuantityWeight Parse(string strDef, Schema schema) { IfcQuantityWeight q = new IfcQuantityWeight(); int ipos = 0; parseFields(q, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return q; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mWeightValue) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mFormula == "$" ? ",$" : ",'" + mFormula + "'")); } + } +} diff --git a/IFC/IFC R.cs b/IFC/IFC R.cs new file mode 100644 index 0000000..24356a7 --- /dev/null +++ b/IFC/IFC R.cs @@ -0,0 +1,2822 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcRadiusDimension : IfcDimensionCurveDirectedCallout // DEPRECEATED IFC4 + { + internal IfcRadiusDimension() : base() { } + internal IfcRadiusDimension(IfcRadiusDimension d) : base((IfcDimensionCurveDirectedCallout)d) { } + internal new static IfcRadiusDimension Parse(string strDef) { IfcRadiusDimension d = new IfcRadiusDimension(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcRadiusDimension d, List arrFields, ref int ipos) { IfcDimensionCurveDirectedCallout.parseFields(d, arrFields, ref ipos); } + } + public partial class IfcRailing : IfcBuildingElement + { + internal IfcRailingTypeEnum mPredefinedType = IfcRailingTypeEnum.NOTDEFINED;// : OPTIONAL IfcRailingTypeEnum + public IfcRailingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcRailing() : base() { } + internal IfcRailing(IfcRailing r) : base(r) { mPredefinedType = r.mPredefinedType; } + public IfcRailing(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcRailing Parse(string strDef) { IfcRailing r = new IfcRailing(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcRailing r, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(r, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str != "$") + r.mPredefinedType = (IfcRailingTypeEnum)Enum.Parse(typeof(IfcRailingTypeEnum), str.Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcRailingType : IfcBuildingElementType + { + internal IfcRailingTypeEnum mPredefinedType = IfcRailingTypeEnum.NOTDEFINED; + public IfcRailingTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcRailingType() : base() { } + internal IfcRailingType(IfcRailingType b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcRailingType(DatabaseIfc m, string name, IfcRailingTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcRailingType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcRailingTypeEnum)Enum.Parse(typeof(IfcRailingTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcRailingType Parse(string strDef) { IfcRailingType t = new IfcRailingType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcRamp : IfcBuildingElement + { + internal IfcRampTypeEnum mPredefinedType = IfcRampTypeEnum.NOTDEFINED;// OPTIONAL : IfcRampTypeEnum + public IfcRampTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcRamp() : base() { } + internal IfcRamp(IfcRamp r) : base(r) { mPredefinedType = r.mPredefinedType; } + public IfcRamp(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcRamp Parse(string strDef) { IfcRamp r = new IfcRamp(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcRamp r, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(r, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcRampTypeEnum)Enum.Parse(typeof(IfcRampTypeEnum), str.Substring(1, str.Length - 2)); + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcRampFlight : IfcBuildingElement + { + internal IfcRampFlightTypeEnum mPredefinedType = IfcRampFlightTypeEnum.NOTDEFINED;// OPTIONAL : IfcRampTypeEnum + public IfcRampFlightTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcRampFlight() : base() { } + internal IfcRampFlight(IfcRampFlight f) : base(f) { mPredefinedType = f.mPredefinedType; } + public IfcRampFlight(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcRampFlight Parse(string strDef, Schema schema) { IfcRampFlight f = new IfcRampFlight(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return f; } + internal static void parseFields(IfcRampFlight f, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(f, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + f.mPredefinedType = (IfcRampFlightTypeEnum)Enum.Parse(typeof(IfcRampFlightTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? base.BuildString() : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public class IfcRampFlightType : IfcBuildingElementType + { + internal IfcRampFlightTypeEnum mPredefinedType = IfcRampFlightTypeEnum.NOTDEFINED; + public IfcRampFlightTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcRampFlightType() : base() { } + internal IfcRampFlightType(IfcRampFlightType b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcRampFlightType(DatabaseIfc m, string name, IfcRampFlightTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcRampFlightType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcRampFlightTypeEnum)Enum.Parse(typeof(IfcRampFlightTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcRampFlightType Parse(string strDef) { IfcRampFlightType t = new IfcRampFlightType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcRampType : IfcBuildingElementType //IFC4 + { + internal IfcRampTypeEnum mPredefinedType = IfcRampTypeEnum.NOTDEFINED; + public IfcRampTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcRampType() : base() { } + internal IfcRampType(IfcRampType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcRampType(DatabaseIfc m, string name, IfcRampTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcRampType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcRampTypeEnum)Enum.Parse(typeof(IfcRampTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcRampType Parse(string strDef) { IfcRampType t = new IfcRampType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcRationalBezierCurve : IfcBezierCurve // DEPRECEATED IFC4 + { + internal List mWeightsData = new List();// : LIST [2:?] OF REAL; + internal IfcRationalBezierCurve() : base() { } + internal IfcRationalBezierCurve(IfcRationalBezierCurve pl) : base(pl) { mWeightsData = new List(pl.mWeightsData.ToArray()); } + internal static void parseFields(IfcRationalBezierCurve c, List arrFields, ref int ipos) + { + IfcBezierCurve.parseFields(c, arrFields, ref ipos); + string s = arrFields[ipos++]; + List arrNodes = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrNodes.Count; icounter++) + c.mWeightsData.Add(ParserSTEP.ParseDouble(arrNodes[icounter])); + } + internal new static IfcRationalBezierCurve Parse(string strDef) { IfcRationalBezierCurve c = new IfcRationalBezierCurve(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.DoubleToString(mWeightsData[0]); + for (int icounter = 1; icounter < mWeightsData.Count; icounter++) + str += "," + ParserSTEP.DoubleToString(mWeightsData[icounter]); + return str + ")"; + } + } + public partial class IfcRationalBSplineCurveWithKnots : IfcBSplineCurveWithKnots + { + internal List mWeightsData = new List();// : LIST [2:?] OF REAL; + internal IfcRationalBSplineCurveWithKnots() : base() { } + internal IfcRationalBSplineCurveWithKnots(IfcRationalBSplineCurveWithKnots c) : base(c) { mWeightsData = new List(c.mWeightsData.ToArray()); } + + internal static void parseFields(IfcRationalBSplineCurveWithKnots c, List arrFields, ref int ipos) + { + IfcBSplineCurveWithKnots.parseFields(c, arrFields, ref ipos); + string s = arrFields[ipos++]; + List arrNodes = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < arrNodes.Count; icounter++) + c.mWeightsData.Add(ParserSTEP.ParseDouble(arrNodes[icounter])); + } + internal new static IfcRationalBSplineCurveWithKnots Parse(string strDef) { IfcRationalBSplineCurveWithKnots c = new IfcRationalBSplineCurveWithKnots(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.DoubleToString(mWeightsData[0]); + for (int icounter = 1; icounter < mWeightsData.Count; icounter++) + str += "," + ParserSTEP.DoubleToString(mWeightsData[icounter]); + return str + ")"; + } + } + public partial class IfcRationalBSplineSurfaceWithKnots : IfcBSplineSurfaceWithKnots + { + internal List> mWeightsData = new List>();// : LIST [2:?] OF REAL; + internal IfcRationalBSplineSurfaceWithKnots() : base() { } + internal IfcRationalBSplineSurfaceWithKnots(IfcRationalBSplineSurfaceWithKnots s) : base(s) + { + for (int icounter = 0; icounter < s.mWeightsData.Count; icounter++) + mWeightsData.Add(new List(s.mWeightsData[icounter].ToArray())); + } + internal static void parseFields(IfcRationalBSplineSurfaceWithKnots s, List arrFields, ref int ipos) + { + IfcBSplineSurfaceWithKnots.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + List arrLists = ParserSTEP.SplitLineFields(str.Substring(1, str.Length - 2)); + int ilast = arrLists.Count; + for (int icounter = 0; icounter < ilast; icounter++) + { + List weights = new List(); + List arrweights = ParserSTEP.SplitLineFields(arrLists[icounter].Substring(1, arrLists[icounter].Length - 2)); + for (int jcounter = 0; jcounter < arrweights.Count; jcounter++) + weights.Add(ParserSTEP.ParseDouble(arrweights[jcounter])); + s.mWeightsData.Add(weights); + } + } + internal new static IfcRationalBSplineSurfaceWithKnots Parse(string strDef) { IfcRationalBSplineSurfaceWithKnots s = new IfcRationalBSplineSurfaceWithKnots(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + List wts = mWeightsData[0]; + string str = base.BuildString() + ",((" + + ParserSTEP.DoubleToString(wts[0]); + for (int jcounter = 1; jcounter < wts.Count; jcounter++) + str += "," + ParserSTEP.DoubleToString(wts[jcounter]); + str += ")"; + for (int icounter = 1; icounter < mWeightsData.Count; icounter++) + { + wts = mWeightsData[icounter]; + str += ",(" + ParserSTEP.DoubleToString(wts[0]); + for (int jcounter = 1; jcounter < wts.Count; jcounter++) + str += "," + ParserSTEP.DoubleToString(wts[jcounter]); + str += ")"; + } + return str + ")"; + } + } + public partial class IfcRectangleHollowProfileDef : IfcRectangleProfileDef + { + internal double mWallThickness;// : IfcPositiveLengthMeasure; + internal double mInnerFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mOuterFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcRectangleHollowProfileDef() : base() { } + internal IfcRectangleHollowProfileDef(IfcRectangleHollowProfileDef c) : base(c) { mWallThickness = c.mWallThickness; mInnerFilletRadius = c.mInnerFilletRadius; mOuterFilletRadius = c.mOuterFilletRadius; } + public IfcRectangleHollowProfileDef(DatabaseIfc m, string name, double depth, double width, double wallThickness, double outerFilletRadius, double innerFilletRadius) + : base(m, name, depth, width) { mWallThickness = wallThickness; mOuterFilletRadius = outerFilletRadius; mInnerFilletRadius = innerFilletRadius; } + internal static void parseFields(IfcRectangleHollowProfileDef p, List arrFields, ref int ipos) { IfcRectangleProfileDef.parseFields(p, arrFields, ref ipos); p.mWallThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mInnerFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mOuterFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mWallThickness) + "," + ParserSTEP.DoubleToString(mInnerFilletRadius) + "," + ParserSTEP.DoubleToString(mOuterFilletRadius); } + internal new static IfcRectangleHollowProfileDef Parse(string strDef) { IfcRectangleHollowProfileDef p = new IfcRectangleHollowProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public partial class IfcRectangleProfileDef : IfcParameterizedProfileDef + { + internal double mXDim, mYDim;// : IfcPositiveLengthMeasure; + internal IfcRectangleProfileDef() : base() { } + internal IfcRectangleProfileDef(IfcRectangleProfileDef p) : base(p) { mXDim = p.mXDim; mYDim = p.mYDim; } + public IfcRectangleProfileDef(DatabaseIfc m, string name, double depth, double width) : base(m) { Name = name; mXDim = width; mYDim = depth; } + internal static void parseFields(IfcRectangleProfileDef p, List arrFields, ref int ipos) { IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); p.mXDim = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mYDim = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mXDim) + "," + ParserSTEP.DoubleToString(mYDim); } + internal new static IfcRectangleProfileDef Parse(string strDef) { IfcRectangleProfileDef p = new IfcRectangleProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + } + public partial class IfcRectangularPyramid : IfcCsgPrimitive3D + { + internal double mXLength, mYLength, mHeight;// : IfcPositiveLengthMeasure; + internal IfcRectangularPyramid() : base() { } + internal IfcRectangularPyramid(IfcRectangularPyramid pl) : base(pl) { mXLength = pl.mXLength; mYLength = pl.mYLength; mHeight = pl.mHeight; } + internal static void parseFields(IfcRectangularPyramid p, List arrFields, ref int ipos) { IfcCsgPrimitive3D.parseFields(p, arrFields, ref ipos); p.mXLength = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mYLength = ParserSTEP.ParseDouble(arrFields[ipos++]); p.mHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcRectangularPyramid Parse(string strDef) { IfcRectangularPyramid p = new IfcRectangularPyramid(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mXLength) + "," + ParserSTEP.DoubleToString(mYLength) + "," + ParserSTEP.DoubleToString(mHeight); } + } + public class IfcRectangularTrimmedSurface : IfcBoundedSurface + { + internal int mBasisSurface;// : IfcPlane; + internal double mU1, mV1, mU2, mV2;// : IfcParameterValue; + internal bool mUsense, mVsense;// : BOOLEAN; + internal IfcRectangularTrimmedSurface() : base() { } + internal IfcRectangularTrimmedSurface(IfcRectangularTrimmedSurface s) : base(s) + { + mBasisSurface = s.mBasisSurface; + mU1 = s.mU1; + mU2 = s.mU2; + mV1 = s.mV1; + mV2 = s.mV2; + mUsense = s.mUsense; + mVsense = s.mVsense; + } + internal static void parseFields(IfcRectangularTrimmedSurface s, List arrFields, ref int ipos) + { + IfcBoundedSurface.parseFields(s, arrFields, ref ipos); + s.mBasisSurface = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mU1 = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mU2 = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mV1 = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mV2 = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mUsense = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mVsense = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcRectangularTrimmedSurface Parse(string strDef) { IfcRectangularTrimmedSurface s = new IfcRectangularTrimmedSurface(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisSurface) + "," + ParserSTEP.DoubleToString(mU1) + "," + ParserSTEP.DoubleToString(mV1) + "," + ParserSTEP.DoubleToString(mU2) + "," + ParserSTEP.DoubleToString(mV2) + "," + ParserSTEP.BoolToString(mUsense) + "," + ParserSTEP.BoolToString(mVsense); } + } + public class IfcRecurrencePattern : BaseClassIfc // IFC4 + { + internal IfcRecurrenceTypeEnum mRecurrenceType = IfcRecurrenceTypeEnum.WEEKLY; //: IfcRecurrenceTypeEnum; + internal List mDayComponent = new List();// : OPTIONAL SET [1:?] OF IfcDayInMonthNumber; + internal List mWeekdayComponent = new List();// : OPTIONAL SET [1:?] OF IfcDayInWeekNumber; + internal List mMonthComponent = new List();// : OPTIONAL SET [1:?] OF IfcMonthInYearNumber; + internal int mPosition = 0;// : OPTIONAL IfcInteger; + internal int mInterval = 0;// : OPTIONAL IfcInteger; + internal int mOccurrences = 0;// : OPTIONAL IfcInteger; + internal List mTimePeriods = new List();// : OPTIONAL LIST [1:?] OF IfcTimePeriod; + internal IfcRecurrencePattern() : base() { } + internal IfcRecurrencePattern(IfcRecurrencePattern p) : base() + { + mRecurrenceType = p.mRecurrenceType; + mDayComponent.AddRange(p.mDayComponent); + mWeekdayComponent.AddRange(p.mWeekdayComponent); + mMonthComponent.AddRange(p.mMonthComponent); + mPosition = p.mPosition; + mInterval = p.mInterval; + mOccurrences = p.mOccurrences; + mTimePeriods.AddRange(p.mTimePeriods); + } + internal IfcRecurrencePattern(DatabaseIfc m, IfcRecurrenceTypeEnum type, List days, List weekdays, List months, int position, int interval, int occurences, List periods) + : base(m) + { + mRecurrenceType = type; + if (days != null) + mDayComponent.AddRange(days); + if (weekdays != null) + mWeekdayComponent.AddRange(weekdays); + if (months != null) + mMonthComponent.AddRange(months); + mPosition = position; + mInterval = interval; + mOccurrences = occurences; + if (periods != null) + mTimePeriods = periods.ConvertAll(x => x.mIndex); + } + internal static IfcRecurrencePattern Parse(string strDef) { IfcRecurrencePattern m = new IfcRecurrencePattern(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcRecurrencePattern m, List arrFields, ref int ipos) + { + m.mRecurrenceType = (IfcRecurrenceTypeEnum)Enum.Parse(typeof(IfcRecurrenceTypeEnum), arrFields[ipos++].Replace(".", "")); + string s = arrFields[ipos++]; + if (s.StartsWith("(")) + m.mDayComponent = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)).ConvertAll(x => int.Parse(x)); + s = arrFields[ipos++]; + if (s.StartsWith("(")) + m.mWeekdayComponent = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)).ConvertAll(x => int.Parse(x)); + s = arrFields[ipos++]; + if (s.StartsWith("(")) + m.mMonthComponent = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)).ConvertAll(x => int.Parse(x)); + s = arrFields[ipos++]; + if (s != "$") + m.mPosition = int.Parse(s); + s = arrFields[ipos++]; + if (s != "$") + m.mInterval = int.Parse(s); + s = arrFields[ipos++]; + if (s != "$") + m.mOccurrences = int.Parse(s); + m.mTimePeriods = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + ",." + mRecurrenceType.ToString(); + if (mDayComponent.Count == 0) + str += ".,$,"; + else + { + str += ".,(" + mDayComponent[0]; + for (int icounter = 1; icounter < mDayComponent.Count; icounter++) + str += "," + mDayComponent[icounter]; + str += "),"; + } + if (mWeekdayComponent.Count == 0) + str += "$,"; + else + { + str += "(" + mWeekdayComponent[0]; + for (int icounter = 1; icounter < mWeekdayComponent.Count; icounter++) + str += "," + mWeekdayComponent[icounter]; + str += "),"; + } + if (mMonthComponent.Count == 0) + str += "$,"; + else + { + str += "(" + mMonthComponent[0]; + for (int icounter = 1; icounter < mMonthComponent.Count; icounter++) + str += "," + mMonthComponent[icounter]; + str += "),"; + } + str += mInterval + "," + mPosition + "," + mOccurrences; + if (mTimePeriods.Count == 0) + str += ",$"; + else + { + str += ",(" + ParserSTEP.LinkToString(mTimePeriods[0]); + for (int icounter = 1; icounter < mTimePeriods.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mTimePeriods[icounter]); + str += ")"; + } + return str; + } + } + public partial class IfcReference : BaseClassIfc, IfcMetricValueSelect, IfcAppliedValueSelect // IFC4 + { + internal string mTypeIdentifier = "$"; //: OPTIONAL IfcIdentifier; + internal string mAttributeIdentifier = "$"; //: OPTIONAL IfcIdentifier; + internal string mInstanceName = "$"; //: OPTIONAL IfcLabel; + internal List mListPositions = new List();// : OPTIONAL LIST [1:?] OF INTEGER; + private int mInnerReference = 0;// : OPTIONAL IfcReference; + + public string TypeIdentifier { get { return (mTypeIdentifier == "$" ? "" : ParserIfc.Decode(mTypeIdentifier)); } set { mTypeIdentifier = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string AttributeIdentifier { get { return (mAttributeIdentifier == "$" ? "" : ParserIfc.Decode(mAttributeIdentifier)); } set { mAttributeIdentifier = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string InstanceName { get { return (mInstanceName == "$" ? "" : ParserIfc.Decode(mInstanceName)); } set { mInstanceName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List ListPositions { get { return mListPositions; } set { mListPositions = (value == null ? new List() : value); } } + public IfcReference InnerReference { get { return mDatabase.mIfcObjects[mInnerReference] as IfcReference; } set { mInnerReference = (value == null ? 0 : value.mIndex); } } + + internal IfcReference() : base() { } + internal IfcReference(IfcReference r) : base() + { + mTypeIdentifier = r.mTypeIdentifier; + mAttributeIdentifier = r.mAttributeIdentifier; + mInstanceName = r.mInstanceName; + mListPositions.AddRange(r.mListPositions); + mInnerReference = r.mInnerReference; + } + public IfcReference(DatabaseIfc db, string typeId, string attributeId, string instanceName) : base(db) + { + TypeIdentifier = typeId; + AttributeIdentifier = attributeId; + InstanceName = instanceName; + } + public IfcReference(DatabaseIfc db, string typeId, string attributeId, string instanceName, IfcReference inner) + : this(db,typeId,attributeId,instanceName) { InnerReference = inner; } + public IfcReference(DatabaseIfc db, string typeId, string attributeId, string instanceName, int position, IfcReference inner) + : this(db, typeId, attributeId, instanceName, inner) { mListPositions.Add(position); } + public IfcReference(DatabaseIfc db, string typeId, string attributeId, string instanceName, List positions, IfcReference inner) + : this(db, typeId, attributeId, instanceName, inner) { mListPositions.AddRange(positions); } + + internal static IfcReference Parse(string strDef) { IfcReference m = new IfcReference(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcReference m, List arrFields, ref int ipos) + { + m.mTypeIdentifier = arrFields[ipos++].Replace("'", ""); + m.mAttributeIdentifier = arrFields[ipos++].Replace("'", ""); + m.mInstanceName = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + if (s.StartsWith("(")) + m.mListPositions = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)).ConvertAll(x => int.Parse(x)); + m.mInnerReference = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + (mTypeIdentifier == "$" ? ",$" : ",'" + mTypeIdentifier + "'") + (mAttributeIdentifier == "$" ? ",$," : ",'" + mAttributeIdentifier + "',") + + (mInstanceName == "$" ? "$," : "'" + mInstanceName + "',"); + if (mListPositions.Count == 0) + str += "$,"; + else + { + str += "(" + mListPositions[0]; + for (int icounter = 1; icounter < mListPositions.Count; icounter++) + str += "," + mListPositions[icounter]; + str += "),"; + } + return str + ParserSTEP.LinkToString(mInnerReference); + } + } + //ENTITY IfcReferencesValueDocument; // DEPRECEATED IFC4 + //ENTITY IfcRegularTimeSeries + public class IfcReinforcementBarProperties : IfcPreDefinedProperties + { + internal double mTotalCrossSectionArea = 0;//: IfcAreaMeasure; + internal string mSteelGrade = "";// : IfcLabel; + internal IfcReinforcingBarSurfaceEnum mBarSurface = IfcReinforcingBarSurfaceEnum.NONE;// : OPTIONAL IfcReinforcingBarSurfaceEnum; + internal double mEffectiveDepth = 0;//: OPTIONAL IfcLengthMeasure; + internal double mNominalBarDiameter = 0;// : OPTIONAL IfcPositiveLengthMeasure; + internal int mBarCount = 0;// : OPTIONAL IfcCountMeasure; + internal IfcReinforcementBarProperties() : base() { } + internal IfcReinforcementBarProperties(IfcReinforcementBarProperties p) : base() + { + mTotalCrossSectionArea = p.mTotalCrossSectionArea; + mSteelGrade = p.mSteelGrade; + mBarSurface = p.mBarSurface; + mEffectiveDepth = p.mEffectiveDepth; + mNominalBarDiameter = p.mNominalBarDiameter; + mBarCount = p.mBarCount; + } + internal static IfcReinforcementBarProperties Parse(string strDef) { IfcReinforcementBarProperties p = new IfcReinforcementBarProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcReinforcementBarProperties p, List arrFields, ref int ipos) + { + p.mTotalCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mSteelGrade = arrFields[ipos++].Replace("'", ""); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + p.mBarSurface = (IfcReinforcingBarSurfaceEnum)Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), arrFields[ipos++].Replace(".", "")); + p.mEffectiveDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mNominalBarDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mBarCount = ParserSTEP.ParseInt(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleToString(mTotalCrossSectionArea) + ",'" + mSteelGrade + "',." + mBarSurface.ToString() + ".," + + ParserSTEP.DoubleOptionalToString(mEffectiveDepth) + "," + ParserSTEP.DoubleOptionalToString(mNominalBarDiameter) + "," + ParserSTEP.IntOptionalToString(mBarCount); + } + } + public class IfcReinforcementDefinitionProperties : IfcPreDefinedPropertySet //IFC2x3 IfcPropertySetDefinition + { + internal string mDefinitionType = "$";// : OPTIONAL IfcLabel; + List mReinforcementSectionDefinitions = new List();// : LIST [1:?] OF IfcSectionReinforcementProperties; + internal IfcReinforcementDefinitionProperties() : base() { } + internal IfcReinforcementDefinitionProperties(IfcReinforcementDefinitionProperties p) : base(p) + { + mDefinitionType = p.mDefinitionType; + mReinforcementSectionDefinitions = new List(p.mReinforcementSectionDefinitions); + } + internal IfcReinforcementDefinitionProperties(string name, string type, List sectProps) + : base(sectProps[0].mDatabase, name) { if (!string.IsNullOrEmpty(type)) mDefinitionType = type; mReinforcementSectionDefinitions = sectProps.ConvertAll(x => x.mIndex); } + internal static IfcReinforcementDefinitionProperties Parse(string strDef) { IfcReinforcementDefinitionProperties p = new IfcReinforcementDefinitionProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcReinforcementDefinitionProperties p, List arrFields, ref int ipos) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mDefinitionType = arrFields[ipos++].Replace("'", ""); + p.mReinforcementSectionDefinitions = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string result = base.BuildString() + (mDefinitionType == "$" ? ",$,(#" : ",'" + mDefinitionType + "',(#") + mReinforcementSectionDefinitions[0]; + for (int icounter = 1; icounter < mReinforcementSectionDefinitions.Count; icounter++) + result += ",#" + mReinforcementSectionDefinitions; + return result + ")"; + } + } + public partial class IfcReinforcingBar : IfcReinforcingElement + { + internal double mNominalDiameter;// : IfcPositiveLengthMeasure; IFC4 OPTIONAL + internal double mCrossSectionArea;// : IfcAreaMeasure; IFC4 OPTIONAL + internal double mBarLength;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcReinforcingBarTypeEnum mPredefinedType = IfcReinforcingBarTypeEnum.NOTDEFINED;// : IfcReinforcingBarRoleEnum; IFC4 OPTIONAL + internal IfcReinforcingBarSurfaceEnum mBarSurface = IfcReinforcingBarSurfaceEnum.NONE;// //: OPTIONAL IfcReinforcingBarSurfaceEnum; + public IfcReinforcingBarTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcReinforcingBar() : base() { } + internal IfcReinforcingBar(IfcReinforcingBar b) : base(b) + { + mNominalDiameter = b.mNominalDiameter; + mCrossSectionArea = b.mCrossSectionArea; + mBarLength = b.mBarLength; + mPredefinedType = b.mPredefinedType; + mBarSurface = b.mBarSurface; + } + internal IfcReinforcingBar(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcReinforcingBar Parse(string strDef) { IfcReinforcingBar b = new IfcReinforcingBar(); int ipos = 0; parseFields(b, ParserSTEP.SplitLineFields(strDef), ref ipos); return b; } + internal static void parseFields(IfcReinforcingBar c, List arrFields, ref int ipos) + { + IfcReinforcingElement.parseFields(c, arrFields, ref ipos); + c.mNominalDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mBarLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + c.mPredefinedType = (IfcReinforcingBarTypeEnum)Enum.Parse(typeof(IfcReinforcingBarTypeEnum), str.Replace(".", "")); + str = arrFields[ipos++]; + if (str.StartsWith(".")) + c.mBarSurface = (IfcReinforcingBarSurfaceEnum)Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), str.Replace(".", "")); + } + protected override string BuildString() + { + string result = base.BuildString() + "," + (mDatabase.mSchema == Schema.IFC2x3 ? ParserSTEP.DoubleToString(mNominalDiameter) + "," + ParserSTEP.DoubleToString(mCrossSectionArea) + "," + ParserSTEP.DoubleToString(mBarLength) + ",." + mPredefinedType.ToString() + ".," : + ParserSTEP.DoubleOptionalToString(mNominalDiameter) + "," + ParserSTEP.DoubleOptionalToString(mCrossSectionArea) + "," + ParserSTEP.DoubleOptionalToString(mBarLength) + (mPredefinedType == IfcReinforcingBarTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType.ToString() + ".,")); + return result + (mBarSurface == IfcReinforcingBarSurfaceEnum.NONE ? "$" : "." + mBarSurface.ToString() + "."); + } + } + public partial class IfcReinforcingBarType : IfcReinforcingElementType //IFC4 + { + internal IfcReinforcingBarTypeEnum mPredefinedType = IfcReinforcingBarTypeEnum.NOTDEFINED;// : IfcFastenerTypeEnum; //IFC4 + internal double mNominalDiameter;// : IfcPositiveLengthMeasure; IFC4 OPTIONAL + internal double mCrossSectionArea;// : IfcAreaMeasure; IFC4 OPTIONAL + internal double mBarLength;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcReinforcingBarSurfaceEnum mBarSurface = IfcReinforcingBarSurfaceEnum.NONE;// //: OPTIONAL IfcReinforcingBarSurfaceEnum; + internal string mBendingShapeCode = "$";// : OPTIONAL IfcLabel; + internal List mBendingParameters = new List();// : OPTIONAL LIST [1:?] OF IfcBendingParameterSelect; + + public IfcReinforcingBarTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcReinforcingBarType() : base() { } + internal IfcReinforcingBarType(IfcReinforcingBarType t) + : base(t) + { + mPredefinedType = t.mPredefinedType; + mNominalDiameter = t.mNominalDiameter; + mCrossSectionArea = t.mCrossSectionArea; + mBarLength = t.mBarLength; + mBarSurface = t.mBarSurface; + mBendingShapeCode = t.mBendingShapeCode; + mBendingParameters.AddRange(t.mBendingParameters); + } + + public IfcReinforcingBarType(DatabaseIfc m, string name, IfcReinforcingBarTypeEnum type, double diameter, double area, double length, IfcReinforcingBarSurfaceEnum surface, string shapecode, List bends) + : base(m) + { + Name = name; + mPredefinedType = type; + mNominalDiameter = diameter; + mCrossSectionArea = area; + mBarLength = length; + mBarSurface = surface; + if (!string.IsNullOrEmpty(shapecode)) + mBendingShapeCode = shapecode; + if (bends != null && bends.Count > 0) + mBendingParameters.AddRange(bends); + } + internal new static IfcReinforcingBarType Parse(string strDef) { int ipos = 0; IfcReinforcingBarType t = new IfcReinforcingBarType(); parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcReinforcingBarType t, List arrFields, ref int ipos) + { + IfcReinforcingElementType.parseFields(t, arrFields, ref ipos); + t.mPredefinedType = (IfcReinforcingBarTypeEnum)Enum.Parse(typeof(IfcReinforcingBarTypeEnum), arrFields[ipos++].Replace(".", "")); + t.mNominalDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + t.mCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + t.mBarLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + t.mBarSurface = (IfcReinforcingBarSurfaceEnum)Enum.Parse(typeof(IfcReinforcingBarSurfaceEnum), arrFields[ipos++].Replace(".", "")); + t.mBendingShapeCode = arrFields[ipos++]; + //t.mBendingParameters = + ipos++; + } + protected override string BuildString() + { + string result = base.BuildString(); + result += ",." + mPredefinedType + ".," + ParserSTEP.DoubleOptionalToString(mNominalDiameter) + ","; + result += ParserSTEP.DoubleOptionalToString(mCrossSectionArea) + "," + ParserSTEP.DoubleOptionalToString(mBarLength); + result += ",." + mBarSurface.ToString() + (mBendingShapeCode == "$" ? ".,$," : ".,'" + mBendingShapeCode + "',"); + if (mBendingParameters.Count == 0) + result += "$"; + else + { + result += "(" + mBendingParameters[0].ToString(); + for (int icounter = 1; icounter < mBendingParameters.Count; icounter++) + result += "," + mBendingParameters[icounter].ToString(); + result += ")"; + } + return result; + } + } + public abstract class IfcReinforcingElement : IfcElementComponent // ABSTRACT SUPERTYPE OF(ONEOF(IfcReinforcingBar, IfcReinforcingMesh, IfcTendon, IfcTendonAnchor)) + { + internal new enum SubTypes { IfcReinforcingBar, IfcReinforcingMesh, IfcTendon, IfcTendonAnchor } + internal string mSteelGrade = "$";// : OPTIONAL IfcLabel; //IFC4 Depreceated + + protected IfcReinforcingElement() : base() { } + protected IfcReinforcingElement(IfcReinforcingElement e) : base(e) { mSteelGrade = e.mSteelGrade; } + internal IfcReinforcingElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + protected static void parseFields(IfcReinforcingElement e, List arrFields, ref int ipos) + { + IfcElementComponent.parseFields(e, arrFields, ref ipos); + //if(UtilityIFC.mIFCModelData.mSchema == Schema.IFC2x3) + e.mSteelGrade = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return base.BuildString() + (mSteelGrade == "$" ? ",$" : ",'" + mSteelGrade + "'"); } + } + public abstract class IfcReinforcingElementType : IfcElementComponentType //IFC4 ABSTRACT SUPERTYPE OF(ONEOF(IfcReinforcingBarType, IfcReinforcingMeshType, IfcTendonAnchorType, IfcTendonType)) + { + protected IfcReinforcingElementType() : base() { } + protected IfcReinforcingElementType(IfcReinforcingElementType t) : base(t) { } + protected IfcReinforcingElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcReinforcingElementType t, List arrFields, ref int ipos) { IfcElementComponentType.parseFields(t, arrFields, ref ipos); } + } + public class IfcReinforcingMesh : IfcReinforcingElement + { + internal double mMeshLength;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mMeshWidth;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mLongitudinalBarNominalDiameter;// : IfcPositiveLengthMeasure; + internal double mTransverseBarNominalDiameter;// : IfcPositiveLengthMeasure; + internal double mLongitudinalBarCrossSectionArea;// : IfcPositiveLengthMeasure; + internal double mTransverseBarCrossSectionArea;// : IfcAreaMeasure; + internal double mLongitudinalBarSpacing;// : IfcPositiveLengthMeasure; + internal double mTransverseBarSpacing;// : IfcPositiveLengthMeasure; + internal IfcReinforcingMeshTypeEnum mPredefinedType = IfcReinforcingMeshTypeEnum.NOTDEFINED; // : OPTIONAL IfcReinforcingMeshTypeEnum; + public IfcReinforcingMeshTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcReinforcingMesh() : base() { } + internal IfcReinforcingMesh(IfcReinforcingMesh m) : base(m) + { + mMeshLength = m.mMeshLength; + mMeshWidth = m.mMeshWidth; + mLongitudinalBarNominalDiameter = m.mLongitudinalBarNominalDiameter; + mTransverseBarNominalDiameter = m.mTransverseBarNominalDiameter; + mLongitudinalBarCrossSectionArea = m.mLongitudinalBarCrossSectionArea; + mTransverseBarCrossSectionArea = m.mTransverseBarCrossSectionArea; + mLongitudinalBarSpacing = m.mLongitudinalBarSpacing; + mTransverseBarSpacing = m.mTransverseBarSpacing; + mPredefinedType = m.mPredefinedType; + } + internal IfcReinforcingMesh(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static IfcReinforcingMesh Parse(string strDef, Schema schema) { IfcReinforcingMesh m = new IfcReinforcingMesh(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return m; } + internal static void parseFields(IfcReinforcingMesh c, List arrFields, ref int ipos, Schema schema) + { + IfcReinforcingElement.parseFields(c, arrFields, ref ipos); + c.mMeshLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mMeshWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mTransverseBarNominalDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mLongitudinalBarCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mTransverseBarCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mLongitudinalBarSpacing = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mTransverseBarSpacing = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + c.mPredefinedType = (IfcReinforcingMeshTypeEnum)Enum.Parse(typeof(IfcReinforcingMeshTypeEnum), str.Replace(".", "")); + } + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mMeshLength) + "," + ParserSTEP.DoubleOptionalToString(mMeshWidth) + "," + + ParserSTEP.DoubleToString(mLongitudinalBarNominalDiameter) + "," + ParserSTEP.DoubleToString(mTransverseBarNominalDiameter) + "," + + ParserSTEP.DoubleToString(mLongitudinalBarCrossSectionArea) + "," + ParserSTEP.DoubleToString(mTransverseBarCrossSectionArea) + "," + + ParserSTEP.DoubleToString(mLongitudinalBarSpacing) + "," + ParserSTEP.DoubleToString(mTransverseBarSpacing) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcReinforcingMeshTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); + } + } + //IfcReinforcingMeshType + public partial class IfcRelAggregates : IfcRelDecomposes + { + internal int mRelatingObject;// : IfcObjectDefinition IFC4 IfcObject + internal List mRelatedObjects = new List();// : SET [1:?] OF IfcObjectDefinition; + + public IfcObjectDefinition RelatingObject { get { return mDatabase.mIfcObjects[mRelatingObject] as IfcObjectDefinition; } } + public List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcObjectDefinition); } } + + internal IfcRelAggregates() : base() { } + internal IfcRelAggregates(IfcRelAggregates a) : base(a) { mRelatingObject = a.mRelatingObject; mRelatedObjects = new List(a.mRelatedObjects.ToArray()); } + internal IfcRelAggregates(IfcObjectDefinition relObject) : base(relObject.mDatabase) + { + mRelatingObject = relObject.mIndex; + relObject.mIsDecomposedBy.Add(this); + } + internal IfcRelAggregates(IfcObjectDefinition relObject, IfcObjectDefinition relatedObject) : this(relObject, new List() { relatedObject }) { } + internal IfcRelAggregates(IfcObjectDefinition relObject, List relatedObjects) : this(relObject) + { + for (int icounter = 0; icounter < relatedObjects.Count; icounter++) + { + mRelatedObjects.Add(relatedObjects[icounter].mIndex); + relatedObjects[icounter].mDecomposes = this; + } + } + internal IfcRelAggregates(DatabaseIfc m, string container, string part, IfcObjectDefinition relObject) + : this(relObject) { Name = container + " Container"; Description = container + " Container for " + part + "s"; } + internal IfcRelAggregates(DatabaseIfc m, string container, string part, IfcObjectDefinition relObject, IfcObjectDefinition relatedObject) + : this(relObject, relatedObject) { Name = container + " Container"; Description = container + " Container for " + part + "s"; } + internal IfcRelAggregates(string container, string part, IfcObjectDefinition relObject, List relatedObjects) + : this(relObject, relatedObjects) { Name = container + " Container"; Description = container + " Container for " + part + "s"; } + internal static IfcRelAggregates Parse(string strDef) { IfcRelAggregates a = new IfcRelAggregates(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAggregates a, List arrFields, ref int ipos) { IfcRelDecomposes.parseFields(a, arrFields, ref ipos); a.mRelatingObject = ParserSTEP.ParseLink(arrFields[ipos++]); a.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = ""; + if (mRelatedObjects.Count > 0) + { + str += ParserSTEP.LinkToString(mRelatedObjects[0]); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedObjects[icounter]); + } + else + return ""; + return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingObject) + ",(" + str + ")"; + } + + internal override void relate() + { + RelatingObject.mIsDecomposedBy.Add(this); + List ods = RelatedObjects; + for (int icounter = 0; icounter < ods.Count; icounter++) + { + if (ods[icounter] != null) + ods[icounter].mDecomposes = this; + } + } + internal bool addObject(IfcObjectDefinition o) + { + if (mRelatedObjects.Contains(o.mIndex)) + return false; + mRelatedObjects.Add(o.mIndex); + o.mDecomposes = this; + return true; + } + } + public abstract partial class IfcRelAssigns : IfcRelationship + { + internal List mRelatedObjects = new List();// : SET [1:?] OF IfcObjectDefinition; + //internal IfcObjectTypeEnum mRelatedObjectsType = IfcObjectTypeEnum.NOTDEFINED;// : OPTIONAL IfcObjectTypeEnum; IFC4 CHANGE The attribute is deprecated and shall no longer be used. A NIL value should always be assigned. + public List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcObjectDefinition); } } + + protected IfcRelAssigns() : base() { } + protected IfcRelAssigns(IfcRelAssigns a) : base(a) { mRelatedObjects = new List(a.mRelatedObjects.ToArray()); } + protected IfcRelAssigns(DatabaseIfc m) : base(m) { } + protected IfcRelAssigns(IfcObjectDefinition related) : this(new List() { related }) { } + protected IfcRelAssigns(List relObjects) : base(relObjects[0].mDatabase) + { + for (int icounter = 0; icounter < relObjects.Count; icounter++) + { + mRelatedObjects.Add(relObjects[icounter].mIndex); + relObjects[icounter].mHasAssignments.Add(this); + } + } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mRelatedObjects[0]); + if (mRelatedObjects.Count > 200) + { + StringBuilder sb = new StringBuilder(); + sb.Append(str); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + sb.Append(",#" + mRelatedObjects[icounter]); + sb.Append("),$"); + return sb.ToString(); + } + else + { + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += ",#" + mRelatedObjects[icounter]; + return str + "),$"; + } + } + protected static void parseFields(IfcRelAssigns c, List arrFields, ref int ipos) + { + IfcRelationship.parseFields(c, arrFields, ref ipos); + c.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); + ipos++; //string str = arrFields[ipos++]; //if(!str.Contains("$")) c.mRelatedObjectsType = (IfcObjectTypeEnum) Enum.Parse(typeof(IfcObjectTypeEnum),str.Replace(".","")); + } + protected static void parseString(IfcRelAssigns a, string str, ref int pos) + { + a.parseString(str, ref pos); + a.mRelatedObjects = ParserSTEP.StripListLink(str, ref pos); + ParserSTEP.StripField(str, ref pos); + } + + internal void assign(IfcObjectDefinition o) { mRelatedObjects.Add(o.mIndex); o.mHasAssignments.Add(this); } + + internal override void relate() + { + List ods = RelatedObjects; + for (int icounter = 0; icounter < ods.Count; icounter++) + { + try + { + IfcObjectDefinition o = ods[icounter]; + if (o != null) + o.mHasAssignments.Add(this); + } + catch (Exception) { } + } + base.relate(); + } + } + public partial class IfcRelAssignsTasks : IfcRelAssignsToControl // IFC4 depreceated + { + internal int mTimeForTask;// : OPTIONAL IfcScheduleTimeControl; + + public IfcScheduleTimeControl TimeForTask { get { return mDatabase.mIfcObjects[mTimeForTask] as IfcScheduleTimeControl; } } + internal IfcWorkControl WorkControl { get { return mDatabase.mIfcObjects[mRelatingControl] as IfcWorkControl; } } + internal List Tasks { get { return RelatedObjects.ConvertAll(x => x as IfcTask); } } + + internal IfcRelAssignsTasks() : base() { } + internal IfcRelAssignsTasks(IfcRelAssignsTasks a) : base(a) { mTimeForTask = a.mTimeForTask; } + internal IfcRelAssignsTasks(IfcWorkControl relControl, IfcScheduleTimeControl timeControl) + : base(relControl) { if (timeControl != null) { mTimeForTask = timeControl.mIndex; timeControl.mScheduleTimeControlAssigned = this; } } + internal IfcRelAssignsTasks(IfcWorkControl relControl, IfcTask relObject, IfcScheduleTimeControl timeControl) + : base(relControl, relObject) { if (timeControl != null) { mTimeForTask = timeControl.mIndex; timeControl.mScheduleTimeControlAssigned = this; } } + internal IfcRelAssignsTasks(IfcWorkControl relControl, List relObjects, IfcScheduleTimeControl timeControl) + : base(relControl, relObjects.ConvertAll(x => (IfcObjectDefinition)x)) { if (timeControl != null) { mTimeForTask = timeControl.mIndex; timeControl.mScheduleTimeControlAssigned = this; } } + internal new static IfcRelAssignsTasks Parse(string strDef) { IfcRelAssignsTasks a = new IfcRelAssignsTasks(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssignsTasks c, List arrFields, ref int ipos) { IfcRelAssignsToControl.parseFields(c, arrFields, ref ipos); c.mTimeForTask = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mTimeForTask)); } + internal override void relate() + { + IfcScheduleTimeControl t = mDatabase.mIfcObjects[mTimeForTask] as IfcScheduleTimeControl; + if (t != null) + t.mScheduleTimeControlAssigned = this; + base.relate(); + } + } + public partial class IfcRelAssignsToActor : IfcRelAssigns + { + internal int mRelatingActor;// : IfcActor; + internal int mActingRole;// : OPTIONAL IfcActorRole; + + public IfcActor RelatingActor { get { return mDatabase.mIfcObjects[mRelatingActor] as IfcActor; } } + + internal IfcRelAssignsToActor() : base() { } + internal IfcRelAssignsToActor(IfcRelAssignsToActor a) : base(a) { mRelatingActor = a.mRelatingActor; mActingRole = a.mActingRole; } + internal IfcRelAssignsToActor(IfcActor relActor, IfcActorRole r) : base(relActor.mDatabase) { mRelatingActor = relActor.mIndex; if (r != null) mActingRole = r.mIndex; } + internal IfcRelAssignsToActor(IfcActor relActor, IfcObjectDefinition relObject, IfcActorRole r) : base(relObject) { mRelatingActor = relActor.mIndex; if (r != null) mActingRole = r.mIndex; } + internal IfcRelAssignsToActor(IfcActor relActor, List relObjects, IfcActorRole r) : base(relObjects) { mRelatingActor = relActor.mIndex; if (r != null) mActingRole = r.mIndex; } + internal static IfcRelAssignsToActor Parse(string strDef) { IfcRelAssignsToActor a = new IfcRelAssignsToActor(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssignsToActor c, List arrFields, ref int ipos) { IfcRelAssigns.parseFields(c, arrFields, ref ipos); c.mRelatingActor = ParserSTEP.ParseLink(arrFields[ipos++]); c.mActingRole = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingActor)); } + internal override void relate() + { + IfcActor c = mDatabase.mIfcObjects[mRelatingActor] as IfcActor; + if (c != null) + c.mIsActingUpon.Add(this); + base.relate(); + } + } + public class IfcRelAssignsToControl : IfcRelAssigns + { + internal int mRelatingControl;// : IfcControl; + internal IfcControl RelatingControl { get { return mDatabase.mIfcObjects[mRelatingControl] as IfcControl; } } + + internal IfcRelAssignsToControl() : base() { } + internal IfcRelAssignsToControl(IfcRelAssignsToControl a) : base(a) { mRelatingControl = a.mRelatingControl; } + internal IfcRelAssignsToControl(IfcControl relControl) : base(relControl.mDatabase) { mRelatingControl = relControl.mIndex; relControl.mControls.Add(this); } + internal IfcRelAssignsToControl(IfcControl relControl, IfcObjectDefinition relObject) : base(relObject) { mRelatingControl = relControl.mIndex; relControl.mControls.Add(this); } + internal IfcRelAssignsToControl(IfcControl relControl, List relObjects) : base(relObjects) { mRelatingControl = relControl.mIndex; relControl.mControls.Add(this); } + internal static IfcRelAssignsToControl Parse(string strDef) { IfcRelAssignsToControl a = new IfcRelAssignsToControl(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssignsToControl c, List arrFields, ref int ipos) { IfcRelAssigns.parseFields(c, arrFields, ref ipos); c.mRelatingControl = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingControl)); } + internal override void relate() + { + IfcControl c = mDatabase.mIfcObjects[mRelatingControl] as IfcControl; + if (c != null) + c.mControls.Add(this); + base.relate(); + } + } + public partial class IfcRelAssignsToGroup : IfcRelAssigns //SUPERTYPE OF(IfcRelAssignsToGroupByFactor) + { + private int mRelatingGroup;// : IfcGroup; + public IfcGroup RelatingGroup { get { return mDatabase.mIfcObjects[mRelatingGroup] as IfcGroup; } } + + internal IfcRelAssignsToGroup() : base() { } + internal IfcRelAssignsToGroup(IfcRelAssignsToGroup a) : base(a) { mRelatingGroup = a.mRelatingGroup; } + internal IfcRelAssignsToGroup(IfcGroup relgroup) : base(relgroup.mDatabase) { mRelatingGroup = relgroup.mIndex; relgroup.mIsGroupedBy.Add(this); } + internal IfcRelAssignsToGroup(IfcGroup relgroup, List relObjects) : base(relObjects) { mRelatingGroup = relgroup.mIndex; } + internal static IfcRelAssignsToGroup Parse(string strDef) + { + IfcRelAssignsToGroup a = new IfcRelAssignsToGroup(); + int pos = 0; + parseString(a, strDef, ref pos); + return a; + } + protected static void parseString(IfcRelAssignsToGroup a, string str, ref int pos) + { + IfcRelAssigns.parseString(a, str, ref pos); + a.mRelatingGroup = ParserSTEP.StripLink(str, ref pos); + } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingGroup)); } + internal override void relate() + { + IfcGroup g = RelatingGroup; + if (g != null) + g.mIsGroupedBy.Add(this); + base.relate(); + } + } + public class IfcRelAssignsToGroupByFactor : IfcRelAssignsToGroup //IFC4 + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCRELASSIGNSTOGROUP" : base.KeyWord); } } + internal double mFactor = 1;// : IfcRatioMeasure; + internal IfcRelAssignsToGroupByFactor() : base() { } + internal IfcRelAssignsToGroupByFactor(IfcRelAssignsToGroupByFactor a) : base(a) { mFactor = a.mFactor; } + internal IfcRelAssignsToGroupByFactor(IfcGroup relgroup, double factor) : base(relgroup) { mFactor = factor; } + internal IfcRelAssignsToGroupByFactor(IfcGroup relgroup, List relObjects, double factor) : base(relgroup, relObjects) { mFactor = factor; } + internal new static IfcRelAssignsToGroup Parse(string strDef) + { + IfcRelAssignsToGroupByFactor a = new IfcRelAssignsToGroupByFactor(); + int pos = 0; + IfcRelAssignsToGroup.parseString(a, strDef, ref pos); + a.mFactor = ParserSTEP.StripDouble(strDef, ref pos); + return a; + } + protected override string BuildString() { return (mRelatedObjects.Count == 0 ? "" : base.BuildString() + (mDatabase.ModelView == ModelView.Ifc2x3Coordination ? "" : "," + ParserSTEP.DoubleToString(mFactor))); } + } + public class IfcRelAssignsToProcess : IfcRelAssigns + { + internal int mRelatingProcess;// : IfcProcess; + internal IfcRelAssignsToProcess() : base() { } + internal IfcRelAssignsToProcess(IfcRelAssignsToProcess a) : base(a) { mRelatingProcess = a.mRelatingProcess; } + internal IfcRelAssignsToProcess(IfcProcess relProcess) + : base(relProcess.mDatabase) { mRelatingProcess = relProcess.mIndex; } + internal IfcRelAssignsToProcess(IfcProcess relProcess, IfcObjectDefinition relObject) + : base(relObject) { mRelatingProcess = relProcess.mIndex; } + internal IfcRelAssignsToProcess(IfcProcess relProcess, List relObjects) + : base(relObjects) { mRelatingProcess = relProcess.mIndex; } + internal static IfcRelAssignsToProcess Parse(string strDef) { IfcRelAssignsToProcess a = new IfcRelAssignsToProcess(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssignsToProcess c, List arrFields, ref int ipos) { IfcRelAssigns.parseFields(c, arrFields, ref ipos); c.mRelatingProcess = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingProcess)); } + internal override void relate() + { + IfcProcess p = mDatabase.mIfcObjects[mRelatingProcess] as IfcProcess; + if (p != null) + p.mHasAssignments.Add(this); + base.relate(); + } + } + public partial class IfcRelAssignsToProduct : IfcRelAssigns + { + private int mRelatingProduct;// : IFC4 IfcProductSelect; : IfcProduct; + + public IfcProductSelect RelatingProduct { get { return mDatabase.mIfcObjects[mRelatingProduct] as IfcProductSelect; } } + + internal IfcRelAssignsToProduct() : base() { } + internal IfcRelAssignsToProduct(IfcRelAssignsToProduct a) : base(a) { mRelatingProduct = a.mRelatingProduct; } + internal IfcRelAssignsToProduct(IfcProductSelect relProduct) + : base(relProduct.Database) { mRelatingProduct = relProduct.Index; relProduct.ReferencedBy.Add(this); ; } + public IfcRelAssignsToProduct(IfcObjectDefinition relObject, IfcProductSelect relProduct) + : base(relObject) { mRelatingProduct = relProduct.Index; relProduct.ReferencedBy.Add(this); } + public IfcRelAssignsToProduct(List relObjects, IfcProductSelect relProduct) + : base(relObjects) { mRelatingProduct = relProduct.Index; relProduct.ReferencedBy.Add(this); } + internal static IfcRelAssignsToProduct Parse(string strDef) { IfcRelAssignsToProduct a = new IfcRelAssignsToProduct(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssignsToProduct c, List arrFields, ref int ipos) { IfcRelAssigns.parseFields(c, arrFields, ref ipos); c.mRelatingProduct = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingProduct)); } + internal override void relate() + { + IfcProductSelect p = RelatingProduct; + if (p != null) + p.ReferencedBy.Add(this); + base.relate(); + } + } + //ENTITY IfcRelAssignsToProjectOrder // DEPRECEATED IFC4 + public partial class IfcRelAssignsToResource : IfcRelAssigns + { + internal int mRelatingResource;// : IfcResource; + internal IfcRelAssignsToResource() : base() { } + internal IfcRelAssignsToResource(IfcRelAssignsToResource i) : base(i) { mRelatingResource = i.mRelatingResource; } + internal IfcRelAssignsToResource(IfcResource relResource) : base(relResource.mDatabase) { mRelatingResource = relResource.mIndex; } + internal IfcRelAssignsToResource(IfcResource relResource, IfcObjectDefinition relObject) : base(relObject) { mRelatingResource = relResource.mIndex; } + internal static IfcRelAssignsToResource Parse(string strDef) { IfcRelAssignsToResource a = new IfcRelAssignsToResource(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssignsToResource c, List arrFields, ref int ipos) { IfcRelAssigns.parseFields(c, arrFields, ref ipos); c.mRelatingResource = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mDatabase.ModelView == ModelView.Ifc2x3Coordination || mRelatedObjects.Count == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingResource)); } + internal override void relate() + { + IfcResource r = mDatabase.mIfcObjects[mRelatingResource] as IfcResource; + if (r != null) + r.mResourceOf.Add(this); + base.relate(); + } + } + public abstract partial class IfcRelAssociates : IfcRelationship //ABSTRACT SUPERTYPE OF (ONEOF(IfcRelAssociatesApproval,IfcRelAssociatesclassification,IfcRelAssociatesConstraint,IfcRelAssociatesDocument,IfcRelAssociatesLibrary,IfcRelAssociatesMaterial)) + { + internal int mID = 0; + internal List mRelatedObjects = new List();// : SET [1:?] OF IfcDefinitionSelect IFC2x3 IfcRoot; + + List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcDefinitionSelect); } } + + protected IfcRelAssociates() : base() { } + protected IfcRelAssociates(IfcRelAssociates i) : base(i) { mRelatedObjects = new List(i.mRelatedObjects.ToArray()); } + internal IfcRelAssociates(DatabaseIfc m) : base(m) { } + internal IfcRelAssociates(IfcDefinitionSelect related) : base(related.Model) { mRelatedObjects.Add(related.Index); } + protected override string BuildString() + { + if (mRelatedObjects.Count == 0) + return ""; + string str = base.BuildString() + ",(#" + mRelatedObjects[0]; + if (mRelatedObjects.Count > 200) + { + StringBuilder sb = new StringBuilder(); + sb.Append(str); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + sb.Append(",#" + mRelatedObjects[icounter]); + sb.Append(")"); + return sb.ToString(); + } + else + { + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += ",#" + mRelatedObjects[icounter]; + return str + ")"; + } + } + protected static void parseFields(IfcRelAssociates a, List arrFields, ref int ipos) { IfcRelationship.parseFields(a, arrFields, ref ipos); a.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override void parseString(string str, ref int pos) + { + base.parseString(str, ref pos); + mRelatedObjects = ParserSTEP.StripListLink(str, ref pos); + } + internal void addAssociation(IfcDefinitionSelect obj) { mRelatedObjects.Add(obj.Index); obj.HasAssociations.Add(this); } + internal void addAssociation(List objs) + { + for (int icounter = 0; icounter < objs.Count; icounter++) + { + IfcDefinitionSelect obj = objs[icounter]; + mRelatedObjects.Add(obj.Index); + obj.HasAssociations.Add(this); + } + } + internal void unassign(IfcDefinitionSelect d) { mRelatedObjects.Remove(d.Index); d.HasAssociations.Remove(this); } + internal void unassign(List ds) + { + for (int icounter = 0; icounter < ds.Count; icounter++) + { + IfcDefinitionSelect d = ds[icounter]; + mRelatedObjects.Remove(d.Index); + d.HasAssociations.Remove(this); + } + } + public override string ToString() { return (mRelatedObjects.Count == 0 ? "" : base.ToString()); } + internal override void relate() + { + for (int icounter = 0; icounter < mRelatedObjects.Count; icounter++) + { + IfcDefinitionSelect r = mDatabase.mIfcObjects[mRelatedObjects[icounter]] as IfcDefinitionSelect; + if (r != null) + r.HasAssociations.Add(this); + } + } + } + //ENTITY IfcRelAssociatesAppliedValue // DEPRECEATED IFC4 + //ENTITY IfcRelAssociatesApproval + public partial class IfcRelAssociatesClassification : IfcRelAssociates + { + internal int mRelatingClassification;// : IfcClassificationSelect; IFC2x3 IfcClassificationNotationSelect + public IfcClassificationSelect RelatingClassification { get { return mDatabase.mIfcObjects[mRelatingClassification] as IfcClassificationSelect; } } + + internal IfcRelAssociatesClassification() : base() { } + internal IfcRelAssociatesClassification(IfcRelAssociatesClassification a) : base(a) { mRelatingClassification = a.mRelatingClassification; } + internal IfcRelAssociatesClassification(IfcClassificationSelect cl) : base(cl.Database) { mRelatingClassification = cl.Index; } + internal static IfcRelAssociatesClassification Parse(string strDef) { IfcRelAssociatesClassification a = new IfcRelAssociatesClassification(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssociatesClassification a, List arrFields, ref int ipos) { IfcRelAssociates.parseFields(a, arrFields, ref ipos); a.mRelatingClassification = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingClassification); } + internal override void relate() + { + IfcClassificationSelect cs = mDatabase.mIfcObjects[mRelatingClassification] as IfcClassificationSelect; + cs.ClassificationForObjects.Add(this); + base.relate(); + } + } + public partial class IfcRelAssociatesConstraint : IfcRelAssociates + { + internal string mIntent = "$";// : OPTIONAL IfcLabel; + private int mRelatingConstraint;// : IfcConstraint + + internal IfcConstraint RelatingConstraint { get { return mDatabase.mIfcObjects[mRelatingConstraint] as IfcConstraint; } } + internal IfcRelAssociatesConstraint() : base() { } + internal IfcRelAssociatesConstraint(IfcRelAssociatesConstraint a) : base(a) { mRelatingConstraint = a.mRelatingConstraint; } + internal IfcRelAssociatesConstraint(string intent, IfcConstraint c) + : base(c.mDatabase) { if (!string.IsNullOrEmpty(intent)) mIntent = intent.Replace("'", ""); mRelatingConstraint = c.Index; } + public IfcRelAssociatesConstraint(IfcDefinitionSelect related, string intent, IfcConstraint c) + : base(related) { if (!string.IsNullOrEmpty(intent)) mIntent = intent.Replace("'", ""); mRelatingConstraint = c.Index; } + + internal static IfcRelAssociatesConstraint Parse(string strDef) { IfcRelAssociatesConstraint a = new IfcRelAssociatesConstraint(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssociatesConstraint a, List arrFields, ref int ipos) { IfcRelAssociates.parseFields(a, arrFields, ref ipos); a.mIntent = arrFields[ipos++].Replace("'", ""); a.mRelatingConstraint = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + (mIntent == "$" ? ",$," : ",'" + mIntent + "',") + ParserSTEP.LinkToString(mRelatingConstraint); } + internal override void relate() + { + IfcConstraint c = mDatabase.mIfcObjects[mRelatingConstraint] as IfcConstraint; + //c.classificationForObjects.Add(this); + base.relate(); + } + } + public partial class IfcRelAssociatesDocument : IfcRelAssociates + { + internal int mRelatingDocument;// : IfcDocumentSelect; + internal IfcRelAssociatesDocument() : base() { } + internal IfcRelAssociatesDocument(IfcRelAssociatesDocument i) : base(i) { mRelatingDocument = i.mRelatingDocument; } + public IfcRelAssociatesDocument(IfcDefinitionSelect related, IfcDocumentSelect document) : base(related) { mRelatingDocument = document.Index; } + internal IfcRelAssociatesDocument(IfcDocumentSelect document) : base(document.Database) { Name = "DocAssoc"; Description = "Document Associates"; mRelatingDocument = document.Index; document.Associates.Add(this); } + internal static IfcRelAssociatesDocument Parse(string strDef) { IfcRelAssociatesDocument a = new IfcRelAssociatesDocument(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssociatesDocument a, List arrFields, ref int ipos) { IfcRelAssociates.parseFields(a, arrFields, ref ipos); a.mRelatingDocument = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingDocument); } + internal IfcDocumentSelect getDocument() { return mDatabase.mIfcObjects[mRelatingDocument] as IfcDocumentSelect; } + } + public class IfcRelAssociatesLibrary : IfcRelAssociates + { + internal string mMatName = ""; + internal int mRelatingLibrary;// : IfcLibrarySelect; + internal IfcRelAssociatesLibrary() : base() { } + internal IfcRelAssociatesLibrary(IfcRelAssociatesLibrary i) : base(i) { mRelatingLibrary = i.mRelatingLibrary; } + internal IfcRelAssociatesLibrary(DatabaseIfc m, IfcLibrarySelect lib) : base(m) { Name = "LibAssoc"; Description = "Library Associates"; mRelatingLibrary = lib.Index; } + internal static IfcRelAssociatesLibrary Parse(string strDef) { IfcRelAssociatesLibrary a = new IfcRelAssociatesLibrary(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssociatesLibrary a, List arrFields, ref int ipos) { IfcRelAssociates.parseFields(a, arrFields, ref ipos); a.mRelatingLibrary = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingLibrary); } + } + public partial class IfcRelAssociatesMaterial : IfcRelAssociates + { + private int mRelatingMaterial;// : IfcMaterialSelect; + + internal IfcMaterialSelect RelatingMaterial { get { return mDatabase.mIfcObjects[mRelatingMaterial] as IfcMaterialSelect; } } + + internal IfcRelAssociatesMaterial() : base() { } + internal IfcRelAssociatesMaterial(IfcRelAssociatesMaterial i) : base(i) { mRelatingMaterial = i.mRelatingMaterial; } + internal IfcRelAssociatesMaterial(IfcMaterialSelect material) : base(material.Database) { Name = "MatAssoc"; Description = "Material Associates"; mRelatingMaterial = material.Index; material.Associates = this; } + internal static IfcRelAssociatesMaterial Parse(string strDef) + { + IfcRelAssociatesMaterial a = new IfcRelAssociatesMaterial(); + int pos = 0; + a.parseString(strDef, ref pos); + a.mRelatingMaterial = ParserSTEP.StripLink(strDef, ref pos); + return a; + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 && string.IsNullOrEmpty(RelatingMaterial.ToString()) ? "" : base.BuildString() + ",#" + mRelatingMaterial); } + internal override void relate() + { + base.relate(); + IfcMaterialSelect ms = mDatabase.mIfcObjects[mRelatingMaterial] as IfcMaterialSelect; + if (ms != null) + ms.Associates = this; + } + } + public partial class IfcRelAssociatesProfileProperties : IfcRelAssociates //IFC4 DELETED Replaced by IfcRelAssociatesMaterial together with material-profile sets + { + private int mRelatingProfileProperties;// : IfcProfileProperties; + internal int mProfileSectionLocation;// : OPTIONAL IfcShapeAspect; + internal double mProfileOrientation;// : OPTIONAL IfcOrientationSelect; //TYPE IfcOrientationSelect = SELECT(IfcPlaneAngleMeasure,IfcDirection); + private bool mAngle = true; + + internal IfcProfileProperties RelatingProfileProperties { get { return mDatabase.mIfcObjects[mRelatingProfileProperties] as IfcProfileProperties; } } + + internal IfcRelAssociatesProfileProperties() : base() { } + internal IfcRelAssociatesProfileProperties(IfcRelAssociatesProfileProperties i) : base(i) { mRelatingProfileProperties = i.mRelatingProfileProperties; mProfileSectionLocation = i.mProfileSectionLocation; mProfileOrientation = i.mProfileOrientation; } + internal IfcRelAssociatesProfileProperties(IfcProfileProperties pp) : base(pp.mDatabase) { if (pp.mDatabase.mSchema != Schema.IFC2x3) throw new Exception(KeyWord + " Deleted in IFC4"); mRelatingProfileProperties = pp.mIndex; } + internal static IfcRelAssociatesProfileProperties Parse(string strDef) { IfcRelAssociatesProfileProperties a = new IfcRelAssociatesProfileProperties(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelAssociatesProfileProperties a, List arrFields, ref int ipos) + { + IfcRelAssociates.parseFields(a, arrFields, ref ipos); + a.mRelatingProfileProperties = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mProfileSectionLocation = ParserSTEP.ParseLink(arrFields[ipos++]); + if (arrFields[ipos].StartsWith("IfcPlaneAngleMeasure(", true, System.Globalization.CultureInfo.CurrentCulture)) + { + string str = arrFields[ipos++]; + a.mProfileOrientation = ParserSTEP.ParseDouble(str.Substring(21, str.Length - 22)); + } + else + { + a.mAngle = false; + a.mProfileOrientation = ParserSTEP.ParseLink(arrFields[ipos++]); + } + } + protected override string BuildString() + { + if (mRelatedObjects.Count == 0) + return ""; + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingProfileProperties) + "," + + ParserSTEP.LinkToString(mProfileSectionLocation) + ","; + if (mAngle) + { + if (mProfileOrientation == 0) + return str + "$"; + return str + ",IFCPLANEANGLEMEASURE(" + ParserSTEP.DoubleToString(mProfileOrientation) + ")"; + } + return str + ParserSTEP.LinkToString((int)mProfileOrientation); + } + } + public abstract class IfcRelationship : IfcRoot //ABSTRACT SUPERTYPE OF (ONEOF (IfcRelAssigns ,IfcRelAssociates ,IfcRelConnects ,IfcRelDecomposes ,IfcRelDefines)) + { + protected IfcRelationship() : base() { } + protected IfcRelationship(IfcRelationship r) : base(r) { } + internal IfcRelationship(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcRelationship r, List arrFields, ref int ipos) { IfcRoot.parseFields(r, arrFields, ref ipos); } + internal virtual void relate() { } + } + /*internal class IfcRelaxation : IfcEntity // DEPRECEATED IFC4 + { + public override string getKW { get { return mKW; } } + internal new static string mKW = strCrypto.Decrypt("sSev2y4jvspcTXVmK7+oEg=="); //// IFCRELAXATION + internal int mRelaxationValue;// : IfcNormalisedRatioMeasure; + internal int mInitialStress;// : IfcNormalisedRatioMeasure; + internal IfcRelaxation(IfcRelaxation p) : base() { mRelaxationValue = p.mRelaxationValue; mInitialStress = p.mInitialStress; } + internal IfcRelaxation() : base() { } + internal new static IfcRelaxation Parse(string strDef) { int ipos = 0; return parseFields(IFCModel.mParser.splitLineFields(strDef), ref ipos); } + internal new static IfcRelaxation parseFields(List arrFields, ref int ipos) + { + IfcRelaxation rm = new IfcRelaxation(); + rm.mRelaxationValue = IFCModel.mParser.parseSTPLink(arrFields[ipos++]); + rm.mInitialStress = IFCModel.mParser.parseSTPLink(arrFields[ipos++]); + return rm; + } + protected override string BuildString() { return base.BuildString() + "," + IFCModel.mParser.STPLinkToString(mRelaxationValue) + "," + IFCModel.mParser.STPLinkToString(mInitialStress); } + }*/ + public abstract class IfcRelConnects : IfcRelationship //ABSTRACT SUPERTYPE OF (ONEOF (IfcRelConnectsElements ,IfcRelConnectsPortToElement ,IfcRelConnectsPorts ,IfcRelConnectsStructuralActivity ,IfcRelConnectsStructuralMember + { //,IfcRelContainedInSpatialStructure ,IfcRelCoversBldgElements ,IfcRelCoversSpaces ,IfcRelFillsElement ,IfcRelFlowControlElements ,IfcRelInterferesElements ,IfcRelReferencedInSpatialStructure ,IfcRelSequence ,IfcRelServicesBuildings ,IfcRelSpaceBoundary)) + protected IfcRelConnects() : base() { } + protected IfcRelConnects(IfcRelConnects i) : base(i) { } + internal IfcRelConnects(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcRelConnects i, List arrFields, ref int ipos) { IfcRelationship.parseFields(i, arrFields, ref ipos); } + } + public class IfcRelConnectsElements : IfcRelConnects + { + internal int mConnectionGeometry;// : OPTIONAL IfcConnectionGeometry; + internal int mRelatingElement;// : IfcElement; + internal int mRelatedElement;// : IfcElement; + + internal IfcConnectionGeometry ConnectionGeometry { get { return mDatabase.mIfcObjects[mConnectionGeometry] as IfcConnectionGeometry; } set { mConnectionGeometry = (value == null ? 0 : value.mIndex); } } + internal IfcElement RelatingElement { get { return mDatabase.mIfcObjects[mRelatingElement] as IfcElement; } } + internal IfcElement RelatedElement { get { return mDatabase.mIfcObjects[mRelatedElement] as IfcElement; } } + + internal IfcRelConnectsElements() : base() { } + internal IfcRelConnectsElements(IfcRelConnectsElements i) : base(i) { mConnectionGeometry = i.mConnectionGeometry; mRelatingElement = i.mRelatingElement; mRelatedElement = i.mRelatedElement; } + internal IfcRelConnectsElements(IfcElement relating, IfcElement related) + : base(relating.mDatabase) + { + mRelatingElement = relating.mIndex; + relating.mConnectedFrom.Add(this); + mRelatedElement = related.mIndex; + related.mConnectedTo.Add(this); + } + internal IfcRelConnectsElements(IfcConnectionGeometry cg, IfcElement relating, IfcElement related) : this(relating, related) { mConnectionGeometry = cg.mIndex; } + internal static IfcRelConnectsElements Parse(string strDef) { IfcRelConnectsElements i = new IfcRelConnectsElements(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsElements i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mConnectionGeometry = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return (mRelatingElement == 0 || mRelatedElement == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mConnectionGeometry) + "," + ParserSTEP.LinkToString(mRelatingElement) + "," + ParserSTEP.LinkToString(mRelatedElement)); } + internal override void relate() + { + IfcElement rg = mDatabase.mIfcObjects[mRelatingElement] as IfcElement, rd = mDatabase.mIfcObjects[mRelatedElement] as IfcElement; + if (rg != null) + rg.mConnectedFrom.Add(this); + if (rd != null) + rd.mConnectedTo.Add(this); + base.relate(); + } + internal IfcElement getConnected(IfcElement e) { return mDatabase.mIfcObjects[(mRelatingElement == e.mIndex ? mRelatedElement : mRelatingElement)] as IfcElement; } + } + public class IfcRelConnectsPathElements : IfcRelConnectsElements + { + internal List mRelatingPriorities = new List();// : LIST [0:?] OF INTEGER; + internal List mRelatedPriorities = new List();// : LIST [0:?] OF INTEGER; + internal IfcConnectionTypeEnum mRelatedConnectionType = IfcConnectionTypeEnum.NOTDEFINED;// : IfcConnectionTypeEnum; + internal IfcConnectionTypeEnum mRelatingConnectionType = IfcConnectionTypeEnum.NOTDEFINED;// : IfcConnectionTypeEnum; + internal IfcRelConnectsPathElements() : base() { } + internal IfcRelConnectsPathElements(IfcRelConnectsPathElements i) + : base(i) + { + mRelatingPriorities.AddRange(i.mRelatingPriorities); + mRelatedPriorities.AddRange(i.mRelatedPriorities); + mRelatedConnectionType = i.mRelatedConnectionType; + mRelatingConnectionType = i.mRelatingConnectionType; + } + internal new static IfcRelConnectsPathElements Parse(string strDef) { IfcRelConnectsPathElements i = new IfcRelConnectsPathElements(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsPathElements i, List arrFields, ref int ipos) + { + IfcRelConnectsElements.parseFields(i, arrFields, ref ipos); + i.mRelatingPriorities = ParserSTEP.SplitListLinks(arrFields[ipos++]); + i.mRelatedPriorities = ParserSTEP.SplitListLinks(arrFields[ipos++]); + i.mRelatedConnectionType = (IfcConnectionTypeEnum)Enum.Parse(typeof(IfcConnectionTypeEnum), arrFields[ipos++].Replace(".", "")); + i.mRelatingConnectionType = (IfcConnectionTypeEnum)Enum.Parse(typeof(IfcConnectionTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() + { + if (mRelatingElement == 0 || mRelatedElement == 0) + return ""; + string str = base.BuildString() + ",("; + if (mRelatingPriorities.Count > 0) + { + str += ParserSTEP.LinkToString(mRelatingPriorities[0]); + for (int icounter = 1; icounter < mRelatingPriorities.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatingPriorities[icounter]); + } + str += "),("; + if (mRelatedPriorities.Count > 0) + { + str += ParserSTEP.LinkToString(mRelatedPriorities[0]); + for (int icounter = 1; icounter < mRelatedPriorities.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedPriorities[icounter]); + } + return str + "),." + mRelatedConnectionType.ToString() + ".,." + mRelatingConnectionType.ToString() + "."; + } + } + public class IfcRelConnectsPortToElement : IfcRelConnects + { + internal int mRelatingPort;// : IfcPort; + internal int mRelatedElement;// : IfcElement; + + internal IfcPort RelatingPort { get { return mDatabase.mIfcObjects[mRelatingPort] as IfcPort; } } + internal IfcElement RelatedElement { get { return mDatabase.mIfcObjects[mRelatedElement] as IfcElement; } } + + internal IfcRelConnectsPortToElement() : base() { } + internal IfcRelConnectsPortToElement(IfcRelConnectsPortToElement c) : base(c) { mRelatingPort = c.mRelatingPort; mRelatedElement = c.mRelatedElement; } + internal IfcRelConnectsPortToElement(IfcPort p, IfcElement e) : base(p.mDatabase) + { + mRelatingPort = p.mIndex; + p.mContainedIn = this; + mRelatedElement = e.mIndex; + e.mHasPorts.Add(this); + } + internal static IfcRelConnectsPortToElement Parse(string strDef) { IfcRelConnectsPortToElement i = new IfcRelConnectsPortToElement(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsPortToElement i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingPort = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingPort) + "," + ParserSTEP.LinkToString(mRelatedElement); } + internal override void relate() { RelatingPort.mContainedIn = this; RelatedElement.mHasPorts.Add(this); } + } + public class IfcRelConnectsPorts : IfcRelConnects + { + internal int mRelatingPort;// : IfcPort; + internal int mRelatedPort;// : IfcPort; + internal int mRealizingElement;// : OPTIONAL IfcElement; + + internal IfcPort RelatingPort { get { return mDatabase.mIfcObjects[mRelatingPort] as IfcPort; } } + internal IfcPort RelatedPort { get { return mDatabase.mIfcObjects[mRelatedPort] as IfcPort; } } + internal IfcElement RealizingElement { get { return mDatabase.mIfcObjects[mRealizingElement] as IfcElement; } } + + internal IfcRelConnectsPorts() : base() { } + internal IfcRelConnectsPorts(IfcRelConnectsPorts c) : base(c) { mRelatingPort = c.mRelatingPort; mRelatedPort = c.mRelatedPort; mRealizingElement = c.mRealizingElement; } + internal IfcRelConnectsPorts(IfcPort relatingPort, IfcPort relatedPort, IfcElement realizingElement) + : base(relatingPort.mDatabase) { mRelatingPort = relatingPort.mIndex; mRelatedPort = relatedPort.mIndex; if (realizingElement != null) mRealizingElement = realizingElement.mIndex; } + internal static IfcRelConnectsPorts Parse(string strDef) { IfcRelConnectsPorts i = new IfcRelConnectsPorts(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsPorts i, List arrFields, ref int ipos) + { + IfcRelConnects.parseFields(i, arrFields, ref ipos); + i.mRelatingPort = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mRelatedPort = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mRealizingElement = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingPort) + "," + ParserSTEP.LinkToString(mRelatedPort) + "," + ParserSTEP.LinkToString(mRealizingElement); } + internal override void relate() + { + IfcPort rg = RelatingPort, rd = RelatedPort; + rg.mConnectedFrom = this; + rd.mConnectedTo = this; + } + internal IfcPort getOtherPort(IfcPort p) { return (mRelatedPort == p.mIndex ? mDatabase.mIfcObjects[mRelatingPort] as IfcPort : mDatabase.mIfcObjects[mRelatedPort] as IfcPort); } + } + public class IfcRelConnectsStructuralActivity : IfcRelConnects + { + private int mRelatingElement;// : IfcStructuralActivityAssignmentSelect; SELECT(IfcStructuralItem,IfcElement); + private int mRelatedStructuralActivity;// : IfcStructuralActivity; + + internal IfcStructuralActivityAssignmentSelect RelatingElement { get { return mDatabase.mIfcObjects[mRelatingElement] as IfcStructuralActivityAssignmentSelect; } } + internal IfcStructuralActivity RelatedStructuralActivity { get { return mDatabase.mIfcObjects[mRelatedStructuralActivity] as IfcStructuralActivity; } } + + internal IfcRelConnectsStructuralActivity() : base() { } + internal IfcRelConnectsStructuralActivity(IfcRelConnectsStructuralActivity c) : base(c) { mRelatingElement = c.mRelatingElement; mRelatedStructuralActivity = c.mRelatedStructuralActivity; } + internal IfcRelConnectsStructuralActivity(IfcStructuralActivityAssignmentSelect item, IfcStructuralActivity a) + : base(a.mDatabase) { mRelatingElement = item.Index; mRelatedStructuralActivity = a.mIndex; } + internal static IfcRelConnectsStructuralActivity Parse(string strDef) { IfcRelConnectsStructuralActivity i = new IfcRelConnectsStructuralActivity(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsStructuralActivity i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedStructuralActivity = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingElement) + "," + ParserSTEP.LinkToString(mRelatedStructuralActivity); } + internal override void relate() + { + IfcStructuralActivity sa = RelatedStructuralActivity; + sa.AssignedToStructuralItem = this; + IfcStructuralActivityAssignmentSelect saa = RelatingElement; + IfcStructuralItem si = saa as IfcStructuralItem; + if (si != null) + si.mAssignedStructuralActivity.Add(this); + else + { + IfcElement element = saa as IfcElement; + if (element != null) + element.mAssignedStructuralActivity.Add(this); + } + } + } + public partial class IfcRelConnectsStructuralElement : IfcRelConnects //DELETED IFC4 Replaced by IfcRelAssignsToProduct + { + internal int mRelatingElement;// : IfcElement; + internal int mRelatedStructuralMember;// : IfcStructuralMember; + + public IfcElement RelatingElement { get { return mDatabase.mIfcObjects[mRelatingElement] as IfcElement; } } + public IfcStructuralMember RelatedStructuralMember { get { return mDatabase.mIfcObjects[mRelatedStructuralMember] as IfcStructuralMember; } } + + internal IfcRelConnectsStructuralElement() : base() { } + internal IfcRelConnectsStructuralElement(IfcRelConnectsStructuralElement c) : base(c) { mRelatingElement = c.mRelatingElement; mRelatedStructuralMember = c.mRelatedStructuralMember; } + internal IfcRelConnectsStructuralElement(IfcElement elem, IfcStructuralMember memb) + : base(elem.mDatabase) { if (elem.mDatabase.mSchema != Schema.IFC2x3) throw new Exception(KeyWord + " Deleted IFC4!"); mRelatingElement = elem.mIndex; mRelatedStructuralMember = memb.mIndex; } + internal static IfcRelConnectsStructuralElement Parse(string strDef) { IfcRelConnectsStructuralElement i = new IfcRelConnectsStructuralElement(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsStructuralElement i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedStructuralMember = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingElement) + "," + ParserSTEP.LinkToString(mRelatedStructuralMember); } + internal override void relate() { IfcElement element = RelatingElement; if (element != null) element.mHasStructuralMemberSS.Add(this); (mDatabase.mIfcObjects[mRelatedStructuralMember] as IfcStructuralMember).mStructuralMemberForGG = this; } + } + public partial class IfcRelConnectsStructuralMember : IfcRelConnects + { + internal int mRelatingStructuralMember;// : IfcStructuralMember; + internal int mRelatedStructuralConnection;// : IfcStructuralConnection; + internal int mAppliedCondition;// : OPTIONAL IfcBoundaryCondition; + internal int mAdditionalConditions;// : OPTIONAL IfcStructuralConnectionCondition; + private double mSupportedLength;// : OPTIONAL IfcLengthMeasure; + internal int mConditionCoordinateSystem; // : OPTIONAL IfcAxis2Placement3D; + + public IfcStructuralMember RelatingStructuralMember { get { return mDatabase.mIfcObjects[mRelatingStructuralMember] as IfcStructuralMember; } } + public IfcStructuralConnection RelatedStructuralConnection { get { return mDatabase.mIfcObjects[mRelatedStructuralConnection] as IfcStructuralConnection; } } + public IfcBoundaryCondition AppliedCondition { get { return mDatabase.mIfcObjects[mAppliedCondition] as IfcBoundaryCondition; } set { mAppliedCondition = (value == null ? 0 : value.mIndex); } } + public IfcStructuralConnectionCondition AdditionalConditions { get { return mDatabase.mIfcObjects[mAdditionalConditions] as IfcStructuralConnectionCondition; } set { mAdditionalConditions = (value == null ? 0 : value.mIndex); } } + public double SupportedLength { get { return mSupportedLength; } set { mSupportedLength = value; } } + public IfcAxis2Placement3D ConditionCoordinateSystem { get { return mDatabase.mIfcObjects[mConditionCoordinateSystem] as IfcAxis2Placement3D; } set { mConditionCoordinateSystem = (value == null ? 0 : value.mIndex); } } + + internal IfcRelConnectsStructuralMember() : base() { } + internal IfcRelConnectsStructuralMember(IfcRelConnectsStructuralMember i) : base(i) { mRelatingStructuralMember = i.mRelatingStructuralMember; mRelatedStructuralConnection = i.mRelatedStructuralConnection; mAppliedCondition = i.mAppliedCondition; mAdditionalConditions = i.mAdditionalConditions; mSupportedLength = i.mSupportedLength; mConditionCoordinateSystem = i.mConditionCoordinateSystem; } + internal IfcRelConnectsStructuralMember(IfcStructuralMember member, IfcStructuralConnection connection) + : base(member.mDatabase) + { + mRelatingStructuralMember = member.mIndex; + member.mConnectedBy.Add(this); + mRelatedStructuralConnection = connection.mIndex; + connection.mConnectsStructuralMembers.Add(this); + } + + internal static IfcRelConnectsStructuralMember Parse(string strDef) { IfcRelConnectsStructuralMember i = new IfcRelConnectsStructuralMember(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsStructuralMember i, List arrFields, ref int ipos) + { + IfcRelConnects.parseFields(i, arrFields, ref ipos); + i.mRelatingStructuralMember = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mRelatedStructuralConnection = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mAppliedCondition = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mAdditionalConditions = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mSupportedLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + i.mConditionCoordinateSystem = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingStructuralMember) + "," + ParserSTEP.LinkToString(mRelatedStructuralConnection) + "," + ParserSTEP.LinkToString(mAppliedCondition) + "," + ParserSTEP.LinkToString(mAdditionalConditions) + "," + ParserSTEP.DoubleToString(mSupportedLength) + "," + ParserSTEP.LinkToString(mConditionCoordinateSystem); } + internal override void relate() + { + IfcStructuralMember m = mDatabase.mIfcObjects[mRelatingStructuralMember] as IfcStructuralMember; + if (m != null) + m.mConnectedBy.Add(this); + IfcStructuralConnection c = mDatabase.mIfcObjects[mRelatedStructuralConnection] as IfcStructuralConnection; + if (c != null) + c.mConnectsStructuralMembers.Add(this); + } + } + public class IfcRelConnectsWithEccentricity : IfcRelConnectsStructuralMember + { + internal int mConnectionConstraint;// : IfcConnectionGeometry + internal IfcConnectionGeometry ConnectionConstraint { get { return mDatabase.mIfcObjects[mConnectionConstraint] as IfcConnectionGeometry; } set { mConnectionConstraint = value.mIndex; } } + + internal IfcRelConnectsWithEccentricity() : base() { } + internal IfcRelConnectsWithEccentricity(IfcRelConnectsWithEccentricity c) : base(c) { mConnectionConstraint = c.mConnectionConstraint; } + internal IfcRelConnectsWithEccentricity(IfcStructuralMember memb, IfcStructuralConnection connection, IfcConnectionGeometry cg) + : base(memb, connection) { mConnectionConstraint = cg.mIndex; } + internal new static IfcRelConnectsWithEccentricity Parse(string strDef) { IfcRelConnectsWithEccentricity i = new IfcRelConnectsWithEccentricity(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsWithEccentricity i, List arrFields, ref int ipos) { IfcRelConnectsStructuralMember.parseFields(i, arrFields, ref ipos); i.mConnectionConstraint = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mConnectionConstraint); } + } + public class IfcRelConnectsWithRealizingElements : IfcRelConnectsElements + { + internal List mRealizingElements = new List();// : SET [1:?] OF IfcElement; + internal string mConnectionType = "$";// : : OPTIONAL IfcLabel; + internal IfcRelConnectsWithRealizingElements() : base() { } + internal IfcRelConnectsWithRealizingElements(IfcRelConnectsWithRealizingElements c) : base(c) { mConnectionGeometry = c.mConnectionGeometry; mRelatingElement = c.mRelatingElement; mRelatedElement = c.mRelatedElement; } + internal IfcRelConnectsWithRealizingElements(IfcConnectionGeometry cg, IfcElement relating, IfcElement related, IfcElement realizing, string connection) + : base(relating, related) + { + ConnectionGeometry = cg; + mRealizingElements.Add(realizing.mIndex); + if (!string.IsNullOrEmpty(connection)) + mConnectionType = connection.Replace("'", ""); + } + internal new static IfcRelConnectsWithRealizingElements Parse(string strDef) { IfcRelConnectsWithRealizingElements i = new IfcRelConnectsWithRealizingElements(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelConnectsWithRealizingElements i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRealizingElements = ParserSTEP.SplitListLinks(arrFields[ipos++]); i.mConnectionType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() + { + if (mRealizingElements.Count == 0) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mRealizingElements[0]); + for (int icounter = 1; icounter < mRealizingElements.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRealizingElements[icounter]); + return str + (mConnectionType == "$" ? "),$" : "),'" + mConnectionType + "'"); + } + internal override void relate() + { + for (int icounter = 0; icounter < mRealizingElements.Count; icounter++) + { + IfcElement e = mDatabase.mIfcObjects[mRealizingElements[icounter]] as IfcElement; + if (e != null) + e.mIsConnectionRealization.Add(this); + } + base.relate(); + } + } + public partial class IfcRelContainedInSpatialStructure : IfcRelConnects + { + internal List mRelatedElements = new List();// : SET [1:?] OF IfcProduct; + private int mRelatingStructure;// IfcSpatialElement + + public List RelatedElements { get { return (mRelatedElements.Count == 0 ? new List() : mRelatedElements.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProduct)); } } + public IfcSpatialElement RelatingStructure { get { return mDatabase.mIfcObjects[mRelatingStructure] as IfcSpatialElement; } } + + internal IfcRelContainedInSpatialStructure() : base() { } + internal IfcRelContainedInSpatialStructure(IfcRelContainedInSpatialStructure i) : base(i) { mRelatedElements = new List(i.mRelatedElements.ToArray()); mRelatingStructure = i.mRelatingStructure; } + internal IfcRelContainedInSpatialStructure(IfcSpatialElement e) : base(e.mDatabase) + { + string containerName = ""; + if (e as IfcBuilding != null) + containerName = "Building"; + else if (e as IfcBuildingStorey != null) + containerName = "BuildingStorey"; + else if (e as IfcExternalSpatialElement != null) + containerName = "ExternalSpatialElement"; + else if (e as IfcSite != null) + containerName = "Site"; + else if (e as IfcSpace != null) + containerName = "Space"; + Name = containerName; + Description = containerName + " Container for Elements"; + mRelatingStructure = e.mIndex; + e.mContainsElements.Add(this); + } + protected override string BuildString() + { + if (mRelatedElements.Count <= 0) + return ""; + string list = ""; + int icounter; + if (mRelatedElements.Count > 100) + { + StringBuilder sb = new StringBuilder(); + for (icounter = 0; icounter < mRelatedElements.Count; icounter++) + { + if (!string.IsNullOrEmpty(mDatabase.mIfcObjects[mRelatedElements[icounter]].ToString())) + { + sb.Append(",(#" + mRelatedElements[0]); + break; + } + } + for (icounter++; icounter < mRelatedElements.Count; icounter++) + { + if (!string.IsNullOrEmpty(mDatabase.mIfcObjects[mRelatedElements[icounter]].ToString())) + sb.Append(",#" + mRelatedElements[icounter]); + } + list = sb.ToString(); + } + else + { + for (icounter = 0; icounter < mRelatedElements.Count; icounter++) + { + if (!string.IsNullOrEmpty(mDatabase.mIfcObjects[mRelatedElements[icounter]].ToString())) + { + list = ",(#" + mRelatedElements[0]; + break; + } + + } + for (icounter++; icounter < mRelatedElements.Count; icounter++) + { + if (!string.IsNullOrEmpty(mDatabase.mIfcObjects[mRelatedElements[icounter]].ToString())) + list += ",#" + mRelatedElements[icounter]; + } + } + return base.BuildString() + list + "),#" + mRelatingStructure; + } + internal static IfcRelContainedInSpatialStructure Parse(string strDef) + { + IfcRelContainedInSpatialStructure c = new IfcRelContainedInSpatialStructure(); + int pos = 0; + c.parseString(strDef, ref pos); + c.mRelatedElements = ParserSTEP.StripListLink(strDef, ref pos); + c.mRelatingStructure = ParserSTEP.StripLink(strDef, ref pos); + return c; + } + internal override void relate() + { + BaseClassIfc ent = mDatabase.mIfcObjects[mRelatingStructure]; + IfcSpatialElement se = ent as IfcSpatialElement; + if (se != null) + se.mContainsElements.Add(this);//.relateStructure(contains); + for (int icounter = 0; icounter < mRelatedElements.Count; icounter++) + { + IfcProduct p = mDatabase.mIfcObjects[mRelatedElements[icounter]] as IfcProduct; + IfcElement e = p as IfcElement; + if (e != null) + e.mContainedInStructure = this; + else + { + IfcGrid g = ent as IfcGrid; + if (g != null) + g.mContainedInStructure = this; + } + } + } + internal List getBuildingElements() + { + List ps = RelatedElements; + List result = new List(ps.Count); + for (int icounter = 0; icounter < ps.Count; icounter++) + { + IfcBuildingElement be = ps[icounter] as IfcBuildingElement; + if (be != null) + result.Add(be); + } + return result; + } + internal void removeObject(IfcElement e) + { + e.mContainedInStructure = null; + mRelatedElements.Remove(e.mIndex); + } + } + public partial class IfcRelCoversBldgElements : IfcRelConnects //IFC4 DEPRECATION The relationship IfcRelCoversBldgElements shall not be used anymore, use IfcRelAggregates instead. + { + internal int mRelatingBuildingElement;// : IfcElement; + private List mRelatedCoverings = new List();// : SET [1:?] OF IfcCovering; + + public IfcElement RelatingBuildingElement { get { return mDatabase.mIfcObjects[mRelatingBuildingElement] as IfcElement; } } + public List RelatedCoverings { get { return mRelatedCoverings.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCovering); } } + + internal IfcRelCoversBldgElements() : base() { } + internal IfcRelCoversBldgElements(IfcRelCoversBldgElements c) : base(c) { mRelatingBuildingElement = c.mRelatingBuildingElement; mRelatedCoverings = new List(c.mRelatedCoverings.ToArray()); } + internal IfcRelCoversBldgElements(IfcElement e, IfcCovering covering) : base(e.mDatabase) + { + mRelatingBuildingElement = e.mIndex; + e.mHasCoverings.Add(this); + if (covering != null) + { + mRelatedCoverings.Add(covering.mIndex); + covering.mCoversElements = this; + } + } + internal IfcRelCoversBldgElements(IfcElement e, List coverings) : base(e.mDatabase) + { + mRelatingBuildingElement = e.mIndex; + e.mHasCoverings.Add(this); + for (int icounter = 0; icounter < coverings.Count; icounter++) + { + mRelatedCoverings.Add(coverings[icounter].mIndex); + coverings[icounter].mCoversElements = this; + } + } + internal static IfcRelCoversBldgElements Parse(string strDef) { IfcRelCoversBldgElements i = new IfcRelCoversBldgElements(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelCoversBldgElements i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingBuildingElement = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedCoverings = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingBuildingElement) + ",("; + if (mRelatedCoverings.Count > 0) + { + str += ParserSTEP.LinkToString(mRelatedCoverings[0]); + for (int icounter = 1; icounter < mRelatedCoverings.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedCoverings[icounter]); + } + else + return ""; + return str + ")"; + } + internal override void relate() + { + IfcBuildingElement be = mDatabase.mIfcObjects[mRelatingBuildingElement] as IfcBuildingElement; + if (be != null) + be.mHasCoverings.Add(this); + for (int icounter = 0; icounter < mRelatedCoverings.Count; icounter++) + { + IfcCovering cov = mDatabase.mIfcObjects[mRelatedCoverings[icounter]] as IfcCovering; + if (cov != null) + cov.mCoversElements = this; + } + } + internal void Remove(IfcCovering c) { mRelatedCoverings.Remove(c.mIndex); c.mHasCoverings.Remove(this); } + internal void addCovering(IfcCovering c) { c.mCoversElements = this; mRelatedCoverings.Add(c.mIndex); } + } + public partial class IfcRelCoversSpaces : IfcRelConnects //IFC4 DEPRECATION The relationship IfcRelCoversSpace shall not be used anymore, use IfcRelContainedInSpatialStructure instead. + { + internal int mRelatedSpace;// : IfcSpace; + internal List mRelatedCoverings = new List();// SET [1:?] OF IfcCovering; + + internal IfcSpace RelatedSpace { get { return mDatabase.mIfcObjects[mRelatedSpace] as IfcSpace; } } + internal List RelatedCoverings { get { return mRelatedCoverings.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcCovering); } } + + internal IfcRelCoversSpaces() : base() { } + internal IfcRelCoversSpaces(IfcRelCoversSpaces c) : base(c) { mRelatedSpace = c.mRelatedSpace; mRelatedCoverings = new List(c.mRelatedCoverings.ToArray()); } + internal IfcRelCoversSpaces(IfcSpace s, IfcCovering covering) : base(s.mDatabase) + { + mRelatedSpace = s.mIndex; + s.mHasCoverings.Add(this); + if (covering != null) + { + mRelatedCoverings.Add(covering.mIndex); + covering.mCoversSpaces = this; + } + } + internal static IfcRelCoversSpaces Parse(string strDef) { IfcRelCoversSpaces i = new IfcRelCoversSpaces(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelCoversSpaces i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatedSpace = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedCoverings = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mRelatedCoverings.Count == 0) + return ""; + string str = base.BuildString() + ",#" + mRelatedSpace + ",(#" + mRelatedCoverings[0]; + for (int icounter = 1; icounter < mRelatedCoverings.Count; icounter++) + str += ",#" + mRelatedCoverings[icounter]; + return str + ")"; + } + + internal void addCovering(IfcCovering c) { c.mCoversSpaces = this; mRelatedCoverings.Add(c.mIndex); } + internal override void relate() + { + IfcSpace s = (IfcSpace)mDatabase.mIfcObjects[mRelatedSpace]; + s.mHasCoverings.Add(this); + for (int icounter = 0; icounter < mRelatedCoverings.Count; icounter++) + { + IfcCovering cov = mDatabase.mIfcObjects[mRelatedCoverings[icounter]] as IfcCovering; + if (cov != null) + cov.mCoversSpaces = this; + } + } + } + public partial class IfcRelDeclares : IfcRelationship //IFC4 + { + private int mRelatingContext;// : IfcContext; + private List mRelatedDefinitions = new List();// : SET [1:?] OF IfcDefinitionSelect; + + internal IfcContext RelatingContext { get { return mDatabase.mIfcObjects[mRelatingContext] as IfcContext; } } + public List RelatedDefinitions { get { return mRelatedDefinitions.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcDefinitionSelect); } } + + internal IfcRelDeclares() : base() { } + internal IfcRelDeclares(IfcRelDeclares d) : base(d) { mRelatingContext = d.mRelatingContext; mRelatedDefinitions.AddRange(d.mRelatedDefinitions); } + internal IfcRelDeclares(IfcContext c) : base(c.mDatabase) { mRelatingContext = c.mIndex; c.mDeclares.Add(this); } + public IfcRelDeclares(IfcContext c, IfcDefinitionSelect def) : this(c, new List() { def }) { } + internal IfcRelDeclares(IfcContext c, List defs) : this(c) + { + for (int icounter = 0; icounter < defs.Count; icounter++) + { + mRelatedDefinitions.Add(defs[icounter].Index); + defs[icounter].HasContext = this; + } + } + internal void AddRelated(IfcDefinitionSelect d) { mRelatedDefinitions.Add(d.Index); d.HasContext = this; } + internal void RemoveRelated(IfcDefinitionSelect d) { mRelatedDefinitions.Remove(d.Index); d.HasContext = null; } + internal static IfcRelDeclares Parse(string strDef) { IfcRelDeclares i = new IfcRelDeclares(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelDeclares i, List arrFields, ref int ipos) { IfcRelationship.parseFields(i, arrFields, ref ipos); i.mRelatingContext = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedDefinitions = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mDatabase.mSchema == Schema.IFC2x3 || mRelatingContext == 0 || mRelatedDefinitions.Count == 0) + return ""; + string str = ",(" + ParserSTEP.LinkToString(mRelatedDefinitions[0]); + for (int icounter = 1; icounter < mRelatedDefinitions.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedDefinitions[icounter]); + return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingContext) + str + ")"; + } + internal override void relate() + { + RelatingContext.mDeclares.Add(this); + for (int icounter = 0; icounter < mRelatedDefinitions.Count; icounter++) + (mDatabase.mIfcObjects[mRelatedDefinitions[icounter]] as IfcDefinitionSelect).HasContext = this; + base.relate(); + } + } + public abstract class IfcRelDecomposes : IfcRelationship //ABSTACT SUPERTYPE OF (ONEOF (IfcRelAggregates ,IfcRelNests ,IfcRelProjectsElement ,IfcRelVoidsElement)) + { + protected IfcRelDecomposes() : base() { } + protected IfcRelDecomposes(IfcRelDecomposes d) : base(d) { } + internal IfcRelDecomposes(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcRelDecomposes d, List arrFields, ref int ipos) { IfcRelationship.parseFields(d, arrFields, ref ipos); } + } + public abstract partial class IfcRelDefines : IfcRelationship // ABSTRACT SUPERTYPE OF (ONEOF(IfcRelDefinesByProperties,IfcRelDefinesByType)) + { + protected IfcRelDefines() : base() { } + protected IfcRelDefines(IfcRelDefines d) : base(d) { } + protected IfcRelDefines(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcRelDefines r, List arrFields, ref int ipos) { IfcRelationship.parseFields(r, arrFields, ref ipos); } + } + public partial class IfcRelDefinesByObject : IfcRelDefines + { + internal List mRelatedObjects = new List();// : SET [1:?] OF IfcObject; + internal int mRelatingObject;// : IfcObject + + internal List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcObject); } } + internal IfcObject RelatingObject { get { return mDatabase.mIfcObjects[mRelatingObject] as IfcObject; } } + + internal IfcRelDefinesByObject() : base() { } + internal IfcRelDefinesByObject(IfcRelDefinesByObject d) : base(d) { mRelatedObjects = new List(d.mRelatedObjects.ToArray()); mRelatingObject = d.mRelatingObject; } + internal IfcRelDefinesByObject(IfcObject relObj) : base(relObj.mDatabase) { mRelatingObject = relObj.mIndex; relObj.mIsDeclaredBy = this; } + protected override string BuildString() + { + if (mRelatedObjects.Count == 0) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mRelatedObjects[0]); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedObjects[icounter]); + return str + ")," + ParserSTEP.LinkToString(mRelatingObject); + } + internal static void parseFields(IfcRelDefinesByObject t, List arrFields, ref int ipos) { IfcRelDefines.parseFields(t, arrFields, ref ipos); t.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); t.mRelatingObject = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcRelDefinesByObject Parse(string strDef) { IfcRelDefinesByObject t = new IfcRelDefinesByObject(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal override void relate() + { + if (mRelatingObject > 0) + { + IfcObject ot = mDatabase.mIfcObjects[mRelatingObject] as IfcObject; + if (ot != null) + ot.mIsDeclaredBy = this; + } + for (int icounter = 0; icounter < mRelatedObjects.Count; icounter++) + { + IfcObject o = mDatabase.mIfcObjects[mRelatedObjects[icounter]] as IfcObject; + if (o != null) + o.mDeclares.Add(this); + } + } + internal void assign(IfcObject obj) { mRelatedObjects.Add(obj.mIndex); obj.mIsDeclaredBy = this; } + } + public partial class IfcRelDefinesByProperties : IfcRelDefines + { + private List mRelatedObjects = new List();// IFC4 change SET [1:1] OF IfcObjectDefinition; ifc2x3 : SET [1:?] OF IfcObject; + private int mRelatingPropertyDefinition;// : IfcPropertySetDefinition; + + public List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcObjectDefinition); } } + public IfcPropertySetDefinition RelatingPropertyDefinition { get { return mDatabase.mIfcObjects[mRelatingPropertyDefinition] as IfcPropertySetDefinition; } } + + internal IfcRelDefinesByProperties() : base() { } + internal IfcRelDefinesByProperties(IfcRelDefinesByProperties d) : base(d) { mRelatedObjects = new List(d.mRelatedObjects.ToArray()); mRelatingPropertyDefinition = d.mRelatingPropertyDefinition; } + internal IfcRelDefinesByProperties(IfcPropertySetDefinition ifcproperty) : base(ifcproperty.mDatabase) { mRelatingPropertyDefinition = ifcproperty.mIndex; } + public IfcRelDefinesByProperties(IfcObjectDefinitionSelect od, IfcPropertySetDefinition ifcproperty) : this(new List() { od }, ifcproperty) { } + public IfcRelDefinesByProperties(List objs, IfcPropertySetDefinition ifcproperty) : this(ifcproperty) + { + for (int icounter = 0; icounter < objs.Count; icounter++) + { + mRelatedObjects.Add(objs[icounter].Index); + objs[icounter].IsDefinedBy.Add(this); + } + } + private IfcRelDefinesByProperties(DatabaseIfc m) : base(m) + { + Name = "NameRelDefinesByProperties"; + Description = "DescriptionRelDefinesByProperties"; + } + protected override string BuildString() + { + if (mRelatedObjects.Count == 0 || RelatingPropertyDefinition == null || string.IsNullOrEmpty(RelatingPropertyDefinition.ToString())) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mRelatedObjects[0]); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedObjects[icounter]); + return str + ")," + ParserSTEP.LinkToString(mRelatingPropertyDefinition); + } + internal static IfcRelDefinesByProperties Parse(string str) + { + IfcRelDefinesByProperties d = new IfcRelDefinesByProperties(); + int pos = 0; + d.parseString(str, ref pos); + d.mRelatedObjects = ParserSTEP.StripListLink(str, ref pos);// splitListSTPLinks(arrFields[ipos++]); + d.mRelatingPropertyDefinition = ParserSTEP.StripLink(str, ref pos);//.parseSTPLink(arrFields[ipos++]); + return d; + } + + internal void assign(IfcObjectDefinitionSelect od) + { + mRelatedObjects.Add(od.Index); + od.IsDefinedBy.Add(this); + } + internal void assign(List objs) + { + for (int icounter = 0; icounter < objs.Count; icounter++) + { + mRelatedObjects.Add(objs[icounter].Index); + objs[icounter].IsDefinedBy.Add(this); + } + } + internal void unassign(List objs) + { + for (int icounter = 0; icounter < objs.Count; icounter++) + { + mRelatedObjects.Remove(objs[icounter].Index); + objs[icounter].IsDefinedBy.Remove(this); + } + } + internal void RemoveRelated(IfcObjectDefinitionSelect od) + { + mRelatedObjects.Remove(od.Index); + od.IsDefinedBy.Remove(this); + } + internal override void relate() + { + RelatingPropertyDefinition.DefinesOccurrence = this; + List related = RelatedObjects; + for (int icounter = 0; icounter < related.Count; icounter++) + { + IfcObject o = related[icounter] as IfcObject; + if (o != null) + o.mIsDefinedBy.Add(this); + else + { + IfcContext context = related[icounter] as IfcContext; + if (context != null) + context.mIsDefinedBy.Add(this); + } + } + } + } + public partial class IfcRelDefinesByType : IfcRelDefines + { + internal List mRelatedObjects = new List();// : SET [1:?] OF IfcObject; + private int mRelatingType;// : IfcTypeObject + + internal IfcTypeObject RelatingType { get { return mDatabase.mIfcObjects[mRelatingType] as IfcTypeObject; } } + internal List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcObject); } } + + internal IfcRelDefinesByType() : base() { } + internal IfcRelDefinesByType(IfcRelDefinesByType d) : base(d) { mRelatedObjects = new List(d.mRelatedObjects.ToArray()); mRelatingType = d.mRelatingType; } + internal IfcRelDefinesByType(IfcTypeObject relType) : base(relType.mDatabase) { mRelatingType = relType.mIndex; relType.mObjectTypeOf = this; } + internal IfcRelDefinesByType(IfcObject related, IfcTypeObject relating) : this(relating) { mRelatedObjects.Add(related.mIndex); } + protected override string BuildString() + { + if (mRelatedObjects.Count == 0) + return ""; + IfcTypeObject to = RelatingType; + if (to == null || string.IsNullOrEmpty(to.ToString())) + return ""; + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mRelatedObjects[0]); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedObjects[icounter]); + return str + ")," + ParserSTEP.LinkToString(mRelatingType); + } + internal static void parseFields(IfcRelDefinesByType t, List arrFields, ref int ipos) { IfcRelDefines.parseFields(t, arrFields, ref ipos); t.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); t.mRelatingType = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcRelDefinesByType Parse(string strDef) { IfcRelDefinesByType t = new IfcRelDefinesByType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal override void relate() + { + if (mRelatingType > 0) + { + IfcTypeObject ot = mDatabase.mIfcObjects[mRelatingType] as IfcTypeObject; + if (ot != null) + ot.mObjectTypeOf = this; + } + for (int icounter = 0; icounter < mRelatedObjects.Count; icounter++) + { + IfcObject o = mDatabase.mIfcObjects[mRelatedObjects[icounter]] as IfcObject; + if (o != null) + o.IsTypedBy = this; + } + } + internal void assignObj(IfcObject obj) + { + mRelatedObjects.Add(obj.mIndex); + if (obj.IsTypedBy != null) + obj.IsTypedBy.mRelatedObjects.Remove(obj.mIndex); + obj.IsTypedBy = this; + } + } + public class IfcRelFillsElement : IfcRelConnects + { + private int mRelatingOpeningElement;// : IfcOpeningElement; + private int mRelatedBuildingElement;// :OPTIONAL IfcElement; + + internal IfcOpeningElement RelatingOpeningElement { get { return mDatabase.mIfcObjects[mRelatingOpeningElement] as IfcOpeningElement; } } + internal IfcElement RelatedBuildingElement { get { return mDatabase.mIfcObjects[mRelatedBuildingElement] as IfcElement; } } + + internal IfcRelFillsElement() : base() { } + internal IfcRelFillsElement(IfcRelFillsElement f) : base(f) { mRelatingOpeningElement = f.mRelatingOpeningElement; mRelatedBuildingElement = f.mRelatedBuildingElement; } + internal IfcRelFillsElement(IfcOpeningElement oe, IfcElement e) : base(oe.mDatabase) { mRelatingOpeningElement = oe.mIndex; mRelatedBuildingElement = e.mIndex; } + internal static IfcRelFillsElement Parse(string strDef) { IfcRelFillsElement i = new IfcRelFillsElement(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelFillsElement i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingOpeningElement = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedBuildingElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingOpeningElement) + "," + ParserSTEP.LinkToString(mRelatedBuildingElement); } + internal override void relate() { RelatedBuildingElement.mFillsVoids.Add(this); RelatingOpeningElement.mHasFillings.Add(this); base.relate(); } + } + public class IfcRelFlowControlElements : IfcRelConnects + { + internal int mRelatingPort;// : IfcPort; + internal int mRelatedElement;// : IfcElement; + internal IfcRelFlowControlElements() : base() { } + internal IfcRelFlowControlElements(IfcRelFlowControlElements i) : base(i) { mRelatingPort = i.mRelatingPort; mRelatedElement = i.mRelatedElement; } + internal static IfcRelFlowControlElements Parse(string strDef) { IfcRelFlowControlElements i = new IfcRelFlowControlElements(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelFlowControlElements i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingPort = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingPort) + "," + ParserSTEP.LinkToString(mRelatedElement); } + } + //ENTITY IfcRelInteractionRequirements // DEPRECEATED IFC4 + public partial class IfcRelNests : IfcRelDecomposes + { + internal int mRelatingObject;// : IfcObjectDefinition + internal List mRelatedObjects = new List();// : SET [1:?] OF IfcObjectDefinition; + + internal IfcObjectDefinition RelatingObject { get { return mDatabase.mIfcObjects[mRelatingObject] as IfcObjectDefinition; } } + internal List RelatedObjects { get { return mRelatedObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcObjectDefinition); } } + + internal IfcRelNests() : base() { } + internal IfcRelNests(IfcRelNests n) : base(n) { mRelatingObject = n.mRelatingObject; mRelatedObjects = new List(n.mRelatedObjects.ToArray()); } + public IfcRelNests(IfcObjectDefinition relatingObject) : base(relatingObject.mDatabase) + { + mRelatingObject = relatingObject.mIndex; + relatingObject.mIsNestedBy.Add(this); + } + internal IfcRelNests(IfcObjectDefinition relatingObject, IfcObjectDefinition relatedObject) : base(relatingObject.mDatabase) + { + mRelatingObject = relatingObject.mIndex; + mRelatedObjects.Add(relatedObject.mIndex); + relatingObject.mIsNestedBy.Add(this); + relatedObject.mNests = this; + } + internal IfcRelNests(IfcObjectDefinition relatingObject, IfcObjectDefinition ro, IfcObjectDefinition ro2) : this(relatingObject, ro) { mRelatedObjects.Add(ro2.mIndex); ro2.mNests = this; ; } + internal IfcRelNests(IfcObjectDefinition relatingObject, List relatedObjects) : base(relatingObject.mDatabase) + { + mRelatingObject = relatingObject.mIndex; + relatingObject.mIsNestedBy.Add(this); + for (int icounter = 0; icounter < relatedObjects.Count; icounter++) + { + mRelatedObjects.Add(relatedObjects[icounter].mIndex); + relatedObjects[icounter].mNests = this; + } + } + internal static IfcRelNests Parse(string strDef) { IfcRelNests a = new IfcRelNests(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcRelNests a, List arrFields, ref int ipos) { IfcRelDecomposes.parseFields(a, arrFields, ref ipos); a.mRelatingObject = ParserSTEP.ParseLink(arrFields[ipos++]); a.mRelatedObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = ""; + if (mRelatedObjects.Count > 0) + { + str += ParserSTEP.LinkToString(mRelatedObjects[0]); + for (int icounter = 1; icounter < mRelatedObjects.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedObjects[icounter]); + } + else + return ""; + return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingObject) + ",(" + str + ")"; + } + internal override void relate() + { + IfcObjectDefinition relating = RelatingObject; + relating.relateNested(this); + List ods = RelatedObjects; + foreach (IfcObjectDefinition od in ods) + { + if (od == null) + continue; + od.mNests = this; + IfcDistributionPort dp = od as IfcDistributionPort; + if (dp != null) + { + IfcFlowSegment fs = relating as IfcFlowSegment; + if (fs != null) + { + if (dp.mFlowDirection == IfcFlowDirectionEnum.SOURCE) + fs.mSourcePort = dp; + else if (dp.mFlowDirection == IfcFlowDirectionEnum.SINK) + fs.mSinkPort = dp; + } + } + } + } + internal void addObject(IfcObjectDefinition o) + { + o.mNests = this; + if (!mRelatedObjects.Contains(o.mIndex)) + mRelatedObjects.Add(o.mIndex); + } + } + //ENTITY IfcRelOccupiesSpaces // DEPRECEATED IFC4 + //ENTITY IfcRelOverridesProperties // DEPRECEATED IFC4 + public class IfcRelProjectsElement : IfcRelDecomposes // IFC2x3 IfcRelDecomposes + { + internal int mRelatingElement;// : IfcElement; + internal int mRelatedFeatureElement;// : IfcFeatureElementAddition + + internal IfcElement RelatingElement { get { return mDatabase.mIfcObjects[mRelatingElement] as IfcElement; } } + internal IfcFeatureElementAddition RelatedFeatureElement { get { return mDatabase.mIfcObjects[mRelatedFeatureElement] as IfcFeatureElementAddition; } } + + protected IfcRelProjectsElement() : base() { } + protected IfcRelProjectsElement(IfcRelProjectsElement p) : base(p) { mRelatingElement = p.mRelatingElement; mRelatedFeatureElement = p.mRelatedFeatureElement; } + protected IfcRelProjectsElement(IfcElement e, IfcFeatureElementAddition a) : base(e.mDatabase) { mRelatingElement = e.mIndex; mRelatedFeatureElement = a.mIndex; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingElement) + "," + ParserSTEP.LinkToString(mRelatedFeatureElement); } + protected static void parseFields(IfcRelProjectsElement c, List arrFields, ref int ipos) { IfcRelDecomposes.parseFields(c, arrFields, ref ipos); c.mRelatingElement = ParserSTEP.ParseLink(arrFields[ipos++]); c.mRelatedFeatureElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal override void relate() + { + base.relate(); + RelatingElement.mHasProjections.Add(this); + RelatedFeatureElement.mProjectsElements.Add(this); + } + } + //ENTITY IfcRelReferencedInSpatialStructure + //ENTITY IfcRelSchedulesCostItems // DEPRECEATED IFC4 + public class IfcRelSequence : IfcRelConnects + { + internal int mRelatingProcess;// : IfcProcess; + internal int mRelatedProcess;// IfcProcess; + internal double mTimeLag;// : OPTIONAL IfcLagTime; IFC2x3 IfcTimeMeasure + internal IfcSequenceEnum mSequenceType = IfcSequenceEnum.NOTDEFINED;// : OPTIONAL IfcSequenceEnum; + internal string mUserDefinedSequenceType = "$";// : OPTIONAL IfcLabel; + internal IfcRelSequence() : base() { } + internal IfcRelSequence(IfcRelSequence s) : base(s) { mRelatingProcess = s.mRelatingProcess; mRelatedProcess = s.mRelatedProcess; mTimeLag = s.mTimeLag; mSequenceType = s.mSequenceType; mUserDefinedSequenceType = s.mUserDefinedSequenceType; } + internal IfcRelSequence(IfcProcess rg, IfcProcess rd, IfcLagTime lag, IfcSequenceEnum st, string userSeqType) : base(rg.mDatabase) + { + mRelatingProcess = rg.mIndex; + mRelatedProcess = rd.mIndex; + if (lag != null) + mTimeLag = (mDatabase.mSchema == Schema.IFC2x3 ? (int)lag.getSecondsDuration() : lag.mIndex); + mSequenceType = st; + if (!string.IsNullOrEmpty(userSeqType)) + mUserDefinedSequenceType = userSeqType.Replace("'", ""); + } + internal static IfcRelSequence Parse(string strDef,Schema schema) { IfcRelSequence i = new IfcRelSequence(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return i; } + internal static void parseFields(IfcRelSequence i, List arrFields, ref int ipos,Schema schema) + { + IfcRelConnects.parseFields(i, arrFields, ref ipos); + i.mRelatingProcess = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mRelatedProcess = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + i.mTimeLag = ParserSTEP.ParseDouble(arrFields[ipos++]); + else + i.mTimeLag = ParserSTEP.ParseLink(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s != "$") + i.mSequenceType = (IfcSequenceEnum)Enum.Parse(typeof(IfcSequenceEnum), s.Replace(".", "")); + if (schema != Schema.IFC2x3) + i.mUserDefinedSequenceType = arrFields[ipos++]; + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingProcess) + "," + ParserSTEP.LinkToString(mRelatedProcess) + "," + (mDatabase.mSchema == Schema.IFC2x3 ? ParserSTEP.DoubleToString(mTimeLag) : + ParserSTEP.LinkToString((int)mTimeLag)) + ",." + mSequenceType + (mDatabase.mSchema == Schema.IFC2x3 ? "." : (mUserDefinedSequenceType == "$" ? ".,$" : ".,'" + mUserDefinedSequenceType + "'")); + } + internal override void relate() + { + IfcProcess p = mDatabase.mIfcObjects[mRelatingProcess] as IfcProcess, s = mDatabase.mIfcObjects[mRelatedProcess] as IfcProcess; + p.mIsPredecessorTo.Add(this); + s.mIsSuccessorFrom.Add(this); + } + internal IfcProcess getPredecessor() { return mDatabase.mIfcObjects[mRelatingProcess] as IfcProcess; } + internal IfcProcess getSuccessor() { return mDatabase.mIfcObjects[mRelatedProcess] as IfcProcess; } + internal TimeSpan getLag() + { + if (mDatabase.mSchema == Schema.IFC2x3) return new TimeSpan(0, 0, (int)mTimeLag); + IfcLagTime lt = mDatabase.mIfcObjects[(int)mTimeLag] as IfcLagTime; + return (lt == null ? new TimeSpan(0, 0, 0) : lt.getLag()); + } + } + public partial class IfcRelServicesBuildings : IfcRelConnects + { + internal int mRelatingSystem;// : IfcSystem; + internal List mRelatedBuildings = new List();// : SET [1:?] OF IfcSpatialElement ; + + public IfcSystem RelatingSystem { get { return mDatabase.mIfcObjects[mRelatingSystem] as IfcSystem; } set { mRelatingSystem = value.mIndex; } } + public List RelatedBuildings { get { return mRelatedBuildings.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcSpatialElement); } } + + internal IfcRelServicesBuildings() : base() { } + internal IfcRelServicesBuildings(IfcRelServicesBuildings s) : base(s) { mRelatingSystem = s.mRelatingSystem; mRelatedBuildings = new List(s.mRelatedBuildings.ToArray()); } + internal IfcRelServicesBuildings(IfcSystem sys, IfcSpatialElement se) + : base(sys.mDatabase) { mRelatingSystem = sys.mIndex; mRelatedBuildings.Add(se.mIndex); se.mServicedBySystems.Add(this); } + internal static IfcRelServicesBuildings Parse(string strDef) { IfcRelServicesBuildings i = new IfcRelServicesBuildings(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelServicesBuildings i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingSystem = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedBuildings = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + if (mRelatedBuildings.Count == 0) + return ""; + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingSystem) + ",(" + ParserSTEP.LinkToString(mRelatedBuildings[0]); + for (int icounter = 1; icounter < mRelatedBuildings.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRelatedBuildings[icounter]); + return str + ")"; + } + internal override void relate() + { + IfcSystem sys = (IfcSystem)mDatabase.mIfcObjects[mRelatingSystem]; + sys.mServicesBuildings = this; + for (int icounter = 0; icounter < mRelatedBuildings.Count; icounter++) + { + IfcSpatialStructureElement se = mDatabase.mIfcObjects[mRelatedBuildings[icounter]] as IfcSpatialStructureElement; + if (se != null) + se.mServicedBySystems.Add(this); + } + } + } + public partial class IfcRelSpaceBoundary : IfcRelConnects + { + internal int mRelatingSpace;// : IfcSpaceBoundarySelect; : IfcSpace; + internal int mRelatedBuildingElement;// :OPTIONAL IfcElement; + internal int mConnectionGeometry;// : OPTIONAL IfcConnectionGeometry; + internal IfcPhysicalOrVirtualEnum mPhysicalOrVirtualBoundary = IfcPhysicalOrVirtualEnum.NOTDEFINED;// : IfcPhysicalOrVirtualEnum; + internal IfcInternalOrExternalEnum mInternalOrExternalBoundary = IfcInternalOrExternalEnum.NOTDEFINED;// : IfcInternalOrExternalEnum; + + internal IfcSpaceBoundarySelect RelatingSpace { get { return mDatabase.mIfcObjects[mRelatingSpace] as IfcSpaceBoundarySelect; } } + internal IfcRelSpaceBoundary() : base() { } + internal IfcRelSpaceBoundary(IfcRelSpaceBoundary p) : base(p) { mRelatingSpace = p.mRelatingSpace; mRelatedBuildingElement = p.mRelatedBuildingElement; mConnectionGeometry = p.mConnectionGeometry; mPhysicalOrVirtualBoundary = p.mPhysicalOrVirtualBoundary; mInternalOrExternalBoundary = p.mInternalOrExternalBoundary; } + internal IfcRelSpaceBoundary(IfcSpaceBoundarySelect s, IfcElement e, IfcConnectionGeometry g, IfcPhysicalOrVirtualEnum virt, IfcInternalOrExternalEnum intern) : base(s.Database) + { + mRelatingSpace = s.Index; + s.BoundedBy.Add(this); + mRelatedBuildingElement = e.mIndex; + if (g != null) + mConnectionGeometry = g.mIndex; + mPhysicalOrVirtualBoundary = virt; + mInternalOrExternalBoundary = intern; + } + internal static IfcRelSpaceBoundary Parse(string strDef) { IfcRelSpaceBoundary i = new IfcRelSpaceBoundary(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelSpaceBoundary i, List arrFields, ref int ipos) + { + IfcRelConnects.parseFields(i, arrFields, ref ipos); + i.mRelatingSpace = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mRelatedBuildingElement = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mConnectionGeometry = ParserSTEP.ParseLink(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s != "$") + i.mPhysicalOrVirtualBoundary = (IfcPhysicalOrVirtualEnum)Enum.Parse(typeof(IfcPhysicalOrVirtualEnum), s.Replace(".", "")); + s = arrFields[ipos++]; + if (s != "$") + i.mInternalOrExternalBoundary = (IfcInternalOrExternalEnum)Enum.Parse(typeof(IfcInternalOrExternalEnum), s.Replace(".", "")); + } + protected override string BuildString() { return (mRelatedBuildingElement == 0 || mRelatingSpace == 0 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingSpace) + "," + ParserSTEP.LinkToString(mRelatedBuildingElement) + "," + ParserSTEP.LinkToString(mConnectionGeometry) + ",." + mPhysicalOrVirtualBoundary.ToString() + ".,." + mInternalOrExternalBoundary.ToString() + "."); } + internal override void relate() + { + base.relate(); + IfcSpaceBoundarySelect s = RelatingSpace; + s.BoundedBy.Add(this); + IfcElement e = mDatabase.mIfcObjects[mRelatedBuildingElement] as IfcElement; + if (e != null) + e.mProvidesBoundaries.Add(this); + } + } + public class IfcRelSpaceBoundary1stLevel : IfcRelSpaceBoundary + { + internal int mParentBoundary;// : IfcRelSpaceBoundary1stLevel; + //INVERSE + internal List mInnerBoundaries = new List();// : SET OF IfcRelSpaceBoundary1stLevel FOR ParentBoundary; + + internal IfcRelSpaceBoundary1stLevel() : base() { } + internal IfcRelSpaceBoundary1stLevel(IfcRelSpaceBoundary1stLevel p) : base(p) { mParentBoundary = p.mParentBoundary; } + internal IfcRelSpaceBoundary1stLevel(IfcSpaceBoundarySelect s, IfcElement e, IfcConnectionGeometry g, IfcPhysicalOrVirtualEnum virt, IfcInternalOrExternalEnum intern, IfcRelSpaceBoundary1stLevel parent) + : base(s, e, g, virt, intern) { mParentBoundary = parent.mIndex; } + internal static new IfcRelSpaceBoundary1stLevel Parse(string strDef) { IfcRelSpaceBoundary1stLevel i = new IfcRelSpaceBoundary1stLevel(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelSpaceBoundary1stLevel i, List arrFields, ref int ipos) + { + IfcRelSpaceBoundary.parseFields(i, arrFields, ref ipos); + i.mParentBoundary = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mParentBoundary); } + internal override void relate() + { + base.relate(); + IfcRelSpaceBoundary1stLevel s = mDatabase.mIfcObjects[mParentBoundary] as IfcRelSpaceBoundary1stLevel; + s.mInnerBoundaries.Add(this); + } + } + public partial class IfcRelSpaceBoundary2ndLevel : IfcRelSpaceBoundary1stLevel + { + internal int mCorrespondingBoundary;// : IfcRelSpaceBoundary2ndLevel; + //INVERSE + internal List mCorresponds = new List();// : SET OF IfcRelSpaceBoundary1stLevel FOR ParentBoundary; + + internal IfcRelSpaceBoundary2ndLevel() : base() { } + internal IfcRelSpaceBoundary2ndLevel(IfcRelSpaceBoundary2ndLevel p) : base(p) { mCorrespondingBoundary = p.mCorrespondingBoundary; } + internal IfcRelSpaceBoundary2ndLevel(IfcSpaceBoundarySelect s, IfcElement e, IfcConnectionGeometry g, IfcPhysicalOrVirtualEnum virt, IfcInternalOrExternalEnum intern, IfcRelSpaceBoundary1stLevel parent, IfcRelSpaceBoundary2ndLevel corresponding) + : base(s, e, g, virt, intern, parent) { if (corresponding != null) mCorrespondingBoundary = corresponding.mIndex; } + internal static new IfcRelSpaceBoundary2ndLevel Parse(string strDef) { IfcRelSpaceBoundary2ndLevel i = new IfcRelSpaceBoundary2ndLevel(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelSpaceBoundary2ndLevel i, List arrFields, ref int ipos) + { + IfcRelSpaceBoundary1stLevel.parseFields(i, arrFields, ref ipos); + i.mCorrespondingBoundary = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mCorrespondingBoundary); } + internal override void relate() + { + base.relate(); + IfcRelSpaceBoundary2ndLevel s = mDatabase.mIfcObjects[mCorrespondingBoundary] as IfcRelSpaceBoundary2ndLevel; + s.mCorresponds.Add(this); + } + } + public partial class IfcRelVoidsElement : IfcRelDecomposes // Ifc2x3 IfcRelConnects + { + private int mRelatingBuildingElement;// : IfcElement; + private int mRelatedOpeningElement;// : IfcFeatureElementSubtraction; + + internal IfcElement RelatingBuildingElement { get { return mDatabase.mIfcObjects[mRelatingBuildingElement] as IfcElement; } } + internal IfcFeatureElementSubtraction RelatedOpeningElement { get { return mDatabase.mIfcObjects[mRelatedOpeningElement] as IfcFeatureElementSubtraction; } } + + internal IfcRelVoidsElement() : base() { } + internal IfcRelVoidsElement(IfcRelVoidsElement v) : base(v) { mRelatingBuildingElement = v.mRelatingBuildingElement; mRelatedOpeningElement = v.mRelatedOpeningElement; } + public IfcRelVoidsElement(IfcElement host, IfcFeatureElementSubtraction fes) + : base(host.mDatabase) { mRelatingBuildingElement = host.mIndex; host.mHasOpenings.Add(this); mRelatedOpeningElement = fes.mIndex; fes.mVoidsElement = this; } + internal static IfcRelVoidsElement Parse(string strDef) { IfcRelVoidsElement i = new IfcRelVoidsElement(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcRelVoidsElement i, List arrFields, ref int ipos) { IfcRelConnects.parseFields(i, arrFields, ref ipos); i.mRelatingBuildingElement = ParserSTEP.ParseLink(arrFields[ipos++]); i.mRelatedOpeningElement = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingBuildingElement) + "," + ParserSTEP.LinkToString(mRelatedOpeningElement); } + internal override void relate() + { + IfcElement elem = RelatingBuildingElement; + if (elem != null) + elem.mHasOpenings.Add(this); + IfcFeatureElementSubtraction es = RelatedOpeningElement; + if (es != null) + es.mVoidsElement = this; + } + } + public partial class IfcRepresentation : BaseClassIfc, IfcLayeredItem // Abstract IFC4 ,SUPERTYPE OF (ONEOF(IfcShapeModel,IfcStyleModel)); + { + private int mContextOfItems;// : IfcRepresentationContext; + internal string mRepresentationIdentifier = "$";// : OPTIONAL IfcLabel; //RepresentationIdentifier: Name of the representation, e.g. 'Body' for 3D shape, 'FootPrint' for 2D ground view, 'Axis' for reference axis, + internal string mRepresentationType = "$";// : OPTIONAL IfcLabel; + internal List mItems = new List();// : SET [1:?] OF IfcRepresentationItem; + + internal string RepresentationIdentifier { get { return mRepresentationIdentifier == "$" ? "" : mRepresentationIdentifier; } set { mRepresentationIdentifier = (string.IsNullOrEmpty(value) ? "$" : value); } } + internal string RepresentationType { get { return mRepresentationType == "$" ? "" : mRepresentationType; } set { mRepresentationType = string.IsNullOrEmpty(value) ? "$" : value; } } + //INVERSE + internal IfcRepresentationMap mRepresentationMap = null;// : SET [0:1] OF IfcRepresentationMap FOR MappedRepresentation; + internal List mLayerAssignments = new List();// new List<>();// IFC4 change : SET OF IfcPresentationLayerAssignment FOR AssignedItems; + private List mOfProductRepresentation = new List();/// IFC4 change : SET [0:n] OF IfcProductRepresentation FOR Representations; + + internal IfcRepresentationContext ContextOfItems { get { return mDatabase.mIfcObjects[mContextOfItems] as IfcRepresentationContext; } } + internal List Items { get { return mItems.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcRepresentationItem); } } + internal List OfProductRepresentation { get { return mOfProductRepresentation; } } + public List LayerAssignments { get { return mLayerAssignments; } } + + protected IfcRepresentation() : base() { } + protected IfcRepresentation(IfcRepresentation r) : base() { mContextOfItems = r.mContextOfItems; mRepresentationIdentifier = r.mRepresentationIdentifier; mRepresentationType = r.mRepresentationType; mItems = new List(r.mItems.ToArray()); } + protected IfcRepresentation(DatabaseIfc m, string identifier, string repType) : base(m) + { + RepresentationIdentifier = identifier.Replace("'", ""); + RepresentationType = repType.Replace("'", ""); + if (m.mGeomRepContxt != null) + mContextOfItems = m.mGeomRepContxt.mIndex; + if (string.Compare(identifier, "Axis", true) == 0 && m.mGeoRepSubContxtAxis != null) + mContextOfItems = m.mGeoRepSubContxtAxis.mIndex; + else if (m.mGeoRepSubContxtBody != null) + mContextOfItems = m.mGeoRepSubContxtBody.mIndex; + } + protected IfcRepresentation(IfcRepresentationItem ri) : this(ri.mDatabase,"","") { mItems.Add(ri.mIndex); } + protected IfcRepresentation(IfcRepresentationItem ri, string identifier, string repType) + : this(ri.mDatabase, identifier, repType) { mItems.Add(ri.mIndex); } + protected IfcRepresentation(List reps, string identifier, string repType) + : this(reps[0].mDatabase, identifier, repType) { mItems = reps.ConvertAll(x => x.mIndex); } + + internal static IfcRepresentation Parse(string str) + { + IfcRepresentation r = new IfcRepresentation(); + int pos = 0; + parseString(r, str, ref pos); + return r; + } + protected static void parseString(IfcRepresentation r, string str, ref int pos) + { + r.mContextOfItems = ParserSTEP.StripLink(str, ref pos); + r.mRepresentationIdentifier = ParserSTEP.StripString(str, ref pos); + r.mRepresentationType = ParserSTEP.StripString(str, ref pos); + r.mItems = ParserSTEP.StripListLink(str, ref pos); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mContextOfItems) + (mRepresentationIdentifier == "$" ? ",$," : ",'" + mRepresentationIdentifier + "',") + (mRepresentationType == "$" ? "$,(" : "'" + mRepresentationType + "',("); + if (mItems.Count > 0) + { + str += ParserSTEP.LinkToString(mItems[0]); + for (int icounter = 1; icounter < mItems.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mItems[icounter]); + } + return str + ")"; + } + internal void relate() + { + IfcRepresentationContext rc = ContextOfItems; + if (rc != null) + rc.RepresentationsInContext.Add(this); + List items = Items; + for (int icounter = 0; icounter < items.Count; icounter++) + items[icounter].mRepresents.Add(this); + } + } + public abstract partial class IfcRepresentationContext : BaseClassIfc + { + internal string mContextIdentifier = "$";// : OPTIONAL IfcLabel; + internal string mContextType = "$";// : OPTIONAL IfcLabel; + //INVERSE + private List mRepresentationsInContext = new List();// : SET OF IfcRepresentation FOR ContextOfItems; + + internal string ContextIdentifier { get { return (mContextIdentifier == "$" ? "" : ParserIfc.Decode(mContextIdentifier)); } set { mContextIdentifier = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + internal string ContextType { get { return (mContextType == "$" ? "" : ParserIfc.Decode(mContextType)); } set { mContextType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + internal List RepresentationsInContext { get { return mRepresentationsInContext; } } + + protected bool mActive = true; + internal bool Active { get { return mActive; } set { mActive = value; } } + internal bool suggestActive() + { + if (string.Compare(mContextIdentifier, "Axis", true) == 0) + return false; + if (string.Compare(mContextIdentifier, "Box", true) == 0) + return false; + if (string.Compare(mContextIdentifier, "Annotation", true) == 0) + return false; + if (string.Compare(mContextType, "Plan", true) == 0) + return false; + return mActive; + } + + protected IfcRepresentationContext() : base() { } + protected IfcRepresentationContext(IfcRepresentationContext p) : base() { mContextIdentifier = p.mContextIdentifier; mContextType = p.mContextType; } + protected IfcRepresentationContext(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcRepresentationContext c, List arrFields, ref int ipos) { c.mContextIdentifier = arrFields[ipos++].Replace("'", ""); c.mContextType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mContextIdentifier == "$" ? ",$," : ",'" + mContextIdentifier + "',") + (mContextType == "$" ? "$" : "'" + mContextType + "'"); } + } + public abstract partial class IfcRepresentationItem : BaseClassIfc, IfcLayeredItem /*(IfcGeometricRepresentationItem,IfcMappedItem,IfcStyledItem,IfcTopologicalRepresentationItem));*/ + { //INVERSE + internal List mLayerAssignments = new List();// null; + internal IfcStyledItem mStyledByItem = null;// : SET [0:1] OF IfcStyledItem FOR Item; + + internal List mRepresents = new List(); + + public List LayerAssignments { get { return mLayerAssignments; } } + + protected IfcRepresentationItem() : base() { } + protected IfcRepresentationItem(IfcRepresentationItem p) : base() { } + protected IfcRepresentationItem(DatabaseIfc m) : base(m) { } + + protected static void parseFields(IfcRepresentationItem i, List arrFields, ref int ipos) { } + protected virtual void Parse(string str, ref int ipos) { } + } + public partial class IfcRepresentationMap : BaseClassIfc, IfcProductRepresentationSelect + { + internal int mMappingOrigin;// : IfcAxis2Placement; + internal int mMappedRepresentation;// : IfcRepresentation; + //INVERSE + internal List mHasShapeAspects = new List();// : SET [0:?] OF IfcShapeAspect FOR PartOfProductDefinitionShape; + internal List mMapUsage = new List();//: SET OF IfcMappedItem FOR MappingSource; + + public IfcAxis2Placement MappingOrigin { get { return mDatabase.mIfcObjects[mMappingOrigin] as IfcAxis2Placement; } set { mMappingOrigin = value.Index; } } + public IfcRepresentation MappedRepresentation { get { return mDatabase.mIfcObjects[mMappedRepresentation] as IfcRepresentation; } set { mMappedRepresentation = value.mIndex; } } + public List HasShapeAspects { get { return mHasShapeAspects; } } + + internal List mTypeProducts = new List();// GG + + internal IfcRepresentationMap() : base() { } + internal IfcRepresentationMap(IfcRepresentationMap p) : base() { mMappingOrigin = p.mMappingOrigin; mMappedRepresentation = p.mMappedRepresentation; } + public IfcRepresentationMap(IfcRepresentationItem item) : base(item.mDatabase) { mMappingOrigin = new IfcAxis2Placement3D(item.mDatabase).mIndex; MappedRepresentation = new IfcShapeRepresentation(new List() { item }); } + public IfcRepresentationMap(IfcAxis2Placement placement, IfcRepresentation representation) : base(representation.mDatabase) { mMappingOrigin = placement.Index; mMappedRepresentation = representation.mIndex; } + + internal static IfcRepresentationMap Parse(string strDef) { IfcRepresentationMap m = new IfcRepresentationMap(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcRepresentationMap rm, List arrFields, ref int ipos) { rm.mMappingOrigin = ParserSTEP.ParseLink(arrFields[ipos++]); rm.mMappedRepresentation = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mMappingOrigin) + "," + ParserSTEP.LinkToString(mMappedRepresentation); } + + } + public abstract class IfcResource : IfcObject //ABSTRACT SUPERTYPE OF (ONEOF (IfcConstructionResource)) + { //INVERSE + internal List mResourceOf = new List();// : SET [0:?] OF IfcRelAssignsToResource FOR RelatingResource; + protected IfcResource() : base() { } + protected IfcResource(IfcResource o) : base(o) { } + protected IfcResource(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcResource r, List arrFields, ref int ipos) { IfcObject.parseFields(r, arrFields, ref ipos); } + } + public partial class IfcResourceConstraintRelationship : IfcResourceLevelRelationship // IfcPropertyConstraintRelationship; // DEPRECEATED IFC4 renamed + { + internal int mRelatingConstraint;// : IfcConstraint; + internal List mRelatedResourceObjects = new List();// : SET [1:?] OF IfcResourceObjectSelect; + + internal IfcConstraint RelatingConstraint { get { return mDatabase.mIfcObjects[mRelatingConstraint] as IfcConstraint; } } + internal List RelatedResourceObjects { get { return mRelatedResourceObjects.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcResourceObjectSelect); } } + internal IfcResourceConstraintRelationship() : base() { } + internal IfcResourceConstraintRelationship(IfcResourceConstraintRelationship o) : base(o) { mRelatingConstraint = o.mRelatingConstraint; } + public IfcResourceConstraintRelationship(string name, string description, IfcConstraint constraint, IfcResourceObjectSelect related) : this(name, description, constraint, new List() { related }) { } + public IfcResourceConstraintRelationship(string name, string description, IfcConstraint constraint, List related) : base(constraint.mDatabase, name, description) { mRelatingConstraint = constraint.mIndex; mRelatedResourceObjects = related.ConvertAll(x => x.Index); } + internal static IfcResourceConstraintRelationship Parse(string strDef, Schema schema) { IfcResourceConstraintRelationship a = new IfcResourceConstraintRelationship(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + internal static void parseFields(IfcResourceConstraintRelationship a, List arrFields, ref int ipos, Schema schema) { IfcResourceLevelRelationship.parseFields(a, arrFields, ref ipos,schema); a.mRelatingConstraint = ParserSTEP.ParseLink(arrFields[ipos++]); a.mRelatedResourceObjects = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string result = base.BuildString() + "," + ParserSTEP.LinkToString(mRelatingConstraint) + ",(#" + mRelatedResourceObjects[0]; + for (int icounter = 1; icounter < mRelatedResourceObjects.Count; icounter++) + result += ",#" + mRelatedResourceObjects[icounter]; + return result + ")"; + } + internal void relate() + { + RelatingConstraint.mPropertiesForConstraint.Add(this); + List related = RelatedResourceObjects; + for (int icounter = 0; icounter < related.Count; icounter++) + related[icounter].HasConstraintRelationships.Add(this); + } + } + public abstract class IfcResourceLevelRelationship : BaseClassIfc //IFC4 ABSTRACT SUPERTYPE OF(ONEOF(IfcApprovalRelationship, + { // IfcCurrencyRelationship, IfcDocumentInformationRelationship, IfcExternalReferenceRelationship, IfcMaterialRelationship, IfcOrganizationRelationship, IfcPropertyDependencyRelationship, IfcResourceApprovalRelationship, IfcResourceConstraintRelationship)); + internal string mName = "$";// : OPTIONAL IfcLabel + internal string mDescription = "$";// : OPTIONAL IfcText; + //INVERSE + //mHasExternalReference + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcResourceLevelRelationship() : base() { } + protected IfcResourceLevelRelationship(IfcResourceLevelRelationship r) : base() { mDescription = r.mDescription; mName = r.mName; } + protected IfcResourceLevelRelationship(DatabaseIfc m, string name, string description) : base(m) { Name = name; Description = description; } + internal static void parseFields(IfcResourceLevelRelationship a, List arrFields, ref int ipos,Schema schema) + { + if (schema != Schema.IFC2x3) + { + a.mName = arrFields[ipos++].Replace("'", ""); + a.mDescription = arrFields[ipos++].Replace("'", ""); + } + } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$" : "'" + mDescription + "'"); } + } + public partial interface IfcResourceObjectSelect : IfcInterface //IFC4 SELECT ( IfcPropertyAbstraction, IfcPhysicalQuantity, IfcAppliedValue, + { //IfcContextDependentUnit, IfcConversionBasedUnit, IfcProfileDef, IfcActorRole, IfcApproval, IfcConstraint, IfcTimeSeries, IfcMaterialDefinition, IfcPerson, IfcPersonAndOrganization, IfcOrganization, IfcExternalReference, IfcExternalInformation);); + List HasExternalReferences { get; } + List HasConstraintRelationships { get; } //gg + } + public class IfcResourceTime : IfcSchedulingTime //IFC4 + { + internal string mScheduleWork = "$";// : OPTIONAL IfcDuration; + internal double mScheduleUsage; //: OPTIONAL IfcPositiveRatioMeasure; + internal string mScheduleStart = "$", mScheduleFinish = "$";//: OPTIONAL IfcDateTime; + internal string mScheduleContour = "$";//: OPTIONAL IfcLabel; + internal string mLevelingDelay = "$";// : OPTIONAL IfcDuration; + internal bool mIsOverAllocated = false;// : OPTIONAL BOOLEAN; + internal string mStatusTime = "$";//: OPTIONAL IfcDateTime; + internal string mActualWork = "$";// : OPTIONAL IfcDuration; + internal double mActualUsage; //: OPTIONAL IfcPositiveRatioMeasure; + internal string mActualStart = "$", mActualFinish = "$";// : OPTIONAL IfcDateTime; + internal string mRemainingWork = "$";// : OPTIONAL IfcDuration; + internal double mRemainingUsage, mCompletion;// : OPTIONAL IfcPositiveRatioMeasure; + internal IfcResourceTime() : base() { } + internal IfcResourceTime(IfcResourceTime t) : base(t) + { + mScheduleWork = t.mScheduleWork; mScheduleUsage = t.mScheduleUsage; mScheduleStart = t.mScheduleStart; mScheduleFinish = t.mScheduleFinish; mScheduleContour = t.mScheduleContour; + mLevelingDelay = t.mLevelingDelay; mIsOverAllocated = t.mIsOverAllocated; mStatusTime = t.mStatusTime; mActualWork = t.mActualWork; mActualUsage = t.mActualUsage; + mActualStart = t.mActualStart; mActualFinish = t.mActualFinish; mRemainingWork = t.mRemainingWork; mRemainingUsage = t.mRemainingUsage; mCompletion = t.mCompletion; + + } + internal IfcResourceTime(DatabaseIfc m, string name, IfcDataOriginEnum orig, string userOrigin, IfcDuration schedWork, double schedUsage, DateTime schedStart, + DateTime schedFinish, string schedContour, IfcDuration levelingDelay, bool isOverAllocated, DateTime statusTime, IfcDuration actualWork, double actualUsage, + DateTime actualStart, DateTime actualFinish, IfcDuration remainingWork, double remainingUsage, double fractionComplete) + : base(m, name, orig, userOrigin) + { + if (schedWork != null) + mScheduleWork = schedWork.ToString(); + mScheduleUsage = schedUsage; + if (schedStart != DateTime.MinValue) + mScheduleStart = IfcDateTime.Convert(schedStart); + if (schedFinish != DateTime.MinValue) + mScheduleFinish = IfcDateTime.Convert(schedFinish); + if (!string.IsNullOrEmpty(schedContour)) + mScheduleContour = schedContour.Replace("'", ""); + if (levelingDelay != null) + mLevelingDelay = levelingDelay.ToString(); + mIsOverAllocated = isOverAllocated; + if (statusTime != DateTime.MinValue) + mStatusTime = IfcDateTime.Convert(statusTime); + if (actualWork != null) + mActualWork = actualWork.ToString(); + mActualUsage = actualUsage; + if (actualStart != DateTime.MinValue) + mActualStart = IfcDateTime.Convert(actualStart); + if (actualFinish != DateTime.MinValue) + mActualFinish = IfcDateTime.Convert(actualFinish); + if (remainingWork != null) + mRemainingWork = remainingWork.ToString(); + mRemainingUsage = remainingUsage; + mCompletion = fractionComplete; + } + internal static IfcResourceTime Parse(string strDef) { IfcResourceTime s = new IfcResourceTime(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcResourceTime s, List arrFields, ref int ipos) + { + IfcSchedulingTime.parseFields(s, arrFields, ref ipos); + s.mRemainingWork = arrFields[ipos++].Replace("'", ""); + s.mScheduleUsage = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mScheduleStart = arrFields[ipos++].Replace("'", ""); + s.mScheduleFinish = arrFields[ipos++].Replace("'", ""); + s.mScheduleContour = arrFields[ipos++].Replace("'", ""); + s.mLevelingDelay = arrFields[ipos++].Replace("'", ""); + s.mIsOverAllocated = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mStatusTime = arrFields[ipos++].Replace("'", ""); + s.mActualWork = arrFields[ipos++].Replace("'", ""); + s.mActualUsage = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mActualStart = arrFields[ipos++].Replace("'", ""); + s.mActualFinish = arrFields[ipos++].Replace("'", ""); + s.mRemainingWork = arrFields[ipos++].Replace("'", ""); + s.mRemainingUsage = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mCompletion = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + (mScheduleWork == "$" ? ",$," : ",'" + mScheduleWork + "',") + ParserSTEP.DoubleOptionalToString(mScheduleUsage) + (mScheduleStart == "$" ? ",$," : ",'" + mScheduleStart + "',") + + (mScheduleFinish == "$" ? "$," : "'" + mScheduleFinish + "',") + (mScheduleContour == "$" ? "$," : "'" + mScheduleContour + "',") + (mLevelingDelay == "$" ? "$," : "'" + mLevelingDelay + "',") + ParserSTEP.BoolToString(mIsOverAllocated) + + (mStatusTime == "$" ? ",$," : ",'" + mStatusTime + "',") + (mActualWork == "$" ? "$," : "'" + mActualWork + "',") + ParserSTEP.DoubleOptionalToString(mActualUsage) + (mActualStart == "$" ? ",$," : ",'" + mActualStart + "',") + + (mActualFinish == "$" ? "$," : "'" + mActualFinish + "',") + (mRemainingWork == "$" ? "$," : "'" + mRemainingWork + "',") + ParserSTEP.DoubleOptionalToString(mRemainingUsage) + "," + ParserSTEP.DoubleOptionalToString(mCompletion); + } + } + public partial class IfcRevolvedAreaSolid : IfcSweptAreaSolid + { + internal int mAxis;//: IfcAxis1Placement + internal double mAngle;// : IfcPlaneAngleMeasure; + + public IfcAxis1Placement Axis { get { return mDatabase.mIfcObjects[mAxis] as IfcAxis1Placement; } set { mAxis = value.mIndex; } } + public double Angle { get { return mAngle; } set { mAngle = value; } } + + internal IfcRevolvedAreaSolid() : base() { } + internal IfcRevolvedAreaSolid(IfcRevolvedAreaSolid s) : base(s) { mAxis = s.mAxis; mAngle = s.mAngle; } + public IfcRevolvedAreaSolid(IfcProfileDef profile, IfcAxis2Placement3D pl, IfcAxis1Placement axis, double angle) : base(profile, pl) { Axis = axis; mAngle = angle; } + + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mAxis) + "," + ParserSTEP.DoubleToString(mAngle); } + internal static void parseFields(IfcRevolvedAreaSolid r, List arrFields, ref int ipos) + { + IfcSweptAreaSolid.parseFields(r, arrFields, ref ipos); + r.mAxis = ParserSTEP.ParseLink(arrFields[ipos++]); + string str = arrFields[ipos]; + if (arrFields[ipos].StartsWith("IfcPlaneAngleMeasure(", true, System.Globalization.CultureInfo.CurrentCulture)) + r.mAngle = ParserSTEP.ParseDouble(str.Substring(21, str.Length - 22)); + else + r.mAngle = ParserSTEP.ParseDouble(str); + } + internal static IfcRevolvedAreaSolid Parse(string strDef) { IfcRevolvedAreaSolid r = new IfcRevolvedAreaSolid(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + } + //ENTITY IfcRevolvedAreaSolidTapered + public class IfcRibPlateProfileProperties : IfcProfileProperties // DEPRECEATED IFC4 + { + internal double mThickness, mRibHeight, mRibWidth, mRibSpacing;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcRibPlateDirectionEnum mDirection;// : IfcRibPlateDirectionEnum;*/ + internal IfcRibPlateProfileProperties() : base() { } + internal IfcRibPlateProfileProperties(IfcRibPlateProfileProperties p) : base(p) + { + mThickness = p.mThickness; + mRibHeight = p.mRibHeight; + mRibWidth = p.mRibWidth; + mRibSpacing = p.mRibSpacing; + mDirection = p.mDirection; + } + internal new static IfcRibPlateProfileProperties Parse(string strDef,Schema schema) { IfcRibPlateProfileProperties p = new IfcRibPlateProfileProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcRibPlateProfileProperties p, List arrFields, ref int ipos,Schema schema) + { + IfcProfileProperties.parseFields(p, arrFields, ref ipos,schema); + p.mThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mRibHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mRibWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mRibSpacing = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mDirection = (IfcRibPlateDirectionEnum)Enum.Parse(typeof(IfcRibPlateDirectionEnum), arrFields[ipos++].Replace(".", "")); + } + } + public partial class IfcRightCircularCone : IfcCsgPrimitive3D + { + internal double mHeight;// : IfcPositiveLengthMeasure; + internal double mBottomRadius;// : IfcPositiveLengthMeasure; + internal IfcRightCircularCone() : base() { } + internal IfcRightCircularCone(IfcRightCircularCone c) : base(c) { mHeight = c.mHeight; mBottomRadius = c.mBottomRadius; } + internal static void parseFields(IfcRightCircularCone c, List arrFields, ref int ipos) { IfcCsgPrimitive3D.parseFields(c, arrFields, ref ipos); c.mHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mBottomRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcRightCircularCone Parse(string strDef) { IfcRightCircularCone c = new IfcRightCircularCone(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mHeight) + "," + ParserSTEP.DoubleToString(mBottomRadius); } + } + public partial class IfcRightCircularCylinder : IfcCsgPrimitive3D + { + internal double mHeight;// : IfcPositiveLengthMeasure; + internal double mRadius;// : IfcPositiveLengthMeasure; + internal IfcRightCircularCylinder() : base() { } + internal IfcRightCircularCylinder(IfcRightCircularCylinder c) : base(c) { mHeight = c.mHeight; mRadius = c.mRadius; } + + internal static void parseFields(IfcRightCircularCylinder c, List arrFields, ref int ipos) { IfcCsgPrimitive3D.parseFields(c, arrFields, ref ipos); c.mHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcRightCircularCylinder Parse(string strDef) { IfcRightCircularCylinder c = new IfcRightCircularCylinder(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mHeight) + "," + ParserSTEP.DoubleToString(mRadius); } + } + public partial class IfcRoof : IfcBuildingElement + { + internal IfcRoofTypeEnum mPredefinedType = IfcRoofTypeEnum.NOTDEFINED;// OPTIONAL : IfcRoofTypeEnum; + public IfcRoofTypeEnum PredefinedType { get { return mPredefinedType; } } + + internal IfcRoof() : base() { } + internal IfcRoof(IfcRoof r) : base(r) { mPredefinedType = r.mPredefinedType; } + public IfcRoof(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcRoof Parse(string strDef) { IfcRoof r = new IfcRoof(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcRoof r, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(r, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcRoofTypeEnum)Enum.Parse(typeof(IfcRoofTypeEnum), str.Substring(1, str.Length - 2)); + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcRoofType : IfcBuildingElementType //IFC4 + { + internal IfcRoofTypeEnum mPredefinedType = IfcRoofTypeEnum.NOTDEFINED; + public IfcRoofTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcRoofType() : base() { } + internal IfcRoofType(IfcRoofType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcRoofType(DatabaseIfc m, string name, IfcRoofTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + + internal static void parseFields(IfcRoofType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcRoofTypeEnum)Enum.Parse(typeof(IfcRoofTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcRoofType Parse(string strDef) { IfcRoofType t = new IfcRoofType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcRoot : BaseClassIfc//ABSTRACT SUPERTYPE OF (ONEOF (IfcObjectDefinition ,IfcPropertyDefinition ,IfcRelationship)); + { + private string mGlobalId; // : IfcGloballyUniqueId; + private int mOwnerHistory;// : IFC4 OPTIONAL IfcOwnerHistory; + private string mName = "$"; //: OPTIONAL IfcLabel; + private string mDescription = "$"; //: OPTIONAL IfcText; + + public string GlobalId + { + get { return mGlobalId; } + set + { + if (ParserIfc.DecodeGlobalID(value) != Guid.Empty && !mDatabase.mGlobalIDs.Contains(value)) + { + mDatabase.mGlobalIDs.Remove(mGlobalId); + mGlobalId = value; + mDatabase.mGlobalIDs.Add(value); + } + } + } + public Guid Guid + { + get { return ParserIfc.DecodeGlobalID(mGlobalId); } + set + { + string id = ParserIfc.EncodeGuid(value == Guid.Empty ? Guid.NewGuid() : value); + if (!mDatabase.mGlobalIDs.Contains(id)) + { + mDatabase.mGlobalIDs.Remove(mGlobalId); + GlobalId = id; + mDatabase.mGlobalIDs.Add(id); + } + } + } + internal IfcOwnerHistory OwnerHistory { get { return mDatabase.mIfcObjects[mOwnerHistory] as IfcOwnerHistory; } set { mOwnerHistory = (value == null ? 0 : value.mIndex); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcRoot() : base() { mGlobalId = ParserIfc.EncodeGuid(Guid.NewGuid()); } + protected IfcRoot(IfcRoot r) : base(r) { mGlobalId = r.mGlobalId; mOwnerHistory = r.mOwnerHistory; mName = r.mName; mDescription = r.mDescription; } + protected IfcRoot(DatabaseIfc m) : base(m) + { + mGlobalId = ParserIfc.EncodeGuid(Guid.NewGuid()); + //m.mGlobalIDs.Add(mGlobalId); + if (m.mModelView != ModelView.Ifc4Reference) + OwnerHistory = m.OwnerHistory(IfcChangeActionEnum.ADDED); + } + protected static void parseFields(IfcRoot root, List arrFields, ref int ipos) + { + root.mGlobalId = arrFields[ipos++].Replace("'", ""); + root.mOwnerHistory = ParserSTEP.ParseLink(arrFields[ipos++]); + root.mName = arrFields[ipos++].Replace("'", ""); + root.mDescription = arrFields[ipos++].Replace("'", ""); + } + protected virtual void parseString(string str, ref int pos) + { + mGlobalId = ParserSTEP.StripString(str, ref pos); + mOwnerHistory = ParserSTEP.StripLink(str, ref pos); + mName = ParserSTEP.StripString(str, ref pos); + mDescription = ParserSTEP.StripString(str, ref pos); + } + protected override string BuildString() { return base.BuildString() + ",'" + mGlobalId + (mOwnerHistory == 0 ? "',$" : "',#" + mOwnerHistory) + (mName == "$" ? ",$," : ",'" + mName + "',") + (mDescription == "$" ? "$" : "'" + mDescription + "'"); } + } + public class IfcRotationalStiffnessSelect + { + internal bool mRigid = false; + internal IfcRotationalStiffnessMeasure mStiffness = null; + public IfcRotationalStiffnessSelect(bool fix) { mRigid = fix; } + internal IfcRotationalStiffnessSelect(double stiff) { mStiffness = new IfcRotationalStiffnessMeasure(stiff); } + internal IfcRotationalStiffnessSelect(IfcRotationalStiffnessMeasure stiff) { mStiffness = stiff; } + internal static IfcRotationalStiffnessSelect Parse(string str, Schema schema) + { + if (str.StartsWith("IFCBOOL")) + return new IfcRotationalStiffnessSelect(((IfcBoolean)ParserIfc.parseSimpleValue(str)).mValue); + if (str.StartsWith("IFCROT")) + return new IfcRotationalStiffnessSelect((IfcRotationalStiffnessMeasure)ParserIfc.parseDerivedMeasureValue(str)); + if (str.StartsWith(".")) + return new IfcRotationalStiffnessSelect(ParserSTEP.ParseBool(str)); + double d = ParserSTEP.ParseDouble(str), tol = 1e-9; + if (schema == Schema.IFC2x3) + { + if (Math.Abs(d + 1) < tol) + return new IfcRotationalStiffnessSelect(true) { mStiffness = new IfcRotationalStiffnessMeasure(-1) }; + if (Math.Abs(d) < tol) + return new IfcRotationalStiffnessSelect(false) { mStiffness = new IfcRotationalStiffnessMeasure(0) }; + } + return new IfcRotationalStiffnessSelect(new IfcRotationalStiffnessMeasure(d)); + } + public override string ToString() { return (mStiffness == null ? "IFCBOOLEAN(" + ParserSTEP.BoolToString(mRigid) + ")" : mStiffness.ToString()); } + } + //ENTITY IfcRoundedEdgeFeature // DEPRECEATED IFC4 + public partial class IfcRoundedRectangleProfileDef : IfcRectangleProfileDef + { + internal double mRoundingRadius;// : IfcPositiveLengthMeasure; + internal IfcRoundedRectangleProfileDef() : base() { } + internal IfcRoundedRectangleProfileDef(IfcRoundedRectangleProfileDef c) : base(c) { mRoundingRadius = c.mRoundingRadius; } + public IfcRoundedRectangleProfileDef(DatabaseIfc m, string name, double h, double b, double r) : base(m, name, h, b) { mRoundingRadius = r; } + internal static void parseFields(IfcRoundedRectangleProfileDef p, List arrFields, ref int ipos) { IfcRectangleProfileDef.parseFields(p, arrFields, ref ipos); p.mRoundingRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal new static IfcRoundedRectangleProfileDef Parse(string strDef) { IfcRoundedRectangleProfileDef p = new IfcRoundedRectangleProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mRoundingRadius); } + } +} diff --git a/IFC/IFC S.cs b/IFC/IFC S.cs new file mode 100644 index 0000000..47c1a1d --- /dev/null +++ b/IFC/IFC S.cs @@ -0,0 +1,2374 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcSanitaryTerminal : IfcFlowTerminal + { + internal IfcSanitaryTerminalTypeEnum mPredefinedType = IfcSanitaryTerminalTypeEnum.NOTDEFINED;// : OPTIONAL IfcSanitaryTerminalTypeEnum; + public IfcSanitaryTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcSanitaryTerminal() : base() { } + internal IfcSanitaryTerminal(IfcSanitaryTerminal t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcSanitaryTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcSanitaryTerminal t, List arrFields, ref int ipos) { IfcFlowTerminal.parseFields(t, arrFields, ref ipos); string s = arrFields[ipos++]; if (s[0] == '.') t.mPredefinedType = (IfcSanitaryTerminalTypeEnum)Enum.Parse(typeof(IfcSanitaryTerminalTypeEnum), s.Substring(1, s.Length - 2)); } + internal new static IfcSanitaryTerminal Parse(string strDef) { IfcSanitaryTerminal t = new IfcSanitaryTerminal(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcSanitaryTerminalTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcSanitaryTerminalType : IfcFlowTerminalType + { + internal IfcSanitaryTerminalTypeEnum mPredefinedType = IfcSanitaryTerminalTypeEnum.NOTDEFINED;// : IfcSanitaryTerminalTypeEnum; + public IfcSanitaryTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSanitaryTerminalType() : base() { } + internal IfcSanitaryTerminalType(IfcSanitaryTerminalType be) : base(be) { mPredefinedType = be.mPredefinedType; } + public IfcSanitaryTerminalType(DatabaseIfc m, string name, IfcSanitaryTerminalTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcSanitaryTerminalType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSanitaryTerminalTypeEnum)Enum.Parse(typeof(IfcSanitaryTerminalTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSanitaryTerminalType Parse(string strDef) { IfcSanitaryTerminalType t = new IfcSanitaryTerminalType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcScheduleTimeControl : IfcControl // DEPRECEATED IFC4 + { + internal int mActualStart, mEarlyStart, mLateStart, mScheduleStart, mActualFinish, mEarlyFinish, mLateFinish, mScheduleFinish;// OPTIONAL IfcDateTimeSelect; + internal double mScheduleDuration, mActualDuration, mRemainingTime, mFreeFloat, mTotalFloat;// OPTIONAL IfcTimeMeasure; + internal bool mIsCritical;// : OPTIONAL BOOLEAN; + internal int mStatusTime;// : OPTIONAL IfcDateTimeSelect + internal double mStartFloat, mFinishFloat;// OPTIONAL IfcTimeMeasure; + internal double mCompletion;// : OPTIONAL IfcPositiveRatioMeasure; + //INVERSE + internal IfcRelAssignsTasks mScheduleTimeControlAssigned = null;// : IfcRelAssignsTasks FOR TimeForTask; + + + internal IfcScheduleTimeControl() : base() { } + internal IfcScheduleTimeControl(IfcScheduleTimeControl c) : base(c) + { + mActualStart = c.mActualStart; mEarlyStart = c.mEarlyStart; mLateStart = c.mLateStart; mScheduleStart = c.mScheduleStart; + mActualFinish = c.mActualFinish; mEarlyFinish = c.mEarlyFinish; mLateFinish = c.mLateFinish; mScheduleFinish = c.mScheduleFinish; + mScheduleDuration = c.mScheduleDuration; mActualDuration = c.mActualDuration; mRemainingTime = c.mRemainingTime; mFreeFloat = c.mFreeFloat; + mTotalFloat = c.mTotalFloat; mIsCritical = c.mIsCritical; mStatusTime = c.mStatusTime; mStartFloat = c.mStartFloat; mFinishFloat = c.mFinishFloat; mCompletion = c.mCompletion; + } + + internal static IfcScheduleTimeControl Parse(string strDef, Schema schema) { IfcScheduleTimeControl s = new IfcScheduleTimeControl(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return s; } + internal static void parseFields(IfcScheduleTimeControl s, List arrFields, ref int ipos, Schema schema) + { + IfcControl.parseFields(s, arrFields, ref ipos,schema); + s.mActualStart = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mEarlyStart = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mLateStart = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mScheduleStart = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mActualFinish = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mEarlyFinish = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mLateFinish = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mScheduleFinish = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mScheduleDuration = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mActualDuration = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mRemainingTime = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mFreeFloat = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mTotalFloat = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mIsCritical = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mStatusTime = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mStartFloat = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mFinishFloat = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mCompletion = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.LinkToString(mActualStart) + "," + ParserSTEP.LinkToString(mEarlyStart) + "," + ParserSTEP.LinkToString(mLateStart) + "," + + ParserSTEP.LinkToString(mScheduleStart) + "," + ParserSTEP.LinkToString(mActualFinish) + "," + ParserSTEP.LinkToString(mEarlyFinish) + "," + ParserSTEP.LinkToString(mLateFinish) + "," + ParserSTEP.LinkToString(mScheduleFinish) + "," + + ParserSTEP.DoubleOptionalToString(mScheduleDuration) + "," + ParserSTEP.DoubleOptionalToString(mActualDuration) + "," + ParserSTEP.DoubleOptionalToString(mRemainingTime) + "," + ParserSTEP.DoubleOptionalToString(mFreeFloat) + "," + ParserSTEP.DoubleOptionalToString(mTotalFloat) + "," + ParserSTEP.BoolToString(mIsCritical) + "," + ParserSTEP.LinkToString(mStatusTime) + "," + + ParserSTEP.DoubleOptionalToString(mStartFloat) + "," + ParserSTEP.DoubleOptionalToString(mFinishFloat) + "," + ParserSTEP.DoubleOptionalToString(mCompletion); //(mScheduleTimeControlAssigned == null ? "" : + } + internal DateTime getActualStart() { IfcDateTimeSelect dts = mDatabase.mIfcObjects[mActualStart] as IfcDateTimeSelect; return (dts == null ? DateTime.MinValue : dts.DateTime); } + internal DateTime getActualFinish() { IfcDateTimeSelect dts = mDatabase.mIfcObjects[mActualFinish] as IfcDateTimeSelect; return (dts == null ? DateTime.MinValue : dts.DateTime); } + internal DateTime getScheduleStart() { IfcDateTimeSelect dts = mDatabase.mIfcObjects[mScheduleStart] as IfcDateTimeSelect; return (dts == null ? DateTime.MinValue : dts.DateTime); } + internal DateTime getScheduleFinish() { IfcDateTimeSelect dts = mDatabase.mIfcObjects[mScheduleFinish] as IfcDateTimeSelect; return (dts == null ? DateTime.MinValue : dts.DateTime); } + internal TimeSpan getScheduleDuration() { return new TimeSpan(0, 0, (int)mScheduleDuration); } + } + public abstract class IfcSchedulingTime : BaseClassIfc // ABSTRACT SUPERTYPE OF(ONEOF(IfcEventTime, IfcLagTime, IfcResourceTime, IfcTaskTime, IfcWorkTime)); + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal IfcDataOriginEnum mDataOrigin = IfcDataOriginEnum.NOTDEFINED;// OPTIONAL : IfcDataOriginEnum; + internal string mUserDefinedDataOrigin = "$";//: OPTIONAL IfcLabel; + protected IfcSchedulingTime() : base() { } + protected IfcSchedulingTime(IfcSchedulingTime i) : base() { mName = i.mName; mDataOrigin = i.mDataOrigin; mUserDefinedDataOrigin = i.mUserDefinedDataOrigin; } + protected IfcSchedulingTime(DatabaseIfc m, string name, IfcDataOriginEnum origin, string userOrigin) + : base(m) + { + if (!string.IsNullOrEmpty(name)) + mName = name.Replace("'", ""); + mDataOrigin = origin; + if (!string.IsNullOrEmpty(userOrigin)) + mUserDefinedDataOrigin = userOrigin.Replace("'", ""); + } + internal static void parseFields(IfcSchedulingTime p, List arrFields, ref int ipos) + { + p.mName = arrFields[ipos++]; + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + p.mDataOrigin = (IfcDataOriginEnum)Enum.Parse(typeof(IfcDataOriginEnum), s.Replace(".", "")); + p.mUserDefinedDataOrigin = arrFields[ipos++]; + } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$,." : ",'" + mName + "',.") + mDataOrigin.ToString() + (mUserDefinedDataOrigin == "$" ? ".,$" : ".,'" + mUserDefinedDataOrigin + "'"); } + } + public partial class IfcSectionedSpine : IfcGeometricRepresentationItem + { + internal int mSpineCurve;// : IfcCompositeCurve; + internal List mCrossSections = new List();// : LIST [2:?] OF IfcProfileDef; + internal List mCrossSectionPositions = new List();// : LIST [2:?] OF IfcAxis2Placement3D; + + internal IfcCompositeCurve SpineCurve { get { return mDatabase.mIfcObjects[mSpineCurve] as IfcCompositeCurve; } } + internal List CrossSections { get { return mCrossSections.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcProfileDef); } } + internal List CrossSectionPositions { get { return mCrossSectionPositions.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcAxis2Placement3D); } } + + internal IfcSectionedSpine() : base() { } + internal IfcSectionedSpine(IfcSectionedSpine p) : base(p) { mSpineCurve = p.mSpineCurve; mCrossSections = new List(p.mCrossSections.ToArray()); mCrossSectionPositions = new List(p.mCrossSectionPositions.ToArray()); } + internal static void parseFields(IfcSectionedSpine s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); s.mSpineCurve = ParserSTEP.ParseLink(arrFields[ipos++]); s.mCrossSections = ParserSTEP.SplitListLinks(arrFields[ipos++]); s.mCrossSectionPositions = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcSectionedSpine Parse(string strDef) { IfcSectionedSpine s = new IfcSectionedSpine(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mSpineCurve) + ",(" + + ParserSTEP.LinkToString(mCrossSections[0]); + for (int icounter = 1; icounter < mCrossSections.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mCrossSections[icounter]); + str += "),(" + ParserSTEP.LinkToString(mCrossSectionPositions[0]); + for (int icounter = 1; icounter < mCrossSectionPositions.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mCrossSectionPositions[icounter]); + return str + ")"; + } + } + public class IfcSectionProperties : IfcPreDefinedProperties // IFC2x3 STPEntity + { + internal IfcSectionTypeEnum mSectionType;// : IfcSectionTypeEnum; + internal int mStartProfile;// IfcProfileDef; + internal int mEndProfile;// : OPTIONAL IfcProfileDef; + internal IfcSectionProperties() : base() { } + internal IfcSectionProperties(IfcSectionProperties i) : base() { mSectionType = i.mSectionType; mStartProfile = i.mStartProfile; mEndProfile = i.mEndProfile; } + internal static IfcSectionProperties Parse(string strDef) { IfcSectionProperties p = new IfcSectionProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcSectionProperties p, List arrFields, ref int ipos) { p.mSectionType = (IfcSectionTypeEnum)Enum.Parse(typeof(IfcSectionTypeEnum), arrFields[ipos++].Replace(".", "")); p.mStartProfile = ParserSTEP.ParseLink(arrFields[ipos++]); p.mEndProfile = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + ",." + mSectionType.ToString() + ".," + ParserSTEP.LinkToString(mStartProfile) + "," + ParserSTEP.LinkToString(mEndProfile); } + } + public class IfcSectionReinforcementProperties : IfcPreDefinedProperties // IFC2x3 STPEntity + { + internal double mLongitudinalStartPosition;// : IfcLengthMeasure; + internal double mLongitudinalEndPosition;// : IfcLengthMeasure; + internal double mTransversePosition = 0;// : OPTIONAL IfcLengthMeasure; + internal IfcReinforcingBarRoleEnum mReinforcementRole = IfcReinforcingBarRoleEnum.NOTDEFINED;// : IfcReinforcingBarRoleEnum; + internal int mSectionDefinition;// : IfcSectionProperties; + internal List mCrossSectionReinforcementDefinitions = new List();// : SET [1:?] OF IfcReinforcementBarProperties; + internal IfcSectionReinforcementProperties() : base() { } + internal IfcSectionReinforcementProperties(IfcSectionReinforcementProperties i) + : base() + { + mLongitudinalStartPosition = i.mLongitudinalStartPosition; + mLongitudinalEndPosition = i.mLongitudinalEndPosition; + mTransversePosition = i.mTransversePosition; + mReinforcementRole = i.mReinforcementRole; + mSectionDefinition = i.mSectionDefinition; + mCrossSectionReinforcementDefinitions = new List(i.mCrossSectionReinforcementDefinitions); + } + internal static IfcSectionReinforcementProperties Parse(string strDef) { IfcSectionReinforcementProperties p = new IfcSectionReinforcementProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcSectionReinforcementProperties p, List arrFields, ref int ipos) + { + p.mLongitudinalStartPosition = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLongitudinalEndPosition = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTransversePosition = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mReinforcementRole = (IfcReinforcingBarRoleEnum)Enum.Parse(typeof(IfcReinforcingBarRoleEnum), arrFields[ipos++].Replace(".", "")); + p.mSectionDefinition = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mCrossSectionReinforcementDefinitions = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string result = base.BuildString() + "," + ParserSTEP.DoubleToString(mLongitudinalStartPosition) + "," + ParserSTEP.DoubleToString(mLongitudinalEndPosition) + "," + + ParserSTEP.DoubleOptionalToString(mTransversePosition) + ",." + mReinforcementRole.ToString() + ".," + ParserSTEP.LinkToString(mSectionDefinition) + ",(" + ParserSTEP.LinkToString(mCrossSectionReinforcementDefinitions[0]); + for (int icounter = 1; icounter < mCrossSectionReinforcementDefinitions.Count; icounter++) + result += ",#" + mCrossSectionReinforcementDefinitions; + return result + ")"; + } + } + public interface IfcSegmentIndexSelect { } //SELECT ( IfcLineIndex, IfcArcIndex); + public class IfcSensor : IfcDistributionControlElement //IFC4 + { + internal IfcSensorTypeEnum mPredefinedType = IfcSensorTypeEnum.NOTDEFINED; + public IfcSensorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcSensor() : base() { } + internal IfcSensor(IfcSensor s) : base(s) { mPredefinedType = s.mPredefinedType; } + internal IfcSensor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcSensor a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcSensorTypeEnum)Enum.Parse(typeof(IfcSensorTypeEnum), s.Replace(".", "")); + } + internal new static IfcSensor Parse(string strDef) { IfcSensor d = new IfcSensor(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcSensorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcSensorType : IfcDistributionControlElementType + { + internal IfcSensorTypeEnum mPredefinedType = IfcSensorTypeEnum.NOTDEFINED;// : IfcSensorTypeEnum; + public IfcSensorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcSensorType() : base() { } + internal IfcSensorType(IfcSensorType be) : base(be) { mPredefinedType = be.mPredefinedType; } + public IfcSensorType(DatabaseIfc m, string name, IfcSensorTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcSensorType t, List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSensorTypeEnum)Enum.Parse(typeof(IfcSensorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSensorType Parse(string strDef) { IfcSensorType t = new IfcSensorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcServiceLife // DEPRECEATED IFC4 + //ENTITY IfcServiceLifeFactor // DEPRECEATED IFC4 + public partial class IfcShadingDevice : IfcBuildingElement + { + internal IfcShadingDeviceTypeEnum mPredefinedType = IfcShadingDeviceTypeEnum.NOTDEFINED;//: OPTIONAL IfcShadingDeviceTypeEnum; + public IfcShadingDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcShadingDevice() : base() { } + internal IfcShadingDevice(IfcShadingDevice d) : base(d) { mPredefinedType = d.mPredefinedType; } + public IfcShadingDevice(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcShadingDevice Parse(string strDef, Schema schema) { IfcShadingDevice w = new IfcShadingDevice(); int ipos = 0; parseFields(w, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return w; } + internal static void parseFields(IfcShadingDevice w, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(w, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + w.mPredefinedType = (IfcShadingDeviceTypeEnum)Enum.Parse(typeof(IfcShadingDeviceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcShadingDeviceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcShadingDeviceType : IfcBuildingElementType + { + internal IfcShadingDeviceTypeEnum mPredefinedType = IfcShadingDeviceTypeEnum.NOTDEFINED; + public IfcShadingDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcShadingDeviceType() : base() { } + internal IfcShadingDeviceType(IfcShadingDeviceType b) : base(b) { mPredefinedType = b.mPredefinedType; } + public IfcShadingDeviceType(DatabaseIfc m, string name, IfcShadingDeviceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + + internal static void parseFields(IfcShadingDeviceType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcShadingDeviceTypeEnum)Enum.Parse(typeof(IfcShadingDeviceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcShadingDeviceType Parse(string strDef) { IfcShadingDeviceType t = new IfcShadingDeviceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcShapeAspect : BaseClassIfc + { + internal List mShapeRepresentations = new List();// : LIST [1:?] OF IfcShapeModel; + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + private IfcLogicalEnum mProductDefinitional;// : LOGICAL; + internal int mPartOfProductDefinitionShape;// IFC4 OPTIONAL IfcProductRepresentationSelect IFC2x3 IfcProductRepresentationSelect; + + public List ShapeRepresentations { get { return mShapeRepresentations.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcShapeModel); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcLogicalEnum ProductDefinitional { get { return mProductDefinitional; } set { mProductDefinitional = value; } } + public IfcProductRepresentationSelect PartOfProductDefinitionShape { get { return mDatabase.mIfcObjects[mPartOfProductDefinitionShape] as IfcProductRepresentationSelect; } } + + internal IfcShapeAspect() : base() { } + internal IfcShapeAspect(IfcShapeAspect a) : base() + { + mShapeRepresentations = new List(a.mShapeRepresentations.ToArray()); + mName = a.mName; + mDescription = a.mDescription; + mProductDefinitional = a.mProductDefinitional; + mPartOfProductDefinitionShape = a.mPartOfProductDefinitionShape; + } + public IfcShapeAspect(List reps, string name, string desc, IfcProductRepresentationSelect pr) + : this(reps[0].mDatabase, name, desc, pr) { mShapeRepresentations = reps.ConvertAll(x => x.mIndex); } + public IfcShapeAspect(IfcShapeModel rep, string name, string desc, IfcProductRepresentationSelect pr) + : this(rep.mDatabase, name, desc, pr) { mShapeRepresentations.Add(rep.mIndex); } + private IfcShapeAspect(DatabaseIfc db, string name, string desc, IfcProductRepresentationSelect pr) : base(db) + { + Name = name; + Description = desc; + if (pr != null) + mPartOfProductDefinitionShape = pr.Index; + } + internal static IfcShapeAspect Parse(string strDef) { IfcShapeAspect a = new IfcShapeAspect(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcShapeAspect a, List arrFields, ref int ipos) + { + a.mShapeRepresentations = ParserSTEP.SplitListLinks(arrFields[ipos++]); + + a.mName = arrFields[ipos++].Replace("'", ""); + a.mDescription = arrFields[ipos++].Replace("'", ""); + a.mProductDefinitional = ParserIfc.ParseIFCLogical(arrFields[ipos++]); + a.mPartOfProductDefinitionShape = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mShapeRepresentations[0]); + for (int icounter = 1; icounter < mShapeRepresentations.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mShapeRepresentations[icounter]); + return str + (mName == "$" ? "),$," : "),'" + mName + "',") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + ParserIfc.LogicalToString(mProductDefinitional) + + "," + ParserSTEP.LinkToString(mPartOfProductDefinitionShape); + } + internal void relate() + { + List sms = ShapeRepresentations; + for (int icounter = 0; icounter < sms.Count; icounter++) + sms[icounter].mOfShapeAspect = this; + + IfcProductRepresentationSelect pds = PartOfProductDefinitionShape; + if (pds != null) + pds.HasShapeAspects.Add(this); + } + } + public abstract class IfcShapeModel : IfcRepresentation//ABSTRACT SUPERTYPE OF (ONEOF (IfcShapeRepresentation,IfcTopologyRepresentation)) + { + //INVERSE + internal IfcShapeAspect mOfShapeAspect = null; //: SET [0:1] OF IfcShapeAspect FOR ShapeRepresentations; + + protected IfcShapeModel() : base() { } + protected IfcShapeModel(IfcShapeModel i) : base(i) { } + protected IfcShapeModel(IfcRepresentationItem ri, string identifier, string repType) : base(ri, identifier, repType) { } + protected IfcShapeModel(List reps, string identifier, string repType) : base(reps, identifier, repType) { } + protected static void parseString(IfcShapeModel shape, string str, ref int pos) { IfcRepresentation.parseString(shape, str, ref pos); } + } + public partial class IfcShapeRepresentation : IfcShapeModel + { + /*Curve2D 2 dimensional curve +Curve3D 3 dimensional curve +Surface2D 2 dimensional surface (a region on ground view) +Surface3D 3 dimensional surface +GeometricSet points, curves, surfaces (2 or 3 dimensional) + GeometricCurveSet points, curves (2 or 3 dimensional) +Annotation2D points, curves (2 or 3 dimensional), hatches and text (2 dimensional) +SurfaceModel face based and shell based surface model +SolidModel including swept solid, Boolean results and Brep bodies +more specific types are: + SweptSolid swept area solids, by extrusion and revolution, excluding tapered sweeps + AdvancedSweptSolid swept area solids created by sweeping a profile aint a directrix, and tapered sweeps + Brep faceted Brep's with and without voids + AdvancedBrep Brep's based on advanced faces, with b-spline surface geometry, with and without voids + CSG Boolean results of operations between solid models, half spaces and Boolean results + Clipping Boolean differences between swept area solids, half spaces and Boolean results +additional types some additional representation types are given: + BoundingBox simplistic 3D representation by a bounding box + SectionedSpine cross section based representation of a spine curve and planar cross sections. It can represent a surface or a solid and the interpolations of the between the cross sections is not defined + MappedRepresentation*/ + internal IfcShapeRepresentation() : base() { } + internal IfcShapeRepresentation(IfcShapeRepresentation p) : base(p) { } + public IfcShapeRepresentation(IfcGeometricRepresentationItem representation) : base(representation, "Body", "") { setIdentifiers(representation); } + public IfcShapeRepresentation(List items) : base(items, "Body", "") { setIdentifiers(items[0]); } + public IfcShapeRepresentation(IfcAdvancedBrep ab) : base(ab, "Body", "AdvancedBrep") { } + public IfcShapeRepresentation(IfcBooleanResult br) + : base(br, "Body", "CSG") + { + IfcBooleanClippingResult bcr = br as IfcBooleanClippingResult; + if (bcr != null) + mRepresentationType = "Clipping"; + } + + public IfcShapeRepresentation(IfcCsgPrimitive3D cg) : base(cg, "Body", "CSG") { } + public IfcShapeRepresentation(IfcCsgSolid cg) : base(cg, "Body", "CSG") { } + //should remove above as in 3d?? hierarchy test + public IfcShapeRepresentation(IfcFacetedBrep fb) : base(fb, "Body", "Brep") { } + public IfcShapeRepresentation(IfcFaceBasedSurfaceModel sm) : base(sm, "Body", "SurfaceModel") { } + public IfcShapeRepresentation(IfcGeometricSet gs) : base(gs, "Body", "GeometricSet") { } + public IfcShapeRepresentation(IfcMappedItem mi) : base(mi, "Body", "MappedRepresentation") { } + public IfcShapeRepresentation(IfcPoint p) : base(p, "", "Point") { } + //internal IfcShapeRepresentation(IfcRepresentationMap rm) : base(new IfcMappedItem(rm), "Model", "MappedRepresentation") { } + public IfcShapeRepresentation(IfcSectionedSpine ss) : base(ss, "Body", "SectionedSpine") + { + if (ss.mCrossSections.Count > 0) + { + IfcProfileDef pd = mDatabase.mIfcObjects[ss.mCrossSections[0]] as IfcProfileDef; + if (pd.mProfileType == IfcProfileTypeEnum.CURVE) + mRepresentationIdentifier = "Surface3D"; + } + } + public IfcShapeRepresentation(IfcShellBasedSurfaceModel sm) : base(sm, "Body", "SurfaceModel") { } + public IfcShapeRepresentation(IfcSurface s) : base(s, "Surface", "Surface3D") { } + public IfcShapeRepresentation(IfcSweptAreaSolid sm) : base(sm, "Body", "SweptSolid") { } + public IfcShapeRepresentation(IfcSweptDiskSolid sm) : base(sm, "Body", "AdvancedSweptSolid") { } + public IfcShapeRepresentation(IfcSolidModel sm) : base(sm, "Body", "SweptSolid") + { + //ABSTRACT SUPERTYPE OF (ONEOF(IfcCsgSolid ,IfcManifoldSolidBrep,IfcSweptAreaSolid,IfcSweptDiskSolid)) + IfcCsgSolid cs = sm as IfcCsgSolid; + if (cs != null) + mRepresentationType = "CSG"; + else + { + IfcManifoldSolidBrep msb = sm as IfcManifoldSolidBrep; + if (msb != null) + mRepresentationType = "Brep"; + else + { + IfcAdvancedBrep ab = sm as IfcAdvancedBrep; + if (ab != null) + mRepresentationType = "AdvancedBrep"; + } + } + + } + public IfcShapeRepresentation(IfcTessellatedItem ti) : base(ti, "Body", "Tessellation") { } //Tessellation + public IfcShapeRepresentation(List reps) : base(reps.ConvertAll(x => (IfcRepresentationItem)x), "Body", "MappedRepresentation") { } + + internal new static IfcShapeRepresentation Parse(string strDef) + { + IfcShapeRepresentation r = new IfcShapeRepresentation(); + int pos = 0; + IfcShapeModel.parseString(r, strDef, ref pos); + return r; + } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString()); } + + internal static IfcShapeRepresentation CreateRepresentation(IfcRepresentationItem ri) + { + if (ri == null) + return null; + IfcBooleanResult br = ri as IfcBooleanResult; + if (br != null) + return new IfcShapeRepresentation(br); + IfcCurve c = ri as IfcCurve; + if (c != null) + return new IfcShapeRepresentation(c); + IfcCsgPrimitive3D csg = ri as IfcCsgPrimitive3D; + if (csg != null) + return new IfcShapeRepresentation(csg); + IfcCsgSolid csgs = ri as IfcCsgSolid; + if (csgs != null) + return new IfcShapeRepresentation(csgs); + IfcExtrudedAreaSolid eas = ri as IfcExtrudedAreaSolid; + if (eas != null) + return new IfcShapeRepresentation(eas); + IfcFacetedBrep fb = ri as IfcFacetedBrep; + if (fb != null) + return new IfcShapeRepresentation(fb); + IfcFaceBasedSurfaceModel fbs = ri as IfcFaceBasedSurfaceModel; + if (fbs != null) + return new IfcShapeRepresentation(fbs); + IfcGeometricSet gs = ri as IfcGeometricSet; + if (gs != null) + return new IfcShapeRepresentation(gs); + IfcPoint p = ri as IfcPoint; + if (p != null) + return new IfcShapeRepresentation(p); + IfcSectionedSpine ss = ri as IfcSectionedSpine; + if (ss != null) + return new IfcShapeRepresentation(ss); + IfcShellBasedSurfaceModel sbs = ri as IfcShellBasedSurfaceModel; + if (sbs != null) + return new IfcShapeRepresentation(sbs); + IfcSurface s = ri as IfcSurface; + if (s != null) + return new IfcShapeRepresentation(s); + IfcSweptAreaSolid sas = ri as IfcSweptAreaSolid; + if (sas != null) + return new IfcShapeRepresentation(sas); + IfcSweptDiskSolid sds = ri as IfcSweptDiskSolid; + if (sds != null) + return new IfcShapeRepresentation(sds); + IfcAdvancedBrep b = ri as IfcAdvancedBrep; + if (b != null) + return new IfcShapeRepresentation(b); + IfcTessellatedItem ti = ri as IfcTessellatedItem; + if (ti != null) + return new IfcShapeRepresentation(ti); + IfcMappedItem mi = ri as IfcMappedItem; + if (mi != null) + return new IfcShapeRepresentation(mi); + ri.mDatabase.logError("XXX Error in identiying " + ri.ToString() + " as shape representation, please contact Jon!"); + return null; + } + + internal static IfcShapeRepresentation getAxisRep(DatabaseIfc m, IfcBoundedCurve a) { return new IfcShapeRepresentation(a) { RepresentationIdentifier = "Axis", RepresentationType = "Curve3D" }; } + internal static IfcShapeRepresentation getProfileRep(DatabaseIfc m, IfcCurve c) { return new IfcShapeRepresentation(c) { RepresentationIdentifier = "Profile", RepresentationType = "Curve3D" }; } + internal static IfcShapeRepresentation getRowRep(DatabaseIfc m, IfcGeometricCurveSet cs) { return new IfcShapeRepresentation(cs) { RepresentationIdentifier = "Row", RepresentationType = "GeometricCurveSet" }; } + + private bool setIdentifiers(IfcRepresentationItem ri) + { + IfcGeometricRepresentationItem gri = ri as IfcGeometricRepresentationItem; + if (ri != null) + { + mRepresentationIdentifier = "Body"; + mRepresentationType = "MappedRepresentation"; + IfcMappedItem mi = ri as IfcMappedItem; + if (mi != null) + return true; + mRepresentationType = "SolidModel"; + IfcSolidModel sm = ri as IfcSolidModel; //IfcCsgSolid ,IfcManifoldSolidBrep,IfcSweptAreaSolid,IfcSweptDiskSolid + if (sm != null) + return true; + + mRepresentationType = "CSG"; + IfcBooleanResult br = ri as IfcBooleanResult; + if (br != null) + return true; + IfcCsgPrimitive3D csg = ri as IfcCsgPrimitive3D; + if (csg != null) + return true; + mRepresentationType = "SectionedSpine"; + IfcSectionedSpine ss = ri as IfcSectionedSpine; + if (ss != null) + return true; + mRepresentationIdentifier = "Body"; + mRepresentationType = "SurfaceModel"; + IfcFaceBasedSurfaceModel fbs = ri as IfcFaceBasedSurfaceModel; + if (fbs != null) + return true; + IfcShellBasedSurfaceModel sbs = ri as IfcShellBasedSurfaceModel; + if (sbs != null) + return true; + mRepresentationType = "Tessellation"; + IfcTessellatedItem ti = ri as IfcTessellatedItem; + if (ti != null) + return true; + mRepresentationIdentifier = "Surface"; + mRepresentationType = "Surface3D"; + IfcSurface s = ri as IfcSurface; + if (s != null) + return true; + mRepresentationIdentifier = "Curve"; + mRepresentationType = "Curve3D"; + IfcCurve c = ri as IfcCurve; + if (c != null) + return true; + } + mRepresentationIdentifier = "$"; + mRepresentationType = "$"; + return false; + } + } + public partial interface IfcShell : IfcInterface // SELECT(IfcClosedShell, IfcOpenShell); + { + List CfsFaces { get; } + } + public partial class IfcShellBasedSurfaceModel : IfcGeometricRepresentationItem + { + internal List mSbsmBoundary = new List();// : SET [1:?] OF IfcShell; + internal List SbsmBoundary { get { return mSbsmBoundary.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcShell); } } + internal IfcShellBasedSurfaceModel() : base() { } + internal IfcShellBasedSurfaceModel(IfcShellBasedSurfaceModel m) : base(m) { mSbsmBoundary = new List(m.mSbsmBoundary.ToArray()); } + public IfcShellBasedSurfaceModel(IfcShell shell) : base(shell.Database) { mSbsmBoundary.Add(shell.Index); } + public IfcShellBasedSurfaceModel(List shells) : base(shells[0].Database) { mSbsmBoundary = shells.ConvertAll(x => x.Index); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mSbsmBoundary[0]); + for (int icounter = 1; icounter < mSbsmBoundary.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mSbsmBoundary[icounter]); + return str + ")"; + } + internal static void parseFields(IfcShellBasedSurfaceModel s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); s.mSbsmBoundary = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcShellBasedSurfaceModel Parse(string strDef) { IfcShellBasedSurfaceModel s = new IfcShellBasedSurfaceModel(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public abstract partial class IfcSimpleProperty : IfcProperty //ABSTRACT SUPERTYPE OF (ONEOF (IfcPropertyBoundedValue ,IfcPropertyEnumeratedValue , + { // IfcPropertyListValue,IfcPropertyReferenceValue,IfcPropertySingleValue,IfcPropertyTableValue)) + protected IfcSimpleProperty() : base() { } + protected IfcSimpleProperty(IfcSimpleProperty p) : base(p) { } + protected IfcSimpleProperty(DatabaseIfc m, string name, string desc) : base(m, name, desc) { } + protected static void parseFields(IfcSimpleProperty p, List arrFields, ref int ipos) { IfcProperty.parseFields(p, arrFields, ref ipos); } + } + public partial class IfcSite : IfcSpatialStructureElement + { + internal string mRefLatitude = "$";// : OPTIONAL IfcCompoundPlaneAngleMeasure; + internal string mRefLongitude = "$";// : OPTIONAL IfcCompoundPlaneAngleMeasure; + internal double mRefElevation;// : OPTIONAL IfcLengthMeasure; + internal string mLandTitleNumber = "$";// : OPTIONAL IfcLabel; + internal int mSiteAddress;// : OPTIONAL IfcPostalAddress; + + internal IfcCompoundPlaneAngleMeasure RefLatitude { set { mRefLatitude = (value == null ? "$" : value.ToString()); } } + internal IfcCompoundPlaneAngleMeasure RefLongitude { set { mRefLongitude = (value == null ? "$" : value.ToString()); } } + internal double RefElevation { get { return mRefElevation; } set { mRefElevation = value; } } + internal IfcPostalAddress SiteAddress { get { return mDatabase.mIfcObjects[mSiteAddress] as IfcPostalAddress; } set { mSiteAddress = (value == null ? 0 : value.mIndex); } } + + internal IfcSite() : base() { } + internal IfcSite(IfcSite p) : base(p) { mRefLatitude = p.mRefLatitude; mRefLongitude = p.mRefLongitude; mRefElevation = p.mRefElevation; mLandTitleNumber = p.mLandTitleNumber; mSiteAddress = p.mSiteAddress; } + internal IfcSite(DatabaseIfc db, string name) : base(db) { Name = name; } + internal IfcSite(IfcSite host, string name) : base(host, name) { } + internal static void parseFields(IfcSite s, List arrFields, ref int ipos) + { + IfcSpatialStructureElement.parseFields(s, arrFields, ref ipos); + s.mRefLatitude = arrFields[ipos++]; + s.mRefLongitude = arrFields[ipos++]; + s.mRefElevation = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mLandTitleNumber = arrFields[ipos++]; + s.mSiteAddress = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + mRefLatitude + "," + mRefLongitude + "," + ParserSTEP.DoubleToString(mRefElevation) + "," + mLandTitleNumber + "," + ParserSTEP.LinkToString(mSiteAddress); } + internal static IfcSite Parse(string strDef) { IfcSite s = new IfcSite(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public partial class IfcSIUnit : IfcNamedUnit + { + private static double[] mFactors = new double[] { Math.Pow(10, 18), Math.Pow(10, 15), Math.Pow(10, 12), Math.Pow(10, 9), Math.Pow(10, 6), Math.Pow(10, 3), Math.Pow(10, 2), Math.Pow(10, 1), Math.Pow(10, -1), Math.Pow(10, -2), Math.Pow(10, -3), Math.Pow(10, -6), Math.Pow(10, -9), Math.Pow(10, -12), Math.Pow(10, -15), Math.Pow(10, -18), 1 }; + private IfcSIPrefix mPrefix = IfcSIPrefix.NONE;// : OPTIONAL IfcSIPrefix; + private IfcSIUnitName mName;// : IfcSIUnitName; + + internal IfcSIPrefix Prefix { get { return mPrefix; } } + internal new IfcSIUnitName Name { get { return mName; } } + + internal IfcSIUnit(IfcSIUnit p) : base(p) { } + internal IfcSIUnit() : base() { } + public IfcSIUnit(DatabaseIfc m, IfcUnitEnum unitEnum, IfcSIPrefix pref, IfcSIUnitName name) : base(m, unitEnum, false) { mPrefix = pref; mName = name; } + protected override string BuildString() + { + string str = base.BuildString(); + if (mPrefix == IfcSIPrefix.NONE) + str += ",$,."; + else + str += ",." + mPrefix.ToString() + ".,."; + return str + mName + "."; + } + internal static void parseFields(IfcSIUnit u, List arrFields, ref int ipos) + { + IfcNamedUnit.parseFields(u, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str.Contains("$")) + u.mPrefix = IfcSIPrefix.NONE; + else + u.mPrefix = (IfcSIPrefix)Enum.Parse(typeof(IfcSIPrefix), str.Replace(".", "")); + u.mName = (IfcSIUnitName)Enum.Parse(typeof(IfcSIUnitName), arrFields[ipos++].Replace(".", "")); + } + internal static IfcSIUnit Parse(string strDef) { IfcSIUnit u = new IfcSIUnit(); int ipos = 0; parseFields(u, ParserSTEP.SplitLineFields(strDef), ref ipos); return u; } + internal override double getSIFactor() { return mFactors[(int)mPrefix]; } + } + public partial class IfcSlab : IfcBuildingElement + { + internal IfcSlabTypeEnum mPredefinedType = IfcSlabTypeEnum.NOTDEFINED;// : OPTIONAL IfcSlabTypeEnum + public IfcSlabTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcSlab() : base() { } + internal IfcSlab(IfcSlab o) : base(o) { mPredefinedType = o.mPredefinedType; } + public IfcSlab(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcSlab Parse(string strDef) { IfcSlab s = new IfcSlab(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcSlab s, List arrFields, ref int ipos) { IfcBuildingElement.parseFields(s, arrFields, ref ipos); string str = arrFields[ipos++]; if (str != "$") s.mPredefinedType = (IfcSlabTypeEnum)Enum.Parse(typeof(IfcSlabTypeEnum), str.Replace(".", "")); } + protected override string BuildString() { return base.BuildString() + (mPredefinedType == IfcSlabTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + "."); } + } + public partial class IfcSlabStandardCase : IfcSlab + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 || mDatabase.mModelView == ModelView.Ifc4Reference ? "IFCSLAB" : base.KeyWord); } } + internal IfcSlabStandardCase() : base() { } + internal IfcSlabStandardCase(IfcSlabStandardCase o) : base(o) { } + internal new static IfcSlabStandardCase Parse(string strDef) { IfcSlabStandardCase s = new IfcSlabStandardCase(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcSlabStandardCase s, List arrFields, ref int ipos) { IfcSlab.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcSlabType : IfcBuildingElementType + { + internal IfcSlabTypeEnum mPredefinedType = IfcSlabTypeEnum.NOTDEFINED; + public IfcSlabTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + public IfcSlabType() : base() { } + public IfcSlabType(DatabaseIfc m, string name, IfcSlabTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal IfcSlabType(IfcSlabType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcSlabType(string name, IfcMaterialLayerSet ls, IfcSlabTypeEnum type) : base(ls.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = ls; } + internal static void parseFields(IfcSlabType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSlabTypeEnum)Enum.Parse(typeof(IfcSlabTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSlabType Parse(string strDef) { IfcSlabType t = new IfcSlabType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcSlippageConnectionCondition + public class IfcSolarDevice : IfcEnergyConversionDevice //IFC4 + { + internal IfcSolarDeviceTypeEnum mPredefinedType = IfcSolarDeviceTypeEnum.NOTDEFINED;// OPTIONAL : IfcSolarDeviceTypeEnum; + public IfcSolarDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSolarDevice() : base() { } + internal IfcSolarDevice(IfcSolarDevice d) : base(d) { mPredefinedType = d.mPredefinedType; } + internal IfcSolarDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcSolarDevice s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcSolarDeviceTypeEnum)Enum.Parse(typeof(IfcSolarDeviceTypeEnum), str); + } + internal new static IfcSolarDevice Parse(string strDef) { IfcSolarDevice s = new IfcSolarDevice(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcSolarDeviceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcSolarDeviceType : IfcEnergyConversionDeviceType + { + internal IfcSolarDeviceTypeEnum mPredefinedType = IfcSolarDeviceTypeEnum.NOTDEFINED;// : IfcSolarDeviceTypeEnum; + public IfcSolarDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSolarDeviceType() : base() { } + internal IfcSolarDeviceType(IfcSolarDeviceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcSolarDeviceType(DatabaseIfc m, string name, IfcSolarDeviceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcSolarDeviceType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSolarDeviceTypeEnum)Enum.Parse(typeof(IfcSolarDeviceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSolarDeviceType Parse(string strDef) { IfcSolarDeviceType t = new IfcSolarDeviceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcSolidModel : IfcGeometricRepresentationItem, IfcBooleanOperand /* ABSTRACT SUPERTYPE OF (ONEOF(IfcCsgSolid ,IfcManifoldSolidBrep,IfcSweptAreaSolid,IfcSweptDiskSolid))*/ + { + protected IfcSolidModel() : base() { } + protected IfcSolidModel(IfcSolidModel p) : base(p) { } + protected IfcSolidModel(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcSolidModel s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); } + } + public class IfcSoundProperties : IfcPropertySetDefinition // DEPRECEATED IFC4 + { + internal bool mIsAttenuating;// : IfcBoolean; + internal IfcSoundScaleEnum mSoundScale = IfcSoundScaleEnum.NOTDEFINED;// : OPTIONAL IfcSoundScaleEnum + internal List mSoundValues = new List(1);// : LIST [1:8] OF IfcSoundValue; + internal IfcSoundProperties() : base() { } + internal IfcSoundProperties(IfcSoundProperties p) : base(p) { mIsAttenuating = p.mIsAttenuating; mSoundScale = p.mSoundScale; mSoundValues = new List(p.mSoundValues.ToArray()); } + internal static IfcSoundProperties Parse(string strDef) { IfcSoundProperties p = new IfcSoundProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcSoundProperties p, List arrFields, ref int ipos) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mIsAttenuating = ParserSTEP.ParseBool(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (!str.StartsWith("$")) + p.mSoundScale = (IfcSoundScaleEnum)Enum.Parse(typeof(IfcSoundScaleEnum), str); + p.mSoundValues = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.BoolToString(mIsAttenuating) + ",." + mSoundScale.ToString() + ".,(" + ParserSTEP.LinkToString(mSoundValues[0]); + for (int icounter = 1; icounter < mSoundValues.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mSoundValues[icounter]); + return str + ")"; + } + } + public class IfcSoundValue : IfcPropertySetDefinition // DEPRECEATED IFC4 + { + internal int mSoundLevelTimeSeries;// : OPTIONAL IfcTimeSeries; + internal int mFrequency;// : IfcFrequencyMeasure; + internal int mSoundLevelSingleValue;// : OPTIONAL IfcDerivedMeasureValue; + internal IfcSoundValue() : base() { } + internal IfcSoundValue(IfcSoundValue i) : base(i) { mSoundLevelTimeSeries = i.mSoundLevelTimeSeries; mFrequency = i.mFrequency; mSoundLevelSingleValue = i.mSoundLevelSingleValue; } + internal static IfcSoundValue Parse(string strDef) { IfcSoundValue v = new IfcSoundValue(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos); return v; } + internal static void parseFields(IfcSoundValue v, List arrFields, ref int ipos) { IfcPropertySetDefinition.parseFields(v, arrFields, ref ipos); v.mSoundLevelTimeSeries = ParserSTEP.ParseLink(arrFields[ipos++]); v.mFrequency = ParserSTEP.ParseLink(arrFields[ipos++]); v.mSoundLevelSingleValue = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSoundLevelTimeSeries) + "," + ParserSTEP.LinkToString(mFrequency) + "," + ParserSTEP.LinkToString(mSoundLevelSingleValue); } + } + public partial class IfcSpace : IfcSpatialStructureElement, IfcSpaceBoundarySelect + { + //internal IfcInternalOrExternalEnum mInteriorOrExteriorSpace = IfcInternalOrExternalEnum.NOTDEFINED;// : IfcInternalOrExternalEnum; replaced IFC4 + internal IfcSpaceTypeEnum mPredefinedType = IfcSpaceTypeEnum.NOTDEFINED; //: OPTIONAL IfcSpaceTypeEnum; + internal double mElevationWithFlooring;// : OPTIONAL IfcLengthMeasure; + //INVERSE + internal List mHasCoverings = new List(); // : SET [0:?] OF IfcRelCoversSpaces FOR RelatedSpace; + internal List mBoundedBy = new List(); // BoundedBy : SET [0:?] OF IfcRelSpaceBoundary FOR RelatingSpace; + + public IfcSpaceTypeEnum PredefinedType + { + get { return mPredefinedType; } + set + { + mPredefinedType = value; + if (mDatabase.mSchema == Schema.IFC2x3) + { + if (value != IfcSpaceTypeEnum.INTERNAL && value != IfcSpaceTypeEnum.EXTERNAL && value != IfcSpaceTypeEnum.NOTDEFINED) + { + mPredefinedType = IfcSpaceTypeEnum.NOTDEFINED; + if (string.IsNullOrEmpty(ObjectType)) + ObjectType = value.ToString(); + } + } + } + } + public double ElevationWithFlooring { get { return mElevationWithFlooring; } set { mElevationWithFlooring = value; } } + public List HasCoverings { get { return mHasCoverings; } } + public List BoundedBy { get { return mBoundedBy; } } + + internal IfcSpace() : base() { } + internal IfcSpace(IfcSpace p) : base(p) { mPredefinedType = p.mPredefinedType; mElevationWithFlooring = p.mElevationWithFlooring; } + internal IfcSpace(IfcSpatialStructureElement host, string name) + : base(host, name) + { + //container.addSpace(this); + //if(mDatabase.mSchema == Schema.IFC2x3 && mPredefinedType != IfcSpaceTypeEnum.EXTERNAL && mPredefinedType != IfcSpaceTypeEnum.INTERNAL && mPredefinedType != IfcSpaceTypeEnum.NOTDEFINED ) + // mPredefinedType = IfcSpaceTypeEnum.NOTDEFINED; + //mElevationWithFlooring = elev; + IfcRelCoversSpaces cs = new IfcRelCoversSpaces(this, null); + } + + internal static void parseFields(IfcSpace gp, List arrFields, ref int ipos) + { + IfcSpatialStructureElement.parseFields(gp, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s[0] == '.') + gp.mPredefinedType = (IfcSpaceTypeEnum)Enum.Parse(typeof(IfcSpaceTypeEnum), s.Replace(".", "")); + gp.mElevationWithFlooring = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 || mPredefinedType != IfcSpaceTypeEnum.NOTDEFINED ? ",." + mPredefinedType.ToString() + ".," : ",$,") + ParserSTEP.DoubleOptionalToString(mElevationWithFlooring); } + internal static IfcSpace Parse(string strDef) { IfcSpace s = new IfcSpace(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + public override bool AddElement(IfcElement s) + { + IfcCovering c = s as IfcCovering; + if (c != null) + { + mHasCoverings[0].addCovering(c); + return true; + } + return base.AddElement(s); + } + } + public partial interface IfcSpaceBoundarySelect : IfcInterface //IFC4 SELECT ( IfcSpace, IfcExternalSpatialElement); + { + List BoundedBy { get; } + } + public class IfcSpaceHeater : IfcFlowTerminal //IFC4 + { + internal IfcSpaceHeaterTypeEnum mPredefinedType = IfcSpaceHeaterTypeEnum.NOTDEFINED;// OPTIONAL : IfcSpaceHeaterTypeEnum; + public IfcSpaceHeaterTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSpaceHeater(IfcSpaceHeater h) : base(h) { mPredefinedType = h.mPredefinedType; } + internal IfcSpaceHeater() : base() { } + internal static void parseFields(IfcSpaceHeater s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcSpaceHeaterTypeEnum)Enum.Parse(typeof(IfcSpaceHeaterTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcSpaceHeater Parse(string strDef) { IfcSpaceHeater s = new IfcSpaceHeater(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType.ToString() + "."); } + } + public class IfcSpaceHeaterType : IfcFlowTerminalType + { + internal IfcSpaceHeaterTypeEnum mPredefinedType = IfcSpaceHeaterTypeEnum.NOTDEFINED;// : IfcSpaceHeaterExchangerEnum; + public IfcSpaceHeaterTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSpaceHeaterType() : base() { } + internal IfcSpaceHeaterType(IfcSpaceHeaterType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcSpaceHeaterType(DatabaseIfc m, string name, IfcSpaceHeaterTypeEnum t) : base(m) { Name = name; PredefinedType = t; } + internal static void parseFields(IfcSpaceHeaterType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSpaceHeaterTypeEnum)Enum.Parse(typeof(IfcSpaceHeaterTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSpaceHeaterType Parse(string strDef) { IfcSpaceHeaterType t = new IfcSpaceHeaterType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcSpaceHeaterTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcSpaceProgram : IfcControl // DEPRECEATED IFC4 + { + internal string mSpaceProgramIdentifier;// : IfcIdentifier; + internal double mMaxRequiredArea, mMinRequiredArea;// : OPTIONAL IfcAreaMeasure; + internal int mRequestedLocation;// : OPTIONAL IfcSpatialStructureElement; + internal double mStandardRequiredArea;// : IfcAreaMeasure; + internal IfcSpaceProgram() : base() { } + internal IfcSpaceProgram(IfcSpaceProgram i) + : base(i) + { + mSpaceProgramIdentifier = i.mSpaceProgramIdentifier; + mMaxRequiredArea = i.mMaxRequiredArea; + mMinRequiredArea = i.mMinRequiredArea; + mRequestedLocation = i.mRequestedLocation; + mStandardRequiredArea = i.mStandardRequiredArea; + } + internal static IfcSpaceProgram Parse(string strDef, Schema schema) { IfcSpaceProgram p = new IfcSpaceProgram(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + internal static void parseFields(IfcSpaceProgram p, List arrFields, ref int ipos, Schema schema) + { + IfcControl.parseFields(p, arrFields, ref ipos,schema); + p.mSpaceProgramIdentifier = arrFields[ipos++]; + p.mMaxRequiredArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mMinRequiredArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mRequestedLocation = ParserSTEP.ParseLink(arrFields[ipos++]); + p.mStandardRequiredArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + mSpaceProgramIdentifier + "," + ParserSTEP.DoubleOptionalToString(mMaxRequiredArea) + "," + ParserSTEP.DoubleOptionalToString(mMinRequiredArea) + "," + ParserSTEP.LinkToString(mRequestedLocation) + "," + ParserSTEP.DoubleToString(mStandardRequiredArea); } + } + //ENTITY IfcSpaceThermalLoadProperties // DEPRECEATED IFC4 + public class IfcSpaceType : IfcSpatialStructureElementType + { + internal IfcSpaceTypeEnum mPredefinedType = IfcSpaceTypeEnum.NOTDEFINED; + public IfcSpaceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSpaceType() : base() { } + internal IfcSpaceType(IfcSpaceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcSpaceType(DatabaseIfc m, string name, IfcSpaceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcSpaceType t, List arrFields, ref int ipos) { IfcSpatialStructureElementType.parseFields(t, arrFields, ref ipos); try { t.mPredefinedType = (IfcSpaceTypeEnum)Enum.Parse(typeof(IfcSpaceTypeEnum), arrFields[ipos++].Replace(".", "")); } catch (Exception) { } } + internal new static IfcSpaceType Parse(string strDef) { IfcSpaceType t = new IfcSpaceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public abstract partial class IfcSpatialElement : IfcProduct //ABSTRACT SUPERTYPE OF (ONEOF (IfcExternalSpatialStructureElement ,IfcSpatialStructureElement ,IfcSpatialZone)) + { + private string mLongName = "$";// : OPTIONAL IfcLabel; + //INVERSE + internal List mContainsElements = new List();// : SET [0:?] OF IfcRelReferencedInSpatialStructure FOR RelatingStructure; + internal List mServicedBySystems = new List();// : SET [0:?] OF IfcRelServicesBuildings FOR RelatedBuildings; + + public string LongName { get { return (mLongName == "$" ? "" : ParserIfc.Decode(mLongName)); } set { mLongName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List ContainsElements { get { return mContainsElements; } } + public List ServicedBySystems { get { return mServicedBySystems; } } + + protected IfcSpatialElement() : base() { } + protected IfcSpatialElement(IfcSpatialElement e) : base(e) { mLongName = e.mLongName; } + protected IfcSpatialElement(IfcSpatialElement host, string name) : this(host.mDatabase) + { + Name = name; + IfcBuilding building = this as IfcBuilding; + if(building != null) + host.addBuilding(building); + else + { + building = host as IfcBuilding; + IfcBuildingStorey bs = this as IfcBuildingStorey; + if (building != null && bs != null) + building.addStorey(bs); + else + { + IfcSpace space = this as IfcSpace; + if (space != null) + host.addSpace(space); + else + host.AddAggregated(this); + } + } + } + protected IfcSpatialElement(DatabaseIfc m) : base(m) + { + IfcRelContainedInSpatialStructure rs = new IfcRelContainedInSpatialStructure(this); + if (mDatabase.mSchema != Schema.IFC2x3) + { + IfcObjectPlacement pl = Placement; + mContainerCommonPlacement = (pl == null ? new IfcLocalPlacement(new IfcAxis2Placement3D(mDatabase)) :new IfcLocalPlacement(pl,new IfcAxis2Placement3D(mDatabase)) ); + mContainerCommonPlacement.mContainerHost = this; + } + } + + protected static void parseFields(IfcSpatialElement s, List arrFields, ref int ipos) { IfcProduct.parseFields(s, arrFields, ref ipos); s.mLongName = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + "," + (mLongName == "$" ? "$" : "'" + mLongName + "'"); } + + public override bool AddElement(IfcElement s) + { + if (mContainsElements.Count == 0) + mContainsElements.Add(new IfcRelContainedInSpatialStructure(this)); + if (mContainsElements[0].mRelatedElements.Contains(s.mIndex)) + return false; + if (s.mContainedInStructure != null) + s.mContainedInStructure.removeObject(s); + s.mContainedInStructure = mContainsElements[0]; + mContainsElements[0].mRelatedElements.Add(s.mIndex); + return true; + } + + internal bool addBuilding(IfcBuilding s) + { + for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) + { + IfcRelAggregates rd = mIsDecomposedBy[icounter]; + if (rd.Description.EndsWith("Buildings", true, System.Globalization.CultureInfo.CurrentCulture)) + { + rd.addObject(s); + return true; + } + if (rd.mRelatedObjects.Count > 0) + { + IfcBuilding b = mDatabase.mIfcObjects[rd.mRelatedObjects[0]] as IfcBuilding; + if (b != null) + { + rd.addObject(s); + return true; + } + } + } + IfcRelAggregates ra = new IfcRelAggregates(mDatabase, KeyWord, "Building", this, s); + return true; + } + internal bool addSpace(IfcSpace s) + { + for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) + { + IfcRelAggregates rd = mIsDecomposedBy[icounter]; + if (rd.Description.EndsWith("Spaces", true, System.Globalization.CultureInfo.CurrentCulture)) + return rd.addObject(s); + } + IfcRelAggregates ra = new IfcRelAggregates(mDatabase, KeyWord, "Space", this, s); + return true; + } + protected bool addStorey(IfcBuildingStorey s) + { + for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) + { + IfcRelAggregates rd = mIsDecomposedBy[icounter]; + if (rd.Description.EndsWith("Stories", true, System.Globalization.CultureInfo.CurrentCulture)) + return rd.addObject(s); + } + IfcRelAggregates ra = new IfcRelAggregates(mDatabase, "Building", "Storie", this, s); + return true; + } + internal List getBuildings() + { + List result = new List(); + for (int icounter = 0; icounter < mIsDecomposedBy.Count; icounter++) + { + List ods = mIsDecomposedBy[icounter].RelatedObjects; + foreach (IfcObjectDefinition od in ods) + { + IfcBuilding b = od as IfcBuilding; + if (b != null) + result.Add(b); + } + } + return result; + } + } + public abstract class IfcSpatialElementType : IfcTypeProduct //IFC4 ABSTRACT SUPERTYPE OF(IfcSpaceType) + { + internal string mElementType = "$";// : OPTIONAL IfcLabel + public string ElementType { get { return (mElementType == "$" ? "" : ParserIfc.Decode(mElementType)); } set { mElementType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + protected IfcSpatialElementType() : base() { } + protected IfcSpatialElementType(IfcSpatialElementType t) : base(t) { mElementType = t.mElementType; } + protected IfcSpatialElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcSpatialElementType t, List arrFields, ref int ipos) { IfcTypeProduct.parseFields(t, arrFields, ref ipos); t.mElementType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mElementType == "$" ? ",$" : ",'" + mElementType + "'"); } + } + public abstract class IfcSpatialStructureElement : IfcSpatialElement /*ABSTRACT SUPERTYPE OF (ONEOF (IfcBuilding ,IfcBuildingStorey ,IfcSite ,IfcSpace))*/ + { + internal IfcElementCompositionEnum mCompositionType = IfcElementCompositionEnum.NA;// : IfcElementCompositionEnum; IFC4 Optional + public IfcElementCompositionEnum CompositionType { get { return mCompositionType; } set { mCompositionType = value; } } + + protected IfcSpatialStructureElement() : base() { } + protected IfcSpatialStructureElement(IfcSpatialStructureElement p) : base(p) { mCompositionType = p.mCompositionType; } + protected IfcSpatialStructureElement(DatabaseIfc m) : base(m) { if (m.mSchema == Schema.IFC2x3) mCompositionType = IfcElementCompositionEnum.ELEMENT; } + protected IfcSpatialStructureElement(IfcSpatialStructureElement host,string name) : base(host,name) { if (mDatabase.mSchema == Schema.IFC2x3) mCompositionType = IfcElementCompositionEnum.ELEMENT; } + protected static void parseFields(IfcSpatialStructureElement s, List arrFields, ref int ipos) + { + IfcSpatialElement.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str != "$") + s.mCompositionType = (IfcElementCompositionEnum)Enum.Parse(typeof(IfcElementCompositionEnum), str.Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + (mCompositionType == IfcElementCompositionEnum.NA ? (mDatabase.mSchema == Schema.IFC2x3 ? ",." + IfcElementCompositionEnum.ELEMENT.ToString() + "." : ",$") : ",." + mCompositionType.ToString() + "."); } + } + public abstract class IfcSpatialStructureElementType : IfcSpatialElementType //ABSTRACT SUPERTYPE OF (ONEOF (IfcSpaceType)) + { + protected IfcSpatialStructureElementType() : base() { } + protected IfcSpatialStructureElementType(IfcSpatialStructureElementType t) : base(t) { } + protected IfcSpatialStructureElementType(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcSpatialStructureElementType t, List arrFields, ref int ipos) { IfcSpatialElementType.parseFields(t, arrFields, ref ipos); } + } + public class IfcSpatialZone : IfcSpatialElement //IFC4 + { + internal IfcSpatialZoneTypeEnum mPredefinedType = IfcSpatialZoneTypeEnum.NOTDEFINED; + public IfcSpatialZoneTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + protected IfcSpatialZone() : base() { } + protected IfcSpatialZone(IfcSpatialZone p) : base(p) { mPredefinedType = p.mPredefinedType; } + internal IfcSpatialZone(IfcSpatialStructureElement host, string name) : base(host, name) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception("IFCSpatial Zone only valid in IFC4 or newer!"); } + + protected static void parseFields(IfcSpatialZone s, List arrFields, ref int ipos) { IfcProduct.parseFields(s, arrFields, ref ipos); if (arrFields[ipos++][0] == '.') s.mPredefinedType = (IfcSpatialZoneTypeEnum)Enum.Parse(typeof(IfcSpatialZoneTypeEnum), arrFields[ipos++].Replace(".", "")); } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + internal static IfcSpatialZone Parse(string strDef) { IfcSpatialZone t = new IfcSpatialZone(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public class IfcSpatialZoneType : IfcSpatialElementType //IFC4 + { + internal IfcSpatialZoneTypeEnum mPredefinedType = IfcSpatialZoneTypeEnum.NOTDEFINED; + public IfcSpatialZoneTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcSpatialZoneType() : base() { } + internal IfcSpatialZoneType(IfcSpatialZoneType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcSpatialZoneType(DatabaseIfc m, string name) : base(m) { Name = name; if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception("IFCSpatial Zone Type only valid in IFC4 or newer!"); } + internal static void parseFields(IfcSpatialZoneType t, List arrFields, ref int ipos) { IfcSpatialElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSpatialZoneTypeEnum)Enum.Parse(typeof(IfcSpatialZoneTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSpatialZoneType Parse(string strDef) { IfcSpatialZoneType t = new IfcSpatialZoneType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public partial class IfcSphere : IfcCsgPrimitive3D + { + internal double mRadius;// : IfcPositiveLengthMeasure; + internal IfcSphere() : base() { } + internal IfcSphere(IfcSphere pl) : base(pl) { mRadius = pl.mRadius; } + + internal static void parseFields(IfcSphere s, List arrFields, ref int ipos) { IfcCsgPrimitive3D.parseFields(s, arrFields, ref ipos); s.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcSphere Parse(string strDef) { IfcSphere s = new IfcSphere(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mRadius); } + } + public class IfcStackTerminal : IfcFlowTerminal //IFC4 + { + internal IfcStackTerminalTypeEnum mPredefinedType = IfcStackTerminalTypeEnum.NOTDEFINED;// OPTIONAL : IfcStackTerminalTypeEnum; + public IfcStackTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcStackTerminal() : base() { } + internal IfcStackTerminal(IfcStackTerminal t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcStackTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcStackTerminal s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcStackTerminalTypeEnum)Enum.Parse(typeof(IfcStackTerminalTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcStackTerminal Parse(string strDef) { IfcStackTerminal s = new IfcStackTerminal(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcStackTerminalTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcStackTerminalType : IfcFlowTerminalType + { + internal IfcStackTerminalTypeEnum mPredefinedType = IfcStackTerminalTypeEnum.NOTDEFINED; + public IfcStackTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcStackTerminalType() : base() { } + internal IfcStackTerminalType(IfcStackTerminalType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcStackTerminalType(DatabaseIfc m, string name, IfcStackTerminalTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcStackTerminalType t, List arrFields, ref int ipos) { IfcFlowTerminalType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcStackTerminalTypeEnum)Enum.Parse(typeof(IfcStackTerminalTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcStackTerminalType Parse(string strDef) { IfcStackTerminalType t = new IfcStackTerminalType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcStair : IfcBuildingElement + { + internal IfcStairTypeEnum mPredefinedType = IfcStairTypeEnum.NOTDEFINED;// OPTIONAL : IfcStairTypeEnum + public IfcStairTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcStair() : base() { } + internal IfcStair(IfcStair s) : base(s) { mPredefinedType = s.mPredefinedType; } + public IfcStair(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static IfcStair Parse(string strDef) { IfcStair s = new IfcStair(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcStair s, List arrFields, ref int ipos) + { + IfcBuildingElement.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcStairTypeEnum)Enum.Parse(typeof(IfcStairTypeEnum), str.Substring(1, str.Length - 2)); + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcStairFlight : IfcBuildingElement + { + internal int mNumberOfRiser = 0;// : OPTIONAL INTEGER; + internal int mNumberOfTreads = 0;// : OPTIONAL INTEGER; + internal double mRiserHeight = 0;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mTreadLength = 0;// : OPTIONAL IfcPositiveLengthMeasure; + + internal IfcStairFlightTypeEnum mPredefinedType = IfcStairFlightTypeEnum.NOTDEFINED;//: OPTIONAL IfcStairFlightTypeEnum; IFC4 + public IfcStairFlightTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcStairFlight() : base() { } + internal IfcStairFlight(IfcStairFlight f) : base(f) { mPredefinedType = f.mPredefinedType; } + public IfcStairFlight(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + + internal static IfcStairFlight Parse(string strDef, Schema schema) { IfcStairFlight f = new IfcStairFlight(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return f; } + internal static void parseFields(IfcStairFlight f, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(f, arrFields, ref ipos); + f.mNumberOfRiser = ParserSTEP.ParseInt(arrFields[ipos++]); + f.mNumberOfTreads = ParserSTEP.ParseInt(arrFields[ipos++]); + f.mRiserHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + f.mTreadLength = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + f.mPredefinedType = (IfcStairFlightTypeEnum)Enum.Parse(typeof(IfcStairFlightTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() + { + string result = base.BuildString() + "," + ParserSTEP.IntOptionalToString(mNumberOfRiser) + "," + ParserSTEP.IntOptionalToString(mNumberOfTreads) + "," + + ParserSTEP.DoubleOptionalToString(mRiserHeight) + "," + ParserSTEP.DoubleOptionalToString(mTreadLength); + return result + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcStairFlightTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public partial class IfcStairFlightType : IfcBuildingElementType + { + internal IfcStairFlightTypeEnum mPredefinedType = IfcStairFlightTypeEnum.NOTDEFINED; + public IfcStairFlightTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcStairFlightType() : base() { } + internal IfcStairFlightType(IfcStairFlightType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcStairFlightType(DatabaseIfc m, string name, IfcStairFlightTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + + internal static void parseFields(IfcStairFlightType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcStairFlightTypeEnum)Enum.Parse(typeof(IfcStairFlightTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcStairFlightType Parse(string strDef) { IfcStairFlightType t = new IfcStairFlightType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcStairType : IfcBuildingElementType + { + internal IfcStairTypeEnum mPredefinedType = IfcStairTypeEnum.NOTDEFINED; + public IfcStairTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcStairType() : base() { } + internal IfcStairType(IfcStairType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcStairType(DatabaseIfc m, string name, IfcStairTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + + internal static void parseFields(IfcStairType t, List arrFields, ref int ipos) { IfcBuildingElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcStairTypeEnum)Enum.Parse(typeof(IfcStairTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcStairType Parse(string strDef) { IfcStairType t = new IfcStairType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + "."); } + } + public abstract partial class IfcStructuralAction : IfcStructuralActivity // ABSTRACT SUPERTYPE OF (ONEOF (IfcStructuralLinearAction ,IfcStructuralPlanarAction,IfcStructuralPointAction)) + { + internal bool mDestabilizingLoad = true, mDestabSet = false;//: OPTIONAL BOOLEAN; IFC4 made optional + internal int mCausedBy;// : OPTIONAL IfcStructuralReaction; DELETED IFC4 + + public bool DestabilizingLoad { get { return mDestabilizingLoad; } set { mDestabilizingLoad = value; mDestabSet = true; } } + + protected IfcStructuralAction() : base() { } + protected IfcStructuralAction(IfcStructuralAction a) : base(a) { mDestabilizingLoad = a.mDestabilizingLoad; mCausedBy = a.mCausedBy; } + protected IfcStructuralAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoad load, bool global) + : base(lc.mDatabase, item, load, global, lc.IsGroupedBy[0]) { } + protected static void parseFields(IfcStructuralAction a, List arrFields, ref int ipos, Schema schema) + { + IfcStructuralActivity.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + { + a.mDestabilizingLoad = ParserSTEP.ParseBool(s); + a.mDestabSet = true; + } + if (schema == Schema.IFC2x3) + a.mCausedBy = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + (mDestabSet || mDatabase.mSchema == Schema.IFC2x3 ? "," + ParserSTEP.BoolToString(mDestabilizingLoad) : ",$") + (mDatabase.mSchema == Schema.IFC2x3 ? "," + ParserSTEP.LinkToString(mCausedBy) : ""); } + } + public abstract partial class IfcStructuralActivity : IfcProduct + { + private int mAppliedLoad;// : IfcStructuralLoad; + private IfcGlobalOrLocalEnum mGlobalOrLocal = IfcGlobalOrLocalEnum.GLOBAL_COORDS;// : IfcGlobalOrLocalEnum; + //INVERSE + private IfcRelConnectsStructuralActivity mAssignedToStructuralItem = null; // : SET [0:1] OF IfcRelConnectsStructuralActivity FOR RelatedStructuralActivity; + + internal IfcStructuralLoad AppliedLoad { get { return mDatabase.mIfcObjects[mAppliedLoad] as IfcStructuralLoad; } } + internal IfcGlobalOrLocalEnum GlobalOrLocal { get { return mGlobalOrLocal; } } + internal IfcRelConnectsStructuralActivity AssignedToStructuralItem { get { return mAssignedToStructuralItem; } set { mAssignedToStructuralItem = value; } } + + protected IfcStructuralActivity() : base() { } + protected IfcStructuralActivity(IfcStructuralActivity p) : base(p) { mAppliedLoad = p.mAppliedLoad; mGlobalOrLocal = p.mGlobalOrLocal; } + protected IfcStructuralActivity(DatabaseIfc db, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoad load, bool global, IfcRelAssignsToGroup loadcase) + : base(db) + { + mAssignedToStructuralItem = new IfcRelConnectsStructuralActivity(item, this); + mAppliedLoad = load.mIndex; + mGlobalOrLocal = global ? IfcGlobalOrLocalEnum.GLOBAL_COORDS : IfcGlobalOrLocalEnum.LOCAL_COORDS; + loadcase.assign(this); + } + protected static void parseFields(IfcStructuralActivity a, List arrFields, ref int ipos) + { + IfcProduct.parseFields(a, arrFields, ref ipos); + a.mAppliedLoad = ParserSTEP.ParseLink(arrFields[ipos++]); + a.mGlobalOrLocal = (IfcGlobalOrLocalEnum)Enum.Parse(typeof(IfcGlobalOrLocalEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mAppliedLoad) + ",." + mGlobalOrLocal.ToString() + "."; } + } + public interface IfcStructuralActivityAssignmentSelect : IfcInterface { } //SELECT(IfcStructuralItem,IfcElement); + public partial class IfcStructuralAnalysisModel : IfcSystem + { + internal IfcAnalysisModelTypeEnum mPredefinedType;// : IfcAnalysisModelTypeEnum; + internal int mOrientationOf2DPlane;// : OPTIONAL IfcAxis2Placement3D; + internal List mLoadedBy = new List();// : OPTIONAL SET [1:?] OF IfcStructuralLoadGroup; + internal List mHasResults = new List();//: OPTIONAL SET [1:?] OF IfcStructuralResultGroup + + internal List LoadedBy { get { return mLoadedBy.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcStructuralLoadGroup); } } + + internal IfcStructuralAnalysisModel() : base() { } + internal IfcStructuralAnalysisModel(IfcStructuralAnalysisModel i) : base(i) { mPredefinedType = i.mPredefinedType; mOrientationOf2DPlane = i.mOrientationOf2DPlane; mLoadedBy = new List(i.mLoadedBy.ToArray()); mHasResults = new List(i.mHasResults.ToArray()); } + internal IfcStructuralAnalysisModel(IfcSpatialElement bldg, string name, IfcAnalysisModelTypeEnum type) : base(bldg, name) { mPredefinedType = type; } + internal new static IfcStructuralAnalysisModel Parse(string strDef) { IfcStructuralAnalysisModel m = new IfcStructuralAnalysisModel(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcStructuralAnalysisModel c, List arrFields, ref int ipos) + { + IfcSystem.parseFields(c, arrFields, ref ipos); + c.mPredefinedType = (IfcAnalysisModelTypeEnum)Enum.Parse(typeof(IfcAnalysisModelTypeEnum), arrFields[ipos++].Replace(".", "")); + c.mOrientationOf2DPlane = ParserSTEP.ParseLink(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (str != "$") + c.mLoadedBy = ParserSTEP.SplitListLinks(str); + str = arrFields[ipos++]; + if (str != "$") + c.mHasResults = ParserSTEP.SplitListLinks(str); + + } + protected override string BuildString() + { + string str = base.BuildString() + ",." + mPredefinedType.ToString() + ".," + ParserSTEP.LinkToString(mOrientationOf2DPlane) + ","; + if (mLoadedBy.Count == 0) + str += "$,"; + else + { + str += "(" + ParserSTEP.LinkToString(mLoadedBy[0]); + for (int icounter = 1; icounter < mLoadedBy.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mLoadedBy[icounter]); + str += "),"; + } + if (mHasResults.Count == 0) + str += "$"; + else + { + str += "(" + ParserSTEP.LinkToString(mHasResults[0]); + for (int icounter = 1; icounter < mHasResults.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mHasResults[icounter]); + str += ")"; + } + return str; + } + + internal void addLoadGroup(IfcStructuralLoadGroup lg) { mLoadedBy.Add(lg.mIndex); } + } + public abstract partial class IfcStructuralConnection : IfcStructuralItem //ABSTRACT SUPERTYPE OF (ONEOF (IfcStructuralCurveConnection ,IfcStructuralPointConnection ,IfcStructuralSurfaceConnection)) + { + internal int mAppliedCondition = 0; //: OPTIONAL IfcBoundaryCondition + //INVERSE + internal List mConnectsStructuralMembers = new List();// : SET [1:?] OF IfcRelConnectsStructuralMember FOR RelatedStructuralConnection; + + public IfcBoundaryCondition AppliedCondition { get { return mDatabase.mIfcObjects[mAppliedCondition] as IfcBoundaryCondition; } set { mAppliedCondition = (value == null ? 0 : value.mIndex); } } + + protected IfcStructuralConnection() : base() { } + protected IfcStructuralConnection(IfcStructuralConnection i) : base(i) { mAppliedCondition = i.mAppliedCondition; } + internal IfcStructuralConnection(IfcStructuralAnalysisModel sm, int id) : base(sm, id) { } + protected static void parseFields(IfcStructuralConnection c, List arrFields, ref int ipos) { IfcStructuralItem.parseFields(c, arrFields, ref ipos); c.mAppliedCondition = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mAppliedCondition); } + } + public abstract class IfcStructuralConnectionCondition : BaseClassIfc //ABSTRACT SUPERTYPE OF (ONEOF (IfcFailureConnectionCondition ,IfcSlippageConnectionCondition)); + { + internal string mName = "$";// : OPTIONAL IfcLabel; + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcStructuralConnectionCondition() : base() { } + protected IfcStructuralConnectionCondition(IfcStructuralConnectionCondition i) : base() { mName = i.mName; } + protected static void parseFields(IfcStructuralConnectionCondition c, List arrFields, ref int ipos) { c.mName = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$" : ",'" + mName + "'"); } + } + public partial class IfcStructuralCurveAction : IfcStructuralAction //SUPERTYPE OF(IfcStructuralLinearAction) + { + internal IfcProjectedOrTrueLengthEnum mProjectedOrTrue = IfcProjectedOrTrueLengthEnum.TRUE_LENGTH;// : IfcProjectedOrTrueLengthEnum + internal IfcStructuralCurveActivityTypeEnum mPredefinedType = IfcStructuralCurveActivityTypeEnum.NOTDEFINED;//IfcStructuralCurveActivityTypeEnum + internal IfcStructuralCurveAction() : base() { } + internal IfcStructuralCurveAction(IfcStructuralCurveAction p) : base(p) { mProjectedOrTrue = p.mProjectedOrTrue; mPredefinedType = p.mPredefinedType; } + internal IfcStructuralCurveAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoad load, bool global, bool projected, IfcStructuralCurveActivityTypeEnum type) + : base(lc, item, load, global) { mProjectedOrTrue = projected ? IfcProjectedOrTrueLengthEnum.PROJECTED_LENGTH : IfcProjectedOrTrueLengthEnum.TRUE_LENGTH; mPredefinedType = type; } + internal static IfcStructuralCurveAction Parse(string strDef,Schema schema) { IfcStructuralCurveAction a = new IfcStructuralCurveAction(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + internal static void parseFields(IfcStructuralCurveAction a, List arrFields, ref int ipos,Schema schema) + { + IfcStructuralAction.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mProjectedOrTrue = (IfcProjectedOrTrueLengthEnum)Enum.Parse(typeof(IfcProjectedOrTrueLengthEnum), s.Replace(".", "")); + if (schema != Schema.IFC2x3) + a.mPredefinedType = (IfcStructuralCurveActivityTypeEnum)Enum.Parse(typeof(IfcStructuralCurveActivityTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() + { + return base.BuildString() + ",." + mProjectedOrTrue.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "." : ".,." + mPredefinedType.ToString() + "."); + } + } + public class IfcStructuralCurveConnection : IfcStructuralConnection + { + internal IfcStructuralCurveConnection() : base() { } + internal IfcStructuralCurveConnection(IfcStructuralCurveConnection i) : base(i) { } + internal static IfcStructuralCurveConnection Parse(string strDef) { IfcStructuralCurveConnection c = new IfcStructuralCurveConnection(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcStructuralCurveConnection c, List arrFields, ref int ipos) { IfcStructuralConnection.parseFields(c, arrFields, ref ipos); } + } + public partial class IfcStructuralCurveMember : IfcStructuralMember + { + internal IfcStructuralCurveTypeEnum mPredefinedType;// : IfcStructuralCurveTypeEnum; + internal int mAxis; //: IfcDirection + + public IfcStructuralCurveTypeEnum PredefinedType { get { return mPredefinedType; } } + public IfcDirection Axis { get { return mDatabase.mIfcObjects[mAxis] as IfcDirection; } } + + public IfcStructuralCurveMember() : base() { } + internal IfcStructuralCurveMember(IfcStructuralCurveMember p) : base(p) { mPredefinedType = p.mPredefinedType; } + + internal static IfcStructuralCurveMember Parse(string strDef, Schema schema) { IfcStructuralCurveMember m = new IfcStructuralCurveMember(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcStructuralCurveMember m, List arrFields, ref int ipos, Schema schema) + { + IfcStructuralMember.parseFields(m, arrFields, ref ipos); + string s = arrFields[ipos++]; + m.mPredefinedType = (IfcStructuralCurveTypeEnum)Enum.Parse(typeof(IfcStructuralCurveTypeEnum), s.Substring(1, s.Length - 2)); + if (schema != Schema.IFC2x3) + m.mAxis = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "." : ".," + ParserSTEP.LinkToString(mAxis)); } + } + public class IfcStructuralCurveMemberVarying : IfcStructuralCurveMember + { + internal IfcStructuralCurveMemberVarying() : base() { } + internal IfcStructuralCurveMemberVarying(IfcStructuralCurveMemberVarying p) : base(p) { } + internal new static IfcStructuralCurveMemberVarying Parse(string strDef,Schema schema) { IfcStructuralCurveMemberVarying m = new IfcStructuralCurveMemberVarying(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return m; } + internal static void parseFields(IfcStructuralCurveMemberVarying m, List arrFields, ref int ipos,Schema schema) { IfcStructuralCurveMember.parseFields(m, arrFields, ref ipos,schema); } + } + public class IfcStructuralCurveReaction : IfcStructuralReaction + { + internal IfcStructuralCurveActivityTypeEnum mPredefinedType = IfcStructuralCurveActivityTypeEnum.NOTDEFINED;//: IfcStructuralCurveActivityTypeEnum; + internal IfcStructuralCurveReaction() : base() { } + internal IfcStructuralCurveReaction(IfcStructuralCurveReaction p) : base(p) { mPredefinedType = p.mPredefinedType; } + internal static IfcStructuralCurveReaction Parse(string strDef) { IfcStructuralCurveReaction r = new IfcStructuralCurveReaction(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcStructuralCurveReaction r, List arrFields, ref int ipos) { IfcStructuralReaction.parseFields(r, arrFields, ref ipos); r.mPredefinedType = (IfcStructuralCurveActivityTypeEnum)Enum.Parse(typeof(IfcStructuralCurveActivityTypeEnum), arrFields[ipos++].Replace(".", "")); } + } + public abstract partial class IfcStructuralItem : IfcProduct, IfcStructuralActivityAssignmentSelect // ABSTRACT SUPERTYPE OF (ONEOF (IfcStructuralConnection ,IfcStructuralMember)) + { + internal int mID = 0; + //INVERSE + internal List mAssignedStructuralActivity = new List();//: SET OF IfcRelConnectsStructuralActivity FOR RelatingElement; + protected IfcStructuralItem() : base() { } + protected IfcStructuralItem(IfcStructuralItem p) : base(p) { } + protected IfcStructuralItem(IfcStructuralAnalysisModel sm, int id) : base(sm.mDatabase) + { + sm.mIsGroupedBy[0].assign(this); + if (string.IsNullOrEmpty(Name)) + Name = id.ToString(); + else if (!string.IsNullOrEmpty(Description)) + Description = id.ToString(); + mID = id; + mDatabase.mContext.setStructuralUnits(); + } + protected static void parseFields(IfcStructuralItem i, List arrFields, ref int ipos) { IfcProduct.parseFields(i, arrFields, ref ipos); } + } + public partial class IfcStructuralLinearAction : IfcStructuralCurveAction + { + internal IfcStructuralLinearAction() : base() { } + internal IfcStructuralLinearAction(IfcStructuralLinearAction p) : base(p) { mProjectedOrTrue = p.mProjectedOrTrue; } + internal IfcStructuralLinearAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoadLinearForce load, bool global, bool projected) : base(lc, item, load, global, projected, IfcStructuralCurveActivityTypeEnum.CONST) { } + internal IfcStructuralLinearAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoadTemperature load, bool global, bool projected) : base(lc, item, load, global, projected, IfcStructuralCurveActivityTypeEnum.CONST) { } + internal new static IfcStructuralLinearAction Parse(string strDef,Schema schema) { IfcStructuralLinearAction a = new IfcStructuralLinearAction(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + internal static void parseFields(IfcStructuralLinearAction a, List arrFields, ref int ipos,Schema schema) { IfcStructuralCurveAction.parseFields(a, arrFields, ref ipos,schema); } + } + public class IfcStructuralLinearActionVarying : IfcStructuralLinearAction + { + internal int mVaryingAppliedLoadLocation;// : IfcShapeAspect; + internal List mSubsequentAppliedLoads = new List();//: LIST [1:?] OF IfcStructuralLoad; + internal IfcStructuralLinearActionVarying() : base() { } + internal IfcStructuralLinearActionVarying(IfcStructuralLinearActionVarying p) : base(p) { mVaryingAppliedLoadLocation = p.mVaryingAppliedLoadLocation; mSubsequentAppliedLoads = new List(p.mSubsequentAppliedLoads.ToArray()); } + internal new static IfcStructuralLinearActionVarying Parse(string strDef,Schema schema) { IfcStructuralLinearActionVarying a = new IfcStructuralLinearActionVarying(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + internal static void parseFields(IfcStructuralLinearActionVarying a, List arrFields, ref int ipos,Schema schema) { IfcStructuralLinearAction.parseFields(a, arrFields, ref ipos,schema); a.mVaryingAppliedLoadLocation = ParserSTEP.ParseLink(arrFields[ipos++]); a.mSubsequentAppliedLoads = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + "," + ParserSTEP.LinkToString(mVaryingAppliedLoadLocation) + ",(" + + ParserSTEP.LinkToString(mSubsequentAppliedLoads[0]); + for (int icounter = 1; icounter < mSubsequentAppliedLoads.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mSubsequentAppliedLoads[icounter]); + return str + ")"; + } + } + public abstract class IfcStructuralLoad : BaseClassIfc // ABSTRACT SUPERTYPE OF(ONEOF(IfcStructuralLoadConfiguration, IfcStructuralLoadOrResult)); + { + internal string mName = "$";// : OPTIONAL IfcLabel + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcStructuralLoad() : base() { } + protected IfcStructuralLoad(IfcStructuralLoad i) : base() { mName = i.mName; } + protected IfcStructuralLoad(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcStructuralLoad l, List arrFields, ref int ipos) { l.mName = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mName == "$" ? ",$" : ",'" + mName + "'"); } + } + public class IfcStructuralLoadConfiguration : IfcStructuralLoad //IFC4 + { + internal List mValues = new List();// : LIST [1:?] OF IfcStructuralLoadOrResult; + internal List> mLocations = new List>();// : OPTIONAL LIST [1:?] OF UNIQUE LIST [1:2] OF IfcLengthMeasure; + + public List Values { get { return mValues.ConvertAll(x => (mDatabase.mIfcObjects[x] as IfcStructuralLoadOrResult)); } } + + internal IfcStructuralLoadConfiguration() : base() { } + internal IfcStructuralLoadConfiguration(IfcStructuralLoadConfiguration p) : base(p) { mValues = p.mValues; mLocations = p.mLocations; } + internal IfcStructuralLoadConfiguration(DatabaseIfc m, IfcStructuralLoadOrResult val, double length) + : base(m) { mValues.Add(val.mIndex); List list = new List(1); list.Add(length); mLocations.Add(list); } + internal IfcStructuralLoadConfiguration(DatabaseIfc m, List vals, List> lengths) + : base(m) { mValues = vals.ConvertAll(x => x.mIndex); if (lengths != null) mLocations = lengths; } + internal static IfcStructuralLoadConfiguration Parse(string strDef) { IfcStructuralLoadConfiguration l = new IfcStructuralLoadConfiguration(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadConfiguration l, List arrFields, ref int ipos) + { + IfcStructuralLoad.parseFields(l, arrFields, ref ipos); + l.mValues = ParserSTEP.SplitListLinks(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s != "$") + { + List fields = ParserSTEP.SplitLineFields(s); + char[] delim = ",".ToCharArray(); + for (int icounter = 0; icounter < fields.Count; icounter++) + { + List list = new List(2); + string[] ss = fields[icounter].Substring(1, fields[icounter].Length - 2).Split(delim); + list.Add(ParserSTEP.ParseDouble(ss[0])); + if (ss.Length > 1) + list.Add(ParserSTEP.ParseDouble(ss[1])); + l.mLocations.Add(list); + } + } + } + protected override string BuildString() + { + string s = ",$"; + if (mLocations.Count > 0) + { + s = ",(" + ParserSTEP.DoubleToString(mLocations[0][0]) + (mLocations[0].Count > 1 ? "," + ParserSTEP.DoubleToString(mLocations[0][1]) : ""); + for (int icounter = 1; icounter < mLocations.Count; icounter++) + s += ")," + ParserSTEP.DoubleToString(mLocations[icounter][0]) + (mLocations[icounter].Count > 1 ? "," + ParserSTEP.DoubleToString(mLocations[icounter][1]) : ""); + s += "))"; + } + return base.BuildString() + "," + ParserSTEP.ListLinksToString(mValues) + s; + } + } + public abstract class IfcStructuralLoadOrResult : IfcStructuralLoad // ABSTRACT SUPERTYPE OF(ONEOF(IfcStructuralLoadStatic, IfcSurfaceReinforcementArea)) + { + protected IfcStructuralLoadOrResult() : base() { } + protected IfcStructuralLoadOrResult(IfcStructuralLoadOrResult p) : base(p) { } + protected IfcStructuralLoadOrResult(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcStructuralLoadOrResult l, List arrFields, ref int ipos) { IfcStructuralLoad.parseFields(l, arrFields, ref ipos); } + } + public partial class IfcStructuralLoadCase : IfcStructuralLoadGroup //IFC4 + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCSTRUCTURALLOADGROUP" : base.KeyWord); } } + + internal Tuple mSelfWeightCoefficients = null;// : OPTIONAL LIST [3:3] OF IfcRatioMeasure; + internal IfcStructuralLoadCase() : base() { } + internal IfcStructuralLoadCase(IfcStructuralLoadCase p) : base(p) { mSelfWeightCoefficients = p.mSelfWeightCoefficients; } + public IfcStructuralLoadCase(IfcStructuralAnalysisModel sm, string name, IfcActionTypeEnum action, IfcActionSourceTypeEnum source, double coeff, string purpose) + : base(sm, name, IfcLoadGroupTypeEnum.LOAD_CASE, action, source, coeff, purpose) { new IfcRelAssignsToGroup(this) { Name = Name + " Actions", Description = Description }; } + internal new static IfcStructuralLoadCase Parse(string strDef) { IfcStructuralLoadCase g = new IfcStructuralLoadCase(); int ipos = 0; parseFields(g, ParserSTEP.SplitLineFields(strDef), ref ipos); return g; } + internal static void parseFields(IfcStructuralLoadCase g, List arrFields, ref int ipos) { IfcStructuralLoadGroup.parseFields(g, arrFields, ref ipos); string s = arrFields[ipos++]; if (s.StartsWith("(")) { List fields = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); g.mSelfWeightCoefficients = new Tuple(double.Parse(fields[0]), double.Parse(fields[1]), double.Parse(fields[2])); } } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mSelfWeightCoefficients != null ? ",(" + ParserSTEP.DoubleToString(mSelfWeightCoefficients.Item1) + "," + ParserSTEP.DoubleToString(mSelfWeightCoefficients.Item2) + "," + ParserSTEP.DoubleToString(mSelfWeightCoefficients.Item3) + ")" : ",$")); } + } + public partial class IfcStructuralLoadGroup : IfcGroup + { + internal IfcLoadGroupTypeEnum mPredefinedType = IfcLoadGroupTypeEnum.NOTDEFINED;// : IfcLoadGroupTypeEnum; + internal IfcActionTypeEnum mActionType = IfcActionTypeEnum.NOTDEFINED;// : IfcActionTypeEnum; + internal IfcActionSourceTypeEnum mActionSource = IfcActionSourceTypeEnum.NOTDEFINED;//: IfcActionSourceTypeEnum; + internal double mCoefficient;//: OPTIONAL IfcRatioMeasure; + internal string mPurpose = "$";// : OPTIONAL IfcLabel; + //INVERSE + //SourceOfResultGroup : SET [0:1] OF IfcStructuralResultGroup FOR ResultForLoadGroup; + internal List mLoadGroupFor = new List();// : SET [0:?] OF IfcStructuralAnalysisModel + + internal IfcStructuralLoadGroup() : base() { } + internal IfcStructuralLoadGroup(IfcStructuralLoadGroup p) : base(p) { mPredefinedType = p.mPredefinedType; mActionType = p.mActionType; mActionSource = p.mActionSource; mCoefficient = p.mCoefficient; mPurpose = p.mPurpose; } + internal IfcStructuralLoadGroup(IfcStructuralAnalysisModel sm, string name, IfcLoadGroupTypeEnum type, IfcActionTypeEnum action, IfcActionSourceTypeEnum source, double coeff, string purpose) + : base(sm.mDatabase, name) { mLoadGroupFor.Add(sm); sm.addLoadGroup(this); mPredefinedType = type; mActionType = action; mActionSource = source; mCoefficient = coeff; if (!string.IsNullOrEmpty(purpose)) mPurpose = purpose; } + internal IfcStructuralLoadGroup(IfcStructuralAnalysisModel sm, string name, List factors, List cases, bool ULS) + : base(sm.mDatabase, name) + { + mPredefinedType = IfcLoadGroupTypeEnum.LOAD_COMBINATION; + mLoadGroupFor.Add(sm); + sm.addLoadGroup(this); + mPurpose = (ULS ? "ULS" : "SLS"); + if (factors != null && factors.Count > 0) + { + double prevfactor = factors[0]; + List ods = new List(); + for (int icounter = 0; icounter < cases.Count; icounter++) + { + double factor = (factors.Count > icounter ? factors[icounter] : prevfactor); + if (Math.Abs(factor - prevfactor) > mDatabase.Tolerance) + { + new IfcRelAssignsToGroupByFactor(this, ods, prevfactor); + ods = new List(); + prevfactor = factor; + } + ods.Add(cases[icounter]); + } + new IfcRelAssignsToGroupByFactor(this, ods, prevfactor); + } + else + { + new IfcRelAssignsToGroupByFactor(this, cases.ConvertAll(x => x as IfcObjectDefinition), 1); + } + } + + internal new static IfcStructuralLoadGroup Parse(string strDef) { IfcStructuralLoadGroup g = new IfcStructuralLoadGroup(); int ipos = 0; parseFields(g, ParserSTEP.SplitLineFields(strDef), ref ipos); return g; } + internal static void parseFields(IfcStructuralLoadGroup g, List arrFields, ref int ipos) { IfcGroup.parseFields(g, arrFields, ref ipos); g.mPredefinedType = (IfcLoadGroupTypeEnum)Enum.Parse(typeof(IfcLoadGroupTypeEnum), arrFields[ipos++].Replace(".", "")); g.mActionType = (IfcActionTypeEnum)Enum.Parse(typeof(IfcActionTypeEnum), arrFields[ipos++].Replace(".", "")); g.mActionSource = (IfcActionSourceTypeEnum)Enum.Parse(typeof(IfcActionSourceTypeEnum), arrFields[ipos++].Replace(".", "")); g.mCoefficient = ParserSTEP.ParseDouble(arrFields[ipos++]); g.mPurpose = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + ".,." + mActionType.ToString() + ".,." + mActionSource.ToString() + ".," + ParserSTEP.DoubleOptionalToString(mCoefficient) + (mPurpose == "$" ? ",$" : ",'" + mPurpose + "'"); } + } + public partial class IfcStructuralLoadLinearForce : IfcStructuralLoadStatic + { + internal double mLinearForceX = 0, mLinearForceY = 0, mLinearForceZ = 0; // : OPTIONAL IfcLinearForceMeasure + internal double mLinearMomentX = 0, mLinearMomentY = 0, mLinearMomentZ = 0;// : OPTIONAL IfcLinearMomentMeasure; + internal IfcStructuralLoadLinearForce() : base() { } + internal IfcStructuralLoadLinearForce(IfcStructuralLoadLinearForce f) : base(f) { mLinearForceX = f.mLinearForceX; mLinearForceY = f.mLinearForceY; mLinearForceZ = f.mLinearForceZ; mLinearMomentX = f.mLinearMomentX; mLinearMomentY = f.mLinearMomentY; mLinearMomentZ = f.mLinearMomentZ; } + internal IfcStructuralLoadLinearForce(DatabaseIfc m) : base(m) { } + internal static IfcStructuralLoadLinearForce Parse(string strDef) { IfcStructuralLoadLinearForce l = new IfcStructuralLoadLinearForce(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadLinearForce l, List arrFields, ref int ipos) + { IfcStructuralLoadStatic.parseFields(l, arrFields, ref ipos); l.mLinearForceX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mLinearForceY= ParserSTEP.ParseDouble(arrFields[ipos++]); l.mLinearForceZ = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mLinearMomentX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mLinearMomentY = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mLinearMomentZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mLinearForceX) + "," + ParserSTEP.DoubleOptionalToString(mLinearForceY) + "," + ParserSTEP.DoubleOptionalToString(mLinearForceZ) + "," + ParserSTEP.DoubleOptionalToString(mLinearMomentX) + "," + ParserSTEP.DoubleOptionalToString(mLinearMomentY) + "," + ParserSTEP.DoubleOptionalToString(mLinearMomentZ); } + } + public partial class IfcStructuralLoadPlanarForce : IfcStructuralLoadStatic + { + internal double mPlanarForceX = 0, mPlanarForceY = 0, mPlanarForceZ = 0;// : OPTIONAL IfcPlanarForceMeasure; + internal IfcStructuralLoadPlanarForce() : base() { } + internal IfcStructuralLoadPlanarForce(IfcStructuralLoadPlanarForce f) : base(f) { mPlanarForceX = f.mPlanarForceX; mPlanarForceY = f.mPlanarForceY; mPlanarForceZ = f.mPlanarForceZ; } + internal IfcStructuralLoadPlanarForce(DatabaseIfc m) : base(m) { } + + internal static IfcStructuralLoadPlanarForce Parse(string strDef) { IfcStructuralLoadPlanarForce l = new IfcStructuralLoadPlanarForce(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadPlanarForce l, List arrFields, ref int ipos) { IfcStructuralLoadStatic.parseFields(l, arrFields, ref ipos); l.mPlanarForceX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mPlanarForceY = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mPlanarForceZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mPlanarForceX) + "," + ParserSTEP.DoubleOptionalToString(mPlanarForceY) + "," + ParserSTEP.DoubleOptionalToString(mPlanarForceZ); } + } + public partial class IfcStructuralLoadSingleDisplacement : IfcStructuralLoadStatic + { + internal double mDisplacementX = 0, mDisplacementY = 0, mDisplacementZ = 0;// : OPTIONAL IfcLengthMeasure; + internal double mRotationalDisplacementRX = 0, mRotationalDisplacementRY = 0, mRotationalDisplacementRZ = 0;// : OPTIONAL IfcPlaneAngleMeasure; + internal IfcStructuralLoadSingleDisplacement() : base() { } + internal IfcStructuralLoadSingleDisplacement(IfcStructuralLoadSingleDisplacement d) : base(d) { mDisplacementX = d.mDisplacementX; mDisplacementY = d.mDisplacementY; mDisplacementZ = d.mDisplacementZ; mRotationalDisplacementRX = d.mRotationalDisplacementRX; mRotationalDisplacementRY = d.mRotationalDisplacementRY; mRotationalDisplacementRZ = d.mRotationalDisplacementRZ; } + public IfcStructuralLoadSingleDisplacement(DatabaseIfc m) : base(m) { } + internal static IfcStructuralLoadSingleDisplacement Parse(string strDef) { IfcStructuralLoadSingleDisplacement l = new IfcStructuralLoadSingleDisplacement(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadSingleDisplacement l, List arrFields, ref int ipos) { IfcStructuralLoadStatic.parseFields(l, arrFields, ref ipos); l.mDisplacementX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mDisplacementY = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mDisplacementZ = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mRotationalDisplacementRX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mRotationalDisplacementRY = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mRotationalDisplacementRZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mDisplacementX) + "," + ParserSTEP.DoubleOptionalToString(mDisplacementY) + "," + ParserSTEP.DoubleOptionalToString(mDisplacementZ) + "," + ParserSTEP.DoubleOptionalToString(mRotationalDisplacementRX) + "," + ParserSTEP.DoubleOptionalToString(mRotationalDisplacementRY) + "," + ParserSTEP.DoubleOptionalToString(mRotationalDisplacementRZ); } + } + public class IfcStructuralLoadSingleDisplacementDistortion : IfcStructuralLoadSingleDisplacement + { + internal double mDistortion;// : OPTIONAL IfcCurvatureMeasure; + internal IfcStructuralLoadSingleDisplacementDistortion() : base() { } + internal IfcStructuralLoadSingleDisplacementDistortion(IfcStructuralLoadSingleDisplacementDistortion p) : base(p) { mDistortion = p.mDistortion; } + internal new static IfcStructuralLoadSingleDisplacementDistortion Parse(string strDef) { IfcStructuralLoadSingleDisplacementDistortion l = new IfcStructuralLoadSingleDisplacementDistortion(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadSingleDisplacementDistortion l, List arrFields, ref int ipos) { IfcStructuralLoadSingleDisplacement.parseFields(l, arrFields, ref ipos); l.mDistortion = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mDistortion); } + } + public partial class IfcStructuralLoadSingleForce : IfcStructuralLoadStatic + { + internal double mForceX = 0, mForceY = 0, mForceZ = 0;// : OPTIONAL IfcForceMeasure; + internal double mMomentX = 0, mMomentY = 0, mMomentZ = 0;// : OPTIONAL IfcTorqueMeasure; + internal IfcStructuralLoadSingleForce() : base() { } + internal IfcStructuralLoadSingleForce(IfcStructuralLoadSingleForce f) : base(f) { mForceX = f.mForceX; mForceY = f.mForceY; mForceZ = f.mForceZ; mMomentX = f.mMomentX; mMomentY = f.mMomentY; mMomentZ = f.mMomentZ; } + internal IfcStructuralLoadSingleForce(DatabaseIfc m) : base(m) { } + internal static IfcStructuralLoadSingleForce Parse(string strDef) { IfcStructuralLoadSingleForce l = new IfcStructuralLoadSingleForce(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadSingleForce l, List arrFields, ref int ipos) { IfcStructuralLoadStatic.parseFields(l, arrFields, ref ipos); l.mForceX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mForceY = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mForceZ = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mMomentX = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mMomentY = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mMomentZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mForceX) + "," + ParserSTEP.DoubleOptionalToString(mForceY) + "," + ParserSTEP.DoubleOptionalToString(mForceZ) + "," + ParserSTEP.DoubleOptionalToString(mMomentX) + "," + ParserSTEP.DoubleOptionalToString(mMomentY) + "," + ParserSTEP.DoubleOptionalToString(mMomentZ); } + } + public class IfcStructuralLoadSingleForceWarping : IfcStructuralLoadSingleForce + { + internal double mWarpingMoment;// : OPTIONAL IfcWarpingMomentMeasure; + internal IfcStructuralLoadSingleForceWarping() : base() { } + internal IfcStructuralLoadSingleForceWarping(IfcStructuralLoadSingleForceWarping p) : base(p) { mWarpingMoment = p.mWarpingMoment; } + internal new static IfcStructuralLoadSingleForceWarping Parse(string strDef) { IfcStructuralLoadSingleForceWarping l = new IfcStructuralLoadSingleForceWarping(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadSingleForceWarping l, List arrFields, ref int ipos) { IfcStructuralLoadSingleForce.parseFields(l, arrFields, ref ipos); l.mWarpingMoment = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mWarpingMoment); } + } + public abstract class IfcStructuralLoadStatic : IfcStructuralLoadOrResult /*ABSTRACT SUPERTYPE OF (ONEOF (IfcStructuralLoadLinearForce ,IfcStructuralLoadPlanarForce ,IfcStructuralLoadSingleDisplacement ,IfcStructuralLoadSingleForce ,IfcStructuralLoadTemperature))*/ + { + protected IfcStructuralLoadStatic() : base() { } + protected IfcStructuralLoadStatic(IfcStructuralLoadStatic p) : base(p) { } + protected IfcStructuralLoadStatic(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcStructuralLoadStatic l, List arrFields, ref int ipos) { IfcStructuralLoadOrResult.parseFields(l, arrFields, ref ipos); } + } + public class IfcStructuralLoadTemperature : IfcStructuralLoadStatic + { + internal double mDeltaT_Constant, mDeltaT_Y, mDeltaT_Z;// : OPTIONAL IfcThermodynamicTemperatureMeasure; + internal IfcStructuralLoadTemperature() : base() { } + internal IfcStructuralLoadTemperature(IfcStructuralLoadTemperature p) : base(p) { mDeltaT_Constant = p.mDeltaT_Constant; mDeltaT_Y = p.mDeltaT_Y; mDeltaT_Z = p.mDeltaT_Z; } + internal IfcStructuralLoadTemperature(DatabaseIfc m, double T, double TY, double TZ) : base(m) { mDeltaT_Constant = T; mDeltaT_Y = TY; mDeltaT_Z = TZ; } + internal static IfcStructuralLoadTemperature Parse(string strDef) { IfcStructuralLoadTemperature l = new IfcStructuralLoadTemperature(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcStructuralLoadTemperature l, List arrFields, ref int ipos) { IfcStructuralLoadStatic.parseFields(l, arrFields, ref ipos); l.mDeltaT_Constant = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mDeltaT_Y = ParserSTEP.ParseDouble(arrFields[ipos++]); l.mDeltaT_Z = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mDeltaT_Constant) + "," + ParserSTEP.DoubleOptionalToString(mDeltaT_Y) + "," + ParserSTEP.DoubleOptionalToString(mDeltaT_Z); } + } + public abstract partial class IfcStructuralMember : IfcStructuralItem //ABSTRACT SUPERTYPE OF(ONEOF(IfcStructuralCurveMember, IfcStructuralSurfaceMember)) + { + //INVERSE + internal List mConnectedBy = new List();// : SET [0:?] OF IfcRelConnectsStructuralMember FOR RelatingStructuralMember + internal IfcRelConnectsStructuralElement mStructuralMemberForGG = null; + protected IfcStructuralMember() : base() { } + protected IfcStructuralMember(IfcStructuralMember i) : base(i) { } + + + protected static void parseFields(IfcStructuralMember m, List arrFields, ref int ipos) { IfcStructuralItem.parseFields(m, arrFields, ref ipos); } + + + } + public partial class IfcStructuralPlanarAction : IfcStructuralSurfaceAction // Ifc2x3 IfcStructuralAction + { + internal IfcStructuralPlanarAction() : base() { } + internal IfcStructuralPlanarAction(IfcStructuralPlanarAction p) : base(p) { mProjectedOrTrue = p.mProjectedOrTrue; } + internal IfcStructuralPlanarAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoadPlanarForce load, bool global, bool projected) + : base(lc, item, load, global, projected, IfcStructuralSurfaceActivityTypeEnum.CONST) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " in IFC4 Only"); } + internal IfcStructuralPlanarAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoadTemperature load, bool global, bool projected) + : base(lc, item, load, global, projected, IfcStructuralSurfaceActivityTypeEnum.CONST) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " in IFC4 Only"); } + + internal new static IfcStructuralPlanarAction Parse(string strDef,Schema schema) { IfcStructuralPlanarAction a = new IfcStructuralPlanarAction(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + internal static void parseFields(IfcStructuralPlanarAction a, List arrFields, ref int ipos,Schema schema) { IfcStructuralSurfaceAction.parseFields(a, arrFields, ref ipos,schema); } + protected override string BuildString() { return base.BuildString() + ",." + mProjectedOrTrue.ToString() + "."; } + } + public partial class IfcStructuralPointAction : IfcStructuralAction + { + internal IfcStructuralPointAction() : base() { } + internal IfcStructuralPointAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoadSingleForce l, bool global) : base(lc, item, l, global) { } + internal IfcStructuralPointAction(IfcStructuralPointAction p) : base(p) { } + internal IfcStructuralPointAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoadSingleDisplacement l, bool global) : base(lc, item, l, global) { } + internal static IfcStructuralPointAction Parse(string strDef) + { + IfcStructuralPointAction a = new IfcStructuralPointAction(); + int ipos = 0; + parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); + return a; + } + internal static void parseFields(IfcStructuralPointAction a, List arrFields, ref int ipos) { IfcStructuralAction.parseFields(a, arrFields, ref ipos); } + } + public partial class IfcStructuralPointConnection : IfcStructuralConnection + { + private int mConditionCoordinateSystem = 0;// : OPTIONAL IfcAxis2Placement3D; + + internal IfcAxis2Placement3D ConditionCoordinateSystem { get { return mDatabase.mIfcObjects[mConditionCoordinateSystem] as IfcAxis2Placement3D; } set { mConditionCoordinateSystem = (value == null ? 0 : value.mIndex); } } + public new IfcBoundaryNodeCondition AppliedCondition { get { return mDatabase.mIfcObjects[mAppliedCondition] as IfcBoundaryNodeCondition; } set { mAppliedCondition = (value == null ? 0 : value.mIndex); } } + + public IfcStructuralPointConnection() : base() { } + internal IfcStructuralPointConnection(IfcStructuralPointConnection c) : base(c) { } + + internal static IfcStructuralPointConnection Parse(string strDef) { IfcStructuralPointConnection c = new IfcStructuralPointConnection(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcStructuralPointConnection c, List arrFields, ref int ipos) + { + IfcStructuralConnection.parseFields(c, arrFields, ref ipos); + if (ipos < arrFields.Count) + c.mConditionCoordinateSystem = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mConditionCoordinateSystem == 0 ? ",$" : ",#" + mConditionCoordinateSystem)); } + } + public class IfcStructuralPointReaction : IfcStructuralReaction + { + internal IfcStructuralPointReaction() : base() { } + internal IfcStructuralPointReaction(IfcStructuralPointReaction p) : base(p) { } + internal static IfcStructuralPointReaction Parse(string strDef) { IfcStructuralPointReaction r = new IfcStructuralPointReaction(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos); return r; } + internal static void parseFields(IfcStructuralPointReaction r, List arrFields, ref int ipos) { IfcStructuralReaction.parseFields(r, arrFields, ref ipos); } + } + public class IfcStructuralProfileProperties : IfcGeneralProfileProperties //IFC4 DELETED Entity replaced by IfcProfileProperties + { + internal double mTorsionalConstantX, mMomentOfInertiaYZ, mMomentOfInertiaY, mMomentOfInertiaZ;// : OPTIONAL IfcMomentOfInertiaMeasure; + internal double mWarpingConstant;// : OPTIONAL IfcWarpingConstantMeasure; + internal double mShearCentreZ, mShearCentreY;// : OPTIONAL IfcLengthMeasure; + internal double mShearDeformationAreaZ, mShearDeformationAreaY;// : OPTIONAL IfcAreaMeasure; + internal double mMaximumSectionModulusY, mMinimumSectionModulusY, mMaximumSectionModulusZ, mMinimumSectionModulusZ;// : OPTIONAL IfcSectionModulusMeasure; + internal double mTorsionalSectionModulus;// : OPTIONAL IfcSectionModulusMeasure; + internal double mCentreOfGravityInX, mCentreOfGravityInY;// : OPTIONAL IfcLengthMeasure; + internal IfcStructuralProfileProperties() : base() { } + internal IfcStructuralProfileProperties(IfcStructuralProfileProperties p) : base(p) + { + mTorsionalConstantX = p.mTorsionalConstantX; mMomentOfInertiaYZ = p.mMomentOfInertiaYZ; mMomentOfInertiaY = p.mMomentOfInertiaY; + mMomentOfInertiaZ = p.mMomentOfInertiaZ; mWarpingConstant = p.mWarpingConstant; + mShearCentreZ = p.mShearCentreZ; mShearCentreY = p.mShearCentreY; + mShearDeformationAreaZ = p.mShearDeformationAreaZ; mShearDeformationAreaY = p.mShearDeformationAreaY; + mMaximumSectionModulusY = p.mMaximumSectionModulusY; mMinimumSectionModulusY = p.mMinimumSectionModulusY; mMaximumSectionModulusZ = p.mMaximumSectionModulusZ; mMinimumSectionModulusZ = p.mMinimumSectionModulusZ; + mTorsionalSectionModulus = p.mTorsionalSectionModulus; + mCentreOfGravityInX = p.mCentreOfGravityInX; mCentreOfGravityInY = p.mCentreOfGravityInY; + } + internal static void parseFields(IfcStructuralProfileProperties gp, List arrFields, ref int ipos) + { + IfcGeneralProfileProperties.parseFields(gp, arrFields, ref ipos); + gp.mTorsionalConstantX = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mMomentOfInertiaYZ = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mMomentOfInertiaY = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mMomentOfInertiaZ = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mWarpingConstant = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mShearCentreZ = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mShearCentreY = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mShearDeformationAreaZ = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mShearDeformationAreaY = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mMaximumSectionModulusY = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mMinimumSectionModulusY = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mMaximumSectionModulusZ = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mMinimumSectionModulusZ = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mTorsionalSectionModulus = ParserSTEP.ParseDouble(arrFields[ipos++]); + gp.mCentreOfGravityInX = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mCentreOfGravityInY = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal new static IfcStructuralProfileProperties Parse(string strDef) { IfcStructuralProfileProperties p = new IfcStructuralProfileProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mTorsionalConstantX) + "," + ParserSTEP.DoubleOptionalToString(mMomentOfInertiaYZ) + "," + ParserSTEP.DoubleOptionalToString(mMomentOfInertiaY) + "," + ParserSTEP.DoubleOptionalToString(mMomentOfInertiaZ) + "," + + ParserSTEP.DoubleOptionalToString(mWarpingConstant) + "," + ParserSTEP.DoubleOptionalToString(mShearCentreZ) + "," + ParserSTEP.DoubleOptionalToString(mShearCentreY) + "," + ParserSTEP.DoubleOptionalToString(mShearDeformationAreaZ) + "," + + ParserSTEP.DoubleOptionalToString(mShearDeformationAreaY) + "," + ParserSTEP.DoubleOptionalToString(mMaximumSectionModulusY) + "," + ParserSTEP.DoubleOptionalToString(mMinimumSectionModulusY) + "," + ParserSTEP.DoubleOptionalToString(mMaximumSectionModulusZ) + "," + + ParserSTEP.DoubleOptionalToString(mMinimumSectionModulusZ) + "," + ParserSTEP.DoubleOptionalToString(mTorsionalSectionModulus) + "," + ParserSTEP.DoubleOptionalToString(mCentreOfGravityInX) + "," + ParserSTEP.DoubleOptionalToString(mCentreOfGravityInY); + } + } + public abstract class IfcStructuralReaction : IfcStructuralActivity + { //INVERSE + //internal List mCauses = new List();// : OPTIONAL IfcStructuralReaction; + protected IfcStructuralReaction() : base() { } + protected IfcStructuralReaction(IfcStructuralReaction p) : base(p) { } + protected static void parseFields(IfcStructuralReaction a, List arrFields, ref int ipos) { IfcStructuralActivity.parseFields(a, arrFields, ref ipos); } + } + public class IfcStructuralResultGroup : IfcGroup + { + internal IfcAnalysisTheoryTypeEnum mTheoryType = IfcAnalysisTheoryTypeEnum.NOTDEFINED;// : IfcAnalysisTheoryTypeEnum; + internal int mResultForLoadGroup;// : OPTIONAL IfcStructuralLoadGroup; + internal bool mIsLinear = false;// : BOOLEAN; + internal IfcStructuralResultGroup() : base() { } + internal IfcStructuralResultGroup(IfcStructuralResultGroup p) : base(p) { mTheoryType = p.mTheoryType; mResultForLoadGroup = p.mResultForLoadGroup; mIsLinear = p.mIsLinear; } + internal IfcStructuralResultGroup(DatabaseIfc m, string name) : base(m, name) { } + internal new static IfcStructuralResultGroup Parse(string strDef) { IfcStructuralResultGroup g = new IfcStructuralResultGroup(); int ipos = 0; parseFields(g, ParserSTEP.SplitLineFields(strDef), ref ipos); return g; } + internal static void parseFields(IfcStructuralResultGroup g, List arrFields, ref int ipos) + { + IfcGroup.parseFields(g, arrFields, ref ipos); + g.mTheoryType = (IfcAnalysisTheoryTypeEnum)Enum.Parse(typeof(IfcAnalysisTheoryTypeEnum), arrFields[ipos++].Replace(".", "")); + g.mResultForLoadGroup = ParserSTEP.ParseLink(arrFields[ipos++]); + g.mIsLinear = ParserSTEP.ParseBool(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",." + mTheoryType.ToString() + ".," + ParserSTEP.LinkToString(mResultForLoadGroup) + "," + ParserSTEP.BoolToString(mIsLinear); } + } + public class IfcStructuralSteelProfileProperties : IfcStructuralProfileProperties //IFC4 DELETED Entity replaced by IfcProfileProperties + { + internal double mShearAreaZ;// : OPTIONAL IfcAreaMeasure; + internal double mShearAreaY;// : OPTIONAL IfcAreaMeasure; + internal double mPlasticShapeFactorY;// : OPTIONAL IfcPositiveRatioMeasure; + internal double mPlasticShapeFactorZ;// : OPTIONAL IfcPositiveRatioMeasure; + internal IfcStructuralSteelProfileProperties() : base() { } + internal IfcStructuralSteelProfileProperties(IfcStructuralSteelProfileProperties p) : base(p) { mShearAreaZ = p.mShearAreaZ; mShearAreaY = p.mShearAreaY; mPlasticShapeFactorY = p.mPlasticShapeFactorY; mPlasticShapeFactorZ = p.mPlasticShapeFactorZ; } + internal static void parseFields(IfcStructuralSteelProfileProperties gp, List arrFields, ref int ipos) { IfcStructuralProfileProperties.parseFields(gp, arrFields, ref ipos); gp.mShearAreaZ = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mShearAreaY = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mPlasticShapeFactorY = ParserSTEP.ParseDouble(arrFields[ipos++]); gp.mPlasticShapeFactorZ = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal new static IfcStructuralSteelProfileProperties Parse(string strDef) { IfcStructuralSteelProfileProperties p = new IfcStructuralSteelProfileProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mShearAreaZ) + "," + ParserSTEP.DoubleOptionalToString(mShearAreaY) + "," + ParserSTEP.DoubleOptionalToString(mPlasticShapeFactorY) + "," + ParserSTEP.DoubleOptionalToString(mPlasticShapeFactorZ); } + } + public partial class IfcStructuralSurfaceAction : IfcStructuralAction //IFC4 SUPERTYPE OF(IfcStructuralPlanarAction) + { + internal IfcProjectedOrTrueLengthEnum mProjectedOrTrue = IfcProjectedOrTrueLengthEnum.TRUE_LENGTH;// : IfcProjectedOrTrueLengthEnum + internal IfcStructuralSurfaceActivityTypeEnum mPredefinedType = IfcStructuralSurfaceActivityTypeEnum.NOTDEFINED;//IfcStructuralCurveActivityTypeEnum + internal IfcStructuralSurfaceAction() : base() { } + internal IfcStructuralSurfaceAction(IfcStructuralSurfaceAction p) : base(p) { mProjectedOrTrue = p.mProjectedOrTrue; mPredefinedType = p.mPredefinedType; } + internal IfcStructuralSurfaceAction(IfcStructuralLoadCase lc, IfcStructuralActivityAssignmentSelect item, IfcStructuralLoad load, bool global, bool projected, IfcStructuralSurfaceActivityTypeEnum type) + : base(lc, item, load, global) { if (mDatabase.mSchema == Schema.IFC2x3) throw new Exception(KeyWord + " in IFC4 Only"); mProjectedOrTrue = projected ? IfcProjectedOrTrueLengthEnum.PROJECTED_LENGTH : IfcProjectedOrTrueLengthEnum.TRUE_LENGTH; mPredefinedType = type; } + internal static IfcStructuralSurfaceAction Parse(string strDef, Schema schema) { IfcStructuralSurfaceAction a = new IfcStructuralSurfaceAction(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + internal static void parseFields(IfcStructuralSurfaceAction a, List arrFields, ref int ipos, Schema schema) + { + IfcStructuralAction.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mProjectedOrTrue = (IfcProjectedOrTrueLengthEnum)Enum.Parse(typeof(IfcProjectedOrTrueLengthEnum), s.Replace(".", "")); + if (schema != Schema.IFC2x3) + a.mPredefinedType = (IfcStructuralSurfaceActivityTypeEnum)Enum.Parse(typeof(IfcStructuralSurfaceActivityTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + ",." + mProjectedOrTrue.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "." : ".,." + mPredefinedType.ToString() + "."); } + } + public partial class IfcStructuralSurfaceConnection : IfcStructuralConnection + { + internal IfcStructuralSurfaceConnection() : base() { } + internal IfcStructuralSurfaceConnection(IfcStructuralSurfaceConnection c) : base(c) { } + + internal static IfcStructuralSurfaceConnection Parse(string strDef) { IfcStructuralSurfaceConnection c = new IfcStructuralSurfaceConnection(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + internal static void parseFields(IfcStructuralSurfaceConnection c, List arrFields, ref int ipos) { IfcStructuralConnection.parseFields(c, arrFields, ref ipos); } + } + public partial class IfcStructuralSurfaceMember : IfcStructuralMember + { + internal IfcStructuralSurfaceTypeEnum mPredefinedType = IfcStructuralSurfaceTypeEnum.NOTDEFINED;// : IfcStructuralSurfaceTypeEnum; + internal double mThickness;// : OPTIONAL IfcPositiveLengthMeasure; + + public IfcStructuralSurfaceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + public IfcStructuralSurfaceMember() : base() { } + internal IfcStructuralSurfaceMember(IfcStructuralSurfaceMember p) : base(p) { mPredefinedType = p.mPredefinedType; mThickness = p.mThickness; } + + internal static IfcStructuralSurfaceMember Parse(string strDef) { IfcStructuralSurfaceMember m = new IfcStructuralSurfaceMember(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcStructuralSurfaceMember sm, List arrFields, ref int ipos) { IfcStructuralMember.parseFields(sm, arrFields, ref ipos); sm.mPredefinedType = (IfcStructuralSurfaceTypeEnum)Enum.Parse(typeof(IfcStructuralSurfaceTypeEnum), arrFields[ipos++].Replace(".", "")); sm.mThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + ".," + ParserSTEP.DoubleOptionalToString(mThickness); } + } + public class IfcStructuralSurfaceMemberVarying : IfcStructuralSurfaceMember + { + internal List mSubsequentThickness = new List();// : LIST [2:?] OF IfcPositiveLengthMeasure; + internal int mVaryingThicknessLocation;// : IfcShapeAspect; + internal IfcStructuralSurfaceMemberVarying() : base() { } + internal IfcStructuralSurfaceMemberVarying(IfcStructuralSurfaceMemberVarying p) : base(p) { mSubsequentThickness = new List(p.mSubsequentThickness.ToArray()); mVaryingThicknessLocation = p.mVaryingThicknessLocation; } + internal new static IfcStructuralSurfaceMemberVarying Parse(string strDef) { IfcStructuralSurfaceMemberVarying m = new IfcStructuralSurfaceMemberVarying(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcStructuralSurfaceMemberVarying sm, List arrFields, ref int ipos) + { + IfcStructuralSurfaceMember.parseFields(sm, arrFields, ref ipos); + List lst = ParserSTEP.SplitLineFields(arrFields[ipos++]); + for (int icounter = 0; icounter < lst.Count; icounter++) + sm.mSubsequentThickness.Add(ParserSTEP.ParseDouble(lst[icounter])); + sm.mVaryingThicknessLocation = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.DoubleToString(mSubsequentThickness[0]); + for (int icounter = 1; icounter < mSubsequentThickness.Count; icounter++) + str += "," + ParserSTEP.DoubleToString(mSubsequentThickness[icounter]); + return str + ")" + "," + ParserSTEP.LinkToString(mVaryingThicknessLocation); + } + } + public class IfcStructuredDimensionCallout : IfcDraughtingCallout // DEPRECEATED IFC4 + { + internal IfcStructuredDimensionCallout() : base() { } + internal IfcStructuredDimensionCallout(IfcStructuredDimensionCallout i) : base(i) { } + internal new static IfcStructuredDimensionCallout Parse(string strDef) { IfcStructuredDimensionCallout d = new IfcStructuredDimensionCallout(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + internal static void parseFields(IfcStructuredDimensionCallout d, List arrFields, ref int ipos) { IfcDraughtingCallout.parseFields(d, arrFields, ref ipos); } + } + public partial interface IfcStyleAssignmentSelect : IfcInterface //(IfcPresentationStyle ,IfcPresentationStyleAssignment); update styledItems inverse + { + List StyledItems { get; } + } + public partial class IfcStyledItem : IfcRepresentationItem + { + private int mItem;// : OPTIONAL IfcRepresentationItem; + private List mStyles = new List();// : SET [1:?] OF IfcStyleAssignmentSelect; ifc2x3 IfcPresentationStyleAssignment; + private string mName = "$";// : OPTIONAL IfcLabel; + + internal IfcRepresentationItem Item { get { return mDatabase.mIfcObjects[mItem] as IfcRepresentationItem; } set { mItem = (value == null ? 0 : value.mIndex); } } + internal List Styles { get { return mStyles.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcStyleAssignmentSelect); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcStyledItem() : base() { } + internal IfcStyledItem(IfcStyledItem el) : base(el) { mItem = el.mItem; mStyles.AddRange(el.mStyles); } + public IfcStyledItem(IfcStyleAssignmentSelect style, string name) : base(style.Database) { Name = name; mStyles.Add(style.Index); } + + internal static IfcStyledItem Parse(string strDef) { IfcStyledItem i = new IfcStyledItem(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcStyledItem i, List arrFields, ref int ipos) + { + IfcRepresentationItem.parseFields(i, arrFields, ref ipos); + i.mItem = ParserSTEP.ParseLink(arrFields[ipos++]); + i.mStyles = ParserSTEP.SplitListLinks(arrFields[ipos++]); + i.mName = arrFields[ipos++].Replace("'", ""); + } + internal void associateItem() + { + IfcRepresentationItem ri = Item; + if (ri != null) + ri.mStyledByItem = this; + List styles = Styles; + for (int icounter = 0; icounter < styles.Count; icounter++) + { + IfcPresentationStyle ps = styles[icounter] as IfcPresentationStyle; + if (ps != null) + ps.mStyledItems.Add(this); + else + { + IfcPresentationStyleAssignment psa = styles[icounter] as IfcPresentationStyleAssignment; + if (psa != null) + psa.mStyledItems.Add(this); + } + } + } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string result = base.BuildString() + "," + ParserSTEP.LinkToString(mItem); + if (mStyles.Count > 0) + { + result += ",(" + ParserSTEP.LinkToString(mStyles[0]); + for (int icounter = 1; icounter < mStyles.Count; icounter++) + result += "," + ParserSTEP.LinkToString(mStyles[icounter]); + } + else + result += ",("; + return result + (mName == "$" ? "),$" : "),'" + mName + "'"); + } + } + public class IfcStyledRepresentation : IfcStyleModel + { + internal new List Items { get { return base.Items.ConvertAll(x => x as IfcStyledItem); } } + + internal IfcStyledRepresentation() : base() { } + internal IfcStyledRepresentation(IfcStyledRepresentation i) : base(i) { } + internal IfcStyledRepresentation(IfcStyledItem ri) : base(ri) { } + public IfcStyledRepresentation(List reps) : base(reps.ConvertAll(x => x as IfcRepresentationItem)) { } + internal new static IfcStyledRepresentation Parse(string strDef) + { + IfcStyledRepresentation r = new IfcStyledRepresentation(); + int pos = 0; + IfcShapeModel.parseString(r, strDef, ref pos); + return r; + } + } + public abstract class IfcStyleModel : IfcRepresentation //ABSTRACT SUPERTYPE OF(IfcStyledRepresentation) + { + protected IfcStyleModel() : base() { } + protected IfcStyleModel(IfcStyleModel i) : base(i) { } + protected IfcStyleModel(IfcRepresentationItem ri) : base(ri) { } + protected IfcStyleModel(List reps) : base(reps, "", "") { } + + protected static void parseString(IfcStyleModel shape, string str, ref int pos) { IfcRepresentation.parseString(shape, str, ref pos); } + } + public class IfcSubContractResource : IfcConstructionResource + { + internal IfcSubContractResourceTypeEnum mPredefinedType = IfcSubContractResourceTypeEnum.NOTDEFINED;// OPTIONAL : IfcRoofTypeEnum; + public IfcSubContractResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcSubContractResource() : base() { } + internal IfcSubContractResource(IfcSubContractResource o) : base(o) { mPredefinedType = o.mPredefinedType; } + internal IfcSubContractResource(DatabaseIfc m) : base(m) { } + internal static IfcSubContractResource Parse(string strDef, Schema schema) { IfcSubContractResource r = new IfcSubContractResource(); int ipos = 0; parseFields(r, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return r; } + internal static void parseFields(IfcSubContractResource r, List arrFields, ref int ipos, Schema schema) + { + IfcConstructionResource.parseFields(r, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + r.mPredefinedType = (IfcSubContractResourceTypeEnum)Enum.Parse(typeof(IfcSubContractResourceTypeEnum), str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcSubContractResourceType : IfcConstructionResourceType //IFC4 + { + internal IfcSubContractResourceTypeEnum mPredefinedType = IfcSubContractResourceTypeEnum.NOTDEFINED; + public IfcSubContractResourceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSubContractResourceType() : base() { } + internal IfcSubContractResourceType(IfcSubContractResourceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcSubContractResourceType(DatabaseIfc m, string name, IfcSubContractResourceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcSubContractResourceType t, List arrFields, ref int ipos) { IfcSubContractResourceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSubContractResourceTypeEnum)Enum.Parse(typeof(IfcSubContractResourceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSubContractResourceType Parse(string strDef) { IfcSubContractResourceType t = new IfcSubContractResourceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcSubedge : IfcEdge + { + internal int mParentEdge;// IfcEdge; + internal IfcSubedge() : base() { } + internal IfcSubedge(IfcSubedge el) : base(el) { mParentEdge = el.mParentEdge; } + public IfcSubedge(IfcVertex v1, IfcVertex v2, IfcEdge e) : base(v1, v2) { mParentEdge = e.mIndex; } + internal new static IfcSubedge Parse(string strDef) { IfcSubedge e = new IfcSubedge(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcSubedge e, List arrFields, ref int ipos) { IfcEdge.parseFields(e, arrFields, ref ipos); e.mParentEdge = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mParentEdge); } + } + public abstract partial class IfcSurface : IfcGeometricRepresentationItem, IfcGeometricSetSelect /* ABSTRACT SUPERTYPE OF (ONEOF(IfcBoundedSurface,IfcElementarySurface,IfcSweptSurface))*/ + { + protected IfcSurface() : base() { } + protected IfcSurface(IfcSurface p) : base(p) { } + protected IfcSurface(DatabaseIfc db) : base(db) { } + protected static void parseFields(IfcSurface s, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcSurfaceCurveSweptAreaSolid : IfcSweptAreaSolid + { + internal int mDirectrix; // : IfcCurve; + internal double mStartParam = 0;// : OPT IfcParameterValue; OPT IFC4 + internal double mEndParam;//: OPT IfcParameterValue; OPT IFC4 + internal int mReferenceSurface;// : IfcSurface; + + internal IfcCurve Directrix { get { return mDatabase.mIfcObjects[mDirectrix] as IfcCurve; } } + internal IfcSurface ReferenceSurface { get { return mDatabase.mIfcObjects[mReferenceSurface] as IfcSurface; } } + + internal IfcSurfaceCurveSweptAreaSolid() : base() { } + internal IfcSurfaceCurveSweptAreaSolid(IfcSurfaceCurveSweptAreaSolid p) : base(p) { mDirectrix = p.mDirectrix; mStartParam = p.mStartParam; mEndParam = p.mEndParam; mReferenceSurface = p.mReferenceSurface; } + + internal static void parseFields(IfcSurfaceCurveSweptAreaSolid s, List arrFields, ref int ipos) { IfcSweptAreaSolid.parseFields(s, arrFields, ref ipos); s.mDirectrix = ParserSTEP.ParseLink(arrFields[ipos++]); s.mStartParam = ParserSTEP.ParseDouble(arrFields[ipos++]); s.mEndParam = ParserSTEP.ParseDouble(arrFields[ipos++]); s.mReferenceSurface = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcSurfaceCurveSweptAreaSolid Parse(string strDef) { IfcSurfaceCurveSweptAreaSolid s = new IfcSurfaceCurveSweptAreaSolid(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mDirectrix) + "," + ParserSTEP.DoubleToString(mStartParam) + "," + ParserSTEP.DoubleToString(mEndParam) + "," + ParserSTEP.LinkToString(mReferenceSurface); } + } + public partial class IfcSurfaceOfLinearExtrusion : IfcSweptSurface + { + internal int mExtrudedDirection;// : IfcDirection; + internal double mDepth;// : IfcLengthMeasure; + + internal IfcDirection ExtrudedDirection { get { return mDatabase.mIfcObjects[mExtrudedDirection] as IfcDirection; } } + + internal IfcSurfaceOfLinearExtrusion() : base() { } + internal IfcSurfaceOfLinearExtrusion(IfcSurfaceOfLinearExtrusion p) : base(p) { mExtrudedDirection = p.mExtrudedDirection; mDepth = p.mDepth; } + + internal static void parseFields(IfcSurfaceOfLinearExtrusion s, List arrFields, ref int ipos) { IfcSweptSurface.parseFields(s, arrFields, ref ipos); s.mExtrudedDirection = ParserSTEP.ParseLink(arrFields[ipos++]); s.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcSurfaceOfLinearExtrusion Parse(string strDef) { IfcSurfaceOfLinearExtrusion s = new IfcSurfaceOfLinearExtrusion(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mExtrudedDirection) + "," + ParserSTEP.DoubleToString(mDepth); } + } + public partial class IfcSurfaceOfRevolution : IfcSweptSurface + { + internal int mAxisPosition;// : IfcAxis1Placement; + public IfcAxis1Placement AxisPosition { get { return mDatabase.mIfcObjects[mAxisPosition] as IfcAxis1Placement; } } + + internal IfcSurfaceOfRevolution() : base() { } + internal IfcSurfaceOfRevolution(IfcSurfaceOfRevolution p) : base(p) { mAxisPosition = p.mAxisPosition; } + + internal static void parseFields(IfcSurfaceOfRevolution s, List arrFields, ref int ipos) { IfcSweptSurface.parseFields(s, arrFields, ref ipos); s.mAxisPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcSurfaceOfRevolution Parse(string strDef) { IfcSurfaceOfRevolution s = new IfcSurfaceOfRevolution(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mAxisPosition); } + } + public partial class IfcSurfaceStyle : IfcPresentationStyle, IfcPresentationStyleSelect + { + internal IfcSurfaceSide mSide = IfcSurfaceSide.BOTH;// : IfcSurfaceSide; + internal List mStyles = new List();// : SET [1:5] OF IfcSurfaceStyleElementSelect; + internal IfcSurfaceStyle() : base() { } + internal IfcSurfaceStyle(IfcSurfaceStyle s) : base(s) { mSide = s.mSide; mStyles.AddRange(s.mStyles); } + + internal static void parseFields(IfcSurfaceStyle s, List arrFields, ref int ipos) + { + IfcPresentationStyle.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + s.mSide = (IfcSurfaceSide)Enum.Parse(typeof(IfcSurfaceSide), str.Replace(".", "")); + s.mStyles = ParserSTEP.SplitListLinks(arrFields[ipos++]); + } + internal static IfcSurfaceStyle Parse(string strDef) { IfcSurfaceStyle s = new IfcSurfaceStyle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + if (mDatabase.mOutputEssential) + return ""; + string str = base.BuildString() + ",." + mSide.ToString() + ".,(" + ParserSTEP.LinkToString(mStyles[0]); + for (int icounter = 1; icounter < mStyles.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mStyles[icounter]); + return str + ")"; + } + } + public partial interface IfcSurfaceStyleElementSelect : IfcInterface //SELECT(IfcSurfaceStyleShading, IfcSurfaceStyleLighting, IfcSurfaceStyleWithTextures + { //, IfcExternallyDefinedSurfaceStyle, IfcSurfaceStyleRefraction); + } + public partial class IfcSurfaceStyleLighting : IfcPresentationItem, IfcSurfaceStyleElementSelect + { + internal int mDiffuseTransmissionColour, mDiffuseReflectionColour, mTransmissionColour, mReflectanceColour;// : IfcColourRgb; + internal IfcSurfaceStyleLighting() : base() { } + internal IfcSurfaceStyleLighting(IfcSurfaceStyleLighting i) + : base(i) + { + mDiffuseTransmissionColour = i.mDiffuseTransmissionColour; + mDiffuseReflectionColour = i.mDiffuseReflectionColour; + mTransmissionColour = i.mTransmissionColour; + mReflectanceColour = i.mReflectanceColour; + } + + protected override void parseFields(List arrFields, ref int ipos) + { + base.parseFields(arrFields, ref ipos); + mDiffuseTransmissionColour = ParserSTEP.ParseLink(arrFields[ipos++]); + mDiffuseReflectionColour = ParserSTEP.ParseLink(arrFields[ipos++]); + mTransmissionColour = ParserSTEP.ParseLink(arrFields[ipos++]); + mReflectanceColour = ParserSTEP.ParseLink(arrFields[ipos++]); + } + internal static IfcSurfaceStyleLighting Parse(string strDef) { IfcSurfaceStyleLighting s = new IfcSurfaceStyleLighting(); int ipos = 0; s.parseFields(ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mDiffuseTransmissionColour) + "," + ParserSTEP.LinkToString(mDiffuseReflectionColour) + "," + ParserSTEP.LinkToString(mTransmissionColour) + "," + ParserSTEP.LinkToString(mReflectanceColour)); } + } + public partial class IfcSurfaceStyleRefraction : IfcPresentationItem, IfcSurfaceStyleElementSelect + { + internal double mRefractionIndex, mDispersionFactor;// : OPTIONAL IfcReal; + internal IfcSurfaceStyleRefraction() : base() { } + internal IfcSurfaceStyleRefraction(IfcSurfaceStyleRefraction s) : base(s) + { + mRefractionIndex = s.mRefractionIndex; + mDispersionFactor = s.mDispersionFactor; + } + + protected override void parseFields(List arrFields, ref int ipos) + { + base.parseFields(arrFields, ref ipos); + mRefractionIndex = ParserSTEP.ParseDouble(arrFields[ipos++]); + mDispersionFactor = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal static IfcSurfaceStyleRefraction Parse(string strDef) { IfcSurfaceStyleRefraction s = new IfcSurfaceStyleRefraction(); int ipos = 0; s.parseFields(ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mRefractionIndex) + "," + ParserSTEP.DoubleOptionalToString(mDispersionFactor)); } + } + public class IfcSurfaceStyleRendering : IfcSurfaceStyleShading + { + internal double mTransparency;// : OPTIONAL IfcNormalisedRatioMeasure; + internal IfcColourOrFactor mDiffuseColour, mTransmissionColour, mDiffuseTransmissionColour, mReflectionColour, mSpecularColour;//: OPTIONAL IfcColourOrFactor; + internal IfcSpecularHighlightSelect mSpecularHighlight;// : OPTIONAL + internal IfcReflectanceMethodEnum mReflectanceMethod = IfcReflectanceMethodEnum.NOTDEFINED;// : IfcReflectanceMethodEnum; + internal IfcSurfaceStyleRendering() : base() { } + internal IfcSurfaceStyleRendering(IfcSurfaceStyleRendering r) : base(r) + { + mTransparency = r.mTransparency; + mDiffuseColour = r.mDiffuseColour; + mTransmissionColour = r.mTransmissionColour; + mDiffuseTransmissionColour = r.mDiffuseTransmissionColour; + mReflectionColour = r.mReflectionColour; + mSpecularColour = r.mSpecularColour; + mSpecularHighlight = r.mSpecularHighlight; + mReflectanceMethod = r.mReflectanceMethod; + } + internal IfcSurfaceStyleRendering(DatabaseIfc m, Color surface, double transparency, Color diffuse, Color transmission, Color reflection, Color specular, IfcSpecularHighlightSelect highlight, IfcReflectanceMethodEnum rm) + : base(m, surface) + { + mTransparency = transparency; + if (!diffuse.IsEmpty) + mDiffuseColour = new IfcNormalisedRatioMeasure(diffuse); + if (!transmission.IsEmpty) + mTransmissionColour = new IfcNormalisedRatioMeasure(transmission); + if (!reflection.IsEmpty) + mReflectionColour = new IfcNormalisedRatioMeasure(reflection); + if (!specular.IsEmpty) + mSpecularColour = new IfcNormalisedRatioMeasure(specular); + mSpecularHighlight = highlight; + mReflectanceMethod = rm; + } + internal static void parseFields(IfcSurfaceStyleRendering s, List arrFields, ref int ipos) + { + IfcSurfaceStyleShading.parseFields(s, arrFields, ref ipos); + s.mTransparency = ParserSTEP.ParseDouble(arrFields[ipos++]); + string str = arrFields[ipos++]; + if (str != "$") + s.mDiffuseColour = ParserIfc.parseColourOrFactor(str); + str = arrFields[ipos++]; + if (str != "$") + s.mTransmissionColour = ParserIfc.parseColourOrFactor(str); + str = arrFields[ipos++]; + if (str != "$") + s.mDiffuseTransmissionColour = ParserIfc.parseColourOrFactor(str); + str = arrFields[ipos++]; + if (str != "$") + s.mReflectionColour = ParserIfc.parseColourOrFactor(str); + str = arrFields[ipos++]; + if (str != "$") + s.mSpecularColour = ParserIfc.parseColourOrFactor(str); + str = arrFields[ipos++]; + if (str != "$") + { + if (str.StartsWith("IFCSPECULARROUGHNESS")) + s.mSpecularHighlight = new IfcSpecularRoughness(double.Parse(str.Substring(21, str.Length - 22))); + else + s.mSpecularHighlight = new IfcSpecularExponent(double.Parse(str.Substring(20, str.Length - 21))); + } + str = arrFields[ipos++]; + if (str != "$") + s.mReflectanceMethod = (IfcReflectanceMethodEnum)Enum.Parse(typeof(IfcReflectanceMethodEnum), str.Replace(".", "")); + } + internal new static IfcSurfaceStyleRendering Parse(string strDef) { IfcSurfaceStyleRendering s = new IfcSurfaceStyleRendering(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return (mDatabase.mOutputEssential ? "" : base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mTransparency) + + (mDiffuseColour == null ? ",$" : "," + mDiffuseColour.ToString()) + (mTransmissionColour == null ? ",$" : "," + mTransmissionColour.ToString()) + + (mDiffuseTransmissionColour == null ? ",$" : "," + mDiffuseTransmissionColour) + (mReflectionColour == null ? ",$" : mReflectionColour.ToString()) + (mSpecularColour == null ? ",$" : "," + mSpecularColour.ToString()) + + (mSpecularHighlight == null ? ",$" : "," + mSpecularHighlight.ToString()) + ",." + mReflectanceMethod.ToString() + "."); + } + } + public partial class IfcSurfaceStyleShading : IfcPresentationItem, IfcSurfaceStyleElementSelect + { + private int mSurfaceColour;// : IfcColourRgb; + internal IfcColourRgb SurfaceColour { get { return mDatabase.mIfcObjects[mSurfaceColour] as IfcColourRgb; } } + internal IfcSurfaceStyleShading() : base() { } + internal IfcSurfaceStyleShading(IfcSurfaceStyleShading i) : base() { mSurfaceColour = i.mSurfaceColour; } + public IfcSurfaceStyleShading(DatabaseIfc m, Color surface) : base(m) { mSurfaceColour = new IfcColourRgb(m,"",surface).mIndex; } + internal static void parseFields(IfcSurfaceStyleShading s, List arrFields, ref int ipos) { s.mSurfaceColour = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal static IfcSurfaceStyleShading Parse(string strDef) { IfcSurfaceStyleShading s = new IfcSurfaceStyleShading(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSurfaceColour); } + } + public partial class IfcSurfaceStyleWithTextures : IfcPresentationItem, IfcSurfaceStyleElementSelect + { + internal List mTextures = new List();//: LIST [1:?] OF IfcSurfaceTexture; + internal IfcSurfaceStyleWithTextures() : base() { } + internal IfcSurfaceStyleWithTextures(IfcSurfaceStyleWithTextures i) : base() { mTextures = new List(i.mTextures.ToArray()); } + internal IfcSurfaceStyleWithTextures(List textures) : base(textures[0].mDatabase) { mTextures = textures.ConvertAll(x => x.mIndex); } + internal static void parseFields(IfcSurfaceStyleWithTextures s, List arrFields, ref int ipos) { s.mTextures = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + internal static IfcSurfaceStyleWithTextures Parse(string strDef) { IfcSurfaceStyleWithTextures s = new IfcSurfaceStyleWithTextures(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mTextures[0]); + for (int icounter = 1; icounter < mTextures.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mTextures[icounter]); + return str + ")"; + } + } + public abstract partial class IfcSurfaceTexture : IfcPresentationItem //ABSTRACT SUPERTYPE OF (ONEOF (IfcBlobTexture ,IfcImageTexture ,IfcPixelTexture)); + { + internal int mMatIndex = -1; + internal bool mRepeatS;// : BOOLEAN; + internal bool mRepeatT;// : BOOLEAN; + internal string mMode = "$"; //: OPTIONAL IfcIdentifier; internal IfcSurfaceTextureEnum mTextureType;// : IfcSurfaceTextureEnum; // IFC2x3 + internal int mTextureTransform;// : OPTIONAL IfcCartesianTransformationOperator2D; + protected IfcSurfaceTexture() : base() { } + protected IfcSurfaceTexture(IfcSurfaceTexture i) : base() { mRepeatS = i.mRepeatS; mRepeatT = i.mRepeatT; mMode = i.mMode; mTextureTransform = i.mTextureTransform; } + protected static void parseFields(IfcSurfaceTexture t, List arrFields, ref int ipos, Schema schema) { t.mRepeatS = ParserSTEP.ParseBool(arrFields[ipos++]); t.mRepeatT = ParserSTEP.ParseBool(arrFields[ipos++]); t.mMode = (schema == Schema.IFC2x3 ? arrFields[ipos++].Replace(".", "") : arrFields[ipos++].Replace("'", "")); t.mTextureTransform = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.BoolToString(mRepeatS) + "," + ParserSTEP.BoolToString(mRepeatT) + (mDatabase.mSchema == Schema.IFC2x3 ? ",." + mMode.ToString() + ".," : mMode == "$" ? ",$," : ",'" + mMode + "',") + ParserSTEP.LinkToString(mTextureTransform); } + } + public abstract partial class IfcSweptAreaSolid : IfcSolidModel /*ABSTRACT SUPERTYPE OF (ONEOF (IfcExtrudedAreaSolid, IfcFixedReferenceSweptAreaSolid ,IfcRevolvedAreaSolid ,IfcSurfaceCurveSweptAreaSolid))*/ + { + private int mSweptArea;// : IfcProfileDef; + private int mPosition;// : IfcAxis2Placement3D; : OPTIONAL IFC4 + + internal IfcProfileDef SweptArea { get { return mDatabase.mIfcObjects[mSweptArea] as IfcProfileDef; } set { mSweptArea = value.mIndex; } } + internal IfcAxis2Placement3D Position { get { return mDatabase.mIfcObjects[mPosition] as IfcAxis2Placement3D; } set { mPosition = (value == null ? 0 : value.mIndex); } } + protected IfcSweptAreaSolid() : base() { } + protected IfcSweptAreaSolid(IfcSweptAreaSolid p) : base(p) { mSweptArea = p.mSweptArea; mPosition = p.mPosition; } + protected IfcSweptAreaSolid(IfcProfileDef prof, IfcAxis2Placement3D placement) : base(prof.mDatabase) { SweptArea = prof; Position = placement; } + protected IfcSweptAreaSolid(DatabaseIfc m) : base(m) { } + + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSweptArea) + (mPosition > 0 ? ",#" + mPosition : ",$"); } + protected static void parseFields(IfcSweptAreaSolid s, List arrFields, ref int ipos) { IfcSolidModel.parseFields(s, arrFields, ref ipos); s.mSweptArea = ParserSTEP.ParseLink(arrFields[ipos++]); s.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + } + public partial class IfcSweptDiskSolid : IfcSolidModel + { + internal int mDirectrix;// : IfcCurve; + internal double mRadius;// : IfcPositiveLengthMeasure; + internal double mInnerRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mStartParam;// : OPTIONAL IfcParameterValue; IFC4 + internal double mEndParam;// : OPTIONAL IfcParameterValue; IFC4 + + internal IfcCurve Directrix { get { return mDatabase.mIfcObjects[mDirectrix] as IfcCurve; } set { mDirectrix = value.mIndex; } } + + internal IfcSweptDiskSolid() : base() { } + internal IfcSweptDiskSolid(IfcSweptDiskSolid p) : base(p) { mDirectrix = p.mDirectrix; mRadius = p.mRadius; mInnerRadius = p.mInnerRadius; mStartParam = p.mStartParam; mEndParam = p.mEndParam; } + public IfcSweptDiskSolid(IfcCurve directrix, double radius, double innerRadius) : base(directrix.mDatabase) { Directrix = directrix; mRadius = radius; mInnerRadius = innerRadius; } + + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mDirectrix) + "," + ParserSTEP.DoubleToString(mRadius) + "," + ParserSTEP.DoubleOptionalToString(mInnerRadius) + "," + (mDatabase.mSchema == Schema.IFC2x3 ? ParserSTEP.DoubleToString(mStartParam) + "," + ParserSTEP.DoubleToString(mEndParam) : ParserSTEP.DoubleOptionalToString(mStartParam) + "," + ParserSTEP.DoubleOptionalToString(mEndParam)); } + internal static void parseFields(IfcSweptDiskSolid s, List arrFields, ref int ipos) + { + IfcSolidModel.parseFields(s, arrFields, ref ipos); + s.mDirectrix = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mInnerRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mStartParam = ParserSTEP.ParseDouble(arrFields[ipos++]); + s.mEndParam = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal static IfcSweptDiskSolid Parse(string strDef) { IfcSweptDiskSolid s = new IfcSweptDiskSolid(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public partial class IfcSweptDiskSolidPolygonal : IfcSweptDiskSolid + { + internal double mFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcSweptDiskSolidPolygonal() : base() { } + internal IfcSweptDiskSolidPolygonal(IfcSweptDiskSolidPolygonal p) : base(p) { mFilletRadius = p.mFilletRadius; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mFilletRadius); } + internal static void parseFields(IfcSweptDiskSolidPolygonal s, List arrFields, ref int ipos) { IfcSweptDiskSolid.parseFields(s, arrFields, ref ipos); s.mFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal new static IfcSweptDiskSolidPolygonal Parse(string strDef) { IfcSweptDiskSolidPolygonal s = new IfcSweptDiskSolidPolygonal(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + } + public abstract partial class IfcSweptSurface : IfcSurface /* ABSTRACT SUPERTYPE OF (ONEOF (IfcSurfaceOfLinearExtrusion ,IfcSurfaceOfRevolution))*/ + { + internal int mSweptCurve;// : IfcProfileDef; + internal int mPosition;// : IfcAxis2Placement3D; + public IfcProfileDef SweptCurve { get { return mDatabase.mIfcObjects[mSweptCurve] as IfcProfileDef; } set { mSweptCurve = value.mIndex; } } + protected IfcSweptSurface() : base() { } + protected IfcSweptSurface(IfcSweptSurface p) : base(p) { mSweptCurve = p.mSweptCurve; mPosition = p.mPosition; } + protected static void parseFields(IfcSweptSurface s, List arrFields, ref int ipos) { IfcSurface.parseFields(s, arrFields, ref ipos); s.mSweptCurve = ParserSTEP.ParseLink(arrFields[ipos++]); s.mPosition = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSweptCurve) + "," + ParserSTEP.LinkToString(mPosition); } + internal IfcProfileDef getProfile() { return mDatabase.mIfcObjects[mSweptCurve] as IfcProfileDef; } + } + public class IfcSwitchingDevice : IfcFlowController //IFC4 + { + internal IfcSwitchingDeviceTypeEnum mPredefinedType = IfcSwitchingDeviceTypeEnum.NOTDEFINED;// OPTIONAL : IfcSwitchingDeviceTypeEnum; + public IfcSwitchingDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSwitchingDevice() : base() { } + internal IfcSwitchingDevice(IfcSwitchingDevice d) : base(d) { mPredefinedType = d.mPredefinedType; } + internal IfcSwitchingDevice(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcSwitchingDevice s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcSwitchingDeviceTypeEnum)Enum.Parse(typeof(IfcSwitchingDeviceTypeEnum), str); + } + internal new static IfcSwitchingDevice Parse(string strDef) { IfcSwitchingDevice s = new IfcSwitchingDevice(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcSwitchingDeviceTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcSwitchingDeviceType : IfcFlowControllerType + { + internal IfcSwitchingDeviceTypeEnum mPredefinedType = IfcSwitchingDeviceTypeEnum.NOTDEFINED;// : IfcFlowMeterTypeEnum; + public IfcSwitchingDeviceTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSwitchingDeviceType() : base() { } + internal IfcSwitchingDeviceType(IfcSwitchingDeviceType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcSwitchingDeviceType(DatabaseIfc m, string name, IfcSwitchingDeviceTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcSwitchingDeviceType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcSwitchingDeviceTypeEnum)Enum.Parse(typeof(IfcSwitchingDeviceTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcSwitchingDeviceType Parse(string strDef) { IfcSwitchingDeviceType t = new IfcSwitchingDeviceType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + //ENTITY IfcSymbolStyle // DEPRECEATED IFC4 + public partial class IfcSystem : IfcGroup //SUPERTYPE OF(ONEOF(IfcBuildingSystem, IfcDistributionSystem, IfcStructuralAnalysisModel, IfcZone)) + { + //INVERSE + internal IfcRelServicesBuildings mServicesBuildings = null;// : SET [0:1] OF IfcRelServicesBuildings FOR RelatingSystem + public IfcRelServicesBuildings ServicesBuildings { get { return mServicesBuildings; } set { mServicesBuildings = value; } } + + internal IfcSystem() : base() { } + internal IfcSystem(IfcSystem p) : base(p) { } + internal IfcSystem(DatabaseIfc m, string name) : base(m, name) { } + internal IfcSystem(IfcSpatialElement e, string name) : base(e.mDatabase, name) { mServicesBuildings = new IfcRelServicesBuildings(this, e) { Name = name }; } + internal new static IfcSystem Parse(string strDef) { IfcSystem s = new IfcSystem(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcSystem s, List arrFields, ref int ipos) { IfcGroup.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcSystemFurnitureElement : IfcFurnishingElement //IFC4 + { + internal IfcSystemFurnitureElementTypeEnum mPredefinedType = IfcSystemFurnitureElementTypeEnum.NOTDEFINED;//: OPTIONAL IfcSystemFurnitureElementTypeEnum + internal IfcSystemFurnitureElement() : base() { } + internal IfcSystemFurnitureElement(IfcSystemFurnitureElement be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal IfcSystemFurnitureElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static void parseFields(IfcSystemFurnitureElement e, List arrFields, ref int ipos) + { + IfcFurnishingElement.parseFields(e, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + e.mPredefinedType = (IfcSystemFurnitureElementTypeEnum)Enum.Parse(typeof(IfcSystemFurnitureElementTypeEnum), s.Replace(".", "")); + } + internal new static IfcSystemFurnitureElement Parse(string strDef) { IfcSystemFurnitureElement e = new IfcSystemFurnitureElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType + "."; } + } + public partial class IfcSystemFurnitureElementType : IfcFurnishingElementType + { + internal IfcSystemFurnitureElementTypeEnum mPredefinedType = IfcSystemFurnitureElementTypeEnum.NOTDEFINED;//: OPTIONAL IfcSystemFurnitureElementTypeEnum + internal IfcSystemFurnitureElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcSystemFurnitureElementType() : base() { } + internal IfcSystemFurnitureElementType(IfcSystemFurnitureElementType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcSystemFurnitureElementType(DatabaseIfc db, string name, IfcSystemFurnitureElementTypeEnum type) + : base(db,name) + { + mPredefinedType = type; + if (mDatabase.mSchema == Schema.IFC2x3 && string.IsNullOrEmpty(ElementType) && type != IfcSystemFurnitureElementTypeEnum.NOTDEFINED) + ElementType = type.ToString(); + } + internal static void parseFields(IfcSystemFurnitureElementType t, List arrFields, ref int ipos, Schema schema) + { + IfcFurnishingElementType.parseFields(t, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + t.mPredefinedType = (IfcSystemFurnitureElementTypeEnum)Enum.Parse(typeof(IfcSystemFurnitureElementTypeEnum), s.Substring(1, s.Length - 2)); + } + } + internal static IfcSystemFurnitureElementType Parse(string strDef, Schema schema) { IfcSystemFurnitureElementType t = new IfcSystemFurnitureElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return t; } + } +} diff --git a/IFC/IFC T.cs b/IFC/IFC T.cs new file mode 100644 index 0000000..5361987 --- /dev/null +++ b/IFC/IFC T.cs @@ -0,0 +1,1342 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcTable : BaseClassIfc, IfcMetricValueSelect + { + internal string mName = "$"; //: OPTIONAL IfcLabel; + private List mRows = new List();// OPTIONAL LIST [1:?] OF IfcTableRow; + private List mColumns = new List();// : OPTIONAL LIST [1:?] OF IfcTableColumn; + + internal List Rows { get { return mRows.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcTableRow); } } + internal List Columns { get { return mColumns.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcTableColumn); } } + + internal IfcTable() : base() { } + internal IfcTable(IfcTable o) : base() { mName = o.mName; mRows.AddRange(o.mRows); mColumns.AddRange(o.mColumns); } + public IfcTable(DatabaseIfc m, string name, List rows, List cols) : base(m) + { + if (!string.IsNullOrEmpty(name)) + mName = name.Replace("'", ""); + if (rows != null && rows.Count > 0) + mRows = rows.ConvertAll(x => x.mIndex); + if (cols != null && cols.Count > 0) + mColumns = cols.ConvertAll(x => x.mIndex); + } + internal static void parseFields(IfcTable t, List arrFields, ref int ipos) { t.mName = arrFields[ipos++]; t.mRows = ParserSTEP.SplitListLinks(arrFields[ipos++]); t.mColumns = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string s = ""; + if (mRows.Count == 0) + s = "$"; + else + { + s = "(" + ParserSTEP.LinkToString(mRows[0]); + for (int icounter = 1; icounter < mRows.Count; icounter++) + s += "," + ParserSTEP.LinkToString(mRows[icounter]); + s += ")"; + } + if (mDatabase.mSchema != Schema.IFC2x3) + { + if (mColumns.Count == 0) + s += ",$"; + else + { + s += ",(" + ParserSTEP.LinkToString(mColumns[0]); + for (int icounter = 1; icounter < mColumns.Count; icounter++) + s += "," + ParserSTEP.LinkToString(mColumns[icounter]); + s += ")"; + } + } + return base.BuildString() + (mName == "$" ? ",$," : ",'" + mName + "',") + s; + } + internal static IfcTable Parse(string strDef) { IfcTable t = new IfcTable(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public partial class IfcTableColumn : BaseClassIfc + { + internal string mIdentifier = "$";// : OPTIONAL IfcIdentifier; + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription = "$";// : OPTIONAL IfcText; + internal int mUnit;// : OPTIONAL IfcUnit; + private int mReferencePath;// : OPTIONAL IfcReference; + + public string Identifier { get { return (mIdentifier == "$" ? "" : ParserIfc.Decode(mIdentifier)); } set { mIdentifier = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string Description { get { return (mDescription == "$" ? "" : ParserIfc.Decode(mDescription)); } set { mDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public IfcUnit Unit { get { return mDatabase.mIfcObjects[mUnit] as IfcUnit; } set { mUnit = (value == null ? 0 : value.Index); } } + public IfcReference ReferencePath { get { return mDatabase.mIfcObjects[mReferencePath] as IfcReference; } set { mReferencePath = (value == null ? 0 : value.mIndex); } } + + internal IfcTableColumn() : base() { } + internal IfcTableColumn(IfcTableColumn c) : base() { mIdentifier = c.mIdentifier; mName = c.mName; mDescription = c.mDescription; mUnit = c.mUnit; mReferencePath = c.mReferencePath; } + public IfcTableColumn(DatabaseIfc db) : base(db) { } + + internal static void parseFields(IfcTableColumn t, List arrFields, ref int ipos) + { + t.mIdentifier = arrFields[ipos++]; + t.mName = arrFields[ipos++].Replace("'", ""); + t.mDescription = arrFields[ipos++]; + t.mUnit = ParserSTEP.ParseLink(arrFields[ipos++]); + t.mReferencePath = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + (mIdentifier == "$" ? ",$," : ",'" + mIdentifier + "',") + (mName == "$" ? "$," : "'" + mName + "',") + (mDescription == "$" ? "$," : "'" + mDescription + "',") + ParserSTEP.LinkToString(mUnit) + "," + ParserSTEP.LinkToString(mReferencePath)); } + internal static IfcTableColumn Parse(string strDef) { IfcTableColumn t = new IfcTableColumn(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public class IfcTableRow : BaseClassIfc + { + internal List mRowCells = new List();// : OPTIONAL LIST [1:?] OF IfcValue; + internal bool mIsHeading = false; //: : OPTIONAL BOOLEAN; + + public List RowCells { get { return mRowCells; } } + + internal IfcTableRow() : base() { } + internal IfcTableRow(IfcTableRow o) : base() { mRowCells.AddRange(o.mRowCells); mIsHeading = o.mIsHeading; } + public IfcTableRow(DatabaseIfc m, IfcValue val) : this(m, new List() { val }, false) { } + public IfcTableRow(DatabaseIfc m, List vals, bool isHeading) : base(m) + { + mRowCells.AddRange(vals); + mIsHeading = isHeading; + } + internal static void parseFields(IfcTableRow t, List arrFields, ref int ipos) + { + string s = arrFields[ipos++]; + if (s != "$") + { + List ss = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < ss.Count; icounter++) + { + IfcValue v = ParserIfc.parseValue(ss[icounter]); + if (v != null) + t.mRowCells.Add(v); + } + } + t.mIsHeading = ParserSTEP.ParseBool(arrFields[ipos++]); + } + protected override string BuildString() + { + string s = ""; + if (mRowCells.Count == 0) + s = ",$,"; + else + { + s = ",(" + mRowCells[0].ToString(); + for (int icounter = 1; icounter < mRowCells.Count; icounter++) + s += "," + mRowCells[icounter].ToString(); + s += "),"; + } + return base.BuildString() + s + ParserSTEP.BoolToString(mIsHeading); + } + internal static IfcTableRow Parse(string strDef) { IfcTableRow t = new IfcTableRow(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + } + public class IfcTank : IfcFlowStorageDevice //IFC4 + { + internal IfcTankTypeEnum mPredefinedType = IfcTankTypeEnum.NOTDEFINED;// OPTIONAL : IfcTankTypeEnum; + public IfcTankTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTank() : base() { } + internal IfcTank(IfcTank t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcTank(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcTank s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcTankTypeEnum)Enum.Parse(typeof(IfcTankTypeEnum), str); + } + internal new static IfcTank Parse(string strDef) { IfcTank s = new IfcTank(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcTankTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcTankType : IfcFlowStorageDeviceType + { + internal IfcTankTypeEnum mPredefinedType = IfcTankTypeEnum.NOTDEFINED;// : IfcDuctFittingTypeEnum; + internal IfcTankType() : base() { } + internal IfcTankType(IfcTankType be) : base((IfcFlowStorageDeviceType)be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcTankType t, List arrFields, ref int ipos) { IfcFlowStorageDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcTankTypeEnum)Enum.Parse(typeof(IfcTankTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcTankType Parse(string strDef) { IfcTankType t = new IfcTankType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcTask : IfcProcess //SUPERTYPE OF (ONEOF(IfcMove,IfcOrderAction) both depreceated IFC4) + { + //internal string mTaskId; // : IfcIdentifier; IFC4 midentification + private string mStatus = "$";// : OPTIONAL IfcLabel; + internal string mWorkMethod = "$";// : OPTIONAL IfcLabel; + internal bool mIsMilestone;// : BOOLEAN + internal int mPriority;// : OPTIONAL INTEGER IFC4 + internal int mTaskTime;// : OPTIONAL IfcTaskTime; IFC4 + internal IfcTaskTypeEnum mPredefinedType = IfcTaskTypeEnum.NOTDEFINED;// : OPTIONAL IfcTaskTypeEnum + + internal string Status { get { return mStatus; } } + internal IfcTaskTime TaskTime { get { return mDatabase.mIfcObjects[mTaskTime] as IfcTaskTime; } } + + internal IfcTask() : base() { } + internal IfcTask(IfcTask o) : base(o) { mStatus = o.mStatus; mWorkMethod = o.mWorkMethod; mIsMilestone = o.mIsMilestone; mPriority = o.mPriority; mTaskTime = o.mTaskTime; mPredefinedType = o.mPredefinedType; } + + internal static IfcTask Parse(string strDef, Schema schema) { IfcTask t = new IfcTask(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return t; } + internal static void parseFields(IfcTask t, List arrFields, ref int ipos, Schema schema) + { + IfcProcess.parseFields(t, arrFields, ref ipos); + if (schema == Schema.IFC2x3) + t.mIdentification = arrFields[ipos++]; + t.mStatus = arrFields[ipos++]; + t.mWorkMethod = arrFields[ipos++]; + t.mIsMilestone = ParserSTEP.ParseBool(arrFields[ipos++]); + t.mPriority = ParserSTEP.ParseInt(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + t.mTaskTime = ParserSTEP.ParseLink(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + t.mPredefinedType = (IfcTaskTypeEnum)Enum.Parse(typeof(IfcTaskTypeEnum), s.Replace(".", "")); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? ",'" + mIdentification + "'" : "") + "," + mStatus + "," + mWorkMethod + "," + ParserSTEP.BoolToString(mIsMilestone) + "," + mPriority.ToString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : "," + ParserSTEP.LinkToString(mTaskTime) + ",." + mPredefinedType.ToString() + "."); } + } + public class IfcTaskTime : IfcSchedulingTime //IFC4 + { + internal IfcTaskDurationEnum mDurationType = IfcTaskDurationEnum.NOTDEFINED; // : OPTIONAL IfcTaskDurationEnum; + internal string mScheduleDuration = "$";// : OPTIONAL IfcDuration; + internal string mScheduleStart = "$", mScheduleFinish = "$", mEarlyStart = "$", mEarlyFinish = "$", mLateStart = "$", mLateFinish = "$"; //: OPTIONAL IfcDateTime; + internal string mFreeFloat = "$", mTotalFloat = "$";// : OPTIONAL IfcDuration; + internal bool mIsCritical;// : OPTIONAL BOOLEAN; + internal string mStatusTime = "$";// : OPTIONAL IfcDateTime; + internal string mActualDuration = "$";// : OPTIONAL IfcDuration; + internal string mActualStart = "$", mActualFinish = "$";// : OPTIONAL IfcDateTime; + internal string mRemainingTime = "$";// : OPTIONAL IfcDuration; + internal double mCompletion;// : OPTIONAL IfcPositiveRatioMeasure; + + internal DateTime ScheduleStart { get { return IfcDateTime.Convert(mScheduleStart); } } + internal DateTime ScheduleFinish { get { return IfcDateTime.Convert(mScheduleFinish); } } + + internal IfcTaskTime() : base() { } + internal IfcTaskTime(IfcTaskTime t) : base(t) + { + mDurationType = t.mDurationType; mScheduleDuration = t.mScheduleDuration; mScheduleStart = t.mScheduleStart; mScheduleFinish = t.mScheduleFinish; + mEarlyStart = t.mEarlyStart; mEarlyFinish = t.mEarlyFinish; mLateStart = t.mLateStart; mLateFinish = t.mLateFinish; mFreeFloat = t.mFreeFloat; mTotalFloat = t.mTotalFloat; + mIsCritical = t.mIsCritical; mStatusTime = t.mStatusTime; mActualDuration = t.mActualDuration; mActualStart = t.mActualStart; mActualFinish = t.mActualFinish; + mRemainingTime = t.mRemainingTime; mCompletion = t.mCompletion; + } + internal IfcTaskTime(DatabaseIfc m, string name, IfcDataOriginEnum orig, string userOrigin, IfcTaskDurationEnum durationtype, IfcDuration schedDuration, DateTime schedStart, DateTime schedFinish, + DateTime earlyStart, DateTime earlyFinish, DateTime lateStart, DateTime lateFinish, IfcDuration freeFloat, IfcDuration totalFloat, bool isCritical, IfcDuration actualDuration, DateTime actualStart, + DateTime actualFinish, IfcDuration remainingTime, double fractionComplete) + : base(m, name, orig, userOrigin) + { + mDurationType = durationtype; + if (schedDuration != null) + mScheduleDuration = schedDuration.ToString(); + if (schedStart != DateTime.MinValue) + mScheduleStart = IfcDateTime.Convert(schedStart); + if (schedFinish != DateTime.MinValue) + mScheduleFinish = IfcDateTime.Convert(schedFinish); + if (earlyStart != DateTime.MinValue) + mEarlyStart = IfcDateTime.Convert(earlyStart); + if (earlyFinish != DateTime.MinValue) + mEarlyFinish = IfcDateTime.Convert(earlyFinish); + if (lateStart != DateTime.MinValue) + mLateStart = IfcDateTime.Convert(lateStart); + if (lateFinish != DateTime.MinValue) + mLateFinish = IfcDateTime.Convert(lateFinish); + if (freeFloat != null) + mFreeFloat = freeFloat.ToString(); + if (totalFloat != null) + mTotalFloat = totalFloat.ToString(); + mIsCritical = isCritical; + if (actualDuration != null) + mActualDuration = actualDuration.ToString(); + if (actualStart != DateTime.MinValue) + mActualStart = IfcDateTime.Convert(actualStart); + if (actualFinish != DateTime.MinValue) + mActualFinish = IfcDateTime.Convert(actualFinish); + if (remainingTime != null) + mRemainingTime = remainingTime.ToString(); + mCompletion = fractionComplete; + } + internal static IfcTaskTime Parse(string strDef) { IfcTaskTime s = new IfcTaskTime(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcTaskTime s, List arrFields, ref int ipos) + { + IfcSchedulingTime.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + s.mDurationType = (IfcTaskDurationEnum)Enum.Parse(typeof(IfcTaskDurationEnum), str.Replace(".", "")); + s.mScheduleDuration = arrFields[ipos++].Replace("'", ""); + s.mScheduleStart = arrFields[ipos++].Replace("'", ""); + s.mScheduleFinish = arrFields[ipos++].Replace("'", ""); + s.mEarlyStart = arrFields[ipos++].Replace("'", ""); + s.mEarlyFinish = arrFields[ipos++].Replace("'", ""); + s.mLateStart = arrFields[ipos++].Replace("'", ""); + s.mLateFinish = arrFields[ipos++].Replace("'", ""); + s.mFreeFloat = arrFields[ipos++].Replace("'", ""); + s.mTotalFloat = arrFields[ipos++].Replace("'", ""); + s.mIsCritical = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mStatusTime = arrFields[ipos++].Replace("'", ""); + s.mActualDuration = arrFields[ipos++].Replace("'", ""); + s.mActualStart = arrFields[ipos++].Replace("'", ""); + s.mActualFinish = arrFields[ipos++].Replace("'", ""); + s.mRemainingTime = arrFields[ipos++].Replace("'", ""); + s.mCompletion = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() + { + return base.BuildString() + ",." + mDurationType + (mScheduleDuration == "$" ? ".,$," : ".,'" + mScheduleDuration + "',") + (mScheduleStart == "$" ? "$," : "'" + mScheduleStart + "',") + + (mScheduleFinish == "$" ? "$," : "'" + mScheduleFinish + "',") + (mEarlyStart == "$" ? "$," : "'" + mEarlyStart + "',") + (mEarlyFinish == "$" ? "$," : "'" + mEarlyFinish + "',") + (mLateStart == "$" ? "$," : "'" + mLateStart + "',") + + (mLateFinish == "$" ? "$," : "'" + mLateFinish + "',") + (mFreeFloat == "$" ? "$," : "'" + mFreeFloat + "',") + (mTotalFloat == "$" ? "$," : "'" + mTotalFloat + "',") + ParserSTEP.BoolToString(mIsCritical) + "," + + (mStatusTime == "$" ? "$," : "'" + mStatusTime + "',") + (mActualDuration == "$" ? "$," : "'" + mActualDuration + "',") + (mActualStart == "$" ? "$," : "'" + mActualStart + "',") + (mActualFinish == "$" ? "$," : "'" + mActualFinish + "',") + + (mRemainingTime == "$" ? "$," : "'" + mRemainingTime + "',") + ParserSTEP.DoubleOptionalToString(mCompletion); + } + } + public class IfcTaskType : IfcTypeProcess //IFC4 + { + internal IfcTaskTypeEnum mPredefinedType = IfcTaskTypeEnum.NOTDEFINED;// : IfcTaskTypeEnum; + private string mWorkMethod = "$";// : OPTIONAL IfcLabel; + + internal IfcTaskTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal string WorkMethod { get { return (mWorkMethod == "$" ? "" : ParserIfc.Decode(mWorkMethod)); } set { mWorkMethod = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcTaskType() : base() { } + internal IfcTaskType(IfcTaskType t) : base(t) { mPredefinedType = t.mPredefinedType; mWorkMethod = t.mWorkMethod; } + internal IfcTaskType(DatabaseIfc m, string name, IfcTaskTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcTaskType t, List arrFields, ref int ipos) { IfcTypeProcess.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcTaskTypeEnum)Enum.Parse(typeof(IfcTaskTypeEnum), arrFields[ipos++].Replace(".", "")); t.mWorkMethod = arrFields[ipos++].Replace("'", ""); } + internal new static IfcTaskType Parse(string strDef) { IfcTaskType t = new IfcTaskType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + ",." + mPredefinedType.ToString() + (mWorkMethod == "$" ? ".,$" : (".,'" + mWorkMethod + "'"))); } + } + public class IfcTelecomAddress : IfcAddress + { + internal List mTelephoneNumbers = new List();// : OPTIONAL LIST [1:?] OF IfcLabel; + internal List mFacsimileNumbers = new List();// : OPTIONAL LIST [1:?] OF IfcLabel; + internal string mPagerNumber = "$";// :OPTIONAL IfcLabel; + internal List mElectronicMailAddresses = new List();// : OPTIONAL LIST [1:?] OF IfcLabel; + internal string mWWWHomePageURL = "$";// : OPTIONAL IfcLabel; + internal List mMessagingIDs = new List();// : OPTIONAL LIST [1:?] OF IfcURIReference //IFC4 + internal IfcTelecomAddress() : base() { } + internal IfcTelecomAddress(IfcTelecomAddress o) : base(o) { mTelephoneNumbers = new List(o.mTelephoneNumbers.ToArray()); mFacsimileNumbers = new List(o.mFacsimileNumbers.ToArray()); mPagerNumber = o.mPagerNumber; mElectronicMailAddresses = new List(o.mElectronicMailAddresses.ToArray()); mWWWHomePageURL = o.mWWWHomePageURL; mMessagingIDs = new List(o.mMessagingIDs); } + //internal IfcTelecomAddress(List phone,List fax,string pager,List email,string www,List + internal static void parseFields(IfcTelecomAddress a, List arrFields, ref int ipos,Schema schema) + { + IfcAddress.parseFields(a, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str != "$") + { + List lst = ParserSTEP.SplitLineFields(str.Substring(1, str.Length - 2)); + for (int icounter = 0; icounter < lst.Count; icounter++) + a.mTelephoneNumbers.Add(lst[icounter]); + } + str = arrFields[ipos++]; + if (str != "$") + { + List lst = ParserSTEP.SplitLineFields(str.Substring(1, str.Length - 2)); + for (int icounter = 0; icounter < lst.Count; icounter++) + a.mFacsimileNumbers.Add(lst[icounter]); + } + a.mPagerNumber = arrFields[ipos++]; + str = arrFields[ipos++]; + if (str != "$") + { + List lst = ParserSTEP.SplitLineFields(str.Substring(1, str.Length - 2)); + for (int icounter = 0; icounter < lst.Count; icounter++) + a.mElectronicMailAddresses.Add(lst[icounter]); + } + a.mWWWHomePageURL = arrFields[ipos++]; + if (schema != Schema.IFC2x3) + { + str = arrFields[ipos++]; + if (!str.StartsWith("$")) + a.mMessagingIDs = ParserSTEP.SplitListLinks(str.Substring(1, str.Length - 2)); + } + } + protected override string BuildString() + { + string str = base.BuildString(); + if (mTelephoneNumbers.Count == 0) + str += ",$,"; + else + { + str += ",(" + mTelephoneNumbers[0]; + for (int icounter = 1; icounter < mTelephoneNumbers.Count; icounter++) + str += "," + mTelephoneNumbers[icounter]; + str += "),"; + } + if (mFacsimileNumbers.Count == 0) + str += "$,"; + else + { + str += "(" + mFacsimileNumbers[0]; + for (int icounter = 1; icounter < mFacsimileNumbers.Count; icounter++) + str += "," + mFacsimileNumbers[icounter]; + str += "),"; + } + + str += mPagerNumber; + if (mElectronicMailAddresses.Count == 0) + str += ",$,"; + else + { + str += ",(" + mElectronicMailAddresses[0]; + for (int icounter = 1; icounter < mElectronicMailAddresses.Count; icounter++) + str += "," + mElectronicMailAddresses[icounter]; + str += "),"; + } + str += mWWWHomePageURL; + if (mDatabase.mSchema != Schema.IFC2x3) + { + if (mMessagingIDs.Count == 0) + str += ",$"; + else + { + str += ",(" + ParserSTEP.LinkToString(mMessagingIDs[0]); + for (int icounter = 1; icounter < mMessagingIDs.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mMessagingIDs[icounter]); + str += ")"; + } + } + return str; + } + internal static IfcTelecomAddress Parse(string strDef,Schema schema) { IfcTelecomAddress a = new IfcTelecomAddress(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return a; } + } + public class IfcTendon : IfcReinforcingElement + { + internal IfcTendonTypeEnum mPredefinedType;// : IfcTendonTypeEnum;// + internal double mNominalDiameter;// : IfcPositiveLengthMeasure; + internal double mCrossSectionArea;// : IfcAreaMeasure; + internal double mTensionForce;// : OPTIONAL IfcForceMeasure; + internal double mPreStress;// : OPTIONAL IfcPressureMeasure; + internal double mFrictionCoefficient;// //: OPTIONAL IfcNormalisedRatioMeasure; + internal double mAnchorageSlip;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mMinCurvatureRadius;// : OPTIONAL IfcPositiveLengthMeasure; + public IfcTendonTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTendon() : base() { } + internal IfcTendon(IfcTendon t) : base(t) + { + mPredefinedType = t.mPredefinedType; + mNominalDiameter = t.mNominalDiameter; + mCrossSectionArea = t.mCrossSectionArea; + mTensionForce = t.mTensionForce; + mPreStress = t.mPreStress; + mFrictionCoefficient = t.mFrictionCoefficient; + mAnchorageSlip = t.mAnchorageSlip; + mMinCurvatureRadius = t.mMinCurvatureRadius; + } + internal IfcTendon(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, double diam, double area, double forceMeasure, double pretress, double fricCoeff, double anchorSlip, double minCurveRadius) + : base(host, placement,representation) + { + mNominalDiameter = diam; + mCrossSectionArea = area; + mTensionForce = forceMeasure; + mPreStress = pretress; + mFrictionCoefficient = fricCoeff; + mAnchorageSlip = anchorSlip; + mMinCurvatureRadius = minCurveRadius; + } + internal static IfcTendon Parse(string strDef) { IfcTendon t = new IfcTendon(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcTendon c, List arrFields, ref int ipos) + { + IfcReinforcingElement.parseFields(c, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + c.mPredefinedType = (IfcTendonTypeEnum)Enum.Parse(typeof(IfcTendonTypeEnum), str.Replace(".", "")); + c.mNominalDiameter = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mCrossSectionArea = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mTensionForce = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mPreStress = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mFrictionCoefficient = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mAnchorageSlip = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mMinCurvatureRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + + } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema != Schema.IFC2x3 && mPredefinedType == IfcTendonTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType.ToString() + ".,") + ParserSTEP.DoubleToString(mNominalDiameter) + "," + + ParserSTEP.DoubleToString(mCrossSectionArea) + "," + ParserSTEP.DoubleToString(mTensionForce) + "," + + ParserSTEP.DoubleToString(mPreStress) + "," + ParserSTEP.DoubleToString(mFrictionCoefficient) + "," + + ParserSTEP.DoubleToString(mAnchorageSlip) + "," + ParserSTEP.DoubleToString(mMinCurvatureRadius); + } + } + public class IfcTendonAnchor : IfcReinforcingElement + { + internal IfcTendonAnchorTypeEnum mPredefinedType = IfcTendonAnchorTypeEnum.NOTDEFINED;// : OPTIONAL IfcTendonAnchorTypeEnum; + public IfcTendonAnchorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTendonAnchor() : base() { } + internal IfcTendonAnchor(IfcTendonAnchor a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcTendonAnchor(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static IfcTendonAnchor Parse(string strDef) { IfcTendonAnchor t = new IfcTendonAnchor(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcTendonAnchor a, List arrFields, ref int ipos) + { + IfcReinforcingElement.parseFields(a, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + a.mPredefinedType = (IfcTendonAnchorTypeEnum)Enum.Parse(typeof(IfcTendonAnchorTypeEnum), str.Replace(".", "")); + } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcTendonAnchorTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType.ToString() + ".")); + } + } + //IfcTendonAnchorType + //IfcTendonType + public class IfcTerminatorSymbol : IfcAnnotationSymbolOccurrence // DEPRECEATED IFC4 + { + internal int mAnnotatedCurve;// : IfcAnnotationCurveOccurrence; + internal IfcTerminatorSymbol() : base() { } + internal IfcTerminatorSymbol(IfcTerminatorSymbol i) : base(i) { mAnnotatedCurve = i.mAnnotatedCurve; } + internal new static IfcTerminatorSymbol Parse(string strDef) { IfcTerminatorSymbol s = new IfcTerminatorSymbol(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcTerminatorSymbol s, List arrFields, ref int ipos) { IfcAnnotationSymbolOccurrence.parseFields(s, arrFields, ref ipos); s.mAnnotatedCurve = ParserSTEP.ParseLink(arrFields[ipos++]); } + } + public abstract partial class IfcTessellatedFaceSet : IfcTessellatedItem //ABSTRACT SUPERTYPE OF(IfcTriangulatedFaceSet) + { + internal int mCoordinates;// : IfcCartesianPointList; + internal Tuple[] mNormals = new Tuple[0];// : OPTIONAL LIST [1:?] OF LIST [3:3] OF IfcParameterValue; + internal bool mClosed; // OPTIONAL BOOLEAN; + // INVERSE + internal IfcIndexedColourMap mHasColours = null;// : SET [0:1] OF IfcIndexedColourMap FOR MappedTo; + internal List mHasTextures = new List();// : SET [0:?] OF IfcIndexedTextureMap FOR MappedTo; + + public IfcCartesianPointList Coordinates { get { return mDatabase.mIfcObjects[mCoordinates] as IfcCartesianPointList; } } + protected IfcTessellatedFaceSet() : base() { } + protected IfcTessellatedFaceSet(IfcTessellatedFaceSet s) + : base(s) + { + mCoordinates = s.mCoordinates; + if (s.mNormals.Length > 0) + mNormals = s.mNormals; + mClosed = s.mClosed; + } + protected IfcTessellatedFaceSet(DatabaseIfc m, IfcCartesianPointList3D pl, IEnumerable> normals, bool closed) + : base(m) + { + mCoordinates = pl.mIndex; + if (normals != null) + mNormals = normals.ToArray(); + mClosed = closed; + } + protected override string BuildString() + { + string result = base.BuildString() + "," + ParserSTEP.LinkToString(mCoordinates); + if (mNormals.Length == 0) + result += ",$,"; + else + { + Tuple normal = mNormals[0]; + result += ",((" + ParserSTEP.DoubleToString(normal.Item1) + "," + ParserSTEP.DoubleToString(normal.Item2) + "," + ParserSTEP.DoubleToString(normal.Item3) + ")"; + for (int icounter = 1; icounter < mNormals.Length; icounter++) + { + normal = mNormals[icounter]; + result += ",(" + ParserSTEP.DoubleToString(normal.Item1) + "," + ParserSTEP.DoubleToString(normal.Item2) + "," + ParserSTEP.DoubleToString(normal.Item3) + ")"; + } + result += "),"; + } + return result + ParserSTEP.BoolToString(mClosed); + } + protected override void Parse(string str, ref int pos) + { + base.Parse(str, ref pos); + mCoordinates = ParserSTEP.StripLink(str, ref pos); + string field = ParserSTEP.StripField(str, ref pos); + if (field.StartsWith("(")) + mNormals = ParserSTEP.SplitListDoubleTriple(field); + mClosed = ParserSTEP.StripBool(str, ref pos); + } + + } + public abstract class IfcTessellatedItem : IfcGeometricRepresentationItem + { + protected IfcTessellatedItem() : base() { } + protected IfcTessellatedItem(IfcTessellatedItem o) : base(o) { } + protected IfcTessellatedItem(DatabaseIfc m) : base(m) { } + protected override void Parse(string str, ref int ipos) { base.Parse(str, ref ipos); } + } + public partial class IfcTextLiteral : IfcGeometricRepresentationItem + { + internal string mLiteral;// : IfcPresentableText; + internal int mPlacement;// : IfcAxis2Placement; + internal IfcTextPath mPath;// : IfcTextPath; + internal IfcAxis2Placement Placement { get { return mDatabase.mIfcObjects[mPlacement] as IfcAxis2Placement; } } + internal IfcTextLiteral() : base() { } + internal IfcTextLiteral(IfcTextLiteral o) : base(o) { mLiteral = o.mLiteral; mPlacement = o.mPlacement; mPath = o.mPath; } + internal static IfcTextLiteral Parse(string strDef) { IfcTextLiteral l = new IfcTextLiteral(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcTextLiteral l, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(l, arrFields, ref ipos); l.mLiteral = arrFields[ipos++]; l.mPlacement = ParserSTEP.ParseLink(arrFields[ipos++]); l.mPath = (IfcTextPath)Enum.Parse(typeof(IfcTextPath), arrFields[ipos++].Replace(".", "")); } + protected override string BuildString() { return base.BuildString() + "," + mLiteral + "," + ParserSTEP.LinkToString(mPlacement) + ",." + mPath.ToString() + "."; } + } + public partial class IfcTextLiteralWithExtent : IfcTextLiteral + { + internal int mExtent;// : IfcPlanarExtent; + internal string mBoxAlignment;// : IfcBoxAlignment; + internal IfcTextLiteralWithExtent() : base() { } + internal IfcTextLiteralWithExtent(IfcTextLiteralWithExtent o) : base(o) { mExtent = o.mExtent; mBoxAlignment = o.mBoxAlignment; } + + internal new static IfcTextLiteralWithExtent Parse(string strDef) { IfcTextLiteralWithExtent l = new IfcTextLiteralWithExtent(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcTextLiteralWithExtent l, List arrFields, ref int ipos) { IfcTextLiteral.parseFields(l, arrFields, ref ipos); l.mExtent = ParserSTEP.ParseLink(arrFields[ipos++]); l.mBoxAlignment = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mExtent) + "," + mBoxAlignment; } + } + public partial class IfcTextStyle : IfcPresentationStyle, IfcPresentationStyleSelect + { + internal int mTextCharacterAppearance;// : OPTIONAL IfcCharacterStyleSelect; + internal int mTextStyle;// : OPTIONAL IfcTextStyleSelect; + internal int mTextFontStyle;// : IfcTextFontSelect; + internal bool mModelOrDraughting = true;// : OPTIONAL BOOLEAN; IFC4CHANGE + internal IfcTextStyle() : base() { } + internal IfcTextStyle(IfcTextStyle v) : base(v) { mTextCharacterAppearance = v.mTextCharacterAppearance; mTextStyle = v.mTextStyle; mTextFontStyle = v.mTextFontStyle; mModelOrDraughting = v.mModelOrDraughting; } + internal static void parseFields(IfcTextStyle s, List arrFields, ref int ipos,Schema schema) + { + IfcPresentationStyle.parseFields(s, arrFields, ref ipos); + s.mTextCharacterAppearance = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mTextStyle = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mTextFontStyle = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + s.mModelOrDraughting = ParserSTEP.ParseBool(arrFields[ipos++]); + } + internal static IfcTextStyle Parse(string strDef,Schema schema) { IfcTextStyle s = new IfcTextStyle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return s; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mTextCharacterAppearance) + "," + ParserSTEP.LinkToString(mTextStyle) + "," + ParserSTEP.LinkToString(mTextFontStyle) + (mDatabase.mSchema != Schema.IFC2x3 ? "," + ParserSTEP.BoolToString(mModelOrDraughting) : ""); } + } + public class IfcTextStyleFontModel : IfcPreDefinedTextFont + { + internal List mFontFamily = new List(1);// : OPTIONAL LIST [1:?] OF IfcTextFontName; + internal string mFontStyle = "$";// : OPTIONAL IfcFontStyle; ['normal','italic','oblique']; + internal string mFontVariant = "$";// : OPTIONAL IfcFontVariant; ['normal','small-caps']; + internal string mFontWeight = "$";// : OPTIONAL IfcFontWeight; // ['normal','small-caps','100','200','300','400','500','600','700','800','900']; + internal string mFontSize;// : IfcSizeSelect; IfcSizeSelect = SELECT (IfcRatioMeasure ,IfcLengthMeasure ,IfcDescriptiveMeasure ,IfcPositiveLengthMeasure ,IfcNormalisedRatioMeasure ,IfcPositiveRatioMeasure); + internal IfcTextStyleFontModel() : base() { } + internal IfcTextStyleFontModel(IfcTextStyleFontModel i) : base(i) + { + mFontFamily = new List(i.mFontFamily.ToArray()); + mFontStyle = i.mFontStyle; + mFontVariant = i.mFontVariant; + mFontWeight = i.mFontWeight; + mFontSize = i.mFontSize; + } + internal static IfcTextStyleFontModel Parse(string strDef) { IfcTextStyleFontModel f = new IfcTextStyleFontModel(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcTextStyleFontModel f, List arrFields, ref int ipos) + { + IfcPreDefinedTextFont.parseFields(f, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s != "$") + { + List lst = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2)); + for (int icounter = 0; icounter < lst.Count; icounter++) + f.mFontFamily.Add(lst[icounter]); + } + f.mFontStyle = arrFields[ipos++]; + f.mFontVariant = arrFields[ipos++]; + f.mFontWeight = arrFields[ipos++]; + f.mFontSize = arrFields[ipos++]; + } + protected override string BuildString() + { + string str = base.BuildString(); + if (mFontFamily.Count > 0) + { + str += ",(" + mFontFamily[0]; + for (int icounter = 1; icounter < mFontFamily.Count; icounter++) + str += "," + mFontFamily[icounter]; + str += "),"; + } + else + str += ",$,"; + return str + mFontStyle + "," + mFontVariant + "," + mFontWeight + "," + mFontSize; + } + } + public class IfcTextStyleForDefinedFont : BaseClassIfc + { + internal int mColour;// : IfcColour; + internal int mBackgroundColour;// : OPTIONAL IfcColour; + internal IfcTextStyleForDefinedFont() : base() { } + internal IfcTextStyleForDefinedFont(IfcTextStyleForDefinedFont o) : base() { mColour = o.mColour; mBackgroundColour = o.mBackgroundColour; } + internal static void parseFields(IfcTextStyleForDefinedFont f, List arrFields, ref int ipos) { f.mColour = ParserSTEP.ParseLink(arrFields[ipos++]); f.mBackgroundColour = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mColour) + "," + ParserSTEP.LinkToString(mBackgroundColour); } + internal static IfcTextStyleForDefinedFont Parse(string strDef) { IfcTextStyleForDefinedFont f = new IfcTextStyleForDefinedFont(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + } + public class IfcTextStyleTextModel : IfcPresentationItem + { + //internal int mDiffuseTransmissionColour, mDiffuseReflectionColour, mTransmissionColour, mReflectanceColour;// : IfcColourRgb; + internal IfcTextStyleTextModel() : base() { } + internal IfcTextStyleTextModel(IfcTextStyleTextModel m) : base(m) { } + + protected override void parseFields(List arrFields, ref int ipos) + { + base.parseFields(arrFields, ref ipos); + //s.mDiffuseTransmissionColour = IFCModel.mSTP.parseSTPLink(arrFields[ipos++]); + //s.mDiffuseReflectionColour = IFCModel.mSTP.parseSTPLink(arrFields[ipos++]); + //s.mTransmissionColour = IFCModel.mSTP.parseSTPLink(arrFields[ipos++]); + //s.mReflectanceColour = IFCModel.mSTP.parseSTPLink(arrFields[ipos++]); + } + internal static IfcTextStyleTextModel Parse(string strDef) { IfcTextStyleTextModel s = new IfcTextStyleTextModel(); int ipos = 0; s.parseFields(ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + //protected override string BuildString() { return (mModel.mOutputEssential ? "" : base.BuildString() + "," + IFCModel.mSTP.STPLinkToString(mDiffuseTransmissionColour) + "," + IFCModel.mSTP.STPLinkToString(mDiffuseReflectionColour) + "," + IFCModel.mSTP.STPLinkToString(mTransmissionColour) + "," + IFCModel.mSTP.STPLinkToString(mReflectanceColour)); } + } + //ENTITY IfcTextStyleWithBoxCharacteristics; // DEPRECEATED IFC4 + public abstract class IfcTextureCoordinate : IfcPresentationItem //ABSTRACT SUPERTYPE OF(ONEOF(IfcIndexedTextureMap, IfcTextureCoordinateGenerator, IfcTextureMap)) + { + internal List mMaps = new List();// : LIST [1:?] OF IfcSurfaceTexture + public List Maps { get { return mMaps.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcSurfaceTexture); } } + + internal IfcTextureCoordinate() : base() { } + internal IfcTextureCoordinate(IfcTextureCoordinate c) : base() { mMaps = c.mMaps; } + public IfcTextureCoordinate(DatabaseIfc m, List maps) : base(m) { mMaps = maps.ConvertAll(x => x.mIndex); } + + protected override void parseFields(List arrFields, ref int pos) + { + mMaps = ParserSTEP.SplitListLinks(arrFields[pos++]); + } + protected override string BuildString() + { + string result = base.BuildString() + ",(#" + mMaps[0]; + for (int icounter = 1; icounter < mMaps.Count; icounter++) + result += ",#" + mMaps[icounter]; + return result + ")"; + } + } + //ENTITY IfcTextureCoordinateGenerator + //ENTITY IfcTextureMap + //ENTITY IfcTextureVertex; + public class IfcTextureVertexList : IfcPresentationItem + { + internal Tuple[] mTexCoordsList = new Tuple[0];// : LIST [1:?] OF IfcSurfaceTexture + + internal IfcTextureVertexList() : base() { } + internal IfcTextureVertexList(IfcTextureVertexList c) : base() { mTexCoordsList = c.mTexCoordsList; } + public IfcTextureVertexList(DatabaseIfc m, IEnumerable> coords) : base(m) { mTexCoordsList = coords.ToArray(); } + + internal static IfcTextureVertexList Parse(string strDef) { IfcTextureVertexList l = new IfcTextureVertexList(); int pos = 0; l.parseFields(ParserSTEP.SplitLineFields(strDef), ref pos); return l; } + protected override void parseFields(List arrFields, ref int ipos) { base.parseFields(arrFields, ref ipos); mTexCoordsList = ParserSTEP.SplitListDoubleTuple(arrFields[ipos++]); } + protected override string BuildString() + { + Tuple pair = mTexCoordsList[0]; + string result = base.BuildString() + ",((" + ParserSTEP.DoubleToString(pair.Item1) + "," + ParserSTEP.DoubleToString(pair.Item2); + for (int icounter = 1; icounter < mTexCoordsList.Length; icounter++) + { + pair = mTexCoordsList[icounter]; + result += "),(" + ParserSTEP.DoubleToString(pair.Item1) + "," + ParserSTEP.DoubleToString(pair.Item2); + } + + return result + "))"; + } + } + public class IfcThermalMaterialProperties : IfcMaterialPropertiesSuperSeded // DEPRECEATED IFC4 + { + internal double mSpecificHeatCapacity;// : OPTIONAL IfcSpecificHeatCapacityMeasure; + internal double mBoilingPoint;// : OPTIONAL IfcThermodynamicTemperatureMeasure; + internal double mFreezingPoint;// : OPTIONAL IfcThermodynamicTemperatureMeasure; + internal double mThermalConductivity;// : OPTIONAL IfcThermalConductivityMeasure; + internal IfcThermalMaterialProperties() : base() { } + internal IfcThermalMaterialProperties(IfcThermalMaterialProperties el) : base(el) { mSpecificHeatCapacity = el.mSpecificHeatCapacity; mBoilingPoint = el.mBoilingPoint; mFreezingPoint = el.mFreezingPoint; mThermalConductivity = el.mThermalConductivity; } + internal static IfcThermalMaterialProperties Parse(string strDef) { IfcThermalMaterialProperties p = new IfcThermalMaterialProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcThermalMaterialProperties p, List arrFields, ref int ipos) + { + IfcMaterialPropertiesSuperSeded.parseFields(p, arrFields, ref ipos); + p.mSpecificHeatCapacity = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mBoilingPoint = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFreezingPoint = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThermalConductivity = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mSpecificHeatCapacity) + "," + ParserSTEP.DoubleOptionalToString(mBoilingPoint) + "," + ParserSTEP.DoubleOptionalToString(mFreezingPoint) + "," + ParserSTEP.DoubleOptionalToString(mThermalConductivity); } + } + public struct IfcTime + { + internal static string convert(DateTime date) { return (date.Hour < 10 ? "T0" : "T") + date.Hour + (date.Minute < 10 ? "-0" : "-") + date.Minute + (date.Second < 10 ? "-0" : "-") + date.Second; } + } + public interface IfcTimeOrRatioSelect { string String { get; } } // IFC4 IfcRatioMeasure, IfcDuration + public class IfcTimePeriod : BaseClassIfc // IFC4 + { + internal string mStart; //: IfcTime; + internal string mFinish; //: IfcTime; + internal IfcTimePeriod() : base() { } + internal IfcTimePeriod(IfcTimePeriod m) : base() { mStart = m.mStart; mFinish = m.mFinish; } + internal IfcTimePeriod(DatabaseIfc m, DateTime start, DateTime finish) : base(m) { mStart = IfcTime.convert(start); mFinish = IfcTime.convert(finish);} + internal static IfcTimePeriod Parse(string strDef) { IfcTimePeriod m = new IfcTimePeriod(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcTimePeriod m, List arrFields, ref int ipos) { m.mStart = arrFields[ipos++]; m.mFinish = arrFields[ipos++]; } + protected override string BuildString() { return base.BuildString() + ",'" + mStart + "','" + mFinish + "'"; } + } + public abstract class IfcTimeSeries : BaseClassIfc, IfcMetricValueSelect, IfcResourceObjectSelect //ABSTRACT SUPERTYPE OF (ONEOF(IfcIrregularTimeSeries,IfcRegularTimeSeries)); + { + internal string mName = "$";// : OPTIONAL IfcLabel; + internal string mDescription;// : OPTIONAL IfcText; + internal int mStartTime;// : IfcDateTimeSelect; + internal int mEndTime;// : IfcDateTimeSelect; + internal IfcTimeSeriesDataTypeEnum mTimeSeriesDataType = IfcTimeSeriesDataTypeEnum.NOTDEFINED;// : IfcTimeSeriesDataTypeEnum; + internal IfcDataOriginEnum mDataOrigin = IfcDataOriginEnum.NOTDEFINED;// : IfcDataOriginEnum; + internal string mUserDefinedDataOrigin = "$";// : OPTIONAL IfcLabel; + internal int mUnit;// : OPTIONAL IfcUnit; + //INVERSE + internal List mHasExternalReferences = new List(); //IFC4 + internal List mHasConstraintRelationships = new List(); //gg + + public override string Name { get { return (mName == "$" ? "" : ParserIfc.Decode(mName)); } set { mName = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public List HasExternalReferences { get { return mHasExternalReferences; } } + public List HasConstraintRelationships { get { return mHasConstraintRelationships; } } + + protected IfcTimeSeries() : base() { } + protected IfcTimeSeries(IfcTimeSeries i) + : base() + { + mName = i.mName; + mDescription = i.mDescription; + mStartTime = i.mStartTime; + mEndTime = i.mEndTime; + mTimeSeriesDataType = i.mTimeSeriesDataType; + mDataOrigin = i.mDataOrigin; + mUserDefinedDataOrigin = i.mUserDefinedDataOrigin; + mUnit = i.mUnit; + } + protected IfcTimeSeries(DatabaseIfc m) : base(m) { } + internal static void parseFields(IfcTimeSeries s, List arrFields, ref int ipos) + { + s.mName = arrFields[ipos++].Replace("'", ""); + s.mDescription = arrFields[ipos++].Replace("'", ""); + s.mStartTime = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mEndTime = ParserSTEP.ParseLink(arrFields[ipos++]); + s.mTimeSeriesDataType = (IfcTimeSeriesDataTypeEnum)Enum.Parse(typeof(IfcTimeSeriesDataTypeEnum), arrFields[ipos++].Replace(".", "")); + string str = arrFields[ipos++]; + if (str.StartsWith(".")) + s.mDataOrigin = (IfcDataOriginEnum)Enum.Parse(typeof(IfcDataOriginEnum), str.Replace(".", "")); + s.mUserDefinedDataOrigin = arrFields[ipos++]; + s.mUnit = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",'" + mName + "','" + mDescription + "'," + ParserSTEP.LinkToString(mStartTime) + "," + ParserSTEP.LinkToString(mEndTime) + ",." + mTimeSeriesDataType.ToString() + ".,." + mDataOrigin.ToString() + ".," + mUserDefinedDataOrigin + "," + ParserSTEP.LinkToString(mUnit); } + } + //ENTITY IfcTimeSeriesReferenceRelationship; // DEPRECEATED IFC4 + //ENTITY IfcTimeSeriesSchedule // DEPRECEATED IFC4 + //ENTITY IfcTimeSeriesValue; + public abstract partial class IfcTopologicalRepresentationItem : IfcRepresentationItem /*(IfcConnectedFaceSet,IfcEdge,IfcFace,IfcFaceBound,IfcLoop,IfcPath,IfcVertex))*/ + { + protected IfcTopologicalRepresentationItem() : base() { } + protected IfcTopologicalRepresentationItem(IfcTopologicalRepresentationItem el) : base(el) { } + protected IfcTopologicalRepresentationItem(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcTopologicalRepresentationItem i, List arrFields, ref int ipos) { IfcRepresentationItem.parseFields(i, arrFields, ref ipos); } + } + public partial class IfcTopologyRepresentation : IfcShapeModel + { + internal IfcTopologyRepresentation() : base() { } + internal IfcTopologyRepresentation(IfcTopologyRepresentation c) : base(c) { } + internal IfcTopologyRepresentation(IfcConnectedFaceSet fs, string identifier) : base(fs, identifier, "FaceSet") { } + internal IfcTopologyRepresentation(IfcEdge e, string identifier) : base(e, identifier, "Edge") { } + internal IfcTopologyRepresentation(IfcFace fs, string identifier) : base(fs, identifier, "Face") { } + internal IfcTopologyRepresentation(IfcVertex v, string identifier) : base(v, identifier, "Vertex") { } + internal new static IfcTopologyRepresentation Parse(string strDef) + { + IfcTopologyRepresentation r = new IfcTopologyRepresentation(); + int pos = 0; + IfcShapeModel.parseString(r, strDef, ref pos); + return r; + } + internal static IfcTopologyRepresentation getRepresentation(IfcTopologicalRepresentationItem ri) + { + IfcConnectedFaceSet cfs = ri as IfcConnectedFaceSet; + if (cfs != null) + return new IfcTopologyRepresentation(cfs, ""); + IfcEdge e = ri as IfcEdge; + if (e != null) + return new IfcTopologyRepresentation(e, ""); + IfcFace f = ri as IfcFace; + if (f != null) + return new IfcTopologyRepresentation(f, ""); + IfcVertex v = ri as IfcVertex; + if (v != null) + return new IfcTopologyRepresentation(v, ""); + return null; + } + + } + public class IfcTransformer : IfcEnergyConversionDevice //IFC4 + { + internal IfcTransformerTypeEnum mPredefinedType = IfcTransformerTypeEnum.NOTDEFINED;// OPTIONAL : IfcTransformerTypeEnum; + public IfcTransformerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTransformer() : base() { } + internal IfcTransformer(IfcTransformer b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcTransformer(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcTransformer s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcTransformerTypeEnum)Enum.Parse(typeof(IfcTransformerTypeEnum), str); + } + internal new static IfcTransformer Parse(string strDef) { IfcTransformer s = new IfcTransformer(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcTransformerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcTransformerType : IfcEnergyConversionDeviceType + { + internal IfcTransformerTypeEnum mPredefinedType = IfcTransformerTypeEnum.NOTDEFINED;// : IfcTransformerEnum; + public IfcTransformerTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTransformerType() : base() { } + internal IfcTransformerType(IfcTransformerType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcTransformerType(DatabaseIfc m, string name, IfcTransformerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcTransformerType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcTransformerTypeEnum)Enum.Parse(typeof(IfcTransformerTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcTransformerType Parse(string strDef) { IfcTransformerType t = new IfcTransformerType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcTranslationalStiffnessSelect + { + internal bool mRigid = false; + internal IfcLinearStiffnessMeasure mStiffness = null; + internal IfcTranslationalStiffnessSelect(bool fix) { mRigid = fix; } + internal IfcTranslationalStiffnessSelect(double stiff) { mStiffness = new IfcLinearStiffnessMeasure(stiff); } + internal IfcTranslationalStiffnessSelect(IfcLinearStiffnessMeasure stiff) { mStiffness = stiff; } + internal static IfcTranslationalStiffnessSelect Parse(string str,Schema schema) + { + if (str == "$") + return null; + if (str.StartsWith("IFCBOOL")) + return new IfcTranslationalStiffnessSelect(((IfcBoolean)ParserIfc.parseSimpleValue(str)).mValue); + if (str.StartsWith("IFCLIN")) + return new IfcTranslationalStiffnessSelect((IfcLinearStiffnessMeasure)ParserIfc.parseDerivedMeasureValue(str)); + if (str.StartsWith(".")) + return new IfcTranslationalStiffnessSelect(ParserSTEP.ParseBool(str)); + double d = ParserSTEP.ParseDouble(str), tol = 1e-9; + if (schema == Schema.IFC2x3) + { + if (Math.Abs(d + 1) < tol) + return new IfcTranslationalStiffnessSelect(true) { mStiffness = new IfcLinearStiffnessMeasure(-1) }; + if (Math.Abs(d) < tol) + return new IfcTranslationalStiffnessSelect(false) { mStiffness = new IfcLinearStiffnessMeasure(0) }; + } + return new IfcTranslationalStiffnessSelect(new IfcLinearStiffnessMeasure(d)); + } + public override string ToString() { return (mStiffness == null ? "IFCBOOLEAN(" + ParserSTEP.BoolToString(mRigid) + ")" : mStiffness.ToString()); } + } + public class IfcTransportElement : IfcElement + { + internal IfcTransportElement() : base() { } + internal IfcTransportElement(IfcTransportElement be) : base(be) { } + internal IfcTransportElement(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation) : base(host, placement, representation) { } + internal static void parseFields(IfcTransportElement e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + internal static IfcTransportElement Parse(string strDef) { IfcTransportElement e = new IfcTransportElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + } + public class IfcTransportElementType : IfcElementType + { + internal IfcTransportElementTypeEnum mPredefinedType;// IfcTransportElementTypeEnum; + public IfcTransportElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTransportElementType() : base() { } + internal IfcTransportElementType(IfcTransportElementType o) : base(o) { mPredefinedType = o.mPredefinedType; } + public IfcTransportElementType(DatabaseIfc m, string name, IfcTransportElementTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal new static IfcTransportElementType Parse(string strDef) { IfcTransportElementType t = new IfcTransportElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + internal static void parseFields(IfcTransportElementType t, List arrFields, ref int ipos) { IfcElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcTransportElementTypeEnum)Enum.Parse(typeof(IfcTransportElementTypeEnum), arrFields[ipos++].Replace(".", "")); } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcTrapeziumProfileDef : IfcParameterizedProfileDef + { + internal double mBottomXDim;// : IfcPositiveLengthMeasure; + internal double mTopXDim;// : IfcPositiveLengthMeasure; + internal double mYDim;// : IfcPositiveLengthMeasure; + internal double mTopXOffset;// : IfcPositiveLengthMeasure; + internal IfcTrapeziumProfileDef() : base() { } + internal IfcTrapeziumProfileDef(IfcTrapeziumProfileDef c) : base(c) { mBottomXDim = c.mBottomXDim; mTopXDim = c.mTopXDim; mYDim = c.mYDim; mTopXOffset = c.mTopXOffset; } + internal IfcTrapeziumProfileDef(DatabaseIfc db, string name,double bottomXDim, double topXDim,double yDim,double topXOffset) : base(db) + { + if (mDatabase.mModelView != ModelView.Ifc4NotAssigned && mDatabase.mModelView != ModelView.If2x3NotAssigned) + throw new Exception("Invalid Model View for IfcTrapeziumProfileDef : " + db.ModelView.ToString()); + Name = name; + mBottomXDim = bottomXDim; + mTopXDim = topXDim; + mYDim = yDim; + mTopXOffset = topXOffset; + } + internal static void parseFields(IfcTrapeziumProfileDef p, List arrFields, ref int ipos) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mBottomXDim = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTopXDim = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mYDim = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTopXOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + internal new static IfcTrapeziumProfileDef Parse(string strDef) { IfcTrapeziumProfileDef p = new IfcTrapeziumProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mBottomXDim) + "," + ParserSTEP.DoubleToString(mTopXDim) + "," + ParserSTEP.DoubleToString(mYDim) + "," + ParserSTEP.DoubleToString(mTopXOffset); } + } + public partial class IfcTriangulatedFaceSet : IfcTessellatedFaceSet + { + internal Tuple[] mCoordIndex = new Tuple[0];// : LIST [1:?] OF LIST [3:3] OF INTEGER; + internal Tuple[] mNormalIndex = new Tuple[0];// : OPTIONAL LIST [1:?] OF LIST [3:3] OF INTEGER; + internal IfcTriangulatedFaceSet() : base() { } + internal IfcTriangulatedFaceSet(IfcTriangulatedFaceSet s) : base(s) + { + mCoordIndex = s.mCoordIndex; + mNormalIndex = s.mNormalIndex; + } + public IfcTriangulatedFaceSet(DatabaseIfc m, IfcCartesianPointList3D pl, List> normals, bool closed, IEnumerable> coords, IEnumerable> normalIndices) + : base(m, pl, normals, closed) { mCoordIndex = coords.ToArray(); if (normals != null) mNormalIndex = normalIndices.ToArray(); } + internal static IfcTriangulatedFaceSet Parse(string str) + { + IfcTriangulatedFaceSet t = new IfcTriangulatedFaceSet(); + int pos = 0; + t.Parse(str, ref pos); + return t; + } + protected override void Parse(string str, ref int pos) + { + base.Parse(str, ref pos); + string field = ParserSTEP.StripField(str, ref pos); + mCoordIndex = ParserSTEP.SplitListSTPIntTriple(field); + field = ParserSTEP.StripField(str, ref pos); + if (field.StartsWith("(")) + mNormalIndex = ParserSTEP.SplitListSTPIntTriple(field); + } + protected override string BuildString() + { + StringBuilder sb = new StringBuilder(); + Tuple p = mCoordIndex[0]; + sb.Append(",((" + p.Item1 + "," + p.Item2 + "," + p.Item3); + for (int icounter = 1; icounter < mCoordIndex.Length; icounter++) + { + p = mCoordIndex[icounter]; + sb.Append("),(" + p.Item1 + "," + p.Item2 + "," + p.Item3); + } + if (mNormalIndex.Length == 0) + sb.Append(")),$"); + else + { + p = mNormalIndex[0]; + sb.Append(")),((" + p.Item1 + "," + p.Item2 + "," + p.Item3); + for (int icounter = 1; icounter < mNormalIndex.Length; icounter++) + { + p = mNormalIndex[icounter]; + sb.Append("),(" + p.Item1 + "," + p.Item2 + "," + p.Item3); + } + sb.Append("))"); + } + return base.BuildString() + sb.ToString(); + } + } + public partial class IfcTrimmedCurve : IfcBoundedCurve + { + private int mBasisCurve;//: IfcCurve; + internal IfcTrimmingSelect mTrim1;// : SET [1:2] OF IfcTrimmingSelect; + internal IfcTrimmingSelect mTrim2;//: SET [1:2] OF IfcTrimmingSelect; + private bool mSenseAgreement;// : BOOLEAN; + + internal IfcCurve BasisCurve { get { return mDatabase.mIfcObjects[mBasisCurve] as IfcCurve; } } + internal bool SenseAgreement { get { return mSenseAgreement; } } + + internal IfcTrimmingPreference mMasterRepresentation = IfcTrimmingPreference.UNSPECIFIED;// : IfcTrimmingPreference; + internal IfcTrimmedCurve() : base() { } + internal IfcTrimmedCurve(IfcTrimmedCurve c) : base(c) { mBasisCurve = c.mBasisCurve; mTrim1 = c.mTrim1; mTrim2 = c.mTrim2; mSenseAgreement = c.mSenseAgreement; mMasterRepresentation = c.mMasterRepresentation; } + internal IfcTrimmedCurve(IfcCurve basis, IfcTrimmingSelect start, IfcTrimmingSelect end, bool senseAgreement, IfcTrimmingPreference tp) : base(basis.mDatabase) + { + mBasisCurve = basis.mIndex; + mTrim1 = start; + mTrim2 = end; + mSenseAgreement = senseAgreement; + mMasterRepresentation = tp; + } + + internal static void parseFields(IfcTrimmedCurve c, List arrFields, ref int ipos) { IfcBoundedCurve.parseFields(c, arrFields, ref ipos); c.mBasisCurve = ParserSTEP.ParseLink(arrFields[ipos++]); c.mTrim1 = IfcTrimmingSelect.Parse(arrFields[ipos++]); c.mTrim2 = IfcTrimmingSelect.Parse(arrFields[ipos++]); c.mSenseAgreement = ParserSTEP.ParseBool(arrFields[ipos++]); c.mMasterRepresentation = (IfcTrimmingPreference)Enum.Parse(typeof(IfcTrimmingPreference), arrFields[ipos++].Replace(".", "")); } + internal static IfcTrimmedCurve Parse(string strDef) { IfcTrimmedCurve c = new IfcTrimmedCurve(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mBasisCurve) + "," + mTrim1.ToString() + "," + mTrim2.ToString() + "," + ParserSTEP.BoolToString(mSenseAgreement) + ",." + mMasterRepresentation.ToString() + "."; } + } + public struct IfcTrimmingSelect + { + internal IfcTrimmingSelect(double param, IfcCartesianPoint cp) + { + mIfcParameterValue = param; + mIfcCartesianPoint = 0; + if (cp != null) + mIfcCartesianPoint = cp.mIndex; + } + internal IfcTrimmingSelect(IfcCartesianPoint cp) + { + mIfcParameterValue = double.NaN; + mIfcCartesianPoint = 0; + if (cp != null) + mIfcCartesianPoint = cp.mIndex; + } + internal double mIfcParameterValue; + internal int mIfcCartesianPoint; + internal static IfcTrimmingSelect Parse(string str) + { + IfcTrimmingSelect ts = new IfcTrimmingSelect(); + ts.mIfcParameterValue = double.NaN; + int i = 0; + if (str[i] == '(') + i++; + char c = str[i]; + if (c == '#') + { + string ls = "#"; + i++; + while (i < str.Length) + { + c = str[i]; + if (c == ',' || c == ')') + break; + ls += c; + i++; + } + ts.mIfcCartesianPoint = ParserSTEP.ParseLink(ls); + if (c == ',') + { + if (str.Substring(i + 1).StartsWith("IFCPARAMETERVALUE(", true, System.Globalization.CultureInfo.CurrentCulture)) + { + i += 19; + string pv = ""; + while (str[i] != ')') + { + pv += str[i++]; + } + ts.mIfcParameterValue = ParserSTEP.ParseDouble(pv); + } + } + } + else + { + if (str.Substring(i).StartsWith("IFCPARAMETERVALUE(", true, System.Globalization.CultureInfo.CurrentCulture)) + { + i += 18; + string pv = ""; + while (str[i] != ')') + { + pv += str[i++]; + } + ts.mIfcParameterValue = ParserSTEP.ParseDouble(pv); + } + if (++i < str.Length) + { + if (str[i++] == ',') + { + ts.mIfcCartesianPoint = ParserSTEP.ParseLink(str.Substring(i, str.Length - i - 1)); + } + } + } + return ts; + } + public override string ToString() + { + string str = "("; + if (!double.IsNaN(mIfcParameterValue)) + { + str += "IFCPARAMETERVALUE(" + ParserSTEP.DoubleToString(mIfcParameterValue) + ")"; + if (mIfcCartesianPoint > 0) + str += "," + ParserSTEP.LinkToString(mIfcCartesianPoint); + return str + ")"; + } + else + return str + ParserSTEP.LinkToString(mIfcCartesianPoint) + ")"; + } + } + public partial class IfcTShapeProfileDef : IfcParameterizedProfileDef + { + internal double mDepth, mFlangeWidth, mWebThickness, mFlangeThickness;// : IfcPositiveLengthMeasure; + internal double mFilletRadius, mFlangeEdgeRadius, mWebEdgeRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mWebSlope, mFlangeSlope;// : OPTIONAL IfcPlaneAngleMeasure; + //internal double mCentreOfGravityInX;// : OPTIONAL IfcPositiveLengthMeasure + + internal double Depth { get { return mDepth; } set { mDepth = value; } } + internal double FlangeWidth { get { return mFlangeWidth; } set { mFlangeWidth = value; } } + internal double WebThickness { get { return mWebThickness; } set { mWebThickness = value; } } + internal double FlangeThickness { get { return mFlangeThickness; } set { mFlangeThickness = value; } } + internal double FilletRadius { get { return mFilletRadius; } set { mFilletRadius = value; } } + internal double FlangeEdgeRadius { get { return mFlangeEdgeRadius; } set { mFlangeEdgeRadius = value; } } + internal double WebEdgeRadius { get { return mWebEdgeRadius; } set { mWebEdgeRadius = value; } } + internal double WebSlope { get { return mWebSlope; } set { mWebSlope = value; } } + internal double FlangeSlope { get { return mFlangeSlope; } set { mFlangeSlope = value; } } + + internal IfcTShapeProfileDef() : base() { } + internal IfcTShapeProfileDef(IfcTShapeProfileDef p) + : base(p) + { + mDepth = p.mDepth; + mFlangeWidth = p.mFlangeWidth; + mWebThickness = p.mWebThickness; + mFlangeThickness = p.mFlangeThickness; + mFilletRadius = p.mFilletRadius; + mFlangeEdgeRadius = p.mFlangeEdgeRadius; + mWebEdgeRadius = p.mWebEdgeRadius; + mWebSlope = p.mWebSlope; + mFlangeSlope = p.mFlangeSlope; + } + + internal static void parseFields(IfcTShapeProfileDef p, List arrFields, ref int ipos,Schema schema) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeEdgeRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebEdgeRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebSlope = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeSlope = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + ipos++; + } + internal static IfcTShapeProfileDef Parse(string strDef,Schema schema) { IfcTShapeProfileDef p = new IfcTShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleToString(mDepth) + "," + ParserSTEP.DoubleToString(mFlangeWidth) + "," + + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mFlangeThickness) + "," + + ParserSTEP.DoubleOptionalToString(mFilletRadius) + "," + ParserSTEP.DoubleOptionalToString(mFlangeEdgeRadius) + "," + + ParserSTEP.DoubleOptionalToString(mWebEdgeRadius) + "," + ParserSTEP.DoubleOptionalToString(mWebSlope) + "," + + ParserSTEP.DoubleOptionalToString(mFlangeSlope) + (mDatabase.mSchema == Schema.IFC2x3 ? ",$" : ""); + } + } + public class IfcTubeBundle : IfcEnergyConversionDevice //IFC4 + { + internal IfcTubeBundleTypeEnum mPredefinedType = IfcTubeBundleTypeEnum.NOTDEFINED;// OPTIONAL : IfcTubeBundleTypeEnum; + public IfcTubeBundleTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTubeBundle() : base() { } + internal IfcTubeBundle(IfcTubeBundle b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcTubeBundle(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcTubeBundle s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcTubeBundleTypeEnum)Enum.Parse(typeof(IfcTubeBundleTypeEnum), str); + } + internal new static IfcTubeBundle Parse(string strDef) { IfcTubeBundle s = new IfcTubeBundle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcTubeBundleTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcTubeBundleType : IfcEnergyConversionDeviceType + { + internal IfcTubeBundleTypeEnum mPredefinedType = IfcTubeBundleTypeEnum.NOTDEFINED;// : IfcTubeBundleEnum; + public IfcTubeBundleTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcTubeBundleType() : base() { } + internal IfcTubeBundleType(IfcTubeBundleType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcTubeBundleType(DatabaseIfc m, string name, IfcTubeBundleTypeEnum t) : base(m) { Name = name; PredefinedType = t; } + internal static void parseFields(IfcTubeBundleType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcTubeBundleTypeEnum)Enum.Parse(typeof(IfcTubeBundleTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcTubeBundleType Parse(string strDef) { IfcTubeBundleType t = new IfcTubeBundleType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcTwoDirectionRepeatFactor : IfcOneDirectionRepeatFactor // DEPRECEATED IFC4 + { + internal int mSecondRepeatFactor;// : IfcVector + internal IfcTwoDirectionRepeatFactor() : base() { } + internal IfcTwoDirectionRepeatFactor(IfcTwoDirectionRepeatFactor p) : base(p) { mSecondRepeatFactor = p.mSecondRepeatFactor; } + internal static void parseFields(IfcTwoDirectionRepeatFactor f, List arrFields, ref int ipos) { IfcOneDirectionRepeatFactor.parseFields(f, arrFields, ref ipos); f.mSecondRepeatFactor = ParserSTEP.ParseLink(arrFields[ipos++]); } + internal new static IfcTwoDirectionRepeatFactor Parse(string strDef) { IfcTwoDirectionRepeatFactor f = new IfcTwoDirectionRepeatFactor(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mSecondRepeatFactor); } + } + public partial class IfcTypeObject : IfcObjectDefinition //(IfcTypeProcess, IfcTypeProduct, IfcTypeResource) IFC4 ABSTRACT + { + internal string mApplicableOccurrence = "$";// : OPTIONAL IfcLabel; + internal List mHasPropertySets = new List();// : OPTIONAL SET [1:?] OF IfcPropertySetDefinition + //INVERSE + internal IfcRelDefinesByType mObjectTypeOf = null; + public IfcRelDefinesByType ObjectTypeOf { get { return mObjectTypeOf; } } + public List HasPropertySets { get { return mHasPropertySets.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcPropertySetDefinition); } set { mHasPropertySets = value.ConvertAll(x => x.mIndex); } } + //GeomGym + internal IfcMaterialProfileSet mTapering = null; + protected IfcTypeObject() : base() { } + protected IfcTypeObject(IfcTypeObject obj) : base(obj) { mApplicableOccurrence = obj.mApplicableOccurrence; mHasPropertySets = new List(obj.mHasPropertySets.ToArray()); } + internal IfcTypeObject(DatabaseIfc m) : base(m) { IfcRelDefinesByType rdt = new IfcRelDefinesByType(this) { Name = Name }; } + + internal static void parseFields(IfcTypeObject t, List arrFields, ref int ipos) + { + IfcObjectDefinition.parseFields(t, arrFields, ref ipos); + t.mApplicableOccurrence = arrFields[ipos++]; + string str = arrFields[ipos++]; + if (str != "$") + t.mHasPropertySets = ParserSTEP.SplitListLinks(str); + } + protected override string BuildString() + { + string str = base.BuildString() + "," + mApplicableOccurrence; + if (mHasPropertySets.Count > 0) + { + str += ",(" + ParserSTEP.LinkToString(mHasPropertySets[0]); + for (int icounter = 1; icounter < mHasPropertySets.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mHasPropertySets[icounter]); + str += ")"; + } + else + str += ",$"; + return str; + } + internal static IfcTypeObject Parse(string strDef) { IfcTypeObject o = new IfcTypeObject(); int ipos = 0; parseFields(o, ParserSTEP.SplitLineFields(strDef), ref ipos); return o; } + + public void AddPropertySet(IfcPropertySetDefinition psd) { mHasPropertySets.Add(psd.mIndex); } + } + public abstract class IfcTypeProcess : IfcTypeObject //ABSTRACT SUPERTYPE OF(ONEOF(IfcEventType, IfcProcedureType, IfcTaskType)) + { + private string mIdentification = "$";// : OPTIONAL IfcIdentifier; + private string mLongDescription = "$";// : OPTIONAL IfcText; + private string mProcessType = "$";// : OPTIONAL IfcLabel; + + public string Identification { get { return (mIdentification == "$" ? "" : ParserIfc.Decode(mIdentification)); } set { mIdentification = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string LongDescription { get { return (mLongDescription == "$" ? "" : ParserIfc.Decode(mLongDescription)); } set { mLongDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string ProcessType { get { return (mProcessType == "$" ? "" : ParserIfc.Decode(mProcessType)); } set { mProcessType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcTypeProcess() : base() { } + protected IfcTypeProcess(IfcTypeProcess o) : base(o) { mIdentification = o.mIdentification; mLongDescription = o.mLongDescription; mProcessType = o.mProcessType; } + protected IfcTypeProcess(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcTypeProcess p, List arrFields, ref int ipos) { IfcTypeObject.parseFields(p, arrFields, ref ipos); p.mIdentification = arrFields[ipos++].Replace("'", ""); p.mLongDescription = arrFields[ipos++].Replace("'", ""); p.mProcessType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mIdentification == "$" ? ",$," : ",'" + mIdentification + "',") + (mLongDescription == "$" ? "$," : "'" + mLongDescription + "',") + (mProcessType == "$" ? "$" : "'" + mProcessType + "'"); } + } + public partial class IfcTypeProduct : IfcTypeObject, IfcProductSelect //ABSTRACT SUPERTYPE OF (ONEOF (IfcDoorStyle ,IfcElementType ,IfcSpatialElementType ,IfcWindowStyle)) + { + internal List mRepresentationMaps = new List();// : OPTIONAL LIST [1:?] OF UNIQUE IfcRepresentationMap; + private string mTag = "$";// : OPTIONAL IfcLabel + + public List RepresentationMaps { get { return mRepresentationMaps.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcRepresentationMap); } set { mRepresentationMaps = (value == null ? new List() : value.ConvertAll(x => x.mIndex)); } } + public string Tag { get { return (mTag == "$" ? "" : mTag); } set { mTag = (string.IsNullOrEmpty(value) ? "$" : value); } } + //INVERSE + internal List mReferencedBy = new List();// : SET OF IfcRelAssignsToProduct FOR RelatingProduct; + public List ReferencedBy { get { return mReferencedBy; } } + + protected IfcTypeProduct() : base() { } + protected IfcTypeProduct(IfcTypeProduct o) : base(o) { mRepresentationMaps = new List(o.mRepresentationMaps.ToArray()); mTag = o.mTag; } + protected IfcTypeProduct(DatabaseIfc m) : base(m) { if (mDatabase.mContext != null) mDatabase.mContext.AddDeclared(this); } + + internal new static IfcTypeProduct Parse(string strDef) { IfcTypeProduct p = new IfcTypeProduct(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcTypeProduct p, List arrFields, ref int ipos) { IfcTypeObject.parseFields(p, arrFields, ref ipos); p.mRepresentationMaps = ParserSTEP.SplitListLinks(arrFields[ipos++]); p.mTag = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() + { + string str = base.BuildString() + ","; + if (mRepresentationMaps.Count > 0) + { + str += "(" + ParserSTEP.LinkToString(mRepresentationMaps[0]); + for (int icounter = 1; icounter < mRepresentationMaps.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mRepresentationMaps[icounter]); + str += ")"; + } + else + str += "$"; + return str + (mTag == "$" ? ",$" : ",'" + mTag + "'"); + } + } + public abstract class IfcTypeResource : IfcTypeObject //ABSTRACT SUPERTYPE OF(IfcConstructionResourceType) + { + internal string mIdentification = "$";// : OPTIONAL IfcIdentifier; + internal string mLongDescription = "$";// : OPTIONAL IfcText; + internal string mResourceType = "$";// : OPTIONAL IfcLabel; + + public string Identification { get { return (mIdentification == "$" ? "" : ParserIfc.Decode(mIdentification)); } set { mIdentification = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string LongDescription { get { return (mLongDescription == "$" ? "" : ParserIfc.Decode(mLongDescription)); } set { mLongDescription = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + public string ResourceType { get { return (mResourceType == "$" ? "" : ParserIfc.Decode(mResourceType)); } set { mResourceType = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + protected IfcTypeResource() : base() { } + protected IfcTypeResource(IfcTypeResource o) : base(o) { mIdentification = o.mIdentification; mLongDescription = o.mLongDescription; mResourceType = o.mResourceType; } + protected IfcTypeResource(DatabaseIfc m) : base(m) { } + protected static void parseFields(IfcTypeResource p, List arrFields, ref int ipos) { IfcTypeObject.parseFields(p, arrFields, ref ipos); p.mIdentification = arrFields[ipos++].Replace("'", ""); p.mLongDescription = arrFields[ipos++].Replace("'", ""); p.mResourceType = arrFields[ipos++].Replace("'", ""); } + protected override string BuildString() { return base.BuildString() + (mIdentification == "$" ? ",$," : ",'" + mIdentification + "',") + (mLongDescription == "$" ? "$," : "'" + mLongDescription + "',") + (mResourceType == "$" ? "$" : "'" + mResourceType + "'"); } + } +} diff --git a/IFC/IFC U.cs b/IFC/IFC U.cs new file mode 100644 index 0000000..531c817 --- /dev/null +++ b/IFC/IFC U.cs @@ -0,0 +1,378 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial interface IfcUnit : IfcInterface { } // = SELECT(IfcDerivedUnit, IfcNamedUnit, IfcMonetaryUnit); + public class IfcUnitaryControlElement : IfcDistributionControlElement //IFC4 + { + internal IfcUnitaryControlElementTypeEnum mPredefinedType = IfcUnitaryControlElementTypeEnum.NOTDEFINED; + public IfcUnitaryControlElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcUnitaryControlElement(IfcUnitaryControlElement a) : base(a) { mPredefinedType = a.mPredefinedType; } + internal IfcUnitaryControlElement() : base() { } + internal IfcUnitaryControlElement(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r, IfcDistributionSystem system) : base(host,p,r, system) { } + internal static void parseFields(IfcUnitaryControlElement a, List arrFields, ref int ipos) + { + IfcDistributionControlElement.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcUnitaryControlElementTypeEnum)Enum.Parse(typeof(IfcUnitaryControlElementTypeEnum), s.Replace(".", "")); + } + internal new static IfcUnitaryControlElement Parse(string strDef) { IfcUnitaryControlElement d = new IfcUnitaryControlElement(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcUnitaryControlElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcUnitaryControlElementType : IfcDistributionControlElementType + { + internal IfcUnitaryControlElementTypeEnum mPredefinedType = IfcUnitaryControlElementTypeEnum.NOTDEFINED;// : IfcUnitaryControlElementTypeEnum; + public IfcUnitaryControlElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcUnitaryControlElementType(IfcUnitaryControlElementType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal IfcUnitaryControlElementType() : base() { } + internal IfcUnitaryControlElementType(DatabaseIfc m, string name, IfcUnitaryControlElementTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcUnitaryControlElementType t, List arrFields, ref int ipos) { IfcDistributionControlElementType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcUnitaryControlElementTypeEnum)Enum.Parse(typeof(IfcUnitaryControlElementTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcUnitaryControlElementType Parse(string strDef) { IfcUnitaryControlElementType t = new IfcUnitaryControlElementType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcUnitaryEquipment : IfcEnergyConversionDevice //IFC4 + { + internal IfcUnitaryEquipmentTypeEnum mPredefinedType = IfcUnitaryEquipmentTypeEnum.NOTDEFINED;// OPTIONAL : IfcUnitaryEquipmentTypeEnum; + public IfcUnitaryEquipmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcUnitaryEquipment() : base() { } + internal IfcUnitaryEquipment(IfcUnitaryEquipment b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcUnitaryEquipment(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcUnitaryEquipment s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcUnitaryEquipmentTypeEnum)Enum.Parse(typeof(IfcUnitaryEquipmentTypeEnum), str); + } + internal new static IfcUnitaryEquipment Parse(string strDef) { IfcUnitaryEquipment s = new IfcUnitaryEquipment(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcUnitaryEquipmentTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcUnitaryEquipmentType : IfcEnergyConversionDeviceType + { + internal IfcUnitaryEquipmentTypeEnum mPredefinedType = IfcUnitaryEquipmentTypeEnum.NOTDEFINED;// : IfcUnitaryEquipmentTypeEnum; + public IfcUnitaryEquipmentTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcUnitaryEquipmentType() : base() { } + internal IfcUnitaryEquipmentType(IfcUnitaryEquipmentType be) : base((IfcEnergyConversionDeviceType)be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcUnitaryEquipmentType t, List arrFields, ref int ipos) { IfcEnergyConversionDeviceType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcUnitaryEquipmentTypeEnum)Enum.Parse(typeof(IfcUnitaryEquipmentTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcUnitaryEquipmentType Parse(string strDef) { IfcUnitaryEquipmentType t = new IfcUnitaryEquipmentType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcUnitAssignment : BaseClassIfc + { + public enum Length { Metre, Centimetre, Millimetre, Foot, Inch }; + + private List mUnits = new List();// : SET [1:?] OF IfcUnit; + + internal List Units { get { return mUnits.ConvertAll(x => mDatabase.mIfcObjects[x] as IfcUnit); } } + + internal IfcUnitAssignment() : base() { } + internal IfcUnitAssignment(IfcUnitAssignment v) : base() { mUnits = new List(v.mUnits.ToArray()); } + internal IfcUnitAssignment(DatabaseIfc m) : base(m) { } + + internal void SetUnits(Length length) + { + if (length == Length.Millimetre) + { + mUnits.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.MILLI, IfcSIUnitName.METRE).mIndex); + mDatabase.ScaleSI = 0.001; + } + else if (length == Length.Centimetre) + { + mUnits.Add(new IfcSIUnit(mDatabase, IfcUnitEnum.LENGTHUNIT, IfcSIPrefix.CENTI, IfcSIUnitName.METRE).mIndex); + mDatabase.ScaleSI = 0.01; + + } + else if (length == Length.Inch) + { + IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(0.0254), mDatabase.mSILength); + mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Inches", mwu).mIndex); + mDatabase.ScaleSI = 0.0254; + } + else if (length == Length.Foot) + { + IfcMeasureWithUnit mwu = new IfcMeasureWithUnit(new IfcLengthMeasure(1 / 3.2808399), mDatabase.mSILength); + mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.LENGTHUNIT, "Feet",mwu).mIndex); + mDatabase.ScaleSI = 1 / 3.2808399; + } + else + mUnits.Add(mDatabase.mSILength.mIndex); + SetUnits(); + } + internal void SetUnits() + { + if (Find(IfcUnitEnum.AREAUNIT) == null && mDatabase.mSIArea != null) + mUnits.Add(mDatabase.mSIArea.mIndex); + if (Find(IfcUnitEnum.VOLUMEUNIT) == null && mDatabase.mSIVolume != null) + mUnits.Add(mDatabase.mSIVolume.mIndex); + if (Find(IfcUnitEnum.PLANEANGLEUNIT) == null) + { + IfcSIUnit radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN); + mUnits.Add(mDatabase.mPlaneAngleToRadians == 1 ? radians.mIndex : new IfcConversionBasedUnit(IfcUnitEnum.PLANEANGLEUNIT, "DEGREE", new IfcMeasureWithUnit(new IfcPlaneAngleMeasure(Math.PI / 180.0), radians)).mIndex); + } + if (Find(IfcUnitEnum.TIMEUNIT) == null) + { + IfcSIUnit seconds = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND); + if (mDatabase.mTimeInDays) + { + IfcMeasureWithUnit mu = new IfcMeasureWithUnit(new IfcTimeMeasure(60 * 60 * 24), seconds); + mUnits.Add(new IfcConversionBasedUnit(IfcUnitEnum.TIMEUNIT, "DAY", mu).mIndex); + } + else + mUnits.Add(seconds.mIndex); + } + } + internal bool mStructuralSet = false; + internal void setStructuralUnits() + { + if (mStructuralSet) + return; + mStructuralSet = true; + DatabaseIfc m = mDatabase; + + IfcNamedUnit fu = Find(IfcUnitEnum.FORCEUNIT); + if (fu == null) + { + fu = new IfcSIUnit(m, IfcUnitEnum.FORCEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.NEWTON); + mUnits.Add(fu.mIndex); + } + if (Find(IfcDerivedUnitEnum.TORQUEUNIT) == null) + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, 1), IfcDerivedUnitEnum.TORQUEUNIT).mIndex); + if (Find(IfcDerivedUnitEnum.LINEARFORCEUNIT) == null) + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -1), IfcDerivedUnitEnum.LINEARFORCEUNIT).mIndex); + if (Find(IfcDerivedUnitEnum.PLANARFORCEUNIT) == null) + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -2), IfcDerivedUnitEnum.PLANARFORCEUNIT).mIndex); + if (Find(IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT) == null) + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -2), IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT).mIndex); + + IfcNamedUnit time = Find(IfcUnitEnum.TIMEUNIT); + if (time == null || Math.Abs(time.getSIFactor() - 1) < mDatabase.Tolerance) + time = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND); + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(m.mSILength, 1), new IfcDerivedUnitElement(time, -2), IfcDerivedUnitEnum.ACCELERATIONUNIT).mIndex); + mUnits.Add(new IfcSIUnit(m, IfcUnitEnum.PRESSUREUNIT, IfcSIPrefix.NONE, IfcSIUnitName.PASCAL).mIndex); + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(m.mSILength, 3), IfcDerivedUnitEnum.SECTIONMODULUSUNIT).mIndex); + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(m.mSILength, 4), IfcDerivedUnitEnum.MOMENTOFINERTIAUNIT).mIndex); + IfcSIUnit massu = Find(IfcUnitEnum.MASSUNIT) as IfcSIUnit; + if (massu == null) + { + massu = new IfcSIUnit(m, IfcUnitEnum.MASSUNIT, IfcSIPrefix.KILO, IfcSIUnitName.GRAM); + mUnits.Add(massu.mIndex); + } + if (Find(IfcDerivedUnitEnum.MASSDENSITYUNIT) == null) + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(massu, 1), new IfcDerivedUnitElement(m.mSIVolume, -1), IfcDerivedUnitEnum.MASSDENSITYUNIT).mIndex); + IfcSIUnit kelvin = Find(IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT) as IfcSIUnit; + if (kelvin == null) + { + kelvin = new IfcSIUnit(m, IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT, IfcSIPrefix.NONE, IfcSIUnitName.KELVIN); + mUnits.Add(kelvin.mIndex); + } + if (Find(IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT) == null) + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(kelvin, -1), IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT).mIndex); + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -1), IfcDerivedUnitEnum.LINEARSTIFFNESSUNIT).mIndex); + IfcNamedUnit radians = Find(IfcUnitEnum.PLANEANGLEUNIT); + if (radians == null || Math.Abs(radians.getSIFactor() - 1) < mDatabase.Tolerance) + radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN); + mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, 1), new IfcDerivedUnitElement(radians, -1), IfcDerivedUnitEnum.ROTATIONALSTIFFNESSUNIT).mIndex); + } + internal void AddUnit(IfcUnit u) { mUnits.Add(u.Index); } + internal static void parseFields(IfcUnitAssignment a, List arrFields, ref int ipos) { a.mUnits = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",("; + if (mUnits.Count > 0) + { + str += ParserSTEP.LinkToString(mUnits[0]); + for (int icounter = 1; icounter < mUnits.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mUnits[icounter]); + } + return str + ")"; + } + internal static IfcUnitAssignment Parse(string strDef) { IfcUnitAssignment a = new IfcUnitAssignment(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal IfcNamedUnit Find(IfcUnitEnum unit) + { + List units = Units; + foreach (IfcUnit u in units) + { + IfcNamedUnit nu = u as IfcNamedUnit; + if (nu != null && nu.UnitType == unit) + return nu; + } + return null; + } + internal IfcDerivedUnit Find(IfcDerivedUnitEnum unit) + { + List units = Units; + foreach (IfcUnit u in units) + { + IfcDerivedUnit du = u as IfcDerivedUnit; + if (du != null && du.UnitType == unit) + return du; + } + return null; + } + internal void Replace(IfcConversionBasedUnit cbu) + { + for (int icounter = 0; icounter < mUnits.Count; icounter++) + { + IfcNamedUnit u = mDatabase.mIfcObjects[mUnits[icounter]] as IfcNamedUnit; + if (u != null && u.UnitType == cbu.UnitType) + { + mUnits[icounter] = cbu.mIndex; + return; + } + } + } + internal double LengthScaleSI + { + get + { + List units = Units; +#if(REVIT) + double result = GGYM.Units.MetreToFeet; +#else + double result = 1; +#endif + foreach (IfcUnit u in units) + { + IfcNamedUnit nu = u as IfcNamedUnit; + if (nu != null) + { + if (nu.UnitType == IfcUnitEnum.LENGTHUNIT) + { + double d = nu.getSIFactor(); + mDatabase.ScaleSI = d; +#if(GGRHINOIFC) + if (GGYM.ggAssembly.mOptions.RhinoDocTolerance) + { + double docScale = Rhino.RhinoMath.UnitScale(Rhino.UnitSystem.Meters, Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem); + mDatabase.Tolerance = docScale * Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance * d; + } +#endif +#if(REVIT) + d = mDatabase.mRevitScale = GGYM.Units.MetreToFeet * d; +#endif + result = d; + } + if (nu.UnitType == IfcUnitEnum.PLANEANGLEUNIT) + { + double d = nu.getSIFactor(); + mDatabase.mPlaneAngleToRadians = d; + } + } + else + { + IfcDerivedUnit du = u as IfcDerivedUnit; + if (du != null) + { + + } + } + } + return result; + } + } + internal double getScaleSI(IfcUnitEnum unitType) + { + List units = Units; + foreach (IfcUnit u in units) + { + IfcNamedUnit nu = u as IfcNamedUnit; + if (nu != null && nu.UnitType == unitType) + { + IfcSIUnit si = nu as IfcSIUnit; + if (si != null) + return si.getSIFactor(); + IfcConversionBasedUnit cbu = nu as IfcConversionBasedUnit; + if (cbu != null) + { + return cbu.getSIFactor(); + + } + } + + } + return 1; + } + internal double getScaleSI(IfcDerivedUnitEnum unitType) + { + List units = Units; + foreach (IfcUnit u in units) + { + IfcDerivedUnit du = u as IfcDerivedUnit; + if (du != null) + { + + } + } + return 1; + } + } + public partial class IfcUShapeProfileDef : IfcParameterizedProfileDef + { + internal double mDepth, mFlangeWidth, mWebThickness, mFlangeThickness;// : IfcPositiveLengthMeasure; + internal double mFilletRadius, mEdgeRadius, mFlangeSlope;// : OPTIONAL IfcPlaneAngleMeasure; + //internal double mCentreOfGravityInX;// : : OPTIONAL IfcPositiveLengthMeasure // DELETED IFC4 Superseded by respective attribute of IfcStructuralProfileProperties + internal IfcUShapeProfileDef() : base() { } + internal IfcUShapeProfileDef(IfcUShapeProfileDef p) + : base(p) + { + mDepth = p.mDepth; + mFlangeWidth = p.mFlangeWidth; + mWebThickness = p.mWebThickness; + mFlangeThickness = p.mFlangeThickness; + mFilletRadius = p.mFilletRadius; + mEdgeRadius = p.mEdgeRadius; + mFlangeSlope = p.mFlangeSlope; + } + public IfcUShapeProfileDef(DatabaseIfc m, string name, double depth, double flangeWidth, double webThickness, double flangeThickness, double filletRadius, double edgeRadius, double flangeSlope) + : base(m) { Name = name; mDepth = depth; mFlangeWidth = flangeWidth; mWebThickness = webThickness; mFlangeThickness = flangeThickness; mFilletRadius = filletRadius; mEdgeRadius = edgeRadius; mFlangeSlope = flangeSlope; } + internal static void parseFields(IfcUShapeProfileDef p, List arrFields, ref int ipos,Schema schema) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mEdgeRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeSlope = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema == Schema.IFC2x3) + ipos++; + } + internal static IfcUShapeProfileDef Parse(string strDef, Schema schema) { IfcUShapeProfileDef p = new IfcUShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return p; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleToString(mDepth) + "," + ParserSTEP.DoubleToString(mFlangeWidth) + "," + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mFlangeThickness) + "," + ParserSTEP.DoubleOptionalToString(mFilletRadius) + "," + ParserSTEP.DoubleOptionalToString(mEdgeRadius) + "," + ParserSTEP.DoubleOptionalToString(mFlangeSlope) + (mDatabase.mSchema == Schema.IFC2x3 ? ",$" : ""); } + } +} diff --git a/IFC/IFC V.cs b/IFC/IFC V.cs new file mode 100644 index 0000000..ae79c1f --- /dev/null +++ b/IFC/IFC V.cs @@ -0,0 +1,639 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public interface IfcValue { string getKW { get; } object Value { get; } } //SELECT(IfcMeasureValue,IfcSimpleValue,IfcDerivedMeasureValue); stpentity parse method + public class IfcValve : IfcFlowController //IFC4 + { + internal IfcValveTypeEnum mPredefinedType = IfcValveTypeEnum.NOTDEFINED;// OPTIONAL : IfcValveTypeEnum; + public IfcValveTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcValve() : base() { } + internal IfcValve(IfcValve b) : base(b) { mPredefinedType = b.mPredefinedType; } + internal IfcValve(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + + internal static void parseFields(IfcValve s, List arrFields, ref int ipos) + { + IfcEnergyConversionDevice.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcValveTypeEnum)Enum.Parse(typeof(IfcValveTypeEnum), str); + } + internal new static IfcValve Parse(string strDef) { IfcValve s = new IfcValve(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() + { + return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcValveTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); + } + } + public class IfcValveType : IfcFlowControllerType + { + internal IfcValveTypeEnum mPredefinedType = IfcValveTypeEnum.NOTDEFINED;// : IfcValveTypeEnum; + public IfcValveTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcValveType() : base() { } + internal IfcValveType(IfcValveType t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcValveType(DatabaseIfc m, string name, IfcValveTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal static void parseFields(IfcValveType t, List arrFields, ref int ipos) { IfcFlowControllerType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcValveTypeEnum)Enum.Parse(typeof(IfcValveTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcValveType Parse(string strDef) { IfcValveType t = new IfcValveType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public partial class IfcVector : IfcGeometricRepresentationItem + { + internal int mOrientation; // : IfcDirection; + internal double mMagnitude;// : IfcLengthMeasure; + + internal IfcDirection Orientation { get { return mDatabase.mIfcObjects[mOrientation] as IfcDirection; } } + + internal IfcVector() : base() { } + internal IfcVector(IfcVector v) : base(v) { mOrientation = v.mOrientation; mMagnitude = v.mMagnitude; } + + internal static void parseFields(IfcVector v, List arrFields, ref int ipos) { IfcGeometricRepresentationItem.parseFields(v, arrFields, ref ipos); v.mOrientation = ParserSTEP.ParseLink(arrFields[ipos++]); v.mMagnitude = ParserSTEP.ParseDouble(arrFields[ipos++]); } + internal static IfcVector Parse(string strDef) { IfcVector v = new IfcVector(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos); return v; } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mOrientation) + "," + ParserSTEP.DoubleToString(mMagnitude); } + } + public partial class IfcVertex : IfcTopologicalRepresentationItem //SUPERTYPE OF(IfcVertexPoint) + { + internal IfcVertex() : base() { } + internal IfcVertex(IfcVertex v) : base(v) { } + internal IfcVertex(DatabaseIfc m) : base(m) { } + internal static IfcVertex Parse(string strDef) { IfcVertex v = new IfcVertex(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos); return v; } + internal static void parseFields(IfcVertex v, List arrFields, ref int ipos) { IfcTopologicalRepresentationItem.parseFields(v, arrFields, ref ipos); } + } + public class IfcVertexBasedTextureMap : BaseClassIfc // DEPRECEATED IFC4 + { + internal List mTextureVertices = new List();// LIST [3:?] OF IfcTextureVertex; + internal List mTexturePoints = new List();// LIST [3:?] OF IfcCartesianPoint; + internal IfcVertexBasedTextureMap() : base() { } + internal IfcVertexBasedTextureMap(IfcVertexBasedTextureMap m) : base() { mTextureVertices = new List(m.mTextureVertices.ToArray()); mTexturePoints = new List(m.mTexturePoints.ToArray()); } + internal static IfcVertexBasedTextureMap Parse(string strDef) { IfcVertexBasedTextureMap m = new IfcVertexBasedTextureMap(); int ipos = 0; parseFields(m, ParserSTEP.SplitLineFields(strDef), ref ipos); return m; } + internal static void parseFields(IfcVertexBasedTextureMap m, List arrFields, ref int ipos) { m.mTextureVertices = ParserSTEP.SplitListLinks(arrFields[ipos++]); m.mTexturePoints = ParserSTEP.SplitListLinks(arrFields[ipos++]); } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mTextureVertices[0]); + for (int icounter = 1; icounter < mTextureVertices.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mTextureVertices[icounter]); + str += "),(" + ParserSTEP.LinkToString(mTexturePoints[0]); + for (int icounter = 1; icounter < mTexturePoints.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mTexturePoints[icounter]); + return str; + } + } + public class IfcVertexloop : IfcLoop + { + internal int mLoopVertex;// : IfcVertex; + internal IfcVertexloop() : base() { } + internal IfcVertexloop(IfcVertexloop o) : base(o) { mLoopVertex = o.mLoopVertex; } + internal new static IfcVertexloop Parse(string strDef) { IfcVertexloop l = new IfcVertexloop(); int ipos = 0; parseFields(l, ParserSTEP.SplitLineFields(strDef), ref ipos); return l; } + internal static void parseFields(IfcVertexloop l, List arrFields, ref int ipos) { IfcLoop.parseFields(l, arrFields, ref ipos); l.mLoopVertex = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mLoopVertex); } + } + public partial class IfcVertexPoint : IfcVertex, IfcPointOrVertexPoint + { + internal int mVertexGeometry;// : IfcPoint; + internal IfcPoint VertexGeometry { get { return mDatabase.mIfcObjects[mVertexGeometry] as IfcPoint; } } + internal IfcVertexPoint() : base() { } + internal IfcVertexPoint(IfcVertexPoint v) : base(v) { mVertexGeometry = v.mVertexGeometry; } + public IfcVertexPoint(IfcPoint cp) : base(cp.mDatabase) { mVertexGeometry = cp.mIndex; } + internal new static IfcVertexPoint Parse(string strDef) { IfcVertexPoint v = new IfcVertexPoint(); int ipos = 0; parseFields(v, ParserSTEP.SplitLineFields(strDef), ref ipos); return v; } + internal static void parseFields(IfcVertexPoint v, List arrFields, ref int ipos) { IfcVertex.parseFields(v, arrFields, ref ipos); v.mVertexGeometry = ParserSTEP.ParseLink(arrFields[ipos++]); } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.LinkToString(mVertexGeometry); } + } + public partial class IfcVibrationIsolator : IfcElementComponent + { + internal IfcVibrationIsolatorTypeEnum mPredefinedType = IfcVibrationIsolatorTypeEnum.NOTDEFINED;// : OPTIONAL IfcVibrationIsolatorTypeEnum; + public IfcVibrationIsolatorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcVibrationIsolator() : base() { } + internal IfcVibrationIsolator(IfcVibrationIsolator a) : base(a) { mPredefinedType = a.mPredefinedType; } + public IfcVibrationIsolator(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcVibrationIsolator Parse(string strDef) { int ipos = 0; IfcVibrationIsolator a = new IfcVibrationIsolator(); parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; } + internal static void parseFields(IfcVibrationIsolator a, List arrFields, ref int ipos) + { + IfcElementComponent.parseFields(a, arrFields, ref ipos); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + a.mPredefinedType = (IfcVibrationIsolatorTypeEnum)Enum.Parse(typeof(IfcVibrationIsolatorTypeEnum), s.Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcVibrationIsolatorTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType + ".")); } + } + public class IfcVibrationIsolatorType : IfcElementComponentType + { + internal IfcVibrationIsolatorTypeEnum mPredefinedType = IfcVibrationIsolatorTypeEnum.NOTDEFINED;// : IfcVibrationIsolatorTypeEnum + public IfcVibrationIsolatorTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcVibrationIsolatorType() : base() { } + internal IfcVibrationIsolatorType(IfcVibrationIsolatorType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal static void parseFields(IfcVibrationIsolatorType t, List arrFields, ref int ipos) { IfcDiscreteAccessoryType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcVibrationIsolatorTypeEnum)Enum.Parse(typeof(IfcVibrationIsolatorTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcVibrationIsolatorType Parse(string strDef) { IfcVibrationIsolatorType t = new IfcVibrationIsolatorType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcVirtualElement : IfcElement + { + internal IfcVirtualElement() : base() { } + internal IfcVirtualElement(IfcVirtualElement el) : base(el) { } + internal static IfcProduct Parse(string strDef) { IfcVirtualElement e = new IfcVirtualElement(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos); return e; } + internal static void parseFields(IfcVirtualElement e, List arrFields, ref int ipos) { IfcElement.parseFields(e, arrFields, ref ipos); } + } + public partial class IfcVirtualGridIntersection : BaseClassIfc + { + internal List mIntersectingAxes = new List(2);// : LIST [2:2] OF UNIQUE IfcGridAxis; + internal Tuple mOffsetDistances = null;// : LIST [2:3] OF IfcLengthMeasure; + internal IfcVirtualGridIntersection() : base() { } + internal IfcVirtualGridIntersection(IfcVirtualGridIntersection p) : base() { mIntersectingAxes = new List(p.mIntersectingAxes.ToArray()); mOffsetDistances = p.mOffsetDistances; } + internal static IfcVirtualGridIntersection Parse(string strDef) { IfcVirtualGridIntersection i = new IfcVirtualGridIntersection(); int ipos = 0; parseFields(i, ParserSTEP.SplitLineFields(strDef), ref ipos); return i; } + internal static void parseFields(IfcVirtualGridIntersection i, List arrFields, ref int ipos) + { + i.mIntersectingAxes = ParserSTEP.SplitListLinks(arrFields[ipos++]); + List lst = ParserSTEP.SplitLineFields(arrFields[ipos++]); + i.mOffsetDistances = new Tuple(ParserSTEP.ParseDouble(lst[0]), ParserSTEP.ParseDouble(lst[1]),(lst.Count > 2 ? ParserSTEP.ParseDouble(lst[2]) : double.NaN)); + } + protected override string BuildString() + { + string str = base.BuildString() + ",(" + ParserSTEP.LinkToString(mIntersectingAxes[0]) + "," + + ParserSTEP.LinkToString(mIntersectingAxes[1]) + "),("; + str += ParserSTEP.DoubleToString(mOffsetDistances.Item1) + "," + ParserSTEP.DoubleToString(mOffsetDistances.Item2); + if (!double.IsNaN(mOffsetDistances.Item3)) + str += "," + ParserSTEP.DoubleToString(mOffsetDistances.Item3); + str += ")"; + return str; + } + } + public partial class IfcVoidingFeature : IfcFeatureElementSubtraction //IFC4 + { + internal IfcVoidingFeatureTypeEnum mPredefinedType = IfcVoidingFeatureTypeEnum.NOTDEFINED;// :IfcVoidingFeatureTypeEnum; + public IfcVoidingFeatureTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcVoidingFeature() : base() { } + internal IfcVoidingFeature(IfcVoidingFeature od) : base(od) { mPredefinedType = od.mPredefinedType; } + public IfcVoidingFeature(IfcElement host,IfcProductRepresentation rep,IfcVoidingFeatureTypeEnum type) : base(host,rep) { mPredefinedType = type; } + + internal static IfcVoidingFeature Parse(string strDef, Schema schema) { IfcVoidingFeature e = new IfcVoidingFeature(); int ipos = 0; parseFields(e, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return e; } + internal static void parseFields(IfcVoidingFeature e, List arrFields, ref int ipos, Schema schema) + { + IfcFeatureElementSubtraction.parseFields(e, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + e.mPredefinedType = (IfcVoidingFeatureTypeEnum)Enum.Parse(typeof(IfcVoidingFeatureTypeEnum), arrFields[ipos++].Replace(".", "")); + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType + "."); } + } + + public interface IfcDerivedMeasureValue : IfcValue { double Measure { get; } } //(IfcVolumetricFlowRateMeasure,IfcTimeStamp ,IfcThermalTransmittanceMeasure ,IfcThermalResistanceMeasure + //,IfcThermalAdmittanceMeasure ,IfcPressureMeasure ,IfcPowerMeasure ,IfcMassFlowRateMeasure ,IfcMassDensityMeasure ,IfcLinearVelocityMeasure + //,IfcKinematicViscosityMeasure ,IfcIntegerCountRateMeasure ,IfcHeatFluxDensityMeasure ,IfcFrequencyMeasure ,IfcEnergyMeasure ,IfcElectricVoltageMeasure + //,IfcDynamicViscosityMeasure ,IfcCompoundPlaneAngleMeasure ,IfcAngularVelocityMeasure ,IfcThermalConductivityMeasure ,IfcMolecularWeightMeasure + //,IfcVaporPermeabilityMeasure ,IfcMoistureDiffusivityMeasure ,IfcIsothermalMoistureCapacityMeasure ,IfcSpecificHeatCapacityMeasure ,IfcMonetaryMeasure + //,IfcMagneticFluxDensityMeasure ,IfcMagneticFluxMeasure ,IfcLuminousFluxMeasure ,IfcForceMeasure ,IfcInductanceMeasure ,IfcIlluminanceMeasure + //,IfcElectricResistanceMeasure ,IfcElectricConductanceMeasure ,IfcElectricChargeMeasure ,IfcDoseEquivalentMeasure ,IfcElectricCapacitanceMeasure + //,IfcAbsorbedDoseMeasure ,IfcRadioActivityMeasure ,IfcRotationalFrequencyMeasure ,IfcTorqueMeasure ,IfcAccelerationMeasure ,IfcLinearForceMeasure + //,IfcLinearStiffnessMeasure ,IfcModulusOfSubgradeReactionMeasure ,IfcModulusOfElasticityMeasure ,IfcMomentOfInertiaMeasure ,IfcPlanarForceMeasure + //,IfcRotationalStiffnessMeasure ,IfcShearModulusMeasure ,IfcLinearMomentMeasure ,IfcLuminousIntensityDistributionMeasure ,IfcCurvatureMeasure + //,IfcMassPerLengthMeasure ,IfcModulusOfLinearSubgradeReactionMeasure ,IfcModulusOfRotationalSubgradeReactionMeasure ,IfcRotationalMassMeasure + //,IfcSectionalAreaIntegralMeasure ,IfcSectionModulusMeasure ,IfcTemperatureGradientMeasure ,IfcThermalExpansionCoefficientMeasure ,IfcWarpingConstantMeasure + //,IfcWarpingMomentMeasure ,IfcSoundPowerMeasure ,IfcSoundPressureMeasure ,IfcHeatingValueMeasure,IfcPHMeasure,IfcIonConcentrationMeasure); + + public class IfcDynamicViscosityMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcDynamicViscosityMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCDYNAMICVISCOSITYMEASURE"; + } + public class IfcForceMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcForceMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCFORCEMEASURE"; + } + public class IfcLinearStiffnessMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcLinearStiffnessMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCLINEARSTIFFNESSMEASURE"; + } + public class IfcLinearVelocityMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcLinearVelocityMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCLINEARVELOCITYMEASURE"; + } + public class IfcMassDensityMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcMassDensityMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMASSDENSITYMEASURE"; + } + public struct IfcMassPerLengthMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcMassPerLengthMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMASSPERLENGTHMEASURE"; + } + public class IfcModulusOfElasticityMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcModulusOfElasticityMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMODULUSOFELASTICITYMEASURE"; + } + public struct IfcMolecularWeightMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcMolecularWeightMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMOLECULARWEIGHTMEASURE"; + } + public struct IfcMomentOfInertiaMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcMomentOfInertiaMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMOMOENTOFINERTIAMEASURE"; + } + public struct IfcMonetaryMeasure : IfcDerivedMeasureValue//, IfcAppliedValueSelect + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcMonetaryMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMONETARYMEASURE"; + } + public class IfcPressureMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + public IfcPressureMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCPRESSUREMEASURE"; + } + public class IfcRotationalStiffnessMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcRotationalStiffnessMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCROTATIONALSTIFFNESSMEASURE"; + } + public class IfcSectionModulusMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcSectionModulusMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCSECTIONMODULUSMEASURE"; + } + public class IfcThermalExpansionCoefficientMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcThermalExpansionCoefficientMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCTHERMALEXPANSIONCOEFFICIENTMEASURE"; + } + public class IfcThermalTransmittanceMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcThermalTransmittanceMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCTHERMALTRANSMITTANCEMEASURE"; + } + public class IfcVolumetricFlowRateMeasure : IfcDerivedMeasureValue// IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + public IfcVolumetricFlowRateMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCVOLUMETRICFLOWRATEMEASURE"; + } + public class IfcWarpingConstantMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcWarpingConstantMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCWARPINGCONSTANTMEASURE"; + } + public class IfcWarpingMomentMeasure : IfcDerivedMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcWarpingMomentMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCWARPINGMOMENTMEASURE"; + } + + public interface IfcMeasureValue : IfcValue { double Measure { get; } } //TYPE IfcMeasureValue = SELECT (IfcVolumeMeasure,IfcTimeMeasure ,IfcThermodynamicTemperatureMeasure ,IfcSolidAngleMeasure ,IfcPositiveRatioMeasure + //,IfcRatioMeasure ,IfcPositivePlaneAngleMeasure ,IfcPlaneAngleMeasure ,IfcParameterValue ,IfcNumericMeasure ,IfcMassMeasure ,IfcPositiveLengthMeasure,IfcLengthMeasure ,IfcElectricCurrentMeasure , + //IfcDescriptiveMeasure ,IfcCountMeasure ,IfcContextDependentMeasure ,IfcAreaMeasure ,IfcAmountOfSubstanceMeasure ,IfcLuminousIntensityMeasure ,IfcNormalisedRatioMeasure ,IfcComplexNumber); + public class IfcAreaMeasure : IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcAreaMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCAREAMEASURE"; + } + public class IfcCountMeasure : IfcMeasureValue + { + internal int mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcCountMeasure(int value) { mValue = value; } + public override string ToString() { return getKW + "(" + mValue + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCCOUNTMEASURE"; + } + public class IfcDescriptiveMeasure : IfcMeasureValue, IfcSizeSelect + { + internal string mValue; + public object Value { get { return mValue; } } + public double Measure { get { return 0; } } + internal IfcDescriptiveMeasure(string value) { mValue = value; } + public override string ToString() { return getKW + "(" + mValue + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCDESCRIPTIVEMEASURE"; + } + public class IfcLengthMeasure : IfcMeasureValue, IfcSizeSelect, IfcBendingParameterSelect + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcLengthMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCLENGTHMEASURE"; + } + public class IfcMassMeasure : IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcMassMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCMASSMEASURE"; + } + public class IfcNormalisedRatioMeasure : IfcMeasureValue, IfcColourOrFactor + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcNormalisedRatioMeasure(double value) { mValue = Math.Min(1, Math.Max(0, value)); } + internal IfcNormalisedRatioMeasure(System.Drawing.Color col) : this(System.Drawing.Color.FromArgb(0, col.R, col.G, col.B).ToArgb() / 16581375.0) { } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCNORMALISEDRATIOMEASURE"; + } + public class IfcPlaneAngleMeasure : IfcMeasureValue, IfcBendingParameterSelect + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcPlaneAngleMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCPLANEANGLEMEASURE"; + } + public class IfcPositiveLengthMeasure : IfcMeasureValue, IfcSizeSelect + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + public IfcPositiveLengthMeasure(double value) { mValue = value; } + internal IfcPositiveLengthMeasure(string str) + { + int icounter = 0; + for (; icounter < str.Length; icounter++) + { + Char c = str[icounter]; + if (char.IsDigit(c)) + break; + if (c == '.') + break; + } + if (!double.TryParse(str.Substring(icounter), out mValue)) + mValue = 0; + } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCPOSITIVELENGTHMEASURE"; + } + public class IfcPositiveRatioMeasure : IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcPositiveRatioMeasure(double value) { mValue = value; } + internal IfcPositiveRatioMeasure(string str) + { + int icounter = 0; + for (; icounter < str.Length; icounter++) + { + Char c = str[icounter]; + if (char.IsDigit(c)) + break; + if (c == '.') + break; + } + if (!double.TryParse(str.Substring(icounter), out mValue)) + mValue = 0; + } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCPOSITIVERATIOMEASURE"; + } + public class IfcRatioMeasure : IfcMeasureValue, IfcTimeOrRatioSelect//, IfcAppliedValueSelect + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcRatioMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string String { get { return ToString(); } } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCRATIOMEASURE"; + } + public class IfcThermodynamicTemperatureMeasure : IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcThermodynamicTemperatureMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCTHERMODYNAMICTEMPERATRUEMEASURE"; + } + public class IfcTimeMeasure : IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcTimeMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCTIMEMEASURE"; + } + public class IfcVolumeMeasure : IfcMeasureValue + { + internal double mValue; + public object Value { get { return mValue; } } + public double Measure { get { return mValue; } } + internal IfcVolumeMeasure(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return mKW; } } + internal static string mKW = "IFCVOLUMEMEASURE"; + } + + public interface IfcSimpleValue : IfcValue { }// = SELECT(IfcInteger,IfcReal,IfcBoolean,IfcIdentifier,IfcText,IfcLabel,IfcLogical); + public class IfcBoolean : IfcSimpleValue + { + internal bool mValue; + public object Value { get { return mValue; } } + public IfcBoolean(bool value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.BoolToString(mValue) + ")"; } + public string getKW { get { return "IFCBOOLEAN"; } } + } + public class IfcIdentifier : IfcSimpleValue + { + internal string mValue; + public object Value { get { return mValue; } } + internal IfcIdentifier(string value) { mValue = value.Replace("'", ""); } + public override string ToString() { return getKW + "('" + mValue + "')"; } + public string getKW { get { return "IFCIDENTIFIER"; } } + } + public class IfcInteger : IfcSimpleValue + { + internal int mValue; + public object Value { get { return mValue; } } + internal IfcInteger(int value) { mValue = value; } + public override string ToString() { return getKW + "(" + mValue.ToString() + ")"; } + public string getKW { get { return "IFCINTEGER"; } } + } + public class IfcLabel : IfcSimpleValue + { + internal string mValue; + public object Value { get { return ParserIfc.Decode(mValue); } } + public IfcLabel(string value) { mValue = string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", "")); } + public override string ToString() { return getKW + "('" + mValue + "')"; } + public string getKW { get { return "IFCLABEL"; } } + } + public class IfcLogical : IfcSimpleValue + { + internal IfcLogicalEnum mValue; + public object Value { get { return mValue.ToString(); } } + internal IfcLogical(IfcLogicalEnum value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserIfc.LogicalToString(mValue) + ")"; } + public string getKW { get { return "IFCLOGICAL"; } } + } + public class IfcReal : IfcSimpleValue + { + internal double mValue; + public object Value { get { return mValue; } } + internal IfcReal(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return "IFCREAL"; } } + } + public class IfcSpecularExponent : IfcSimpleValue, IfcSpecularHighlightSelect + { + internal double mValue; + public object Value { get { return mValue; } } + internal IfcSpecularExponent(double value) { mValue = value; } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return "IFCSPECULAREXPONENT"; } } + } + public class IfcSpecularRoughness : IfcSimpleValue, IfcSpecularHighlightSelect + { + internal double mValue; + public object Value { get { return mValue; } } + internal IfcSpecularRoughness(double value) { mValue = Math.Min(1, Math.Max(0, value)); } + public override string ToString() { return getKW + "(" + ParserSTEP.DoubleToString(mValue) + ")"; } + public string getKW { get { return "IFCSPECULARROUGHNESS"; } } + } + public class IfcText : IfcSimpleValue + { + internal string mValue; + public object Value { get { return ParserIfc.Decode(mValue); } } + internal IfcText(string value) { mValue = string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", "")); } + public override string ToString() { return getKW + "('" + mValue + "')"; } + public string getKW { get { return "IFCTEXT"; } } + } + + public interface IfcSizeSelect { } //TYPE IfcSizeSelect = SELECT (IfcRatioMeasure ,IfcLengthMeasure ,IfcDescriptiveMeasure ,IfcPositiveLengthMeasure ,IfcNormalisedRatioMeasure ,IfcPositiveRatioMeasure); +} diff --git a/IFC/IFC W.cs b/IFC/IFC W.cs new file mode 100644 index 0000000..e5e21c1 --- /dev/null +++ b/IFC/IFC W.cs @@ -0,0 +1,552 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public partial class IfcWall : IfcBuildingElement + { + internal IfcWallTypeEnum mPredefinedType = IfcWallTypeEnum.NOTDEFINED;//: OPTIONAL IfcWallTypeEnum; + public IfcWallTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcWall() : base() { } + internal IfcWall(IfcWall w) : base(w) { mPredefinedType = w.mPredefinedType; } + public IfcWall(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcWall Parse(string strDef, Schema schema) { IfcWall w = new IfcWall(); int ipos = 0; parseFields(w, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return w; } + internal static void parseFields(IfcWall w, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(w, arrFields, ref ipos); + if (schema != Schema.IFC2x3) + { + string str = arrFields[ipos++]; + if (str[0] == '.') + { + try + { + w.mPredefinedType = (IfcWallTypeEnum)Enum.Parse(typeof(IfcWallTypeEnum), str.Substring(1, str.Length - 2)); + } + catch (Exception) { } + } + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcWallTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public partial class IfcWallStandardCase : IfcWall + { + internal IfcWallStandardCase() : base() { } + internal IfcWallStandardCase(IfcWallStandardCase w) : base(w) { } + + internal new static IfcWallStandardCase Parse(string strDef, Schema schema) { IfcWallStandardCase w = new IfcWallStandardCase(); int ipos = 0; parseFields(w, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return w; } + internal static void parseFields(IfcWallStandardCase w, List arrFields, ref int ipos, Schema schema) { IfcWall.parseFields(w, arrFields, ref ipos,schema); } + } + public partial class IfcWallType : IfcBuildingElementType + { + internal IfcWallTypeEnum mPredefinedType = IfcWallTypeEnum.NOTDEFINED; + public IfcWallTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcWallType() : base() { } + internal IfcWallType(IfcWallType t) : base(t) { mPredefinedType = t.mPredefinedType; } + public IfcWallType(DatabaseIfc m, string name, IfcWallTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + public IfcWallType(string name, IfcMaterialLayerSet ls, IfcWallTypeEnum type) : base(ls.mDatabase) { Name = name; mPredefinedType = type; MaterialSelect = ls; } + internal static void parseFields(IfcWallType t, List arrFields, ref int ipos) + { + IfcBuildingElementType.parseFields(t, arrFields, ref ipos); + try + { + string str = arrFields[ipos++].Replace(".", ""); + if (string.Compare(str, "STANDARD", true) != 0) + t.mPredefinedType = (IfcWallTypeEnum)Enum.Parse(typeof(IfcWallTypeEnum), str); + } + catch (Exception) { } + } + internal new static IfcWallType Parse(string strDef) { IfcWallType t = new IfcWallType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcWarpingStiffnessSelect + { + internal bool mFixed; + internal double mStiffness; + internal IfcWarpingStiffnessSelect(bool fix) { mFixed = fix; mStiffness = 0; } + internal IfcWarpingStiffnessSelect(double stiff) { mFixed = false; mStiffness = stiff; } + internal static IfcWarpingStiffnessSelect Parse(string str) { if (str.StartsWith(".")) return new IfcWarpingStiffnessSelect(ParserSTEP.ParseBool(str)); return new IfcWarpingStiffnessSelect(ParserSTEP.ParseDouble(str)); } + public override string ToString() { return (mFixed ? ParserSTEP.BoolToString(mFixed) : ParserSTEP.DoubleToString(mStiffness)); } + } + public class IfcWasteTerminal : IfcFlowTerminal //IFC4 + { + internal IfcWasteTerminalTypeEnum mPredefinedType = IfcWasteTerminalTypeEnum.NOTDEFINED;// OPTIONAL : IfcWasteTerminalTypeEnum; + public IfcWasteTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcWasteTerminal() : base() { } + internal IfcWasteTerminal(IfcWasteTerminal t) : base(t) { mPredefinedType = t.mPredefinedType; } + internal IfcWasteTerminal(IfcProduct host, IfcObjectPlacement placement, IfcProductRepresentation representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } + internal static void parseFields(IfcWasteTerminal s, List arrFields, ref int ipos) + { + IfcFlowTerminal.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str[0] == '.') + s.mPredefinedType = (IfcWasteTerminalTypeEnum)Enum.Parse(typeof(IfcWasteTerminalTypeEnum), str.Substring(1, str.Length - 2)); + } + internal new static IfcWasteTerminal Parse(string strDef) { IfcWasteTerminal s = new IfcWasteTerminal(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mPredefinedType == IfcWasteTerminalTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } + } + public class IfcWasteTerminalType : IfcFlowTerminalType + { + internal IfcWasteTerminalTypeEnum mPredefinedType = IfcWasteTerminalTypeEnum.NOTDEFINED;// : IfcWasteTerminalTypeEnum; + public IfcWasteTerminalTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcWasteTerminalType() : base() { } + internal IfcWasteTerminalType(IfcWasteTerminalType be) : base(be) { mPredefinedType = be.mPredefinedType; } + internal IfcWasteTerminalType(DatabaseIfc m, string name, IfcWasteTerminalTypeEnum t) : base(m) { Name = name; mPredefinedType = t; } + internal static void parseFields(IfcWasteTerminalType t, List arrFields, ref int ipos) { IfcFlowTerminalType.parseFields(t, arrFields, ref ipos); t.mPredefinedType = (IfcWasteTerminalTypeEnum)Enum.Parse(typeof(IfcWasteTerminalTypeEnum), arrFields[ipos++].Replace(".", "")); } + internal new static IfcWasteTerminalType Parse(string strDef) { IfcWasteTerminalType t = new IfcWasteTerminalType(); int ipos = 0; parseFields(t, ParserSTEP.SplitLineFields(strDef), ref ipos); return t; } + protected override string BuildString() { return base.BuildString() + ",." + mPredefinedType.ToString() + "."; } + } + public class IfcWaterProperties : IfcMaterialPropertiesSuperSeded // DEPRECEATED IFC4 + { + internal double mIsPotable;// : OPTIONAL IfcDynamicViscosityMeasure; + internal double mHardness;// : OPTIONAL IfcModulusOfElasticityMeasure; + internal double mAlkalinityConcentration;// : OPTIONAL IfcModulusOfElasticityMeasure; + internal double mPoissonRatio;// : OPTIONAL IfcPositiveRatioMeasure; + internal double mThermalExpansionCoefficient;// : OPTIONAL IfcThermalExpansionCoefficientMeasure; + internal IfcWaterProperties() : base() { } + internal IfcWaterProperties(IfcWaterProperties be) + : base(be) + { + mIsPotable = be.mIsPotable; + mHardness = be.mHardness; + mAlkalinityConcentration = be.mAlkalinityConcentration; + mPoissonRatio = be.mPoissonRatio; + mThermalExpansionCoefficient = be.mThermalExpansionCoefficient; + } + internal static IfcWaterProperties Parse(string strDef) { IfcWaterProperties p = new IfcWaterProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcWaterProperties p, List arrFields, ref int ipos) + { + IfcMaterialPropertiesSuperSeded.parseFields(p, arrFields, ref ipos); + p.mIsPotable = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mHardness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mAlkalinityConcentration = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mPoissonRatio = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mThermalExpansionCoefficient = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mIsPotable) + "," + ParserSTEP.DoubleOptionalToString(mHardness) + "," + ParserSTEP.DoubleOptionalToString(mAlkalinityConcentration) + "," + ParserSTEP.DoubleOptionalToString(mPoissonRatio) + "," + ParserSTEP.DoubleOptionalToString(mThermalExpansionCoefficient); } + } + public partial class IfcWindow : IfcBuildingElement + { + internal double mOverallHeight;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mOverallWidth;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcWindowTypeEnum mPredefinedType = IfcWindowTypeEnum.NOTDEFINED;// : OPTIONAL IfcWindowTypeEnum; + internal IfcWindowTypePartitioningEnum mPartitioningType = IfcWindowTypePartitioningEnum.NOTDEFINED;// : OPTIONAL IfcWindowTypePartitioningEnum; + internal string mUserDefinedPartitioningType = "$";//: OPTIONAL IfcLabel; + + public IfcWindowTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + + internal IfcWindow() : base() { } + internal IfcWindow(IfcWindow o) : base(o) { mOverallHeight = o.mOverallHeight; mOverallWidth = o.mOverallWidth; mPredefinedType = o.mPredefinedType; mPartitioningType = o.mPartitioningType; mUserDefinedPartitioningType = o.mUserDefinedPartitioningType; } + public IfcWindow(IfcProduct host, IfcObjectPlacement p, IfcProductRepresentation r) : base(host, p, r) { } + + internal static IfcWindow Parse(string strDef, Schema schema) { IfcWindow w = new IfcWindow(); int ipos = 0; parseFields(w, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return w; } + internal static void parseFields(IfcWindow w, List arrFields, ref int ipos, Schema schema) + { + IfcBuildingElement.parseFields(w, arrFields, ref ipos); + w.mOverallHeight = ParserSTEP.ParseDouble(arrFields[ipos++]); + w.mOverallWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + w.mPredefinedType = (IfcWindowTypeEnum)Enum.Parse(typeof(IfcWindowTypeEnum), s.Replace(".", "")); + s = arrFields[ipos++]; + if (s.StartsWith(".")) + w.mPredefinedType = (IfcWindowTypeEnum)Enum.Parse(typeof(IfcWindowTypeEnum), s.Replace(".", "")); + w.mUserDefinedPartitioningType = arrFields[ipos++]; + } + } + protected override string BuildString() { return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mOverallHeight) + "," + ParserSTEP.DoubleOptionalToString(mOverallWidth) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType + ".,." + mPartitioningType + (mUserDefinedPartitioningType == "$" ? ".,$" : ".,'" + mUserDefinedPartitioningType + "'")); } + + } + public class IfcWindowLiningProperties : IfcPreDefinedPropertySet //IFC2x3 : IfcPropertySetDefinition + { + internal double mLiningDepth;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mLiningThickness; //: OPTIONAL IfcNonNegativeLengthMeasure + internal double mTransomThickness, mMullionThickness;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mFirstTransomOffset, mSecondTransomOffset, mFirstMullionOffset, mSecondMullionOffset;// : OPTIONAL IfcNormalisedRatioMeasure; + private int mShapeAspectStyle;// : OPTIONAL IfcShapeAspect; IFC4 Depreceated + internal double mLiningOffset, mLiningToPanelOffsetX, mLiningToPanelOffsetY;// : OPTIONAL IfcLengthMeasure; + internal IfcWindowLiningProperties() : base() { } + internal IfcWindowLiningProperties(IfcWindowLiningProperties p) + : base(p) + { + mLiningDepth = p.mLiningDepth; + mLiningThickness = p.mLiningThickness; + mTransomThickness = p.mTransomThickness; + mMullionThickness = p.mMullionThickness; + mFirstTransomOffset = p.mFirstTransomOffset; + mSecondTransomOffset = p.mSecondTransomOffset; + mFirstMullionOffset = p.mFirstMullionOffset; + mSecondMullionOffset = p.mSecondMullionOffset; + mShapeAspectStyle = p.mShapeAspectStyle; + mLiningOffset = p.mLiningOffset; + mLiningToPanelOffsetX = p.mLiningToPanelOffsetX; + mLiningToPanelOffsetY = p.mLiningToPanelOffsetY; + } + internal IfcWindowLiningProperties(DatabaseIfc m, string name, double lngDpth, double lngThck, double trnsmThck, double mllnThck, + double trnsmOffst1, double trnsmOffst2, double mllnOffst1, double mllnOffst2, double lngOffset, double lngToPnlOffstX, double lngToPnlOffstY) + : base(m, name) + { + mLiningDepth = lngDpth; + mLiningThickness = lngThck; + mTransomThickness = trnsmThck; + mMullionThickness = mllnThck; + mFirstTransomOffset = Math.Min(1, Math.Max(0, trnsmOffst1)); + mSecondTransomOffset = Math.Min(1, Math.Max(0, trnsmOffst2)); + mFirstMullionOffset = Math.Min(1, Math.Max(0, mllnOffst1)); + mSecondMullionOffset = Math.Min(1, Math.Max(0, mllnOffst2)); + mLiningOffset = lngOffset; + mLiningToPanelOffsetX = lngToPnlOffstX; + mLiningToPanelOffsetY = lngToPnlOffstY; + } + internal static IfcWindowLiningProperties Parse(string strDef, Schema schema) { IfcWindowLiningProperties p = new IfcWindowLiningProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos, schema); return p; } + internal static void parseFields(IfcWindowLiningProperties p, List arrFields, ref int ipos, Schema schema) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mLiningDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLiningThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mTransomThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mMullionThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFirstTransomOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mSecondTransomOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFirstMullionOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mSecondMullionOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mShapeAspectStyle = ParserSTEP.ParseLink(arrFields[ipos++]); + if (schema != Schema.IFC2x3) + { + p.mLiningOffset = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLiningToPanelOffsetX = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mLiningToPanelOffsetY = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + } + protected override string BuildString() + { + return base.BuildString() + "," + ParserSTEP.DoubleOptionalToString(mLiningDepth) + "," + ParserSTEP.DoubleOptionalToString(mLiningThickness) + "," + ParserSTEP.DoubleOptionalToString(mTransomThickness) + "," + ParserSTEP.DoubleOptionalToString(mMullionThickness) + + "," + ParserSTEP.DoubleOptionalToString(mFirstTransomOffset) + "," + ParserSTEP.DoubleOptionalToString(mSecondTransomOffset) + "," + ParserSTEP.DoubleOptionalToString(mFirstMullionOffset) + "," + ParserSTEP.DoubleOptionalToString(mSecondMullionOffset) + "," + + ParserSTEP.LinkToString(mShapeAspectStyle) + (mDatabase.mSchema == Schema.IFC2x3 ? "" : "," + ParserSTEP.DoubleOptionalToString(mLiningOffset) + "," + ParserSTEP.DoubleOptionalToString(mLiningToPanelOffsetX) + "," + ParserSTEP.DoubleOptionalToString(mLiningToPanelOffsetY)); + } + } + public class IfcWindowPanelProperties : IfcPreDefinedPropertySet //IFC2x3: IfcPropertySetDefinition + { + internal IfcWindowPanelOperationEnum mOperationType;// : IfcWindowPanelOperationEnum; + internal IfcWindowPanelPositionEnum mPanelPosition;// :IfcWindowPanelPositionEnume; + internal double mFrameDepth;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mFrameThickness;// : OPTIONAL IfcPositiveLengthMeasure; + private int mShapeAspectStyle;// : OPTIONAL IfcShapeAspect; IFC4 Depreceated + internal IfcWindowPanelProperties() : base() { } + internal IfcWindowPanelProperties(IfcWindowPanelProperties p) + : base(p) + { + mOperationType = p.mOperationType; + mPanelPosition = p.mPanelPosition; + mFrameDepth = p.mFrameDepth; + mFrameThickness = p.mFrameThickness; + mShapeAspectStyle = p.mShapeAspectStyle; + } + internal IfcWindowPanelProperties(DatabaseIfc m, string name, IfcWindowPanelOperationEnum op, IfcWindowPanelPositionEnum panel, double frameDepth, double frameThick) + : base(m, name) + { + mOperationType = op; + mPanelPosition = panel; + mFrameDepth = frameDepth; + mFrameThickness = frameThick; + } + internal static IfcWindowPanelProperties Parse(string strDef) { IfcWindowPanelProperties p = new IfcWindowPanelProperties(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcWindowPanelProperties p, List arrFields, ref int ipos) + { + IfcPropertySetDefinition.parseFields(p, arrFields, ref ipos); + p.mOperationType = (IfcWindowPanelOperationEnum)Enum.Parse(typeof(IfcWindowPanelOperationEnum), arrFields[ipos++].Replace(".", "")); + p.mPanelPosition = (IfcWindowPanelPositionEnum)Enum.Parse(typeof(IfcWindowPanelPositionEnum), arrFields[ipos++].Replace(".", "")); + p.mFrameDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFrameThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mShapeAspectStyle = ParserSTEP.ParseLink(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",." + mOperationType.ToString() + ".,." + mPanelPosition.ToString() + ".," + ParserSTEP.DoubleOptionalToString(mFrameDepth) + "," + ParserSTEP.DoubleOptionalToString(mFrameThickness) + "," + ParserSTEP.LinkToString(mShapeAspectStyle); } + } + public class IfcWindowStandardCase : IfcWindow + { + internal IfcWindowStandardCase() : base() { } + internal IfcWindowStandardCase(IfcWindowStandardCase o) : base(o) { } + internal static IfcWindowStandardCase Parse(string strDef) { IfcWindowStandardCase s = new IfcWindowStandardCase(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcWindowStandardCase s, List arrFields, ref int ipos) { IfcWindow.parseFields(s, arrFields, ref ipos); } + } + public partial class IfcWindowStyle : IfcTypeProduct // IFC2x3 + { + internal IfcWindowStyleConstructionEnum mConstructionType;// : IfcWindowStyleConstructionEnum; + internal IfcWindowStyleOperationEnum mOperationType;// : IfcWindowStyleOperationEnum; + internal bool mParameterTakesPrecedence;// : BOOLEAN; + internal bool mSizeable;// : BOOLEAN; + internal IfcWindowStyle() : base() { } + internal IfcWindowStyle(IfcWindowStyle el) : base(el) { mConstructionType = el.mConstructionType; mOperationType = el.mOperationType; mParameterTakesPrecedence = el.mParameterTakesPrecedence; mSizeable = el.mSizeable; } + internal new static IfcWindowStyle Parse(string strDef) { IfcWindowStyle s = new IfcWindowStyle(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcWindowStyle s, List arrFields, ref int ipos) + { + IfcTypeProduct.parseFields(s, arrFields, ref ipos); + string str = arrFields[ipos++]; + if (str != "$") + s.mConstructionType = (IfcWindowStyleConstructionEnum)Enum.Parse(typeof(IfcWindowStyleConstructionEnum), str.Replace(".", "")); + str = arrFields[ipos++]; + if (str != "$") + s.mOperationType = (IfcWindowStyleOperationEnum)Enum.Parse(typeof(IfcWindowStyleOperationEnum), str.Replace(".", "")); + s.mParameterTakesPrecedence = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mSizeable = ParserSTEP.ParseBool(arrFields[ipos++]); + } + protected override string BuildString() { return base.BuildString() + ",." + mConstructionType.ToString() + ".,." + mOperationType.ToString() + ".," + ParserSTEP.BoolToString(mParameterTakesPrecedence) + "," + ParserSTEP.BoolToString(mSizeable); } + } + public partial class IfcWindowType : IfcBuildingElementType //IFCWindowStyle IFC2x3 + { + public override string KeyWord { get { return (mDatabase.mSchema == Schema.IFC2x3 ? "IFCWINDOWSTYLE" : base.KeyWord); } } + internal IfcWindowTypeEnum mPredefinedType = IfcWindowTypeEnum.NOTDEFINED; + internal IfcWindowTypePartitioningEnum mPartitioningType = IfcWindowTypePartitioningEnum.NOTDEFINED;// : IfcWindowTypePartitioningEnum; + internal bool mParameterTakesPrecedence;// : BOOLEAN; + internal string mUserDefinedPartitioningType = "$"; // : OPTIONAL IfcLabel; + public IfcWindowTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = value; } } + internal IfcWindowType() : base() { } + internal IfcWindowType(IfcWindowType t) : base(t) { mPredefinedType = t.mPredefinedType; mPartitioningType = t.mPartitioningType; mParameterTakesPrecedence = t.mParameterTakesPrecedence; mUserDefinedPartitioningType = t.mUserDefinedPartitioningType; } + public IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type) : base(m) { Name = name; mPredefinedType = type; } + internal IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type, IfcWindowTypePartitioningEnum partition, bool parameterTakesPrecendence) + : base(m) { Name = name; mPredefinedType = type; mPartitioningType = partition; mParameterTakesPrecedence = parameterTakesPrecendence; } + internal IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type, IfcWindowTypePartitioningEnum partition, string userDefinedPartionType, IfcWindowLiningProperties wlp, List pps) + : base(m) + { + Name = name; + mPredefinedType = type; + mPartitioningType = partition; + mParameterTakesPrecedence = true; + if (wlp != null) + mHasPropertySets.Add(wlp.mIndex); + if (pps != null && pps.Count > 0) + mHasPropertySets.AddRange(pps.ConvertAll(x => x.mIndex)); + if (!string.IsNullOrEmpty(userDefinedPartionType)) + mUserDefinedPartitioningType = userDefinedPartionType.Replace("'", ""); + } + + internal new static IfcWindowType Parse(string strDef) { IfcWindowType s = new IfcWindowType(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos); return s; } + internal static void parseFields(IfcWindowType s, List arrFields, ref int ipos) + { + IfcTypeProduct.parseFields(s, arrFields, ref ipos); + s.mPredefinedType = (IfcWindowTypeEnum)Enum.Parse(typeof(IfcWindowTypeEnum), arrFields[ipos++].Replace(".", "")); + s.mPartitioningType = (IfcWindowTypePartitioningEnum)Enum.Parse(typeof(IfcWindowTypePartitioningEnum), arrFields[ipos++].Replace(".", "")); + s.mParameterTakesPrecedence = ParserSTEP.ParseBool(arrFields[ipos++]); + s.mUserDefinedPartitioningType = arrFields[ipos++]; + } + protected override string BuildString() + { + return (mDatabase.mSchema == Schema.IFC2x3 ? base.BuildString() + ",.NOTDEFINED.,.NOTDEFINED.," + ParserSTEP.BoolToString(mParameterTakesPrecedence) + "," + ParserSTEP.BoolToString(false) : + base.BuildString() + ",." + mPredefinedType.ToString() + ".,." + mPartitioningType.ToString() + ".," + ParserSTEP.BoolToString(mParameterTakesPrecedence) + (mUserDefinedPartitioningType == "$" ? ",$" : ",'" + mUserDefinedPartitioningType + "'")); + } + } + public class IfcWorkCalendar : IfcControl //IFC4 + { + internal List mWorkingTimes = new List();// : OPTIONAL SET [1:?] OF IfcWorkTime; + internal List mExceptionTimes = new List();// : OPTIONAL SET [1:?] OF IfcWorkTime; + internal IfcWorkCalendarTypeEnum mPredefinedType = IfcWorkCalendarTypeEnum.NOTDEFINED;// : OPTIONAL IfcWorkCalendarTypeEnum + internal IfcWorkCalendar() : base() { } + internal IfcWorkCalendar(IfcWorkCalendar i) : base(i) { mWorkingTimes.AddRange(i.mWorkingTimes); mExceptionTimes.AddRange(i.mExceptionTimes); mPredefinedType = i.mPredefinedType; } + internal IfcWorkCalendar(DatabaseIfc m, List working, List exception, IfcWorkCalendarTypeEnum type, IfcProject prj) + : base(m) + { + if (working != null) + mWorkingTimes = working.ConvertAll(x => x.mIndex); + if (exception != null) + mExceptionTimes = exception.ConvertAll(x => x.mIndex); + mPredefinedType = type; + if (prj != null) + prj.AddDeclared(this); + } + internal static IfcWorkCalendar Parse(string strDef) { IfcWorkCalendar p = new IfcWorkCalendar(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcWorkCalendar c, List arrFields, ref int ipos) + { + IfcControl.parseFields(c, arrFields, ref ipos); + c.mWorkingTimes = ParserSTEP.SplitListLinks(arrFields[ipos++]); + c.mExceptionTimes = ParserSTEP.SplitListLinks(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + c.mPredefinedType = (IfcWorkCalendarTypeEnum)Enum.Parse(typeof(IfcWorkCalendarTypeEnum), s.Replace(".", "")); + } + protected override string BuildString() + { + string str = ""; + if (mWorkingTimes.Count > 0) + { + str += ",(" + ParserSTEP.LinkToString(mWorkingTimes[0]); + for (int icounter = 1; icounter < mWorkingTimes.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mWorkingTimes[icounter]); + str += "),"; + } + else + str += ",$,"; + if (mExceptionTimes.Count > 0) + { + str += "(" + ParserSTEP.LinkToString(mExceptionTimes[0]); + for (int icounter = 1; icounter < mExceptionTimes.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mExceptionTimes[icounter]); + str += "),."; + } + else + str += "$,."; + return base.BuildString() + str + mPredefinedType.ToString() + "."; + } + } + public abstract partial class IfcWorkControl : IfcControl //ABSTRACT SUPERTYPE OF(ONEOF(IfcWorkPlan, IfcWorkSchedule)) + { + //internal string mIdentifier : IfcIdentifier; IFC4 moved to control + internal string mCreationDate;// : IfcDateTime; + internal List mCreators = new List();// : OPTIONAL SET [1:?] OF IfcPerson; + internal string mPurpose = "$";// : OPTIONAL IfcLabel; + internal string mDuration = "$", mTotalFloat = "$";// : OPTIONAL IfcDuration; IFC4 + internal string mStartTime;// : IfcDateTime; + internal string mFinishTime = "$";// : OPTIONAL IfcDateTime; IFC4 + internal double mSSDuration = 0, mSSTotalFloat = 0; //: OPTIONAL IfcTimeMeasure; + internal int mSSCreationDate, mSSStartTime; //: IfcDateTimeSelect; + internal int mSSFinishTime; //: OPTIONAL IfcDateTimeSelect; + internal IfcWorkControlTypeEnum mWorkControlType = IfcWorkControlTypeEnum.NOTDEFINED;// : OPTIONAL IfcWorkControlTypeEnum; IFC2x3 + internal string mUserDefinedControlType = "$";// : OPTIONAL IfcLabel; + + public string Purpose { get { return (mPurpose == "$" ? "" : ParserIfc.Decode(mPurpose)); } set { mPurpose = (string.IsNullOrEmpty(value) ? "$" : ParserIfc.Encode(value.Replace("'", ""))); } } + + + protected IfcWorkControl() : base() { } + protected IfcWorkControl(IfcWorkControl i) + : base(i) + { + mCreationDate = i.mCreationDate; + mCreators.AddRange(i.mCreators); + mDuration = i.mDuration; + mTotalFloat = i.mTotalFloat; + mStartTime = i.mStartTime; + mFinishTime = i.mFinishTime; + } + + protected static void parseFields(IfcWorkControl c, List arrFields, ref int ipos, Schema schema) + { + IfcControl.parseFields(c, arrFields, ref ipos,schema); + if (schema == Schema.IFC2x3) + { + c.mIdentification = arrFields[ipos++].Replace("'", ""); + c.mSSCreationDate = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mCreators = ParserSTEP.SplitListLinks(arrFields[ipos++]); + c.mPurpose = arrFields[ipos++]; + c.mSSDuration = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mSSTotalFloat = ParserSTEP.ParseDouble(arrFields[ipos++]); + c.mSSStartTime = ParserSTEP.ParseLink(arrFields[ipos++]); + c.mSSFinishTime = ParserSTEP.ParseLink(arrFields[ipos++]); + string s = arrFields[ipos++]; + if (s[0] == '.') + c.mWorkControlType = (IfcWorkControlTypeEnum)Enum.Parse(typeof(IfcWorkControlTypeEnum), s.Replace(".", "")); + c.mUserDefinedControlType = arrFields[ipos++]; + } + else + { + c.mCreationDate = arrFields[ipos++].Replace("'", ""); + c.mCreators = ParserSTEP.SplitListLinks(arrFields[ipos++]); + c.mPurpose = arrFields[ipos++]; + c.mDuration = arrFields[ipos++]; + c.mTotalFloat = arrFields[ipos++]; + c.mStartTime = arrFields[ipos++].Replace("'", ""); + c.mFinishTime = arrFields[ipos++].Replace("'", ""); + } + } + protected override string BuildString() + { + string str = base.BuildString() + "," + (mDatabase.mSchema == Schema.IFC2x3 ? "'" + mIdentification + "'," + ParserSTEP.LinkToString(mSSCreationDate) : (mCreationDate == "$" ? "$" : "'" + mCreationDate + "'")); + if (mCreators.Count > 0) + { + str += ",(" + ParserSTEP.LinkToString(mCreators[0]); + for (int icounter = 1; icounter < mCreators.Count; icounter++) + str += "," + ParserSTEP.LinkToString(mCreators[icounter]); + str += "),"; + } + else + str += ",$,"; + if (mDatabase.mSchema == Schema.IFC2x3) + return str + (mPurpose == "$" ? "$," : "'" + mPurpose + "',") + ParserSTEP.DoubleOptionalToString(mSSDuration) + "," + ParserSTEP.DoubleOptionalToString(mSSTotalFloat) + "," + + ParserSTEP.LinkToString(mSSStartTime) + "," + ParserSTEP.LinkToString(mSSFinishTime) + ",." + mWorkControlType.ToString() + (mUserDefinedControlType == "$" ? ".,$" : ".,'" + mUserDefinedControlType + "'"); + return str + (mPurpose == "$" ? "$," : "'" + mPurpose + "',") + mDuration + "," + mTotalFloat + (mStartTime == "$" ? ",$," : ",'" + mStartTime + "',") + (mFinishTime == "$" ? "$" : "'" + mFinishTime + "'"); + } + internal DateTime getStart() { return (mDatabase.mSchema == Schema.IFC2x3 ? (mDatabase.mIfcObjects[mSSStartTime] as IfcDateTimeSelect).DateTime : DateTime.MinValue); } + + } + public partial class IfcWorkPlan : IfcWorkControl + { + internal IfcWorkPlanTypeEnum mPredefinedType = IfcWorkPlanTypeEnum.NOTDEFINED;// : OPTIONAL IfcWorkPlanTypeEnum; IFC4 + internal IfcWorkPlan() : base() { } + internal IfcWorkPlan(IfcWorkPlan p) : base(p) { mPredefinedType = p.mPredefinedType; } + internal static IfcWorkPlan Parse(string strDef) { IfcWorkPlan p = new IfcWorkPlan(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcWorkPlan p, List arrFields, ref int ipos, Schema schema) + { + IfcWorkControl.parseFields(p, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string s = arrFields[ipos++]; + if (s.StartsWith(".")) + p.mPredefinedType = (IfcWorkPlanTypeEnum)Enum.Parse(typeof(IfcWorkPlanTypeEnum), s.Replace(".", "")); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType.ToString() + "."); } + } + public partial class IfcWorkSchedule : IfcWorkControl + { + internal IfcWorkScheduleTypeEnum mPredefinedType = IfcWorkScheduleTypeEnum.NOTDEFINED;// : OPTIONAL IfcWorkScheduleTypeEnum; IFC4 + internal IfcWorkSchedule() : base() { } + internal IfcWorkSchedule(IfcWorkSchedule p) : base(p) { mPredefinedType = p.mPredefinedType; } + internal static IfcWorkSchedule Parse(string strDef, Schema schema) { IfcWorkSchedule s = new IfcWorkSchedule(); int ipos = 0; parseFields(s, ParserSTEP.SplitLineFields(strDef), ref ipos,schema); return s; } + internal static void parseFields(IfcWorkSchedule s, List arrFields, ref int ipos, Schema schema) + { + IfcWorkControl.parseFields(s, arrFields, ref ipos,schema); + if (schema != Schema.IFC2x3) + { + string st = arrFields[ipos++]; + if (st.StartsWith(".")) + s.mPredefinedType = (IfcWorkScheduleTypeEnum)Enum.Parse(typeof(IfcWorkScheduleTypeEnum), st.Replace(".", "")); + } + } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : ",." + mPredefinedType.ToString() + "."); } + } + public class IfcWorkTime : IfcSchedulingTime //IFC4 + { + internal int mRecurrencePattern;// OPTIONAL IfcRecurrencePattern + internal string mStart = "$";// : OPTIONAL IfcDate; + internal string mFinish = "$";// : OPTIONAL IfcDate; + internal IfcWorkTime() : base() { } + internal IfcWorkTime(IfcWorkTime i) : base(i) { mRecurrencePattern = i.mRecurrencePattern; mStart = i.mStart; mFinish = i.mFinish; } + internal IfcWorkTime(DatabaseIfc m, string name, IfcDataOriginEnum origin, string userOrigin, IfcRecurrencePattern recur, DateTime start, DateTime finish) + : base(m, name, origin, userOrigin) { if (recur != null) mRecurrencePattern = recur.mIndex; if (start != DateTime.MinValue) mStart = IfcDate.convert(start); if (finish != DateTime.MinValue) mFinish = IfcDate.convert(finish); } + internal static IfcWorkTime Parse(string strDef) { IfcWorkTime f = new IfcWorkTime(); int ipos = 0; parseFields(f, ParserSTEP.SplitLineFields(strDef), ref ipos); return f; } + internal static void parseFields(IfcWorkTime f, List arrFields, ref int ipos) + { + IfcSchedulingTime.parseFields(f, arrFields, ref ipos); + f.mRecurrencePattern = ParserSTEP.ParseLink(arrFields[ipos++]); + f.mStart = arrFields[ipos++].Replace("'", ""); + f.mFinish = arrFields[ipos++].Replace("'", ""); + } + protected override string BuildString() { return (mDatabase.mSchema == Schema.IFC2x3 ? "" : base.BuildString() + "," + ParserSTEP.LinkToString(mRecurrencePattern) + (mStart == "$" ? ",$," : ",'" + mStart + "',") + (mFinish == "$" ? "$" : "'" + mFinish + "'")); } + } +} diff --git a/IFC/IFC Z.cs b/IFC/IFC Z.cs new file mode 100644 index 0000000..0e4c7ae --- /dev/null +++ b/IFC/IFC Z.cs @@ -0,0 +1,71 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Linq; +using System.Drawing; +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public class IfcZone : IfcSystem + { + internal string mLongName = "$";// : OPTIONAL IfcLabel; IFC4 + public string LongName { get { return (mLongName == "$" ? "" : ParserIfc.Decode(mLongName)); } set { mLongName = (string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value.Replace("'", ""))); } } + + internal IfcZone() : base() { } + internal IfcZone(IfcZone z) : base(z) { mLongName = z.mLongName; } + internal IfcZone(DatabaseIfc m, string name) : base(m, name) { } + internal IfcZone(IfcSpatialElement e, string name, string longname, List spaces) : base(e, name) + { + if (spaces != null) + mIsGroupedBy[0].mRelatedObjects.AddRange(spaces.ConvertAll(x => x.mIndex)); + } + internal new static IfcZone Parse(string strDef) { IfcZone z = new IfcZone(); int ipos = 0; parseFields(z, ParserSTEP.SplitLineFields(strDef), ref ipos); return z; } + internal static void parseFields(IfcZone z, List arrFields, ref int ipos) { IfcGroup.parseFields(z, arrFields, ref ipos); } + protected override string BuildString() { return base.BuildString() + (mDatabase.mSchema == Schema.IFC2x3 ? "" : (mLongName == "$" ? ",$" : ",'" + mLongName + "'")); } + } + public partial class IfcZShapeProfileDef : IfcParameterizedProfileDef + { + internal double mDepth;// : IfcPositiveLengthMeasure; + internal double mFlangeWidth;// : IfcPositiveLengthMeasure; + internal double mWebThickness;// : IfcPositiveLengthMeasure; + internal double mFlangeThickness;// : IfcPositiveLengthMeasure; + internal double mFilletRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal double mEdgeRadius;// : OPTIONAL IfcPositiveLengthMeasure; + internal IfcZShapeProfileDef() : base() { } + internal IfcZShapeProfileDef(IfcZShapeProfileDef i) : base(i) { mDepth = i.mDepth; mFlangeWidth = i.mFlangeWidth; mWebThickness = i.mWebThickness; mFlangeThickness = i.mFlangeThickness; mFilletRadius = i.mFilletRadius; mEdgeRadius = i.mEdgeRadius; } + + internal new static IfcZShapeProfileDef Parse(string strDef) { IfcZShapeProfileDef p = new IfcZShapeProfileDef(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; } + internal static void parseFields(IfcZShapeProfileDef p, List arrFields, ref int ipos) + { + IfcParameterizedProfileDef.parseFields(p, arrFields, ref ipos); + p.mDepth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeWidth = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mWebThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFlangeThickness = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mFilletRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + p.mEdgeRadius = ParserSTEP.ParseDouble(arrFields[ipos++]); + } + } +} diff --git a/IFC/ParserIFC.cs b/IFC/ParserIFC.cs new file mode 100644 index 0000000..e0fc9ba --- /dev/null +++ b/IFC/ParserIFC.cs @@ -0,0 +1,709 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Diagnostics; + +using GeometryGym.STEP; + +namespace GeometryGym.Ifc +{ + public static class ParserIfc + { + public static string Encode(string str) + { + string result = ""; + for (int icounter = 0; icounter < str.Length; icounter++) + { + char c = str[icounter]; + int i = (int)c; + if(i < 32 || i > 126) + result += "\\X2\\" + string.Format("{0:x4}", i).ToUpper() + "\\X0\\"; + else + result += c; + } + return result; + } + public static string Decode(string str) //http://www.buildingsmart-tech.org/implementation/get-started/string-encoding/string-encoding-decoding-summary + { + int ilast = str.Length - 4, icounter = 0; + string result = ""; + while (icounter < ilast) + { + char c = str[icounter]; + if (c == '\\') + { + if (str[icounter + 2] == '\\') + { + if (str[icounter + 1] == 'S') + { + char o = str[icounter + 3]; + result += (char)((int)o + 128); + icounter += 3; + } + else if (str[icounter + 1] == 'X' && str.Length > icounter + 4) + { + string s = str.Substring(icounter + 3, 2); + c = System.Text.Encoding.ASCII.GetChars(BitConverter.GetBytes(Convert.ToInt32(s, 16)))[0]; + //result += (char)(); + result += c; + icounter += 4; + } + else + result += str[icounter]; + } + else if (str[icounter + 3] == '\\' && str[icounter + 2] == '2' && str[icounter + 1] == 'X') + { + icounter += 4; + while (str[icounter] != '\\') + { + string s = str.Substring(icounter, 4); + c = System.Text.Encoding.Unicode.GetChars(BitConverter.GetBytes(Convert.ToInt32(s, 16)))[0]; + //result += (char)(); + result += c; + icounter += 4; + } + icounter += 3; + } + else + result += str[icounter]; + } + else + result += str[icounter]; + icounter++; + } + while (icounter < str.Length) + result += str[icounter++]; + return result; + } + + public static IfcLogicalEnum ParseIFCLogical(string str) + { + string s = str.Trim(); + if (str == "$") + return IfcLogicalEnum.UNKNOWN; + Char c = char.ToUpper(s.Replace(".", "")[0]); + if (c == 'T') + return IfcLogicalEnum.TRUE; + else if (c == 'F') + return IfcLogicalEnum.FALSE; + + return IfcLogicalEnum.UNKNOWN; + } + public static IfcLogicalEnum StripLogical(string s, ref int pos) + { + IfcLogicalEnum result = IfcLogicalEnum.UNKNOWN; + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + if (s[icounter] == '$') + { + if (++icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return result; + } + if (s[icounter++] != '.') + throw new Exception("Unrecognized format!"); + char c = char.ToUpper(s[icounter++]); + if (c == 'T') + result = IfcLogicalEnum.TRUE; + else if (c == 'F') + result = IfcLogicalEnum.TRUE; + pos = icounter + 2; + return result; + } + public static string LogicalToString(IfcLogicalEnum l) + { + if (l == IfcLogicalEnum.TRUE) + return ".T."; + else if (l == IfcLogicalEnum.FALSE) + return ".F."; + return ".U."; + } + + internal static void GetKeyWord(string line, out int ifcID, out string keyword, out string def) + { + keyword = ""; + def = ""; + ifcID = 0; + if (string.IsNullOrEmpty(line)) + return; + string strLine = line.Trim(); + int jlast = strLine.Length, jcounter = (line[0] == '#' ? 1 : 0); + char c; + for (; jcounter < jlast; jcounter++) + { + c = strLine[jcounter]; + if (char.IsDigit(c)) + def += c; + else + break; + } + if (!string.IsNullOrEmpty(def)) + ifcID = int.Parse(def); + c = strLine[jcounter]; + while (c == ' ') + c = strLine[++jcounter]; + if (strLine[jcounter] == '=') + jcounter++; + c = strLine[jcounter]; + while (c == ' ') + c = strLine[++jcounter]; + if (c != 'I') + return; + for (; jcounter < jlast; jcounter++) + { + c = strLine[jcounter]; + if (c == '(') + break; + keyword += c; + } + keyword = keyword.Trim(); + keyword = keyword.ToUpper(); + int len = strLine.Length; + int ilast = 1; + while (strLine[len - ilast] != ')') + ilast++; + def = strLine.Substring(jcounter + 1, len - jcounter - ilast - 1);//(strLine[len-1] == ';' ? 3 : 2)); + } + internal static BaseClassIfc ParseLine(string line, Schema schema) + { + string kw = "", str = ""; + int ifcID = 0; + if (string.IsNullOrEmpty(line)) + return null; + if (line.Length < 5 || line.StartsWith("ISO")) + return null; + GetKeyWord(line, out ifcID, out kw, out str); + if (string.IsNullOrEmpty(kw)) + return null; + str = str.Trim(); + BaseClassIfc result = LineParser(kw, str, schema); + if (result == null) + return null; + result.mIFCString = str; + result.mIndex = ifcID; + return result; + } + private static BaseClassIfc LineParser(string keyword, string str, Schema schema) + { + Type type = Type.GetType("GeometryGym.Ifc." + keyword,false,true); + if (type != null) + { + Type[] arguments = new Type[] { typeof(string), typeof(Schema) }; + MethodInfo parser = type.GetMethod("Parse",BindingFlags.Static | BindingFlags.NonPublic,null,CallingConventions.Any, arguments,null); + if (parser != null) + return parser.Invoke(null, new object[] { str,schema }) as BaseClassIfc; + arguments = new Type[] { typeof(string) }; + parser = type.GetMethod("Parse", BindingFlags.Static | BindingFlags.NonPublic, null, CallingConventions.Any, arguments, null); + if (parser != null) + return parser.Invoke(null, new object[] { str }) as BaseClassIfc; + } + return null; + } + + internal static IfcColour parseColour(string str) + { + string kw = "", def = ""; + int id = 0; + ParserIfc.GetKeyWord(str, out id, out kw, out def); + if (string.IsNullOrEmpty(kw)) + return null; + if (string.Compare(kw, "IFCCOLOURRGB", false) == 0) + return IfcColourRgb.Parse(str); + if (string.Compare(kw, "IFCDRAUGHTINGPREDEFINEDCOLOUR", false) == 0) + return IfcDraughtingPreDefinedColour.Parse(str); + return null; + } + internal static IfcColourOrFactor parseColourOrFactor(string str) + { + if (str[0] == '#') + return null; + string kw = "", def = ""; + int id = 0; + ParserIfc.GetKeyWord(str, out id, out kw, out def); + if (string.IsNullOrEmpty(kw)) + return null; + if (string.Compare(kw, "IFCCOLOURRGB", false) == 0) + return IfcColourRgb.Parse(str); + return new IfcNormalisedRatioMeasure(ParserSTEP.ParseDouble(def)); + } + internal static IfcDerivedMeasureValue parseDerivedMeasureValue(string str) + { + int len = str.Length; + if (str.EndsWith(")")) + len--; + int icounter = 0; + char c = str[icounter]; + while (!char.IsDigit(c) && icounter < str.Length) + c = str[icounter++]; + if (icounter == str.Length) + return null; + icounter--; + if (icounter > 1) + { + string kw = str.Substring(0, icounter - 1); + double val = 0; + if (double.TryParse(str.Substring(icounter, len - icounter), out val)) + { + if (string.Compare(kw, IfcVolumetricFlowRateMeasure.mKW, true) == 0) + return new IfcVolumetricFlowRateMeasure(val); + if (string.Compare(kw, IfcThermalTransmittanceMeasure.mKW, true) == 0) + return new IfcThermalTransmittanceMeasure(val); + //IfcThermalResistanceMeasure, + //IfcThermalAdmittanceMeasure, + if (string.Compare(kw, IfcPressureMeasure.mKW, true) == 0) + return new IfcPressureMeasure(val); + //IfcPowerMeasure, + //IfcMassFlowRateMeasure, + if (string.Compare(kw, IfcMassDensityMeasure.mKW, true) == 0) + return new IfcMassDensityMeasure(val); + /*IfcLinearVelocityMeasure, + IfcKinematicViscosityMeasure, + IfcIntegerCountRateMeasure, + IfcHeatFluxDensityMeasure, + IfcFrequencyMeasure, + IfcEnergyMeasure, + IfcElectricVoltageMeasure, + , */ + if (string.Compare(kw, IfcDynamicViscosityMeasure.mKW, true) == 0) + return new IfcDynamicViscosityMeasure(val); + // if (string.Compare(kw, IfcCompoundPlaneAngleMeasure.mKW, true) == 0) + // return new IfcCompoundPlaneAngleMeasure(val); + + /*IfcAngularVelocityMeasure, + IfcThermalConductivityMeasure, */ + if (string.Compare(kw, IfcMolecularWeightMeasure.mKW, true) == 0) + return new IfcMolecularWeightMeasure(val); + /*IfcVaporPermeabilityMeasure, + IfcMoistureDiffusivityMeasure, + IfcIsothermalMoistureCapacityMeasure, + IfcSpecificHeatCapacityMeasure, */ + if (string.Compare(kw, IfcMonetaryMeasure.mKW, true) == 0) + return new IfcMonetaryMeasure(val); + /*IfcMagneticFluxDensityMeasure, + IfcMagneticFluxMeasure, + IfcLuminousFluxMeasure, */ + if (string.Compare(kw, IfcForceMeasure.mKW, true) == 0) + return new IfcForceMeasure(val); + /*IfcInductanceMeasure, + IfcIlluminanceMeasure, + IfcElectricResistanceMeasure, + IfcElectricConductanceMeasure, + IfcElectricChargeMeasure, + IfcDoseEquivalentMeasure, + IfcElectricCapacitanceMeasure, + IfcAbsorbedDoseMeasure, + IfcRadioActivityMeasure, + IfcRotationalFrequencyMeasure, + IfcTorqueMeasure, + IfcAccelerationMeasure, + IfcLinearForceMeasure, */ + if (string.Compare(kw, IfcLinearStiffnessMeasure.mKW, true) == 0) + return new IfcLinearStiffnessMeasure(val); + //IfcModulusOfSubgradeReactionMeasure, + if (string.Compare(kw, IfcModulusOfElasticityMeasure.mKW, true) == 0) + return new IfcModulusOfElasticityMeasure(val); + /*IfcMomentOfInertiaMeasure, + IfcPlanarForceMeasure, */ + if (string.Compare(kw, IfcRotationalStiffnessMeasure.mKW, true) == 0) + return new IfcRotationalStiffnessMeasure(val); + /*IfcShearModulusMeasure, + IfcLinearMomentMeasure, + IfcLuminousIntensityDistributionMeasure, + IfcCurvatureMeasure, */ + if (string.Compare(kw, IfcMassPerLengthMeasure.mKW, true) == 0) + return new IfcMassPerLengthMeasure(val); + + /*IfcModulusOfLinearSubgradeReactionMeasure, + IfcModulusOfRotationalSubgradeReactionMeasure, + IfcRotationalMassMeasure, + IfcSectionalAreaIntegralMeasure, + IfcSectionModulusMeasure, + IfcTemperatureGradientMeasure, + , */ + if (string.Compare(kw, IfcThermalExpansionCoefficientMeasure.mKW, true) == 0) + return new IfcThermalExpansionCoefficientMeasure(val); + if (string.Compare(kw, IfcWarpingConstantMeasure.mKW, true) == 0) + return new IfcWarpingConstantMeasure(val); + if (string.Compare(kw, IfcWarpingMomentMeasure.mKW, true) == 0) + return new IfcWarpingMomentMeasure(val); + /*IfcSoundPowerMeasure, + IfcSoundPressureMeasure, + IfcHeatingValueMeasure, + IfcPHMeasure, + IfcIonConcentrationMeasure, + IfcTemperatureRateOfChangeMeasure, + IfcAreaDensityMeasure, + IfcSoundPowerLevelMeasure, + IfcSoundPressureLevelMeasure);*/ + } + } + return null; + } + internal static IfcMeasureValue parseMeasureValue(string str) + { + int len = str.Length; + if (str.EndsWith(")")) + len--; + int icounter = 0; + char c = str[icounter]; + while (!char.IsDigit(c) && icounter < str.Length) + c = str[icounter++]; + if (icounter == str.Length) + return null; + icounter--; + if (icounter > 1) + { + string kw = str.Substring(0, icounter - 1); + double val = 0; + int i = 0; + if (int.TryParse(str.Substring(icounter, len - icounter), out i)) + { + if (string.Compare(kw, IfcCountMeasure.mKW, true) == 0) + return new IfcCountMeasure(i); + } + if (double.TryParse(str.Substring(icounter, len - icounter), out val)) + { + if (string.Compare(kw, IfcVolumeMeasure.mKW, true) == 0) + return new IfcVolumeMeasure(val); + if (string.Compare(kw, IfcTimeMeasure.mKW, true) == 0) + return new IfcTimeMeasure(val); + if (string.Compare(kw, IfcThermodynamicTemperatureMeasure.mKW, true) == 0) + return new IfcThermodynamicTemperatureMeasure(val); + //IfcSolidAngleMeasure, */ + if (string.Compare(kw, IfcPositiveRatioMeasure.mKW, true) == 0) + return new IfcPositiveRatioMeasure(val); + if (string.Compare(kw, IfcRatioMeasure.mKW, true) == 0) + return new IfcRatioMeasure(val); + //IfcPositivePlaneAngleMeasure, + if (string.Compare(kw, IfcPlaneAngleMeasure.mKW, true) == 0) + return new IfcPlaneAngleMeasure(val); + //if (string.Compare(kw, IfcParameterValue.mKW, true) == 0) + // return new IfcParameterValue(val); + // if (string.Compare(kw, IfcNumericMeasure.mKW, true) == 0) + // return new IfcNumericMeasure(val); + if (string.Compare(kw, IfcMassMeasure.mKW, true) == 0) + return new IfcMassMeasure(val); + if (string.Compare(kw, IfcPositiveLengthMeasure.mKW, true) == 0) + return new IfcPositiveLengthMeasure(val); + if (string.Compare(kw, IfcLengthMeasure.mKW, true) == 0) + return new IfcLengthMeasure(val); + //IfcElectricCurrentMeasure, + + + //IfcContextDependentMeasure, + if (string.Compare(kw, IfcAreaMeasure.mKW, true) == 0) + return new IfcAreaMeasure(val); + //IfcAmountOfSubstanceMeasure, + //IfcLuminousIntensityMeasure, + if (string.Compare(kw, IfcNormalisedRatioMeasure.mKW, true) == 0) + return new IfcNormalisedRatioMeasure(val); + //IfcComplexNumber, + //IfcNonNegativeLengthMeasure); + } + if (string.Compare(kw, IfcDescriptiveMeasure.mKW, true) == 0) + return new IfcDescriptiveMeasure(str.Substring(icounter, len - icounter)); + } + return null; + } + internal static IfcSimpleValue parseSimpleValue(string str) + { + if (str.StartsWith("IFCBOOLEAN(")) + return new IfcBoolean(string.Compare(str.Substring(11, str.Length - 12), ".T.") == 0); + if (str.StartsWith("IFCIDENTIFIER(")) + return new IfcIdentifier(str.Substring(15, str.Length - 17)); + if (str.StartsWith("IFCINTEGER(")) + return new IfcInteger(int.Parse(str.Substring(11, str.Length - 12))); + if (str.StartsWith("IFCLABEL(")) + { + string s = str.Substring(9, str.Length - 10).Replace("'", ""); + return new IfcLabel((s == "$" || string.IsNullOrEmpty(s) ? "DEFAULT" : s)); + } + if (str.StartsWith("IFCLOGICAL(")) + { + string s = str.Substring(11, str.Length - 12); + IfcLogicalEnum l = IfcLogicalEnum.UNKNOWN; + if (s == ".T.") + l = IfcLogicalEnum.TRUE; + else if (s == ".F.") + l = IfcLogicalEnum.FALSE; + return new IfcLogical(l); + } + if (str.StartsWith("IFCREAL(")) + return new IfcReal(ParserSTEP.ParseDouble(str.Substring(8, str.Length - 9))); + if (str.StartsWith("IFCTEXT(")) + { + string s = str.Substring(8, str.Length - 9).Replace("'", ""); + return new IfcText((s == "$" || string.IsNullOrEmpty(s) ? "DEFAULT" : s)); + } + int i = 0; + if (int.TryParse(str, out i)) + return new IfcInteger(i); + double d = 0; + if (double.TryParse(str, out d)) + return new IfcReal(d); + if (str == ".T.") + return new IfcBoolean(true); + if (str == ".F.") + return new IfcBoolean(false); + if (str == ".U.") + return new IfcLogical(IfcLogicalEnum.UNKNOWN); + return null; + } + internal static IfcValue parseValue(string str) + { + IfcMeasureValue sv = parseMeasureValue(str); + if (sv != null) + return sv; + IfcDerivedMeasureValue mv = parseDerivedMeasureValue(str); + if (mv != null) + return mv; + return parseSimpleValue(str); + } + internal static bool TryGetDouble(IfcValue v, out double val) + { + IfcReal r = v as IfcReal; + if (r != null) + { + val = r.mValue; + return true; + } + IfcInteger i = v as IfcInteger; + if (i != null) + { + val = i.mValue; + return true; + } + IfcPositiveLengthMeasure plm = v as IfcPositiveLengthMeasure; + if (plm != null) + { + val = plm.mValue; + return true; + } + IfcDynamicViscosityMeasure dvm = v as IfcDynamicViscosityMeasure; + if (dvm != null) + { + val = dvm.mValue; + return true; + } + IfcMassDensityMeasure mdm = v as IfcMassDensityMeasure; + if (mdm != null) + { + val = mdm.mValue; + return true; + } + IfcModulusOfElasticityMeasure mem = v as IfcModulusOfElasticityMeasure; + if (mem != null) + { + val = mem.mValue; + return true; + } + IfcPositiveRatioMeasure prm = v as IfcPositiveRatioMeasure; + if (prm != null) + { + val = prm.mValue; + return true; + } + IfcThermalExpansionCoefficientMeasure tec = v as IfcThermalExpansionCoefficientMeasure; + if (tec != null) + { + val = tec.mValue; + return true; + } + val = 0; + return false; + } + + + //http://madskristensen.net/post/A-shorter-and-URL-friendly-GUID.aspx + /// + /// Conversion methods between an IFC + /// encoded GUID string and a .NET GUID. + /// This is a translation of the C code + /// found here: + /// http://www.iai-tech.org/ifc/IFC2x3/TC1/html/index.htm + /// + /// + + #region Private Members + /// + /// The replacement table + /// + private static readonly char[] base64Chars = new char[] + { '0','1','2','3','4','5','6','7','8','9' + , 'A','B','C','D','E','F','G','H','I','J' + , 'K','L','M','N','O','P','Q','R','S','T' + , 'U','V','W','X','Y','Z','a','b','c','d' + , 'e','f','g','h','i','j','k','l','m','n' + , 'o','p','q','r','s','t','u','v','w','x' + , 'y','z','_','$' }; + + /// + /// Conversion of an integer into characters + /// with base 64 using the table base64Chars + /// + /// The number to convert + /// The result char array to write to + /// The position in the char array to start writing + /// The length to write + /// + static void cv_to_64(uint number, ref char[] result, int start, int len) + { + uint act; + int iDigit, nDigits; + + Debug.Assert(len <= 4); + act = number; + nDigits = len; + + for (iDigit = 0; iDigit < nDigits; iDigit++) + { + result[start + len - iDigit - 1] = base64Chars[(int)(act % 64)]; + act /= 64; + } + Debug.Assert(act == 0, "Logic failed, act was not null: " + act.ToString()); + return; + } + + /// + /// The reverse function to calculate + /// the number from the characters + /// + /// The char array to convert from + /// Position in array to start read + /// The length to read + /// The calculated nuber + static uint cv_from_64(char[] str, int start, int len) + { + int i, j, index; + uint res = 0; + Debug.Assert(len <= 4); + + for (i = 0; i < len; i++) + { + index = -1; + for (j = 0; j < 64; j++) + { + if (base64Chars[j] == str[start + i]) + { + index = j; + break; + } + } + Debug.Assert(index >= 0); + res = res * 64 + ((uint)index); + } + return res; + } + #endregion // Private Members + + #region Conversion Methods + /// + /// Reconstruction of the GUID + /// from an IFC GUID string (base64) + /// + /// The GUID string to convert. Must be 22 characters int + /// GUID correspondig to the string + public static Guid DecodeGlobalID(string guid) + { + try + { + if (guid.Length == 22) + { + uint[] num = new uint[6]; + char[] str = guid.ToCharArray(); + int n = 2, pos = 0, i; + for (i = 0; i < 6; i++) + { + num[i] = cv_from_64(str, pos, n); + pos += n; n = 4; + } + int a = (int)((num[0] * 16777216 + num[1])); + short b = (short)(num[2] / 256); + short c = (short)((num[2] % 256) * 256 + num[3] / 65536); + byte[] d = new byte[8]; + d[0] = Convert.ToByte((num[3] / 256) % 256); + d[1] = Convert.ToByte(num[3] % 256); + d[2] = Convert.ToByte(num[4] / 65536); + d[3] = Convert.ToByte((num[4] / 256) % 256); + d[4] = Convert.ToByte(num[4] % 256); + d[5] = Convert.ToByte(num[5] / 65536); + d[6] = Convert.ToByte((num[5] / 256) % 256); + d[7] = Convert.ToByte(num[5] % 256); + + return new Guid(a, b, c, d); + } + } + catch (Exception) { } + return Guid.Empty; + } + + /// + /// Conversion of a GUID to a string + /// representing the GUID + /// + /// The GUID to convert + /// IFC (base64) encoded GUID string + public static string EncodeGuid(Guid guid) + { + uint[] num = new uint[6]; + char[] str = new char[22]; + int i, n; + byte[] b = guid.ToByteArray(); + + // Creation of six 32 Bit integers from the components of the GUID structure + num[0] = (uint)(BitConverter.ToUInt32(b, 0) / 16777216); + num[1] = (uint)(BitConverter.ToUInt32(b, 0) % 16777216); + num[2] = (uint)(BitConverter.ToUInt16(b, 4) * 256 + BitConverter.ToInt16(b, 6) / 256); + num[3] = (uint)((BitConverter.ToUInt16(b, 6) % 256) * 65536 + b[8] * 256 + b[9]); + num[4] = (uint)(b[10] * 65536 + b[11] * 256 + b[12]); + num[5] = (uint)(b[13] * 65536 + b[14] * 256 + b[15]); + + // Conversion of the numbers into a system using a base of 64 + n = 2; + int pos = 0; + for (i = 0; i < 6; i++) + { + cv_to_64(num[i], ref str, pos, n); + pos += n; n = 4; + } + return new String(str); + } + #endregion // Conversion Methods + + + } +} diff --git a/RhinoCommon IFC/IFC A RhinoCommon.cs b/RhinoCommon IFC/IFC A RhinoCommon.cs new file mode 100644 index 0000000..911d44d --- /dev/null +++ b/RhinoCommon IFC/IFC A RhinoCommon.cs @@ -0,0 +1,45 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + public partial class IfcAxis1Placement : IfcPlacement + { + internal Vector3d AxisVector { get { return (mAxis > 0 ? (mDatabase.mIfcObjects[mAxis] as IfcDirection).Vector : Vector3d.XAxis); } } + } + + public partial class IfcAxis2Placement2D + { + internal Vector3d DirectionVector { get { return (mRefDirection > 0 ? (mDatabase.mIfcObjects[mRefDirection] as IfcDirection).Vector : Vector3d.XAxis); } } + } + public partial class IfcAxis2Placement3D + { + + } +} diff --git a/RhinoCommon IFC/IFC B RhinoCommon.cs b/RhinoCommon IFC/IFC B RhinoCommon.cs new file mode 100644 index 0000000..540fb6e --- /dev/null +++ b/RhinoCommon IFC/IFC B RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC C RhinoCommon.cs b/RhinoCommon IFC/IFC C RhinoCommon.cs new file mode 100644 index 0000000..2d58631 --- /dev/null +++ b/RhinoCommon IFC/IFC C RhinoCommon.cs @@ -0,0 +1,114 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + public partial class IfcCartesianPoint + { + internal override Point3d Coordinates + { + get { return new Point3d(mCoordinateX, mCoordinateY, Double.IsNaN(mCoordinateZ) ? 0 : mCoordinateZ); } + } + internal Point3d Coordinates3d { set { mCoordinateX = value.X; mCoordinateY = value.Y; mCoordinateZ = value.Z; } } + internal Point2d Coordinates2d { set { mCoordinateX = value.X; mCoordinateY = value.Y; mCoordinateZ = double.NaN; } } + internal IfcCartesianPoint(DatabaseIfc m, Point3d pt) : base(m) { Coordinates3d = pt; } + internal IfcCartesianPoint(DatabaseIfc m, Point2d pt) : base(m) { Coordinates2d = pt; } + } + + public partial class IfcCartesianPointList2D + { + public IfcCartesianPointList2D(DatabaseIfc m, IEnumerable coordList) : base(m) + { + List> pts = new List>(); + foreach (Point2d t in coordList) + pts.Add(new Tuple(t.X, t.Y)); + mCoordList = pts.ToArray(); + } + } + public partial class IfcConnectionPointEccentricity + { + internal Vector3d Eccentricity { get { return new Vector3d(mEccentricityInX, mEccentricityInY, mEccentricityInZ); } } + + internal IfcConnectionPointEccentricity(IfcPointOrVertexPoint v, Vector3d ecc) : base(v) { mEccentricityInX = ecc.X; mEccentricityInY = ecc.Y; mEccentricityInZ = ecc.Z; } + } + public abstract partial class IfcCartesianTransformationOperator + { + internal Transform Transform + { + get + { + IfcCartesianPoint cp = LocalOrigin; + Point3d p = cp.Coordinates; + return Transform.Translation(p.X, p.Y, p.Z) * vecsTransform() * getScaleTransform(p); + } + } + internal virtual Transform getScaleTransform(Point3d location) { return Transform.Scale(location, mScale); } + protected virtual Transform vecsTransform() + { + Vector3d vx = new Vector3d(1, 0, 0), vy = new Vector3d(0, 1, 0); + Transform tr = Transform.Identity; + if (mAxis1 > 0) + { + vx = Axis1.Vector; + tr.M00 = vx.X; + tr.M10 = vx.Y; + tr.M20 = vx.Z; + } + if (mAxis2 > 0) + { + vy = Axis2.Vector; + tr.M01 = vy.X; + tr.M11 = vy.Y; + tr.M21 = vy.Z; + } + return tr; + } + } + public partial class IfcCartesianTransformationOperator2DnonUniform + { + internal override Transform getScaleTransform(Point3d location) { return Transform.Scale(new Plane(location, Vector3d.XAxis, Vector3d.YAxis), Scale, mScale2, 1); } + } + public partial class IfcCartesianTransformationOperator3D + { + internal Vector3d Axis3Vector { get { return (mAxis3 > 0 ? Axis3.Vector : Vector3d.ZAxis); } } + protected override Transform vecsTransform() + { + Transform tr = base.vecsTransform(); + Vector3d v = Axis3Vector; + tr.M02 = v.X; + tr.M12 = v.Y; + tr.M22 = v.Z; + return tr; + } + } + public partial class IfcCartesianTransformationOperator3DnonUniform + { + internal override Transform getScaleTransform(Point3d location) { return Transform.Scale(new Plane(location, Vector3d.XAxis, Vector3d.YAxis), Scale, Scale2, Scale3); } + } +} diff --git a/RhinoCommon IFC/IFC D RhinoCommon.cs b/RhinoCommon IFC/IFC D RhinoCommon.cs new file mode 100644 index 0000000..cbe5834 --- /dev/null +++ b/RhinoCommon IFC/IFC D RhinoCommon.cs @@ -0,0 +1,36 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + public partial class IfcDirection + { + internal Vector3d Vector { get { return new Vector3d(mCoordinateX, mCoordinateY, double.IsNaN(mCoordinateZ) ? 0 : mCoordinateZ); } } + } +} diff --git a/RhinoCommon IFC/IFC E RhinoCommon.cs b/RhinoCommon IFC/IFC E RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC E RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC F RhinoCommon.cs b/RhinoCommon IFC/IFC F RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC F RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC G RhinoCommon.cs b/RhinoCommon IFC/IFC G RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC G RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC H RhinoCommon.cs b/RhinoCommon IFC/IFC H RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC H RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC I RhinoCommon.cs b/RhinoCommon IFC/IFC I RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC I RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC L RhinoCommon.cs b/RhinoCommon IFC/IFC L RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC L RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC M RhinoCommon.cs b/RhinoCommon IFC/IFC M RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC M RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC O RhinoCommon.cs b/RhinoCommon IFC/IFC O RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC O RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC P RhinoCommon.cs b/RhinoCommon IFC/IFC P RhinoCommon.cs new file mode 100644 index 0000000..e95f94c --- /dev/null +++ b/RhinoCommon IFC/IFC P RhinoCommon.cs @@ -0,0 +1,36 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + public abstract partial class IfcPoint + { + internal virtual Point3d Coordinates { get { return Point3d.Unset; } } + } +} diff --git a/RhinoCommon IFC/IFC R RhinoCommon.cs b/RhinoCommon IFC/IFC R RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC R RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC S RhinoCommon.cs b/RhinoCommon IFC/IFC S RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC S RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC T RhinoCommon.cs b/RhinoCommon IFC/IFC T RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC T RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/RhinoCommon IFC/IFC V RhinoCommon.cs b/RhinoCommon IFC/IFC V RhinoCommon.cs new file mode 100644 index 0000000..b4304f4 --- /dev/null +++ b/RhinoCommon IFC/IFC V RhinoCommon.cs @@ -0,0 +1,33 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; + +using Rhino.Collections; +using Rhino.Geometry; +using Rhino.DocObjects; + +namespace GeometryGym.Ifc +{ + +} diff --git a/STEP/BaseClassSTEP.cs b/STEP/BaseClassSTEP.cs new file mode 100644 index 0000000..53f56f1 --- /dev/null +++ b/STEP/BaseClassSTEP.cs @@ -0,0 +1,54 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; + +namespace GeometryGym.STEP +{ + public class STEPEntity + { + internal int mIndex = 0; + internal List mComments = new List(); + + public int Index { get { return mIndex; } } + public List Comments { get { return mComments; } set { mComments = value; } } + + public virtual string KeyWord {get { return this.GetType().Name.ToUpper();}} + + public override string ToString() + { + string str = BuildString(); + if (string.IsNullOrEmpty(str)) + return ""; + string comment = ""; + if (mComments.Count > 0) + { + foreach (string c in mComments) + comment = "/* " + c + " */\r\n"; + } + return comment + (mIndex > 0 ? "#" + mIndex + "= " : "") + KeyWord + "(" + str.Substring(1) + ");"; + } + protected virtual string BuildString() { return ""; } + } +} diff --git a/STEP/ParserSTEP.cs b/STEP/ParserSTEP.cs new file mode 100644 index 0000000..041622c --- /dev/null +++ b/STEP/ParserSTEP.cs @@ -0,0 +1,909 @@ +// MIT License +// Copyright (c) 2016 Geometry Gym Pty Ltd + +// 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. + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Reflection; +using System.IO; +using System.ComponentModel; +using System.Globalization; + +namespace GeometryGym.STEP +{ + public static class ParserSTEP + { + public static NumberFormatInfo NumberFormat = null; + static ParserSTEP() + { + CultureInfo ci = new CultureInfo("en-us"); + NumberFormat = (NumberFormatInfo) ci.NumberFormat.Clone(); + } + + public static bool ParseBool(string str) + { + string s = str.Trim(); + if (char.ToUpper(s.Replace(".", "")[0]) == 'T') + return true; + return false; + } + public static double ParseDouble(string str) + { + string s = str.Trim(); + if (s == "$") + return 0; + if (s == "*") + return 0; + return double.Parse(s, NumberFormat); + } + public static int ParseInt(string str) + { + string s = str.Trim(); + if (s == "$") + return 0; + if (s == "*") + return 0; + return int.Parse(s); + } + public static int ParseLink(string str) + { + string s = str.Trim(); + if (s == "$") + return 0; + if (s == "*") + return 0; + return int.Parse(s.Substring(1)); + } + + public static string BoolToString(bool b) { return (b ? ".T." : ".F."); } + public static string DoubleToString(double i) { return String.Format("{0:0.0################}", i); } + public static string DoubleOptionalToString(double i) { return (i == 0 ? "$" : String.Format("{0:0.0################}", i)); } + public static string IntToString(int i) + { + if (i == 0) + return "*"; + return i.ToString(); + } + public static string IntOptionalToString(int i) + { + if (i == 0) + return "$"; + return i.ToString(); + } + public static string LinkToString(int link) + { + if (link == 0) + return "$"; + else + return "#" + link; + } + public static string ListLinksToString(List links) + { + if (links.Count == 0) + return "$"; + if (links.Count > 50) + { + StringBuilder sb = new StringBuilder(); + sb.Append("(#" + links[0]); + for (int icounter = 1; icounter < links.Count; icounter++) + { + sb.Append(",#" + links[icounter]); + } + return sb.ToString() + ")"; + } + string result = "(#" + links[0]; + for (int icounter = 1; icounter < links.Count; icounter++) + result += ",#" + links[icounter]; + return result + ")"; + } + + + public static List SplitLineFields(string s) + { + //string s = str.Trim(); + string field = ""; + List fields = new List(); + int ilast = s.Length; + int icounter = 0; + char c = s[icounter]; + while (char.IsWhiteSpace(c)) + { + if (++icounter >= ilast) + break; + c = s[icounter]; + } + /*if (c == '(') + { + icounter++; + c = s[ilast - 1]; + while (char.IsWhiteSpace(c)) + { + ilast--; + c = s[ilast - 1]; + } + if (s[ilast - 1] == ')') + ilast--; + }*/ + for (; icounter < ilast; icounter++) + { + c = s[icounter]; + while (char.IsWhiteSpace(c)) + { + if (++icounter >= ilast) + break; + c = s[icounter]; + } + if (c == '\'') + { + field += "'"; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + /* if (c == '\\') + { + //field += '\\'; + int incr = 0; + decode(s.Substring(icounter), ref c, ref incr); + //field += c; + icounter += incr; + /*c = s[++icounter]; + if (c == '\'') + { + if (s.IndexOf('\'', icounter + 1) < icounter) + break; + }*/ + //} + //else + if (c == '\'') + { + if (icounter + 1 < ilast && s[icounter + 1] == '\'') + { + field += "'"; + icounter++; + } + else + break; + } + field += c; + } + field += "'"; + if (++icounter < ilast) + c = s[icounter]; + } + else if (c == '(') + { + icounter++; + field += "("; + int bCounter = 0; + for (; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '\'') + { + field += "'"; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '\'') + { + if (icounter + 1 < ilast && s[icounter + 1] == '\'') + { + field += "'"; + icounter++; + } + else + break; + } + field += c; + } + } + if (c == '(') + bCounter++; + if (c == ')') + { + if (bCounter == 0) + { + break; + } + else + bCounter--; + } + field += c; + } + field += ")"; + if (++icounter < ilast) + c = s[icounter]; + } + if (icounter < ilast) + { + if (c == ',') + { + fields.Add(field); + field = ""; + } + else + field += c; + } + } + if (!string.IsNullOrEmpty(field)) + fields.Add(field); + return fields; + } + public static List SplitListSTPIntegers(string s) + { + List result = new List(); + if (s == "$") + return result; + int ilast = s.Length, i = 0; + int icounter = 0; + while (char.IsWhiteSpace(s[icounter])) + { + if (++icounter >= ilast) + break; + } + while (char.IsWhiteSpace(s[ilast - 1])) + ilast--; + char c = s[icounter]; + if (c != '(') + return result; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + continue; + string str = ""; + str += c; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (!char.IsDigit(c)) + { + if (int.TryParse(str, out i)) + result.Add(i); + break; + } + str += c; + } + } + return result; + } + public static List SplitListLinks(string s) + { + List links = new List(); + //string s = str.Trim(); + if (string.IsNullOrEmpty(s) || s == "$") + return links; + + string field = ""; + int ilast = s.Length; + int icounter = 0; + while (char.IsWhiteSpace(s[icounter])) + { + if (++icounter >= ilast) + break; + } + while (char.IsWhiteSpace(s[ilast - 1])) + ilast--; + if (s.StartsWith("(")) + { + icounter = 1; + if (s[ilast - 1] == ')') + ilast--; + } + char c; + for (; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '#') + { + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + { + int i = int.Parse(field); + links.Add(i); + field = ""; + break; + } + field += c; + } + if (field != "") + { + int i = int.Parse(field); + links.Add(i); + } + } + } + return links; + } + public static List SplitListStrings(string s) + { + List result = new List(); + if (s == "$") + return result; + int ilast = s.Length; + int icounter = 0; + while (char.IsWhiteSpace(s[icounter])) + { + if (++icounter >= ilast) + break; + } + while (char.IsWhiteSpace(s[ilast - 1])) + ilast--; + char c = s[icounter]; + if (c != '(') + return result; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '\'') + { + string str = ""; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '\'') + { + result.Add(str); + break; + } + str += c; + } + if (!string.IsNullOrEmpty(str)) + result.Add(str); + } + } + return result; + } + public static Tuple[] SplitListDoubleTuple(string s) + { + List> tss = new List>(100); + if (s == "$") + return new Tuple[0]; + string field = ""; + int ilast = s.Length; + int icounter = 0; + while (char.IsWhiteSpace(s[icounter])) + { + if (++icounter >= ilast) + break; + } + while (char.IsWhiteSpace(s[ilast - 1])) + ilast--; + + char c = s[icounter]; + if (c != '(') + return new Tuple[0]; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '(') + { + double i = 0, j = 0; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + { + i = double.Parse(field, NumberFormat); + field = ""; + break; + } + field += c; + } + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ')') + { + j = double.Parse(field, NumberFormat); + field = ""; + + tss.Add(new Tuple(i, j)); + break; + } + field += c; + } + } + } + return tss.ToArray(); + } + public static Tuple[] SplitListDoubleTriple(string s) + { + List> tss = new List>(100); + if (s == "$") + return new Tuple[0]; + string field = ""; + int ilast = s.Length; + int icounter = 0; + while (char.IsWhiteSpace(s[icounter])) + { + if (++icounter >= ilast) + break; + } + while (char.IsWhiteSpace(s[ilast - 1])) + ilast--; + + char c = s[icounter]; + if (c != '(') + return new Tuple[0]; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '(') + { + double i = 0, j = 0, k = 0; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + { + i = double.Parse(field, NumberFormat); + field = ""; + break; + } + field += c; + } + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + { + j = double.Parse(field, NumberFormat); + field = ""; + break; + } + field += c; + } + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ')') + { + k = double.Parse(field, NumberFormat); + field = ""; + + tss.Add(new Tuple(i, j, k)); + break; + } + field += c; + } + } + } + return tss.ToArray(); + } + public static Tuple[] SplitListSTPIntTriple(string s) + { + List> tss = new List>(100); + if (s == "$") + return new Tuple[0]; + string field = ""; + int ilast = s.Length; + int icounter = 0; + while (char.IsWhiteSpace(s[icounter])) + { + if (++icounter >= ilast) + break; + } + while (char.IsWhiteSpace(s[ilast - 1])) + ilast--; + + char c = s[icounter]; + if (c != '(') + return new Tuple[0]; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == '(') + { + int i = 0, j = 0, k = 0; + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + { + i = int.Parse(field); + field = ""; + break; + } + field += c; + } + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ',') + { + j = int.Parse(field); + field = ""; + break; + } + field += c; + } + for (icounter++; icounter < ilast; icounter++) + { + c = s[icounter]; + if (c == ')') + { + k = int.Parse(field); + field = ""; + + tss.Add(new Tuple(i, j, k)); + break; + } + field += c; + } + } + } + + return tss.ToArray(); + } + + public static string StripField(string s, ref int pos) + { + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + string result = ""; + char c = s[icounter++]; + bool isList = c == '('; + while (c != ',' && c != ')') + { + result += c; + if (c == '\'') + { + if (icounter == len) + break; + c = s[icounter++]; + result += c; + while (c != '\'') + { + if (icounter == len) + break; + c = s[icounter++]; + result += c; + } + result += c; + c = s[icounter++]; + } + else if (c == '(') + { + while (c != ')') + { + if (icounter == len) + break; + c = s[icounter++]; + result += c; + if (c == '\'') + { + if (icounter == len) + break; + c = s[icounter++]; + result += c; + while (c != '\'') + { + if (icounter == len) + break; + c = s[icounter++]; + result += c; + } + } + } + c = s[icounter++]; + while (char.IsWhiteSpace(c)) + { + c = s[icounter++]; + if (icounter == len) + break; + } + if (isList) + { + if (c == ',') + { + result += c; + c = s[icounter++]; + } + } + } + else + { + if (icounter == len) + break; + c = s[icounter++]; + } + if (icounter == len) + break; + } + if (isList) + { + result += c; + while (c != ',') + { + if (icounter == len) + break; + c = s[icounter++]; + } + } + pos = icounter; + return result; + } + public static bool StripBool(string s, ref int pos) + { + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + if (s[icounter] == '$') + { + if (++icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return false; + } + if (s[icounter++] != '.') + throw new Exception("Unrecognized format!"); + char c = char.ToUpper(s[icounter++]); + pos = icounter + 2; + return c == 'T'; + } + public static double StripDouble(string s, ref int pos) + { + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + if (s[icounter] == '$') + { + if (++icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return 0; + } + + + string str = ""; + while (char.IsDigit(s[icounter]) || s[icounter] == '.' || s[icounter] == 'e' || s[icounter] == '-') + { + str += s[icounter++]; + if (icounter == len) + break; + } + if (icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return double.Parse(str, NumberFormat); + } + public static int StripLink(string s, ref int pos) + { + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + if (s[icounter] == '$') + { + if (++icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return 0; + } + + if (s[icounter++] != '#') + throw new Exception("Unrecognized format!"); + string str = ""; + while (char.IsDigit(s[icounter])) + { + str += s[icounter++]; + if (icounter == len) + break; + } + if (icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return int.Parse(str); + } + public static List StripListLink(string s, ref int pos) + { + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + if (s[icounter] == '$') + { + if (++icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + return new List(); + } + while (char.IsWhiteSpace(s[icounter])) + icounter++; + if (s[icounter++] != '(') + throw new Exception("Unrecognized format!"); + while (char.IsWhiteSpace(s[icounter])) + icounter++; + if (s[icounter++] != '#') + throw new Exception("Unrecognized format!"); + List result = new List(); + while (s[icounter] != ')') + { + string str = ""; + while (char.IsDigit(s[icounter])) + { + str += s[icounter++]; + if (icounter == len) + break; + } + result.Add(int.Parse(str)); + if (icounter == len) + break; + while (char.IsWhiteSpace(s[icounter])) + icounter++; + if (s[icounter] != ')') + { + if (s[icounter++] != ',') + throw new Exception("Unrecognized format!"); + while (char.IsWhiteSpace(s[icounter])) + icounter++; + if (s[icounter++] != '#') + throw new Exception("Unrecognized format!"); + } + } + pos = icounter + 2; + return result; + } + public static string StripString(string s, ref int pos) + { + int icounter = pos, len = s.Length; + while (char.IsWhiteSpace(s[icounter])) + { + icounter++; + if (icounter == len) + break; + } + if (s[icounter] == '$') + { + if (++icounter < len) + { + while (s[icounter++] != ',') + { + if (icounter == len) + break; + } + } + pos = icounter; + return "$"; + } + string result = ""; + if (s[icounter++] != '\'') + throw new Exception("Unrecognized format!"); + while (icounter < len) + { + char c = s[icounter]; + if (c == '\'') + { + if (icounter + 1 < len) + { + if (s[icounter + 1] != '\'') + break; + result += '\''; + icounter++; + } + else + break; + } + result += c; + icounter++; + } + pos = icounter + 2; + return result; + } + + internal static string offsetSTEPRecords(string line, int offset) + { + string newline = ""; + int ilast = line.Length - 1; + for (int icounter = 0; icounter < line.Length; icounter++) + { + char c = line[icounter]; + if (c == '\'') + { + newline += "'"; + while (icounter < ilast) + { + c = line[icounter + 1]; + newline += c; + icounter++; + if (c == '\'') + break; + } + + } + else if (line[icounter] == '#') + { + newline += "#"; + string str = ""; + while (icounter < ilast) + { + c = line[icounter + 1]; + if (char.IsDigit(c)) + str += c; + else + break; + icounter++; + } + int record = int.Parse(str) + offset; + newline += record.ToString(); + } + else + newline += c; + } + return newline; + } + } +}