From f0ce43b2db56e2e9335d1f05a10295fc3e140478 Mon Sep 17 00:00:00 2001 From: Jon Mirtschin Date: Wed, 22 Feb 2023 14:34:16 +1100 Subject: [PATCH] v0.2.12 --- Core/IFC/DatabaseIFC.cs | 2 +- Core/IFC/Enumerations.cs | 15 ++++++++---- Core/IFC/IFC A.cs | 4 ++-- Core/IFC/IFC S.cs | 23 ++----------------- Core/IFC/IFC V.cs | 2 +- Core/IFC/JSON/DatabaseIFC JSON.cs | 1 - Core/IFC/STEP/IFC C STEP.cs | 6 ++--- Core/IFC/STEP/IFC G STEP.cs | 4 ++-- Core/IFC/STEP/IFC S STEP.cs | 2 +- Core/IFC/XML/IFC R XML.cs | 8 ++++++- .../GeometryGymIFC/Properties/AssemblyInfo.cs | 4 ++-- .../GeometryGymIFCRhinoCommonx64.csproj | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../GeometryGymIFCcore.csproj | 6 ++--- 14 files changed, 39 insertions(+), 46 deletions(-) diff --git a/Core/IFC/DatabaseIFC.cs b/Core/IFC/DatabaseIFC.cs index 3ec3618..5a518dd 100644 --- a/Core/IFC/DatabaseIFC.cs +++ b/Core/IFC/DatabaseIFC.cs @@ -836,7 +836,7 @@ namespace GeometryGym.Ifc private BaseClassIfc duplicateWorker(BaseClassIfc entity, DuplicateOptions options) { BaseClassIfc result = null; - if (mDatabase.Release != entity.mDatabase.Release) + if (entity.mDatabase == null || mDatabase.Release != entity.mDatabase.Release) { if (mDatabase.Release < ReleaseVersion.IFC4X3_RC1) { diff --git a/Core/IFC/Enumerations.cs b/Core/IFC/Enumerations.cs index 3011371..8a5ad52 100644 --- a/Core/IFC/Enumerations.cs +++ b/Core/IFC/Enumerations.cs @@ -23,10 +23,17 @@ namespace GeometryGym.Ifc { public enum ShapeRepresentationType { - Curve2D, Annotation2D, GeometricSet, GeometricCurveSet, SurfaceModel, SolidModel, SweptSolid, CSG, Clipping, AdvancedSweptSolid, Brep, BoundingBox, SectionedSpine, MappedRepresentation, - [VersionAdded(ReleaseVersion.IFC4)] Point, [VersionAdded(ReleaseVersion.IFC4)] PointCloud, [VersionAdded(ReleaseVersion.IFC4)] Curve, [VersionAdded(ReleaseVersion.IFC4)] Curve3D, - [VersionAdded(ReleaseVersion.IFC4)] Surface, [VersionAdded(ReleaseVersion.IFC4)] Surface2D, [VersionAdded(ReleaseVersion.IFC4)] Surface3D, [VersionAdded(ReleaseVersion.IFC4)] FillArea, - [VersionAdded(ReleaseVersion.IFC4)] Text, [VersionAdded(ReleaseVersion.IFC4)] Tessellation, [VersionAdded(ReleaseVersion.IFC4)] AdvancedBrep, [VersionAdded(ReleaseVersion.IFC4)] LightSource + Curve2D, Annotation2D, GeometricSet, GeometricCurveSet, SurfaceModel, SolidModel, SweptSolid, CSG, Clipping, + AdvancedSweptSolid, Brep, BoundingBox, SectionedSpine, MappedRepresentation, + [VersionAdded(ReleaseVersion.IFC4)] Point, [VersionAdded(ReleaseVersion.IFC4)] PointCloud, + [VersionAdded(ReleaseVersion.IFC4)] Curve, [VersionAdded(ReleaseVersion.IFC4)] Curve3D, + [VersionAdded(ReleaseVersion.IFC4)] Surface, [VersionAdded(ReleaseVersion.IFC4)] Surface2D, + [VersionAdded(ReleaseVersion.IFC4)] Surface3D, [VersionAdded(ReleaseVersion.IFC4)] FillArea, + [VersionAdded(ReleaseVersion.IFC4)] Text, [VersionAdded(ReleaseVersion.IFC4)] Tessellation, + [VersionAdded(ReleaseVersion.IFC4)] AdvancedBrep, [VersionAdded(ReleaseVersion.IFC4)] AdvancedSurface, + [VersionAdded(ReleaseVersion.IFC4)] LightSource, [VersionAdded(ReleaseVersion.IFC4)] SurfaceOrSolidModel , + [VersionAdded(ReleaseVersion.IFC4X3)] SectionedSurface, [VersionAdded(ReleaseVersion.IFC4X3)] Segment + }; [VersionAdded(ReleaseVersion.IFC4)] diff --git a/Core/IFC/IFC A.cs b/Core/IFC/IFC A.cs index cdfcb82..ac0ef01 100644 --- a/Core/IFC/IFC A.cs +++ b/Core/IFC/IFC A.cs @@ -1077,7 +1077,7 @@ namespace GeometryGym.Ifc throw new NotImplementedException("XX Not Implemented horizontal segment " + PredefinedType.ToString()); IfcCurveSegment curveSegment = new IfcCurveSegment(IfcTransitionCode.CONTSAMEGRADIENTSAMECURVATURE, placement, start, length, parentCurve); if (mDesignerOf != null) - mDesignerOf.Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis), curveSegment, ShapeRepresentationType.Curve2D)); + mDesignerOf.Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis), curveSegment, ShapeRepresentationType.Segment)); return curveSegment; } @@ -1302,7 +1302,7 @@ namespace GeometryGym.Ifc throw new NotImplementedException("XX Not Implemented vertical segment " + PredefinedType.ToString()); if (mDesignerOf != null) - mDesignerOf.Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis), curveSegment, ShapeRepresentationType.Curve2D)); + mDesignerOf.Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis), curveSegment, ShapeRepresentationType.Segment)); return curveSegment; } diff --git a/Core/IFC/IFC S.cs b/Core/IFC/IFC S.cs index 652a8b4..3d43c78 100644 --- a/Core/IFC/IFC S.cs +++ b/Core/IFC/IFC S.cs @@ -532,26 +532,6 @@ namespace GeometryGym.Ifc [Serializable] public partial class IfcShapeRepresentation : IfcShapeModel { - /*Curve2D 2 dimensional curve -Curve3D 3 dimensional curve -Surface2D 2 dimensional surface (a region on ground view) -Surface3D 3 dimensional surface -GeometricSet points, curves, surfaces (2 or 3 dimensional) - GeometricCurveSet points, curves (2 or 3 dimensional) -Annotation2D points, curves (2 or 3 dimensional), hatches and text (2 dimensional) -SurfaceModel face based and shell based surface model -SolidModel including swept solid, Boolean results and Brep bodies -more specific types are: - SweptSolid swept area solids, by extrusion and revolution, excluding tapered sweeps - AdvancedSweptSolid swept area solids created by sweeping a profile aint a directrix, and tapered sweeps - Brep faceted Brep's with and without voids - AdvancedBrep Brep's based on advanced faces, with b-spline surface geometry, with and without voids - CSG Boolean results of operations between solid models, half spaces and Boolean results - Clipping Boolean differences between swept area solids, half spaces and Boolean results -additional types some additional representation types are given: - BoundingBox simplistic 3D representation by a bounding box - SectionedSpine cross section based representation of a spine curve and planar cross sections. It can represent a surface or a solid and the interpolations of the between the cross sections is not defined - MappedRepresentation*/ internal IfcShapeRepresentation() : base() { } internal IfcShapeRepresentation(DatabaseIfc db, IfcShapeRepresentation r, DuplicateOptions options) : base(db, r, options) { } public IfcShapeRepresentation(IfcGeometricRepresentationItem representation, ShapeRepresentationType representationType) : base(representation.mDatabase.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Body), representation) { RepresentationType = representationType.ToString(); } @@ -587,9 +567,10 @@ additional types some additional representation types are given: { IfcProfileDef pd = spine.CrossSections[0]; if (pd.mProfileType == IfcProfileTypeEnum.CURVE) - RepresentationType = "Surface3D"; + RepresentationType = ShapeRepresentationType.Surface3D.ToString(); } } + public IfcShapeRepresentation(IfcSectionedSurface surface) : base(surface) { RepresentationType = ShapeRepresentationType.SectionedSurface.ToString(); } public IfcShapeRepresentation(IfcShellBasedSurfaceModel surface) : base(surface) { RepresentationType = ShapeRepresentationType.SurfaceModel.ToString(); } public IfcShapeRepresentation(IfcSurface surface) : base(surface) { RepresentationType = ShapeRepresentationType.Surface3D.ToString(); } public IfcShapeRepresentation(IfcExtrudedAreaSolid extrudedAreaSolid) : base(extrudedAreaSolid) { RepresentationType = ShapeRepresentationType.SweptSolid.ToString(); } diff --git a/Core/IFC/IFC V.cs b/Core/IFC/IFC V.cs index a801f43..e526034 100644 --- a/Core/IFC/IFC V.cs +++ b/Core/IFC/IFC V.cs @@ -324,7 +324,7 @@ namespace GeometryGym.Ifc public class IfcCompoundPlaneAngleMeasure //: IfcDerivedMeasureValue { internal int mDegrees = 0, mMinutes = 0, mSeconds = 0, mMicroSeconds = 0; - public IfcCompoundPlaneAngleMeasure(double angleDegrees) //: base(angleDegrees) + public IfcCompoundPlaneAngleMeasure(double angleDegrees) { double ang = Math.Abs(angleDegrees); int sign = angleDegrees < 0 ? -1 : 1; diff --git a/Core/IFC/JSON/DatabaseIFC JSON.cs b/Core/IFC/JSON/DatabaseIFC JSON.cs index 0592708..95a8d6c 100644 --- a/Core/IFC/JSON/DatabaseIFC JSON.cs +++ b/Core/IFC/JSON/DatabaseIFC JSON.cs @@ -371,7 +371,6 @@ namespace GeometryGym.Ifc public static partial class JsonIFCExtensions { - #if (NEWTONSOFT) public static T GetValue(this JToken node) { diff --git a/Core/IFC/STEP/IFC C STEP.cs b/Core/IFC/STEP/IFC C STEP.cs index c96711d..19447a0 100644 --- a/Core/IFC/STEP/IFC C STEP.cs +++ b/Core/IFC/STEP/IFC C STEP.cs @@ -207,7 +207,7 @@ namespace GeometryGym.Ifc protected override string BuildStringSTEP(ReleaseVersion release) { return "(" + string.Join(",", mCoordList.Select(x => "(" + formatLength(x.Item1) + "," + formatLength(x.Item2) + ")")) + ")" + - (release < ReleaseVersion.IFC4X1 ? "" : (mTagList == null || mTagList.Count == 0 ? ",$" : ",(" + string.Join(",", mTagList.Select(x=> (string.IsNullOrEmpty(x) ? "$" : "'" + ParserSTEP.Encode(x) + "'"))) + ")" )); + (release < ReleaseVersion.IFC4X1 ? "" : (mTagList == null || mTagList.Count == 0 ? ",$" : ",(" + string.Join(",", mTagList.Select(x=> (string.IsNullOrEmpty(x) ? "''" : "'" + ParserSTEP.Encode(x) + "'"))) + ")" )); } internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) { @@ -260,7 +260,7 @@ namespace GeometryGym.Ifc textWriter.Write("))"); if(release >= ReleaseVersion.IFC4X1) - textWriter.Write(mTagList == null || mTagList.Count == 0 ? ",$" : ",(" + string.Join(",", mTagList.Select(x => (string.IsNullOrEmpty(x) ? "$" : "'" + ParserSTEP.Encode(x) + "'"))) + ")"); + textWriter.Write(mTagList == null || mTagList.Count == 0 ? ",$" : ",(" + string.Join(",", mTagList.Select(x => (string.IsNullOrEmpty(x) ? "''" : "'" + ParserSTEP.Encode(x) + "'"))) + ")"); WriteStepLineWorkerSuffix(textWriter); } @@ -286,7 +286,7 @@ namespace GeometryGym.Ifc } stringBuilder.Append("))"); return stringBuilder.ToString() + - (release < ReleaseVersion.IFC4X1 ? "" : (mTagList == null || mTagList.Count == 0 ? ",$" : ",(" + string.Join(",", mTagList.Select(x => (string.IsNullOrEmpty(x) ? "$" : "'" + ParserSTEP.Encode(x) + "'"))) + ")")); + (release < ReleaseVersion.IFC4X1 ? "" : (mTagList == null || mTagList.Count == 0 ? ",$" : ",(" + string.Join(",", mTagList.Select(x => (string.IsNullOrEmpty(x) ? "''" : "'" + ParserSTEP.Encode(x) + "'"))) + ")")); } internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) { diff --git a/Core/IFC/STEP/IFC G STEP.cs b/Core/IFC/STEP/IFC G STEP.cs index 4f9fe6c..37d2e6a 100644 --- a/Core/IFC/STEP/IFC G STEP.cs +++ b/Core/IFC/STEP/IFC G STEP.cs @@ -80,8 +80,8 @@ namespace GeometryGym.Ifc if (release < ReleaseVersion.IFC4X3_ADD1) return ""; return base.BuildStringSTEP(release) + - (string.IsNullOrEmpty(mPrimeMeridian) ? "$," : "'" + ParserSTEP.Encode(mPrimeMeridian) + "',") + - (mAngleUnit == null ? "$" : "#" + mAngleUnit.StepId) + (mHeightUnit == null ? "$" : "#" + mHeightUnit.StepId); + (string.IsNullOrEmpty(mPrimeMeridian) ? ",$," : ",'" + ParserSTEP.Encode(mPrimeMeridian) + "',") + + (mAngleUnit == null ? "$" : "#" + mAngleUnit.StepId) + (mHeightUnit == null ? ",$" : ",#" + mHeightUnit.StepId); } internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) { diff --git a/Core/IFC/STEP/IFC S STEP.cs b/Core/IFC/STEP/IFC S STEP.cs index 565556c..8f6830a 100644 --- a/Core/IFC/STEP/IFC S STEP.cs +++ b/Core/IFC/STEP/IFC S STEP.cs @@ -146,7 +146,7 @@ namespace GeometryGym.Ifc result += ",(" + string.Join(",", mCrossSectionPositionMeasures_OBSOLETE.ConvertAll(x => "#" + x.ToString())); else result += ",(" + string.Join(",", CrossSectionPositions.Select(x => "#" + x.StepId)); - return result + (release < ReleaseVersion.IFC4X3 ? (mFixedAxisVertical ? "),.T." : "),.F.") : ""); + return result + (release < ReleaseVersion.IFC4X3 ? (mFixedAxisVertical ? "),.T." : "),.F.") : ")"); } internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary dictionary) { diff --git a/Core/IFC/XML/IFC R XML.cs b/Core/IFC/XML/IFC R XML.cs index 796258e..001fef7 100644 --- a/Core/IFC/XML/IFC R XML.cs +++ b/Core/IFC/XML/IFC R XML.cs @@ -1018,7 +1018,13 @@ namespace GeometryGym.Ifc } public partial class IfcRigidOperation { - + internal override void SetXML(XmlElement xml, BaseClassIfc host, Dictionary processed) + { + base.SetXML(xml, host, processed); + xml.AppendChild(convert(xml.OwnerDocument, FirstCoordinate as IfcValue, "FirstCoordinate", mDatabase.mXmlNamespace)); + xml.AppendChild(convert(xml.OwnerDocument, SecondCoordinate as IfcValue, "SecondCoordinate", mDatabase.mXmlNamespace)); + xml.SetAttribute("Height", mHeight.ToString()); + } } public partial class IfcRoot { diff --git a/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs b/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs index 503f1e2..b9de7c9 100644 --- a/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs +++ b/DLL Projects/GeometryGymIFC/Properties/AssemblyInfo.cs @@ -20,8 +20,8 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyVersion("0.2.09.0")] -[assembly: AssemblyFileVersion("0.2.09.0")] +[assembly: AssemblyVersion("0.2.12.0")] +[assembly: AssemblyFileVersion("0.2.12.0")] [assembly: AssemblyTitle("GeometryGymIFC")] [assembly: AssemblyDescription("C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files")] diff --git a/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj b/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj index 4d68f1f..c21d06d 100644 --- a/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj +++ b/DLL Projects/GeometryGymIFCRhinoCommonx64/GeometryGymIFCRhinoCommonx64.csproj @@ -36,7 +36,7 @@ true bin\ - TRACE;DEBUG;NEWTONSOFT + TRACE;DEBUG;NEWTONSOFT OPEN_SOURCE full x64 prompt @@ -44,7 +44,7 @@ bin\x64\Release\ - TRACE;NEWTONSOFT + TRACE;NEWTONSOFT OPEN_SOURCE true pdbonly x64 diff --git a/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs b/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs index ae3dbd2..fc283c5 100644 --- a/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs +++ b/DLL Projects/GeometryGymIFCRhinoCommonx64/Properties/AssemblyInfo.cs @@ -20,8 +20,8 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyVersion("0.2.09.0")] -[assembly: AssemblyFileVersion("0.2.09.0")] +[assembly: AssemblyVersion("0.2.12.0")] +[assembly: AssemblyFileVersion("0.2.12.0")] // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. diff --git a/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj b/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj index 1c70515..e56f094 100644 --- a/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj +++ b/DLL Projects/GeometryGymIFCcore/GeometryGymIFCcore.csproj @@ -3,7 +3,7 @@ netstandard2.0 GeometryGymIFC_Core - 0.2.09 + 0.2.12 Geometry Gym GeometryGymIFC_Core .Net Standard 2.0 C# classes to generate and parse buildingSMART IFC (Industry Foundation Class) files @@ -14,8 +14,8 @@ License https://github.com/GeometryGym/GeometryGymIFC/blob/master/LICENSE https://github.com/GeometryGym/GeometryGymIFC BIM, IFC, openBIM - 0.2.09.0 - 0.2.09.0 + 0.2.12.0 + 0.2.12.0