From 24026f3e78906eb846d31601ed6caf02a95ada77 Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Thu, 24 Oct 2024 05:13:44 +0100 Subject: [PATCH 1/2] template for symbol objects --- src/Speckle.Objects/Interfaces.cs | 11 ++++++ src/Speckle.Objects/Other/SymbolLayer.cs | 45 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/Speckle.Objects/Other/SymbolLayer.cs diff --git a/src/Speckle.Objects/Interfaces.cs b/src/Speckle.Objects/Interfaces.cs index 8610ad4c..74a76414 100644 --- a/src/Speckle.Objects/Interfaces.cs +++ b/src/Speckle.Objects/Interfaces.cs @@ -84,6 +84,17 @@ public interface ITransformable : ISpeckleObject bool TransformTo(Transform transform, out ITransformable transformed); } +/// +/// +public interface ISymbolLayer +{ + string symbolUnits { get; set; } + LineStyleType lineType { get; set; } + double lineWidth { get; set; } + int lineColor { get; set; } + int displayPriority { get; set; } +} + #endregion #region GIS diff --git a/src/Speckle.Objects/Other/SymbolLayer.cs b/src/Speckle.Objects/Other/SymbolLayer.cs new file mode 100644 index 00000000..6f26fae8 --- /dev/null +++ b/src/Speckle.Objects/Other/SymbolLayer.cs @@ -0,0 +1,45 @@ +using Speckle.Sdk.Models; + +namespace Speckle.Objects.Other; + +[SpeckleType("Objects.Other.Symbol")] +public class Symbol : Base +{ + public List symbolLayers { get; set; } +} + +[SpeckleType("Objects.Other.MarkerSymbolLayer")] +public class MarkerSymbolLayer : Base, ISymbolLayer +{ + public string symbolUnits { get; set; } + public LineStyleType lineType { get; set; } + public double lineWidth { get; set; } + public int lineColor { get; set; } + public int displayPriority { get; set; } + + public int fillColor { get; set; } + public MarkerType type { get; set; } +} + +[SpeckleType("Objects.Other.LineSymbolLayer")] +public class LineSymbolLayer : Base, ISymbolLayer +{ + public string symbolUnits { get; set; } + public LineStyleType lineType { get; set; } + public double lineWidth { get; set; } + public int lineColor { get; set; } + public int displayPriority { get; set; } +} + +[SpeckleType("Objects.Other.FillSymbolLayer")] +public class FillSymbolLayer : Base, ISymbolLayer +{ + public string symbolUnits { get; set; } + public LineStyleType lineType { get; set; } + public double lineWidth { get; set; } + public int lineColor { get; set; } + public int displayPriority { get; set; } + + public int fillColor { get; set; } + public FillType type { get; set; } +} From a9675b24277e0de18ef1611cb6c00dff500358e9 Mon Sep 17 00:00:00 2001 From: KatKatKateryna Date: Thu, 24 Oct 2024 05:28:04 +0100 Subject: [PATCH 2/2] complete missing types --- src/Speckle.Objects/Interfaces.cs | 2 +- src/Speckle.Objects/Other/SymbolEnums.cs | 25 ++++++++++++++++++++++++ src/Speckle.Objects/Other/SymbolLayer.cs | 7 ++++--- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 src/Speckle.Objects/Other/SymbolEnums.cs diff --git a/src/Speckle.Objects/Interfaces.cs b/src/Speckle.Objects/Interfaces.cs index 74a76414..4ab7ecf1 100644 --- a/src/Speckle.Objects/Interfaces.cs +++ b/src/Speckle.Objects/Interfaces.cs @@ -89,7 +89,7 @@ public interface ITransformable : ISpeckleObject public interface ISymbolLayer { string symbolUnits { get; set; } - LineStyleType lineType { get; set; } + LineType lineType { get; set; } double lineWidth { get; set; } int lineColor { get; set; } int displayPriority { get; set; } diff --git a/src/Speckle.Objects/Other/SymbolEnums.cs b/src/Speckle.Objects/Other/SymbolEnums.cs new file mode 100644 index 00000000..987ace5a --- /dev/null +++ b/src/Speckle.Objects/Other/SymbolEnums.cs @@ -0,0 +1,25 @@ +namespace Speckle.Objects.Other; + +public enum LineType +{ + Solid, + Dashed, + Dotted, +} + +public enum MarkerType +{ + Simple, +} + +public enum MarkerShape +{ + Circle, + Square, + Cross, +} + +public enum FillType +{ + Simple, +} diff --git a/src/Speckle.Objects/Other/SymbolLayer.cs b/src/Speckle.Objects/Other/SymbolLayer.cs index 6f26fae8..85028e5a 100644 --- a/src/Speckle.Objects/Other/SymbolLayer.cs +++ b/src/Speckle.Objects/Other/SymbolLayer.cs @@ -12,11 +12,12 @@ public class Symbol : Base public class MarkerSymbolLayer : Base, ISymbolLayer { public string symbolUnits { get; set; } - public LineStyleType lineType { get; set; } + public LineType lineType { get; set; } public double lineWidth { get; set; } public int lineColor { get; set; } public int displayPriority { get; set; } + public double angle { get; set; } public int fillColor { get; set; } public MarkerType type { get; set; } } @@ -25,7 +26,7 @@ public class MarkerSymbolLayer : Base, ISymbolLayer public class LineSymbolLayer : Base, ISymbolLayer { public string symbolUnits { get; set; } - public LineStyleType lineType { get; set; } + public LineType lineType { get; set; } public double lineWidth { get; set; } public int lineColor { get; set; } public int displayPriority { get; set; } @@ -35,7 +36,7 @@ public class LineSymbolLayer : Base, ISymbolLayer public class FillSymbolLayer : Base, ISymbolLayer { public string symbolUnits { get; set; } - public LineStyleType lineType { get; set; } + public LineType lineType { get; set; } public double lineWidth { get; set; } public int lineColor { get; set; } public int displayPriority { get; set; }