├── .editorconfig ├── .gitattributes ├── .gitignore ├── Core ├── IFC │ ├── BaseClassIFC.cs │ ├── DatabaseIFC.cs │ ├── DefinedTypes.cs │ ├── Enumerations.cs │ ├── IFC A.cs │ ├── IFC B.cs │ ├── IFC C.cs │ ├── IFC D.cs │ ├── IFC E.cs │ ├── IFC F.cs │ ├── IFC G.cs │ ├── IFC H.cs │ ├── IFC I.cs │ ├── IFC J.cs │ ├── IFC K.cs │ ├── IFC L.cs │ ├── IFC M.cs │ ├── IFC N.cs │ ├── IFC O.cs │ ├── IFC P.cs │ ├── IFC Q.cs │ ├── IFC R.cs │ ├── IFC S.cs │ ├── IFC T.cs │ ├── IFC U.cs │ ├── IFC V.cs │ ├── IFC W.cs │ ├── IFC X.cs │ ├── IFC Y.cs │ ├── IFC Z.cs │ ├── JSON │ │ ├── BaseClassIFC JSON.cs │ │ ├── DatabaseIFC JSON.cs │ │ ├── IFC A JSON.cs │ │ ├── IFC B JSON.cs │ │ ├── IFC C JSON.cs │ │ ├── IFC D JSON.cs │ │ ├── IFC E JSON.cs │ │ ├── IFC F JSON.cs │ │ ├── IFC G JSON.cs │ │ ├── IFC H JSON.cs │ │ ├── IFC I JSON.cs │ │ ├── IFC J JSON.cs │ │ ├── IFC K JSON.cs │ │ ├── IFC L JSON.cs │ │ ├── IFC M JSON.cs │ │ ├── IFC N JSON.cs │ │ ├── IFC O JSON.cs │ │ ├── IFC P JSON.cs │ │ ├── IFC Q JSON.cs │ │ ├── IFC R JSON.cs │ │ ├── IFC S JSON.cs │ │ ├── IFC T JSON.cs │ │ ├── IFC U JSON.cs │ │ ├── IFC V JSON.cs │ │ ├── IFC W JSON.cs │ │ └── IFC Z JSON.cs │ ├── ParserIFC.cs │ ├── Property Sets.cs │ ├── Quantity Sets.cs │ ├── STEP │ │ ├── BaseClassIFC STEP.cs │ │ ├── IFC A STEP.cs │ │ ├── IFC B STEP.cs │ │ ├── IFC C STEP.cs │ │ ├── IFC D STEP.cs │ │ ├── IFC E STEP.cs │ │ ├── IFC F STEP.cs │ │ ├── IFC G STEP.cs │ │ ├── IFC H STEP.cs │ │ ├── IFC I STEP.cs │ │ ├── IFC J STEP.cs │ │ ├── IFC K STEP.cs │ │ ├── IFC L STEP.cs │ │ ├── IFC M STEP.cs │ │ ├── IFC N STEP.cs │ │ ├── IFC O STEP.cs │ │ ├── IFC P STEP.cs │ │ ├── IFC Q STEP.cs │ │ ├── IFC R STEP.cs │ │ ├── IFC S STEP.cs │ │ ├── IFC T STEP.cs │ │ ├── IFC U STEP.cs │ │ ├── IFC V STEP.cs │ │ ├── IFC W STEP.cs │ │ ├── IFC X STEP.cs │ │ ├── IFC Y STEP.cs │ │ └── IFC Z STEP.cs │ ├── Validate.cs │ └── XML │ │ ├── BaseClassIFC XML.cs │ │ ├── DatabaseIFC XML.cs │ │ ├── IFC A XML.cs │ │ ├── IFC B XML.cs │ │ ├── IFC C XML.cs │ │ ├── IFC D XML.cs │ │ ├── IFC E XML.cs │ │ ├── IFC F XML.cs │ │ ├── IFC G XML.cs │ │ ├── IFC H XML.cs │ │ ├── IFC I XML.cs │ │ ├── IFC J XML.cs │ │ ├── IFC K XML.cs │ │ ├── IFC L XML.cs │ │ ├── IFC M XML.cs │ │ ├── IFC N XML.cs │ │ ├── IFC O XML.cs │ │ ├── IFC P XML.cs │ │ ├── IFC Q XML.cs │ │ ├── IFC R XML.cs │ │ ├── IFC S XML.cs │ │ ├── IFC T XML.cs │ │ ├── IFC U XML.cs │ │ ├── IFC V XML.cs │ │ ├── IFC W XML.cs │ │ ├── IFC X XML.cs │ │ ├── IFC Y XML.cs │ │ └── IFC Z XML.cs ├── MVD │ └── MVD.cs └── STEP │ ├── BaseClassSTEP.cs │ ├── CollectionsSTEP.cs │ ├── DatabaseSTEP.cs │ └── ParserSTEP.cs ├── DLL Projects ├── GeometryGymIFC.sln ├── GeometryGymIFC │ ├── GeometryGymIFC.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── GeometryGymIFCRhinoCommonx64 │ ├── GeometryGymIFCRhinoCommonx64.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config └── GeometryGymIFCcore │ └── GeometryGymIFCcore.csproj ├── Extensions ├── Drawing │ └── System │ │ ├── IFC C System.Drawing.cs │ │ ├── IFC N System.Drawing.cs │ │ ├── IFC P System.Drawing.cs │ │ └── IFC S System.Drawing.cs └── RhinoCommon IFC │ ├── IFC A RhinoCommon.cs │ ├── IFC B RhinoCommon.cs │ ├── IFC C RhinoCommon.cs │ ├── IFC D RhinoCommon.cs │ ├── IFC E RhinoCommon.cs │ ├── IFC F RhinoCommon.cs │ ├── IFC G RhinoCommon.cs │ ├── IFC H RhinoCommon.cs │ ├── IFC I RhinoCommon.cs │ ├── IFC L RhinoCommon.cs │ ├── IFC M RhinoCommon.cs │ ├── IFC O RhinoCommon.cs │ ├── IFC P RhinoCommon.cs │ ├── IFC R RhinoCommon.cs │ ├── IFC S RhinoCommon.cs │ ├── IFC T RhinoCommon.cs │ ├── IFC U RhinoCommon.cs │ ├── IFC V RhinoCommon.cs │ ├── IFC W RhinoCommon.cs │ └── IFC Z RhinoCommon.cs ├── GettingStarted.md ├── LICENSE └── README.md /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Code files 5 | [*.cs] 6 | indent_style = tab 7 | indent_size = 4 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | .DS_Store 10 | 11 | # Build results 12 | [Dd]ebug/ 13 | [Dd]ebugPublic/ 14 | [Rr]elease/ 15 | [Rr]eleases/ 16 | x64/ 17 | x86/ 18 | build/ 19 | bld/ 20 | [Bb]in/ 21 | [Oo]bj/ 22 | .vs/ 23 | 24 | # Roslyn cache directories 25 | *.ide 26 | 27 | # MSTest test Results 28 | [Tt]est[Rr]esult*/ 29 | [Bb]uild[Ll]og.* 30 | 31 | #NUNIT 32 | *.VisualState.xml 33 | TestResult.xml 34 | 35 | # Build Results of an ATL Project 36 | [Dd]ebugPS/ 37 | [Rr]eleasePS/ 38 | dlldata.c 39 | 40 | *_i.c 41 | *_p.c 42 | *_i.h 43 | *.ilk 44 | *.meta 45 | *.obj 46 | *.pch 47 | *.pdb 48 | *.mdb 49 | *.pgc 50 | *.pgd 51 | *.rsp 52 | *.sbr 53 | *.tlb 54 | *.tli 55 | *.tlh 56 | *.tmp 57 | *.tmp_proj 58 | *.log 59 | *.vspscc 60 | *.vssscc 61 | .builds 62 | *.pidb 63 | *.svclog 64 | *.scc 65 | 66 | # Chutzpah Test files 67 | _Chutzpah* 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | *.cachefile 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | *.vspx 81 | 82 | # TFS 2012 Local Workspace 83 | $tf/ 84 | 85 | # Guidance Automation Toolkit 86 | *.gpState 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper*/ 90 | *.[Rr]e[Ss]harper 91 | *.DotSettings.user 92 | 93 | # JustCode is a .NET coding addin-in 94 | .JustCode 95 | 96 | # TeamCity is a build add-in 97 | _TeamCity* 98 | 99 | # DotCover is a Code Coverage Tool 100 | *.dotCover 101 | 102 | # NCrunch 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | # TODO: Comment the next line if you want to checkin your web deploy settings 133 | # but database connection strings (with potential passwords) will be unencrypted 134 | *.pubxml 135 | *.publishproj 136 | 137 | # NuGet Packages 138 | *.nupkg 139 | # The packages folder can be ignored because of Package Restore 140 | **/packages/* 141 | # except build/, which is used as an MSBuild target. 142 | !**/packages/build/ 143 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 144 | #!**/packages/repositories.config 145 | 146 | # Windows Azure Build Output 147 | csx/ 148 | *.build.csdef 149 | 150 | # Windows Store app package directory 151 | AppPackages/ 152 | 153 | # Others 154 | sql/ 155 | *.Cache 156 | ClientBin/ 157 | [Ss]tyle[Cc]op.* 158 | ~$* 159 | *~ 160 | *.dbmdl 161 | *.dbproj.schemaview 162 | *.pfx 163 | *.publishsettings 164 | node_modules/ 165 | *.msi 166 | 167 | # RIA/Silverlight projects 168 | Generated_Code/ 169 | 170 | # Backup & report files from converting an old project file 171 | # to a newer Visual Studio version. Backup files are not needed, 172 | # because we have git ;-) 173 | _UpgradeReport_Files/ 174 | Backup*/ 175 | UpgradeLog*.XML 176 | UpgradeLog*.htm 177 | 178 | # SQL Server files 179 | *.mdf 180 | *.ldf 181 | 182 | # Business Intelligence projects 183 | *.rdl.data 184 | *.bim.layout 185 | *.bim_*.settings 186 | 187 | # Microsoft Fakes 188 | FakesAssemblies/ 189 | 190 | # Rhino 191 | *.rui_bak 192 | -------------------------------------------------------------------------------- /Core/IFC/DefinedTypes.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | 21 | namespace GeometryGym.Ifc 22 | { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Core/IFC/IFC J.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections.Specialized; 22 | using System.Reflection; 23 | using System.Linq; 24 | using GeometryGym.STEP; 25 | 26 | namespace GeometryGym.Ifc 27 | { 28 | [Serializable] 29 | public partial class IfcJunctionBox : IfcFlowFitting //IFC4 30 | { 31 | private IfcJunctionBoxTypeEnum mPredefinedType = IfcJunctionBoxTypeEnum.NOTDEFINED;// OPTIONAL : IfcJunctionBoxTypeEnum; 32 | public IfcJunctionBoxTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = validPredefinedType(value, mDatabase == null ? ReleaseVersion.IFC4X3 : mDatabase.Release); } } 33 | 34 | internal IfcJunctionBox() : base() { } 35 | internal IfcJunctionBox(DatabaseIfc db, IfcJunctionBox b, DuplicateOptions options) : base(db, b, options) { PredefinedType = b.PredefinedType; } 36 | public IfcJunctionBox(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation, IfcDistributionSystem system) : base(host, placement, representation, system) { } 37 | } 38 | [Serializable] 39 | public partial class IfcJunctionBoxType : IfcFlowFittingType 40 | { 41 | private IfcJunctionBoxTypeEnum mPredefinedType = IfcJunctionBoxTypeEnum.NOTDEFINED;// : IfcJunctionBoxTypeEnum; 42 | public IfcJunctionBoxTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = validPredefinedType(value, mDatabase == null ? ReleaseVersion.IFC4X3 : mDatabase.Release); } } 43 | 44 | internal IfcJunctionBoxType() : base() { } 45 | internal IfcJunctionBoxType(DatabaseIfc db, IfcJunctionBoxType t, DuplicateOptions options) : base(db, t, options) { PredefinedType = t.PredefinedType; } 46 | public IfcJunctionBoxType(DatabaseIfc db, string name, IfcJunctionBoxTypeEnum type) : base(db) { Name = name; PredefinedType = type; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Core/IFC/IFC K.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections.Specialized; 22 | using System.Reflection; 23 | using System.Linq; 24 | using GeometryGym.STEP; 25 | 26 | namespace GeometryGym.Ifc 27 | { 28 | [Serializable, VersionAdded(ReleaseVersion.IFC4X3)] 29 | public partial class IfcKerb : IfcBuiltElement 30 | { 31 | private IfcKerbTypeEnum mPredefinedType = IfcKerbTypeEnum.NOTDEFINED;// OPTIONAL : IfcKerbTypeEnum; 32 | public IfcKerbTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = validPredefinedType(value, mDatabase == null ? ReleaseVersion.IFC4X3 : mDatabase.Release); } } 33 | 34 | public IfcKerb() : base() { } 35 | public IfcKerb(DatabaseIfc db) : base(db) { ; } 36 | public IfcKerb(DatabaseIfc db, IfcKerb kerb, DuplicateOptions options) : base(db, kerb, options) { PredefinedType = kerb.PredefinedType; } 37 | public IfcKerb(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation) { } 38 | } 39 | [Serializable, VersionAdded(ReleaseVersion.IFC4X3)] 40 | public partial class IfcKerbType : IfcBuiltElementType 41 | { 42 | private IfcKerbTypeEnum mPredefinedType = IfcKerbTypeEnum.NOTDEFINED;// : IfcKerbTypeEnum; 43 | public IfcKerbTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = validPredefinedType(value, mDatabase == null ? ReleaseVersion.IFC4X3 : mDatabase.Release); } } 44 | 45 | public IfcKerbType() : base() { } 46 | public IfcKerbType(DatabaseIfc db, IfcKerbType kerbType, DuplicateOptions options) : base(db, kerbType, options) { PredefinedType = kerbType.PredefinedType; } 47 | public IfcKerbType(DatabaseIfc db, string name, IfcKerbTypeEnum type) 48 | : base(db, name) { PredefinedType = type; } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Core/IFC/IFC N.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections.Specialized; 22 | using System.Reflection; 23 | using System.Linq; 24 | using GeometryGym.STEP; 25 | 26 | namespace GeometryGym.Ifc 27 | { 28 | [Serializable] 29 | public abstract partial class IfcNamedUnit : BaseClassIfc, IfcUnit //ABSTRACT SUPERTYPE OF (ONEOF(IfcContextDependentUnit,IfcConversionBasedUnit,IfcSIUnit)); 30 | { 31 | internal IfcDimensionalExponents mDimensions = null;// : IfcDimensionalExponents; 32 | private IfcUnitEnum mUnitType;// : IfcUnitEnum 33 | 34 | public IfcDimensionalExponents Dimensions { get { return mDimensions as IfcDimensionalExponents; } set { mDimensions = value; } } 35 | public IfcUnitEnum UnitType { get { return mUnitType; } set { mUnitType = value; } } 36 | 37 | protected IfcNamedUnit() : base() { } 38 | protected IfcNamedUnit(DatabaseIfc db, IfcNamedUnit u, DuplicateOptions options) : base(db, u) { if (u.mDimensions != null) Dimensions = db.Factory.Duplicate(u.Dimensions, options); mUnitType = u.mUnitType; } 39 | protected IfcNamedUnit(DatabaseIfc db, IfcUnitEnum unitEnum, bool gendims) : base(db) 40 | { 41 | mUnitType = unitEnum; 42 | if (gendims) 43 | { 44 | if (unitEnum == IfcUnitEnum.LENGTHUNIT) 45 | Dimensions = new IfcDimensionalExponents(db, 1, 0, 0, 0, 0, 0, 0); 46 | else if (unitEnum == IfcUnitEnum.AREAUNIT) 47 | Dimensions = new IfcDimensionalExponents(db, 2, 0, 0, 0, 0, 0, 0); 48 | else if (unitEnum == IfcUnitEnum.VOLUMEUNIT) 49 | Dimensions = new IfcDimensionalExponents(db, 3, 0, 0, 0, 0, 0, 0); 50 | else if (unitEnum == IfcUnitEnum.MASSUNIT) 51 | Dimensions = new IfcDimensionalExponents(db, 0, 1, 0, 0, 0, 0, 0); 52 | else if (unitEnum == IfcUnitEnum.TIMEUNIT) 53 | Dimensions = new IfcDimensionalExponents(db, 0, 0, 1, 0, 0, 0, 0); 54 | else if (unitEnum == IfcUnitEnum.ELECTRICCURRENTUNIT) 55 | Dimensions = new IfcDimensionalExponents(db, 0, 0, 0, 1, 0, 0, 0); 56 | else if (unitEnum == IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT) 57 | Dimensions = new IfcDimensionalExponents(db, 0, 0, 0, 0, 1, 0, 0); 58 | else if (unitEnum == IfcUnitEnum.AMOUNTOFSUBSTANCEUNIT) 59 | Dimensions = new IfcDimensionalExponents(db, 0, 0, 0, 0, 0, 1, 0); 60 | else if (unitEnum == IfcUnitEnum.LUMINOUSINTENSITYUNIT) 61 | Dimensions = new IfcDimensionalExponents(db, 0, 0, 0, 0, 0, 0, 1); 62 | else if (unitEnum == IfcUnitEnum.PLANEANGLEUNIT) 63 | Dimensions = new IfcDimensionalExponents(db, 0, 0, 0, 0, 0, 0, 0); 64 | } 65 | } 66 | public IfcNamedUnit(IfcDimensionalExponents dimensions, IfcUnitEnum unitType) 67 | : base(dimensions.Database) { Dimensions = dimensions; UnitType = unitType; } 68 | 69 | public abstract double SIFactor(); 70 | } 71 | [Serializable] 72 | public partial class IfcNavigationElement : IfcBuiltElement 73 | { 74 | private IfcNavigationElementTypeEnum mPredefinedType = IfcNavigationElementTypeEnum.NOTDEFINED; //: OPTIONAL IfcNavigationElementTypeEnum; 75 | public IfcNavigationElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = validPredefinedType(value, mDatabase == null ? ReleaseVersion.IFC4X3 : mDatabase.Release); } } 76 | 77 | public IfcNavigationElement() : base() { } 78 | public IfcNavigationElement(DatabaseIfc db) : base(db) { } 79 | public IfcNavigationElement(DatabaseIfc db, IfcNavigationElement navigationElement, DuplicateOptions options) : base(db, navigationElement, options) { PredefinedType = navigationElement.PredefinedType; } 80 | public IfcNavigationElement(IfcObjectDefinition host, IfcObjectPlacement placement, IfcProductDefinitionShape representation) : base(host, placement, representation) { } 81 | } 82 | [Serializable] 83 | public partial class IfcNavigationElementType : IfcBuiltElementType 84 | { 85 | private IfcNavigationElementTypeEnum mPredefinedType = IfcNavigationElementTypeEnum.NOTDEFINED; //: IfcNavigationElementTypeEnum; 86 | public IfcNavigationElementTypeEnum PredefinedType { get { return mPredefinedType; } set { mPredefinedType = validPredefinedType(value, mDatabase == null ? ReleaseVersion.IFC4X3 : mDatabase.Release); } } 87 | 88 | public IfcNavigationElementType() : base() { } 89 | public IfcNavigationElementType(DatabaseIfc db, IfcNavigationElementType navigationElementType, DuplicateOptions options) : base(db, navigationElementType, options) { PredefinedType = navigationElementType.PredefinedType; } 90 | public IfcNavigationElementType(DatabaseIfc db, string name, IfcNavigationElementTypeEnum predefinedType) 91 | : base(db, name) { PredefinedType = predefinedType; } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Core/IFC/IFC V.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeometryGym/GeometryGymIFC/ab0a422ab1173a3a1482e1ed5db67e1dbfad0e6d/Core/IFC/IFC V.cs -------------------------------------------------------------------------------- /Core/IFC/IFC X.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections.Specialized; 22 | using System.Reflection; 23 | using System.Linq; 24 | using GeometryGym.STEP; 25 | 26 | namespace GeometryGym.Ifc 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Core/IFC/IFC Y.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections.Specialized; 22 | using System.Reflection; 23 | using System.Linq; 24 | using GeometryGym.STEP; 25 | 26 | namespace GeometryGym.Ifc 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Core/IFC/IFC Z.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections.Specialized; 22 | using System.Reflection; 23 | using System.Linq; 24 | using GeometryGym.STEP; 25 | 26 | namespace GeometryGym.Ifc 27 | { 28 | [Serializable] 29 | public partial class IfcZone : IfcSystem 30 | { 31 | internal string mLongName = "";// : OPTIONAL IfcLabel; IFC4 32 | public string LongName { get { return mLongName; } set { mLongName = value; } } 33 | 34 | internal IfcZone() : base() { } 35 | internal IfcZone(DatabaseIfc db, IfcZone z, DuplicateOptions options) : base(db, z, options) { mLongName = z.mLongName; } 36 | internal IfcZone(DatabaseIfc db, string name) : base(db, name) { } 37 | public IfcZone(IfcSpatialElement e, string name, List spaces) : base(e, name) 38 | { 39 | if (spaces != null && spaces.Count > 0) 40 | { 41 | new IfcRelAssignsToGroup(spaces, this); 42 | } 43 | } 44 | } 45 | [Serializable] 46 | public partial class IfcZShapeProfileDef : IfcParameterizedProfileDef 47 | { 48 | internal double mDepth;// : IfcPositiveLengthMeasure; 49 | internal double mFlangeWidth;// : IfcPositiveLengthMeasure; 50 | internal double mWebThickness;// : IfcPositiveLengthMeasure; 51 | internal double mFlangeThickness;// : IfcPositiveLengthMeasure; 52 | internal double mFilletRadius = double.NaN;// : OPTIONAL IfcPositiveLengthMeasure; 53 | internal double mEdgeRadius = double.NaN;// : OPTIONAL IfcPositiveLengthMeasure; 54 | 55 | public double Depth { get { return mDepth; } set { mDepth = value; } } 56 | public double FlangeWidth { get { return mFlangeWidth; } set { mFlangeWidth = value; } } 57 | public double WebThickness { get { return mWebThickness; } set { mWebThickness = value; } } 58 | public double FlangeThickness { get { return mFlangeThickness; } set { mFlangeThickness = value; } } 59 | public double FilletRadius { get { return mFilletRadius; } set { mFilletRadius = (value < mDatabase.Tolerance ? double.NaN : value); } } 60 | public double EdgeRadius { get { return mEdgeRadius; } set { mEdgeRadius = (value < mDatabase.Tolerance ? double.NaN : value); } } 61 | 62 | internal IfcZShapeProfileDef() : base() { } 63 | internal IfcZShapeProfileDef(DatabaseIfc db, IfcZShapeProfileDef p, DuplicateOptions options) : base(db, p, options) { mDepth = p.mDepth; mFlangeWidth = p.mFlangeWidth; mWebThickness = p.mWebThickness; mFlangeThickness = p.mFlangeThickness; mFilletRadius = p.mFilletRadius; mEdgeRadius = p.mEdgeRadius; } 64 | public IfcZShapeProfileDef(DatabaseIfc db, string name, double depth, double flangeWidth, double webThickness, double flangeThickness) : base(db, name) { mDepth = depth; mFlangeWidth = flangeWidth; mWebThickness = webThickness; mFlangeThickness = flangeThickness; } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC F JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcFace 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | Bounds.AddRange(mDatabase.extractJsonArray(obj["Bounds"] as JsonArray)); 46 | } 47 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 48 | { 49 | base.setJSON(obj, host, options); 50 | createArray(obj, "Bounds", Bounds, this, options); 51 | } 52 | } 53 | public partial class IfcFaceBasedSurfaceModel 54 | { 55 | internal override void parseJsonObject(JsonObject obj) 56 | { 57 | base.parseJsonObject(obj); 58 | FbsmFaces.AddRange(mDatabase.extractJsonArray(obj["FbsmFaces"] as JsonArray)); 59 | } 60 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 61 | { 62 | base.setJSON(obj, host, options); 63 | createArray(obj, "FbsmFaces", FbsmFaces, this, options); 64 | } 65 | } 66 | public partial class IfcFaceBound 67 | { 68 | internal override void parseJsonObject(JsonObject obj) 69 | { 70 | base.parseJsonObject(obj); 71 | JsonObject jobj = obj["Bound"] as JsonObject; 72 | if (jobj != null) 73 | Bound = extractObject(jobj); 74 | var node = obj["Orientation"]; 75 | if (node != null) 76 | Orientation = node.GetValue(); 77 | } 78 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 79 | { 80 | base.setJSON(obj, host, options); 81 | obj["Bound"] = Bound.getJson(this, options); 82 | obj["Orientation"] = Orientation; 83 | } 84 | } 85 | public partial class IfcFaceSurface 86 | { 87 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 88 | { 89 | base.setJSON(obj, host, options); 90 | obj["FaceSurface"] = FaceSurface.getJson(this, options); 91 | obj["SameSense"] = SameSense; 92 | } 93 | } 94 | public partial class IfcFillAreaStyle 95 | { 96 | internal override void parseJsonObject(JsonObject obj) 97 | { 98 | base.parseJsonObject(obj); 99 | var node = obj["ModelorDraughting"]; 100 | if (node != null) 101 | bool.TryParse(node.GetValue(), out mModelorDraughting); 102 | FillStyles.AddRange(mDatabase.extractJsonArray(obj["FillStyles"] as JsonArray)); 103 | } 104 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 105 | { 106 | base.setJSON(obj, host, options); 107 | if(mDatabase.Release > ReleaseVersion.IFC2x3) 108 | obj["ModelorDraughting"] = mModelorDraughting.ToString(); 109 | createArray(obj, "FillStyles", FillStyles, this, options); 110 | } 111 | } 112 | public partial class IfcFurniture 113 | { 114 | internal override void parseJsonObject(JsonObject obj) 115 | { 116 | base.parseJsonObject(obj); 117 | var node = obj["PredefinedType"]; 118 | if (node != null) 119 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 120 | } 121 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 122 | { 123 | base.setJSON(obj, host, options); 124 | if (mPredefinedType != IfcFurnitureTypeEnum.NOTDEFINED) 125 | obj["PredefinedType"] = mPredefinedType.ToString(); 126 | } 127 | } 128 | public partial class IfcFurnitureType 129 | { 130 | internal override void parseJsonObject(JsonObject obj) 131 | { 132 | base.parseJsonObject(obj); 133 | var node = obj["PredefinedType"]; 134 | if (node != null) 135 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 136 | } 137 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 138 | { 139 | base.setJSON(obj, host, options); 140 | if (mPredefinedType != IfcFurnitureTypeEnum.NOTDEFINED) 141 | obj["PredefinedType"] = mPredefinedType.ToString(); 142 | } 143 | } 144 | } 145 | #endif 146 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC H JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcHalfSpaceSolid 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | JsonObject jobj = obj["BaseSurface"] as JsonObject; 46 | if (jobj != null) 47 | BaseSurface = mDatabase.ParseJsonObject(jobj); 48 | mAgreementFlag = extractBool(obj["AgreementFlag"]); 49 | } 50 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 51 | { 52 | base.setJSON(obj, host, options); 53 | obj["BaseSurface"] = BaseSurface.getJson(this, options); 54 | obj["AgreementFlag"] = mAgreementFlag; 55 | } 56 | } 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC I JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcIndexedPolyCurve 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | JsonObject jobj = obj["Points"] as JsonObject; 46 | if (jobj != null) 47 | Points = mDatabase.ParseJsonObject(jobj); 48 | JsonArray array = obj["Segments"] as JsonArray; 49 | if (array != null) 50 | { 51 | foreach (var token in array) 52 | { 53 | JsonObject ob = token as JsonObject; 54 | if (ob != null) 55 | { 56 | var jtoken = ob["IfcLineIndex"]; 57 | if (jtoken != null) 58 | mSegments.Add(new IfcLineIndex(jtoken.GetValue().Split(' ').Select(x => int.Parse(x)))); 59 | else 60 | { 61 | jtoken = ob["IfcArcIndex"]; 62 | if (jtoken != null) 63 | { 64 | List tokens = jtoken.GetValue().Split(' ').Select(x => int.Parse(x)).ToList(); 65 | mSegments.Add(new IfcArcIndex(tokens[0], tokens[1], tokens[2])); 66 | } 67 | } 68 | } 69 | } 70 | } 71 | var node = obj["SelfIntersect"]; 72 | if (node != null) 73 | Enum.TryParse(node.GetValue(), true, out mSelfIntersect); 74 | } 75 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 76 | { 77 | base.setJSON(obj, host, options); 78 | obj["Points"] = Points.getJson(this, options); 79 | if (mSegments.Count > 0) 80 | { 81 | JsonArray array = new JsonArray(); 82 | obj["Segments"] = array; 83 | foreach (IfcSegmentIndexSelect seg in Segments) 84 | { 85 | IfcArcIndex ai = seg as IfcArcIndex; 86 | JsonObject jobj = new JsonObject(); 87 | if (ai != null) 88 | { 89 | jobj["IfcArcIndex"] = ai[0] + " " + ai[1] + " " + ai[2]; 90 | } 91 | else 92 | { 93 | IfcLineIndex li = seg as IfcLineIndex; 94 | jobj["IfcLineIndex"] = string.Join(" ", li.ConvertAll(x => x.ToString())); 95 | } 96 | array.Add(jobj); 97 | } 98 | } 99 | if (mSelfIntersect != IfcLogicalEnum.UNKNOWN) 100 | obj["SelfIntersect"] = mSelfIntersect.ToString(); 101 | } 102 | } 103 | 104 | public partial class IfcIShapeProfileDef 105 | { 106 | internal override void parseJsonObject(JsonObject obj) 107 | { 108 | base.parseJsonObject(obj); 109 | mOverallWidth = extractDouble(obj["OverallWidth"]); 110 | mOverallDepth = extractDouble(obj["OverallDepth"]); 111 | mWebThickness = extractDouble(obj["WebThickness"]); 112 | mFlangeThickness = extractDouble(obj["FlangeThickness"]); 113 | mFilletRadius = extractDouble(obj["FilletRadius"]); 114 | mFlangeEdgeRadius = extractDouble(obj["FlangeEdgeRadius"]); 115 | mFlangeSlope = extractDouble(obj["FlangeSlope"]); 116 | } 117 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 118 | { 119 | base.setJSON(obj, host, options); 120 | obj["OverallWidth"] = formatLength(mOverallWidth); 121 | obj["OverallDepth"] = formatLength(mOverallDepth); 122 | obj["WebThickness"] = formatLength(mWebThickness); 123 | obj["FlangeThickness"] = formatLength(mFlangeThickness); 124 | if (!double.IsNaN(mFilletRadius) && mFilletRadius > 0) 125 | obj["FilletRadius"] = formatLength(mFilletRadius); 126 | if (!double.IsNaN(mFlangeEdgeRadius) && mFlangeEdgeRadius > 0) 127 | obj["FlangeEdgeRadius"] = formatLength(mFlangeEdgeRadius); 128 | if (!double.IsNaN(mFlangeSlope) && mFlangeSlope > 0) 129 | obj["FlangeSlope"] = formatLength(mFlangeSlope); 130 | } 131 | } 132 | } 133 | #endif 134 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC J JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC K JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcKerb 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | var node = obj["PredefinedType"]; 46 | if (node != null) 47 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 48 | } 49 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 50 | { 51 | base.setJSON(obj, host, options); 52 | if (mPredefinedType != IfcKerbTypeEnum.NOTDEFINED) 53 | obj["PredefinedType"] = mPredefinedType.ToString(); 54 | } 55 | } 56 | public partial class IfcKerbType 57 | { 58 | internal override void parseJsonObject(JsonObject obj) 59 | { 60 | base.parseJsonObject(obj); 61 | var node = obj["PredefinedType"]; 62 | if (node != null) 63 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 64 | } 65 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 66 | { 67 | base.setJSON(obj, host, options); 68 | obj["PredefinedType"] = mPredefinedType.ToString(); 69 | } 70 | } 71 | } 72 | #endif 73 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC N JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | 27 | #if (NET || !NOIFCJSON) 28 | #if (NEWTONSOFT) 29 | using Newtonsoft.Json; 30 | using Newtonsoft.Json.Linq; 31 | using JsonObject = Newtonsoft.Json.Linq.JObject; 32 | using JsonArray = Newtonsoft.Json.Linq.JArray; 33 | #else 34 | using System.Text.Json.Nodes; 35 | #endif 36 | 37 | namespace GeometryGym.Ifc 38 | { 39 | public partial class IfcNamedUnit 40 | { 41 | internal override void parseJsonObject(JsonObject obj) 42 | { 43 | base.parseJsonObject(obj); 44 | 45 | JsonObject jobj = obj["Dimensions"] as JsonObject; 46 | if (jobj != null) 47 | Dimensions = mDatabase.ParseJsonObject(jobj); 48 | var node = obj["UnitType"]; 49 | if (node != null) 50 | Enum.TryParse(node.GetValue(), out mUnitType); 51 | } 52 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 53 | { 54 | base.setJSON(obj, host, options); 55 | IfcDimensionalExponents exponents = Dimensions; 56 | if(exponents != null) 57 | obj["Dimensions"] = exponents.getJson(this, options); 58 | obj["UnitType"] = mUnitType.ToString(); 59 | } 60 | } 61 | public partial class IfcNavigationElement 62 | { 63 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 64 | { 65 | base.setJSON(obj, host, options); 66 | if (mPredefinedType != IfcNavigationElementTypeEnum.NOTDEFINED) 67 | obj["PredefinedType"] = mPredefinedType.ToString(); 68 | } 69 | internal override void parseJsonObject(JsonObject obj) 70 | { 71 | base.parseJsonObject(obj); 72 | var node = obj["PredefinedType"]; 73 | if (node != null) 74 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 75 | } 76 | } 77 | public partial class IfcNavigationElementType 78 | { 79 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 80 | { 81 | base.setJSON(obj, host, options); 82 | obj["PredefinedType"] = mPredefinedType.ToString(); 83 | } 84 | internal override void parseJsonObject(JsonObject obj) 85 | { 86 | base.parseJsonObject(obj); 87 | var node = obj["PredefinedType"]; 88 | if (node != null) 89 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 90 | } 91 | } 92 | } 93 | #endif 94 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC Q JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcQuantityArea 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | AreaValue = extractDouble(obj["AreaValue"]); 46 | Formula = extractString( obj["Formula"]); 47 | } 48 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 49 | { 50 | base.setJSON(obj, host, options); 51 | obj["AreaValue"] = AreaValue; 52 | base.setAttribute(obj, "Formula", Formula); 53 | } 54 | 55 | } 56 | public partial class IfcQuantityCount 57 | { 58 | internal override void parseJsonObject(JsonObject obj) 59 | { 60 | base.parseJsonObject(obj); 61 | CountValueDouble = extractDouble(obj["CountValue"]); 62 | Formula = extractString(obj["Formula"]); 63 | } 64 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 65 | { 66 | base.setJSON(obj, host, options); 67 | obj["CountValue"] = CountValue; 68 | base.setAttribute(obj, "Formula", Formula); 69 | } 70 | 71 | } 72 | public partial class IfcQuantityLength 73 | { 74 | internal override void parseJsonObject(JsonObject obj) 75 | { 76 | base.parseJsonObject(obj); 77 | LengthValue = extractDouble(obj["LengthValue"]); 78 | Formula = extractString(obj["Formula"]); 79 | } 80 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 81 | { 82 | base.setJSON(obj, host, options); 83 | obj["LengthValue"] = LengthValue; 84 | base.setAttribute(obj, "Formula", Formula); 85 | } 86 | } 87 | public partial class IfcQuantityNumber 88 | { 89 | internal override void parseJsonObject(JsonObject obj) 90 | { 91 | base.parseJsonObject(obj); 92 | NumberValue = extractDouble(obj["NumberValue"]); 93 | Formula = extractString(obj["Formula"]); 94 | } 95 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 96 | { 97 | base.setJSON(obj, host, options); 98 | obj["NumberValue"] = NumberValue; 99 | base.setAttribute(obj, "Formula", Formula); 100 | } 101 | } 102 | public partial class IfcQuantityTime 103 | { 104 | internal override void parseJsonObject(JsonObject obj) 105 | { 106 | base.parseJsonObject(obj); 107 | TimeValue = extractDouble(obj["TimeValue"]); 108 | Formula = extractString(obj["Formula"]); 109 | } 110 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 111 | { 112 | base.setJSON(obj, host, options); 113 | obj["TimeValue"] = TimeValue; 114 | base.setAttribute(obj, "Formula", Formula); 115 | } 116 | 117 | } 118 | public partial class IfcQuantityVolume : IfcPhysicalSimpleQuantity 119 | { 120 | internal override void parseJsonObject(JsonObject obj) 121 | { 122 | base.parseJsonObject(obj); 123 | VolumeValue = extractDouble(obj["VolumeValue"]); 124 | Formula = extractString(obj["Formula"]); 125 | } 126 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 127 | { 128 | base.setJSON(obj, host, options); 129 | obj["VolumeValue"] = VolumeValue; 130 | base.setAttribute(obj, "Formula", Formula); 131 | } 132 | 133 | } 134 | public partial class IfcQuantityWeight 135 | { 136 | internal override void parseJsonObject(JsonObject obj) 137 | { 138 | base.parseJsonObject(obj); 139 | WeightValue = extractDouble(obj["WeightValue"]); 140 | Formula = extractString(obj["Formula"]); 141 | } 142 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 143 | { 144 | base.setJSON(obj, host, options); 145 | obj["WeightValue"] = WeightValue; 146 | base.setAttribute(obj, "Formula", Formula); 147 | } 148 | } 149 | } 150 | #endif 151 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC U JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | 27 | #if (NET || !NOIFCJSON) 28 | #if (NEWTONSOFT) 29 | using Newtonsoft.Json; 30 | using Newtonsoft.Json.Linq; 31 | using JsonObject = Newtonsoft.Json.Linq.JObject; 32 | using JsonArray = Newtonsoft.Json.Linq.JArray; 33 | #else 34 | using System.Text.Json.Nodes; 35 | #endif 36 | 37 | namespace GeometryGym.Ifc 38 | { 39 | public partial class IfcUnitaryEquipment 40 | { 41 | internal override void parseJsonObject(JsonObject obj) 42 | { 43 | base.parseJsonObject(obj); 44 | var node = obj["PredefinedType"]; 45 | if (node != null) 46 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 47 | } 48 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 49 | { 50 | base.setJSON(obj, host, options); 51 | if (mPredefinedType != IfcUnitaryEquipmentTypeEnum.NOTDEFINED) 52 | obj["PredefinedType"] = mPredefinedType.ToString(); 53 | } 54 | } 55 | public partial class IfcUnitaryEquipmentType 56 | { 57 | internal override void parseJsonObject(JsonObject obj) 58 | { 59 | base.parseJsonObject(obj); 60 | var node = obj["PredefinedType"]; 61 | if (node != null) 62 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 63 | } 64 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 65 | { 66 | base.setJSON(obj, host, options); 67 | if (mPredefinedType != IfcUnitaryEquipmentTypeEnum.NOTDEFINED) 68 | obj["PredefinedType"] = mPredefinedType.ToString(); 69 | } 70 | } 71 | public partial class IfcUnitAssignment 72 | { 73 | internal override void parseJsonObject(JsonObject obj) 74 | { 75 | base.parseJsonObject(obj); 76 | Units.AddRange(mDatabase.extractJsonArray(obj["Units"] as JsonArray)); 77 | } 78 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 79 | { 80 | base.setJSON(obj, host, options); 81 | JsonArray array = new JsonArray(); 82 | foreach (IfcUnit unit in mUnits) 83 | array.Add(mDatabase[unit.StepId].getJson(this, options)); 84 | obj["Units"] = array; 85 | } 86 | } 87 | public partial class IfcUShapeProfileDef 88 | { 89 | internal override void parseJsonObject(JsonObject obj) 90 | { 91 | base.parseJsonObject(obj); 92 | mDepth = extractDouble(obj["Depth"]); 93 | mFlangeWidth = extractDouble(obj["FlangeWidth"]); 94 | mWebThickness = extractDouble(obj["WebThickness"]); 95 | mFlangeThickness = extractDouble(obj["FlangeThickness"]); 96 | mFilletRadius = extractDouble(obj["FilletRadius"]); 97 | mEdgeRadius = extractDouble(obj["EdgeRadius"]); 98 | mFlangeSlope = extractDouble(obj["FlangeSlope"]); 99 | mCentreOfGravityInX = extractDouble(obj["mCentreOfGravityInX"]); 100 | } 101 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 102 | { 103 | base.setJSON(obj, host, options); 104 | obj["Depth"] = formatLength(mDepth); 105 | obj["FlangeWidth"] = formatLength(mFlangeWidth); 106 | obj["WebThickness"] = formatLength(mWebThickness); 107 | obj["FlangeThickness"] = formatLength(mFlangeThickness); 108 | if (!double.IsNaN(mFilletRadius)) 109 | obj["FilletRadius"] = formatLength(mFilletRadius); 110 | if (!double.IsNaN(mEdgeRadius)) 111 | obj["EdgeRadius"] = formatLength(mEdgeRadius); 112 | if (!double.IsNaN(mFlangeSlope)) 113 | obj["FlangeSlope"] = mFlangeSlope; 114 | if(options.Version < ReleaseVersion.IFC4 && !double.IsNaN(mCentreOfGravityInX)) 115 | obj["mCentreOfGravityInX"] = formatLength(mCentreOfGravityInX); 116 | } 117 | } 118 | } 119 | #endif 120 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC V JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | 27 | #if (NET || !NOIFCJSON) 28 | #if (NEWTONSOFT) 29 | using Newtonsoft.Json; 30 | using Newtonsoft.Json.Linq; 31 | using JsonObject = Newtonsoft.Json.Linq.JObject; 32 | using JsonArray = Newtonsoft.Json.Linq.JArray; 33 | #else 34 | using System.Text.Json.Nodes; 35 | #endif 36 | 37 | namespace GeometryGym.Ifc 38 | { 39 | public partial class IfcValue 40 | { 41 | public JsonObject getJson(BaseClassIfc host, BaseClassIfc.SetJsonOptions options) 42 | { 43 | return DatabaseIfc.extract(this); 44 | } 45 | } 46 | public partial class IfcValveType 47 | { 48 | internal override void parseJsonObject(JsonObject obj) 49 | { 50 | base.parseJsonObject(obj); 51 | var node = obj["PredefinedType"]; 52 | if (node != null) 53 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 54 | } 55 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 56 | { 57 | base.setJSON(obj, host, options); 58 | if (mPredefinedType != IfcValveTypeEnum.NOTDEFINED) 59 | obj["PredefinedType"] = mPredefinedType.ToString(); 60 | } 61 | } 62 | public partial class IfcVector 63 | { 64 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 65 | { 66 | base.setJSON(obj, host, options); 67 | obj["Orientation"] = Orientation.getJson(this, options); 68 | obj["Magnitude"] = Magnitude; 69 | } 70 | internal override void parseJsonObject(JsonObject obj) 71 | { 72 | base.parseJsonObject(obj); 73 | JsonObject jobj = obj["Pnt"] as JsonObject; 74 | if (jobj != null) 75 | Orientation = mDatabase.ParseJsonObject(jobj); 76 | var node = obj["Depth"]; 77 | if (node != null) 78 | mMagnitude = node.GetValue(); 79 | } 80 | } 81 | public partial class IfcVertexPoint 82 | { 83 | internal override void parseJsonObject(JsonObject obj) 84 | { 85 | base.parseJsonObject(obj); 86 | JsonObject rp = obj["VertexGeometry"] as JsonObject; 87 | if (rp != null) 88 | VertexGeometry = mDatabase.ParseJsonObject(rp); 89 | } 90 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 91 | { 92 | base.setJSON(obj, host, options); 93 | obj["VertexGeometry"] = VertexGeometry.getJson(this, options); 94 | } 95 | } 96 | } 97 | #endif 98 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC W JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcWallType 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | var node = obj["PredefinedType"]; 46 | if (node != null) 47 | Enum.TryParse(node.GetValue(), true, out mPredefinedType); 48 | } 49 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 50 | { 51 | base.setJSON(obj, host, options); 52 | if (mPredefinedType != IfcWallTypeEnum.NOTDEFINED) 53 | obj["PredefinedType"] = mPredefinedType.ToString(); 54 | } 55 | } 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /Core/IFC/JSON/IFC Z JSON.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using GeometryGym.STEP; 27 | 28 | #if (NET || !NOIFCJSON) 29 | #if (NEWTONSOFT) 30 | using Newtonsoft.Json; 31 | using Newtonsoft.Json.Linq; 32 | using JsonObject = Newtonsoft.Json.Linq.JObject; 33 | using JsonArray = Newtonsoft.Json.Linq.JArray; 34 | #else 35 | using System.Text.Json.Nodes; 36 | #endif 37 | 38 | namespace GeometryGym.Ifc 39 | { 40 | public partial class IfcZShapeProfileDef 41 | { 42 | internal override void parseJsonObject(JsonObject obj) 43 | { 44 | base.parseJsonObject(obj); 45 | mDepth = extractDouble(obj["Depth"]); 46 | mFlangeWidth = extractDouble(obj["FlangeWidth"]); 47 | mWebThickness = extractDouble(obj["WebThickness"]); 48 | mFlangeThickness = extractDouble(obj["FlangeThickness"]); 49 | mFilletRadius = extractDouble(obj["FilletRadius"]); 50 | mEdgeRadius = extractDouble(obj["EdgeRadius"]); 51 | } 52 | protected override void setJSON(JsonObject obj, BaseClassIfc host, SetJsonOptions options) 53 | { 54 | base.setJSON(obj, host, options); 55 | obj["Depth"] = formatLength(mDepth); 56 | obj["FlangeWidth"] = formatLength(mFlangeWidth); 57 | obj["WebThickness"] = formatLength(mWebThickness); 58 | obj["FlangeThickness"] = formatLength(mFlangeThickness); 59 | if (!double.IsNaN(mFilletRadius) && mFilletRadius > 0) 60 | obj["FilletRadius"] = formatLength(mFilletRadius); 61 | if (!double.IsNaN(mEdgeRadius) && mEdgeRadius > 0) 62 | obj["FlangeEdgeRadius"] = formatLength(mEdgeRadius); 63 | } 64 | } 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /Core/IFC/STEP/BaseClassIFC STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections; 21 | using System.Collections.Concurrent; 22 | using System.Collections.Generic; 23 | using System.Text; 24 | using System.Reflection; 25 | using System.IO; 26 | using System.ComponentModel; 27 | 28 | using GeometryGym.STEP; 29 | 30 | namespace GeometryGym.Ifc 31 | { 32 | public partial class BaseClassIfc : STEPEntity, IBaseClassIfc 33 | { 34 | internal abstract void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary); 35 | protected override string BuildStringSTEP() 36 | { 37 | return BuildStringSTEP(mDatabase == null ? ReleaseVersion.IFC4A2 : mDatabase.Release); 38 | } 39 | protected abstract string BuildStringSTEP(ReleaseVersion release); 40 | 41 | protected string StepOptionalLengthString(double length) 42 | { 43 | if (double.IsNaN(length) || double.IsInfinity(length)) 44 | return "$"; 45 | return formatLength(length); 46 | } 47 | 48 | public string StringSTEP(ReleaseVersion release) 49 | { 50 | string str = BuildStringSTEP(release); 51 | if (string.IsNullOrEmpty(str)) 52 | return ""; 53 | return StepLinePrefix() + str + StepLineSuffix(); 54 | } 55 | 56 | internal virtual void WriteStepLine(TextWriter textWriter, ReleaseVersion release) 57 | { 58 | try 59 | { 60 | string str = StringSTEP(release); 61 | if (!string.IsNullOrEmpty(str)) 62 | textWriter.WriteLine(str); 63 | } 64 | catch (Exception) { } 65 | } 66 | } 67 | public partial class StiffnessSelect 68 | { 69 | public override string ToString() { return (mStiffness == null ? "IFCBOOLEAN(" + ParserSTEP.BoolToString(mRigid) + ")" : mStiffness.ToString()); } 70 | protected void ParseValue(string str, ReleaseVersion version) 71 | { 72 | if (str.StartsWith("IFCBOOL")) 73 | mRigid = ((IfcBoolean)ParserIfc.parseSimpleValue(str)).Boolean; 74 | else if (str.StartsWith("IFC")) 75 | mStiffness = ((T)ParserIfc.parseDerivedMeasureValue(str)); 76 | else if (str.StartsWith(".")) 77 | mRigid = ParserSTEP.ParseBool(str); 78 | else 79 | { 80 | double d = ParserSTEP.ParseDouble(str), tol = 1e-9; 81 | if (!double.IsNaN(d)) 82 | { 83 | if (version < ReleaseVersion.IFC4) 84 | { 85 | if (Math.Abs(d + 1) < tol) 86 | { 87 | mStiffness = new T(); 88 | mStiffness.Measure = -1; 89 | mRigid = true; 90 | } 91 | else if (Math.Abs(d) < tol) 92 | { 93 | mStiffness = new T(); 94 | mStiffness.Measure = 0; 95 | mRigid = false; 96 | } 97 | } 98 | else 99 | { 100 | mStiffness = new T(); 101 | mStiffness.Measure = d; 102 | } 103 | } 104 | } 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC H STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using GeometryGym.STEP; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public partial class IfcHalfSpaceSolid 32 | { 33 | protected override string BuildStringSTEP(ReleaseVersion release) { return "#" + mBaseSurface.StepId + "," + ParserSTEP.BoolToString(mAgreementFlag); } 34 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 35 | { 36 | mBaseSurface = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcSurface; 37 | mAgreementFlag = ParserSTEP.StripBool(str, ref pos, len); 38 | } 39 | } 40 | public partial class IfcHeatExchanger 41 | { 42 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? "" : (mPredefinedType == IfcHeatExchangerTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } 43 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 44 | { 45 | base.parse(str, ref pos, release, len, dictionary); 46 | string s = ParserSTEP.StripField(str, ref pos, len); 47 | if (s.StartsWith(".")) 48 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 49 | } 50 | } 51 | public partial class IfcHeatExchangerType 52 | { 53 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; } 54 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 55 | { 56 | base.parse(str, ref pos, release, len, dictionary); 57 | string s = ParserSTEP.StripField(str, ref pos, len); 58 | if (s.StartsWith(".")) 59 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 60 | } 61 | } 62 | public partial class IfcHumidifier 63 | { 64 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? "" : (mPredefinedType == IfcHumidifierTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } 65 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 66 | { 67 | base.parse(str, ref pos, release, len, dictionary); 68 | string s = ParserSTEP.StripField(str, ref pos, len); 69 | if (s.StartsWith(".")) 70 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 71 | } 72 | } 73 | public partial class IfcHumidifierType 74 | { 75 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; } 76 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 77 | { 78 | base.parse(str, ref pos, release, len, dictionary); 79 | string s = ParserSTEP.StripField(str, ref pos, len); 80 | if (s.StartsWith(".")) 81 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 82 | } 83 | } 84 | public partial class IfcHygroscopicMaterialProperties 85 | { 86 | protected override string BuildStringSTEP(ReleaseVersion release) 87 | { 88 | return base.BuildStringSTEP(release) + "," + ParserSTEP.DoubleOptionalToString(mUpperVaporResistanceFactor) + "," + 89 | ParserSTEP.DoubleOptionalToString(mLowerVaporResistanceFactor) + "," + ParserSTEP.DoubleOptionalToString(mIsothermalMoistureCapacity) + "," + 90 | ParserSTEP.DoubleOptionalToString(mVaporPermeability) + "," + ParserSTEP.DoubleOptionalToString(mMoistureDiffusivity); 91 | } 92 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 93 | { 94 | base.parse(str, ref pos, release, len, dictionary); 95 | mUpperVaporResistanceFactor = ParserSTEP.StripDouble(str, ref pos, len); 96 | mLowerVaporResistanceFactor = ParserSTEP.StripDouble(str, ref pos, len); 97 | mIsothermalMoistureCapacity = ParserSTEP.StripDouble(str, ref pos, len); 98 | mVaporPermeability = ParserSTEP.StripDouble(str, ref pos, len); 99 | mMoistureDiffusivity = ParserSTEP.StripDouble(str, ref pos, len); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC J STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using GeometryGym.STEP; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public partial class IfcJunctionBox 32 | { 33 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? "" : (mPredefinedType == IfcJunctionBoxTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } 34 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 35 | { 36 | base.parse(str, ref pos, release, len, dictionary); 37 | string s = ParserSTEP.StripField(str, ref pos, len); 38 | if (s.StartsWith(".")) 39 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 40 | } 41 | } 42 | public partial class IfcJunctionBoxType 43 | { 44 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; } 45 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 46 | { 47 | base.parse(str, ref pos, release, len, dictionary); 48 | string s = ParserSTEP.StripField(str, ref pos, len); 49 | if (s.StartsWith(".")) 50 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC K STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using GeometryGym.STEP; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public partial class IfcKerb 32 | { 33 | protected override string BuildStringSTEP(ReleaseVersion release) 34 | { 35 | return base.BuildStringSTEP(release) + (mPredefinedType == IfcKerbTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + "."); 36 | } 37 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 38 | { 39 | base.parse(str, ref pos, release, len, dictionary); 40 | string s = ParserSTEP.StripField(str, ref pos, len); 41 | if (s.StartsWith(".")) 42 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 43 | } 44 | } 45 | public partial class IfcKerbType 46 | { 47 | protected override string BuildStringSTEP(ReleaseVersion release) 48 | { 49 | return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; ; 50 | } 51 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 52 | { 53 | base.parse(str, ref pos, release, len, dictionary); 54 | string s = ParserSTEP.StripField(str, ref pos, len); 55 | if (s.StartsWith(".")) 56 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC N STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using GeometryGym.STEP; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public abstract partial class IfcNamedUnit 32 | { 33 | protected override string BuildStringSTEP(ReleaseVersion release) { return (mDimensions == null ? "*" : "#" + mDimensions.StepId) + ",." + mUnitType.ToString() + "."; } 34 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 35 | { 36 | mDimensions = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcDimensionalExponents; 37 | Enum.TryParse(ParserSTEP.StripField(str, ref pos, len).Replace(".", ""), true, out mUnitType); 38 | } 39 | } 40 | public partial class IfcNavigationElement 41 | { 42 | protected override string BuildStringSTEP(ReleaseVersion release) 43 | { 44 | return base.BuildStringSTEP(release) + (mPredefinedType == IfcNavigationElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + "."); 45 | } 46 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 47 | { 48 | base.parse(str, ref pos, release, len, dictionary); 49 | string s = ParserSTEP.StripField(str, ref pos, len); 50 | if (s.StartsWith(".")) 51 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 52 | } 53 | } 54 | public partial class IfcNavigationElementType 55 | { 56 | protected override string BuildStringSTEP(ReleaseVersion release) 57 | { 58 | return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; 59 | } 60 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 61 | { 62 | base.parse(str, ref pos, release, len, dictionary); 63 | string s = ParserSTEP.StripField(str, ref pos, len); 64 | if (s.StartsWith(".")) 65 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC U STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Collections.ObjectModel; 23 | using System.Text; 24 | using System.Reflection; 25 | using System.IO; 26 | using System.ComponentModel; 27 | using System.Linq; 28 | using GeometryGym.STEP; 29 | 30 | namespace GeometryGym.Ifc 31 | { 32 | public partial class IfcUndergroundExcavation 33 | { 34 | protected override string BuildStringSTEP(ReleaseVersion release) 35 | { 36 | return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; 37 | } 38 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 39 | { 40 | base.parse(str, ref pos, release, len, dictionary); 41 | string s = ParserSTEP.StripField(str, ref pos, len); 42 | if (s.StartsWith(".")) 43 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 44 | } 45 | } 46 | public partial class IfcUnitaryControlElement 47 | { 48 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? "" : (mPredefinedType == IfcUnitaryControlElementTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } 49 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 50 | { 51 | base.parse(str, ref pos, release, len, dictionary); 52 | string s = ParserSTEP.StripField(str, ref pos, len); 53 | if (s.StartsWith(".")) 54 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 55 | } 56 | } 57 | public partial class IfcUnitaryControlElementType 58 | { 59 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; } 60 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 61 | { 62 | base.parse(str, ref pos, release, len, dictionary); 63 | string s = ParserSTEP.StripField(str, ref pos, len); 64 | if (s.StartsWith(".")) 65 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 66 | } 67 | } 68 | public partial class IfcUnitaryEquipment 69 | { 70 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? "" : (mPredefinedType == IfcUnitaryEquipmentTypeEnum.NOTDEFINED ? ",$" : ",." + mPredefinedType.ToString() + ".")); } 71 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 72 | { 73 | base.parse(str, ref pos, release, len, dictionary); 74 | string s = ParserSTEP.StripField(str, ref pos, len); 75 | if (s.StartsWith(".")) 76 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 77 | } 78 | } 79 | public partial class IfcUnitaryEquipmentType 80 | { 81 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + "."; } 82 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 83 | { 84 | base.parse(str, ref pos, release, len, dictionary); 85 | string s = ParserSTEP.StripField(str, ref pos, len); 86 | if (s.StartsWith(".")) 87 | Enum.TryParse(s.Replace(".", ""), true, out mPredefinedType); 88 | } 89 | } 90 | public partial class IfcUnitAssignment 91 | { 92 | protected override string BuildStringSTEP(ReleaseVersion release) { return "(" + string.Join(",", mUnits.ConvertAll(x=> "#" + x.StepId)) + ")"; } 93 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) { Units.AddRange(ParserSTEP.StripListLink(str, ref pos, len).ConvertAll(x=>dictionary[x] as IfcUnit)); } 94 | } 95 | public partial class IfcUShapeProfileDef 96 | { 97 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + "," + ParserSTEP.DoubleToString(mDepth) + "," + ParserSTEP.DoubleToString(mFlangeWidth) + "," + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mFlangeThickness) + "," + ParserSTEP.DoubleOptionalToString(mFilletRadius) + "," + ParserSTEP.DoubleOptionalToString(mEdgeRadius) + "," + ParserSTEP.DoubleOptionalToString(mFlangeSlope) + (release < ReleaseVersion.IFC4 ? "," + ParserSTEP.DoubleOptionalToString(mCentreOfGravityInX) : ""); } 98 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 99 | { 100 | base.parse(str, ref pos, release, len, dictionary); 101 | mDepth = ParserSTEP.StripDouble(str, ref pos, len); 102 | mFlangeWidth = ParserSTEP.StripDouble(str, ref pos, len); 103 | mWebThickness = ParserSTEP.StripDouble(str, ref pos, len); 104 | mFlangeThickness = ParserSTEP.StripDouble(str, ref pos, len); 105 | mFilletRadius = ParserSTEP.StripDouble(str, ref pos, len); 106 | mEdgeRadius = ParserSTEP.StripDouble(str, ref pos, len); 107 | mFlangeSlope = ParserSTEP.StripDouble(str, ref pos, len); 108 | if(release < ReleaseVersion.IFC4) 109 | mCentreOfGravityInX = ParserSTEP.StripDouble(str, ref pos, len); 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC X STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using GeometryGym.STEP; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC Y STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using GeometryGym.STEP; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Core/IFC/STEP/IFC Z STEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Collections.ObjectModel; 23 | using System.Text; 24 | using System.Reflection; 25 | using System.IO; 26 | using System.ComponentModel; 27 | using System.Linq; 28 | using GeometryGym.STEP; 29 | 30 | namespace GeometryGym.Ifc 31 | { 32 | public partial class IfcZone 33 | { 34 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? "" : (string.IsNullOrEmpty(mLongName) ? ",$" : ",'" + ParserSTEP.Encode(mLongName) + "'")); } 35 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 36 | { 37 | base.parse(str, ref pos, release, len, dictionary); 38 | if (release > ReleaseVersion.IFC2x3) 39 | mLongName = ParserSTEP.Decode(ParserSTEP.StripString(str, ref pos, len)); 40 | } 41 | } 42 | public partial class IfcZShapeProfileDef 43 | { 44 | protected override string BuildStringSTEP(ReleaseVersion release) { return base.BuildStringSTEP(release) + "," + ParserSTEP.DoubleToString(mDepth) + "," + ParserSTEP.DoubleToString(mFlangeWidth) + "," + ParserSTEP.DoubleToString(mWebThickness) + "," + ParserSTEP.DoubleToString(mFlangeThickness) + "," + ParserSTEP.DoubleOptionalToString(mFilletRadius) + "," + ParserSTEP.DoubleOptionalToString(mEdgeRadius); } 45 | internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) 46 | { 47 | base.parse(str, ref pos, release, len, dictionary); 48 | mDepth = ParserSTEP.StripDouble(str, ref pos, len); 49 | mFlangeWidth = ParserSTEP.StripDouble(str, ref pos, len); 50 | mWebThickness = ParserSTEP.StripDouble(str, ref pos, len); 51 | mFlangeThickness = ParserSTEP.StripDouble(str, ref pos, len); 52 | mFilletRadius = ParserSTEP.StripDouble(str, ref pos, len); 53 | mEdgeRadius = ParserSTEP.StripDouble(str, ref pos, len); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Core/IFC/XML/BaseClassIFC XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using System.Xml; 28 | //using System.Xml.Linq; 29 | 30 | 31 | using GeometryGym.STEP; 32 | 33 | namespace GeometryGym.Ifc 34 | { 35 | public partial class BaseClassIfc : STEPEntity, IBaseClassIfc 36 | { 37 | internal virtual void ParseXml(XmlElement xml) { } 38 | internal XmlElement GetXML(XmlDocument doc, string name, BaseClassIfc host, Dictionary processed) 39 | { 40 | string type = StepClassName; 41 | if (string.IsNullOrEmpty(name)) 42 | name = type; 43 | 44 | XmlElement existing = null; 45 | string id = xmlId(); 46 | if (processed.TryGetValue(id, out existing)) 47 | { 48 | if (!mDatabase.XMLMandatoryId) 49 | { 50 | if (!existing.HasAttribute("id")) 51 | { 52 | XmlAttribute attribute = doc.CreateAttribute("id"); 53 | attribute.Value = id; 54 | existing.Attributes.Prepend(attribute); 55 | } 56 | } 57 | XmlElement xelement = doc.CreateElement(name, mDatabase.mXmlNamespace); 58 | XmlAttribute nil = doc.CreateAttribute("xsi", "nil", mDatabase.mXsiNamespace); 59 | nil.Value = "true"; 60 | xelement.SetAttributeNode(nil); 61 | 62 | xelement.SetAttribute("href", id); 63 | return xelement; 64 | } 65 | 66 | XmlElement element = doc.CreateElement(name, mDatabase.mXmlNamespace); 67 | processed[id] = element; 68 | SetXML(element, host, processed); 69 | 70 | if(mDatabase.XMLMandatoryId) 71 | element.SetAttribute("id", "i" + mStepId); 72 | if (string.Compare(name, type) != 0) 73 | { 74 | XmlAttribute typeAttribute = doc.CreateAttribute("type", mDatabase.mXsiNamespace); 75 | typeAttribute.Value = type; 76 | element.Attributes.Prepend(typeAttribute); 77 | } 78 | return element; 79 | } 80 | internal virtual void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 81 | { 82 | foreach (string str in mComments) 83 | xml.AppendChild(xml.OwnerDocument.CreateComment(str)); 84 | } 85 | 86 | protected void setAttribute(XmlElement xml, string name, string value) 87 | { 88 | if (!string.IsNullOrEmpty(value)) 89 | xml.SetAttribute(name, value); 90 | } 91 | protected void setAttribute(XmlElement xml, string name, double val) 92 | { 93 | if (!double.IsNaN(val)) 94 | xml.SetAttribute(name, val.ToString()); 95 | } 96 | protected string extractString(XmlElement xml, string name) { return (xml.HasAttribute(name) ? xml.Attributes[name].Value : ""); } 97 | protected void setChild(XmlElement xml, string name, IEnumerable objects, Dictionary processed) 98 | { 99 | if (objects == null || objects.Count() == 0) 100 | return; 101 | XmlElement element = xml.OwnerDocument.CreateElement(name, mDatabase.mXmlNamespace); 102 | xml.AppendChild(element); 103 | foreach (IBaseClassIfc o in objects) 104 | element.AppendChild((o as BaseClassIfc).GetXML(xml.OwnerDocument, "", this, processed)); 105 | } 106 | internal static XmlNode convert(XmlDocument doc, IfcValue value, string name, string ifcnamespace) 107 | { 108 | string keyword = value.GetType().Name; 109 | XmlElement v = doc.CreateElement(keyword + "-wrapper", ifcnamespace); 110 | v.InnerText = value.ValueString; 111 | if (string.IsNullOrEmpty(name)) 112 | return v; 113 | XmlElement element = doc.CreateElement(name, ifcnamespace); 114 | element.AppendChild(v); 115 | return element; 116 | } 117 | internal static IfcValue extractValue(XmlNode node) 118 | { 119 | string name = node.Name; 120 | if(name.EndsWith("-wrapper")) 121 | { 122 | name = name.Substring(0, name.Length - 8); 123 | return ParserIfc.extractValue(name, node.InnerText); 124 | } 125 | 126 | return null; 127 | } 128 | 129 | internal string xmlId() 130 | { 131 | string id = ""; 132 | IfcClassificationReference classificationReference = this as IfcClassificationReference; 133 | if (classificationReference != null) 134 | { 135 | if (!string.IsNullOrEmpty(classificationReference.Identification)) 136 | { 137 | int i = 0; 138 | string str = classificationReference.Identification; 139 | if (str[0] == 'i' || str[0] == '_') 140 | str = str.Substring(1); 141 | if(!int.TryParse(str, out i)) 142 | id = classificationReference.Identification; 143 | } 144 | } 145 | if(string.IsNullOrEmpty(id)) 146 | return "i" + StepId; 147 | if (char.IsDigit(id[0])) 148 | return "_" + id; 149 | return id; 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC F XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | 25 | namespace GeometryGym.Ifc 26 | { 27 | public partial class IfcFace 28 | { 29 | internal override void ParseXml(XmlElement xml) 30 | { 31 | base.ParseXml(xml); 32 | foreach (XmlNode child in xml.ChildNodes) 33 | { 34 | string name = child.Name; 35 | if (string.Compare(name, "Bounds") == 0) 36 | { 37 | foreach (XmlNode cn in child.ChildNodes) 38 | { 39 | IfcFaceBound f = mDatabase.ParseXml(cn as XmlElement); 40 | if (f != null) 41 | Bounds.Add(f); 42 | } 43 | } 44 | } 45 | } 46 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 47 | { 48 | base.SetXML(xml, host, processed); 49 | XmlElement element = xml.OwnerDocument.CreateElement("Bounds", mDatabase.mXmlNamespace); 50 | xml.AppendChild(element); 51 | foreach (IfcFaceBound face in Bounds) 52 | element.AppendChild(face.GetXML(xml.OwnerDocument, "", this, processed)); 53 | } 54 | } 55 | public partial class IfcFaceBasedSurfaceModel 56 | { 57 | internal override void ParseXml(XmlElement xml) 58 | { 59 | base.ParseXml(xml); 60 | foreach (XmlNode child in xml.ChildNodes) 61 | { 62 | string name = child.Name; 63 | if (string.Compare(name, "FbsmFaces") == 0) 64 | { 65 | foreach (XmlNode cn in child.ChildNodes) 66 | { 67 | IfcConnectedFaceSet f = mDatabase.ParseXml(cn as XmlElement); 68 | if (f != null) 69 | mFbsmFaces.Add(f); 70 | } 71 | } 72 | } 73 | } 74 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 75 | { 76 | base.SetXML(xml, host, processed); 77 | XmlElement element = xml.OwnerDocument.CreateElement("FbsmFaces", mDatabase.mXmlNamespace); 78 | xml.AppendChild(element); 79 | foreach (IfcConnectedFaceSet face in FbsmFaces) 80 | element.AppendChild(face.GetXML(xml.OwnerDocument, "", this, processed)); 81 | } 82 | } 83 | public partial class IfcFaceBound 84 | { 85 | internal override void ParseXml(XmlElement xml) 86 | { 87 | base.ParseXml(xml); 88 | 89 | foreach (XmlNode child in xml.ChildNodes) 90 | { 91 | string name = child.Name; 92 | if (string.Compare(name, "Bound") == 0) 93 | Bound = mDatabase.ParseXml(child as XmlElement); 94 | } 95 | if (xml.HasAttribute("Orientation")) 96 | mOrientation = bool.Parse(xml.Attributes["Orientation"].Value); 97 | } 98 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 99 | { 100 | base.SetXML(xml, host, processed); 101 | xml.AppendChild(Bound.GetXML(xml.OwnerDocument, "Bound", this, processed)); 102 | xml.SetAttribute("Orientation", mOrientation.ToString().ToLower()); 103 | } 104 | } 105 | public partial class IfcFacetedBrepWithVoids 106 | { 107 | internal override void ParseXml(XmlElement xml) 108 | { 109 | base.ParseXml(xml); 110 | foreach (XmlNode child in xml.ChildNodes) 111 | { 112 | string name = child.Name; 113 | if (string.Compare(name, "Voids") == 0) 114 | { 115 | foreach (XmlNode cn in child.ChildNodes) 116 | { 117 | IfcClosedShell s = mDatabase.ParseXml(cn as XmlElement); 118 | if (s != null) 119 | Voids.Add(s); 120 | } 121 | } 122 | } 123 | } 124 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 125 | { 126 | base.SetXML(xml, host, processed); 127 | XmlElement element = xml.OwnerDocument.CreateElement("Voids", mDatabase.mXmlNamespace); 128 | xml.AppendChild(element); 129 | foreach (IfcClosedShell s in Voids) 130 | element.AppendChild(s.GetXML(xml.OwnerDocument, "", this, processed)); 131 | } 132 | } 133 | public partial class IfcFixedReferenceSweptAreaSolid 134 | { 135 | internal override void ParseXml(XmlElement xml) 136 | { 137 | base.ParseXml(xml); 138 | foreach (XmlNode child in xml.ChildNodes) 139 | { 140 | string name = child.Name; 141 | if (string.Compare(name, "FixedReference") == 0) 142 | FixedReference = mDatabase.ParseXml(child as XmlElement); 143 | } 144 | } 145 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 146 | { 147 | base.SetXML(xml, host, processed); 148 | xml.AppendChild(FixedReference.GetXML(xml.OwnerDocument, "FixedReference", this, processed)); 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC H XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcHalfSpaceSolid 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | foreach (XmlNode child in xml.ChildNodes) 32 | { 33 | string name = child.Name; 34 | if (string.Compare(name, "BaseSurface") == 0) 35 | BaseSurface = mDatabase.ParseXml(child as XmlElement); 36 | } 37 | if (xml.HasAttribute("AgreementFlag")) 38 | mAgreementFlag = bool.Parse(xml.Attributes["AgreementFlag"].Value); 39 | } 40 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 41 | { 42 | base.SetXML(xml, host, processed); 43 | xml.AppendChild(BaseSurface.GetXML(xml.OwnerDocument, "BaseSurface", this, processed)); 44 | xml.SetAttribute("AgreementFlag", mAgreementFlag.ToString().ToLower()); 45 | } 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC I XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | using GeometryGym.STEP; 25 | 26 | 27 | namespace GeometryGym.Ifc 28 | { 29 | public partial class IfcIndexedPolyCurve 30 | { 31 | internal override void ParseXml(XmlElement xml) 32 | { 33 | base.ParseXml(xml); 34 | foreach (XmlNode child in xml.ChildNodes) 35 | { 36 | string name = child.Name; 37 | if (string.Compare(name, "Points") == 0) 38 | Points = mDatabase.ParseXml(child as XmlElement); 39 | else if (string.Compare(name, "Segments") == 0) 40 | { 41 | foreach(XmlNode node in child.ChildNodes) 42 | { 43 | List ints = node.InnerText.Split(" ".ToCharArray()).ToList().ConvertAll(x => int.Parse(x)); 44 | if (string.Compare("IfcLineIndex-wrapper", node.Name) == 0) 45 | Segments.Add(new IfcLineIndex(ints)); 46 | else 47 | Segments.Add(new IfcArcIndex(ints[0], ints[1], ints[2])); 48 | } 49 | } 50 | } 51 | if (xml.HasAttribute("SelfIntersect")) 52 | mSelfIntersect = bool.Parse(xml.Attributes["SelfIntersect"].Value) ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE; 53 | } 54 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 55 | { 56 | base.SetXML(xml, host, processed); 57 | xml.AppendChild(Points.GetXML(xml.OwnerDocument, "Points", this, processed)); 58 | if (mSegments.Count > 0) 59 | { 60 | XmlElement element = xml.OwnerDocument.CreateElement("Segments", mDatabase.mXmlNamespace); 61 | xml.AppendChild(element); 62 | foreach (IfcSegmentIndexSelect seg in Segments) 63 | { 64 | XmlElement s = xml.OwnerDocument.CreateElement(seg.GetType().Name + "-wrapper", mDatabase.mXmlNamespace); 65 | element.AppendChild(s); 66 | IfcArcIndex ai = seg as IfcArcIndex; 67 | if (ai != null) 68 | s.InnerText = ai[0] + " " + ai[1] + " " + ai[2]; 69 | else 70 | { 71 | IfcLineIndex li = seg as IfcLineIndex; 72 | s.InnerText = string.Join(" ", li.ConvertAll(x => x.ToString())); 73 | } 74 | } 75 | } 76 | } 77 | } 78 | public partial class IfcIShapeProfileDef 79 | { 80 | internal override void ParseXml(XmlElement xml) 81 | { 82 | base.ParseXml(xml); 83 | if (xml.HasAttribute("OverallWidth")) 84 | mOverallWidth = double.Parse(xml.Attributes["OverallWidth"].Value); 85 | if (xml.HasAttribute("OverallDepth")) 86 | mOverallDepth = double.Parse(xml.Attributes["OverallDepth"].Value); 87 | if (xml.HasAttribute("WebThickness")) 88 | mWebThickness = double.Parse(xml.Attributes["WebThickness"].Value); 89 | if (xml.HasAttribute("FlangeThickness")) 90 | mFlangeThickness = double.Parse(xml.Attributes["FlangeThickness"].Value); 91 | if (xml.HasAttribute("FilletRadius")) 92 | mFilletRadius = double.Parse(xml.Attributes["FilletRadius"].Value); 93 | if (xml.HasAttribute("FlangeEdgeRadius")) 94 | mFlangeEdgeRadius = double.Parse(xml.Attributes["FlangeEdgeRadius"].Value); 95 | if (xml.HasAttribute("FlangeSlope")) 96 | mFlangeSlope = double.Parse(xml.Attributes["FlangeSlope"].Value); 97 | foreach (XmlNode child in xml.ChildNodes) 98 | { 99 | string name = child.Name; 100 | if (string.Compare(name, "OverallWidth") == 0) 101 | OverallWidth = ParserSTEP.ParseDouble(child.InnerText); 102 | if (string.Compare(name, "OverallDepth") == 0) 103 | OverallDepth = ParserSTEP.ParseDouble(child.InnerText); 104 | if (string.Compare(name, "WebThickness") == 0) 105 | WebThickness = ParserSTEP.ParseDouble(child.InnerText); 106 | if (string.Compare(name, "FlangeThickness") == 0) 107 | FlangeThickness = ParserSTEP.ParseDouble(child.InnerText); 108 | if (string.Compare(name, "FlangeThickness") == 0) 109 | FlangeThickness = ParserSTEP.ParseDouble(child.InnerText); 110 | if (string.Compare(name, "FilletRadius") == 0) 111 | FilletRadius = ParserSTEP.ParseDouble(child.InnerText); 112 | if (string.Compare(name, "FlangeSlope") == 0) 113 | FlangeSlope = ParserSTEP.ParseDouble(child.InnerText); 114 | } 115 | } 116 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 117 | { 118 | base.SetXML(xml, host, processed); 119 | xml.SetAttribute("OverallWidth", mOverallWidth.ToString()); 120 | xml.SetAttribute("OverallDepth", mOverallDepth.ToString()); 121 | xml.SetAttribute("WebThickness", mWebThickness.ToString()); 122 | xml.SetAttribute("FlangeThickness", mFlangeThickness.ToString()); 123 | if (!double.IsNaN(mFilletRadius) && mFilletRadius > 0) 124 | xml.SetAttribute("FilletRadius", mFilletRadius.ToString()); 125 | if (!double.IsNaN(mFlangeEdgeRadius) && mFlangeEdgeRadius > 0) 126 | xml.SetAttribute("FlangeEdgeRadius", mFlangeEdgeRadius.ToString()); 127 | if (!double.IsNaN(mFlangeSlope) && mFlangeSlope > 0) 128 | xml.SetAttribute("FlangeSlope", mFlangeSlope.ToString()); 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC J XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC K XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcKerb 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | if (xml.HasAttribute("PredefinedType")) 32 | Enum.TryParse(xml.Attributes["PredefinedType"].Value, true, out mPredefinedType); 33 | } 34 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 35 | { 36 | base.SetXML(xml, host, processed); 37 | if (mPredefinedType != IfcKerbTypeEnum.NOTDEFINED) 38 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 39 | } 40 | } 41 | public partial class IfcKerbType 42 | { 43 | internal override void ParseXml(XmlElement xml) 44 | { 45 | base.ParseXml(xml); 46 | if (xml.HasAttribute("PredefinedType")) 47 | Enum.TryParse(xml.Attributes["PredefinedType"].Value, true, out mPredefinedType); 48 | } 49 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 50 | { 51 | base.SetXML(xml, host, processed); 52 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC N XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public abstract partial class IfcNamedUnit 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | foreach (XmlNode child in xml.ChildNodes) 32 | { 33 | string name = child.Name; 34 | if (string.Compare(name, "Dimensions", true) == 0) 35 | Dimensions = mDatabase.ParseXml(child as XmlElement); 36 | else if (string.Compare(name, "UnitType", true) == 0) 37 | Enum.TryParse(child.InnerText, true, out mUnitType); 38 | } 39 | if (xml.HasAttribute("UnitType")) 40 | Enum.TryParse(xml.Attributes["UnitType"].Value, true, out mUnitType); 41 | } 42 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 43 | { 44 | base.SetXML(xml, host, processed); 45 | if (mDimensions != null) 46 | xml.AppendChild(Dimensions.GetXML(xml.OwnerDocument, "Dimensions", this, processed)); 47 | xml.SetAttribute("UnitType", mUnitType.ToString().ToLower()); 48 | } 49 | } 50 | public partial class IfcNavigationElement 51 | { 52 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 53 | { 54 | base.SetXML(xml, host, processed); 55 | if (mPredefinedType != IfcNavigationElementTypeEnum.NOTDEFINED) 56 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 57 | } 58 | internal override void ParseXml(XmlElement xml) 59 | { 60 | base.ParseXml(xml); 61 | XmlAttribute predefinedType = xml.Attributes["PredefinedType"]; 62 | if (predefinedType != null) 63 | Enum.TryParse(predefinedType.Value, out mPredefinedType); 64 | } 65 | } 66 | public partial class IfcNavigationElementType 67 | { 68 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 69 | { 70 | base.SetXML(xml, host, processed); 71 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 72 | } 73 | internal override void ParseXml(XmlElement xml) 74 | { 75 | base.ParseXml(xml); 76 | XmlAttribute predefinedType = xml.Attributes["PredefinedType"]; 77 | if (predefinedType != null) 78 | Enum.TryParse(predefinedType.Value, out mPredefinedType); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC Q XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcQuantityArea 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | if (xml.HasAttribute("AreaValue")) 32 | AreaValue = double.Parse(xml.Attributes["AreaValue"].Value); 33 | if (xml.HasAttribute("Formula")) 34 | Formula = xml.Attributes["Formula"].Value; 35 | } 36 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 37 | { 38 | base.SetXML(xml, host, processed); 39 | xml.SetAttribute("AreaValue", AreaValue.ToString()); 40 | setAttribute(xml, "Formula", Formula); 41 | } 42 | } 43 | public partial class IfcQuantityCount 44 | { 45 | internal override void ParseXml(XmlElement xml) 46 | { 47 | base.ParseXml(xml); 48 | if (xml.HasAttribute("CountValue")) 49 | CountValueDouble = double.Parse(xml.Attributes["CountValue"].Value); 50 | if (xml.HasAttribute("Formula")) 51 | Formula = xml.Attributes["Formula"].Value; 52 | } 53 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 54 | { 55 | base.SetXML(xml, host, processed); 56 | xml.SetAttribute("CountValue", CountValue.ToString()); 57 | setAttribute(xml, "Formula", Formula); 58 | } 59 | } 60 | public partial class IfcQuantityLength 61 | { 62 | internal override void ParseXml(XmlElement xml) 63 | { 64 | base.ParseXml(xml); 65 | if (xml.HasAttribute("LengthValue")) 66 | LengthValue = double.Parse(xml.Attributes["LengthValue"].Value); 67 | if (xml.HasAttribute("Formula")) 68 | Formula = xml.Attributes["Formula"].Value; 69 | } 70 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 71 | { 72 | base.SetXML(xml, host, processed); 73 | xml.SetAttribute("LengthValue", LengthValue.ToString()); 74 | setAttribute(xml, "Formula", Formula); 75 | } 76 | } 77 | public partial class IfcQuantityTime 78 | { 79 | internal override void ParseXml(XmlElement xml) 80 | { 81 | base.ParseXml(xml); 82 | if (xml.HasAttribute("LengthValue")) 83 | TimeValue = double.Parse(xml.Attributes["TimeValue"].Value); 84 | if (xml.HasAttribute("Formula")) 85 | Formula = xml.Attributes["Formula"].Value; 86 | } 87 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 88 | { 89 | base.SetXML(xml, host, processed); 90 | xml.SetAttribute("TimeValue", TimeValue.ToString()); 91 | setAttribute(xml, "Formula", Formula); 92 | } 93 | } 94 | public partial class IfcQuantityVolume 95 | { 96 | internal override void ParseXml(XmlElement xml) 97 | { 98 | base.ParseXml(xml); 99 | if (xml.HasAttribute("VolumeValue")) 100 | VolumeValue = double.Parse(xml.Attributes["VolumeValue"].Value); 101 | if (xml.HasAttribute("Formula")) 102 | Formula = xml.Attributes["Formula"].Value; 103 | } 104 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 105 | { 106 | base.SetXML(xml, host, processed); 107 | xml.SetAttribute("VolumeValue", VolumeValue.ToString()); 108 | setAttribute(xml, "Formula", Formula); 109 | } 110 | } 111 | public partial class IfcQuantityWeight 112 | { 113 | internal override void ParseXml(XmlElement xml) 114 | { 115 | base.ParseXml(xml); 116 | if (xml.HasAttribute("WeightValue")) 117 | WeightValue = double.Parse(xml.Attributes["WeightValue"].Value); 118 | if (xml.HasAttribute("Formula")) 119 | Formula = xml.Attributes["Formula"].Value; 120 | } 121 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 122 | { 123 | base.SetXML(xml, host, processed); 124 | xml.SetAttribute("WeightValue", WeightValue.ToString()); 125 | setAttribute(xml, "Formula", Formula); 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC U XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcUnitaryEquipment 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | if (xml.HasAttribute("PredefinedType")) 32 | Enum.TryParse(xml.Attributes["PredefinedType"].Value,true, out mPredefinedType); 33 | } 34 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 35 | { 36 | base.SetXML(xml, host, processed); 37 | if (mPredefinedType != IfcUnitaryEquipmentTypeEnum.NOTDEFINED) 38 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 39 | } 40 | } 41 | public partial class IfcUnitaryEquipmentType 42 | { 43 | internal override void ParseXml(XmlElement xml) 44 | { 45 | base.ParseXml(xml); 46 | if (xml.HasAttribute("PredefinedType")) 47 | Enum.TryParse(xml.Attributes["PredefinedType"].Value,true, out mPredefinedType); 48 | } 49 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 50 | { 51 | base.SetXML(xml, host, processed); 52 | if (mPredefinedType != IfcUnitaryEquipmentTypeEnum.NOTDEFINED) 53 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 54 | } 55 | } 56 | 57 | public partial class IfcUnitAssignment 58 | { 59 | internal override void ParseXml(XmlElement xml) 60 | { 61 | base.ParseXml(xml); 62 | foreach (XmlNode child in xml.ChildNodes) 63 | { 64 | string name = child.Name; 65 | if (string.Compare(name, "Units") == 0) 66 | { 67 | foreach (XmlNode cn in child.ChildNodes) 68 | { 69 | IfcUnit u = mDatabase.ParseXml(cn as XmlElement); 70 | if (u != null) 71 | Units.Add(u); 72 | } 73 | } 74 | } 75 | } 76 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 77 | { 78 | base.SetXML(xml, host, processed); 79 | XmlElement element = xml.OwnerDocument.CreateElement("Units", mDatabase.mXmlNamespace); 80 | xml.AppendChild(element); 81 | foreach (IfcUnit unit in Units) 82 | element.AppendChild((unit as BaseClassIfc).GetXML(xml.OwnerDocument, "", this, processed)); 83 | } 84 | } 85 | public partial class IfcUShapeProfileDef 86 | { 87 | internal override void ParseXml(XmlElement xml) 88 | { 89 | base.ParseXml(xml); 90 | if (xml.HasAttribute("Depth")) 91 | mDepth = double.Parse(xml.Attributes["Depth"].Value); 92 | if (xml.HasAttribute("FlangeWidth")) 93 | mFlangeWidth = double.Parse(xml.Attributes["FlangeWidth"].Value); 94 | if (xml.HasAttribute("WebThickness")) 95 | mWebThickness = double.Parse(xml.Attributes["WebThickness"].Value); 96 | if (xml.HasAttribute("FlangeThickness")) 97 | mFlangeThickness = double.Parse(xml.Attributes["FlangeThickness"].Value); 98 | if (xml.HasAttribute("FilletRadius")) 99 | mFilletRadius = double.Parse(xml.Attributes["FilletRadius"].Value); 100 | if (xml.HasAttribute("EdgeRadius")) 101 | mEdgeRadius = double.Parse(xml.Attributes["EdgeRadius"].Value); 102 | if (xml.HasAttribute("FlangeSlope")) 103 | mFlangeSlope = double.Parse(xml.Attributes["FlangeSlope"].Value); 104 | } 105 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 106 | { 107 | base.SetXML(xml, host, processed); 108 | xml.SetAttribute("Depth", mDepth.ToString()); 109 | xml.SetAttribute("FlangeWidth", mFlangeWidth.ToString()); 110 | xml.SetAttribute("WebThickness", mWebThickness.ToString()); 111 | xml.SetAttribute("FlangeThickness", mFlangeThickness.ToString()); 112 | if (!double.IsNaN(mFilletRadius)) 113 | xml.SetAttribute("FilletRadius", mFilletRadius.ToString()); 114 | if (!double.IsNaN(mEdgeRadius)) 115 | xml.SetAttribute("EdgeRadius", mEdgeRadius.ToString()); 116 | if (!double.IsNaN(mFlangeSlope)) 117 | xml.SetAttribute("FlangeSlope", mFlangeSlope.ToString()); 118 | if (mDatabase.Release < ReleaseVersion.IFC4 && !double.IsNaN(mCentreOfGravityInX)) 119 | xml.SetAttribute("CentreOfGravityInX", mCentreOfGravityInX.ToString()); 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC V XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcValveType 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | if (xml.HasAttribute("PredefinedType")) 32 | Enum.TryParse(xml.Attributes["PredefinedType"].Value, true, out mPredefinedType); 33 | } 34 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 35 | { 36 | base.SetXML(xml, host, processed); 37 | if (mPredefinedType != IfcValveTypeEnum.NOTDEFINED) 38 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 39 | } 40 | } 41 | public partial class IfcVector 42 | { 43 | internal override void ParseXml(XmlElement xml) 44 | { 45 | base.ParseXml(xml); 46 | 47 | foreach (XmlNode child in xml.ChildNodes) 48 | { 49 | string name = child.Name; 50 | if (string.Compare(name, "Orientation") == 0) 51 | Orientation = mDatabase.ParseXml(child as XmlElement); 52 | } 53 | if (xml.HasAttribute("Magnitude")) 54 | mMagnitude = double.Parse(xml.Attributes["Magnitude"].Value); 55 | } 56 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 57 | { 58 | base.SetXML(xml, host, processed); 59 | xml.AppendChild(Orientation.GetXML(xml.OwnerDocument, "Orientation", this, processed)); 60 | xml.SetAttribute("Magnitude", mMagnitude.ToString()); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC W XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcWall 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | if (xml.HasAttribute("PredefinedType")) 32 | Enum.TryParse(xml.Attributes["PredefinedType"].Value,true, out mPredefinedType); 33 | } 34 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 35 | { 36 | base.SetXML(xml, host, processed); 37 | if (mPredefinedType != IfcWallTypeEnum.NOTDEFINED) 38 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 39 | } 40 | } 41 | public partial class IfcWallType 42 | { 43 | internal override void ParseXml(XmlElement xml) 44 | { 45 | base.ParseXml(xml); 46 | if (xml.HasAttribute("PredefinedType")) 47 | Enum.TryParse(xml.Attributes["PredefinedType"].Value,true, out mPredefinedType); 48 | } 49 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 50 | { 51 | base.SetXML(xml, host, processed); 52 | if (mPredefinedType != IfcWallTypeEnum.NOTDEFINED) 53 | xml.SetAttribute("PredefinedType", mPredefinedType.ToString().ToLower()); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC X XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using System.Xml; 27 | //using System.Xml.Linq; 28 | 29 | 30 | namespace GeometryGym.Ifc 31 | { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC Y XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Text; 22 | using System.Reflection; 23 | using System.IO; 24 | using System.ComponentModel; 25 | using System.Linq; 26 | using System.Xml; 27 | //using System.Xml.Linq; 28 | 29 | 30 | namespace GeometryGym.Ifc 31 | { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /Core/IFC/XML/IFC Z XML.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Linq; 22 | using System.Xml; 23 | 24 | namespace GeometryGym.Ifc 25 | { 26 | public partial class IfcZShapeProfileDef 27 | { 28 | internal override void ParseXml(XmlElement xml) 29 | { 30 | base.ParseXml(xml); 31 | if (xml.HasAttribute("Depth")) 32 | mDepth = double.Parse(xml.Attributes["Depth"].Value); 33 | if (xml.HasAttribute("FlangeWidth")) 34 | mFlangeWidth = double.Parse(xml.Attributes["FlangeWidth"].Value); 35 | if (xml.HasAttribute("WebThickness")) 36 | mWebThickness = double.Parse(xml.Attributes["WebThickness"].Value); 37 | if (xml.HasAttribute("FlangeThickness")) 38 | mFlangeThickness = double.Parse(xml.Attributes["FlangeThickness"].Value); 39 | if (xml.HasAttribute("FilletRadius")) 40 | mFilletRadius = double.Parse(xml.Attributes["FilletRadius"].Value); 41 | if (xml.HasAttribute("EdgeRadius")) 42 | mEdgeRadius = double.Parse(xml.Attributes["EdgeRadius"].Value); 43 | } 44 | internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) 45 | { 46 | base.SetXML(xml, host, processed); 47 | xml.SetAttribute("Depth", mDepth.ToString()); 48 | xml.SetAttribute("FlangeWidth", mFlangeWidth.ToString()); 49 | xml.SetAttribute("WebThickness", mWebThickness.ToString()); 50 | xml.SetAttribute("FlangeThickness", mFlangeThickness.ToString()); 51 | if (!double.IsNaN(mFilletRadius)) 52 | xml.SetAttribute("FilletRadius", mFilletRadius.ToString()); 53 | if (!double.IsNaN(mEdgeRadius)) 54 | xml.SetAttribute("EdgeRadius", mEdgeRadius.ToString()); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Core/STEP/BaseClassSTEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Concurrent; 21 | using System.Collections.Generic; 22 | using System.Collections; 23 | using System.ComponentModel; 24 | using System.IO; 25 | using System.Reflection; 26 | using System.Text; 27 | using System.Threading.Tasks; 28 | 29 | namespace GeometryGym.STEP 30 | { 31 | 32 | public partial interface ISTEPEntity 33 | { 34 | int StepId { get; } 35 | string StepClassName { get; } 36 | } 37 | [Serializable] 38 | public abstract partial class STEPEntity 39 | { 40 | [NonSerialized] internal int mStepId = 0; 41 | [NonSerialized] internal List mComments = new List(); 42 | 43 | public int StepId { get { return mStepId; } private set { mStepId = value; } } 44 | 45 | protected static ConcurrentDictionary mSTEPTypes = new ConcurrentDictionary(); 46 | protected static ConcurrentDictionary mConstructors = new ConcurrentDictionary(); 47 | 48 | internal STEPEntity() { initialize(); } 49 | public virtual string StepClassName { get { return this.GetType().Name; } } 50 | 51 | protected virtual void initialize() { } 52 | public string StringSTEP() 53 | { 54 | string str = BuildStringSTEP(); 55 | if (string.IsNullOrEmpty(str)) 56 | return ""; 57 | return StepLinePrefix() + str + StepLineSuffix(); 58 | } 59 | protected string StepLinePrefix() 60 | { 61 | string comment = ""; 62 | if (mComments.Count > 0) 63 | { 64 | foreach (string c in mComments) 65 | comment += "/* " + c + " */\r\n"; 66 | } 67 | return comment + (mStepId > 0 ? "#" + StepId + "= " : "") + StepClassName.ToUpper() + "("; 68 | } 69 | protected string StepLineSuffix() 70 | { 71 | return ");"; 72 | } 73 | protected void WriteStepLineWorkerPrefix(TextWriter textWriter) 74 | { 75 | if (mComments.Count > 0) 76 | { 77 | foreach (string c in mComments) 78 | textWriter.WriteLine("/* " + c + " */)"); 79 | } 80 | textWriter.Write("#" + StepId + "= " + StepClassName.ToUpper() + "("); 81 | } 82 | protected void WriteStepLineWorkerSuffix(TextWriter textWriter) 83 | { 84 | textWriter.WriteLine(");"); 85 | } 86 | public string STEPSerialization() 87 | { 88 | string attributesString = BuildStringSTEP(); 89 | if (string.IsNullOrEmpty(attributesString)) 90 | return ""; 91 | return StepClassName.ToUpper() + "(" + attributesString + ")"; 92 | } 93 | public override string ToString() { return StringSTEP(); } 94 | protected abstract string BuildStringSTEP();// { return ""; } 95 | public void AddComment(string comment) { mComments.Add(comment); } 96 | 97 | 98 | internal static Type GetType(string classNameIfc, string nameSpace) 99 | { 100 | if (string.IsNullOrEmpty(classNameIfc)) 101 | return null; 102 | Type type = null; 103 | string name = classNameIfc; 104 | string[] fields = classNameIfc.Split(".".ToCharArray()); 105 | if (fields != null && fields.Length > 0) 106 | name = fields[0]; 107 | if (!mSTEPTypes.TryGetValue(name, out type)) 108 | { 109 | type = Type.GetType("GeometryGym." + nameSpace + "." + name, false, true); 110 | if (type != null) 111 | mSTEPTypes[name] = type; 112 | } 113 | return type; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Core/STEP/CollectionsSTEP.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections; 21 | using System.Collections.Concurrent; 22 | using System.Collections.Generic; 23 | using System.Collections.ObjectModel; 24 | using System.Collections.Specialized; 25 | using System.ComponentModel; 26 | using System.Linq; 27 | using System.IO; 28 | using System.Reflection; 29 | using System.Text; 30 | using System.Threading.Tasks; 31 | using GeometryGym.Ifc; 32 | 33 | namespace GeometryGym.STEP 34 | { 35 | [Serializable] 36 | public class SET : ICollection, IEnumerable, IEnumerable, INotifyCollectionChanged where T : ISTEPEntity //ICollection, 37 | { 38 | private HashSet mSet = new HashSet(); 39 | 40 | public event NotifyCollectionChangedEventHandler CollectionChanged; 41 | 42 | public SET() : base() { } 43 | public SET(T item) : base() { Add(item); } 44 | public SET(IEnumerable collection) { Clear(); AddRange(collection); } 45 | 46 | public int Count { get { return mSet.Count; } } 47 | public bool IsReadOnly { get { return false; } } 48 | 49 | private bool add(T item) 50 | { 51 | return mSet.Add(item); 52 | } 53 | public void Add(T item) 54 | { 55 | if(add(item) && CollectionChanged != null) 56 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item)); 57 | } 58 | public void AddRange(IEnumerable collection) 59 | { 60 | List changed = new List(); 61 | if (collection != null) 62 | { 63 | foreach (T t in collection) 64 | { 65 | if (t != null) 66 | { 67 | if (this.add(t)) 68 | changed.Add(t); 69 | } 70 | } 71 | } 72 | if (changed.Count > 0 && CollectionChanged != null) 73 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changed)); 74 | } 75 | public void Clear() 76 | { 77 | if(mSet.Count > 0) 78 | { 79 | List values = mSet.ToList(); 80 | mSet.Clear(); 81 | if(CollectionChanged != null) 82 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, values)); 83 | } 84 | } 85 | public bool Contains(T item) { return mSet.Contains(item); } 86 | public List ConvertAll(Converter converter) { return this.ToList().ConvertAll(converter); } 87 | public void CopyTo(T[] array, int arrayIndex) { mSet.CopyTo(array, arrayIndex); } 88 | public IEnumerator GetEnumerator() { return mSet.GetEnumerator(); } 89 | public bool Remove(T item) 90 | { 91 | if(mSet.Remove(item)) 92 | { 93 | if(CollectionChanged != null) 94 | CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item)); 95 | return true; 96 | } 97 | return false; 98 | } 99 | IEnumerator IEnumerable.GetEnumerator() { return mSet.GetEnumerator(); } 100 | } 101 | [Serializable] 102 | public class LIST : ObservableCollection 103 | { 104 | public LIST() : base() { } 105 | public LIST(T item) : base() { Add(item); } 106 | public LIST(IEnumerable collection) { Clear(); AddRange(collection); } 107 | public void AddRange(IEnumerable collection) 108 | { 109 | if (collection != null) 110 | { 111 | foreach (T t in collection) 112 | { 113 | if(t != null) 114 | this.Add(t); 115 | } 116 | } 117 | } 118 | public List ConvertAll(Converter converter) { return this.ToList().ConvertAll(converter); } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /DLL Projects/GeometryGymIFC.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29215.179 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeometryGymIFC", "GeometryGymIFC\GeometryGymIFC.csproj", "{6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeometryGymIFCRhinoCommonx64", "GeometryGymIFCRhinoCommonx64\GeometryGymIFCRhinoCommonx64.csproj", "{0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeometryGymIFCcore", "GeometryGymIFCcore\GeometryGymIFCcore.csproj", "{8A9147EC-5769-4F66-9272-4549BB9B0BF6}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|Any CPU = Release|Any CPU 18 | Release|x64 = Release|x64 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|x64.ActiveCfg = Debug|Any CPU 25 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Debug|x86.ActiveCfg = Debug|Any CPU 26 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|x64.ActiveCfg = Release|Any CPU 29 | {6CD3BE38-25BC-4FCF-9426-D15ED4D4657C}.Release|x86.ActiveCfg = Release|Any CPU 30 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|Any CPU.ActiveCfg = Debug|x64 31 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|Any CPU.Build.0 = Debug|x64 32 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|x64.ActiveCfg = Debug|x64 33 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Debug|x86.ActiveCfg = Debug|Any CPU 34 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|x64.ActiveCfg = Release|Any CPU 37 | {0E350E61-D5D6-4C9D-BDC8-494F3FF6E5C1}.Release|x86.ActiveCfg = Release|Any CPU 38 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Debug|x64.ActiveCfg = Debug|Any CPU 41 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Debug|x64.Build.0 = Debug|Any CPU 42 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Debug|x86.ActiveCfg = Debug|Any CPU 43 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Debug|x86.Build.0 = Debug|Any CPU 44 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Release|x64.ActiveCfg = Release|Any CPU 47 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Release|x64.Build.0 = Release|Any CPU 48 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Release|x86.ActiveCfg = Release|Any CPU 49 | {8A9147EC-5769-4F66-9272-4549BB9B0BF6}.Release|x86.Build.0 = Release|Any CPU 50 | EndGlobalSection 51 | GlobalSection(SolutionProperties) = preSolution 52 | HideSolutionNode = FALSE 53 | EndGlobalSection 54 | GlobalSection(ExtensibilityGlobals) = postSolution 55 | SolutionGuid = {6B0500FB-88EA-4089-8A63-C3CAC101AC07} 56 | EndGlobalSection 57 | EndGlobal 58 | -------------------------------------------------------------------------------- /DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System.Reflection; 20 | using System.Runtime.CompilerServices; 21 | using System.Runtime.InteropServices; 22 | 23 | [assembly: AssemblyVersion("25.02.25.0")] 24 | [assembly: AssemblyFileVersion("25.02.25.0")] 25 | 26 | [assembly: AssemblyTitle("GeometryGymIFC")] 27 | [assembly: AssemblyDescription("C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files")] 28 | [assembly: AssemblyConfiguration("")] 29 | [assembly: AssemblyCompany("Geometry Gym Pty Ltd")] 30 | [assembly: AssemblyProduct("GeometryGymIFC")] 31 | [assembly: AssemblyCopyright("Copyright © Geometry Gym Pty Ltd 2016")] 32 | [assembly: AssemblyTrademark("")] 33 | [assembly: AssemblyCulture("")] 34 | 35 | [assembly: ComVisible(false)] 36 | 37 | [assembly: Guid("c26aa7cc-baf1-4551-b91b-76e56ca15567")] 38 | 39 | 40 | -------------------------------------------------------------------------------- /DLL Projects/GeometryGymIFC/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System.Reflection; 20 | using System.Runtime.CompilerServices; 21 | using System.Runtime.InteropServices; 22 | 23 | [assembly: AssemblyVersion("25.02.25.0")] 24 | [assembly: AssemblyFileVersion("25.02.25.0")] 25 | // General Information about an assembly is controlled through the following 26 | // set of attributes. Change these attribute values to modify the information 27 | // associated with an assembly. 28 | [assembly: AssemblyTitle("GeometryGymIFCRhinoCommonx64")] 29 | [assembly: AssemblyDescription("")] 30 | [assembly: AssemblyConfiguration("")] 31 | [assembly: AssemblyCompany("Geometry Gym Pty Ltd")] 32 | [assembly: AssemblyProduct("GeometryGymIFCRhinoCommonx64")] 33 | [assembly: AssemblyCopyright("Copyright © Geometry Gym Pty Ltd 2016")] 34 | [assembly: AssemblyTrademark("")] 35 | [assembly: AssemblyCulture("")] 36 | 37 | [assembly: ComVisible(false)] 38 | 39 | [assembly: Guid("c26aa7cc-baf1-4551-b91b-76e56ca15567")] 40 | 41 | -------------------------------------------------------------------------------- /DLL Projects/GeometryGymIFCRhinoCommonx64/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Extensions/Drawing/System/IFC C System.Drawing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Linq; 6 | 7 | namespace GeometryGym.Ifc 8 | { 9 | public partial interface IfcColour 10 | { 11 | Color Color(); 12 | } 13 | public partial class IfcColourRgb 14 | { 15 | public override Color Color() 16 | { 17 | try 18 | { 19 | return System.Drawing.Color.FromArgb((int)(mRed * 255), (int)(mGreen * 255), (int)(mBlue * 255)); 20 | } 21 | catch { } 22 | return System.Drawing.Color.Empty; 23 | } 24 | 25 | public IfcColourRgb(DatabaseIfc db, Color col) : base(db) { Name = col.Name; mRed = col.R / 255.0; mGreen = col.G / 255.0; mBlue = col.B / 255.0; } 26 | } 27 | public partial class IfcColourRgbList 28 | { 29 | public IfcColourRgbList(DatabaseIfc db, IEnumerable colourList) : base(db) 30 | { 31 | mColourList.AddRange(colourList.Select(x => new Tuple(x.R / 255.0, x.G / 255.0, x.B / 255.0))); 32 | } 33 | 34 | internal List ColorList() 35 | { 36 | return mColourList.ConvertAll(x => Color.FromArgb((int)(x.Item1 * 255), (int)(x.Item2 * 255), (int)(x.Item3 * 255))); 37 | } 38 | } 39 | public abstract partial class IfcColourSpecification 40 | { 41 | public abstract Color Color(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Extensions/Drawing/System/IFC N System.Drawing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace GeometryGym.Ifc 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Extensions/Drawing/System/IFC P System.Drawing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Collections.Generic; 4 | using System.Collections.ObjectModel; 5 | 6 | using GeometryGym.STEP; 7 | 8 | namespace GeometryGym.Ifc 9 | { 10 | public abstract partial class IfcPreDefinedColour 11 | { 12 | public Color Color() { return System.Drawing.Color.Empty; } 13 | } 14 | public partial class IfcPresentationLayerAssignment 15 | { 16 | internal virtual Color LayerColour { get { return Color.Empty; } } 17 | } 18 | public partial class IfcPresentationLayerWithStyle 19 | { 20 | internal override Color LayerColour 21 | { 22 | get 23 | { 24 | SET styles = LayerStyles; 25 | foreach (IfcPresentationStyle ps in styles) 26 | { 27 | IfcSurfaceStyle ss = ps as IfcSurfaceStyle; 28 | if (ss != null) 29 | { 30 | List sss = ss.Extract(); 31 | if (sss.Count > 0) 32 | return sss[0].SurfaceColour.Color(); 33 | } 34 | } 35 | foreach (IfcPresentationStyle ps in styles) 36 | { 37 | IfcCurveStyle cs = ps as IfcCurveStyle; 38 | if (cs != null) 39 | { 40 | IfcColour col = cs.CurveColour; 41 | if (col != null) 42 | return col.Color(); 43 | } 44 | } 45 | return base.LayerColour; 46 | } 47 | } 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /Extensions/Drawing/System/IFC S System.Drawing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace GeometryGym.Ifc 5 | { 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC A RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Linq; 23 | using System.Text; 24 | using System.Reflection; 25 | using System.IO; 26 | 27 | using Rhino.Geometry; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public partial class IfcAlignmentHorizontal 32 | { 33 | internal override Plane computePlaneAtLength(double length, double tol) 34 | { 35 | double distAlong = 0; 36 | List segments = HorizontalSegments.ToList(); 37 | for (int icounter = 0; icounter < segments.Count; icounter++) 38 | { 39 | IfcAlignmentHorizontalSegment segment = segments[icounter]; 40 | if (distAlong + segment.SegmentLength + tol > length) 41 | { 42 | Plane plane = segment.PlaneAtLength(length - distAlong, tol); 43 | if (plane.IsValid) 44 | return plane; 45 | 46 | return Plane.Unset; 47 | } 48 | distAlong += segment.SegmentLength; 49 | } 50 | return Plane.Unset; 51 | } 52 | } 53 | public partial class IfcAlignmentHorizontalSegment 54 | { 55 | public Vector2d StartTangent2d() 56 | { 57 | Tuple startTangent = StartTangent(); 58 | return new Vector2d(startTangent.Item1, startTangent.Item2); 59 | } 60 | internal Vector3d StartTangent3d() { Tuple startTangent = StartTangent(); return new Vector3d(startTangent.Item1, startTangent.Item2, 0); } 61 | public Plane Plane() 62 | { 63 | Point3d origin = StartPoint.Location; 64 | Vector3d startTangent = StartTangent3d(); 65 | Vector3d yAxis = Vector3d.CrossProduct(Vector3d.ZAxis, startTangent); 66 | return new Plane(origin, startTangent, yAxis); 67 | } 68 | public Plane PlaneAtLength(double length, double tol) 69 | { 70 | Plane plane = Plane(); 71 | 72 | if (mPredefinedType == IfcAlignmentHorizontalSegmentTypeEnum.LINE) 73 | { 74 | plane.Origin = plane.Origin + plane.XAxis * length; 75 | return plane; 76 | } 77 | else if (mPredefinedType == IfcAlignmentHorizontalSegmentTypeEnum.CIRCULARARC) 78 | { 79 | Point3d centre = plane.Origin + plane.YAxis * StartRadiusOfCurvature; 80 | double angle = length / Math.Abs(StartRadiusOfCurvature); 81 | plane.Rotate(angle, new Vector3d(0, 0, StartRadiusOfCurvature > 0 ? 1 : -1), centre); 82 | return plane; 83 | } 84 | else if (mPredefinedType == IfcAlignmentHorizontalSegmentTypeEnum.CLOTHOID) 85 | { 86 | #if (!OPEN_SOURCE) 87 | TransitionSetout transitionSetout = new TransitionSetout(this, mDatabase.Tolerance); 88 | Point2d origin = transitionSetout.computePoint(length); 89 | Vector3d xAxis = transitionSetout.mPlane.XAxis * (transitionSetout.mReversed ? -1 : 1); 90 | Vector3d yAxis = Vector3d.CrossProduct(Vector3d.ZAxis, xAxis); 91 | plane = new Plane(new Point3d(origin.X, origin.Y, 0), xAxis, yAxis); 92 | double angleLength = transitionSetout.calcBasisDistance(length); 93 | double angle = transitionSetout.computeAngle(angleLength); 94 | plane.Rotate(angle, transitionSetout.mPlane.ZAxis, plane.Origin); 95 | return plane; 96 | #endif 97 | } 98 | throw new NotImplementedException("Plane at length for " + PredefinedType + " not implemented yet!"); 99 | } 100 | } 101 | public partial class IfcAxis1Placement 102 | { 103 | internal Vector3d AxisVector { get { return (mAxis != null ? Axis.Vector3d : Vector3d.XAxis); } } 104 | } 105 | public partial class IfcAxis2Placement2D 106 | { 107 | internal Vector3d DirectionVector { get { return (mRefDirection != null ? RefDirection.Vector3d : Vector3d.XAxis); } } 108 | 109 | internal IfcAxis2Placement2D(DatabaseIfc db, Point2d position, Vector2d dir) : base(db) 110 | { 111 | Location = new IfcCartesianPoint(db, position); 112 | if (dir.Length > 0 && new Vector3d(dir.X, dir.Y, 0).IsParallelTo(Vector3d.XAxis, Math.PI / 1800) != 1) 113 | RefDirection = new IfcDirection(db, dir); 114 | } 115 | 116 | } 117 | public partial class IfcAxis2Placement3D 118 | { 119 | public IfcAxis2Placement3D(DatabaseIfc db, Plane plane) : base(db) 120 | { 121 | Location = new IfcCartesianPoint(db, plane.Origin); 122 | double angTol = Math.PI / 1800; 123 | if (plane.ZAxis.IsParallelTo(Vector3d.ZAxis, angTol) != 1) 124 | { 125 | Axis = IfcDirection.convert(db, plane.ZAxis); 126 | RefDirection = IfcDirection.convert(db, plane.XAxis); 127 | } 128 | else if (plane.XAxis.IsParallelTo(Vector3d.XAxis, angTol) != 1) 129 | { 130 | RefDirection = IfcDirection.convert(db, plane.XAxis); 131 | Axis = db.Factory.ZAxis; 132 | } 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC B RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcBSplineCurve 31 | { 32 | protected IfcBSplineCurve(DatabaseIfc db, NurbsCurve nonRationalCurve, bool twoD) 33 | : this(db, nonRationalCurve.Degree) 34 | { 35 | int ilast = nonRationalCurve.Points.Count - (nonRationalCurve.IsPeriodic ? mDegree : 0); 36 | if (twoD) 37 | { 38 | for (int icounter = 0; icounter < ilast; icounter++) 39 | { 40 | Point3d p3 = nonRationalCurve.Points[icounter].Location; 41 | mControlPointsList.Add(new IfcCartesianPoint(db, new Point2d(p3.X, p3.Y))); 42 | } 43 | if (nonRationalCurve.IsPeriodic) 44 | { 45 | for (int icounter = 0; icounter < mDegree; icounter++) 46 | mControlPointsList.Add(mControlPointsList[icounter]); 47 | } 48 | } 49 | else 50 | { 51 | for (int icounter = 0; icounter < ilast; icounter++) 52 | mControlPointsList.Add(new IfcCartesianPoint(db, nonRationalCurve.Points[icounter].Location)); 53 | if (nonRationalCurve.IsPeriodic) 54 | { 55 | for (int icounter = 0; icounter < mDegree; icounter++) 56 | mControlPointsList.Add(mControlPointsList[icounter]); 57 | } 58 | } 59 | } 60 | } 61 | public partial class IfcBSplineCurveWithKnots 62 | { 63 | public IfcBSplineCurveWithKnots(DatabaseIfc db, int degree, List controlPoints, List multiplicities, List knots, IfcKnotType knotSpec) : 64 | base(degree, controlPoints.ConvertAll(x=>new IfcCartesianPoint(db, x))) 65 | { 66 | mKnotMultiplicities.AddRange(multiplicities); 67 | mKnots.AddRange(knots); 68 | } 69 | internal IfcBSplineCurveWithKnots(DatabaseIfc db, NurbsCurve nc, bool twoD) 70 | : base(db, nc, twoD) 71 | { 72 | if (mDatabase.mModelView == ModelView.Ifc4Reference) 73 | throw new Exception("Invalid Model View for IfcBSplineCurveWithKnots : " + mDatabase.ModelView.ToString()); 74 | ClosedCurve = nc.IsClosed ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE; 75 | adoptKnotsAndMultiplicities(nc); 76 | } 77 | public IfcBSplineCurveWithKnots(DatabaseIfc db, int degree, List controlPoints, IEnumerable multiplicities, IEnumerable knots, IfcKnotType knotSpec) : 78 | base(degree, controlPoints.ConvertAll(x => new IfcCartesianPoint(db, x))) 79 | { 80 | if (mDatabase.mModelView != ModelView.Ifc4Reference) 81 | throw new Exception("Invalid Model View for IfcBSplineCurveWithKnots : " + mDatabase.ModelView.ToString()); 82 | mKnotMultiplicities.AddRange(multiplicities); 83 | mKnots.AddRange(knots); 84 | } 85 | private void adoptKnotsAndMultiplicities(NurbsCurve nc) 86 | { 87 | var knotList = nc.Knots; 88 | int count = knotList.Count; 89 | if (nc.IsPeriodic) 90 | { 91 | double knot = nc.Knots[0]; 92 | mKnots.Add(knot - (nc.Knots[1] - knot)); 93 | mKnotMultiplicities.Add(1); 94 | for(int u = 0; u < count; u++) 95 | { 96 | int multiplicity = knotList.KnotMultiplicity(u); 97 | mKnots.Add(knotList[u]); 98 | mKnotMultiplicities.Add(multiplicity); 99 | u += multiplicity - 1; 100 | } 101 | knot = nc.Knots[count - 1]; 102 | mKnots.Add(knot + (knot - nc.Knots[count - 2])); 103 | mKnotMultiplicities.Add(1); 104 | } 105 | else 106 | { 107 | for (int u = 0; u < count; u++) 108 | { 109 | double knot = knotList[u]; 110 | int multiplicity = knotList.KnotMultiplicity(u); 111 | bool superfluous = (u == 0 || u + multiplicity == count); 112 | mKnots.Add(knot); 113 | mKnotMultiplicities.Add(multiplicity + (superfluous ? 1 : 0)); 114 | u += multiplicity - 1; 115 | } 116 | } 117 | } 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC D RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcDirection 31 | { 32 | public Vector3d Vector3d { get { return new Vector3d(mDirectionRatioX, mDirectionRatioY, double.IsNaN(mDirectionRatioZ) ? 0 : mDirectionRatioZ); } } 33 | public IfcDirection(DatabaseIfc db, Vector3d v) : base(db) 34 | { 35 | Vector3d unit = v; 36 | unit.Unitize(); 37 | 38 | mDirectionRatioX = unit.X; 39 | mDirectionRatioY = unit.Y; 40 | mDirectionRatioZ = unit.Z; 41 | } 42 | public IfcDirection(DatabaseIfc db, Vector2d v) : base(db) 43 | { 44 | double len = v.Length; 45 | mDirectionRatioX = v.X / len; 46 | mDirectionRatioY = v.Y / len; 47 | mDirectionRatioZ = double.NaN; 48 | } 49 | 50 | internal static IfcDirection convert(DatabaseIfc db, Vector3d vector) 51 | { 52 | if (double.IsNaN(vector.Z)) 53 | return new IfcDirection(db, vector.X, vector.Y); 54 | vector.Unitize(); 55 | double tol = 1e-6; 56 | if (Math.Abs(vector.X - 1) < tol) 57 | return db.Factory.XAxis; 58 | if (Math.Abs(vector.Y - 1) < tol) 59 | return db.Factory.YAxis; 60 | if (Math.Abs(vector.Z - 1) < tol) 61 | return db.Factory.ZAxis; 62 | if (Math.Abs(vector.X + 1) < tol) 63 | return db.Factory.XAxisNegative; 64 | if (Math.Abs(vector.Y + 1) < tol) 65 | return db.Factory.YAxisNegative; 66 | if (Math.Abs(vector.Z + 1) < tol) 67 | return db.Factory.ZAxisNegative; 68 | return new IfcDirection(db, vector); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC E RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC F RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC G RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC H RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC I RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcIndexedPolyCurve 31 | { 32 | internal static IfcIndexedPolyCurve Convert(DatabaseIfc db, PolyCurve polycurve, bool twoD) 33 | { 34 | double tol = db.Tolerance; 35 | Curve[] segments = polycurve.Explode(); 36 | PolyCurve pc = new PolyCurve(); 37 | foreach (Curve s in segments) 38 | { 39 | if (s.IsLinear(tol)) 40 | pc.Append(new Line(s.PointAtStart, s.PointAtEnd)); 41 | else 42 | { 43 | Arc a = Arc.Unset; 44 | if (s.TryGetArc(out a, tol)) 45 | pc.Append(a); 46 | else 47 | return null; 48 | } 49 | } 50 | List segs = new List(); 51 | IfcCartesianPointList cpl = null; 52 | bool closed = pc.PointAtStart.DistanceTo(pc.PointAtEnd) < tol; 53 | if (twoD) 54 | { 55 | Point2d pt = new Point2d(pc.PointAtStart.X, pc.PointAtStart.Y); 56 | int pcounter = 1; 57 | List pts = new List(); 58 | pts.Add(pt); 59 | IfcLineIndex li = null; 60 | for (int icounter = 0; icounter < pc.SegmentCount; icounter++) 61 | { 62 | Curve c = pc.SegmentCurve(icounter); 63 | if (c.IsLinear(tol) && c.PointAtStart.DistanceTo(c.PointAtEnd) < tol) 64 | continue; 65 | if (c.IsLinear(tol)) 66 | { 67 | if (closed && icounter + 1 == segments.Length) 68 | { 69 | if (li != null) 70 | li.Add(1); 71 | else 72 | li = new IfcLineIndex(pcounter, 1); 73 | } 74 | else 75 | { 76 | pts.Add(new Point2d(c.PointAtEnd.X, c.PointAtEnd.Y)); 77 | if (li != null) 78 | li.Add(++pcounter); 79 | else 80 | li = new IfcLineIndex(pcounter++, pcounter); 81 | } 82 | } 83 | else 84 | { 85 | if (li != null) 86 | { 87 | segs.Add(li); 88 | li = null; 89 | } 90 | Point3d tp = c.PointAt(c.Domain.Mid); 91 | pts.Add(new Point2d(tp.X, tp.Y)); 92 | if (closed && icounter + 1 == segments.Length) 93 | segs.Add(new IfcArcIndex(pcounter++, pcounter++, 1)); 94 | else 95 | { 96 | pts.Add(new Point2d(c.PointAtEnd.X, c.PointAtEnd.Y)); 97 | segs.Add(new IfcArcIndex(pcounter++, pcounter++, pcounter)); 98 | } 99 | } 100 | } 101 | if (li != null) 102 | segs.Add(li); 103 | cpl = new IfcCartesianPointList2D(db, pts.ToArray()); 104 | } 105 | else 106 | { 107 | Point3d pt = pc.PointAtStart; 108 | int pcounter = 1; 109 | List pts = new List(); 110 | pts.Add(pt); 111 | List sis = new List(segments.Length); 112 | IfcLineIndex li = null; 113 | for (int icounter = 0; icounter < pc.SegmentCount; icounter++) 114 | { 115 | Curve c = pc.SegmentCurve(icounter); 116 | if (c.IsLinear(tol) && c.PointAtStart.DistanceTo(c.PointAtEnd) < tol) 117 | continue; 118 | if (c.IsLinear(tol)) 119 | { 120 | if (closed && icounter + 1 == segments.Length) 121 | { 122 | if (li != null) 123 | li.Add(0); 124 | else 125 | li = new IfcLineIndex(pcounter, 0); 126 | } 127 | else 128 | { 129 | pts.Add(c.PointAtEnd); 130 | if (li != null) 131 | li.Add(++pcounter); 132 | else 133 | li = new IfcLineIndex(pcounter++, pcounter); 134 | } 135 | } 136 | else 137 | { 138 | if (li != null) 139 | { 140 | segs.Add(li); 141 | li = null; 142 | } 143 | pts.Add(c.PointAt(c.Domain.Mid)); 144 | if (closed && icounter + 1 == segments.Length) 145 | segs.Add(new IfcArcIndex(pcounter++, pcounter, 0)); 146 | else 147 | { 148 | pts.Add(c.PointAtEnd); 149 | segs.Add(new IfcArcIndex(pcounter++, pcounter++, pcounter)); 150 | } 151 | } 152 | } 153 | if (li != null) 154 | segs.Add(li); 155 | cpl = new IfcCartesianPointList3D(db, pts.ToArray()); 156 | } 157 | return new IfcIndexedPolyCurve(cpl, segs) { }; 158 | } 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC L RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Linq; 23 | using System.Text; 24 | using System.Reflection; 25 | using System.IO; 26 | 27 | using Rhino.Geometry; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public partial class IfcLine 32 | { 33 | public Line Line() 34 | { 35 | Point3d pt = Pnt.Location; 36 | return new Line(pt, pt + Dir.Vector); 37 | } 38 | } 39 | public partial class IfcLinearElement 40 | { 41 | internal virtual Plane computePlaneAtLength(double length, double tol) 42 | { 43 | return Plane.Unset; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC M RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC O RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC P RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcPlacement 31 | { 32 | internal Point3d LocationPoint { get { return mLocation.Location; } } 33 | } 34 | public partial class IfcPoint 35 | { 36 | public virtual Point3d Location { get { return Point3d.Unset; } } 37 | } 38 | public partial class IfcPolyline 39 | { 40 | internal IfcPolyline(DatabaseIfc db, Line l) : base(db) { Points.Add(new IfcCartesianPoint(db, l.From)); Points.Add( new IfcCartesianPoint(db, l.To)); } 41 | internal IfcPolyline(DatabaseIfc db, Polyline pl) : base(db) 42 | { 43 | if (pl.IsClosed) 44 | { 45 | int ilast = pl.Count - 1; 46 | IfcCartesianPoint cp = new IfcCartesianPoint(db, pl[0]); 47 | Points.Add(cp); 48 | for (int icounter = 1; icounter < ilast; icounter++) 49 | Points.Add(new IfcCartesianPoint(db, pl[icounter])); 50 | Points.Add(cp); 51 | } 52 | else 53 | Points = new STEP.LIST(pl.ConvertAll(x => new IfcCartesianPoint(db, x))); 54 | } 55 | } 56 | public partial class IfcProfileDef 57 | { 58 | internal virtual Transform Transform() { return Rhino.Geometry.Transform.Identity; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC R RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcRationalBSplineCurveWithKnots 31 | { 32 | internal IfcRationalBSplineCurveWithKnots(DatabaseIfc db, NurbsCurve nc, bool twoD) 33 | : base(db, nc, twoD) 34 | { 35 | mWeightsData = new List(nc.Points.Count); 36 | for (int icounter = 0; icounter < nc.Points.Count; icounter++) 37 | mWeightsData.Add(nc.Points[icounter].Weight); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC S RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcStructuralLoadLinearForce 31 | { 32 | public Vector3d LinearForce 33 | { 34 | get { return new Vector3d(mLinearForceX, mLinearForceY, mLinearForceZ); } 35 | set 36 | { 37 | if (value.IsValid) 38 | { 39 | mLinearForceX = value.X; 40 | mLinearForceY = value.Y; 41 | mLinearForceZ = value.Z; 42 | } 43 | else 44 | mLinearForceX = mLinearForceY = mLinearForceZ = 0; 45 | } 46 | } 47 | public Vector3d LinearMoment 48 | { 49 | get { return new Vector3d(mLinearMomentX, mLinearMomentY, mLinearMomentZ); } 50 | set 51 | { 52 | if (value.IsValid) 53 | { 54 | mLinearMomentX = value.X; 55 | mLinearMomentY = value.Y; 56 | mLinearMomentZ = value.Z; 57 | } 58 | else 59 | mLinearMomentX = mLinearMomentY = mLinearMomentZ = 0; 60 | } 61 | } 62 | } 63 | 64 | public partial class IfcStructuralLoadPlanarForce 65 | { 66 | public Vector3d PlanarForce 67 | { 68 | get { return new Vector3d(PlanarForceX, PlanarForceY, PlanarForceZ); } 69 | set 70 | { 71 | if (value.IsValid) 72 | { 73 | mPlanarForceX = value.X; 74 | mPlanarForceY = value.Y; 75 | mPlanarForceZ = value.Z; 76 | } 77 | else 78 | mPlanarForceX = mPlanarForceY = mPlanarForceZ = 0; 79 | } 80 | } 81 | } 82 | public partial class IfcStructuralLoadSingleDisplacement 83 | { 84 | public Vector3d Displacement 85 | { 86 | get { return new Vector3d(mDisplacementX, mDisplacementY, mDisplacementZ); } 87 | set 88 | { 89 | if (value.IsValid) 90 | { 91 | mDisplacementX = value.X; 92 | mDisplacementY = value.Y; 93 | mDisplacementZ = value.Z; 94 | } 95 | else 96 | mDisplacementX = mDisplacementY = mDisplacementZ = 0; 97 | } 98 | } 99 | public Vector3d RotationalDisplacement 100 | { 101 | get { return new Vector3d(mRotationalDisplacementRX, mRotationalDisplacementRY, mRotationalDisplacementRZ); } 102 | set 103 | { 104 | if (value.IsValid) 105 | { 106 | mRotationalDisplacementRX = value.X; 107 | mRotationalDisplacementRY = value.Y; 108 | mRotationalDisplacementRZ = value.Z; 109 | } 110 | else 111 | mRotationalDisplacementRX = mRotationalDisplacementRY = mRotationalDisplacementRZ = 0; 112 | } 113 | } 114 | } 115 | public partial class IfcStructuralLoadSingleForce 116 | { 117 | public Vector3d Force 118 | { 119 | get { return new Vector3d(ForceX, ForceY, ForceZ); } 120 | set 121 | { 122 | if (value.IsValid) 123 | { 124 | mForceX = value.X; 125 | mForceY = value.Y; 126 | mForceZ = value.Z; 127 | } 128 | else 129 | mForceX = mForceY = mForceZ = 0; 130 | } 131 | } 132 | public Vector3d Moment 133 | { 134 | get { return new Vector3d(MomentX, MomentY, MomentZ); } 135 | set 136 | { 137 | if (value.IsValid) 138 | { 139 | mMomentX = value.X; 140 | mMomentY = value.Y; 141 | mMomentZ = value.Z; 142 | } 143 | else 144 | mMomentX = mMomentY = mMomentZ = 0; 145 | } 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC T RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | public partial class IfcTrimmedCurve 31 | { 32 | public IfcTrimmedCurve(IfcCartesianPoint s, IfcCartesianPoint e) : base(s.mDatabase) 33 | { 34 | BasisCurve = new IfcLine(s, new IfcVector(s.mDatabase,e.Location- s.Location)); 35 | mTrim1 = new IfcTrimmingSelect(s); 36 | mTrim2 = new IfcTrimmingSelect(e); 37 | mMasterRepresentation = IfcTrimmingPreference.CARTESIAN; 38 | mSenseAgreement = true; 39 | } 40 | internal IfcTrimmedCurve(DatabaseIfc db, Arc a, bool twoD, IfcCartesianPoint optStrt, out IfcCartesianPoint end) 41 | :this(db, a, twoD) 42 | { 43 | Point3d o = a.Plane.Origin, s = a.StartPoint, e = a.EndPoint; 44 | Vector3d x = s - o; 45 | if (optStrt == null) 46 | mTrim1.CartesianPoint = twoD ? new IfcCartesianPoint(db, new Point2d(s.X, s.Y)) : new IfcCartesianPoint(db, s); 47 | else 48 | mTrim1.CartesianPoint = optStrt; 49 | end = twoD ? new IfcCartesianPoint(db, new Point2d(e.X, e.Y)) : new IfcCartesianPoint(db, e); 50 | mTrim2.CartesianPoint = end; 51 | 52 | } 53 | internal IfcTrimmedCurve(DatabaseIfc db, Arc a, bool twoD) : base(db) 54 | { 55 | Point3d o = a.Plane.Origin, s = a.StartPoint, e = a.EndPoint; 56 | Vector3d x = s - o; 57 | double angleFactor = mDatabase.Context.UnitsInContext.ScaleSI(IfcUnitEnum.PLANEANGLEUNIT); 58 | mSenseAgreement = true; 59 | if (twoD) 60 | { 61 | if (a.Plane.ZAxis.Z < 0) 62 | { 63 | mSenseAgreement = false; 64 | x = e - o; 65 | IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y)); 66 | BasisCurve = new IfcCircle(ap, a.Radius); 67 | mTrim1 = new IfcTrimmingSelect(a.Angle / angleFactor); 68 | mTrim2 = new IfcTrimmingSelect(0); 69 | } 70 | else 71 | { 72 | IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y)); 73 | BasisCurve = new IfcCircle(ap, a.Radius); 74 | mTrim1 = new IfcTrimmingSelect(0); 75 | mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor); 76 | } 77 | } 78 | else 79 | { 80 | Vector3d y = Vector3d.CrossProduct(a.Plane.ZAxis, x); 81 | Plane pl = new Plane(o, x, y); 82 | IfcAxis2Placement3D ap = new IfcAxis2Placement3D(db, pl); 83 | BasisCurve = new IfcCircle(ap, a.Radius); 84 | mTrim1 = new IfcTrimmingSelect(0); 85 | mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor); 86 | } 87 | mMasterRepresentation = IfcTrimmingPreference.PARAMETER; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC U RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC V RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | using Rhino.Geometry.Intersect; 28 | 29 | namespace GeometryGym.Ifc 30 | { 31 | public partial class IfcVector 32 | { 33 | internal Vector3d Vector { get { return Orientation.Vector3d * mMagnitude; } } 34 | 35 | public IfcVector(DatabaseIfc db, Vector2d v) : base(db) { Orientation = new IfcDirection(db, v); mMagnitude = v.Length; } 36 | public IfcVector(DatabaseIfc db, Vector3d v) : base(db) { Orientation = new IfcDirection(db, v); mMagnitude = v.Length; } 37 | } 38 | public partial class IfcVirtualGridIntersection 39 | { 40 | internal Vector3d OffsetVector { get { return new Vector3d(mOffsetDistances.Item1, mOffsetDistances.Item2, double.IsNaN(mOffsetDistances.Item3) ? 0 : mOffsetDistances.Item3); } } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC W RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Extensions/RhinoCommon IFC/IFC Z RhinoCommon.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2016 Geometry Gym Pty Ltd 3 | 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software 5 | // and associated documentation files (the "Software"), to deal in the Software without restriction, 6 | // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 8 | // subject to the following conditions: 9 | 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial 11 | // portions of the Software. 12 | 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 14 | // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 16 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 17 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | using System; 20 | using System.Collections.Generic; 21 | using System.Collections; 22 | using System.Text; 23 | using System.Reflection; 24 | using System.IO; 25 | 26 | using Rhino.Geometry; 27 | 28 | namespace GeometryGym.Ifc 29 | { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /GettingStarted.md: -------------------------------------------------------------------------------- 1 | # GeometryGymIfc toolkit basic principles 2 | 3 | # Installation 4 | 5 | GeometryGymIfc is available via Nuget. 6 | When starting a new project, open the Nuget package manager and search for `GeometryGymIfc` ([see here](https://www.nuget.org/packages/GeometryGymIFC/)) 7 | 8 | Installing via package manager console: 9 | 10 | Install-Package GeometryGymIFC 11 | 12 | If a specific version is of interest, add a version flag: 13 | 14 | Install-Package GeometryGymIFC -Version 0.1.6 15 | 16 | Add the reference to your code: 17 | 18 | using GeometryGym.Ifc; 19 | 20 | 21 | 22 | # Create, open, and save an Ifc file 23 | 24 | ## Create new Ifc model 25 | 26 | var database = new DatabaseIfc(ModelView.Ifc4X3_RC2); 27 | 28 | When creating a new database, the user can choose if some boilerplate data should be generated automatically. 29 | 30 | var database = new DatabaseIfc(true, ModelView.Ifc4X3_RC2). 31 | 32 | The first argument triggers the boilerplate generation. 33 | If the constructor is called only be the desired ModelView item, the boilerplate is created by default. 34 | 35 | ## Open an existing Ifc model 36 | 37 | string path = ""; 38 | var database = new DatabaseIfc(path); 39 | 40 | ## Save model in STEP-P21 41 | 42 | database.WriteFile("myIfcFile.ifc"); 43 | 44 | 48 | 54 | 58 | 59 | 66 | 67 | ## Database factory 68 | 69 | Once the `DatabaseIfc` instance is created, it offers various settings 70 | 71 | ### Example 1: Set the application developer: 72 | 73 | database.Factory.ApplicationDeveloper = "Developer Name"; 74 | 75 | ### Example 2: Set the application name: 76 | 77 | database.Factory.ApplicationFullName = "IFC Application"; 78 | 79 | ### Example 3: Turn off the auto generation of an IfcOwnerHistory: 80 | 81 | database.Factory.Options.GenerateOwnerHistory = false; 82 | 83 | ### Example 4: Add a textual comment in the resulting `*.ifc` file: 84 | 85 | var element = new IfcBuiltElement(database); 86 | element.AddComment("some comment"); 87 | 88 | results in 89 | 90 | /* some comment */ 91 | #1= IFCBUILTELEMENT('3X4z6TQDjEfweLPwC9InC4',#7,$,$,$,$,$,$); 92 | 93 | 103 | 104 | # General conventions 105 | 106 | ## Constructors 107 | Constructors for IFC classes are typically require all non-optional attributes. 108 | Passing `null` into any constructor is typically not intended and leads to non schema compliant IFC files. 109 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Geometry Gym Pty Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | ## Third Party Licenses ## 24 | ###Newtonsoft JSON### 25 | https://github.com/JamesNK/Newtonsoft.Json 26 | https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md 27 | (MIT license) 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GeometryGymIFC 2 | C# classes to generate and parse OpenBIM IFC (Industry Foundation Class) files 3 | 4 | These classes simultaneously support IFC2x3, IFC4 and Infrastructure extensions such as IFC4.3 and IFC4.4. 5 | We provide early support for IFC extension projects and new versions. 6 | 7 | Documentation on these classes is available on Building Smart websites, such as 8 | [https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/](https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/) (Browse Alphabetical Listings) 9 | Documentation for other versions of IFC are available https://technical.buildingsmart.org/standards/ifc/ifc-schema-specifications/ 10 | 11 | 12 | Projects to demonstrate the classes include 13 | https://github.com/jmirtsch/GeometryGymIFCExamples 14 | 15 | Please contact me in advance of making significant changes to the core code, as 16 | it's possible existing code might be ported to the open source repository if I've 17 | already implemented it. 18 | --------------------------------------------------------------------------------