From fbcb8ffdaa1e06a5093028f0ce07dcd51cde1754 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 27 Jun 2024 11:57:39 +0100 Subject: [PATCH 1/6] V3 core sdk via nuget (#3533) * initial nuget references * fmt * remove unused revit dependency * Don't use new solution * remove unused file * update core --- .editorconfig | 2 + DUI3-DX.slnf | 9 +- .../packages.lock.json | 67 ++++++------ .../packages.lock.json | 67 ++++++------ .../Speckle.Connectors.Civil3d2024.csproj | 1 - .../packages.lock.json | 78 +++++++------- .../packages.lock.json | 67 ++++++------ .../Plugin/RevitExternalApplication.cs | 1 - .../Plugin/Speckle.Connectors.Rhino7Plugin.cs | 1 - .../packages.lock.json | 67 ++++++------ .../packages.lock.json | 63 +++++------ .../Speckle.Converters.ArcGIS3.csproj | 5 +- .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../XyzConversionToPointTests.cs | 2 - .../packages.lock.json | 65 +++++------ .../packages.lock.json | 63 +++++------ .../Helpers/DisplayValueExtractor.cs | 30 +++--- .../Helpers/ParameterObjectAssigner.cs | 11 +- .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../packages.lock.json | 102 +++++++++--------- .../Speckle.Connectors.DUI.csproj | 3 +- .../Speckle.Connectors.DUI/packages.lock.json | 50 ++++----- .../SpeckleContainerBuilder.cs | 1 - .../Speckle.Autofac/ExceptionExtensions.cs | 45 ++++++++ .../Speckle.Autofac/Speckle.Autofac.csproj | 4 - .../Speckle.Connectors.Utils.csproj | 3 +- .../packages.lock.json | 48 +++++---- .../packages.lock.json | 63 +++++------ .../packages.lock.json | 63 +++++------ .../Speckle.Converters.Common.csproj | 7 +- .../packages.lock.json | 62 ++++++----- 37 files changed, 822 insertions(+), 732 deletions(-) create mode 100644 DUI3-DX/Sdk/Speckle.Autofac/ExceptionExtensions.cs diff --git a/.editorconfig b/.editorconfig index 36de039b9a..0485923f3a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -242,6 +242,8 @@ dotnet_diagnostic.ca1506.severity = warning # Avoid excessive class coupling dotnet_diagnostic.ca1507.severity = warning # Use nameof in place of string dotnet_diagnostic.ca1508.severity = warning # Avoid dead conditional code dotnet_diagnostic.ca1509.severity = warning # Invalid entry in code metrics configuration file +dotnet_diagnostic.CA2254.severity = none # Template should be a static expression + # Performance rules diff --git a/DUI3-DX.slnf b/DUI3-DX.slnf index 4bfa3426df..fcbcedfb72 100644 --- a/DUI3-DX.slnf +++ b/DUI3-DX.slnf @@ -3,11 +3,6 @@ "path": "All.sln", "projects": [ "Build\\Build.csproj", - "Core\\Core\\Core.csproj", - "Core\\Tests\\Speckle.Core.Tests.Integration\\Speckle.Core.Tests.Integration.csproj", - "Core\\Tests\\Speckle.Core.Tests.Performance\\Speckle.Core.Tests.Performance.csproj", - "Core\\Tests\\Speckle.Core.Tests.Unit\\Speckle.Core.Tests.Unit.csproj", - "Core\\Transports\\DiskTransport\\DiskTransport.csproj", "DUI3-DX\\Connectors\\ArcGIS\\Speckle.Connectors.ArcGIS3\\Speckle.Connectors.ArcGIS3.csproj", "DUI3-DX\\Connectors\\Autocad\\Speckle.Connectors.Autocad2023\\Speckle.Connectors.Autocad2023.csproj", "DUI3-DX\\Connectors\\Autocad\\Speckle.Connectors.AutocadShared\\Speckle.Connectors.AutocadShared.shproj", @@ -34,9 +29,7 @@ "DUI3-DX\\Sdk\\Speckle.Connectors.Utils\\Speckle.Connectors.Utils.csproj", "DUI3-DX\\Sdk\\Speckle.Converters.Common.DependencyInjection\\Speckle.Converters.Common.DependencyInjection.csproj", "DUI3-DX\\Sdk\\Speckle.Converters.Common.Tests\\Speckle.Converters.Common.Tests.csproj", - "DUI3-DX\\Sdk\\Speckle.Converters.Common\\Speckle.Converters.Common.csproj", - "Objects\\Objects\\Objects.csproj", - "Objects\\Tests\\Objects.Tests.Unit\\Objects.Tests.Unit.csproj" + "DUI3-DX\\Sdk\\Speckle.Converters.Common\\Speckle.Converters.Common.csproj" ] } } \ No newline at end of file diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json index 5306011fc3..720298148f 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json @@ -297,11 +297,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -378,8 +409,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -388,7 +418,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -404,7 +434,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } }, "speckle.converters.arcgis3": { @@ -426,7 +456,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -435,33 +465,6 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } }, "net6.0-windows7.0/win-x64": { diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json index ecbfc4fb09..662f264cb2 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json @@ -274,11 +274,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -434,8 +465,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -444,7 +474,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -460,7 +490,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } }, "speckle.converters.autocad2023": { @@ -482,7 +512,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -491,33 +521,6 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj index 721a34ab7e..a780058c4e 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj @@ -19,7 +19,6 @@ - diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json index 442462d552..a56054ea66 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json @@ -18,12 +18,6 @@ "resolved": "1.14.1", "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" }, - "Speckle.AutoCAD.API": { - "type": "Direct", - "requested": "[2024.0.0, )", - "resolved": "2024.0.0", - "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" - }, "Speckle.Civil3D.API": { "type": "Direct", "requested": "[2024.0.0, )", @@ -283,11 +277,47 @@ "Serilog": "2.10.0" } }, + "Speckle.AutoCAD.API": { + "type": "Transitive", + "resolved": "2024.0.0", + "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" + }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -443,8 +473,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -453,7 +482,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -469,7 +498,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } }, "speckle.converters.autocad2024": { @@ -491,7 +520,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -500,33 +529,6 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json index 27da03b1ba..90b4c6879e 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json @@ -303,11 +303,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "Speckle.Revit.API": { "type": "Transitive", "resolved": "2023.0.0", @@ -488,8 +519,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -498,7 +528,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -507,14 +537,14 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -539,33 +569,6 @@ "Speckle.Converters.Revit2023": "[2.0.999-local, )", "Speckle.Revit2023.Api": "[0.1.1-preview.0.28, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs index 1ce923f7c3..afe71b6f6d 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs @@ -3,7 +3,6 @@ using System.Reflection; using Speckle.Autofac; using Speckle.Connectors.Utils; -using Speckle.Core.Logging; namespace Speckle.Connectors.Revit.Plugin; diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Plugin/Speckle.Connectors.Rhino7Plugin.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Plugin/Speckle.Connectors.Rhino7Plugin.cs index 16e7297e5a..bd1cff5176 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Plugin/Speckle.Connectors.Rhino7Plugin.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Plugin/Speckle.Connectors.Rhino7Plugin.cs @@ -5,7 +5,6 @@ using Speckle.Connectors.Rhino7.DependencyInjection; using Speckle.Connectors.Rhino7.HostApp; using Speckle.Core.Kits; -using Speckle.Core.Logging; using Speckle.Core.Models.Extensions; namespace Speckle.Connectors.Rhino7.Plugin; diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json index 2b6b868bae..2423363e91 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json @@ -316,11 +316,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -481,8 +512,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -491,7 +521,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -507,14 +537,14 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -529,33 +559,6 @@ "dependencies": { "Speckle.Rhino7.Interfaces": "[0.1.1-preview.0.28, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json index acad1bb553..2e1dba8069 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json @@ -265,11 +265,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -346,8 +377,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.arcgis3": { @@ -361,7 +391,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -370,33 +400,6 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj index 3b07dc8f64..f65ef46df7 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj @@ -7,8 +7,7 @@ - + @@ -16,4 +15,4 @@ Include="..\..\..\Sdk\Speckle.Converters.Common\Speckle.Converters.Common.csproj"/> - \ No newline at end of file + diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json index 9c5d3fa603..b79f0ae450 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json @@ -260,11 +260,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -341,42 +372,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json index 57f50cdecb..5d933c5ecf 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json @@ -208,11 +208,42 @@ "resolved": "2023.0.0", "contentHash": "aNfiNw9zRW8pCl8AAQK7afEJuea4bJ4sFNsGVSDrdq1egaonZrwALU01dSyFNCE8tne86eVjlprpOGG6r0+G/A==" }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -354,8 +385,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.autocad2023": { @@ -369,7 +399,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -378,33 +408,6 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json index 2ea05d5e3f..0b3957751a 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json @@ -200,11 +200,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -346,42 +377,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json index 90415ed373..6954909ed9 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json @@ -208,11 +208,42 @@ "resolved": "2024.0.0", "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -354,8 +385,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.autocad2024": { @@ -369,7 +399,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -378,33 +408,6 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json index 7e24ff76cb..bd3d39f474 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json @@ -200,11 +200,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -346,42 +377,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json index a1b26cfcdc..6bba1c44ba 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json @@ -220,11 +220,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "Speckle.Revit.API": { "type": "Transitive", "resolved": "2023.0.0", @@ -381,15 +412,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -405,33 +435,6 @@ "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs index dee5979761..471ca0be47 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs @@ -1,9 +1,7 @@ using FluentAssertions; using Moq; using NUnit.Framework; -using Objects; using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Services; using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Revit.Interfaces; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json index 2d40fe5534..818e420a39 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json @@ -319,11 +319,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -474,8 +505,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.utils": { @@ -483,14 +513,14 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -506,33 +536,6 @@ "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json index 7c350fca98..d873133c84 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json @@ -200,11 +200,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -346,42 +377,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs index 9dd899678a..d292b5ed2f 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Logging; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Core.Logging; using Speckle.InterfaceGenerator; using Speckle.Revit.Interfaces; @@ -17,16 +17,19 @@ private readonly ITypedConverter< > _meshByMaterialConverter; private readonly IRevitOptionsFactory _revitOptionsFactory; private readonly IRevitSolidUtils _revitSolidUtils; + private readonly ILogger _logger; public DisplayValueExtractor( ITypedConverter>, List> meshByMaterialConverter, IRevitOptionsFactory revitOptionsFactory, - IRevitSolidUtils revitSolidUtils + IRevitSolidUtils revitSolidUtils, + ILogger logger ) { _meshByMaterialConverter = meshByMaterialConverter; _revitOptionsFactory = revitOptionsFactory; _revitSolidUtils = revitSolidUtils; + _logger = logger; } public List GetDisplayValue( @@ -251,7 +254,7 @@ private void SortGeometry( } // POC: should be hoovered up with the new reporting, logging, exception philosophy - private static void LogInstanceMeshRetrievalWarnings( + private void LogInstanceMeshRetrievalWarnings( IRevitElement element, int topLevelSolidsCount, int topLevelMeshesCount, @@ -263,29 +266,20 @@ bool hasSymbolGeom { if (topLevelSolidsCount > 0) { - SpeckleLog.Logger.Warning( - "Element of type {elementType} with uniqueId {uniqueId} has valid symbol geometry and {numSolids} top level solids. See comment on method SortInstanceGeometry for link to RevitAPI docs that leads us to believe this shouldn't happen", - element.GetType(), - element.UniqueId, - topLevelSolidsCount + _logger.LogWarning( + $"Element of type {element.GetType()} with uniqueId {element.UniqueId} has valid symbol geometry and {topLevelSolidsCount} top level solids. See comment on method SortInstanceGeometry for link to RevitAPI docs that leads us to believe this shouldn't happen" ); } if (topLevelMeshesCount > 0) { - SpeckleLog.Logger.Warning( - "Element of type {elementType} with uniqueId {uniqueId} has valid symbol geometry and {numMeshes} top level meshes. See comment on method SortInstanceGeometry for link to RevitAPI docs that leads us to believe this shouldn't happen", - element.GetType(), - element.UniqueId, - topLevelMeshesCount + _logger.LogWarning( + $"Element of type {element.GetType()} with uniqueId {element.UniqueId} has valid symbol geometry and {topLevelMeshesCount} top level meshes. See comment on method SortInstanceGeometry for link to RevitAPI docs that leads us to believe this shouldn't happen" ); } if (topLevelGeomElementCount > 0) { - SpeckleLog.Logger.Warning( - "Element of type {elementType} with uniqueId {uniqueId} has valid symbol geometry and {numGeomElements} top level geometry elements. See comment on method SortInstanceGeometry for link to RevitAPI docs that leads us to believe this shouldn't happen", - element.GetType(), - element.UniqueId, - topLevelGeomElementCount + _logger.LogWarning( + $"Element of type {element.GetType()} with uniqueId {element.UniqueId} has valid symbol geometry and {topLevelGeomElementCount} top level geometry elements. See comment on method SortInstanceGeometry for link to RevitAPI docs that leads us to believe this shouldn't happen" ); } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs index b7b493d064..b6489d3646 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs @@ -1,6 +1,6 @@ -using Speckle.Converters.Common; +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Core.Logging; using Speckle.Core.Models; using Speckle.InterfaceGenerator; using Speckle.Revit.Interfaces; @@ -15,16 +15,19 @@ public sealed class ParameterObjectAssigner : IParameterObjectAssigner private readonly ITypedConverter _paramConverter; private readonly IParameterValueExtractor _parameterValueExtractor; private readonly IRevitElementIdUtils _revitElementIdUtils; + private readonly ILogger _logger; public ParameterObjectAssigner( ITypedConverter paramConverter, IParameterValueExtractor parameterValueExtractor, - IRevitElementIdUtils revitElementIdUtils + IRevitElementIdUtils revitElementIdUtils, + ILogger logger ) { _paramConverter = paramConverter; _parameterValueExtractor = parameterValueExtractor; _revitElementIdUtils = revitElementIdUtils; + _logger = logger; } public void AssignParametersToBase(IRevitElement target, Base @base) @@ -75,7 +78,7 @@ private void AssignSpeckleParamToBaseObject( // maybe hoover these into one exception or into our reporting strategy catch (SpeckleConversionException ex) { - SpeckleLog.Logger.Warning(ex, "Error thrown when trying to set property named {propName}", kv.Key); + _logger.LogWarning(ex, $"Error thrown when trying to set property named {kv.Key}"); } } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json index 0b5cd3165f..c6f96ec282 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json @@ -200,11 +200,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -346,15 +377,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } }, "speckle.converters.common.dependencyinjection": { @@ -370,33 +400,6 @@ "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Rhino7.Interfaces": "[0.1.1-preview.0.28, )" } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" - } } } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json index 9a85ec5d77..d748c89324 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json @@ -200,11 +200,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -346,42 +377,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json index 2f687deb37..9b1e4b087b 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json @@ -260,6 +260,29 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", @@ -420,8 +443,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -430,7 +452,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -439,28 +461,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } } }, @@ -749,6 +750,29 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", @@ -830,8 +854,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.dui": { @@ -840,7 +863,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )", + "Speckle.Core": "[3.0.1-alpha.11, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -849,28 +872,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj index e0a93209c5..6d4602c693 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj @@ -7,12 +7,11 @@ + - - diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json index 5f57ceb468..8b1d8f5d09 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json @@ -27,6 +27,30 @@ "resolved": "1.14.1", "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" }, + "Speckle.Core": { + "type": "Direct", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.InterfaceGenerator": { "type": "Direct", "requested": "[0.9.5, )", @@ -495,8 +519,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.connectors.utils": { @@ -504,28 +527,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" + "Speckle.Core": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs b/DUI3-DX/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs index ee71d941e6..363e55cc56 100644 --- a/DUI3-DX/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs +++ b/DUI3-DX/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs @@ -2,7 +2,6 @@ using Autofac; using Microsoft.Extensions.Logging; using Speckle.Autofac.Files; -using Speckle.Core.Logging; using Module = Autofac.Module; namespace Speckle.Autofac.DependencyInjection; diff --git a/DUI3-DX/Sdk/Speckle.Autofac/ExceptionExtensions.cs b/DUI3-DX/Sdk/Speckle.Autofac/ExceptionExtensions.cs new file mode 100644 index 0000000000..626e9751c1 --- /dev/null +++ b/DUI3-DX/Sdk/Speckle.Autofac/ExceptionExtensions.cs @@ -0,0 +1,45 @@ +using System.Diagnostics.Contracts; + +namespace Speckle.Autofac; + +public static class ExceptionExtensions +{ + /// + /// Helper function for catch blocks to avoid catching and handling/wrapping of some critical exception types that are unlikely to be truly handleable + /// + /// + /// We should aim to always catch specific exception types, and have all functions document the types they may throw. + /// However, this is not always achievable. + /// e.g. when dealing with legacy code, some third-party APIs, or in cases where we want to prevent a host app crash. + /// In these cases, we often want to catch all exceptions, and opt out only of the ones that definitely shouldn't be handled + /// + /// + /// + /// try + /// { + /// SomethingSketchy(); + /// } + /// catch (Exception ex) when (!IsFatal(ex)) + /// { + /// throw new SpeckleException("Failed to do something", ex); + /// } + /// + /// + /// + /// for types that are unlikely to ever be recoverable + [Pure] + public static bool IsFatal(this Exception ex) + { + return ex switch + { + OutOfMemoryException + or ThreadAbortException + or InvalidProgramException + or AccessViolationException + or AppDomainUnloadedException + or BadImageFormatException + => true, + _ => false, + }; + } +} diff --git a/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj b/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj index c74a1334ca..e1524d1db6 100644 --- a/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj +++ b/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj @@ -10,8 +10,4 @@ - - - - diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj index 55e445a089..e2dfaccf8a 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj @@ -5,10 +5,9 @@ + - - diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json index c23420da56..501db4a15e 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json @@ -27,6 +27,30 @@ "Serilog": "2.12.0" } }, + "Speckle.Core": { + "type": "Direct", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.InterfaceGenerator": { "type": "Direct", "requested": "[0.9.5, )", @@ -489,29 +513,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json index 890db720a4..e34336c3a4 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json @@ -297,11 +297,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -446,42 +477,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json index 202e7670ff..7bbbb295a6 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json @@ -259,11 +259,42 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Objects": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -405,42 +436,14 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Speckle.Objects": "[3.0.1-alpha.11, )" } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj b/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj index 9c80cf3aba..1211ab6937 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj @@ -3,10 +3,13 @@ netstandard2.0 + - - + + + + diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json index a9095c6e5b..b29c15e4a5 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json @@ -23,6 +23,15 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, + "Speckle.Objects": { + "type": "Direct", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -288,6 +297,29 @@ "Serilog": "2.10.0" } }, + "Speckle.Core": { + "type": "Transitive", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", @@ -437,35 +469,7 @@ "speckle.autofac": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", - "Speckle.Core": "[2.0.999-local, )" - } - }, - "Speckle.Core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" - } - }, - "Speckle.Objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[2.0.999-local, )" + "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } } } From 980b75d7fec831c48b89399223bb224461d425dc Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 27 Jun 2024 12:55:23 +0100 Subject: [PATCH 2/6] Manage V3 versions centrally (exception AutoCAD) (#3536) * initial nuget references * fmt * remove unused revit dependency * Don't use new solution * remove unused file * update core * Manage V3 versions centrally (exception AutoCAD) * fixed up multiple autocad versions * fix up lock files --- All.sln | 9 +- DUI3-DX.slnf | 8 +- .../Speckle.Connectors.ArcGIS3.csproj | 7 +- .../packages.lock.json | 143 +++--- .../Autocad/Directory.Packages.props | 6 + .../Speckle.Connectors.Autocad2023.csproj | 7 +- .../packages.lock.json | 109 +++-- .../Speckle.Connectors.Civil3d2024.csproj | 8 +- .../packages.lock.json | 151 ++++--- .../Speckle.Connectors.Revit2023.csproj | 4 +- .../packages.lock.json | 167 ++++--- .../Speckle.Connectors.Rhino7.csproj | 10 +- .../packages.lock.json | 142 +++--- ...verters.ArcGIS3.DependencyInjection.csproj | 2 +- .../packages.lock.json | 108 +++-- .../Speckle.Converters.ArcGIS3.csproj | 2 +- .../packages.lock.json | 97 +++-- .../Autocad/2023/Directory.Packages.props | 6 + .../AutocadConverterModule.cs | 0 ...ers.Autocad2023.DependencyInjection.csproj | 4 +- .../packages.lock.json | 136 ++++-- .../Speckle.Converters.Autocad2023.csproj | 18 + .../packages.lock.json | 121 +++--- .../Autocad/2024/Directory.Packages.props | 6 + .../AutocadConverterModule.cs | 0 ...ers.Autocad2024.DependencyInjection.csproj | 4 +- .../packages.lock.json | 112 +++-- .../Speckle.Converters.Autocad2024.csproj | 18 + .../packages.lock.json | 70 ++- .../Speckle.Converters.Autocad2023.csproj | 18 - .../Speckle.Converters.Autocad2024.csproj | 18 - ...rters.Revit2023.DependencyInjection.csproj | 2 +- .../packages.lock.json | 112 +++-- .../Speckle.Converters.Revit2023.Tests.csproj | 13 +- .../packages.lock.json | 130 +++--- .../Speckle.Converters.Revit2023.csproj | 2 +- .../packages.lock.json | 101 +++-- ...nverters.Rhino7.DependencyInjection.csproj | 2 +- .../packages.lock.json | 101 +++-- .../Speckle.Converters.Rhino7.csproj | 2 +- .../packages.lock.json | 101 +++-- .../Speckle.Connectors.DUI.WebView.csproj | 4 +- .../packages.lock.json | 180 ++++++-- .../Speckle.Connectors.DUI.csproj | 8 +- .../Speckle.Connectors.DUI/packages.lock.json | 41 +- DUI3-DX/Directory.Build.props | 12 +- DUI3-DX/Directory.Packages.props | 30 ++ .../Speckle.Autofac/Speckle.Autofac.csproj | 6 +- .../Sdk/Speckle.Autofac/packages.lock.json | 411 ++---------------- .../Speckle.Connectors.Utils.csproj | 6 +- .../packages.lock.json | 41 +- ...nverters.Common.DependencyInjection.csproj | 2 +- .../packages.lock.json | 105 +++-- .../Speckle.Converters.Common.Tests.csproj | 13 +- .../packages.lock.json | 107 +++-- .../Speckle.Converters.Common.csproj | 2 +- .../packages.lock.json | 88 ++-- 57 files changed, 1735 insertions(+), 1398 deletions(-) create mode 100644 DUI3-DX/Connectors/Autocad/Directory.Packages.props create mode 100644 DUI3-DX/Converters/Autocad/2023/Directory.Packages.props rename DUI3-DX/Converters/Autocad/{ => 2023}/Speckle.Converters.Autocad2023.DependencyInjection/AutocadConverterModule.cs (100%) rename DUI3-DX/Converters/Autocad/{ => 2023}/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj (63%) rename DUI3-DX/Converters/Autocad/{Speckle.Converters.Autocad2023 => 2023/Speckle.Converters.Autocad2023.DependencyInjection}/packages.lock.json (89%) create mode 100644 DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj rename DUI3-DX/Converters/Autocad/{Speckle.Converters.Autocad2023.DependencyInjection => 2023/Speckle.Converters.Autocad2023}/packages.lock.json (93%) create mode 100644 DUI3-DX/Converters/Autocad/2024/Directory.Packages.props rename DUI3-DX/Converters/Autocad/{ => 2024}/Speckle.Converters.Autocad2024.DependencyInjection/AutocadConverterModule.cs (100%) rename DUI3-DX/Converters/Autocad/{ => 2024}/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj (63%) rename DUI3-DX/Converters/Autocad/{ => 2024}/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json (93%) create mode 100644 DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj rename DUI3-DX/Converters/Autocad/{ => 2024}/Speckle.Converters.Autocad2024/packages.lock.json (87%) delete mode 100644 DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj delete mode 100644 DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj create mode 100644 DUI3-DX/Directory.Packages.props diff --git a/All.sln b/All.sln index 9d104a8de5..59406b4cb8 100644 --- a/All.sln +++ b/All.sln @@ -459,6 +459,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DUI3-DX", "DUI3-DX", "{9DB74760-01DE-4AC1-A81B-BC7784351D22}" ProjectSection(SolutionItems) = preProject DUI3-DX\Directory.Build.props = DUI3-DX\Directory.Build.props + DUI3-DX\Directory.Packages.props = DUI3-DX\Directory.Packages.props EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Revit", "Revit", "{4838C66E-8677-4FBD-9609-25376042E981}" @@ -523,9 +524,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Autocad", "Autocad", "{804E EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.AutocadShared", "DUI3-DX\Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.shproj", "{9ADD1B7A-6401-4202-8613-F668E2FBC0A4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2023\Speckle.Converters.Autocad2023.csproj", "{631C295A-7CCF-4B42-8686-7034E31469E7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023", "DUI3-DX\Converters\Autocad\2023\Speckle.Converters.Autocad2023\Speckle.Converters.Autocad2023.csproj", "{631C295A-7CCF-4B42-8686-7034E31469E7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023.DependencyInjection", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2023.DependencyInjection\Speckle.Converters.Autocad2023.DependencyInjection.csproj", "{D940853C-003A-482C-BDB0-665367F274A0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023.DependencyInjection", "DUI3-DX\Converters\Autocad\2023\Speckle.Converters.Autocad2023.DependencyInjection\Speckle.Converters.Autocad2023.DependencyInjection.csproj", "{D940853C-003A-482C-BDB0-665367F274A0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.DUI.WebView", "DUI3-DX\DUI3\Speckle.Connectors.DUI.WebView\Speckle.Connectors.DUI.WebView.csproj", "{7420652C-3046-4F38-BE64-9B9E69D76FA2}" EndProject @@ -561,9 +562,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common.T EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2024", "DUI3-DX\Connectors\Autocad\Speckle.Connectors.Civil3d2024\Speckle.Connectors.Civil3d2024.csproj", "{DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2024\Speckle.Converters.Autocad2024.csproj", "{C9C28F31-1367-438C-83B0-049C3B3A3E3B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024", "DUI3-DX\Converters\Autocad\2024\Speckle.Converters.Autocad2024\Speckle.Converters.Autocad2024.csproj", "{C9C28F31-1367-438C-83B0-049C3B3A3E3B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2024.DependencyInjection", "DUI3-DX\Converters\Autocad\Speckle.Converters.Autocad2024.DependencyInjection\Speckle.Converters.Autocad2024.DependencyInjection.csproj", "{06082BAA-98E8-49B1-9D33-252B126A0561}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2024.DependencyInjection", "DUI3-DX\Converters\Autocad\2024\Speckle.Converters.Autocad2024.DependencyInjection\Speckle.Converters.Autocad2024.DependencyInjection.csproj", "{06082BAA-98E8-49B1-9D33-252B126A0561}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/DUI3-DX.slnf b/DUI3-DX.slnf index fcbcedfb72..157eec292b 100644 --- a/DUI3-DX.slnf +++ b/DUI3-DX.slnf @@ -12,10 +12,10 @@ "DUI3-DX\\Connectors\\Rhino\\Speckle.Connectors.Rhino7\\Speckle.Connectors.Rhino7.csproj", "DUI3-DX\\Converters\\ArcGIS\\Speckle.Converters.ArcGIS3.DependencyInjection\\Speckle.Converters.ArcGIS3.DependencyInjection.csproj", "DUI3-DX\\Converters\\ArcGIS\\Speckle.Converters.ArcGIS3\\Speckle.Converters.ArcGIS3.csproj", - "DUI3-DX\\Converters\\Autocad\\Speckle.Converters.Autocad2023.DependencyInjection\\Speckle.Converters.Autocad2023.DependencyInjection.csproj", - "DUI3-DX\\Converters\\Autocad\\Speckle.Converters.Autocad2023\\Speckle.Converters.Autocad2023.csproj", - "DUI3-DX\\Converters\\Autocad\\Speckle.Converters.Autocad2024.DependencyInjection\\Speckle.Converters.Autocad2024.DependencyInjection.csproj", - "DUI3-DX\\Converters\\Autocad\\Speckle.Converters.Autocad2024\\Speckle.Converters.Autocad2024.csproj", + "DUI3-DX\\Converters\\Autocad\\2023\\Speckle.Converters.Autocad2023.DependencyInjection\\Speckle.Converters.Autocad2023.DependencyInjection.csproj", + "DUI3-DX\\Converters\\Autocad\\2023\\Speckle.Converters.Autocad2023\\Speckle.Converters.Autocad2023.csproj", + "DUI3-DX\\Converters\\Autocad\\2024\\Speckle.Converters.Autocad2024.DependencyInjection\\Speckle.Converters.Autocad2024.DependencyInjection.csproj", + "DUI3-DX\\Converters\\Autocad\\2024\\Speckle.Converters.Autocad2024\\Speckle.Converters.Autocad2024.csproj", "DUI3-DX\\Converters\\Autocad\\Speckle.Converters.AutocadShared\\Speckle.Converters.AutocadShared.shproj", "DUI3-DX\\Converters\\Revit\\Speckle.Converters.Revit2023.DependencyInjection\\Speckle.Converters.Revit2023.DependencyInjection.csproj", "DUI3-DX\\Converters\\Revit\\Speckle.Converters.Revit2023.Tests\\Speckle.Converters.Revit2023.Tests.csproj", diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj index 0dc50a19aa..3cbc19ac77 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj @@ -20,9 +20,8 @@ - - + + @@ -35,4 +34,4 @@ - \ No newline at end of file + diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json index 720298148f..e890a9f47a 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { "net6.0-windows7.0": { "Esri.ArcGISPro.Extensions30": { @@ -14,6 +14,16 @@ "resolved": "7.0.0", "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -26,11 +36,6 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Autofac": { - "type": "Transitive", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -100,6 +105,11 @@ "System.Text.Encodings.Web": "4.5.0" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -177,10 +187,10 @@ "System.Buffers": "4.5.0" } }, - "Microsoft.Web.WebView2": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "1.0.1823.32", - "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -237,15 +247,6 @@ "System.Reflection.TypeExtensions": "4.7.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -297,42 +298,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -401,11 +371,6 @@ "resolved": "4.5.0", "contentHash": "Xg4G4Indi4dqP1iuAiMSwpiWS54ZghzR644OtsRCm/m/lBMG8dUBhLVN7hLm8NNrNTR+iGbshCPTwrvxZPlm4g==" }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "speckle.autofac": { "type": "Project", "dependencies": { @@ -465,18 +430,80 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } - } - }, - "net6.0-windows7.0/win-x64": { + }, + "Autofac": { + "type": "CentralTransitive", + "requested": "[5.2.0, )", + "resolved": "5.2.0", + "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + }, "Microsoft.Web.WebView2": { - "type": "Transitive", + "type": "CentralTransitive", + "requested": "[1.0.1823.32, )", "resolved": "1.0.1823.32", "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" + } + }, + "net6.0-windows7.0/win-x64": { "SQLitePCLRaw.lib.e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + }, + "Microsoft.Web.WebView2": { + "type": "CentralTransitive", + "requested": "[1.0.1823.32, )", + "resolved": "1.0.1823.32", + "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" } } } diff --git a/DUI3-DX/Connectors/Autocad/Directory.Packages.props b/DUI3-DX/Connectors/Autocad/Directory.Packages.props new file mode 100644 index 0000000000..568fea5f0f --- /dev/null +++ b/DUI3-DX/Connectors/Autocad/Directory.Packages.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj index 238ec770f6..b0f4587d7f 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj @@ -10,7 +10,7 @@ - + @@ -18,8 +18,9 @@ - - + + + diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json index 662f264cb2..df67e2ad73 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { "Microsoft.Extensions.Logging.Abstractions": { @@ -12,6 +12,16 @@ "System.Memory": "4.5.5" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -30,14 +40,6 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Autofac": { - "type": "Transitive", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" - } - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -78,6 +80,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -151,10 +158,10 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, - "Microsoft.Web.WebView2": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "1.0.1823.32", - "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -214,15 +221,6 @@ "Serilog": "2.8.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -444,11 +442,6 @@ "System.ValueTuple": "4.5.0" } }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -521,6 +514,70 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } + }, + "Autofac": { + "type": "CentralTransitive", + "requested": "[5.2.0, )", + "resolved": "5.2.0", + "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + } + }, + "Microsoft.Web.WebView2": { + "type": "CentralTransitive", + "requested": "[1.0.1823.32, )", + "resolved": "1.0.1823.32", + "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" } } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj index a780058c4e..b04e1c73e0 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj @@ -1,4 +1,4 @@ - + Speckle.Connectors.Civil3d net48 @@ -10,7 +10,7 @@ - + @@ -18,8 +18,8 @@ - - + + diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json index a56054ea66..b6c4d13a4c 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { "Microsoft.Extensions.Logging.Abstractions": { @@ -12,6 +12,16 @@ "System.Memory": "4.5.5" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -33,14 +43,6 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Autofac": { - "type": "Transitive", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" - } - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -81,6 +83,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -154,10 +161,10 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, - "Microsoft.Web.WebView2": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "1.0.1823.32", - "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -217,15 +224,6 @@ "Serilog": "2.8.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -277,47 +275,11 @@ "Serilog": "2.10.0" } }, - "Speckle.AutoCAD.API": { - "type": "Transitive", - "resolved": "2024.0.0", - "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" - }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -452,11 +414,6 @@ "System.ValueTuple": "4.5.0" } }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -529,6 +486,76 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } + }, + "Autofac": { + "type": "CentralTransitive", + "requested": "[5.2.0, )", + "resolved": "5.2.0", + "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + } + }, + "Microsoft.Web.WebView2": { + "type": "CentralTransitive", + "requested": "[1.0.1823.32, )", + "resolved": "1.0.1823.32", + "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.AutoCAD.API": { + "type": "CentralTransitive", + "requested": "[2023.0.0, )", + "resolved": "2024.0.0", + "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" } } } diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj index 893a9a4c12..1ce038c81e 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj @@ -30,8 +30,8 @@ - - + + diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json index 90b4c6879e..99af7ef77d 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { "CefSharp.Wpf": { @@ -11,6 +11,16 @@ "CefSharp.Common": "[92.0.260]" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -103,6 +113,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -158,15 +173,6 @@ "System.ValueTuple": "4.5.0" } }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.Options": { "type": "Transitive", "resolved": "7.0.0", @@ -185,6 +191,11 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -243,15 +254,6 @@ "Serilog": "2.8.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -303,62 +305,16 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "Speckle.Revit.API": { "type": "Transitive", "resolved": "2023.0.0", "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" }, - "Speckle.Revit2023.Api": { - "type": "Transitive", - "resolved": "0.1.1-preview.0.28", - "contentHash": "ejwYS/HI8yy0rJE4vgTr5aj8Fkg/E9JnMGjwyVS2fLtI4f7+FmwAY6inTUT2p/RAoRc2nQw+TerDpUtOhddzag==", - "dependencies": { - "Mapster": "7.3.0", - "Speckle.Revit.API": "2023.0.0", - "Speckle.Revit2023.Interfaces": "0.1.1-preview.0.28" - } - }, - "Speckle.Revit2023.Interfaces": { - "type": "Transitive", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -498,11 +454,6 @@ "System.ValueTuple": "4.5.0" } }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -569,6 +520,82 @@ "Speckle.Converters.Revit2023": "[2.0.999-local, )", "Speckle.Revit2023.Api": "[0.1.1-preview.0.28, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, + "Speckle.Revit2023.Api": { + "type": "CentralTransitive", + "requested": "[0.1.1-preview.0.28, )", + "resolved": "0.1.1-preview.0.28", + "contentHash": "ejwYS/HI8yy0rJE4vgTr5aj8Fkg/E9JnMGjwyVS2fLtI4f7+FmwAY6inTUT2p/RAoRc2nQw+TerDpUtOhddzag==", + "dependencies": { + "Mapster": "7.3.0", + "Speckle.Revit.API": "2023.0.0", + "Speckle.Revit2023.Interfaces": "0.1.1-preview.0.28" + } + }, + "Speckle.Revit2023.Interfaces": { + "type": "CentralTransitive", + "requested": "[0.1.1-preview.0.28, )", + "resolved": "0.1.1-preview.0.28", + "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" } } } diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj index b64bd8b20b..e114f0d218 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json index 2423363e91..c8f0acc3ee 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -111,6 +121,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -166,15 +181,6 @@ "System.ValueTuple": "4.5.0" } }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.Options": { "type": "Transitive", "resolved": "7.0.0", @@ -193,10 +199,10 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, - "Microsoft.Web.WebView2": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "1.0.1823.32", - "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -256,15 +262,6 @@ "Serilog": "2.8.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -316,42 +313,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -491,11 +457,6 @@ "System.ValueTuple": "4.5.0" } }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -559,6 +520,71 @@ "dependencies": { "Speckle.Rhino7.Interfaces": "[0.1.1-preview.0.28, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Microsoft.Web.WebView2": { + "type": "CentralTransitive", + "requested": "[1.0.1823.32, )", + "resolved": "1.0.1823.32", + "contentHash": "ppRcWBUNggFIqyJp7PfgS4Oe8/7yli/mHcTNDOaqo3ZzJWnv9AOr0WE9ceEP5SPs1M7CQ3QvdGMR7KNz0v09EA==" + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" } } } diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj index 2cb23d51d9..3c4c103894 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj @@ -11,7 +11,7 @@ - + diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json index 2e1dba8069..383e499052 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { "net6.0-windows7.0": { "Autofac": { @@ -8,6 +8,16 @@ "resolved": "5.2.0", "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -20,11 +30,6 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Esri.ArcGISPro.Extensions30": { - "type": "Transitive", - "resolved": "3.2.0.49743", - "contentHash": "fmnYm+mD14Cz0Uqh1ij37SfLJerkyFHK5581y5tXT/l3H2ZvUmVuuxjYquXzyzj9p7IexQzMW4xCpxe+mD922g==" - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -94,6 +99,11 @@ "System.Text.Encodings.Web": "4.5.0" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -121,11 +131,6 @@ "resolved": "2.2.0", "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" - }, "Microsoft.Extensions.ObjectPool": { "type": "Transitive", "resolved": "2.2.0", @@ -159,6 +164,11 @@ "System.Buffers": "4.5.0" } }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -265,42 +275,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -400,6 +379,51 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } + }, + "Esri.ArcGISPro.Extensions30": { + "type": "CentralTransitive", + "requested": "[3.2.0.49743, )", + "resolved": "3.2.0.49743", + "contentHash": "fmnYm+mD14Cz0Uqh1ij37SfLJerkyFHK5581y5tXT/l3H2ZvUmVuuxjYquXzyzj9p7IexQzMW4xCpxe+mD922g==" + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj index f65ef46df7..9d4668fbe4 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Speckle.Converters.ArcGIS3.csproj @@ -7,7 +7,7 @@ - + diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json index b79f0ae450..18027e4d25 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { "net6.0-windows7.0": { "Esri.ArcGISPro.Extensions30": { @@ -8,6 +8,16 @@ "resolved": "3.2.0.49743", "contentHash": "fmnYm+mD14Cz0Uqh1ij37SfLJerkyFHK5581y5tXT/l3H2ZvUmVuuxjYquXzyzj9p7IexQzMW4xCpxe+mD922g==" }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -89,6 +99,11 @@ "System.Text.Encodings.Web": "4.5.0" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -116,11 +131,6 @@ "resolved": "2.2.0", "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" - }, "Microsoft.Extensions.ObjectPool": { "type": "Transitive", "resolved": "2.2.0", @@ -154,6 +164,11 @@ "System.Buffers": "4.5.0" } }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -260,42 +275,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -381,6 +365,45 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Autocad/2023/Directory.Packages.props b/DUI3-DX/Converters/Autocad/2023/Directory.Packages.props new file mode 100644 index 0000000000..568fea5f0f --- /dev/null +++ b/DUI3-DX/Converters/Autocad/2023/Directory.Packages.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/AutocadConverterModule.cs b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/AutocadConverterModule.cs similarity index 100% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/AutocadConverterModule.cs rename to DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/AutocadConverterModule.cs diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj similarity index 63% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj rename to DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj index c115e62f88..303e2f808a 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj @@ -6,12 +6,12 @@ - + - + diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json similarity index 89% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json rename to DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json index 0b3957751a..e9931ee09e 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json @@ -1,19 +1,32 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Autofac": { + "type": "Direct", + "requested": "[5.2.0, )", + "resolved": "5.2.0", + "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + } + }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", "resolved": "1.14.1", "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" }, - "Speckle.AutoCAD.API": { - "type": "Direct", - "requested": "[2023.0.0, )", - "resolved": "2023.0.0", - "contentHash": "aNfiNw9zRW8pCl8AAQK7afEJuea4bJ4sFNsGVSDrdq1egaonZrwALU01dSyFNCE8tne86eVjlprpOGG6r0+G/A==" - }, "Speckle.InterfaceGenerator": { "type": "Direct", "requested": "[0.9.5, )", @@ -60,6 +73,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -82,14 +100,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -200,42 +214,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -380,12 +363,75 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, + "speckle.converters.autocad2023": { + "type": "Project", + "dependencies": { + "Speckle.AutoCAD.API": "[2023.0.0, )", + "Speckle.Converters.Common": "[2.0.999-local, )" + } + }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "speckle.converters.common.dependencyinjection": { + "type": "Project", + "dependencies": { + "Speckle.Autofac": "[2.0.999-local, )", + "Speckle.Converters.Common": "[2.0.999-local, )" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.AutoCAD.API": { + "type": "CentralTransitive", + "requested": "[2023.0.0, )", + "resolved": "2023.0.0", + "contentHash": "aNfiNw9zRW8pCl8AAQK7afEJuea4bJ4sFNsGVSDrdq1egaonZrwALU01dSyFNCE8tne86eVjlprpOGG6r0+G/A==" + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj new file mode 100644 index 0000000000..753a408e8e --- /dev/null +++ b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj @@ -0,0 +1,18 @@ + + + + net48 + x64 + + + + + + + + + + + + + diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json similarity index 93% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json rename to DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json index 5d933c5ecf..b114e8a7c5 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json @@ -1,14 +1,15 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { - "Autofac": { + "Microsoft.SourceLink.GitHub": { "type": "Direct", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" } }, "PolySharp": { @@ -17,6 +18,12 @@ "resolved": "1.14.1", "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" }, + "Speckle.AutoCAD.API": { + "type": "Direct", + "requested": "[2023.0.0, )", + "resolved": "2023.0.0", + "contentHash": "aNfiNw9zRW8pCl8AAQK7afEJuea4bJ4sFNsGVSDrdq1egaonZrwALU01dSyFNCE8tne86eVjlprpOGG6r0+G/A==" + }, "Speckle.InterfaceGenerator": { "type": "Direct", "requested": "[0.9.5, )", @@ -63,6 +70,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -85,14 +97,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -203,47 +211,11 @@ "Serilog": "2.10.0" } }, - "Speckle.AutoCAD.API": { - "type": "Transitive", - "resolved": "2023.0.0", - "contentHash": "aNfiNw9zRW8pCl8AAQK7afEJuea4bJ4sFNsGVSDrdq1egaonZrwALU01dSyFNCE8tne86eVjlprpOGG6r0+G/A==" - }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -388,13 +360,6 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } }, - "speckle.converters.autocad2023": { - "type": "Project", - "dependencies": { - "Speckle.AutoCAD.API": "[2023.0.0, )", - "Speckle.Converters.Common": "[2.0.999-local, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { @@ -402,11 +367,47 @@ "Speckle.Objects": "[3.0.1-alpha.11, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" } } } diff --git a/DUI3-DX/Converters/Autocad/2024/Directory.Packages.props b/DUI3-DX/Converters/Autocad/2024/Directory.Packages.props new file mode 100644 index 0000000000..27e149ab85 --- /dev/null +++ b/DUI3-DX/Converters/Autocad/2024/Directory.Packages.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/AutocadConverterModule.cs b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/AutocadConverterModule.cs similarity index 100% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/AutocadConverterModule.cs rename to DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/AutocadConverterModule.cs diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj similarity index 63% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj rename to DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj index 9442c9cfe9..05de443d1e 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj @@ -6,12 +6,12 @@ - + - + diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json similarity index 93% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json rename to DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json index 6954909ed9..8eee516ff1 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { "Autofac": { @@ -11,6 +11,16 @@ "Microsoft.Bcl.AsyncInterfaces": "1.1.0" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -63,6 +73,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -85,14 +100,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -203,47 +214,11 @@ "Serilog": "2.10.0" } }, - "Speckle.AutoCAD.API": { - "type": "Transitive", - "resolved": "2024.0.0", - "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" - }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -408,6 +383,55 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Converters.Common": "[2.0.999-local, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.AutoCAD.API": { + "type": "CentralTransitive", + "requested": "[2024.0.0, )", + "resolved": "2024.0.0", + "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj new file mode 100644 index 0000000000..8aad1ab7d5 --- /dev/null +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj @@ -0,0 +1,18 @@ + + + + net48 + x64 + + + + + + + + + + + + + diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json similarity index 87% rename from DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json rename to DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json index bd3d39f474..66a0d5e333 100644 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -60,6 +70,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -82,14 +97,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -386,6 +397,49 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj deleted file mode 100644 index 60d55503f4..0000000000 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2023/Speckle.Converters.Autocad2023.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net48 - x64 - - - - - - - - - - - - - diff --git a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj b/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj deleted file mode 100644 index f23b34ad29..0000000000 --- a/DUI3-DX/Converters/Autocad/Speckle.Converters.Autocad2024/Speckle.Converters.Autocad2024.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net48 - x64 - - - - - - - - - - - - - diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj index b9b0735ffe..a4ecb27491 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj @@ -6,7 +6,7 @@ - + diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json index 6bba1c44ba..928fe09a85 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -80,6 +90,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -102,14 +117,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -220,52 +231,16 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "Speckle.Revit.API": { "type": "Transitive", "resolved": "2023.0.0", "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" }, - "Speckle.Revit2023.Interfaces": { - "type": "Transitive", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -435,6 +410,55 @@ "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } + }, + "Speckle.Revit2023.Interfaces": { + "type": "CentralTransitive", + "requested": "[0.1.1-preview.0.28, )", + "resolved": "0.1.1-preview.0.28", + "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj index 4657d9e8ba..2839be1e72 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj @@ -8,13 +8,12 @@ - - - - - - - + + + + + + diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json index 818e420a39..2c05f6ade3 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json @@ -1,13 +1,7 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.2, )", - "resolved": "6.0.2", - "contentHash": "bJShQ6uWRTQ100ZeyiMqcFlhP7WJ+bCuabUs885dJiBEzMsJMSFr7BOyeCw4rgvQokteGi5rKQTlkhfQPUXg2A==" - }, "FluentAssertions": { "type": "Direct", "requested": "[6.12.0, )", @@ -26,6 +20,16 @@ "Microsoft.CodeCoverage": "17.10.0" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "Moq": { "type": "Direct", "requested": "[4.20.70, )", @@ -114,6 +118,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CodeCoverage": { "type": "Transitive", "resolved": "17.10.0", @@ -174,15 +183,6 @@ "System.ValueTuple": "4.5.0" } }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.Options": { "type": "Transitive", "resolved": "7.0.0", @@ -201,6 +201,11 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -259,15 +264,6 @@ "Serilog": "2.8.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -319,42 +315,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -536,6 +501,59 @@ "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj index 26aa7a8647..e3c04fcf68 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj @@ -9,7 +9,7 @@ - + diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json index d873133c84..220a146664 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -60,6 +70,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -82,14 +97,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -200,42 +211,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -386,6 +366,49 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj index 052b08bafc..a9a52748e3 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj @@ -11,6 +11,6 @@ - + diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json index c6f96ec282..7e98fae831 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -60,6 +70,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -82,14 +97,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -200,42 +211,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -400,6 +380,49 @@ "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Rhino7.Interfaces": "[0.1.1-preview.0.28, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj index 72c57460cd..206a1eecf0 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj @@ -4,7 +4,7 @@ net48 - + diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json index d748c89324..e88d9d0998 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -60,6 +70,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -82,14 +97,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -200,42 +211,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -386,6 +366,49 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/Speckle.Connectors.DUI.WebView.csproj b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/Speckle.Connectors.DUI.WebView.csproj index ed1204c751..4f80899e94 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/Speckle.Connectors.DUI.WebView.csproj +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/Speckle.Connectors.DUI.WebView.csproj @@ -7,10 +7,10 @@ - + - \ No newline at end of file + diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json index 9b1e4b087b..2586c0cd45 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "Microsoft.Web.WebView2": { "type": "Direct", "requested": "[1.0.1823.32, )", @@ -60,6 +70,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -115,15 +130,6 @@ "System.ValueTuple": "4.5.0" } }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.Options": { "type": "Transitive", "resolved": "7.0.0", @@ -142,6 +148,11 @@ "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -200,15 +211,6 @@ "Serilog": "2.8.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -422,11 +424,6 @@ "System.ValueTuple": "4.5.0" } }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -463,9 +460,69 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Core": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" } }, "net6.0-windows7.0": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "Microsoft.Web.WebView2": { "type": "Direct", "requested": "[1.0.1823.32, )", @@ -553,6 +610,11 @@ "System.Text.Encodings.Web": "4.5.0" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -599,11 +661,6 @@ "Microsoft.Extensions.Options": "7.0.0" } }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" - }, "Microsoft.Extensions.ObjectPool": { "type": "Transitive", "resolved": "2.2.0", @@ -635,6 +692,11 @@ "System.Buffers": "4.5.0" } }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -690,15 +752,6 @@ "System.Reflection.TypeExtensions": "4.7.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -846,11 +899,6 @@ "resolved": "4.5.0", "contentHash": "Xg4G4Indi4dqP1iuAiMSwpiWS54ZghzR644OtsRCm/m/lBMG8dUBhLVN7hLm8NNrNTR+iGbshCPTwrvxZPlm4g==" }, - "System.Threading.Tasks.Dataflow": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - }, "speckle.autofac": { "type": "Project", "dependencies": { @@ -874,6 +922,52 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Core": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==" + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" } } } diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj index 6d4602c693..421db57bc1 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj @@ -1,13 +1,13 @@ - + netstandard2.0 - - - + + + diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json index 8b1d8f5d09..d1e30f591b 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { "Microsoft.Extensions.Logging.Abstractions": { @@ -12,6 +12,16 @@ "System.Memory": "4.5.5" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "NETStandard.Library": { "type": "Direct", "requested": "[2.0.3, )", @@ -140,6 +150,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -237,6 +252,11 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -296,15 +316,6 @@ "System.Reflection.TypeExtensions": "4.7.0" } }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, "Serilog.Formatting.Compact": { "type": "Transitive", "resolved": "1.1.0", @@ -529,6 +540,16 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Core": "[3.0.1-alpha.11, )" } + }, + "Serilog.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", + "dependencies": { + "Microsoft.Extensions.Logging": "7.0.0", + "Serilog": "2.12.0" + } } } } diff --git a/DUI3-DX/Directory.Build.props b/DUI3-DX/Directory.Build.props index ecc6709aba..7093d49171 100644 --- a/DUI3-DX/Directory.Build.props +++ b/DUI3-DX/Directory.Build.props @@ -7,10 +7,12 @@ true false true + true + true + + + true + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - - - - - diff --git a/DUI3-DX/Directory.Packages.props b/DUI3-DX/Directory.Packages.props new file mode 100644 index 0000000000..5e7ea97006 --- /dev/null +++ b/DUI3-DX/Directory.Packages.props @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj b/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj index e1524d1db6..c87411e8e9 100644 --- a/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj +++ b/DUI3-DX/Sdk/Speckle.Autofac/Speckle.Autofac.csproj @@ -1,4 +1,4 @@ - + true @@ -6,8 +6,8 @@ - - + + diff --git a/DUI3-DX/Sdk/Speckle.Autofac/packages.lock.json b/DUI3-DX/Sdk/Speckle.Autofac/packages.lock.json index c4cbeb83cb..bea3fab0df 100644 --- a/DUI3-DX/Sdk/Speckle.Autofac/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Autofac/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { "Autofac": { @@ -21,6 +21,16 @@ "System.Memory": "4.5.5" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "NETStandard.Library": { "type": "Direct", "requested": "[2.0.3, )", @@ -42,318 +52,34 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "GraphQL.Client": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0", - "GraphQL.Client.Abstractions.Websocket": "6.0.0", - "System.Reactive": "5.0.0" - } - }, - "GraphQL.Client.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", - "dependencies": { - "GraphQL.Primitives": "6.0.0" - } - }, - "GraphQL.Client.Abstractions.Websocket": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0" - } - }, - "GraphQL.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" - }, - "Microsoft.AspNetCore.Http": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "pPDcCW8spnyibK3krpxrOpaFHf5fjV6k1Hsl6gfh77N/8gRYlLU7MOQDUnjpEwdlHmtxwJKQJNxZqVQOmJGRUw==", - "dependencies": { - "Microsoft.AspNetCore.Http.Abstractions": "2.1.1", - "Microsoft.AspNetCore.WebUtilities": "2.1.1", - "Microsoft.Extensions.ObjectPool": "2.1.1", - "Microsoft.Extensions.Options": "2.1.1", - "Microsoft.Net.Http.Headers": "2.1.1" - } - }, - "Microsoft.AspNetCore.Http.Abstractions": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "kQUEVOU4loc8CPSb2WoHFTESqwIa8Ik7ysCBfTwzHAd0moWovc9JQLmhDIHlYLjHbyexqZAlkq/FPRUZqokebw==", - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "2.1.1", - "System.Text.Encodings.Web": "4.5.0" - } - }, - "Microsoft.AspNetCore.Http.Features": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "VklZ7hWgSvHBcDtwYYkdMdI/adlf7ebxTZ9kdzAhX+gUs5jSHE9mZlTamdgf9miSsxc1QjNazHXTDJdVPZKKTw==", - "dependencies": { - "Microsoft.Extensions.Primitives": "2.1.1" - } - }, - "Microsoft.AspNetCore.WebUtilities": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "PGKIZt4+412Z/XPoSjvYu/QIbTxcAQuEFNoA1Pw8a9mgmO0ZhNBmfaNyhgXFf7Rq62kP0tT/2WXpxdcQhkFUPA==", - "dependencies": { - "Microsoft.Net.Http.Headers": "2.1.1", - "System.Text.Encodings.Web": "4.5.0" - } - }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "KGxbPeWsQMnmQy43DSBxAFtHz3l2JX8EWBSGUCvT3CuZ8KsuzbkqMIJMDOxWtG8eZSoCDI04aiVQjWuuV8HmSw==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.5", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "FTerRmQPqHrCrnoUzhBu+E+1DNGwyrAMLqHkAqOOOu5pGfyMOj8qQUBxI/gDtWtG11p49UxSfWmBzRNlwZqfUg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "MgYpU5cwZohUMKKg3sbPhvGG+eAZ/59E9UwPwlrUkyXU+PGzqwZg9yyQNjhxuAWmoNoFReoemeCku50prYSGzA==" - }, - "Microsoft.Extensions.ObjectPool": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "SErON45qh4ogDp6lr6UvVmFYW0FERihW+IQ+2JyFv1PUyWktcJytFaWH5zarufJvZwhci7Rf1IyGXr9pVEadTw==" - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "V7lXCU78lAbzaulCGFKojcCyG8RTJicEbiBkPJjFqiqXwndEBBIehdXRMWEVU3UtzQ1yDvphiWUL9th6/4gJ7w==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.1", - "Microsoft.Extensions.Primitives": "2.1.1" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "scJ1GZNIxMmjpENh0UZ8XCQ6vzr/LzeF9WvEA51Ix2OQGAs9WPgPu8ABVUdvpKPLuor/t05gm6menJK3PwqOXg==", + "resolved": "1.1.0", + "contentHash": "1Am6l4Vpn3/K32daEqZI+FFr96OlZkgwK2LcT3pZ2zWubR5zTPW3/FkO1Rat9kb7oQOa4rxgl9LJHc5tspCWfg==", "dependencies": { - "System.Memory": "4.5.1", - "System.Runtime.CompilerServices.Unsafe": "4.5.1" + "System.Threading.Tasks.Extensions": "4.5.2" } }, - "Microsoft.Net.Http.Headers": { + "Microsoft.Build.Tasks.Git": { "type": "Transitive", - "resolved": "2.1.1", - "contentHash": "lPNIphl8b2EuhOE9dMH6EZDmu7pS882O+HMi5BJNsigxHaWlBrYxZHFZgE18cyaPp6SSZcTkKkuzfjV/RRQKlA==", - "dependencies": { - "Microsoft.Extensions.Primitives": "2.1.1", - "System.Buffers": "4.5.0" - } + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" }, "Microsoft.NETCore.Platforms": { "type": "Transitive", "resolved": "1.1.0", "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Polly": { - "type": "Transitive", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" - }, - "Polly.Contrib.WaitAndRetry": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" - }, - "Polly.Extensions.Http": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", - "dependencies": { - "Polly": "7.1.0" - } - }, - "Sentry": { - "type": "Transitive", - "resolved": "3.33.0", - "contentHash": "8vbD2o6IR2wrRrkSiRbnodWGWUOqIlwYtzpjvPNOb5raJdOf+zxMwfS8f6nx9bmrTTfDj7KrCB8C/5OuicAc8A==", - "dependencies": { - "System.Reflection.Metadata": "5.0.0", - "System.Text.Json": "5.0.2" - } - }, - "Sentry.Serilog": { - "type": "Transitive", - "resolved": "3.33.0", - "contentHash": "V8BU7QGWg2qLYfNPqtuTBhC1opysny5l+Ifp6J6PhOeAxU0FssR7nYfbJVetrnLIoh2rd3DlJ6hHYYQosQYcUQ==", - "dependencies": { - "Sentry": "3.33.0", - "Serilog": "2.7.1" - } - }, - "Serilog": { - "type": "Transitive", - "resolved": "2.12.0", - "contentHash": "xaiJLIdu6rYMKfQMYUZgTy8YK7SMZjB4Yk50C/u//Z4OsvxkUfSPJy4nknfvwAC34yr13q7kcyh4grbwhSxyZg==" - }, - "Serilog.Enrichers.ClientInfo": { - "type": "Transitive", - "resolved": "1.3.0", - "contentHash": "mTc7PM+wC9Hr7LWSwqt5mmnlAr7RJs+eTb3PGPRhwdOackk95MkhUZognuxXEdlW19HAFNmEBTSBY5DfLwM8jQ==", - "dependencies": { - "Microsoft.AspNetCore.Http": "2.1.1", - "Serilog": "2.7.1" - } - }, - "Serilog.Exceptions": { - "type": "Transitive", - "resolved": "8.4.0", - "contentHash": "nc/+hUw3lsdo0zCj0KMIybAu7perMx79vu72w0za9Nsi6mWyNkGXxYxakAjWB7nEmYL6zdmhEQRB4oJ2ALUeug==", - "dependencies": { - "Serilog": "2.8.0", - "System.Reflection.TypeExtensions": "4.7.0" - } - }, - "Serilog.Formatting.Compact": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "pNroKVjo+rDqlxNG5PXkRLpfSCuDOBY0ri6jp9PLe505ljqwhwZz8ospy2vWhQlFu5GkIesh3FcDs4n7sWZODA==", - "dependencies": { - "Serilog": "2.8.0" - } - }, - "Serilog.Sinks.Console": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "K6N5q+5fetjnJPvCmkWOpJ/V8IEIoMIB1s86OzBrbxwTyHxdx3pmz4H+8+O/Dc/ftUX12DM1aynx/dDowkwzqg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Serilog.Sinks.File": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "uwV5hdhWPwUH1szhO8PJpFiahqXmzPzJT/sOijH/kFgUx+cyoDTMM8MHD0adw9+Iem6itoibbUXHYslzXsLEAg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Serilog.Sinks.PeriodicBatching": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "NDWR7m3PalVlGEq3rzoktrXikjFMLmpwF0HI4sowo8YDdU+gqPlTHlDQiOGxHfB0sTfjPA9JjA7ctKG9zqjGkw==", - "dependencies": { - "Serilog": "2.0.0" - } - }, - "Serilog.Sinks.Seq": { - "type": "Transitive", - "resolved": "5.2.2", - "contentHash": "1Csmo5ua7NKUe0yXUx+zsRefjAniPWcXFhUXxXG8pwo0iMiw2gjn9SOkgYnnxbgWqmlGv236w0N/dHc2v5XwMg==", - "dependencies": { - "Serilog": "2.12.0", - "Serilog.Formatting.Compact": "1.1.0", - "Serilog.Sinks.File": "5.0.0", - "Serilog.Sinks.PeriodicBatching": "3.1.0" - } - }, - "SerilogTimings": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "Zs28eTgszAMwpIrbBnWHBI50yuxL50p/dmAUWmy75+axdZYK/Sjm5/5m1N/CisR8acJUhTVcjPZrsB1P5iv0Uw==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "SQLitePCLRaw.bundle_e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", - "dependencies": { - "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", - "SQLitePCLRaw.provider.e_sqlite3": "2.1.4" - } - }, - "SQLitePCLRaw.core": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - }, - "SQLitePCLRaw.provider.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "CSlb5dUp1FMIkez9Iv5EXzpeq7rHryVNqwJMWnpq87j9zWZexaEMdisDktMsnnrzKM6ahNrsTkjqNodTBPBxtQ==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "System.Buffers": { "type": "Transitive", "resolved": "4.5.1", "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", - "dependencies": { - "System.Memory": "4.5.4" - } - }, - "System.DoubleNumerics": { - "type": "Transitive", - "resolved": "3.1.3", - "contentHash": "KRKEM/L3KBodjA9VOg3EifFVWUY6EOqaMB05UvPEDm7Zeby/kZW+4kdWUEPzW6xtkwf46p661L9NrbeeQhtLzw==", - "dependencies": { - "NETStandard.Library": "1.6.1" - } - }, "System.Memory": { "type": "Transitive", "resolved": "4.5.5", @@ -366,103 +92,20 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", - "dependencies": { - "System.Runtime.InteropServices.WindowsRuntime": "4.3.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==", - "dependencies": { - "System.Collections.Immutable": "5.0.0" - } - }, - "System.Reflection.TypeExtensions": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==" - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "System.Runtime.InteropServices.WindowsRuntime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "J4GUi3xZQLUBasNwZnjrffN8i5wpHrBtZoLG+OhRyGo/+YunMRWWtwoMDlUAIdmX0uRfpHIBDSV6zyr3yf00TA==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "5.0.1", - "contentHash": "KmJ+CJXizDofbq6mpqDoRRLcxgOd2z9X3XoFNULSbvbqVRZkFX3istvr+MUjL6Zw1RT+RNdoI4GYidIINtgvqQ==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "5.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0", - "System.Text.Encodings.Web": "5.0.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "Speckle.Core": { - "type": "Project", + "resolved": "4.5.2", + "contentHash": "BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==", "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.5, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Sentry": "[3.33.0, )", - "Sentry.Serilog": "[3.33.0, )", - "Serilog": "[2.12.0, )", - "Serilog.Enrichers.ClientInfo": "[1.3.0, )", - "Serilog.Exceptions": "[8.4.0, )", - "Serilog.Sinks.Console": "[4.1.0, )", - "Serilog.Sinks.Seq": "[5.2.2, )", - "SerilogTimings": "[3.0.1, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.DoubleNumerics": "[3.1.3, )" + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } } } diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj index e2dfaccf8a..d379d2aace 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj @@ -1,11 +1,11 @@ - + netstandard2.0 - - + + diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json index 501db4a15e..077e72b92b 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "NETStandard.Library": { "type": "Direct", "requested": "[2.0.3, )", @@ -134,6 +144,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -188,15 +203,6 @@ "System.Diagnostics.DiagnosticSource": "7.0.0" } }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.ObjectPool": { "type": "Transitive", "resolved": "2.1.1", @@ -240,6 +246,11 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -515,6 +526,16 @@ "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj index 7675aeeae6..b7e5a37e54 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj @@ -5,7 +5,7 @@ - + diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json index e34336c3a4..19523196d8 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json @@ -1,5 +1,5 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { "Autofac": { @@ -11,6 +11,16 @@ "Microsoft.Bcl.AsyncInterfaces": "1.1.0" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "NETStandard.Library": { "type": "Direct", "requested": "[2.0.3, )", @@ -109,6 +119,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -136,15 +151,6 @@ "resolved": "2.1.1", "contentHash": "MgYpU5cwZohUMKKg3sbPhvGG+eAZ/59E9UwPwlrUkyXU+PGzqwZg9yyQNjhxuAWmoNoFReoemeCku50prYSGzA==" }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.ObjectPool": { "type": "Transitive", "resolved": "2.1.1", @@ -187,6 +193,11 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -297,42 +308,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -486,6 +466,49 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj index f1e4c53353..e5baa8e603 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj @@ -8,13 +8,12 @@ - - - - - - - + + + + + + diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json index 7bbbb295a6..25241e1d85 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json @@ -1,13 +1,7 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETFramework,Version=v4.8": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.2, )", - "resolved": "6.0.2", - "contentHash": "bJShQ6uWRTQ100ZeyiMqcFlhP7WJ+bCuabUs885dJiBEzMsJMSFr7BOyeCw4rgvQokteGi5rKQTlkhfQPUXg2A==" - }, "FluentAssertions": { "type": "Direct", "requested": "[6.12.0, )", @@ -26,6 +20,16 @@ "Microsoft.CodeCoverage": "17.10.0" } }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "Moq": { "type": "Direct", "requested": "[4.20.70, )", @@ -114,6 +118,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CodeCoverage": { "type": "Transitive", "resolved": "17.10.0", @@ -141,14 +150,10 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, "Polly": { "type": "Transitive", @@ -259,42 +264,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -445,6 +419,49 @@ "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Objects": "[3.0.1-alpha.11, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "dependencies": { + "Speckle.Core": "3.0.1-alpha.11" + } } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj b/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj index 1211ab6937..4bbe1058c7 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj @@ -5,7 +5,7 @@ - + diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json index b29c15e4a5..0bd34a6305 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json @@ -1,7 +1,17 @@ { - "version": 1, + "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, "NETStandard.Library": { "type": "Direct", "requested": "[2.0.3, )", @@ -109,6 +119,11 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, "Microsoft.CSharp": { "type": "Transitive", "resolved": "4.7.0", @@ -136,15 +151,6 @@ "resolved": "2.1.1", "contentHash": "MgYpU5cwZohUMKKg3sbPhvGG+eAZ/59E9UwPwlrUkyXU+PGzqwZg9yyQNjhxuAWmoNoFReoemeCku50prYSGzA==" }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, "Microsoft.Extensions.ObjectPool": { "type": "Transitive", "resolved": "2.1.1", @@ -187,6 +193,11 @@ "resolved": "1.1.0", "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, "Polly": { "type": "Transitive", "resolved": "7.2.3", @@ -297,29 +308,6 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", @@ -471,6 +459,40 @@ "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + }, + "Speckle.Core": { + "type": "CentralTransitive", + "requested": "[3.0.1-alpha.11, )", + "resolved": "3.0.1-alpha.11", + "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Sentry": "3.33.0", + "Sentry.Serilog": "3.33.0", + "Serilog": "2.12.0", + "Serilog.Enrichers.ClientInfo": "1.3.0", + "Serilog.Exceptions": "8.4.0", + "Serilog.Sinks.Console": "4.1.0", + "Serilog.Sinks.Seq": "5.2.2", + "SerilogTimings": "3.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "System.DoubleNumerics": "3.1.3" + } } } } From cd39d867065b53c111ff02adbe66642780cc863f Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 27 Jun 2024 16:28:09 +0100 Subject: [PATCH 3/6] Rollback interfaces (#3540) * initial nuget references * fmt * remove unused revit dependency * Don't use new solution * remove unused file * update core * Manage V3 versions centrally (exception AutoCAD) * fixed up multiple autocad versions * Removal of Revit interfaces * Remove Rhino interfaces * fix up project dependencies * some changes from reviewing * Merge remote-tracking branch 'origin/dui3/alpha' into rollback-interfaces * merge fixes and fmt * more review changes * more fixes * recheck lock files * fix caching * logger IOC fixes * fix IOC and fmt * try stuff for columns? * use less nullables and revit root properly --- All.sln | 19 - Build/Consts.cs | 6 +- DUI3-DX.slnf | 2 - .../packages.lock.json | 31 - .../packages.lock.json | 49 +- .../Bindings/BasicConnectorBindingRevit.cs | 2 +- .../Bindings/RevitBaseBinding.cs | 2 +- .../Bindings/RevitSendBinding.cs | 2 +- .../Bindings/SelectionBinding.cs | 2 +- .../DependencyInjection/ProxyMapper.cs | 17 - .../RevitConnectorModule.cs | 10 +- .../Helpers/RevitConversionContextStack.cs | 38 -- .../HostApp/RevitDocumentStore.cs | 2 +- .../Operations/Send/RevitRootObjectBuilder.cs | 11 +- .../Plugin/RevitExternalApplication.cs | 3 +- .../Plugin/RevitIdleManager.cs | 2 +- .../Plugin/RevitPlugin.cs | 5 +- .../Speckle.Connectors.RevitShared.projitems | 23 +- .../DependencyInjection/ProxyMapper.cs | 17 - .../RhinoConnectorModule.cs | 4 - .../HostApp/RhinoContext.cs | 8 + .../Operations/Receive/DisableRedrawScope.cs | 8 +- .../Receive/RhinoHostObjectBuilder.cs | 51 +- .../Speckle.Connectors.Rhino7.csproj | 3 +- .../packages.lock.json | 45 +- .../ArcGISConverterModule.cs | 2 +- .../packages.lock.json | 31 - .../RevitConverterModule.cs | 22 +- ...rters.Revit2023.DependencyInjection.csproj | 3 - .../packages.lock.json | 46 +- .../LocationConversionToSpeckleTests.cs | 85 --- .../Speckle.Converters.Revit2023.Tests.csproj | 27 - .../packages.lock.json | 560 ------------------ .../RevitVersionConversionHelper.cs | 19 + .../Speckle.Converters.Revit2023.csproj | 3 +- .../packages.lock.json | 8 +- .../Extensions/CategoryExtensions.cs | 8 +- .../Extensions/DefinitionExtensions.cs | 8 +- .../Extensions/ElementExtensions.cs | 23 +- .../Extensions/ForgeTypeIdExtensions.cs | 14 +- .../Extensions/ParameterExtensions.cs | 13 +- .../GlobalUsings.cs | 4 +- .../Helpers/DisplayValueExtractor.cs | 200 +++---- .../Helpers/IRevitConversionContextStack.cs | 13 + .../Helpers/ISlopeArrowExtractor.cs | 10 + .../Helpers/ParameterObjectAssigner.cs | 35 +- .../Helpers/ParameterObjectBuilder.cs | 50 ++ .../Helpers/ParameterValueExtractor.cs | 161 +++-- .../Helpers/RevitCategories.cs | 150 +++++ .../Helpers/RevitCategoryInfo.cs | 65 ++ .../Helpers/RevitContext.cs | 4 +- .../Helpers/RevitConversionContextStack.cs | 28 + .../Helpers/SendSelection.cs | 17 + .../Helpers/SlopeArrowExtractor.cs | 55 +- .../Helpers/ToSpeckleConvertedObjectsCache.cs | 25 + .../IReferencePointConverter.cs | 6 + .../IRevitVersionConversionHelper.cs | 6 + .../Raw/BeamConversionToSpeckle.cs | 36 +- .../Raw/BoundarySegmentConversionToSpeckle.cs | 13 +- .../Raw/BraceToSpeckleConverter.cs | 15 +- .../Raw/ColumnConversionToSpeckle.cs | 80 ++- .../Raw/Geometry/ArcToSpeckleConverter.cs | 42 +- .../BoundingBoxXYZToSpeckleConverter.cs | 26 +- .../Raw/Geometry/CircleToSpeckleConverter.cs | 24 +- ...urveArrArrayToSpecklePolycurveConverter.cs | 27 +- .../Geometry/CurveArrayConversionToSpeckle.cs | 30 +- .../Raw/Geometry/CurveConversionToSpeckle.cs | 67 +-- .../Raw/Geometry/EllipseToSpeckleConverter.cs | 32 +- .../HermiteSplineToSpeckleConverter.cs | 18 +- .../Raw/Geometry/LineConversionToSpeckle.cs | 21 +- .../MeshByMaterialDictionaryToSpeckle.cs | 41 +- .../Raw/Geometry/MeshConversionToSpeckle.cs | 37 +- .../Geometry/NurbsSplineToSpeckleConverter.cs | 27 +- .../Raw/Geometry/PlaneToSpeckleConverter.cs | 19 +- .../Geometry/PointCloudToSpeckleConverter.cs | 41 +- .../Raw/Geometry/PointConversionToSpeckle.cs | 11 +- .../Geometry/PolylineToSpeckleConverter.cs | 15 +- .../Raw/Geometry/SolidConversionToSpeckle.cs | 40 +- .../Raw/Geometry/VectorToSpeckleConverter.cs | 13 +- .../Raw/Geometry/XyzConversionToPoint.cs | 16 +- .../Raw/LevelConversionToSpeckle.cs | 13 +- .../Raw/LocationConversionToSpeckle.cs | 37 +- .../Raw/MaterialConversionToSpeckle.cs | 7 +- .../ModelCurveArrArrayConverterToSpeckle.cs | 30 - .../ModelCurveArrArrayToSpeckleConverter.cs | 28 + .../Raw/ModelCurveArrayToSpeckleConverter.cs | 30 +- .../Raw/ParameterConversionToSpeckle.cs | 27 +- .../Raw/RevitVersionConversionHelper.cs | 23 - .../{Services => }/ReferencePointConverter.cs | 75 +-- .../RevitConstants.cs | 6 - .../RevitConversionSettings.cs | 19 + .../RevitRootToHostConverter.cs | 50 ++ .../Services/RevitToSpeckleUnitConverter.cs | 27 +- .../Services/ScalingServiceToSpeckle.cs | 25 +- .../Speckle.Converters.RevitShared.projitems | 68 ++- .../BaseTopLevelConverterToSpeckle.cs | 2 +- .../CeilingTopLevelConverterToSpeckle.cs | 35 +- .../DirectShapeTopLevelConverterToSpeckle.cs | 22 +- .../ElementTopLevelConverterToSpeckle.cs | 20 +- ...ExtrusionRoofToSpeckleTopLevelConverter.cs | 57 +- ...amilyInstanceTopLevelConverterToSpeckle.cs | 32 +- .../FloorTopLevelConverterToSpeckle.cs | 48 +- ...FootPrintRoofToSpeckleTopLevelConverter.cs | 57 +- .../HostedElementConversionToSpeckle.cs | 20 +- .../ModelCurveToSpeckleTopLevelConverter.cs | 19 +- ...fBaseToSpeckleTopLevelTopLevelConverter.cs | 31 +- .../RoomTopLevelConverterToSpeckle.cs | 39 +- .../TopographyTopLevelConverterToSpeckle.cs | 17 +- .../WallTopLevelConverterToSpeckle.cs | 82 +-- .../RhinoConverterModule.cs | 7 +- .../RhinoRootElementProvider.cs | 9 - ...nverters.Rhino7.DependencyInjection.csproj | 2 +- .../packages.lock.json | 21 +- .../Speckle.Converters.Rhino7/GlobalUsings.cs | 1 + .../RhinoConversionContextStack.cs | 11 +- .../RhinoToSpeckleUnitConverter.cs | 30 +- .../Speckle.Converters.Rhino7.csproj | 5 +- ...ckleToHostGeometryBaseTopLevelConverter.cs | 17 +- .../ToHost/Raw/ArcToHostConverter.cs | 32 +- .../ToHost/Raw/BrepToHostConverter.cs | 57 +- .../ToHost/Raw/CircleToHostConverter.cs | 38 +- .../ToHost/Raw/CurveToHostConverter.cs | 41 +- .../ToHost/Raw/EllipseToHostConverter.cs | 36 +- .../Raw/FlatPointListToHostConverter.cs | 21 +- .../ToHost/Raw/IntervalToHostConverter.cs | 14 +- .../ToHost/Raw/LineToHostConverter.cs | 21 +- .../ToHost/Raw/MeshToHostConverter.cs | 44 +- .../ToHost/Raw/NurbsCurveToHostConverter.cs | 25 +- .../ToHost/Raw/PlaneToHostConverter.cs | 18 +- .../ToHost/Raw/PointCloudToHostConverter.cs | 17 +- .../ToHost/Raw/PointToHostConverter.cs | 15 +- .../ToHost/Raw/PolyCurveToHostConverter.cs | 21 +- .../ToHost/Raw/PolylineToHostConverter.cs | 27 +- .../ToHost/Raw/SpiralToHostConverter.cs | 13 +- .../ToHost/Raw/SurfaceToHostConverter.cs | 18 +- .../ToHost/Raw/VectorToHostConverter.cs | 12 +- .../TopLevel/ArcToHostTopLevelConverter.cs | 13 +- .../TopLevel/BrepToHostTopLevelConverter.cs | 13 +- .../TopLevel/CircleToHostTopLevelConverter.cs | 13 +- .../EllipseToHostTopLevelConverter.cs | 13 +- .../FallbackToHostTopLevelConverter.cs | 37 +- .../TopLevel/LineToHostTopLevelConverter.cs | 13 +- .../TopLevel/MeshToHostTopLevelConverter.cs | 13 +- .../NurbsCurveToHostTopLevelConverter.cs | 13 +- .../PointCloudToHostTopLevelConverter.cs | 13 +- .../TopLevel/PointToHostTopLevelConverter.cs | 13 +- .../PolycurveToHostTopLevelConverter.cs | 14 +- .../PolylineToHostTopLevelConverter.cs | 13 +- .../Raw/ArcCurveToSpeckleConverter.cs | 28 +- .../ToSpeckle/Raw/ArcToSpeckleConverter.cs | 29 +- .../ToSpeckle/Raw/BoxToSpeckleConverter.cs | 20 +- .../ToSpeckle/Raw/BrepToSpeckleConverter.cs | 59 +- .../ToSpeckle/Raw/CircleToSpeckleConverter.cs | 22 +- .../Raw/ControlPointToSpeckleConverter.cs | 15 +- .../ToSpeckle/Raw/CurveToSpeckleConverter.cs | 57 +- .../Raw/EllipseToSpeckleConverter.cs | 25 +- .../Raw/IntervalToSpeckleConverter.cs | 5 +- .../ToSpeckle/Raw/LineToSpeckleConverter.cs | 27 +- .../ToSpeckle/Raw/MeshToSpeckleConverter.cs | 28 +- .../ToSpeckle/Raw/NurbsCurveConverter.cs | 33 +- .../Raw/NurbsSurfaceToSpeckleConverter.cs | 32 +- .../ToSpeckle/Raw/PlaneToSpeckleConverter.cs | 18 +- .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 15 +- .../Raw/PolyCurveToSpeckleConverter.cs | 26 +- .../Raw/PolylineToSpeckleConverter.cs | 39 +- .../ToSpeckle/Raw/RawPointCloudToSpeckle.cs | 21 +- .../ToSpeckle/Raw/VectorToSpeckleConverter.cs | 12 +- .../BrepObjectToSpeckleTopLevelConverter.cs | 12 +- .../CurveObjectToSpeckleTopLevelConverter.cs | 13 +- ...trusionObjectToSpeckleTopLevelConverter.cs | 12 +- .../MeshObjectToSpeckleTopLevelConverter.cs | 13 +- ...ntCloudObjectToSpeckleTopLevelConverter.cs | 12 +- .../PointObjectToSpeckleTopLevelConverter.cs | 12 +- .../RhinoObjectToSpeckleTopLevelConverter.cs | 12 +- .../packages.lock.json | 12 +- .../packages.lock.json | 46 -- DUI3-DX/Directory.Packages.props | 11 +- .../ContainerRegistration.cs | 6 +- .../Speckle.Connectors.Utils.csproj | 1 + .../packages.lock.json | 9 + .../ContainerRegistration.cs | 3 +- .../NamedTypeInjector.cs | 22 +- .../RawConversionRegisterer.cs | 23 +- .../FakeType.cs | 109 ---- .../RootToSpeckleConverterTests.cs | 66 --- .../Speckle.Converters.Common.Tests.csproj | 24 - .../packages.lock.json | 468 --------------- .../ContextWrapper.cs | 2 +- .../ConversionContext.cs | 8 +- .../ConversionContextStack.cs | 9 +- .../Speckle.Converters.Common/IProxyMapper.cs | 33 -- .../LegacyRootToSpeckleConverter.cs | 37 -- .../RootConvertManager.cs | 2 +- .../RootToSpeckleConverter.cs | 45 +- 194 files changed, 2196 insertions(+), 3791 deletions(-) delete mode 100644 DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/ProxyMapper.cs delete mode 100644 DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitConversionContextStack.cs delete mode 100644 DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/ProxyMapper.cs create mode 100644 DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoContext.cs delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/LocationConversionToSpeckleTests.cs delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/RevitVersionConversionHelper.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ISlopeArrowExtractor.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectBuilder.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitCategories.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitCategoryInfo.cs rename DUI3-DX/{Connectors/Revit/Speckle.Connectors.RevitShared => Converters/Revit/Speckle.Converters.RevitShared}/Helpers/RevitContext.cs (80%) create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SendSelection.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ToSpeckleConvertedObjectsCache.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IReferencePointConverter.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IRevitVersionConversionHelper.cs delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayConverterToSpeckle.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayToSpeckleConverter.cs delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/RevitVersionConversionHelper.cs rename DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/{Services => }/ReferencePointConverter.cs (51%) delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConstants.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConversionSettings.cs create mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs delete mode 100644 DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoRootElementProvider.cs delete mode 100644 DUI3-DX/Sdk/Speckle.Converters.Common.Tests/FakeType.cs delete mode 100644 DUI3-DX/Sdk/Speckle.Converters.Common.Tests/RootToSpeckleConverterTests.cs delete mode 100644 DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj delete mode 100644 DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json delete mode 100644 DUI3-DX/Sdk/Speckle.Converters.Common/IProxyMapper.cs delete mode 100644 DUI3-DX/Sdk/Speckle.Converters.Common/LegacyRootToSpeckleConverter.cs diff --git a/All.sln b/All.sln index 59406b4cb8..da15c240b4 100644 --- a/All.sln +++ b/All.sln @@ -558,8 +558,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B1324D25 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2023.Tests", "DUI3-DX\Converters\Revit\Speckle.Converters.Revit2023.Tests\Speckle.Converters.Revit2023.Tests.csproj", "{AEC26A0B-25F3-4544-A9D6-A427BFF79250}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common.Tests", "DUI3-DX\Sdk\Speckle.Converters.Common.Tests\Speckle.Converters.Common.Tests.csproj", "{95E23A97-E5EA-4506-A52C-D3DA9012DA02}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2024", "DUI3-DX\Connectors\Autocad\Speckle.Connectors.Civil3d2024\Speckle.Connectors.Civil3d2024.csproj", "{DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024", "DUI3-DX\Converters\Autocad\2024\Speckle.Converters.Autocad2024\Speckle.Converters.Autocad2024.csproj", "{C9C28F31-1367-438C-83B0-049C3B3A3E3B}" @@ -2816,22 +2814,6 @@ Global {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|Any CPU.Build.0 = Release|Any CPU {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|x64.ActiveCfg = Release|Any CPU {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|x64.Build.0 = Release|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug Mac|x64.ActiveCfg = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug Mac|x64.Build.0 = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug|x64.ActiveCfg = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Debug|x64.Build.0 = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release Mac|Any CPU.ActiveCfg = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release Mac|Any CPU.Build.0 = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release Mac|x64.ActiveCfg = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release Mac|x64.Build.0 = Debug|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release|Any CPU.Build.0 = Release|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release|x64.ActiveCfg = Release|Any CPU - {95E23A97-E5EA-4506-A52C-D3DA9012DA02}.Release|x64.Build.0 = Release|Any CPU {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}.Debug Mac|x64.ActiveCfg = Debug|Any CPU @@ -3092,7 +3074,6 @@ Global {70DEAA13-6DC8-44A0-B287-9E806A8054F1} = {890F3257-FCC2-4ED8-9180-22B3641B494C} {F06E4C37-4076-4272-9CA6-FB505E02CD31} = {BE521908-7944-46F3-98BF-B47D34509934} {AEC26A0B-25F3-4544-A9D6-A427BFF79250} = {D92751C8-1039-4005-90B2-913E55E0B8BD} - {95E23A97-E5EA-4506-A52C-D3DA9012DA02} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E} = {743489BF-1941-43D5-8AF9-35C56D0DCC34} {C9C28F31-1367-438C-83B0-049C3B3A3E3B} = {804E065F-914C-414A-AF84-009312C3CFF6} {06082BAA-98E8-49B1-9D33-252B126A0561} = {804E065F-914C-414A-AF84-009312C3CFF6} diff --git a/Build/Consts.cs b/Build/Consts.cs index 2fa9d8deaa..5d3f91de54 100644 --- a/Build/Consts.cs +++ b/Build/Consts.cs @@ -5,11 +5,7 @@ namespace Build; public static class Consts { public static readonly string[] Solutions = { "DUI3-DX.slnf" }; - public static readonly string[] TestProjects = - { - "Speckle.Converters.Revit2023.Tests", - "Speckle.Converters.Common.Tests" - }; + public static readonly string[] TestProjects = System.Array.Empty(); public static readonly InstallerProject[] InstallerManifests = { diff --git a/DUI3-DX.slnf b/DUI3-DX.slnf index 157eec292b..4f4a6e3edb 100644 --- a/DUI3-DX.slnf +++ b/DUI3-DX.slnf @@ -18,7 +18,6 @@ "DUI3-DX\\Converters\\Autocad\\2024\\Speckle.Converters.Autocad2024\\Speckle.Converters.Autocad2024.csproj", "DUI3-DX\\Converters\\Autocad\\Speckle.Converters.AutocadShared\\Speckle.Converters.AutocadShared.shproj", "DUI3-DX\\Converters\\Revit\\Speckle.Converters.Revit2023.DependencyInjection\\Speckle.Converters.Revit2023.DependencyInjection.csproj", - "DUI3-DX\\Converters\\Revit\\Speckle.Converters.Revit2023.Tests\\Speckle.Converters.Revit2023.Tests.csproj", "DUI3-DX\\Converters\\Revit\\Speckle.Converters.Revit2023\\Speckle.Converters.Revit2023.csproj", "DUI3-DX\\Converters\\Revit\\Speckle.Converters.RevitShared\\Speckle.Converters.RevitShared.shproj", "DUI3-DX\\Converters\\Rhino\\Speckle.Converters.Rhino7.DependencyInjection\\Speckle.Converters.Rhino7.DependencyInjection.csproj", @@ -28,7 +27,6 @@ "DUI3-DX\\Sdk\\Speckle.Autofac\\Speckle.Autofac.csproj", "DUI3-DX\\Sdk\\Speckle.Connectors.Utils\\Speckle.Connectors.Utils.csproj", "DUI3-DX\\Sdk\\Speckle.Converters.Common.DependencyInjection\\Speckle.Converters.Common.DependencyInjection.csproj", - "DUI3-DX\\Sdk\\Speckle.Converters.Common.Tests\\Speckle.Converters.Common.Tests.csproj", "DUI3-DX\\Sdk\\Speckle.Converters.Common\\Speckle.Converters.Common.csproj" ] } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json index df67e2ad73..68bcf35809 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json @@ -272,42 +272,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json index 99af7ef77d..0a002c7391 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json @@ -90,21 +90,6 @@ "resolved": "6.0.0", "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" }, - "Mapster": { - "type": "Transitive", - "resolved": "7.3.0", - "contentHash": "NrCUX/rJa5PTyo6iW4AL5dZLU9PDNlYnrJOVjgdpo5OQM9EtWH2CMHnC5sSuJWC0d0b0SnmeRrIviEem6WxtuQ==", - "dependencies": { - "Mapster.Core": "1.2.0", - "Microsoft.CSharp": "4.3.0", - "System.Reflection.Emit": "4.3.0" - } - }, - "Mapster.Core": { - "type": "Transitive", - "resolved": "1.2.0", - "contentHash": "TNdqZk2zAuBYfJF88D/3clQTOyOdqr1crU81yZQtlGa+e7FYWhJdK/buBWT+TpM3qQko9UzmzfOT4iq3JCs/ZA==" - }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", "resolved": "7.0.0", @@ -310,11 +295,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Revit.API": { - "type": "Transitive", - "resolved": "2023.0.0", - "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -407,11 +387,6 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==" - }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "5.0.0", @@ -509,7 +484,7 @@ "type": "Project", "dependencies": { "Speckle.Converters.Common": "[2.0.999-local, )", - "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" + "Speckle.Revit.API": "[2023.0.0, )" } }, "speckle.converters.revit2023.dependencyinjection": { @@ -517,8 +492,7 @@ "dependencies": { "Speckle.Converters.Common": "[2.0.999-local, )", "Speckle.Converters.Common.DependencyInjection": "[2.0.999-local, )", - "Speckle.Converters.Revit2023": "[2.0.999-local, )", - "Speckle.Revit2023.Api": "[0.1.1-preview.0.28, )" + "Speckle.Converters.Revit2023": "[2.0.999-local, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -574,22 +548,11 @@ "Speckle.Core": "3.0.1-alpha.11" } }, - "Speckle.Revit2023.Api": { - "type": "CentralTransitive", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "ejwYS/HI8yy0rJE4vgTr5aj8Fkg/E9JnMGjwyVS2fLtI4f7+FmwAY6inTUT2p/RAoRc2nQw+TerDpUtOhddzag==", - "dependencies": { - "Mapster": "7.3.0", - "Speckle.Revit.API": "2023.0.0", - "Speckle.Revit2023.Interfaces": "0.1.1-preview.0.28" - } - }, - "Speckle.Revit2023.Interfaces": { + "Speckle.Revit.API": { "type": "CentralTransitive", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" + "requested": "[2023.0.0, )", + "resolved": "2023.0.0", + "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" }, "System.Threading.Tasks.Dataflow": { "type": "CentralTransitive", diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs index ff27f05fb4..3aa6be233f 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs @@ -6,8 +6,8 @@ using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.Revit.Plugin; -using Speckle.Connectors.RevitShared.Helpers; using Speckle.Connectors.Utils; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Logging; namespace Speckle.Connectors.DUI.Bindings; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs index 566cc9c41a..9774517d94 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs @@ -1,7 +1,7 @@ using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; -using Speckle.Connectors.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Connectors.Revit.Bindings; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs index 8bd3033442..99e6492b79 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs @@ -3,12 +3,12 @@ using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.Revit.Plugin; using Speckle.Connectors.Utils; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.DUI.Bindings; using Speckle.Autofac.DependencyInjection; using Speckle.Connectors.DUI.Exceptions; using Speckle.Connectors.DUI.Models; -using Speckle.Connectors.RevitShared.Helpers; using Speckle.Connectors.Utils.Caching; using Speckle.Connectors.Utils.Cancellation; using Speckle.Connectors.Utils.Operations; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs index d60fe3ef27..c74a0606bd 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs @@ -2,8 +2,8 @@ using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.Revit.Plugin; -using Speckle.Connectors.RevitShared.Helpers; using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Connectors.Revit.Bindings; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/ProxyMapper.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/ProxyMapper.cs deleted file mode 100644 index e4e997c4e2..0000000000 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/ProxyMapper.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.ProxyGenerator; - -namespace Speckle.Connectors.Revit.DependencyInjection; - -public class ProxyMapper : IProxyMapper -{ - public Type? GetMappedTypeFromHostType(Type type) => ProxyMap.GetMappedTypeFromHostType(type); - - public Type? GetMappedTypeFromProxyType(Type type) => ProxyMap.GetMappedTypeFromProxyType(type); - - public Type? GetHostTypeFromMappedType(Type type) => ProxyMap.GetHostTypeFromMappedType(type); - - public object CreateProxy(Type type, object toWrap) => ProxyMap.CreateProxy(type, toWrap); - - public T CreateProxy(object toWrap) => ProxyMap.CreateProxy(toWrap); -} diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs index 879bf05041..ec1bcb5566 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs @@ -10,14 +10,10 @@ using Speckle.Connectors.Revit.HostApp; using Speckle.Connectors.Revit.Operations.Send; using Speckle.Connectors.Revit.Plugin; -using Speckle.Connectors.RevitShared.Helpers; using Speckle.Connectors.Utils; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; using Speckle.Connectors.Utils.Operations; -using Speckle.Converters.Common; -using Speckle.Revit.Api; -using Speckle.Revit.Interfaces; namespace Speckle.Connectors.Revit.DependencyInjection; @@ -29,11 +25,7 @@ public void Load(SpeckleContainerBuilder builder) builder.AddAutofac(); builder.AddConnectorUtils(); builder.AddDUI(); - builder.AddSingleton(new RevitContext()); - - // POC: the concrete type can come out if we remove all the reference to it - builder.AddScoped, RevitConversionContextStack>(); - builder.ScanAssemblyOfType(); + //builder.AddDUIView(); builder.AddSingletonInstance(); diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitConversionContextStack.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitConversionContextStack.cs deleted file mode 100644 index d5461e7f60..0000000000 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitConversionContextStack.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Autodesk.Revit.DB; -using Speckle.Converters.Common; -using Speckle.Revit.Api; -using Speckle.Revit.Interfaces; - -namespace Speckle.Connectors.RevitShared.Helpers; - -[System.Diagnostics.CodeAnalysis.SuppressMessage( - "Naming", - "CA1711:Identifiers should not have incorrect suffix", - Justification = "See base class justification" -)] -// POC: so this should *probably* be Document and NOT UI.UIDocument, the former is Conversion centric -// and the latter is more for connector -public class RevitConversionContextStack - : ConversionContextStack, - IConversionContextStack -{ - public RevitConversionContextStack(RevitContext context, IHostToSpeckleUnitConverter unitConverter) - : base( - // POC: we probably should not get here without a valid document - // so should this perpetuate or do we assume this is valid? - // relting on the context.UIApplication?.ActiveUIDocument is not right - // this should be some IActiveDocument I suspect? - new DocumentProxy( - context.UIApplication?.ActiveUIDocument?.Document - ?? throw new SpeckleConversionException("Active UI document could not be determined") - ), - new ForgeTypeIdProxy( - context.UIApplication.ActiveUIDocument.Document.GetUnits().GetFormatOptions(SpecTypeId.Length).GetUnitTypeId() - ), - unitConverter - ) { } - - ContextWrapper IConversionContextStack.Push( - string speckleUnit - ) => throw new NotImplementedException(); -} diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitDocumentStore.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitDocumentStore.cs index ba9b7d8db3..42acdc95ca 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitDocumentStore.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitDocumentStore.cs @@ -7,8 +7,8 @@ using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.Revit.Plugin; -using Speckle.Connectors.RevitShared.Helpers; using Speckle.Connectors.Utils; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Logging; using Speckle.Newtonsoft.Json; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs index 417478e952..df84c9218e 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs @@ -3,13 +3,12 @@ using Speckle.Core.Models; using Autodesk.Revit.DB; using Speckle.Connectors.DUI.Exceptions; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; using Speckle.Connectors.Utils.Conversion; using Speckle.Connectors.Utils.Operations; using Speckle.Core.Logging; -using Speckle.Revit.Api; -using Speckle.Revit.Interfaces; namespace Speckle.Connectors.Revit.Operations.Send; @@ -17,14 +16,14 @@ public class RevitRootObjectBuilder : IRootObjectBuilder { // POC: SendSelection and RevitConversionContextStack should be interfaces, former needs interfaces private readonly IRootToSpeckleConverter _converter; - private readonly IConversionContextStack _contextStack; + private readonly IRevitConversionContextStack _contextStack; private readonly Dictionary _collectionCache; private readonly Collection _rootObject; private readonly ISendConversionCache _sendConversionCache; public RevitRootObjectBuilder( IRootToSpeckleConverter converter, - IConversionContextStack contextStack, + IRevitConversionContextStack contextStack, ISendConversionCache sendConversionCache ) { @@ -46,7 +45,7 @@ public RootObjectBuilderResult Build( CancellationToken ct = default ) { - var doc = ((DocumentProxy)_contextStack.Current.Document)._Instance; + var doc = _contextStack.Current.Document; if (doc.IsFamilyDocument) { @@ -57,7 +56,7 @@ public RootObjectBuilderResult Build( foreach (var id in objects) { - var el = doc.GetElement(id); + var el = _contextStack.Current.Document.GetElement(id); if (el != null) { revitElements.Add(el); diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs index afe71b6f6d..6de43da0c7 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs @@ -1,5 +1,6 @@ using Autodesk.Revit.UI; using Speckle.Autofac.DependencyInjection; +using System.IO; using System.Reflection; using Speckle.Autofac; using Speckle.Connectors.Utils; @@ -31,7 +32,7 @@ public RevitExternalApplication() "2023", "Speckle New UI", "Revit", - new[] { System.IO.Path.GetDirectoryName(typeof(RevitExternalApplication).Assembly.Location) }, + new[] { Path.GetDirectoryName(typeof(RevitExternalApplication).Assembly.Location) }, "Revit Connector", "2023" //POC: app version? ); diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitIdleManager.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitIdleManager.cs index 6e3d0c4e5e..1b46efa267 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitIdleManager.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitIdleManager.cs @@ -2,7 +2,7 @@ using Autodesk.Revit.UI; using Autodesk.Revit.UI.Events; using Speckle.Connectors.DUI.Bridge; -using Speckle.Connectors.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Connectors.Revit.Plugin; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitPlugin.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitPlugin.cs index a46046dd45..13d3500b2f 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitPlugin.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitPlugin.cs @@ -5,11 +5,12 @@ using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Bindings; using System.Diagnostics; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Logging; using System.Reflection; using System.Windows.Media.Imaging; using System.Windows.Media; -using Speckle.Connectors.RevitShared.Helpers; +using System.IO; namespace Speckle.Connectors.Revit.Plugin; @@ -181,7 +182,7 @@ private void RegisterDockablePane() { try { - var assembly = Assembly.LoadFrom(System.IO.Path.Combine(path)); + var assembly = Assembly.LoadFrom(Path.Combine(path)); var icon = assembly.GetManifestResourceStream(sourceName); PngBitmapDecoder decoder = new(icon, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); ImageSource source = decoder.Frames[0]; diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems index a479f3189b..8a671aefc9 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems @@ -16,7 +16,28 @@ - + + + + + + + + + + + + + + CefSharpPanel.xaml + + + + + + + + diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/ProxyMapper.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/ProxyMapper.cs deleted file mode 100644 index dabeb71d95..0000000000 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/ProxyMapper.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.ProxyGenerator; - -namespace Speckle.Connectors.Rhino7.DependencyInjection; - -public class ProxyMapper : IProxyMapper -{ - public Type? GetMappedTypeFromHostType(Type type) => ProxyMap.GetMappedTypeFromHostType(type); - - public Type? GetMappedTypeFromProxyType(Type type) => ProxyMap.GetMappedTypeFromProxyType(type); - - public Type? GetHostTypeFromMappedType(Type type) => ProxyMap.GetHostTypeFromMappedType(type); - - public object CreateProxy(Type type, object toWrap) => ProxyMap.CreateProxy(type, toWrap); - - public T CreateProxy(object toWrap) => ProxyMap.CreateProxy(toWrap); -} diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs index 16cdc3a7de..7be48aa2b6 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs @@ -20,9 +20,7 @@ using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; using Speckle.Connectors.Utils.Operations; -using Speckle.Converters.Common; using Speckle.Core.Models.GraphTraversal; -using Speckle.Rhino7.Api; namespace Speckle.Connectors.Rhino7.DependencyInjection; @@ -38,7 +36,6 @@ public void Load(SpeckleContainerBuilder builder) builder.AddConnectorUtils(); builder.AddDUI(); builder.AddDUIView(); - builder.ScanAssemblyOfType(); // POC: Overwriting the SyncToMainThread to SyncToCurrentThread for Rhino! builder.AddSingletonInstance(); @@ -47,7 +44,6 @@ public void Load(SpeckleContainerBuilder builder) builder.AddSingleton(); builder.AddSingleton(); builder.AddSingleton(); - builder.AddSingleton(); // Register bindings builder.AddSingleton(); diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoContext.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoContext.cs new file mode 100644 index 0000000000..17b532035a --- /dev/null +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoContext.cs @@ -0,0 +1,8 @@ +using Rhino; + +namespace Speckle.Connectors.Rhino7.HostApp; + +public class RhinoContext +{ + public RhinoDoc Document { get; } = RhinoDoc.ActiveDoc; +} diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/DisableRedrawScope.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/DisableRedrawScope.cs index 621bfa45ed..1182e5de7a 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/DisableRedrawScope.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/DisableRedrawScope.cs @@ -1,16 +1,16 @@ -using Speckle.Rhino7.Interfaces; +using Rhino.DocObjects.Tables; namespace Speckle.Connectors.Rhino7.Operations.Receive; /// -/// Helper class to disable within a scope +/// Helper class to disable within a scope /// public sealed class DisableRedrawScope : IDisposable { - private readonly IRhinoViewTable _viewTable; + private readonly ViewTable _viewTable; private readonly bool _returnToStatus; - public DisableRedrawScope(IRhinoViewTable viewTable, bool returnToStatus = true) + public DisableRedrawScope(ViewTable viewTable, bool returnToStatus = true) { _viewTable = viewTable; _returnToStatus = returnToStatus; diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs index 6c73b9bd10..02f653f08a 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs @@ -1,32 +1,31 @@ using System.Diagnostics.Contracts; +using Rhino; +using Rhino.DocObjects; +using Rhino.Geometry; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Conversion; using Speckle.Converters.Common; using Speckle.Core.Logging; using Speckle.Core.Models; using Speckle.Core.Models.GraphTraversal; -using Speckle.Rhino7.Interfaces; namespace Speckle.Connectors.Rhino7.Operations.Receive; public class RhinoHostObjectBuilder : IHostObjectBuilder { private readonly IRootToHostConverter _converter; - private readonly IConversionContextStack _contextStack; + private readonly IConversionContextStack _contextStack; private readonly GraphTraversal _traverseFunction; - private readonly IRhinoDocFactory _rhinoDocFactory; public RhinoHostObjectBuilder( IRootToHostConverter converter, - IConversionContextStack contextStack, - GraphTraversal traverseFunction, - IRhinoDocFactory rhinoDocFactory + IConversionContextStack contextStack, + GraphTraversal traverseFunction ) { _converter = converter; _contextStack = contextStack; _traverseFunction = traverseFunction; - _rhinoDocFactory = rhinoDocFactory; } public HostObjectBuilderResult Build( @@ -54,19 +53,15 @@ CancellationToken cancellationToken // POC: Potentially refactor out into an IObjectBaker. private HostObjectBuilderResult BakeObjects(IEnumerable objectsGraph, string baseLayerName) { - var doc = _contextStack.Current.Document; - var rootLayerIndex = _contextStack.Current.Document.Layers.Find( - Guid.Empty, - baseLayerName, - _rhinoDocFactory.UnsetIntIndex - ); + RhinoDoc doc = _contextStack.Current.Document; + var rootLayerIndex = _contextStack.Current.Document.Layers.Find(Guid.Empty, baseLayerName, RhinoMath.UnsetIntIndex); // POC: We could move this out into a separate service for testing and re-use. // Cleans up any previously received objects - if (rootLayerIndex != _rhinoDocFactory.UnsetIntIndex) + if (rootLayerIndex != RhinoMath.UnsetIntIndex) { - var documentLayer = doc.Layers[rootLayerIndex]; - var childLayers = documentLayer.GetChildren(); + Layer documentLayer = doc.Layers[rootLayerIndex]; + Layer[]? childLayers = documentLayer.GetChildren(); if (childLayers != null) { using var layerNoDraw = new DisableRedrawScope(doc.Views); @@ -82,7 +77,7 @@ private HostObjectBuilderResult BakeObjects(IEnumerable object } var cache = new Dictionary(); - rootLayerIndex = doc.Layers.Add(_rhinoDocFactory.CreateLayer(baseLayerName)); + rootLayerIndex = doc.Layers.Add(new Layer { Name = baseLayerName }); cache.Add(baseLayerName, rootLayerIndex); using var noDraw = new DisableRedrawScope(doc.Views); @@ -96,7 +91,7 @@ private HostObjectBuilderResult BakeObjects(IEnumerable object { var path = GetLayerPath(tc); - var fullLayerName = string.Join(_rhinoDocFactory.LayerPathSeparator, path); + var fullLayerName = string.Join(Layer.PathSeparator, path); var layerIndex = cache.TryGetValue(fullLayerName, out int value) ? value : GetAndCreateLayerFromPath(path, baseLayerName, cache); @@ -125,31 +120,31 @@ private IReadOnlyList HandleConversionResult(object conversionResult, Ba List newObjectIds = new(); switch (conversionResult) { - case IEnumerable list: + case IEnumerable list: { - var group = BakeObjectsAsGroup(originalObject.id, list, layerIndex); + Group group = BakeObjectsAsGroup(originalObject.id, list, layerIndex); newObjectIds.Add(group.Id.ToString()); break; } - case IRhinoGeometryBase newObject: + case GeometryBase newObject: { - var newObjectGuid = doc.Objects.Add(newObject, _rhinoDocFactory.CreateAttributes(layerIndex)); + var newObjectGuid = doc.Objects.Add(newObject, new ObjectAttributes { LayerIndex = layerIndex }); newObjectIds.Add(newObjectGuid.ToString()); break; } default: throw new SpeckleConversionException( - $"Unexpected result from conversion: Expected {nameof(IRhinoGeometryBase)} but instead got {conversionResult.GetType().Name}" + $"Unexpected result from conversion: Expected {nameof(GeometryBase)} but instead got {conversionResult.GetType().Name}" ); } return newObjectIds; } - private IRhinoGroup BakeObjectsAsGroup(string groupName, IEnumerable list, int layerIndex) + private Group BakeObjectsAsGroup(string groupName, IEnumerable list, int layerIndex) { var doc = _contextStack.Current.Document; - var objectIds = list.Select(obj => doc.Objects.Add(obj, _rhinoDocFactory.CreateAttributes(layerIndex))); + var objectIds = list.Select(obj => doc.Objects.Add(obj, new ObjectAttributes { LayerIndex = layerIndex })); var groupIndex = _contextStack.Current.Document.Groups.Add(groupName, objectIds); var group = _contextStack.Current.Document.Groups.FindIndex(groupIndex); return group; @@ -159,12 +154,12 @@ private IRhinoGroup BakeObjectsAsGroup(string groupName, IEnumerable cache) { var currentLayerName = baseLayerName; - var currentDocument = _contextStack.Current.Document; + RhinoDoc currentDocument = _contextStack.Current.Document; var previousLayer = currentDocument.Layers.FindName(currentLayerName); foreach (var layerName in path) { - currentLayerName = baseLayerName + _rhinoDocFactory.LayerPathSeparator + layerName; + currentLayerName = baseLayerName + Layer.PathSeparator + layerName; currentLayerName = currentLayerName.Replace("{", "").Replace("}", ""); // Rhino specific cleanup for gh (see RemoveInvalidRhinoChars) if (cache.TryGetValue(currentLayerName, out int value)) { @@ -173,7 +168,7 @@ private int GetAndCreateLayerFromPath(string[] path, string baseLayerName, Dicti } var cleanNewLayerName = layerName.Replace("{", "").Replace("}", ""); - var newLayer = _rhinoDocFactory.CreateLayer(cleanNewLayerName, previousLayer.Id); + var newLayer = new Layer { Name = cleanNewLayerName, ParentLayerId = previousLayer.Id }; var index = currentDocument.Layers.Add(newLayer); cache.Add(currentLayerName, index); previousLayer = currentDocument.Layers.FindIndex(index); // note we need to get the correct id out, hence why we're double calling this diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj index e114f0d218..dbea907d5c 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj @@ -15,8 +15,6 @@ - - @@ -43,4 +41,5 @@ Resources.Designer.cs + diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json index c8f0acc3ee..42b0399f3e 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json @@ -39,24 +39,6 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Speckle.Rhino7.Api": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "AE+1lMl+lzwEdNn6kvEWuCy6wRSFAIYP0KXeGI8fECNsCBj023c4IE/wSVn7wIHD+nM2ZHcST/62dmZXNqUt5A==", - "dependencies": { - "Mapster": "7.3.0", - "RhinoCommon": "7.13.21348.13001", - "RhinoWindows": "7.13.21348.13001", - "Speckle.Rhino7.Interfaces": "0.1.1-preview.0.28" - } - }, - "Speckle.Rhino7.Interfaces": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "TcbfXlRMnQRat1JodgW+YW5FflTYem1GGo9DtKA+6iAuVaYagN5dxsrM5LE6M3pCnEV9rkEQOjFo7sgnnbo4mw==" - }, "System.Resources.Extensions": { "type": "Direct", "requested": "[7.0.0, )", @@ -98,21 +80,6 @@ "resolved": "6.0.0", "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" }, - "Mapster": { - "type": "Transitive", - "resolved": "7.3.0", - "contentHash": "NrCUX/rJa5PTyo6iW4AL5dZLU9PDNlYnrJOVjgdpo5OQM9EtWH2CMHnC5sSuJWC0d0b0SnmeRrIviEem6WxtuQ==", - "dependencies": { - "Mapster.Core": "1.2.0", - "Microsoft.CSharp": "4.3.0", - "System.Reflection.Emit": "4.3.0" - } - }, - "Mapster.Core": { - "type": "Transitive", - "resolved": "1.2.0", - "contentHash": "TNdqZk2zAuBYfJF88D/3clQTOyOdqr1crU81yZQtlGa+e7FYWhJdK/buBWT+TpM3qQko9UzmzfOT4iq3JCs/ZA==" - }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", "resolved": "7.0.0", @@ -318,6 +285,11 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Revit2023.Interfaces": { + "type": "Transitive", + "resolved": "0.1.1-preview.0.24", + "contentHash": "BSVpOUJc9g6ISrw8GxvtkglTlITpHEDYNOhxv1ZPbckBsI0yO36JiphhQV4q57ERqD9PpCozUJkVhlCaxWeS6A==" + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -410,11 +382,6 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==" - }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "5.0.0", @@ -518,7 +485,7 @@ "speckle.converters.rhino7.dependencyinjection": { "type": "Project", "dependencies": { - "Speckle.Rhino7.Interfaces": "[0.1.1-preview.0.28, )" + "RhinoCommon": "[7.13.21348.13001, )" } }, "Microsoft.Extensions.Logging.Abstractions": { diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs index 88d26d8166..30a739310b 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs @@ -11,7 +11,7 @@ public class ArcGISConverterModule : ISpeckleModule public void Load(SpeckleContainerBuilder builder) { //don't need a host specific RootToSpeckleConverter - builder.AddConverterCommon(); + builder.AddConverterCommon(); // most things should be InstancePerLifetimeScope so we get one per operation builder.AddScoped(); builder.AddScoped(); diff --git a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json index 66a0d5e333..5ef4059ca1 100644 --- a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json @@ -211,42 +211,11 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Objects": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/RevitConverterModule.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/RevitConverterModule.cs index 7900f25180..60c5050217 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/RevitConverterModule.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/RevitConverterModule.cs @@ -1,11 +1,10 @@ +using Autodesk.Revit.DB; using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common; using Speckle.Converters.Common.DependencyInjection; using Speckle.Converters.RevitShared; using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; using Speckle.Converters.RevitShared.ToSpeckle; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.Revit2023.DependencyInjection; @@ -13,21 +12,24 @@ public class RevitConverterModule : ISpeckleModule { public void Load(SpeckleContainerBuilder builder) { - builder.AddConverterCommon(); + builder.AddConverterCommon(); + builder.AddSingleton(new RevitContext()); // POC: do we need ToSpeckleScalingService as is, do we need to interface it out? - builder.AddScoped(); + builder.AddScoped(); + + // POC: the concrete type can come out if we remove all the reference to it + builder.AddScoped(); builder.AddScoped(); - builder.AddScoped(); + builder.AddScoped(); builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); + builder.AddScoped(); + builder.AddScoped(); + builder.AddScoped(); + builder.AddScoped(); builder.AddScoped(); - builder.AddScoped(); } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj index a4ecb27491..704fef95ed 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj @@ -5,9 +5,6 @@ x64 - - - diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json index 928fe09a85..a1186a3a61 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json @@ -24,17 +24,6 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Speckle.Revit2023.Api": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "ejwYS/HI8yy0rJE4vgTr5aj8Fkg/E9JnMGjwyVS2fLtI4f7+FmwAY6inTUT2p/RAoRc2nQw+TerDpUtOhddzag==", - "dependencies": { - "Mapster": "7.3.0", - "Speckle.Revit.API": "2023.0.0", - "Speckle.Revit2023.Interfaces": "0.1.1-preview.0.28" - } - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -67,21 +56,6 @@ "resolved": "6.0.0", "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" }, - "Mapster": { - "type": "Transitive", - "resolved": "7.3.0", - "contentHash": "NrCUX/rJa5PTyo6iW4AL5dZLU9PDNlYnrJOVjgdpo5OQM9EtWH2CMHnC5sSuJWC0d0b0SnmeRrIviEem6WxtuQ==", - "dependencies": { - "Mapster.Core": "1.2.0", - "Microsoft.CSharp": "4.3.0", - "System.Reflection.Emit": "4.3.0" - } - }, - "Mapster.Core": { - "type": "Transitive", - "resolved": "1.2.0", - "contentHash": "TNdqZk2zAuBYfJF88D/3clQTOyOdqr1crU81yZQtlGa+e7FYWhJdK/buBWT+TpM3qQko9UzmzfOT4iq3JCs/ZA==" - }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", "resolved": "5.0.0", @@ -236,11 +210,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Revit.API": { - "type": "Transitive", - "resolved": "2023.0.0", - "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -324,11 +293,6 @@ "System.Threading.Tasks.Extensions": "4.5.4" } }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==" - }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "5.0.0", @@ -408,7 +372,7 @@ "type": "Project", "dependencies": { "Speckle.Converters.Common": "[2.0.999-local, )", - "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" + "Speckle.Revit.API": "[2023.0.0, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -454,11 +418,11 @@ "Speckle.Core": "3.0.1-alpha.11" } }, - "Speckle.Revit2023.Interfaces": { + "Speckle.Revit.API": { "type": "CentralTransitive", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" + "requested": "[2023.0.0, )", + "resolved": "2023.0.0", + "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/LocationConversionToSpeckleTests.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/LocationConversionToSpeckleTests.cs deleted file mode 100644 index 6fb5ba34d3..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/LocationConversionToSpeckleTests.cs +++ /dev/null @@ -1,85 +0,0 @@ -using FluentAssertions; -using Moq; -using NUnit.Framework; -using Objects; -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared; -using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; - -namespace Speckle.Converters.Revit2023.Tests; - -public class ModelCurveArrayToSpeckleConverterTests -{ - private readonly MockRepository _repository = new(MockBehavior.Strict); - - private readonly Mock> _revitConversionContextStack; - private readonly Mock _scalingServiceToSpeckle; - private readonly Mock> _curveConverter; - - public ModelCurveArrayToSpeckleConverterTests() - { - _revitConversionContextStack = _repository.Create>(); - _scalingServiceToSpeckle = _repository.Create(); - _curveConverter = _repository.Create>(); - } - - [TearDown] - public void Verify() => _repository.VerifyAll(); - - [Test] - public void Convert_Empty() - { - var sut = new ModelCurveArrayToSpeckleConverter( - _revitConversionContextStack.Object, - _scalingServiceToSpeckle.Object, - _curveConverter.Object - ); - Assert.Throws(() => sut.Convert(new List())); - } - - [Test] - public void Convert() - { - var endpoint1 = _repository.Create(); - var geometry1 = _repository.Create(); - var curve1 = _repository.Create(); - curve1.Setup(x => x.GeometryCurve).Returns(geometry1.Object); - geometry1.Setup(x => x.Length).Returns(2); - geometry1.Setup(x => x.GetEndPoint(0)).Returns(endpoint1.Object); - - var endpoint2 = _repository.Create(); - var geometry2 = _repository.Create(); - var curve2 = _repository.Create(); - curve2.Setup(x => x.GeometryCurve).Returns(geometry2.Object); - geometry2.Setup(x => x.Length).Returns(3); - geometry2.Setup(x => x.GetEndPoint(1)).Returns(endpoint2.Object); - - var context = _repository.Create>(); - _revitConversionContextStack.Setup(x => x.Current).Returns(context.Object); - - var units = "units"; - context.Setup(x => x.SpeckleUnits).Returns(units); - - var scaleLength = 2.2; - _scalingServiceToSpeckle.Setup(x => x.ScaleLength(2 + 3)).Returns(scaleLength); - - endpoint1.Setup(x => x.DistanceTo(endpoint2.Object)).Returns(4.4); - - _curveConverter.Setup(x => x.Convert(geometry1.Object)).Returns(_repository.Create().Object); - _curveConverter.Setup(x => x.Convert(geometry2.Object)).Returns(_repository.Create().Object); - - var sut = new ModelCurveArrayToSpeckleConverter( - _revitConversionContextStack.Object, - _scalingServiceToSpeckle.Object, - _curveConverter.Object - ); - var polycurve = sut.Convert(new List() { curve1.Object, curve2.Object }); - - polycurve.units.Should().Be(units); - polycurve.closed.Should().BeFalse(); - polycurve.length.Should().Be(scaleLength); - polycurve.segments.Count.Should().Be(2); - } -} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj deleted file mode 100644 index 2839be1e72..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/Speckle.Converters.Revit2023.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net48 - x64 - false - true - - - - - - - - - - - - - - - - - - - - diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json deleted file mode 100644 index 2c05f6ade3..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json +++ /dev/null @@ -1,560 +0,0 @@ -{ - "version": 2, - "dependencies": { - ".NETFramework,Version=v4.8": { - "FluentAssertions": { - "type": "Direct", - "requested": "[6.12.0, )", - "resolved": "6.12.0", - "contentHash": "ZXhHT2YwP9lajrwSKbLlFqsmCCvFJMoRSK9t7sImfnCyd0OB3MhgxdoMcVqxbq1iyxD6mD2fiackWmBb7ayiXQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.0" - } - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.10.0, )", - "resolved": "17.10.0", - "contentHash": "0/2HeACkaHEYU3wc83YlcD2Fi4LMtECJjqrtvw0lPi9DCEa35zSPt1j4fuvM8NagjDqJuh1Ja35WcRtn1Um6/A==", - "dependencies": { - "Microsoft.CodeCoverage": "17.10.0" - } - }, - "Microsoft.SourceLink.GitHub": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "8.0.0", - "Microsoft.SourceLink.Common": "8.0.0" - } - }, - "Moq": { - "type": "Direct", - "requested": "[4.20.70, )", - "resolved": "4.20.70", - "contentHash": "4rNnAwdpXJBuxqrOCzCyICXHSImOTRktCgCWXWykuF1qwoIsVvEnR7PjbMk/eLOxWvhmj5Kwt+kDV3RGUYcNwg==", - "dependencies": { - "Castle.Core": "5.1.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "NUnit": { - "type": "Direct", - "requested": "[4.1.0, )", - "resolved": "4.1.0", - "contentHash": "MT/DpAhjtiytzhTgTqIhBuWx4y26PKfDepYUHUM+5uv4TsryHC2jwFo5e6NhWkApCm/G6kZ80dRjdJFuAxq3rg==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "NUnit.Analyzers": { - "type": "Direct", - "requested": "[4.2.0, )", - "resolved": "4.2.0", - "contentHash": "4fJojPkzdoa4nB2+p6U+fITvPnVvwWSnsmiJ/Dl30xqiL3oxNbYvfeSLVd91hOmEjoUqSwN3Z7j1aFedjqWbUA==" - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.5, )", - "resolved": "0.9.5", - "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" - }, - "Speckle.Revit2023.Interfaces": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" - }, - "Castle.Core": { - "type": "Transitive", - "resolved": "5.1.1", - "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==" - }, - "GraphQL.Client": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0", - "GraphQL.Client.Abstractions.Websocket": "6.0.0", - "System.Net.WebSockets.Client.Managed": "1.0.22", - "System.Reactive": "5.0.0" - } - }, - "GraphQL.Client.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", - "dependencies": { - "GraphQL.Primitives": "6.0.0" - } - }, - "GraphQL.Client.Abstractions.Websocket": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0" - } - }, - "GraphQL.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "3aeMZ1N0lJoSyzqiP03hqemtb1BijhsJADdobn/4nsMJ8V1H+CrpuduUe4hlRdx+ikBQju1VGjMD1GJ3Sk05Eg==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.10.0", - "contentHash": "yC7oSlnR54XO5kOuHlVOKtxomNNN1BWXX8lK1G2jaPXT9sUok7kCOoA4Pgs0qyFaCtMrNsprztYMeoEGqCm4uA==" - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "KGxbPeWsQMnmQy43DSBxAFtHz3l2JX8EWBSGUCvT3CuZ8KsuzbkqMIJMDOxWtG8eZSoCDI04aiVQjWuuV8HmSw==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.5", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "FTerRmQPqHrCrnoUzhBu+E+1DNGwyrAMLqHkAqOOOu5pGfyMOj8qQUBxI/gDtWtG11p49UxSfWmBzRNlwZqfUg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "elNeOmkeX3eDVG6pYVeV82p29hr+UKDaBhrZyWvWLw/EVZSYEkZlQdkp0V39k/Xehs2Qa0mvoCvkVj3eQxNQ1Q==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "7.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "Nw2muoNrOG5U5qa2ZekXwudUn2BJcD41e65zwmDHb1fQegTX66UokLWZkJRpqSSHXDOWZ5V0iqhbxOEky91atA==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "7.0.0", - "Microsoft.Extensions.DependencyInjection": "7.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", - "Microsoft.Extensions.Logging.Abstractions": "7.0.0", - "Microsoft.Extensions.Options": "7.0.0", - "System.Diagnostics.DiagnosticSource": "7.0.0", - "System.ValueTuple": "4.5.0" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "lP1yBnTTU42cKpMozuafbvNtQ7QcBjr/CcK3bYOGEMH55Fjt+iecXjT6chR7vbgCMqy3PG3aNQSZgo/EuY/9qQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0", - "Microsoft.Extensions.Primitives": "7.0.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "um1KU5kxcRp3CNuI8o/GrZtD4AIOXDk+RLsytjZ9QPok3ttLUelLKpilVPuaFT3TFjOhSibUAso0odbOaCDj3Q==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" - }, - "Polly": { - "type": "Transitive", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" - }, - "Polly.Contrib.WaitAndRetry": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" - }, - "Polly.Extensions.Http": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", - "dependencies": { - "Polly": "7.1.0" - } - }, - "Sentry": { - "type": "Transitive", - "resolved": "3.33.0", - "contentHash": "8vbD2o6IR2wrRrkSiRbnodWGWUOqIlwYtzpjvPNOb5raJdOf+zxMwfS8f6nx9bmrTTfDj7KrCB8C/5OuicAc8A==", - "dependencies": { - "System.Reflection.Metadata": "5.0.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Text.Json": "5.0.2" - } - }, - "Sentry.Serilog": { - "type": "Transitive", - "resolved": "3.33.0", - "contentHash": "V8BU7QGWg2qLYfNPqtuTBhC1opysny5l+Ifp6J6PhOeAxU0FssR7nYfbJVetrnLIoh2rd3DlJ6hHYYQosQYcUQ==", - "dependencies": { - "Sentry": "3.33.0", - "Serilog": "2.7.1" - } - }, - "Serilog": { - "type": "Transitive", - "resolved": "2.12.0", - "contentHash": "xaiJLIdu6rYMKfQMYUZgTy8YK7SMZjB4Yk50C/u//Z4OsvxkUfSPJy4nknfvwAC34yr13q7kcyh4grbwhSxyZg==" - }, - "Serilog.Enrichers.ClientInfo": { - "type": "Transitive", - "resolved": "1.3.0", - "contentHash": "mTc7PM+wC9Hr7LWSwqt5mmnlAr7RJs+eTb3PGPRhwdOackk95MkhUZognuxXEdlW19HAFNmEBTSBY5DfLwM8jQ==", - "dependencies": { - "Serilog": "2.4.0" - } - }, - "Serilog.Exceptions": { - "type": "Transitive", - "resolved": "8.4.0", - "contentHash": "nc/+hUw3lsdo0zCj0KMIybAu7perMx79vu72w0za9Nsi6mWyNkGXxYxakAjWB7nEmYL6zdmhEQRB4oJ2ALUeug==", - "dependencies": { - "Serilog": "2.8.0" - } - }, - "Serilog.Formatting.Compact": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "pNroKVjo+rDqlxNG5PXkRLpfSCuDOBY0ri6jp9PLe505ljqwhwZz8ospy2vWhQlFu5GkIesh3FcDs4n7sWZODA==", - "dependencies": { - "Serilog": "2.8.0" - } - }, - "Serilog.Sinks.Console": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "K6N5q+5fetjnJPvCmkWOpJ/V8IEIoMIB1s86OzBrbxwTyHxdx3pmz4H+8+O/Dc/ftUX12DM1aynx/dDowkwzqg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Serilog.Sinks.File": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "uwV5hdhWPwUH1szhO8PJpFiahqXmzPzJT/sOijH/kFgUx+cyoDTMM8MHD0adw9+Iem6itoibbUXHYslzXsLEAg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Serilog.Sinks.PeriodicBatching": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "NDWR7m3PalVlGEq3rzoktrXikjFMLmpwF0HI4sowo8YDdU+gqPlTHlDQiOGxHfB0sTfjPA9JjA7ctKG9zqjGkw==", - "dependencies": { - "Serilog": "2.0.0" - } - }, - "Serilog.Sinks.Seq": { - "type": "Transitive", - "resolved": "5.2.2", - "contentHash": "1Csmo5ua7NKUe0yXUx+zsRefjAniPWcXFhUXxXG8pwo0iMiw2gjn9SOkgYnnxbgWqmlGv236w0N/dHc2v5XwMg==", - "dependencies": { - "Serilog": "2.12.0", - "Serilog.Formatting.Compact": "1.1.0", - "Serilog.Sinks.File": "5.0.0", - "Serilog.Sinks.PeriodicBatching": "3.1.0" - } - }, - "SerilogTimings": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "Zs28eTgszAMwpIrbBnWHBI50yuxL50p/dmAUWmy75+axdZYK/Sjm5/5m1N/CisR8acJUhTVcjPZrsB1P5iv0Uw==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "SQLitePCLRaw.bundle_e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", - "dependencies": { - "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", - "SQLitePCLRaw.provider.dynamic_cdecl": "2.1.4" - } - }, - "SQLitePCLRaw.core": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - }, - "SQLitePCLRaw.provider.dynamic_cdecl": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "ZsaKKhgYF9B1fvcnOGKl3EycNAwd9CRWX7v0rEfuPWhQQ5Jjpvf2VEHahiLIGHio3hxi3EIKFJw9KvyowWOUAw==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", - "dependencies": { - "System.Memory": "4.5.4" - } - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "9W0ewWDuAyDqS2PigdTxk6jDKonfgscY/hP8hm7VpxYhNHZHKvZTdRckberlFk3VnCmr3xBUyMBut12Q+T2aOw==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.DoubleNumerics": { - "type": "Transitive", - "resolved": "3.1.3", - "contentHash": "KRKEM/L3KBodjA9VOg3EifFVWUY6EOqaMB05UvPEDm7Zeby/kZW+4kdWUEPzW6xtkwf46p661L9NrbeeQhtLzw==", - "dependencies": { - "NETStandard.Library": "1.6.1" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Net.WebSockets.Client.Managed": { - "type": "Transitive", - "resolved": "1.0.22", - "contentHash": "WqEOxPlXjuZrIjUtXNE9NxEfU/n5E35iV2PtoZdJSUC4tlrqwHnTee+wvMIM4OUaJWmwrymeqcgYrE0IkGAgLA==", - "dependencies": { - "System.Buffers": "4.4.0", - "System.Numerics.Vectors": "4.4.0" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==", - "dependencies": { - "System.Collections.Immutable": "5.0.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==" - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "5.0.1", - "contentHash": "KmJ+CJXizDofbq6mpqDoRRLcxgOd2z9X3XoFNULSbvbqVRZkFX3istvr+MUjL6Zw1RT+RNdoI4GYidIINtgvqQ==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "5.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0", - "System.Text.Encodings.Web": "5.0.1", - "System.Threading.Tasks.Extensions": "4.5.4", - "System.ValueTuple": "4.5.0" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" - } - }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Serilog.Extensions.Logging": "[7.0.0, )", - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Converters.Common": "[2.0.999-local, )" - } - }, - "speckle.converters.revit2023": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[2.0.999-local, )", - "Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.28, )" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[7.0.0, )", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, - "Serilog.Extensions.Logging": { - "type": "CentralTransitive", - "requested": "[7.0.0, )", - "resolved": "7.0.0", - "contentHash": "9faU0zNQqU7I6soVhLUMYaGNpgWv6cKlKb2S5AnS8gXxzW/em5Ladm/6FMrWTnX41cdbdGPOWNAo6adi4WaJ6A==", - "dependencies": { - "Microsoft.Extensions.Logging": "7.0.0", - "Serilog": "2.12.0" - } - }, - "Speckle.Core": { - "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - } - } - } -} \ No newline at end of file diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/RevitVersionConversionHelper.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/RevitVersionConversionHelper.cs new file mode 100644 index 0000000000..515c2e057f --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/RevitVersionConversionHelper.cs @@ -0,0 +1,19 @@ +using Speckle.Converters.RevitShared; + +namespace Speckle.Converters.Revit2023; + +public class RevitVersionConversionHelper : IRevitVersionConversionHelper +{ + public bool IsCurveClosed(DB.NurbSpline nurbsSpline) + { + try + { + return nurbsSpline.IsClosed; + } + catch (Autodesk.Revit.Exceptions.ApplicationException) + { + // POC: is this actually a good assumption? + return true; + } + } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj index e3c04fcf68..985086abd5 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/Speckle.Converters.Revit2023.csproj @@ -3,13 +3,12 @@ net48 x64 - false - + diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json index 220a146664..0fbae10307 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json @@ -24,11 +24,11 @@ "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Speckle.Revit2023.Interfaces": { + "Speckle.Revit.API": { "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" + "requested": "[2023.0.0, )", + "resolved": "2023.0.0", + "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" }, "GraphQL.Client": { "type": "Transitive", diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/CategoryExtensions.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/CategoryExtensions.cs index c0acca23c8..9083375a2e 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/CategoryExtensions.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/CategoryExtensions.cs @@ -1,10 +1,10 @@ -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; namespace Speckle.Converters.RevitShared.Extensions; public static class CategoryExtensions { - public static SOBR.RevitCategory GetSchemaBuilderCategoryFromBuiltIn(this RevitBuiltInCategory builtInCategory) + public static SOBR.RevitCategory GetSchemaBuilderCategoryFromBuiltIn(this DB.BuiltInCategory builtInCategory) { // Clean up built-in name "OST_Walls" to be just "WALLS" var cleanName = builtInCategory @@ -23,9 +23,9 @@ public static SOBR.RevitCategory GetSchemaBuilderCategoryFromBuiltIn(this RevitB return cat; } - public static RevitBuiltInCategory GetBuiltInCategory(this IRevitCategory category) + public static BuiltInCategory GetBuiltInCategory(this Category category) { - return (RevitBuiltInCategory)category.Id.IntegerValue; + return (BuiltInCategory)category.Id.IntegerValue; } public static string GetBuiltInFromSchemaBuilderCategory(this SOBR.RevitCategory c) diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/DefinitionExtensions.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/DefinitionExtensions.cs index 1b3a22beda..77aff9d11b 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/DefinitionExtensions.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/DefinitionExtensions.cs @@ -1,12 +1,16 @@ -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; namespace Speckle.Converters.RevitShared.Extensions; public static class DefinitionExtensions { // POC: can we just interface these specialisations out and thereby avoid this kind of BS :D - public static string GetUnitTypeString(this IRevitDefinition definition) + public static string GetUnitTypeString(this Definition definition) { +#if REVIT2020 || REVIT2021 + return definition.UnitType.ToString(); +#else return definition.GetDataType().TypeId; +#endif } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ElementExtensions.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ElementExtensions.cs index e8553e34cb..468a98fd0f 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ElementExtensions.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ElementExtensions.cs @@ -1,31 +1,30 @@ -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; namespace Speckle.Converters.RevitShared.Extensions; public static class ElementExtensions { // POC: should this be an injected service? - public static IList GetHostedElementIds(this IRevitElement host, IRevitFilterFactory filterFactory) + public static IList GetHostedElementIds(this Element host) { - IList ids; - var hostObject = host.ToHostObject(); - if (hostObject is not null) + IList ids; + if (host is HostObject hostObject) { ids = hostObject.FindInserts(true, false, false, false); } else { - var typeFilter = filterFactory.CreateElementIsElementTypeFilter(true); - var categoryFilter = filterFactory.CreateElementMulticategoryFilter( - new List() + var typeFilter = new ElementIsElementTypeFilter(true); + var categoryFilter = new ElementMulticategoryFilter( + new List() { - RevitBuiltInCategory.OST_CLines, - RevitBuiltInCategory.OST_SketchLines, - RevitBuiltInCategory.OST_WeakDims + BuiltInCategory.OST_CLines, + BuiltInCategory.OST_SketchLines, + BuiltInCategory.OST_WeakDims }, true ); - ids = host.GetDependentElements(filterFactory.CreateLogicalAndFilter(typeFilter, categoryFilter)); + ids = host.GetDependentElements(new LogicalAndFilter(typeFilter, categoryFilter)); } // dont include host elementId diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ForgeTypeIdExtensions.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ForgeTypeIdExtensions.cs index 1c9d03b5a1..790e92a07a 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ForgeTypeIdExtensions.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ForgeTypeIdExtensions.cs @@ -1,25 +1,25 @@ -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; namespace Speckle.Converters.RevitShared.Extensions; public static class ForgeTypeIdExtensions { - public static string? GetSymbol(this IRevitForgeTypeId forgeTypeId, IRevitFormatOptionsUtils formatOptionsUtils) + public static string? GetSymbol(this ForgeTypeId forgeTypeId) { - if (!formatOptionsUtils.CanHaveSymbol(forgeTypeId)) + if (!FormatOptions.CanHaveSymbol(forgeTypeId)) { return null; } - var validSymbols = formatOptionsUtils.GetValidSymbols(forgeTypeId); + var validSymbols = FormatOptions.GetValidSymbols(forgeTypeId); var typeId = validSymbols.Where(x => !x.Empty()); - foreach (var symbolId in typeId) + foreach (DB.ForgeTypeId symbolId in typeId) { - return formatOptionsUtils.GetLabelForSymbol(symbolId); + return LabelUtils.GetLabelForSymbol(symbolId); } return null; } - public static string ToUniqueString(this IRevitForgeTypeId forgeTypeId) + public static string ToUniqueString(this ForgeTypeId forgeTypeId) { return forgeTypeId.TypeId; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs index 704eb40484..c8ac6f92e8 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs @@ -1,5 +1,4 @@ -using Speckle.Converters.Common; -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; namespace Speckle.Converters.RevitShared.Extensions; @@ -11,7 +10,7 @@ public static class ParameterExtensions /// /// /// - public static string GetInternalName(this IRevitParameter rp) + public static string GetInternalName(this DB.Parameter rp) { if (rp.IsShared) { @@ -19,8 +18,8 @@ public static string GetInternalName(this IRevitParameter rp) } else { - var def = rp.Definition.ToInternal().NotNull(); - if (def.BuiltInParameter == RevitBuiltInParameter.INVALID) + var def = (InternalDefinition)rp.Definition; + if (def.BuiltInParameter == BuiltInParameter.INVALID) { return def.Name; } @@ -29,9 +28,9 @@ public static string GetInternalName(this IRevitParameter rp) } } - public static RevitBuiltInParameter? GetBuiltInParameter(this IRevitParameter rp) + public static BuiltInParameter? GetBuiltInParameter(this Parameter rp) { - var def = rp.Definition.ToInternal(); + var def = rp.Definition as InternalDefinition; return def?.BuiltInParameter; } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/GlobalUsings.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/GlobalUsings.cs index a4a6c2cf0d..5a7a8f20bd 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/GlobalUsings.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/GlobalUsings.cs @@ -1,3 +1,5 @@ -global using SOG = Objects.Geometry; +global using DB = Autodesk.Revit.DB; +global using DBA = Autodesk.Revit.DB.Architecture; +global using SOG = Objects.Geometry; global using SOBR = Objects.BuiltElements.Revit; global using SOBE = Objects.BuiltElements; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs index d292b5ed2f..7980fa5b02 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs @@ -1,53 +1,38 @@ -using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.Logging; -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.Helpers; // POC: needs breaking down https://spockle.atlassian.net/browse/CNX-9354 -[GenerateAutoInterface] -public sealed class DisplayValueExtractor : IDisplayValueExtractor +public sealed class DisplayValueExtractor { - private readonly ITypedConverter< - Dictionary>, - List - > _meshByMaterialConverter; - private readonly IRevitOptionsFactory _revitOptionsFactory; - private readonly IRevitSolidUtils _revitSolidUtils; + private readonly ITypedConverter>, List> _meshByMaterialConverter; private readonly ILogger _logger; public DisplayValueExtractor( - ITypedConverter>, List> meshByMaterialConverter, - IRevitOptionsFactory revitOptionsFactory, - IRevitSolidUtils revitSolidUtils, + ITypedConverter>, List> meshByMaterialConverter, ILogger logger ) { _meshByMaterialConverter = meshByMaterialConverter; - _revitOptionsFactory = revitOptionsFactory; - _revitSolidUtils = revitSolidUtils; _logger = logger; } public List GetDisplayValue( - IRevitElement element, - IRevitOptions? options = null, + DB.Element element, + DB.Options? options = null, // POC: should this be part of the context? - IRevitTransform? transform = null + DB.Transform? transform = null ) { var displayMeshes = new List(); // test if the element is a group first - var g = element.ToGroup(); - if (g is not null) + if (element is DB.Group g) { foreach (var id in g.GetMemberIds()) { - var groupMeshes = GetDisplayValue(element.Document.GetElement(id).NotNull(), options); + var groupMeshes = GetDisplayValue(element.Document.GetElement(id), options); displayMeshes.AddRange(groupMeshes); } return displayMeshes; @@ -60,18 +45,18 @@ ILogger logger return _meshByMaterialConverter.Convert(meshesByMaterial); } - private static Dictionary> GetMeshesByMaterial( - List meshes, - List solids + private static Dictionary> GetMeshesByMaterial( + List meshes, + List solids ) { - var meshesByMaterial = new Dictionary>(); + var meshesByMaterial = new Dictionary>(); foreach (var mesh in meshes) { var materialId = mesh.MaterialElementId; - if (!meshesByMaterial.TryGetValue(materialId, out List? value)) + if (!meshesByMaterial.TryGetValue(materialId, out List? value)) { - value = new List(); + value = new List(); meshesByMaterial[materialId] = value; } @@ -80,12 +65,12 @@ List solids foreach (var solid in solids) { - foreach (IRevitFace face in solid.Faces) + foreach (DB.Face face in solid.Faces) { var materialId = face.MaterialElementId; - if (!meshesByMaterial.TryGetValue(materialId, out List? value)) + if (!meshesByMaterial.TryGetValue(materialId, out List? value)) { - value = new List(); + value = new List(); meshesByMaterial[materialId] = value; } @@ -96,30 +81,29 @@ List solids return meshesByMaterial; } - [SuppressMessage("Design", "CA1031:Do not catch general exception types")] - private (List, List) GetSolidsAndMeshesFromElement( - IRevitElement element, - IRevitOptions? options, - IRevitTransform? transform = null + private (List, List) GetSolidsAndMeshesFromElement( + DB.Element element, + DB.Options? options, + DB.Transform? transform = null ) { //options = ViewSpecificOptions ?? options ?? new Options() { DetailLevel = DetailLevelSetting }; - options ??= _revitOptionsFactory.Create(RevitViewDetailLevel.Fine); + options ??= new DB.Options { DetailLevel = DB.ViewDetailLevel.Fine }; - IRevitGeometryElement? geom; + DB.GeometryElement geom; try { - geom = element.GetGeometry(options); + geom = element.get_Geometry(options); } // POC: should we be trying to continue? - catch (Exception) + catch (Autodesk.Revit.Exceptions.ArgumentException) { options.ComputeReferences = false; - geom = element.GetGeometry(options); + geom = element.get_Geometry(options); } - var solids = new List(); - var meshes = new List(); + var solids = new List(); + var meshes = new List(); if (geom != null) { @@ -147,11 +131,11 @@ List solids /// /// private void SortGeometry( - IRevitElement element, - List solids, - List meshes, - IRevitGeometryElement geom, - IRevitTransform? inverseTransform = null + DB.Element element, + List solids, + List meshes, + DB.GeometryElement geom, + DB.Transform? inverseTransform = null ) { var topLevelSolidsCount = 0; @@ -160,36 +144,32 @@ private void SortGeometry( var topLevelGeomInstanceCount = 0; bool hasSymbolGeometry = false; - foreach (IRevitGeometryObject geomObj in geom) + foreach (DB.GeometryObject geomObj in geom) { // POC: switch could possibly become factory and IIndex<,> pattern and move conversions to // separate IComeConversionInterfaces - var solid = geomObj.ToSolid(); - if (solid is not null) + switch (geomObj) { - // skip invalid solid - if ( - solid.Faces.Count == 0 - || Math.Abs(solid.SurfaceArea) == 0 - || IsSkippableGraphicStyle(solid.GraphicsStyleId, element.Document) - ) - { - continue; - } + case DB.Solid solid: + // skip invalid solid + if ( + solid.Faces.Size == 0 + || Math.Abs(solid.SurfaceArea) == 0 + || IsSkippableGraphicStyle(solid.GraphicsStyleId, element.Document) + ) + { + continue; + } - if (inverseTransform != null) - { - topLevelSolidsCount++; - solid = _revitSolidUtils.CreateTransformed(solid, inverseTransform); - } + if (inverseTransform != null) + { + topLevelSolidsCount++; + solid = DB.SolidUtils.CreateTransformed(solid, inverseTransform); + } - solids.Add(solid); - } - else - { - var mesh = geomObj.ToMesh(); - if (mesh is not null) - { + solids.Add(solid); + break; + case DB.Mesh mesh: if (IsSkippableGraphicStyle(mesh.GraphicsStyleId, element.Document)) { continue; @@ -198,46 +178,35 @@ private void SortGeometry( if (inverseTransform != null) { topLevelMeshesCount++; - mesh = mesh.GetTransformed(inverseTransform); + mesh = mesh.get_Transformed(inverseTransform); } meshes.Add(mesh); - } - else - { - var instance = geomObj.ToGeometryInstance(); - if (instance is not null) + break; + case DB.GeometryInstance instance: + // element transforms should not be carried down into nested geometryInstances. + // Nested geomInstances should have their geom retreived with GetInstanceGeom, not GetSymbolGeom + if (inverseTransform != null) { - // element transforms should not be carried down into nested geometryInstances. - // Nested geomInstances should have their geom retreived with GetInstanceGeom, not GetSymbolGeom - if (inverseTransform != null) - { - topLevelGeomInstanceCount++; - SortGeometry(element, solids, meshes, instance.GetSymbolGeometry()); - if (meshes.Count > 0 || solids.Count > 0) - { - hasSymbolGeometry = true; - } - } - else + topLevelGeomInstanceCount++; + SortGeometry(element, solids, meshes, instance.GetSymbolGeometry()); + if (meshes.Count > 0 || solids.Count > 0) { - SortGeometry(element, solids, meshes, instance.GetInstanceGeometry()); + hasSymbolGeometry = true; } } else { - var geometryElement = geomObj.ToGeometryElement(); - if (geometryElement is not null) - { - if (inverseTransform != null) - { - topLevelGeomElementCount++; - } - - SortGeometry(element, solids, meshes, geometryElement); - } + SortGeometry(element, solids, meshes, instance.GetInstanceGeometry()); } - } + break; + case DB.GeometryElement geometryElement: + if (inverseTransform != null) + { + topLevelGeomElementCount++; + } + SortGeometry(element, solids, meshes, geometryElement); + break; } } @@ -255,7 +224,7 @@ private void SortGeometry( // POC: should be hoovered up with the new reporting, logging, exception philosophy private void LogInstanceMeshRetrievalWarnings( - IRevitElement element, + DB.Element element, int topLevelSolidsCount, int topLevelMeshesCount, int topLevelGeomElementCount, @@ -288,24 +257,27 @@ bool hasSymbolGeom /// /// We're caching a dictionary of graphic styles and their ids as it can be a costly operation doing Document.GetElement(solid.GraphicsStyleId) for every solid /// - private readonly Dictionary _graphicStyleCache = new(); + private readonly Dictionary _graphicStyleCache = new(); /// /// Exclude light source cones and potentially other geometries by their graphic style /// - private bool IsSkippableGraphicStyle(IRevitElementId id, IRevitDocument doc) + /// + /// + /// + private bool IsSkippableGraphicStyle(DB.ElementId id, DB.Document doc) { - var graphicStyle = doc.GetElement(id)?.ToGraphicsStyle(); - if (graphicStyle is null) - { - return false; - } - if (!_graphicStyleCache.ContainsKey(id.IntegerValue)) + var key = id.ToString(); + if (_graphicStyleCache.TryGetValue(key, out var graphicStyle)) { - _graphicStyleCache.Add(id.IntegerValue, graphicStyle); + graphicStyle = (DB.GraphicsStyle)doc.GetElement(id); + _graphicStyleCache.Add(key, graphicStyle); } - if (graphicStyle.GraphicsStyleCategory.Id.IntegerValue == (int)RevitBuiltInCategory.OST_LightingFixtureSource) + if ( + graphicStyle != null + && graphicStyle.GraphicsStyleCategory.Id.IntegerValue == (int)DB.BuiltInCategory.OST_LightingFixtureSource + ) { return true; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs new file mode 100644 index 0000000000..1cf5d4b80c --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs @@ -0,0 +1,13 @@ +using Autodesk.Revit.DB; +using Speckle.Converters.Common; + +namespace Speckle.Converters.RevitShared.Helpers; + +[System.Diagnostics.CodeAnalysis.SuppressMessage( + "Naming", + "CA1711:Identifiers should not have incorrect suffix", + Justification = "See base class justification" +)] +// POC: so this should *probably* be Document and NOT UI.UIDocument, the former is Conversion centric +// and the latter is more for connector +public interface IRevitConversionContextStack : IConversionContextStack { } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ISlopeArrowExtractor.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ISlopeArrowExtractor.cs new file mode 100644 index 0000000000..750f4d1073 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ISlopeArrowExtractor.cs @@ -0,0 +1,10 @@ +namespace Speckle.Converters.RevitShared.Helpers; + +public interface ISlopeArrowExtractor +{ + DB.ModelLine? GetSlopeArrow(DB.Element element); + SOG.Point GetSlopeArrowHead(DB.ModelLine slopeArrow); + SOG.Point GetSlopeArrowTail(DB.ModelLine slopeArrow); + double GetSlopeArrowTailOffset(DB.ModelLine slopeArrow); + double GetSlopeArrowHeadOffset(DB.ModelLine slopeArrow, double tailOffset, out double slope); +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs index b6489d3646..86735165b1 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs @@ -1,49 +1,44 @@ -using Microsoft.Extensions.Logging; +using Autodesk.Revit.DB; +using Microsoft.Extensions.Logging; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.Helpers; // POC: rationalise whether this and ParameterObjectBuilder are sufficiently different?? // did it go away? -[GenerateAutoInterface] -public sealed class ParameterObjectAssigner : IParameterObjectAssigner +public sealed class ParameterObjectAssigner { - private readonly ITypedConverter _paramConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IRevitElementIdUtils _revitElementIdUtils; + private readonly ITypedConverter _paramConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; private readonly ILogger _logger; public ParameterObjectAssigner( - ITypedConverter paramConverter, - IParameterValueExtractor parameterValueExtractor, - IRevitElementIdUtils revitElementIdUtils, + ITypedConverter paramConverter, + ParameterValueExtractor parameterValueExtractor, ILogger logger ) { _paramConverter = paramConverter; _parameterValueExtractor = parameterValueExtractor; - _revitElementIdUtils = revitElementIdUtils; _logger = logger; } - public void AssignParametersToBase(IRevitElement target, Base @base) + public void AssignParametersToBase(Element target, Base @base) { - var instanceParameters = _parameterValueExtractor.GetAllRemainingParams(target); - IRevitElementId elementId = target.GetTypeId(); + Dictionary instanceParameters = _parameterValueExtractor.GetAllRemainingParams(target); + ElementId elementId = target.GetTypeId(); Base paramBase = new(); AssignSpeckleParamToBaseObject(instanceParameters, paramBase); // POC: Some elements can have an invalid element type ID, I don't think we want to continue here. - if (elementId.IntegerValue != _revitElementIdUtils.InvalidElementId.IntegerValue && target is not SOBE.Level) //ignore type props of levels..! + if (elementId != ElementId.InvalidElementId && target is not Level) //ignore type props of levels..! { - var elementType = target.Document.GetElement(elementId).NotNull(); + var elementType = target.Document.GetElement(elementId); // I don't think we should be adding the type parameters to the object like this - var typeParameters = _parameterValueExtractor.GetAllRemainingParams(elementType); + Dictionary typeParameters = _parameterValueExtractor.GetAllRemainingParams(elementType); AssignSpeckleParamToBaseObject(typeParameters, paramBase, true); } @@ -54,7 +49,7 @@ public void AssignParametersToBase(IRevitElement target, Base @base) } private void AssignSpeckleParamToBaseObject( - IEnumerable> parameters, + IEnumerable> parameters, Base paramBase, bool isTypeParameter = false ) @@ -64,7 +59,7 @@ private void AssignSpeckleParamToBaseObject( { try { - var speckleParam = _paramConverter.Convert(kv.Value); + SOBR.Parameter speckleParam = _paramConverter.Convert(kv.Value); speckleParam.isTypeParameter = isTypeParameter; paramBase[kv.Key] = speckleParam; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectBuilder.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectBuilder.cs new file mode 100644 index 0000000000..71cf930224 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectBuilder.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using System.Linq; +using Autodesk.Revit.DB; +using Speckle.Converters.Common.Objects; +using Speckle.Core.Logging; +using Speckle.Core.Models; + +namespace Speckle.Converters.RevitShared.Helpers; + +public sealed class ParameterObjectAssigner +{ + private readonly IRawConversion _paramConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + + public ParameterObjectAssigner( + IRawConversion paramConverter, + ParameterValueExtractor parameterValueExtractor + ) + { + _paramConverter = paramConverter; + _parameterValueExtractor = parameterValueExtractor; + } + + public void AssignParametersToBase(Element target, Base @base) + { + Dictionary allParams = _parameterValueExtractor.GetAllRemainingParams(target); + Base paramBase = new(); + //sort by key + foreach (var kv in allParams.OrderBy(x => x.Key)) + { + try + { + paramBase[kv.Key] = _paramConverter.RawConvert(kv.Value); + } + catch (InvalidPropNameException) + { + //ignore + } + catch (SpeckleException ex) + { + SpeckleLog.Logger.Warning(ex, "Error thrown when trying to set property named {propName}", kv.Key); + } + } + + if (paramBase.GetMembers(DynamicBaseMemberType.Dynamic).Count > 0) + { + @base["parameters"] = paramBase; + } + } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterValueExtractor.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterValueExtractor.cs index 2f5a71a853..cdc8e69243 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterValueExtractor.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterValueExtractor.cs @@ -1,8 +1,7 @@ -using System.Diagnostics.CodeAnalysis; +using Autodesk.Revit.DB; using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Extensions; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.Helpers; @@ -10,18 +9,17 @@ namespace Speckle.Converters.RevitShared.Helpers; // really if we have to edit a switch statement... // maybe also better as an extension method, but maybe is fine? // POC: there are a lot of public methods here. Maybe consider consolodating - -public class ParameterValueExtractor : IParameterValueExtractor +public class ParameterValueExtractor { - private readonly IScalingServiceToSpeckle _scalingService; - private readonly Dictionary> _uniqueIdToUsedParameterSetMap = new(); + private readonly ScalingServiceToSpeckle _scalingService; + private readonly Dictionary> _uniqueIdToUsedParameterSetMap = new(); - public ParameterValueExtractor(IScalingServiceToSpeckle scalingService) + public ParameterValueExtractor(ScalingServiceToSpeckle scalingService) { _scalingService = scalingService; } - public object? GetValue(IRevitParameter parameter) + public object? GetValue(Parameter parameter) { if (!parameter.HasValue) { @@ -30,36 +28,32 @@ public ParameterValueExtractor(IScalingServiceToSpeckle scalingService) return parameter.StorageType switch { - RevitStorageType.Double => GetValueAsDouble(parameter), - RevitStorageType.Integer => GetValueAsInt(parameter), - RevitStorageType.String => GetValueAsString(parameter), - RevitStorageType.ElementId => GetValueAsElementId(parameter)?.ToString(), - RevitStorageType.None + StorageType.Double => GetValueAsDouble(parameter), + StorageType.Integer => GetValueAsInt(parameter), + StorageType.String => GetValueAsString(parameter), + StorageType.ElementId => GetValueAsElementId(parameter)?.ToString(), + StorageType.None or _ => throw new SpeckleConversionException($"Unsupported parameter storage type {parameter.StorageType}") }; } - public double GetValueAsDouble(IRevitElement element, RevitBuiltInParameter builtInParameter) + public double GetValueAsDouble(Element element, BuiltInParameter builtInParameter) { if (!TryGetValueAsDouble(element, builtInParameter, out double? value)) { throw new SpeckleConversionException($"Failed to get {builtInParameter} as double."); } - return value.Value; // If TryGet returns true, we succeeded in obtaining the value, and it will not be null. + return value!.Value; // If TryGet returns true, we succeeded in obtaining the value, and it will not be null. } - public bool TryGetValueAsDouble( - IRevitElement element, - RevitBuiltInParameter builtInParameter, - [NotNullWhen(true)] out double? value - ) + public bool TryGetValueAsDouble(Element element, BuiltInParameter builtInParameter, out double? value) { var number = GetValueGeneric( element, builtInParameter, - RevitStorageType.Double, + StorageType.Double, (parameter) => _scalingService.Scale(parameter.AsDouble(), parameter.GetUnitTypeId()) ); if (number.HasValue) @@ -72,81 +66,69 @@ public bool TryGetValueAsDouble( return false; } - private double? GetValueAsDouble(IRevitParameter parameter) + private double? GetValueAsDouble(Parameter parameter) { return GetValueGeneric( parameter, - RevitStorageType.Double, + StorageType.Double, (parameter) => _scalingService.Scale(parameter.AsDouble(), parameter.GetUnitTypeId()) ); } - public int GetValueAsInt(IRevitElement element, RevitBuiltInParameter builtInParameter) + public int GetValueAsInt(Element element, BuiltInParameter builtInParameter) { - return GetValueGeneric( - element, - builtInParameter, - RevitStorageType.Integer, - (parameter) => parameter.AsInteger() - ) + return GetValueGeneric(element, builtInParameter, StorageType.Integer, (parameter) => parameter.AsInteger()) ?? throw new SpeckleConversionException( $"Expected int but got null for property {builtInParameter} on element of type {element.GetType()}" ); } - private int? GetValueAsInt(IRevitParameter parameter) + private int? GetValueAsInt(Parameter parameter) { - return GetValueGeneric(parameter, RevitStorageType.Integer, (parameter) => parameter.AsInteger()); + return GetValueGeneric(parameter, StorageType.Integer, (parameter) => parameter.AsInteger()); } - public bool? GetValueAsBool(IRevitElement element, RevitBuiltInParameter builtInParameter) + public bool? GetValueAsBool(Element element, BuiltInParameter builtInParameter) { var intVal = GetValueGeneric( element, builtInParameter, - RevitStorageType.Integer, + StorageType.Integer, (parameter) => parameter.AsInteger() ); return intVal.HasValue ? Convert.ToBoolean(intVal.Value) : null; } - public string? GetValueAsString(IRevitElement element, RevitBuiltInParameter builtInParameter) + public string? GetValueAsString(Element element, BuiltInParameter builtInParameter) { - return GetValueGeneric(element, builtInParameter, RevitStorageType.String, (parameter) => parameter.AsString()); + return GetValueGeneric(element, builtInParameter, StorageType.String, (parameter) => parameter.AsString()); } - private string? GetValueAsString(IRevitParameter parameter) + private string? GetValueAsString(Parameter parameter) { - return GetValueGeneric(parameter, RevitStorageType.String, (parameter) => parameter.AsString()); + return GetValueGeneric(parameter, StorageType.String, (parameter) => parameter.AsString()); } - public IRevitElementId GetValueAsElementId(IRevitElement element, RevitBuiltInParameter builtInParameter) + public ElementId GetValueAsElementId(Element element, BuiltInParameter builtInParameter) { if (TryGetValueAsElementId(element, builtInParameter, out var elementId)) { - return elementId; + return elementId!; } throw new SpeckleConversionException( $"Failed to get {builtInParameter} on element of type {element.GetType()} as ElementId" ); } - public bool TryGetValueAsElementId( - IRevitElement element, - RevitBuiltInParameter builtInParameter, - [NotNullWhen(true)] out IRevitElementId? elementId - ) + public bool TryGetValueAsElementId(Element element, BuiltInParameter builtInParameter, out ElementId? elementId) { - var generic = GetValueGeneric( - element, - builtInParameter, - RevitStorageType.ElementId, - (parameter) => parameter.AsElementId() - ); - if (generic is not null) + if ( + GetValueGeneric(element, builtInParameter, StorageType.ElementId, (parameter) => parameter.AsElementId()) + is ElementId elementIdNotNull + ) { - elementId = generic; + elementId = elementIdNotNull; return true; } @@ -154,66 +136,62 @@ public bool TryGetValueAsElementId( return false; } - public IRevitElementId? GetValueAsElementId(IRevitParameter parameter) + public ElementId? GetValueAsElementId(Parameter parameter) { - return GetValueGeneric(parameter, RevitStorageType.ElementId, (p) => p.AsElementId()); + return GetValueGeneric(parameter, StorageType.ElementId, (parameter) => parameter.AsElementId()); } - public IRevitLevel GetValueAsRevitLevel(IRevitElement element, RevitBuiltInParameter builtInParameter) + public bool TryGetValueAsDocumentObject(Element element, BuiltInParameter builtInParameter, out T? value) { if (!TryGetValueAsElementId(element, builtInParameter, out var elementId)) { - throw new SpeckleConversionException(); + value = default; + return false; } - var paramElement = element.Document.GetElement(elementId); - return (paramElement?.ToLevel()).NotNull(); + Element paramElement = element.Document.GetElement(elementId); + if (paramElement is not T typedElement) + { + value = default; + return false; + } + + value = typedElement; + return true; } - public bool TryGetValueAsRevitLevel( - IRevitElement element, - RevitBuiltInParameter builtInParameter, - [NotNullWhen(true)] out IRevitLevel? revitLevel - ) + public T GetValueAsDocumentObject(Element element, BuiltInParameter builtInParameter) + where T : class { - if (!TryGetValueAsElementId(element, builtInParameter, out var elementId)) + if (!TryGetValueAsDocumentObject(element, builtInParameter, out var value)) { - revitLevel = null; - return false; + throw new SpeckleConversionException($"Failed to get {builtInParameter} as an element of type {typeof(T)}"); } - var paramElement = element.Document.GetElement(elementId); - revitLevel = paramElement?.ToLevel(); - return revitLevel is not null; + return value!; // If TryGet returns true, we succeeded in obtaining the value, and it will not be null. } private TResult? GetValueGeneric( - IRevitElement element, - RevitBuiltInParameter builtInParameter, - RevitStorageType expectedStorageType, - Func getParamValue + Element element, + BuiltInParameter builtInParameter, + StorageType expectedStorageType, + Func getParamValue ) { - if ( - !_uniqueIdToUsedParameterSetMap.TryGetValue(element.UniqueId, out HashSet usedParameters) - ) + if (!_uniqueIdToUsedParameterSetMap.TryGetValue(element.UniqueId, out HashSet usedParameters)) { usedParameters = new(); _uniqueIdToUsedParameterSetMap[element.UniqueId] = usedParameters; } usedParameters.Add(builtInParameter); - var parameter = element.GetParameter(builtInParameter); - if (parameter is null) - { - return default; - } + var parameter = element.get_Parameter(builtInParameter); return GetValueGeneric(parameter, expectedStorageType, getParamValue); } private TResult? GetValueGeneric( - IRevitParameter parameter, - RevitStorageType expectedStorageType, - Func getParamValue + Parameter parameter, + StorageType expectedStorageType, + Func getParamValue ) { if (parameter == null || !parameter.HasValue) @@ -231,20 +209,20 @@ Func getParamValue return getParamValue(parameter); } - public Dictionary GetAllRemainingParams(IRevitElement revitElement) + public Dictionary GetAllRemainingParams(DB.Element revitElement) { - var allParams = new Dictionary(); + var allParams = new Dictionary(); AddElementParamsToDict(revitElement, allParams); return allParams; } - private void AddElementParamsToDict(IRevitElement element, Dictionary paramDict) + private void AddElementParamsToDict(DB.Element element, Dictionary paramDict) { - _uniqueIdToUsedParameterSetMap.TryGetValue(element.UniqueId, out HashSet? usedParameters); + _uniqueIdToUsedParameterSetMap.TryGetValue(element.UniqueId, out HashSet? usedParameters); using var parameters = element.Parameters; - foreach (IRevitParameter param in parameters) + foreach (DB.Parameter param in parameters) { var internalName = param.GetInternalName(); if (paramDict.ContainsKey(internalName)) @@ -252,8 +230,7 @@ private void AddElementParamsToDict(IRevitElement element, Dictionary +/// Contains predefined categories of revit objects as well as the types that make up the elements +/// in that category +/// +/// +// POC: is quite a messy looking thing, need some review +// might be legit or maybe a bette/cleaner pattern rather than the dictionary of pain, but maybe not +// some whitespace between each at the least! +public static class RevitCategories +{ + public static Dictionary All { get; } + + static RevitCategories() + { + All = new(StringComparer.OrdinalIgnoreCase) + { + { nameof(CableTray), CableTray }, + { nameof(Ceiling), Ceiling }, + { nameof(Column), Column }, + { nameof(Conduit), Conduit }, + { nameof(Door), Door }, + { nameof(Duct), Duct }, + { nameof(FamilyInstance), FamilyInstance }, + { nameof(Floor), Floor }, + { nameof(Furniture), Furniture }, + { nameof(Pipe), Pipe }, + { nameof(PlumbingFixture), PlumbingFixture }, + { nameof(Roof), Roof }, + { nameof(Railing), Railing }, + { nameof(StructuralFraming), StructuralFraming }, + { nameof(Wall), Wall }, + { nameof(Window), Window }, + { nameof(Wire), Wire }, + { nameof(Undefined), Undefined }, + }; + } + + public static RevitCategoryInfo CableTray { get; } = + new( + nameof(CableTray), + typeof(DB.Electrical.CableTray), + typeof(DB.Electrical.CableTrayType), + new List() + ); + public static RevitCategoryInfo Ceiling { get; } = + new(nameof(Ceiling), typeof(DB.Ceiling), typeof(CeilingType), new List()); + public static RevitCategoryInfo Column { get; } = + new( + nameof(Column), + typeof(FamilyInstance), + typeof(FamilySymbol), + new List { BuiltInCategory.OST_Columns, BuiltInCategory.OST_StructuralColumns } + ); + public static RevitCategoryInfo Conduit { get; } = + new(nameof(Conduit), typeof(DB.Electrical.Conduit), typeof(DB.Electrical.ConduitType), new List()); + public static RevitCategoryInfo Door { get; } = + new( + nameof(Door), + typeof(DB.FamilyInstance), + typeof(DB.FamilySymbol), + new List { BuiltInCategory.OST_Doors } + ); + public static RevitCategoryInfo Duct { get; } = + new( + nameof(Duct), + typeof(DB.Mechanical.Duct), + typeof(DB.MEPCurveType), + new List { BuiltInCategory.OST_DuctCurves, BuiltInCategory.OST_FlexDuctCurves } + ); + public static RevitCategoryInfo FamilyInstance { get; } = + new(nameof(FamilyInstance), typeof(DB.FamilyInstance), typeof(DB.FamilySymbol), new List()); + public static RevitCategoryInfo Floor { get; } = + new( + nameof(Floor), + typeof(DB.Floor), + typeof(DB.FloorType), + new List { BuiltInCategory.OST_Floors } + ); + public static RevitCategoryInfo Furniture { get; } = + new( + nameof(Furniture), + typeof(DB.FamilyInstance), + typeof(DB.FamilySymbol), + new List { BuiltInCategory.OST_Furniture } + ); + + //public static RevitCategoryInfo Material { get; } = new( + // nameof(Material), + // typeof(DB.Material), + // null, + // new List + // { + // BuiltInCategory.OST_Materials, + // BuiltInCategory.OST_PipeMaterials, + // BuiltInCategory.OST_WireMaterials + // }); + public static RevitCategoryInfo Pipe { get; } = + new( + nameof(Pipe), + typeof(DB.Plumbing.Pipe), + typeof(DB.MEPCurveType), + new List { BuiltInCategory.OST_PipeCurves, BuiltInCategory.OST_FlexPipeCurves } + ); + public static RevitCategoryInfo PlumbingFixture { get; } = + new( + nameof(PlumbingFixture), + typeof(DB.FamilyInstance), + typeof(DB.FamilySymbol), + new List { BuiltInCategory.OST_PlumbingFixtures } + ); + public static RevitCategoryInfo Roof { get; } = + new( + nameof(Roof), + typeof(DB.RoofBase), + typeof(DB.RoofType), + new List { BuiltInCategory.OST_Roofs, } + ); + public static RevitCategoryInfo Railing { get; } = + new( + nameof(Railing), + typeof(DB.Architecture.Railing), + typeof(DB.Architecture.RailingType), + new List() + ); + public static RevitCategoryInfo StructuralFraming { get; } = + new( + nameof(StructuralFraming), + typeof(DB.FamilyInstance), + typeof(DB.FamilySymbol), + new List { BuiltInCategory.OST_StructuralFraming }, + new List { "beam", "brace", "framing" } + ); + public static RevitCategoryInfo Wall { get; } = + new(nameof(Wall), typeof(DB.Wall), typeof(DB.WallType), new List { BuiltInCategory.OST_Walls }); + public static RevitCategoryInfo Window { get; } = + new( + nameof(Window), + typeof(DB.FamilyInstance), + typeof(DB.FamilySymbol), + new List { BuiltInCategory.OST_Windows } + ); + public static RevitCategoryInfo Wire { get; } = + new(nameof(Wire), typeof(DB.Electrical.Wire), typeof(DB.Electrical.WireType), new List()); + public static RevitCategoryInfo Undefined { get; } = + new(nameof(Undefined), typeof(RevitCategoryInfo), typeof(RevitCategoryInfo), new List()); +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitCategoryInfo.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitCategoryInfo.cs new file mode 100644 index 0000000000..f883f7c9e8 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitCategoryInfo.cs @@ -0,0 +1,65 @@ +using System.Diagnostics.CodeAnalysis; +using Autodesk.Revit.DB; + +namespace Speckle.Converters.RevitShared.Helpers; + +// review, maybe it doesn't need injecting, or maybe we inject a factory? +public class RevitCategoryInfo +{ + public RevitCategoryInfo( + string name, + Type instanceType, + Type familyType, + List categories, + List? categoryAliases = null + ) + { + CategoryName = name; + ElementInstanceType = instanceType; + ElementTypeType = familyType; + BuiltInCategories = categories; + CategoryAliases = categoryAliases ?? new List(); + } + + public string CategoryName { get; } + public Type ElementInstanceType { get; } + public Type ElementTypeType { get; } + public ICollection BuiltInCategories { get; } + public List CategoryAliases { get; } + + public bool ContainsRevitCategory(Category category) + { + return BuiltInCategories.Select(x => (int)x).Contains(category.Id.IntegerValue); + } + + public List GetElementTypes(Document document) + { + return GetElementTypes(document); + } + + [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope")] + public List GetElementTypes(Document document) + where T : ElementType + { + // POC: why is this disabled? surely a using statement is golden here? + var collector = new FilteredElementCollector(document); + + if (BuiltInCategories.Count > 0) + { + using var filter = new ElementMulticategoryFilter(BuiltInCategories); + collector = collector.WherePasses(filter); + } + if (ElementTypeType != null) + { + collector = collector.OfClass(ElementTypeType); + } + var elementTypes = collector.WhereElementIsElementType().Cast().ToList(); + collector.Dispose(); + return elementTypes; + } + + public string GetCategorySpecificTypeName(string typeName) + { + return CategoryName + "_" + typeName; + } +} diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitContext.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitContext.cs similarity index 80% rename from DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitContext.cs rename to DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitContext.cs index 3148acc5dc..59c3892a75 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Helpers/RevitContext.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitContext.cs @@ -1,6 +1,6 @@ -using Autodesk.Revit.UI; +using Autodesk.Revit.UI; -namespace Speckle.Connectors.RevitShared.Helpers; +namespace Speckle.Converters.RevitShared.Helpers; public class RevitContext { diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs new file mode 100644 index 0000000000..ce43a88901 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs @@ -0,0 +1,28 @@ +using Autodesk.Revit.DB; +using Speckle.Converters.Common; + +namespace Speckle.Converters.RevitShared.Helpers; + +[System.Diagnostics.CodeAnalysis.SuppressMessage( + "Naming", + "CA1711:Identifiers should not have incorrect suffix", + Justification = "See base class justification" +)] +// POC: so this should *probably* be Document and NOT UI.UIDocument, the former is Conversion centric +// and the latter is more for connector +public class RevitConversionContextStack : ConversionContextStack, IRevitConversionContextStack +{ + public const double TOLERANCE = 0.0164042; // 5mm in ft + + public RevitConversionContextStack(RevitContext context, IHostToSpeckleUnitConverter unitConverter) + : base( + // POC: we probably should not get here without a valid document + // so should this perpetuate or do we assume this is valid? + // relting on the context.UIApplication?.ActiveUIDocument is not right + // this should be some IActiveDocument I suspect? + context.UIApplication?.ActiveUIDocument?.Document + ?? throw new SpeckleConversionException("Active UI document could not be determined"), + context.UIApplication.ActiveUIDocument.Document.GetUnits().GetFormatOptions(SpecTypeId.Length).GetUnitTypeId(), + unitConverter + ) { } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SendSelection.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SendSelection.cs new file mode 100644 index 0000000000..c6b4590a6d --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SendSelection.cs @@ -0,0 +1,17 @@ +namespace Speckle.Converters.RevitShared.Helpers; + +// POC: why do we need this send selection? +// why does conversion need to know about selection in this way? +public class SendSelection +{ + private readonly HashSet _selectedItemIds; + + public SendSelection(IEnumerable selectedItemIds) + { + _selectedItemIds = new HashSet(selectedItemIds); + } + + public bool Contains(string elementId) => _selectedItemIds.Contains(elementId); + + public IReadOnlyCollection SelectedItems => _selectedItemIds.ToList().AsReadOnly(); +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SlopeArrowExtractor.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SlopeArrowExtractor.cs index 1ae02630be..9db6d14583 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SlopeArrowExtractor.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/SlopeArrowExtractor.cs @@ -1,51 +1,43 @@ -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.Helpers; -[GenerateAutoInterface] public class SlopeArrowExtractor : ISlopeArrowExtractor { - private readonly ITypedConverter _pointConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IRevitFilterFactory _revitFilterFactory; + private readonly ITypedConverter _pointConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; public SlopeArrowExtractor( - ITypedConverter pointConverter, - IParameterValueExtractor parameterValueExtractor, - IRevitFilterFactory revitFilterFactory + ITypedConverter pointConverter, + ParameterValueExtractor parameterValueExtractor ) { _pointConverter = pointConverter; _parameterValueExtractor = parameterValueExtractor; - _revitFilterFactory = revitFilterFactory; } - public IRevitModelLine? GetSlopeArrow(IRevitElement element) + public DB.ModelLine? GetSlopeArrow(DB.Element element) { - IList? elementIds = null; - if (element is IRevitFloor floor) + IList? elementIds = null; + if (element is DB.Floor floor) { - elementIds = (floor.Document.GetElement(floor.SketchId).NotNull().ToSketch().NotNull()).GetAllElements(); + elementIds = ((DB.Sketch)floor.Document.GetElement(floor.SketchId)).GetAllElements(); } if (elementIds == null) { - using var modelLineFilter = _revitFilterFactory.CreateElementCategoryFilter(RevitBuiltInCategory.OST_SketchLines); + using var modelLineFilter = new DB.ElementCategoryFilter(DB.BuiltInCategory.OST_SketchLines); elementIds = element.GetDependentElements(modelLineFilter); } foreach (var elementId in elementIds) { - var line = element.Document.GetElement(elementId)?.ToModelLine(); - if (line is null) + if (element.Document.GetElement(elementId) is not DB.ModelLine line) { continue; } - var offsetAtTailParameter = line.GetParameter(RevitBuiltInParameter.SLOPE_START_HEIGHT); + var offsetAtTailParameter = line.get_Parameter(DB.BuiltInParameter.SLOPE_START_HEIGHT); if (offsetAtTailParameter != null) { return line; @@ -54,29 +46,26 @@ IRevitFilterFactory revitFilterFactory return null; } - public SOG.Point GetSlopeArrowHead(IRevitModelLine slopeArrow) + public SOG.Point GetSlopeArrowHead(DB.ModelLine slopeArrow) { - return _pointConverter.Convert((slopeArrow.GetLocationAsLocationCurve().NotNull()).Curve.GetEndPoint(1)); + return _pointConverter.Convert(((DB.LocationCurve)slopeArrow.Location).Curve.GetEndPoint(1)); } - public SOG.Point GetSlopeArrowTail(IRevitModelLine slopeArrow) + public SOG.Point GetSlopeArrowTail(DB.ModelLine slopeArrow) { - return _pointConverter.Convert((slopeArrow.GetLocationAsLocationCurve().NotNull()).Curve.GetEndPoint(0)); + return _pointConverter.Convert(((DB.LocationCurve)slopeArrow.Location).Curve.GetEndPoint(0)); } - public double GetSlopeArrowTailOffset(IRevitModelLine slopeArrow) + public double GetSlopeArrowTailOffset(DB.ModelLine slopeArrow) { - return _parameterValueExtractor.GetValueAsDouble(slopeArrow, RevitBuiltInParameter.SLOPE_START_HEIGHT); + return _parameterValueExtractor.GetValueAsDouble(slopeArrow, DB.BuiltInParameter.SLOPE_START_HEIGHT); } - public double GetSlopeArrowHeadOffset(IRevitModelLine slopeArrow, double tailOffset, out double slope) + public double GetSlopeArrowHeadOffset(DB.ModelLine slopeArrow, double tailOffset, out double slope) { - var specifyOffset = _parameterValueExtractor.GetValueAsInt( - slopeArrow, - RevitBuiltInParameter.SPECIFY_SLOPE_OR_OFFSET - ); + var specifyOffset = _parameterValueExtractor.GetValueAsInt(slopeArrow, DB.BuiltInParameter.SPECIFY_SLOPE_OR_OFFSET); - var lineLength = _parameterValueExtractor.GetValueAsDouble(slopeArrow, RevitBuiltInParameter.CURVE_ELEM_LENGTH); + var lineLength = _parameterValueExtractor.GetValueAsDouble(slopeArrow, DB.BuiltInParameter.CURVE_ELEM_LENGTH); slope = 0; double headOffset = 0; @@ -84,12 +73,12 @@ public double GetSlopeArrowHeadOffset(IRevitModelLine slopeArrow, double tailOff if (specifyOffset == 1) { // in this scenario, slope is returned as a percentage. Divide by 100 to get the unitless form - slope = _parameterValueExtractor.GetValueAsDouble(slopeArrow, RevitBuiltInParameter.ROOF_SLOPE) / 100d; + slope = _parameterValueExtractor.GetValueAsDouble(slopeArrow, DB.BuiltInParameter.ROOF_SLOPE) / 100d; headOffset = tailOffset + lineLength * Math.Sin(Math.Atan(slope)); } else if (specifyOffset == 0) // 0 corrospondes to the "height at tail" option { - headOffset = _parameterValueExtractor.GetValueAsDouble(slopeArrow, RevitBuiltInParameter.SLOPE_END_HEIGHT); + headOffset = _parameterValueExtractor.GetValueAsDouble(slopeArrow, DB.BuiltInParameter.SLOPE_END_HEIGHT); slope = (headOffset - tailOffset) / lineLength; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ToSpeckleConvertedObjectsCache.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ToSpeckleConvertedObjectsCache.cs new file mode 100644 index 0000000000..c4c91d9fb8 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ToSpeckleConvertedObjectsCache.cs @@ -0,0 +1,25 @@ +using Speckle.Core.Models; + +namespace Speckle.Converters.RevitShared.Helpers; + +// POC: review the cache? should this be a common class? +// Does caching work this way everywhere, i.e, string key and base value? +public sealed class ToSpeckleConvertedObjectsCache +{ + private readonly Dictionary _uniqueIdToConvertedBaseDict = new(); + + public void AddConvertedBase(string revitUniqueId, Base b) + { + _uniqueIdToConvertedBaseDict.Add(revitUniqueId, b); + } + + public bool ContainsBaseConvertedFromId(string revitUniqueId) + { + return _uniqueIdToConvertedBaseDict.ContainsKey(revitUniqueId); + } + + public bool TryGetConvertedBase(string revitUniqueId, out Base? value) + { + return _uniqueIdToConvertedBaseDict.TryGetValue(revitUniqueId, out value); + } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IReferencePointConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IReferencePointConverter.cs new file mode 100644 index 0000000000..f526412336 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IReferencePointConverter.cs @@ -0,0 +1,6 @@ +namespace Speckle.Converters.RevitShared; + +public interface IReferencePointConverter +{ + DB.XYZ ConvertToExternalCoordindates(DB.XYZ inbound, bool isPoint); +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IRevitVersionConversionHelper.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IRevitVersionConversionHelper.cs new file mode 100644 index 0000000000..18a593cbbd --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/IRevitVersionConversionHelper.cs @@ -0,0 +1,6 @@ +namespace Speckle.Converters.RevitShared; + +public interface IRevitVersionConversionHelper +{ + bool IsCurveClosed(DB.NurbSpline nurbsSpline); +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BeamConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BeamConversionToSpeckle.cs index 59f790664f..d6ee746e43 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BeamConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BeamConversionToSpeckle.cs @@ -3,28 +3,27 @@ using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: There is no validation on this converter to prevent conversion from "not a Revit Beam" to a Speckle Beam. // This will definitely explode if we tried. Goes back to the `CanConvert` functionality conversation. // As-is, what we are saying is that it can take "any Family Instance" and turn it into a Speckle.RevitBeam, which is far from correct. // CNX-9312 -public class BeamConversionToSpeckle : ITypedConverter +public class BeamConversionToSpeckle : ITypedConverter { - private readonly ITypedConverter _locationConverter; - private readonly ITypedConverter _levelConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IParameterObjectAssigner _parameterObjectAssigner; + private readonly ITypedConverter _locationConverter; + private readonly ITypedConverter _levelConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly ParameterObjectAssigner _parameterObjectAssigner; public BeamConversionToSpeckle( - ITypedConverter locationConverter, - ITypedConverter levelConverter, - IParameterValueExtractor parameterValueExtractor, - IDisplayValueExtractor displayValueExtractor, - IParameterObjectAssigner parameterObjectAssigner + ITypedConverter locationConverter, + ITypedConverter levelConverter, + ParameterValueExtractor parameterValueExtractor, + DisplayValueExtractor displayValueExtractor, + ParameterObjectAssigner parameterObjectAssigner ) { _locationConverter = locationConverter; @@ -34,7 +33,7 @@ IParameterObjectAssigner parameterObjectAssigner _parameterObjectAssigner = parameterObjectAssigner; } - public SOBR.RevitBeam Convert(IRevitFamilyInstance target) + public SOBR.RevitBeam Convert(DB.FamilyInstance target) { var baseGeometry = _locationConverter.Convert(target.Location); if (baseGeometry is not ICurve baseCurve) @@ -43,20 +42,19 @@ public SOBR.RevitBeam Convert(IRevitFamilyInstance target) $"Beam location conversion did not yield an ICurve, instead it yielded an object of type {baseGeometry.GetType()}" ); } - - var symbol = target.Document.GetElement(target.GetTypeId()).NotNull().ToFamilySymbol().NotNull(); + var symbol = (DB.FamilySymbol)target.Document.GetElement(target.GetTypeId()); SOBR.RevitBeam speckleBeam = new() { family = symbol.FamilyName, - type = target.Document.GetElement(target.GetTypeId()).NotNull().Name, + type = target.Document.GetElement(target.GetTypeId()).Name, baseLine = baseCurve }; - var level = _parameterValueExtractor.GetValueAsRevitLevel( + var level = _parameterValueExtractor.GetValueAsDocumentObject( target, - RevitBuiltInParameter.INSTANCE_REFERENCE_LEVEL_PARAM + DB.BuiltInParameter.INSTANCE_REFERENCE_LEVEL_PARAM ); speckleBeam.level = _levelConverter.Convert(level); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BoundarySegmentConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BoundarySegmentConversionToSpeckle.cs index 793e03735e..8f02d4c345 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BoundarySegmentConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BoundarySegmentConversionToSpeckle.cs @@ -1,19 +1,18 @@ using Objects; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; -public class BoundarySegmentConversionToSpeckle : ITypedConverter, SOG.Polycurve> +public class BoundarySegmentConversionToSpeckle : ITypedConverter, SOG.Polycurve> { - private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _curveConverter; - public BoundarySegmentConversionToSpeckle(ITypedConverter curveConverter) + public BoundarySegmentConversionToSpeckle(ITypedConverter curveConverter) { _curveConverter = curveConverter; } - public SOG.Polycurve Convert(IList target) + public SOG.Polycurve Convert(IList target) { if (target.Count == 0) { @@ -23,7 +22,7 @@ public SOG.Polycurve Convert(IList target) var poly = new SOG.Polycurve(); foreach (var segment in target) { - IRevitCurve revitCurve = segment.GetCurve(); + DB.Curve revitCurve = segment.GetCurve(); var curve = _curveConverter.Convert(revitCurve); // POC: We used to attach the `elementID` of every curve in a PolyCurve as a dynamic property. diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BraceToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BraceToSpeckleConverter.cs index bcee398c73..ccae249fe5 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BraceToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/BraceToSpeckleConverter.cs @@ -1,25 +1,24 @@ -using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: There is no validation on this converter to prevent conversion from "not a Revit Beam" to a Speckle Beam. // This will definitely explode if we tried. Goes back to the `CanConvert` functionality conversation. // As-is, what we are saying is that it can take "any Family Instance" and turn it into a Speckle.RevitBeam, which is far from correct. // CNX-9312 -public class BraceToSpeckleConverter : ITypedConverter +public class BraceToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _beamConverter; + private readonly ITypedConverter _beamConverter; - public BraceToSpeckleConverter(ITypedConverter beamConverter) + public BraceToSpeckleConverter(ITypedConverter beamConverter) { _beamConverter = beamConverter; } - public SOBR.RevitBrace Convert(IRevitFamilyInstance target) + public SOBR.RevitBrace Convert(DB.FamilyInstance target) { - // POC: we might want some easy one-liner here to FamilyMatchesOrThrow(target, IRevitStructure.StructuralType.Brace) or similar + // POC: we might want some easy one-liner here to FamilyMatchesOrThrow(target, DB.Structure.StructuralType.Brace) or similar // and added in each Convert // POC: this and the beam lost the notes we were returning, though this seems against even the original pattern diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ColumnConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ColumnConversionToSpeckle.cs index afcf6f27eb..1786febd39 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ColumnConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ColumnConversionToSpeckle.cs @@ -1,30 +1,31 @@ -using Objects; +using Autodesk.Revit.DB; +using Objects; +using Objects.BuiltElements.Revit; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: There is no validation on this converter to prevent conversion from "not a Revit Beam" to a Speckle Beam. // This will definitely explode if we tried. Goes back to the `CanConvert` functionality conversation. -public class ColumnConversionToSpeckle : ITypedConverter +public class ColumnConversionToSpeckle : ITypedConverter { - private readonly ITypedConverter _locationConverter; - private readonly ITypedConverter _levelConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IConversionContextStack _contextStack; - private readonly IParameterObjectAssigner _parameterObjectAssigner; + private readonly ITypedConverter _locationConverter; + private readonly ITypedConverter _levelConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly IRevitConversionContextStack _contextStack; + private readonly ParameterObjectAssigner _parameterObjectAssigner; public ColumnConversionToSpeckle( - ITypedConverter locationConverter, - ITypedConverter levelConverter, - IParameterValueExtractor parameterValueExtractor, - IDisplayValueExtractor displayValueExtractor, - IConversionContextStack contextStack, - IParameterObjectAssigner parameterObjectAssigner + ITypedConverter locationConverter, + ITypedConverter levelConverter, + ParameterValueExtractor parameterValueExtractor, + DisplayValueExtractor displayValueExtractor, + IRevitConversionContextStack contextStack, + ParameterObjectAssigner parameterObjectAssigner ) { _locationConverter = locationConverter; @@ -35,71 +36,67 @@ IParameterObjectAssigner parameterObjectAssigner _parameterObjectAssigner = parameterObjectAssigner; } - public SOBR.RevitColumn Convert(IRevitFamilyInstance target) + public RevitColumn Convert(DB.FamilyInstance target) { - var symbol = target.Document.GetElement(target.GetTypeId()).NotNull().ToFamilySymbol().NotNull(); + FamilySymbol symbol = (FamilySymbol)target.Document.GetElement(target.GetTypeId()); - SOBR.RevitColumn speckleColumn = - new() { family = symbol.FamilyName, type = target.Document.GetElement(target.GetTypeId()).NotNull().Name }; + RevitColumn speckleColumn = + new() { family = symbol.FamilyName, type = target.Document.GetElement(target.GetTypeId()).Name }; - //should these all be try? if ( - _parameterValueExtractor.TryGetValueAsRevitLevel( + _parameterValueExtractor.TryGetValueAsDocumentObject( target, - RevitBuiltInParameter.FAMILY_BASE_LEVEL_PARAM, + BuiltInParameter.FAMILY_BASE_LEVEL_PARAM, out var level ) ) { - speckleColumn.level = _levelConverter.Convert(level); + speckleColumn.level = _levelConverter.Convert(level.NotNull()); } - //should these all be try? if ( - _parameterValueExtractor.TryGetValueAsRevitLevel( + _parameterValueExtractor.TryGetValueAsDocumentObject( target, - RevitBuiltInParameter.FAMILY_TOP_LEVEL_PARAM, + BuiltInParameter.FAMILY_TOP_LEVEL_PARAM, out var topLevel ) ) { - speckleColumn.topLevel = _levelConverter.Convert(topLevel); + speckleColumn.topLevel = _levelConverter.Convert(topLevel.NotNull()); } - //should these all be try? if ( _parameterValueExtractor.TryGetValueAsDouble( target, - RevitBuiltInParameter.FAMILY_BASE_LEVEL_OFFSET_PARAM, + BuiltInParameter.FAMILY_BASE_LEVEL_OFFSET_PARAM, out var baseOffset ) ) { - speckleColumn.baseOffset = baseOffset.Value; + speckleColumn.baseOffset = baseOffset.NotNull(); } - //should these all be try? if ( _parameterValueExtractor.TryGetValueAsDouble( target, - RevitBuiltInParameter.FAMILY_TOP_LEVEL_OFFSET_PARAM, + BuiltInParameter.FAMILY_TOP_LEVEL_OFFSET_PARAM, out var topOffset ) ) { - speckleColumn.topOffset = topOffset.Value; + speckleColumn.topOffset = topOffset.NotNull(); } + speckleColumn.facingFlipped = target.FacingFlipped; speckleColumn.handFlipped = target.HandFlipped; speckleColumn.isSlanted = target.IsSlantedColumn; - var locationPoint = target.GetLocationAsLocationPoint(); - if (locationPoint is not null) + if (target.Location is LocationPoint locationPoint) { speckleColumn.rotation = locationPoint.Rotation; } speckleColumn.baseLine = - GetBaseCurve(target, speckleColumn.topLevel?.elevation, speckleColumn.topOffset) + GetBaseCurve(target, speckleColumn.topLevel?.elevation ?? -1, speckleColumn.topOffset) ?? throw new SpeckleConversionException("Unable to find a valid baseCurve for column"); speckleColumn.displayValue = _displayValueExtractor.GetDisplayValue(target); @@ -109,7 +106,7 @@ out var topOffset return speckleColumn; } - private ICurve? GetBaseCurve(IRevitFamilyInstance target, double? topLevelElevation, double topLevelOffset) + private ICurve? GetBaseCurve(DB.FamilyInstance target, double topLevelElevation, double topLevelOffset) { Base baseGeometry = _locationConverter.Convert(target.Location); ICurve? baseCurve = baseGeometry as ICurve; @@ -132,12 +129,7 @@ out var topOffset return new SOG.Line( basePoint, - new SOG.Point( - basePoint.x, - basePoint.y, - topLevelElevation ?? 0 + topLevelOffset, - _contextStack.Current.SpeckleUnits - ), + new SOG.Point(basePoint.x, basePoint.y, topLevelElevation + topLevelOffset, _contextStack.Current.SpeckleUnits), _contextStack.Current.SpeckleUnits ); } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/ArcToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/ArcToSpeckleConverter.cs index a5830c9c45..d6774a710b 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/ArcToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/ArcToSpeckleConverter.cs @@ -1,46 +1,42 @@ -using Objects.Primitive; -using Speckle.Converters.Common; +using Objects.Primitive; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class ArcToSpeckleConverter : ITypedConverter +public class ArcToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly ITypedConverter _planeConverter; - private readonly IScalingServiceToSpeckle _scalingService; - private readonly IRevitPlaneUtils _revitPlaneUtils; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _planeConverter; + private readonly ScalingServiceToSpeckle _scalingService; public ArcToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - ITypedConverter planeConverter, - IScalingServiceToSpeckle scalingService, - IRevitPlaneUtils revitPlaneUtils + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ITypedConverter planeConverter, + ScalingServiceToSpeckle scalingService ) { _contextStack = contextStack; _xyzToPointConverter = xyzToPointConverter; _planeConverter = planeConverter; _scalingService = scalingService; - _revitPlaneUtils = revitPlaneUtils; } - public SOG.Arc Convert(IRevitArc target) + public SOG.Arc Convert(DB.Arc target) { // see https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-startangle-and-endangle-of-arc-object/td-p/7637128 - var arcPlane = _revitPlaneUtils.CreateByOriginAndBasis(target.Center, target.XDirection, target.YDirection); - IRevitXYZ center = target.Center; + var arcPlane = DB.Plane.CreateByOriginAndBasis(target.Center, target.XDirection, target.YDirection); + DB.XYZ center = target.Center; - IRevitXYZ dir0 = (target.GetEndPoint(0).Subtract(center)).Normalize(); - IRevitXYZ dir1 = (target.GetEndPoint(1).Subtract(center)).Normalize(); + DB.XYZ dir0 = (target.GetEndPoint(0) - center).Normalize(); + DB.XYZ dir1 = (target.GetEndPoint(1) - center).Normalize(); - IRevitXYZ start = target.Evaluate(0, true); - IRevitXYZ end = target.Evaluate(1, true); - IRevitXYZ mid = target.Evaluate(0.5, true); + DB.XYZ start = target.Evaluate(0, true); + DB.XYZ end = target.Evaluate(1, true); + DB.XYZ mid = target.Evaluate(0.5, true); double startAngle = target.XDirection.AngleOnPlaneTo(dir0, target.Normal); double endAngle = target.XDirection.AngleOnPlaneTo(dir1, target.Normal); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs index f91deee0cc..a891579ad5 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs @@ -1,31 +1,27 @@ -using Objects.Primitive; -using Speckle.Converters.Common; +using Objects.Primitive; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class BoundingBoxXYZToSpeckleConverter : ITypedConverter +public class BoundingBoxXYZToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly ITypedConverter _planeConverter; - private readonly IRevitPlaneUtils _revitPlaneUtils; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _planeConverter; public BoundingBoxXYZToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - ITypedConverter planeConverter, - IRevitPlaneUtils revitPlaneUtils + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ITypedConverter planeConverter ) { _contextStack = contextStack; _xyzToPointConverter = xyzToPointConverter; _planeConverter = planeConverter; - _revitPlaneUtils = revitPlaneUtils; } - public SOG.Box Convert(IRevitBoundingBoxXYZ target) + public SOG.Box Convert(DB.BoundingBoxXYZ target) { // convert min and max pts to speckle first var min = _xyzToPointConverter.Convert(target.Min); @@ -33,7 +29,7 @@ public SOG.Box Convert(IRevitBoundingBoxXYZ target) // get the base plane of the bounding box from the transform var transform = target.Transform; - var plane = _revitPlaneUtils.CreateByOriginAndBasis( + var plane = DB.Plane.CreateByOriginAndBasis( transform.Origin, transform.BasisX.Normalize(), transform.BasisY.Normalize() diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CircleToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CircleToSpeckleConverter.cs index 580c223c6b..7abdc08cfc 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CircleToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CircleToSpeckleConverter.cs @@ -1,36 +1,32 @@ -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class CircleToSpeckleConverter : ITypedConverter +public class CircleToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _planeConverter; - private readonly IScalingServiceToSpeckle _scalingService; - private readonly IRevitPlaneUtils _revitPlaneUtils; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _planeConverter; + private readonly ScalingServiceToSpeckle _scalingService; public CircleToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter planeConverter, - IScalingServiceToSpeckle scalingService, - IRevitPlaneUtils revitPlaneUtils + IRevitConversionContextStack contextStack, + ITypedConverter planeConverter, + ScalingServiceToSpeckle scalingService ) { _contextStack = contextStack; _planeConverter = planeConverter; _scalingService = scalingService; - _revitPlaneUtils = revitPlaneUtils; } - public SOG.Circle Convert(IRevitArc target) + public SOG.Circle Convert(DB.Arc target) { // POC: should we check for arc of 360 and throw? Original CircleToSpeckle did not do this. // see https://forums.autodesk.com/t5/revit-api-forum/how-to-retrieve-startangle-and-endangle-of-arc-object/td-p/7637128 - var arcPlane = _revitPlaneUtils.CreateByNormalAndOrigin(target.Normal, target.Center); + var arcPlane = DB.Plane.CreateByNormalAndOrigin(target.Normal, target.Center); var c = new SOG.Circle() { plane = _planeConverter.Convert(arcPlane), diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs index d393d310c6..4644bc1435 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs @@ -1,25 +1,34 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; +using Objects.Geometry; +using Speckle.Converters.Common.Objects; -namespace Speckle.Converters.RevitShared.ToSpeckle; +namespace Speckle.Converters.RevitShared.Raw; -public sealed class CurveArrArrayToSpecklePolycurveConverter : ITypedConverter> +internal sealed class CurveArrArrayToSpecklePolycurveConverter : ITypedConverter> { - private readonly ITypedConverter _curveArrayConverter; + private readonly ITypedConverter _curveArrayConverter; - public CurveArrArrayToSpecklePolycurveConverter(ITypedConverter curveArrayConverter) + public CurveArrArrayToSpecklePolycurveConverter(ITypedConverter curveArrayConverter) { _curveArrayConverter = curveArrayConverter; } - public List Convert(IRevitCurveArrArray target) + public List Convert(CurveArrArray target) { - List polycurves = new(target.Count); - foreach (var curveArray in target) + List polycurves = new(); + foreach (var curveArray in GetCurveArrays(target)) { polycurves.Add(_curveArrayConverter.Convert(curveArray)); } return polycurves; } + + private IEnumerable GetCurveArrays(DB.CurveArrArray curveArrArray) + { + for (var i = 0; i < curveArrArray.Size; i++) + { + yield return curveArrArray.get_Item(i); + } + } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrayConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrayConversionToSpeckle.cs index afa6ad4830..8ec80fe9f7 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrayConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveArrayConversionToSpeckle.cs @@ -1,21 +1,22 @@ -using Objects; -using Speckle.Converters.Common; +using Autodesk.Revit.DB; +using Objects; +using Objects.Geometry; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public sealed class CurveArrayConversionToSpeckle : ITypedConverter +public sealed class CurveArrayConversionToSpeckle : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly IScalingServiceToSpeckle _scalingService; - private readonly ITypedConverter _curveConverter; + private readonly IRevitConversionContextStack _contextStack; + private readonly ScalingServiceToSpeckle _scalingService; + private readonly ITypedConverter _curveConverter; public CurveArrayConversionToSpeckle( - IConversionContextStack contextStack, - IScalingServiceToSpeckle scalingService, - ITypedConverter curveConverter + IRevitConversionContextStack contextStack, + ScalingServiceToSpeckle scalingService, + ITypedConverter curveConverter ) { _contextStack = contextStack; @@ -23,14 +24,15 @@ ITypedConverter curveConverter _curveConverter = curveConverter; } - public SOG.Polycurve Convert(IRevitCurveArray target) + public Polycurve Convert(CurveArray target) { - List curves = target.Cast().ToList(); + List curves = target.Cast().ToList(); - return new SOG.Polycurve() + return new Polycurve() { units = _contextStack.Current.SpeckleUnits, - closed = curves.First().GetEndPoint(0).DistanceTo(curves.Last().GetEndPoint(1)) < RevitConstants.TOLERANCE, + closed = + curves.First().GetEndPoint(0).DistanceTo(curves.Last().GetEndPoint(1)) < RevitConversionContextStack.TOLERANCE, length = _scalingService.ScaleLength(curves.Sum(x => x.Length)), segments = curves.Select(x => _curveConverter.Convert(x)).ToList() }; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveConversionToSpeckle.cs index e165964a28..0b034a779c 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/CurveConversionToSpeckle.cs @@ -1,26 +1,25 @@ -using Objects; -using Speckle.Converters.Common; +using Objects; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.Common; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class CurveConversionToSpeckle : ITypedConverter +public class CurveConversionToSpeckle : ITypedConverter { - private readonly ITypedConverter _lineConverter; - private readonly ITypedConverter _arcConverter; - private readonly ITypedConverter _circleConverter; - private readonly ITypedConverter _ellipseConverter; - private readonly ITypedConverter _nurbsConverter; - private readonly ITypedConverter _hermiteConverter; // POC: should this be ICurve? + private readonly ITypedConverter _lineConverter; + private readonly ITypedConverter _arcConverter; + private readonly ITypedConverter _circleConverter; + private readonly ITypedConverter _ellipseConverter; + private readonly ITypedConverter _nurbsConverter; + private readonly ITypedConverter _hermiteConverter; // POC: should this be ICurve? public CurveConversionToSpeckle( - ITypedConverter lineConverter, - ITypedConverter arcConverter, - ITypedConverter circleConverter, - ITypedConverter ellipseConverter, - ITypedConverter nurbsConverter, - ITypedConverter hermiteConverter + ITypedConverter lineConverter, + ITypedConverter arcConverter, + ITypedConverter circleConverter, + ITypedConverter ellipseConverter, + ITypedConverter nurbsConverter, + ITypedConverter hermiteConverter ) { _lineConverter = lineConverter; @@ -31,34 +30,18 @@ public CurveConversionToSpeckle( _hermiteConverter = hermiteConverter; } - public ICurve Convert(IRevitCurve target) + public ICurve Convert(DB.Curve target) { - var line = target.ToLine(); - if (line is not null) - { - return _lineConverter.Convert(line); - } - var arc = target.ToArc(); - if (arc is not null) - { - return arc.IsClosed ? _circleConverter.Convert(arc) : _arcConverter.Convert(arc); - } - var ellipse = target.ToEllipse(); - if (ellipse is not null) - { - return _ellipseConverter.Convert(ellipse); - } - var nurbs = target.ToNurbSpline(); - if (nurbs is not null) - { - return _nurbsConverter.Convert(nurbs); - } - var hermite = target.ToHermiteSpline(); - if (hermite is not null) + return target switch { - return _hermiteConverter.Convert(hermite); - } + DB.Line line => _lineConverter.Convert(line), + // POC: are maybe arc.IsCyclic ? + DB.Arc arc => arc.IsClosed ? _circleConverter.Convert(arc) : _arcConverter.Convert(arc), + DB.Ellipse ellipse => _ellipseConverter.Convert(ellipse), + DB.NurbSpline nurbs => _nurbsConverter.Convert(nurbs), + DB.HermiteSpline hermite => _hermiteConverter.Convert(hermite), - throw new SpeckleConversionException($"Unsupported curve type {target.GetType()}"); + _ => throw new SpeckleConversionException($"Unsupported curve type {target.GetType()}") + }; } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/EllipseToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/EllipseToSpeckleConverter.cs index 7f920e5954..96ca62f8f1 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/EllipseToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/EllipseToSpeckleConverter.cs @@ -1,40 +1,30 @@ -using Objects.Primitive; -using Speckle.Converters.Common; +using Objects.Primitive; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class EllipseToSpeckleConverter : ITypedConverter +public class EllipseToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _planeConverter; - private readonly IScalingServiceToSpeckle _scalingService; - private readonly IRevitPlaneUtils _revitPlaneUtils; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _planeConverter; + private readonly ScalingServiceToSpeckle _scalingService; public EllipseToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter planeConverter, - IScalingServiceToSpeckle scalingService, - IRevitPlaneUtils revitPlaneUtils + IRevitConversionContextStack contextStack, + ITypedConverter planeConverter, + ScalingServiceToSpeckle scalingService ) { _contextStack = contextStack; _planeConverter = planeConverter; _scalingService = scalingService; - _revitPlaneUtils = revitPlaneUtils; } - public SOG.Ellipse Convert(IRevitEllipse target) + public SOG.Ellipse Convert(DB.Ellipse target) { - using ( - IRevitPlane basePlane = _revitPlaneUtils.CreateByOriginAndBasis( - target.Center, - target.XDirection, - target.YDirection - ) - ) + using (DB.Plane basePlane = DB.Plane.CreateByOriginAndBasis(target.Center, target.XDirection, target.YDirection)) { var trim = target.IsBound ? new Interval(target.GetEndParameter(0), target.GetEndParameter(1)) : null; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/HermiteSplineToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/HermiteSplineToSpeckleConverter.cs index 1c364da849..5aa2a07ed2 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/HermiteSplineToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/HermiteSplineToSpeckleConverter.cs @@ -1,25 +1,19 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.Common.Objects; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class HermiteSplineToSpeckleConverter : ITypedConverter +public class HerminteSplitToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _splineConverter; - private readonly IRevitNurbSplineUtils _revitNurbSplineUtils; + private readonly ITypedConverter _splineConverter; - public HermiteSplineToSpeckleConverter( - ITypedConverter splineConverter, - IRevitNurbSplineUtils revitNurbSplineUtils - ) + public HerminteSplitToSpeckleConverter(ITypedConverter splineConverter) { _splineConverter = splineConverter; - _revitNurbSplineUtils = revitNurbSplineUtils; } - public SOG.Curve Convert(IRevitHermiteSpline target) + public SOG.Curve Convert(DB.HermiteSpline target) { - var nurbs = _revitNurbSplineUtils.Create(target); + var nurbs = DB.NurbSpline.Create(target); return _splineConverter.Convert(nurbs); } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/LineConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/LineConversionToSpeckle.cs index ceddef39b0..2405cf0b22 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/LineConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/LineConversionToSpeckle.cs @@ -1,21 +1,20 @@ -using Objects.Primitive; -using Speckle.Converters.Common; +using Objects.Primitive; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class LineConversionToSpeckle : ITypedConverter +public class LineConversionToSpeckle : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly IScalingServiceToSpeckle _scalingService; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ScalingServiceToSpeckle _scalingService; public LineConversionToSpeckle( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - IScalingServiceToSpeckle scalingService + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ScalingServiceToSpeckle scalingService ) { _contextStack = contextStack; @@ -23,7 +22,7 @@ IScalingServiceToSpeckle scalingService _scalingService = scalingService; } - public SOG.Line Convert(IRevitLine target) => + public SOG.Line Convert(DB.Line target) => new() { units = _contextStack.Current.SpeckleUnits, diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs index 22d806277a..29b0bd9f98 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs @@ -1,21 +1,20 @@ using Objects.Other; -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; public class MeshByMaterialDictionaryToSpeckle - : ITypedConverter>, List> + : ITypedConverter>, List> { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly ITypedConverter _materialConverter; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _materialConverter; public MeshByMaterialDictionaryToSpeckle( - ITypedConverter materialConverter, - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter + ITypedConverter materialConverter, + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter ) { _materialConverter = materialConverter; @@ -26,24 +25,24 @@ public MeshByMaterialDictionaryToSpeckle( /// /// Converts a dictionary of Revit meshes, where key is MaterialId, into a list of Speckle meshes. /// - /// A dictionary with IRevitElementId keys and List of IRevitMesh values. + /// A dictionary with DB.ElementId keys and List of DB.Mesh values. /// /// Returns a list of objects where each mesh represents one unique material in the input dictionary. /// /// /// Be aware that this method internally creates a new instance of for each unique material in the input dictionary. /// These meshes are created with an initial capacity based on the size of the vertex and face arrays to avoid unnecessary resizing. - /// Also note that, for each unique material, the method tries to retrieve the related IRevitMaterial from the current document and convert it. If the conversion is successful, + /// Also note that, for each unique material, the method tries to retrieve the related DB.Material from the current document and convert it. If the conversion is successful, /// the material is added to the corresponding Speckle mesh. If the conversion fails, the operation simply continues without the material. /// - public List Convert(Dictionary> target) + public List Convert(Dictionary> target) { var result = new List(target.Keys.Count); foreach (var meshData in target) { - IRevitElementId materialId = meshData.Key; - List meshes = meshData.Value; + DB.ElementId materialId = meshData.Key; + List meshes = meshData.Value; // We compute the final size of the arrays to prevent unnecessary resizing. (int verticesSize, int facesSize) = GetVertexAndFaceListSize(meshes); @@ -56,7 +55,7 @@ public MeshByMaterialDictionaryToSpeckle( ); var doc = _contextStack.Current.Document; - if (doc.GetElement(materialId) is IRevitMaterial material) + if (doc.GetElement(materialId) is DB.Material material) { speckleMesh["renderMaterial"] = _materialConverter.Convert(material); } @@ -73,7 +72,7 @@ public MeshByMaterialDictionaryToSpeckle( return result; } - private void AppendToSpeckleMesh(IRevitMesh mesh, SOG.Mesh speckleMesh) + private void AppendToSpeckleMesh(DB.Mesh mesh, SOG.Mesh speckleMesh) { int faceIndexOffset = speckleMesh.vertices.Count / 3; @@ -87,16 +86,16 @@ private void AppendToSpeckleMesh(IRevitMesh mesh, SOG.Mesh speckleMesh) for (int i = 0; i < mesh.NumTriangles; i++) { - var triangle = mesh.GetTriangle(i); + var triangle = mesh.get_Triangle(i); speckleMesh.faces.Add(3); // TRIANGLE flag - speckleMesh.faces.Add((int)triangle.GetIndex(0) + faceIndexOffset); - speckleMesh.faces.Add((int)triangle.GetIndex(1) + faceIndexOffset); - speckleMesh.faces.Add((int)triangle.GetIndex(2) + faceIndexOffset); + speckleMesh.faces.Add((int)triangle.get_Index(0) + faceIndexOffset); + speckleMesh.faces.Add((int)triangle.get_Index(1) + faceIndexOffset); + speckleMesh.faces.Add((int)triangle.get_Index(2) + faceIndexOffset); } } - private static (int vertexCount, int) GetVertexAndFaceListSize(List meshes) + private static (int vertexCount, int) GetVertexAndFaceListSize(List meshes) { int numberOfVertices = 0; int numberOfFaces = 0; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshConversionToSpeckle.cs index 093d553cf2..2f6c494ba0 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/MeshConversionToSpeckle.cs @@ -1,20 +1,19 @@ using Objects.Other; -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class MeshConversionToSpeckle : ITypedConverter +public class MeshConversionToSpeckle : ITypedConverter { - private readonly ITypedConverter _xyzToPointConverter; - private readonly ITypedConverter _materialConverter; - private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _materialConverter; + private readonly IRevitConversionContextStack _contextStack; public MeshConversionToSpeckle( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - ITypedConverter materialConverter + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ITypedConverter materialConverter ) { _contextStack = contextStack; @@ -22,17 +21,15 @@ ITypedConverter materialConverter _materialConverter = materialConverter; } - public SOG.Mesh Convert(IRevitMesh target) + public SOG.Mesh Convert(DB.Mesh target) { var doc = _contextStack.Current.Document; List vertices = GetSpeckleMeshVertexData(target); List faces = GetSpeckleMeshFaceData(target); - var element = doc.GetElement(target.MaterialElementId); - var revitMaterial = element?.ToMaterial(); RenderMaterial? speckleMaterial = null; - if (revitMaterial is not null) + if (doc.GetElement(target.MaterialElementId) is DB.Material revitMaterial) { speckleMaterial = _materialConverter.Convert(revitMaterial); } @@ -43,7 +40,7 @@ public SOG.Mesh Convert(IRevitMesh target) }; } - private List GetSpeckleMeshVertexData(IRevitMesh target) + private List GetSpeckleMeshVertexData(DB.Mesh target) { var vertices = new List(target.Vertices.Count * 3); @@ -55,12 +52,12 @@ private List GetSpeckleMeshVertexData(IRevitMesh target) return vertices; } - private List GetSpeckleMeshFaceData(IRevitMesh target) + private List GetSpeckleMeshFaceData(DB.Mesh target) { var faces = new List(target.NumTriangles * 4); for (int i = 0; i < target.NumTriangles; i++) { - var triangle = target.GetTriangle(i); + var triangle = target.get_Triangle(i); faces.AddRange(GetMeshTriangleData(triangle)); } @@ -76,12 +73,12 @@ private List GetSpeckleMeshFaceData(IRevitMesh target) /// Output format is a 4 item list with format [3, v1, v2, v3]; where the first item is the triangle flag (for speckle) /// and the 3 following numbers are the indices of each vertex in the vertex list. /// - private IReadOnlyList GetMeshTriangleData(IRevitMeshTriangle triangle) => + private IReadOnlyList GetMeshTriangleData(DB.MeshTriangle triangle) => new[] { 3, // The TRIANGLE flag in speckle - (int)triangle.GetIndex(0), - (int)triangle.GetIndex(1), - (int)triangle.GetIndex(2) + (int)triangle.get_Index(0), + (int)triangle.get_Index(1), + (int)triangle.get_Index(2) }; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/NurbsSplineToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/NurbsSplineToSpeckleConverter.cs index c646f9e6b4..7229f639e3 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/NurbsSplineToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/NurbsSplineToSpeckleConverter.cs @@ -1,23 +1,22 @@ -using Objects.Primitive; -using Speckle.Converters.Common; +using Objects.Primitive; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class NurbsSplineToSpeckleConverter : ITypedConverter +public class NurbsSplineToSpeckleConverter : ITypedConverter { private readonly IRevitVersionConversionHelper _conversionHelper; - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly IScalingServiceToSpeckle _scalingService; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ScalingServiceToSpeckle _scalingService; public NurbsSplineToSpeckleConverter( IRevitVersionConversionHelper conversionHelper, - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - IScalingServiceToSpeckle scalingService + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ScalingServiceToSpeckle scalingService ) { _conversionHelper = conversionHelper; @@ -26,7 +25,7 @@ IScalingServiceToSpeckle scalingService _scalingService = scalingService; } - public SOG.Curve Convert(IRevitNurbSpline target) + public SOG.Curve Convert(DB.NurbSpline target) { var units = _contextStack.Current.SpeckleUnits; @@ -41,12 +40,12 @@ public SOG.Curve Convert(IRevitNurbSpline target) return new SOG.Curve() { - weights = target.Weights.ToList(), + weights = target.Weights.Cast().ToList(), points = points, - knots = target.Knots.ToList(), + knots = target.Knots.Cast().ToList(), degree = target.Degree, //speckleCurve.periodic = revitCurve.Period; // POC: already commented out, remove? - rational = target.IsRational, + rational = target.isRational, closed = _conversionHelper.IsCurveClosed(target), units = units, domain = new Interval(target.GetEndParameter(0), target.GetEndParameter(1)), diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PlaneToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PlaneToSpeckleConverter.cs index 56f098ceda..27cef7bab6 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PlaneToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PlaneToSpeckleConverter.cs @@ -1,19 +1,18 @@ -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class PlaneToSpeckleConverter : ITypedConverter +public class PlaneToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly ITypedConverter _xyzToVectorConverter; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _xyzToVectorConverter; public PlaneToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - ITypedConverter xyzToVectorConverter + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ITypedConverter xyzToVectorConverter ) { _contextStack = contextStack; @@ -21,7 +20,7 @@ public PlaneToSpeckleConverter( _xyzToVectorConverter = xyzToVectorConverter; } - public SOG.Plane Convert(IRevitPlane target) + public SOG.Plane Convert(DB.Plane target) { var origin = _xyzToPointConverter.Convert(target.Origin); var normal = _xyzToVectorConverter.Convert(target.Normal); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointCloudToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointCloudToSpeckleConverter.cs index c552e7dbdf..ab86301cd2 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointCloudToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointCloudToSpeckleConverter.cs @@ -1,52 +1,39 @@ -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class PointCloudToSpeckleConverter : ITypedConverter +public class PointCloudToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; - private readonly ITypedConverter _boundingBoxConverter; - private readonly IRevitPlaneUtils _revitPlaneUtils; - private readonly IRevitXYZUtils _revitxyzUtils; - private readonly IRevitFilterFactory _revitFilterFactory; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _boundingBoxConverter; public PointCloudToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter, - ITypedConverter boundingBoxConverter, - IRevitPlaneUtils revitPlaneUtils, - IRevitXYZUtils revitxyzUtils, - IRevitFilterFactory revitFilterFactory + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter, + ITypedConverter boundingBoxConverter ) { _contextStack = contextStack; _xyzToPointConverter = xyzToPointConverter; _boundingBoxConverter = boundingBoxConverter; - _revitPlaneUtils = revitPlaneUtils; - _revitxyzUtils = revitxyzUtils; - _revitFilterFactory = revitFilterFactory; } - public SOG.Pointcloud Convert(IRevitPointCloudInstance target) + public SOG.Pointcloud Convert(DB.PointCloudInstance target) { - var boundingBox = target.GetBoundingBox(); - using IRevitTransform transform = target.GetTransform(); + var boundingBox = target.get_BoundingBox(null); + using DB.Transform transform = target.GetTransform(); { - var minPlane = _revitPlaneUtils.CreateByNormalAndOrigin( - _revitxyzUtils.BasisZ, - transform.OfPoint(boundingBox.NotNull().Min) - ); - var filter = _revitFilterFactory.CreateMultiPlaneFilter(minPlane); + var minPlane = DB.Plane.CreateByNormalAndOrigin(DB.XYZ.BasisZ, transform.OfPoint(boundingBox.Min)); + var filter = DB.PointClouds.PointCloudFilterFactory.CreateMultiPlaneFilter(new List() { minPlane }); var points = target.GetPoints(filter, 0.0001, 999999); // max limit is 1 mil but 1000000 throws error // POC: complaining about nullability var specklePointCloud = new SOG.Pointcloud { points = points - .Select(o => _xyzToPointConverter.Convert(transform.OfPoint(o.ToXYZ()))) + .Select(o => _xyzToPointConverter.Convert(transform.OfPoint(o))) .SelectMany(o => new List() { o.x, o.y, o.z }) .ToList(), colors = points.Select(o => o.Color).ToList(), diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointConversionToSpeckle.cs index 4da12eafca..8f6ca703db 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PointConversionToSpeckle.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.Common.Objects; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class PointConversionToSpeckle : ITypedConverter +public class PointConversionToSpeckle : ITypedConverter { - private readonly ITypedConverter _xyzToPointConverter; + private readonly ITypedConverter _xyzToPointConverter; - public PointConversionToSpeckle(ITypedConverter xyzToPointConverter) + public PointConversionToSpeckle(ITypedConverter xyzToPointConverter) { _xyzToPointConverter = xyzToPointConverter; } - public SOG.Point Convert(IRevitPoint target) => _xyzToPointConverter.Convert(target.Coord); + public SOG.Point Convert(DB.Point target) => _xyzToPointConverter.Convert(target.Coord); } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PolylineToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PolylineToSpeckleConverter.cs index e64b28309b..5efb22e278 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PolylineToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/PolylineToSpeckleConverter.cs @@ -1,24 +1,23 @@ -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class PolylineToSpeckleConverter : ITypedConverter +public class PolylineToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _xyzToPointConverter; + private readonly IRevitConversionContextStack _contextStack; + private readonly ITypedConverter _xyzToPointConverter; public PolylineToSpeckleConverter( - IConversionContextStack contextStack, - ITypedConverter xyzToPointConverter + IRevitConversionContextStack contextStack, + ITypedConverter xyzToPointConverter ) { _contextStack = contextStack; _xyzToPointConverter = xyzToPointConverter; } - public SOG.Polyline Convert(IRevitPolyLine target) + public SOG.Polyline Convert(DB.PolyLine target) { var coords = target.GetCoordinates().SelectMany(coord => _xyzToPointConverter.Convert(coord).ToList()).ToList(); return new SOG.Polyline(coords, _contextStack.Current.SpeckleUnits); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/SolidConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/SolidConversionToSpeckle.cs index 039c706869..e848d3a843 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/SolidConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/SolidConversionToSpeckle.cs @@ -1,53 +1,53 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; /// /// Solid conversion is a one->many. For each material used in the solid, a mesh will be returned to reduce the amount of instances created. /// -public class SolidConversionToSpeckle : ITypedConverter> +public class SolidConversionToSpeckle : IRawConversion> { - private readonly ITypedConverter< - Dictionary>, - List - > _meshByMaterialConverter; + private readonly RevitConversionContextStack _contextStack; + private readonly IRawConversion>, List> _meshByMaterialConverter; public SolidConversionToSpeckle( - ITypedConverter>, List> meshByMaterialConverter + RevitConversionContextStack contextStack, + IRawConversion>, List> meshByMaterialConverter ) { + _contextStack = contextStack; _meshByMaterialConverter = meshByMaterialConverter; } /// - /// Converts the input object into a list of . + /// Converts the input object into a list of . /// - /// The input object to be converted. + /// The input object to be converted. /// - /// A list of objects that represent the input object. Each mesh in the list corresponds to a different material in the original solid. + /// A list of objects that represent the input object. Each mesh in the list corresponds to a different material in the original solid. /// /// /// This conversion process first triangulates the input solid by material, and then converts the result to raw meshes individually. /// Be aware that this operation might be computationally intensive for complex solids, due to the need for triangulation. /// - public List Convert(IRevitSolid target) + public List RawConvert(DB.Solid target) { var meshesByMaterial = GetTriangulatedMeshesFromSolidByMaterial(target); - return _meshByMaterialConverter.Convert(meshesByMaterial); + return _meshByMaterialConverter.RawConvert(meshesByMaterial); } - private Dictionary> GetTriangulatedMeshesFromSolidByMaterial(IRevitSolid solid) + private Dictionary> GetTriangulatedMeshesFromSolidByMaterial(DB.Solid solid) { - var result = new Dictionary>(); - foreach (IRevitFace face in solid.Faces) + var result = new Dictionary>(); + foreach (DB.Face face in solid.Faces) { - if (!result.TryGetValue(face.MaterialElementId, out var mat)) + if (!result.ContainsKey(face.MaterialElementId)) { - mat = new List(); - result[face.MaterialElementId] = mat; + result[face.MaterialElementId] = new List(); } - mat.Add(face.Triangulate()); + + result[face.MaterialElementId].Add(face.Triangulate()); } return result; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/VectorToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/VectorToSpeckleConverter.cs index ad04f5d8db..e97cf962f4 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/VectorToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/VectorToSpeckleConverter.cs @@ -1,28 +1,27 @@ -using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -public class VectorToSpeckleConverter : ITypedConverter +public class VectorToSpeckleConverter : ITypedConverter { private readonly IReferencePointConverter _referencePointConverter; - private readonly IScalingServiceToSpeckle _scalingService; + private readonly ScalingServiceToSpeckle _scalingService; public VectorToSpeckleConverter( IReferencePointConverter referencePointConverter, - IScalingServiceToSpeckle scalingService + ScalingServiceToSpeckle scalingService ) { _referencePointConverter = referencePointConverter; _scalingService = scalingService; } - public SOG.Vector Convert(IRevitXYZ target) + public SOG.Vector Convert(DB.XYZ target) { // POC: originally had a concept of not transforming, but this was // optional arg defaulting to false - removing the argument appeared to break nothing - var extPt = _referencePointConverter.ConvertToExternalCoordindates(target, false); + DB.XYZ extPt = _referencePointConverter.ConvertToExternalCoordindates(target, false); var pointToSpeckle = new SOG.Vector( _scalingService.ScaleLength(extPt.X), _scalingService.ScaleLength(extPt.Y), diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/XyzConversionToPoint.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/XyzConversionToPoint.cs index 4f5996e1e5..bf250d06c3 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/XyzConversionToPoint.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/Geometry/XyzConversionToPoint.cs @@ -1,26 +1,24 @@ -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; -#pragma warning disable IDE0130 namespace Speckle.Converters.RevitShared.ToSpeckle; -public class XyzConversionToPoint : ITypedConverter +public class XyzConversionToPoint : ITypedConverter { - private readonly IScalingServiceToSpeckle _toSpeckleScalingService; - private readonly IConversionContextStack _contextStack; + private readonly ScalingServiceToSpeckle _toSpeckleScalingService; + private readonly IRevitConversionContextStack _contextStack; public XyzConversionToPoint( - IScalingServiceToSpeckle toSpeckleScalingService, - IConversionContextStack contextStack + ScalingServiceToSpeckle toSpeckleScalingService, + IRevitConversionContextStack contextStack ) { _toSpeckleScalingService = toSpeckleScalingService; _contextStack = contextStack; } - public SOG.Point Convert(IRevitXYZ target) + public SOG.Point Convert(DB.XYZ target) { var pointToSpeckle = new SOG.Point( _toSpeckleScalingService.ScaleLength(target.X), diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LevelConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LevelConversionToSpeckle.cs index bea059ceaa..33e1d7fea2 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LevelConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LevelConversionToSpeckle.cs @@ -1,19 +1,18 @@ -using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; -public class LevelConversionToSpeckle : ITypedConverter +public class LevelConversionToSpeckle : ITypedConverter { - private readonly IScalingServiceToSpeckle _scalingService; + private readonly ScalingServiceToSpeckle _scalingService; - public LevelConversionToSpeckle(IScalingServiceToSpeckle scalingService) + public LevelConversionToSpeckle(ScalingServiceToSpeckle scalingService) { _scalingService = scalingService; } - public SOBR.RevitLevel Convert(IRevitLevel target) + public SOBR.RevitLevel Convert(DB.Level target) { SOBR.RevitLevel level = new() diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LocationConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LocationConversionToSpeckle.cs index ac47cb38cf..29d3378103 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LocationConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/LocationConversionToSpeckle.cs @@ -1,43 +1,34 @@ -using Objects; -using Speckle.Converters.Common; +using Objects; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; -#pragma warning disable IDE0130 -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; -#pragma warning restore IDE0130 - -public class LocationConversionToSpeckle : ITypedConverter +public class LocationConversionToSpeckle : ITypedConverter { - private readonly ITypedConverter _curveConverter; - private readonly ITypedConverter _xyzConverter; + private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _xyzConverter; // POC: review IRawConversion which always returns a Base, this is ToSpeckle, so... this breaks // the meaning of IRawConversion, it could be IToSpeckleRawConversion // also a factory type public LocationConversionToSpeckle( - ITypedConverter curveConverter, - ITypedConverter xyzConverter + ITypedConverter curveConverter, + ITypedConverter xyzConverter ) { _curveConverter = curveConverter; _xyzConverter = xyzConverter; } - public Base Convert(IRevitLocation target) + public Base Convert(DB.Location target) { - var curve = target.ToLocationCurve(); - if (curve is not null) - { - return (_curveConverter.Convert(curve.Curve) as Base).NotNull(); // POC: ICurve and Base are not related but we know they must be, had to soft cast and then !. - } - var point = target.ToLocationPoint(); - if (point is not null) + return target switch { - return _xyzConverter.Convert(point.Point); - } - throw new SpeckleConversionException($"Unexpected location type {target.GetType()}"); + DB.LocationCurve curve => (_curveConverter.Convert(curve.Curve) as Base)!, // POC: ICurve and Base are not related but we know they must be, had to soft cast and then !. + DB.LocationPoint point => _xyzConverter.Convert(point.Point), + _ => throw new SpeckleConversionException($"Unexpected location type {target.GetType()}") + }; } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/MaterialConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/MaterialConversionToSpeckle.cs index 50062f88fd..f7f48974f7 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/MaterialConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/MaterialConversionToSpeckle.cs @@ -1,12 +1,11 @@ using Objects.Other; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; -public class MaterialConversionToSpeckle : ITypedConverter +public class MaterialConversionToSpeckle : ITypedConverter { - public RenderMaterial Convert(IRevitMaterial target) => + public RenderMaterial Convert(DB.Material target) => // POC: not sure we should be pulling in System.Drawing - // maybe this isn't a problem as it's part of the netstandard Fwk // ideally we'd have serialiser of our own colour class, i.e. to serialise to an uint diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayConverterToSpeckle.cs deleted file mode 100644 index 111e12a42b..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayConverterToSpeckle.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Objects.Geometry; -using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; -#pragma warning disable IDE0130 -namespace Speckle.Converters.RevitShared; - -internal sealed class ModelCurveArrArrayConverterToSpeckle : ITypedConverter -{ - private readonly ITypedConverter _modelCurveArrayConverter; - - public ModelCurveArrArrayConverterToSpeckle( - ITypedConverter modelCurveArrayConverter - ) - { - _modelCurveArrayConverter = modelCurveArrayConverter; - } - - public Objects.Geometry.Polycurve[] Convert(IRevitModelCurveArrArray target) - { - var polycurves = new Objects.Geometry.Polycurve[target.Count]; - var revitArrays = target.ToArray(); - - for (int i = 0; i < polycurves.Length; i++) - { - polycurves[i] = _modelCurveArrayConverter.Convert(revitArrays[i]); - } - - return polycurves; - } -} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayToSpeckleConverter.cs new file mode 100644 index 0000000000..d294360b2d --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrArrayToSpeckleConverter.cs @@ -0,0 +1,28 @@ +using Autodesk.Revit.DB; +using Objects.Geometry; +using Speckle.Converters.Common.Objects; + +namespace Speckle.Converters.RevitShared.Raw; + +internal sealed class ModelCurveArrArrayConverterToSpeckle : ITypedConverter +{ + private readonly ITypedConverter _modelCurveArrayConverter; + + public ModelCurveArrArrayConverterToSpeckle(ITypedConverter modelCurveArrayConverter) + { + _modelCurveArrayConverter = modelCurveArrayConverter; + } + + public SOG.Polycurve[] Convert(ModelCurveArrArray target) + { + var polycurves = new Polycurve[target.Size]; + var revitArrays = target.Cast().ToArray(); + + for (int i = 0; i < polycurves.Length; i++) + { + polycurves[i] = _modelCurveArrayConverter.Convert(revitArrays[i]); + } + + return polycurves; + } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrayToSpeckleConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrayToSpeckleConverter.cs index ce1690ee5d..5bfd4d11bb 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrayToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ModelCurveArrayToSpeckleConverter.cs @@ -1,21 +1,21 @@ -using Objects; +using Objects; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; -using Speckle.Revit.Interfaces; -#pragma warning disable IDE0130 -namespace Speckle.Converters.RevitShared; -public sealed class ModelCurveArrayToSpeckleConverter : ITypedConverter +namespace Speckle.Converters.RevitShared.Raw; + +internal sealed class ModelCurveArrayToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly IScalingServiceToSpeckle _scalingService; - private readonly ITypedConverter _curveConverter; + private readonly IRevitConversionContextStack _contextStack; + private readonly ScalingServiceToSpeckle _scalingService; + private readonly ITypedConverter _curveConverter; public ModelCurveArrayToSpeckleConverter( - IConversionContextStack contextStack, - IScalingServiceToSpeckle scalingService, - ITypedConverter curveConverter + IRevitConversionContextStack contextStack, + ScalingServiceToSpeckle scalingService, + ITypedConverter curveConverter ) { _contextStack = contextStack; @@ -23,12 +23,10 @@ ITypedConverter curveConverter _curveConverter = curveConverter; } - public SOG.Polycurve Convert(IRevitModelCurveArray target) => Convert((IReadOnlyList)target); - - public SOG.Polycurve Convert(IReadOnlyList target) + public SOG.Polycurve Convert(DB.ModelCurveArray target) { SOG.Polycurve polycurve = new(); - var curves = target.Select(mc => mc.GeometryCurve).ToArray(); + var curves = target.Cast().Select(mc => mc.GeometryCurve).ToArray(); if (curves.Length == 0) { @@ -38,7 +36,7 @@ public SOG.Polycurve Convert(IReadOnlyList target) var start = curves[0].GetEndPoint(0); var end = curves[^1].GetEndPoint(1); polycurve.units = _contextStack.Current.SpeckleUnits; - polycurve.closed = start.DistanceTo(end) < RevitConstants.TOLERANCE; + polycurve.closed = start.DistanceTo(end) < RevitConversionContextStack.TOLERANCE; polycurve.length = _scalingService.ScaleLength(curves.Sum(x => x.Length)); polycurve.segments.AddRange(curves.Select(x => _curveConverter.Convert(x))); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ParameterConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ParameterConversionToSpeckle.cs index ae2a9ec5c5..a0b1f01da5 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ParameterConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/ParameterConversionToSpeckle.cs @@ -1,35 +1,30 @@ -using Speckle.Converters.Common.Objects; +using Autodesk.Revit.DB; +using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Extensions; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared; +namespace Speckle.Converters.RevitShared.ToSpeckle; -public class ParameterConversionToSpeckle : ITypedConverter +public class ParameterConversionToSpeckle : ITypedConverter { - private readonly IParameterValueExtractor _valueExtractor; - private readonly IRevitFormatOptionsUtils _revitFormatOptionsUtils; + private readonly ParameterValueExtractor _valueExtractor; - public ParameterConversionToSpeckle( - IParameterValueExtractor valueExtractor, - IRevitFormatOptionsUtils revitFormatOptionsUtils - ) + public ParameterConversionToSpeckle(ParameterValueExtractor valueExtractor) { _valueExtractor = valueExtractor; - _revitFormatOptionsUtils = revitFormatOptionsUtils; } - public SOBR.Parameter Convert(IRevitParameter target) + public SOBR.Parameter Convert(Parameter target) { string internalName = target.GetInternalName(); - IRevitForgeTypeId? unitTypeId = null; - if (target.StorageType is RevitStorageType.Double) + ForgeTypeId? unitTypeId = null; + if (target.StorageType is StorageType.Double) { // according to the api documentation, this method will throw if the storage type is not a VALUE type // however, I've found that it will still throw if StorageType == StorageType.Integer unitTypeId = target.GetUnitTypeId(); } - IRevitDefinition definition = target.Definition; + Definition definition = target.Definition; return new SOBR.Parameter() { @@ -38,7 +33,7 @@ public SOBR.Parameter Convert(IRevitParameter target) isShared = target.IsShared, isReadOnly = target.IsReadOnly, name = definition.Name, - units = unitTypeId?.GetSymbol(_revitFormatOptionsUtils) ?? "None", + units = unitTypeId?.GetSymbol() ?? "None", value = _valueExtractor.GetValue(target) }; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/RevitVersionConversionHelper.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/RevitVersionConversionHelper.cs deleted file mode 100644 index 7ebcaf9d95..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Raw/RevitVersionConversionHelper.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; - -namespace Speckle.Converters.RevitShared; - -[GenerateAutoInterface] -public class RevitVersionConversionHelper : IRevitVersionConversionHelper -{ - [SuppressMessage("Design", "CA1031:Do not catch general exception types")] - public bool IsCurveClosed(IRevitNurbSpline nurbsSpline) - { - try - { - return nurbsSpline.IsClosed; - } - catch (Exception) - { - // POC: is this actually a good assumption? - return true; - } - } -} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ReferencePointConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs similarity index 51% rename from DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ReferencePointConverter.cs rename to DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs index 4eef722c25..4704184be6 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ReferencePointConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs @@ -1,25 +1,12 @@ using System.Diagnostics.CodeAnalysis; -using Speckle.Converters.Common; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared; -[GenerateAutoInterface] -public class RevitConversionSettings : IRevitConversionSettings -{ - private Dictionary Settings { get; } = new(); - - public bool TryGetSettingString(string key, out string value) => Settings.TryGetValue(key, out value); - - public string this[string key] - { - get => Settings[key]; - set => Settings[key] = value; - } -} - -[GenerateAutoInterface] +// POC: this could perhaps becomes some RevitDocumentService but also... +// This reference point feature needs review. We could do with knowing whether this feature is widely used. +// there's also some bogus disposal happening +// https://spockle.atlassian.net/browse/CNX-9357 public class ReferencePointConverter : IReferencePointConverter { // POC: probably not the best place for this @@ -27,33 +14,21 @@ public class ReferencePointConverter : IReferencePointConverter private const string REFPOINT_PROJECT_BASE = "Project Base"; private const string REFPOINT_SURVEY = "Survey"; - private readonly IRevitConversionSettings _revitSettings; - private readonly IConversionContextStack _contextStack; - private readonly IRevitTransformUtils _transformUtils; - private readonly IRevitFilterFactory _revitFilterFactory; - private readonly IRevitXYZUtils _revitXyzUtils; - - private readonly Dictionary _docTransforms = new(); - - public ReferencePointConverter( - IConversionContextStack contextStack, - IRevitConversionSettings revitSettings, - IRevitFilterFactory revitFilterFactory, - IRevitTransformUtils transformUtils, - IRevitXYZUtils revitXyzUtils - ) + private readonly RevitConversionSettings _revitSettings; + private readonly IRevitConversionContextStack _contextStack; + + private readonly Dictionary _docTransforms = new(); + + public ReferencePointConverter(IRevitConversionContextStack contextStack, RevitConversionSettings revitSettings) { _contextStack = contextStack; _revitSettings = revitSettings; - _revitFilterFactory = revitFilterFactory; - _transformUtils = transformUtils; - _revitXyzUtils = revitXyzUtils; } // POC: the original allowed for the document to be passed in // if required, we would probably need to push the stack with a new document if the // doc can change during the lifeycycle of the conversions. This may need some looking into - public IRevitXYZ ConvertToExternalCoordindates(IRevitXYZ inbound, bool isPoint) + public DB.XYZ ConvertToExternalCoordindates(DB.XYZ inbound, bool isPoint) { var rpt = GetDocReferencePointTransform(_contextStack.Current.Document); return isPoint ? rpt.OfPoint(inbound) : rpt.OfVector(inbound); @@ -61,13 +36,13 @@ public IRevitXYZ ConvertToExternalCoordindates(IRevitXYZ inbound, bool isPoint) // POC: this might be better in some RevitDocumentService // we could probably return that instance instead of the Doc from the context, maybe... - public IRevitTransform GetDocReferencePointTransform(IRevitDocument doc) + public DB.Transform GetDocReferencePointTransform(DB.Document doc) { //linked files are always saved to disc and will have a path name //if the current doc is unsaved it will not, but then it'll be the only one :) var id = doc.PathName; - if (!_docTransforms.TryGetValue(id, out IRevitTransform? transform)) + if (!_docTransforms.TryGetValue(id, out DB.Transform? transform)) { // get from settings var referencePointSetting = _revitSettings.TryGetSettingString("reference-point", out string value) @@ -81,25 +56,25 @@ public IRevitTransform GetDocReferencePointTransform(IRevitDocument doc) } [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope")] - public IRevitTransform GetReferencePointTransform(string referencePointSetting) + public DB.Transform GetReferencePointTransform(string referencePointSetting) { // first get the main doc base points and reference setting transform - var referencePointTransform = _transformUtils.Identity; + var referencePointTransform = DB.Transform.Identity; // POC: bogus disposal below - var points = _revitFilterFactory - .CreateFilteredElementCollector(_contextStack.Current.Document) - .OfClass() + var points = new DB.FilteredElementCollector(_contextStack.Current.Document) + .OfClass(typeof(DB.BasePoint)) + .Cast() .ToList(); - var projectPoint = NotNullExtensions.NotNull(points.FirstOrDefault(o => o.IsShared == false), "No projectPoint"); - var surveyPoint = NotNullExtensions.NotNull(points.FirstOrDefault(o => o.IsShared), "No surveyPoint"); + var projectPoint = points.FirstOrDefault(o => o.IsShared == false); + var surveyPoint = points.FirstOrDefault(o => o.IsShared); // POC: it's not clear what support is needed for this switch (referencePointSetting) { case REFPOINT_PROJECT_BASE: // note that the project base (ui) rotation is registered on the survey pt, not on the base point - referencePointTransform = _transformUtils.CreateTranslation(projectPoint.Position); + referencePointTransform = DB.Transform.CreateTranslation(projectPoint.Position); break; case REFPOINT_SURVEY: @@ -107,12 +82,12 @@ public IRevitTransform GetReferencePointTransform(string referencePointSetting) // retrieve the survey point rotation from the project point // POC: should a null angle resolve to 0? - var angle = projectPoint.GetParameter(RevitBuiltInParameter.BASEPOINT_ANGLETON_PARAM)?.AsDouble() ?? 0; + var angle = projectPoint.get_Parameter(DB.BuiltInParameter.BASEPOINT_ANGLETON_PARAM)?.AsDouble() ?? 0; // POC: following disposed incorrectly or early or maybe a false negative? - referencePointTransform = _transformUtils + referencePointTransform = DB.Transform .CreateTranslation(surveyPoint.Position) - .Multiply(_transformUtils.CreateRotation(_revitXyzUtils.BasisZ, angle)); + .Multiply(DB.Transform.CreateRotation(DB.XYZ.BasisZ, angle)); break; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConstants.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConstants.cs deleted file mode 100644 index 79a6ef167a..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConstants.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Speckle.Converters.RevitShared; - -public static class RevitConstants -{ - public const double TOLERANCE = 0.0164042; // 5mm in ft -} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConversionSettings.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConversionSettings.cs new file mode 100644 index 0000000000..3fb4466120 --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitConversionSettings.cs @@ -0,0 +1,19 @@ +namespace Speckle.Converters.RevitShared; + +// POC: probably NOT the right place, probably needs passing in with the send/rcv operation +// not clear how this should get configured or if we should have it, the shape probably needs to change +// this was dragged in because it (or something like it) is required for reference point conversion. +// have made it a strongly typed thing encapsulating a dictionary so as not to rely on injecting a weak type. +// relates to https://spockle.atlassian.net/browse/CNX-9357 +public class RevitConversionSettings +{ + private Dictionary Settings { get; } = new Dictionary(); + + public bool TryGetSettingString(string key, out string value) => Settings.TryGetValue(key, out value); + + public string this[string key] + { + get => Settings[key]; + set => Settings[key] = value; + } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs new file mode 100644 index 0000000000..78790ee19e --- /dev/null +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs @@ -0,0 +1,50 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Core.Models; +using Speckle.Converters.RevitShared.Helpers; + +namespace Speckle.Converters.RevitShared; + +// POC: maybe possible to restrict the access so this cannot be created directly? +public class RevitRootToHostConverter : IRootToSpeckleConverter +{ + private readonly IConverterResolver _toSpeckle; + private readonly ParameterValueExtractor _parameterValueExtractor; + + public RevitRootToHostConverter( + IConverterResolver toSpeckle, + ParameterValueExtractor parameterValueExtractor + ) + { + _toSpeckle = toSpeckle; + _parameterValueExtractor = parameterValueExtractor; + } + + // POC: our assumption here is target is valid for conversion + // if it cannot be converted then we should throw + public Base Convert(object target) + { + var objectConverter = _toSpeckle.GetConversionForType(target.GetType()); + + if (objectConverter == null) + { + throw new SpeckleConversionException($"No conversion found for {target.GetType().Name}"); + } + + Base result = + objectConverter.Convert(target) + ?? throw new SpeckleConversionException($"Conversion of object with type {target.GetType()} returned null"); + + // POC : where should logic common to most objects go? + // shouldn't target ALWAYS be DB.Element? + if (target is DB.Element element) + { + // POC: is this the right place? + result.applicationId = element.UniqueId; + + _parameterValueExtractor.RemoveUniqueId(element.UniqueId); + } + + return result; + } +} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/RevitToSpeckleUnitConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/RevitToSpeckleUnitConverter.cs index e6de0840fa..e1d7a7a62b 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/RevitToSpeckleUnitConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/RevitToSpeckleUnitConverter.cs @@ -1,30 +1,29 @@ using Speckle.Converters.Common; using Speckle.Core.Kits; using Speckle.Core.Logging; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.Services; -public sealed class RevitToSpeckleUnitConverter : IHostToSpeckleUnitConverter +public sealed class RevitToSpeckleUnitConverter : IHostToSpeckleUnitConverter { - private readonly Dictionary _unitMapping = new(); + private readonly Dictionary _unitMapping = new(); - public RevitToSpeckleUnitConverter(IRevitUnitUtils revitUnitUtils) + public RevitToSpeckleUnitConverter() { - _unitMapping[revitUnitUtils.Millimeters.TypeId] = Units.Millimeters; - _unitMapping[revitUnitUtils.Centimeters.TypeId] = Units.Centimeters; - _unitMapping[revitUnitUtils.Meters.TypeId] = Units.Meters; - _unitMapping[revitUnitUtils.MetersCentimeters.TypeId] = Units.Meters; - _unitMapping[revitUnitUtils.Inches.TypeId] = Units.Inches; - _unitMapping[revitUnitUtils.FractionalInches.TypeId] = Units.Inches; - _unitMapping[revitUnitUtils.Feet.TypeId] = Units.Feet; - _unitMapping[revitUnitUtils.FeetFractionalInches.TypeId] = Units.Feet; + _unitMapping[DB.UnitTypeId.Millimeters] = Units.Millimeters; + _unitMapping[DB.UnitTypeId.Centimeters] = Units.Centimeters; + _unitMapping[DB.UnitTypeId.Meters] = Units.Meters; + _unitMapping[DB.UnitTypeId.MetersCentimeters] = Units.Meters; + _unitMapping[DB.UnitTypeId.Inches] = Units.Inches; + _unitMapping[DB.UnitTypeId.FractionalInches] = Units.Inches; + _unitMapping[DB.UnitTypeId.Feet] = Units.Feet; + _unitMapping[DB.UnitTypeId.FeetFractionalInches] = Units.Feet; } // POC: maybe just convert, it's not a Try method - public string ConvertOrThrow(IRevitForgeTypeId hostUnit) + public string ConvertOrThrow(DB.ForgeTypeId hostUnit) { - if (_unitMapping.TryGetValue(hostUnit.TypeId, out string value)) + if (_unitMapping.TryGetValue(hostUnit, out string value)) { return value; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs index 57ba7be5f2..a0c2779048 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs @@ -1,27 +1,20 @@ -using Speckle.Converters.Common; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; +using Autodesk.Revit.DB; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.Services; // POC: feels like this is a context thing and we should be calculating this occasionally? // needs some thought as to how it could be be done, could leave as is for now -[GenerateAutoInterface] -public sealed class ScalingServiceToSpeckle : IScalingServiceToSpeckle +public sealed class ScalingServiceToSpeckle { private readonly double _defaultLengthConversionFactor; - private readonly IRevitUnitUtils _revitUnitUtils; // POC: this seems like the reverse relationship - public ScalingServiceToSpeckle( - IConversionContextStack contextStack, - IRevitUnitUtils revitUnitUtils - ) + public ScalingServiceToSpeckle(IRevitConversionContextStack contextStack) { - _revitUnitUtils = revitUnitUtils; // POC: this is accurate for the current context stack - var documentUnits = contextStack.Current.Document.GetUnits(); - var formatOptions = documentUnits.GetFormatOptions(_revitUnitUtils.Length); + Units documentUnits = contextStack.Current.Document.GetUnits(); + FormatOptions formatOptions = documentUnits.GetFormatOptions(SpecTypeId.Length); var lengthUnitsTypeId = formatOptions.GetUnitTypeId(); _defaultLengthConversionFactor = ScaleStatic(1, lengthUnitsTypeId); } @@ -33,14 +26,14 @@ IRevitUnitUtils revitUnitUtils public double ScaleLength(double length) => length * _defaultLengthConversionFactor; // POC: not sure about this??? - public double Scale(double value, IRevitForgeTypeId forgeTypeId) + public double Scale(double value, ForgeTypeId forgeTypeId) { return ScaleStatic(value, forgeTypeId); } // POC: not sure why this is needed??? - private double ScaleStatic(double value, IRevitForgeTypeId forgeTypeId) + private static double ScaleStatic(double value, ForgeTypeId forgeTypeId) { - return _revitUnitUtils.ConvertFromInternalUnits(value, forgeTypeId); + return UnitUtils.ConvertFromInternalUnits(value, forgeTypeId); } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems index 575c0093e6..5e5d29480e 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems @@ -9,6 +9,72 @@ Speckle.Converters.RevitShared - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/BaseTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/BaseTopLevelConverterToSpeckle.cs index 0a246e3b2f..f7a94c8d1f 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/BaseTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/BaseTopLevelConverterToSpeckle.cs @@ -1,4 +1,4 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/CeilingTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/CeilingTopLevelConverterToSpeckle.cs index 3dd7ed8cb6..c3de2636aa 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/CeilingTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/CeilingTopLevelConverterToSpeckle.cs @@ -1,31 +1,30 @@ +using Autodesk.Revit.DB; using Objects; using Objects.BuiltElements.Revit; using Objects.Geometry; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(IRevitCeiling), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -internal sealed class CeilingTopLevelConverterToSpeckle - : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.Ceiling), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +internal sealed class CeilingTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter> _curveArrArrayConverter; - private readonly ITypedConverter _levelConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly IDisplayValueExtractor _displayValueExtractor; + private readonly ITypedConverter> _curveArrArrayConverter; + private readonly ITypedConverter _levelConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly ParameterObjectAssigner _parameterObjectAssigner; + private readonly DisplayValueExtractor _displayValueExtractor; //private readonly HostedElementConversionToSpeckle _hostedElementConverter; public CeilingTopLevelConverterToSpeckle( - ITypedConverter> curveArrArrayConverter, - ITypedConverter levelConverter, - IParameterValueExtractor parameterValueExtractor, - IParameterObjectAssigner parameterObjectAssigner, - IDisplayValueExtractor displayValueExtractor + ITypedConverter> curveArrArrayConverter, + ITypedConverter levelConverter, + ParameterValueExtractor parameterValueExtractor, + ParameterObjectAssigner parameterObjectAssigner, + DisplayValueExtractor displayValueExtractor ) { _curveArrArrayConverter = curveArrArrayConverter; @@ -35,14 +34,14 @@ IDisplayValueExtractor displayValueExtractor _displayValueExtractor = displayValueExtractor; } - public override RevitCeiling Convert(IRevitCeiling target) + public override RevitCeiling Convert(DB.Ceiling target) { - var sketch = target.Document.GetElement(target.SketchId).NotNull().ToSketch().NotNull(); + var sketch = (Sketch)target.Document.GetElement(target.SketchId); List profiles = _curveArrArrayConverter.Convert(sketch.Profile); var speckleCeiling = new RevitCeiling(); - var elementType = target.Document.GetElement(target.GetTypeId()).NotNull().ToType().NotNull(); + var elementType = (ElementType)target.Document.GetElement(target.GetTypeId()); speckleCeiling.type = elementType.Name; speckleCeiling.family = elementType.FamilyName; @@ -59,7 +58,7 @@ public override RevitCeiling Convert(IRevitCeiling target) // POC: our existing receive operation is checking the "slopeDirection" prop, // but it is never being set. We should be setting it - var level = _parameterValueExtractor.GetValueAsRevitLevel(target, RevitBuiltInParameter.LEVEL_PARAM); + var level = _parameterValueExtractor.GetValueAsDocumentObject(target, DB.BuiltInParameter.LEVEL_PARAM); speckleCeiling.level = _levelConverter.Convert(level); _parameterObjectAssigner.AssignParametersToBase(target, speckleCeiling); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/DirectShapeTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/DirectShapeTopLevelConverterToSpeckle.cs index 1f87f63696..c9c9ca5e14 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/DirectShapeTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/DirectShapeTopLevelConverterToSpeckle.cs @@ -1,22 +1,22 @@ using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Extensions; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared.ToSpeckle; +namespace Speckle.Converters.Revit2023.ToSpeckle; -[NameAndRankValue(nameof(IRevitDirectShape), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class DirectShapeTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.DirectShape), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class DirectShapeTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly IConversionContextStack _contextStack; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly IDisplayValueExtractor _displayValueExtractor; + private readonly IRevitConversionContextStack _contextStack; + private readonly ParameterObjectAssigner _parameterObjectAssigner; + private readonly DisplayValueExtractor _displayValueExtractor; public DirectShapeTopLevelConverterToSpeckle( - IParameterObjectAssigner parameterObjectAssigner, - IConversionContextStack contextStack, - IDisplayValueExtractor displayValueExtractor + ParameterObjectAssigner parameterObjectAssigner, + IRevitConversionContextStack contextStack, + DisplayValueExtractor displayValueExtractor ) { _parameterObjectAssigner = parameterObjectAssigner; @@ -24,7 +24,7 @@ IDisplayValueExtractor displayValueExtractor _displayValueExtractor = displayValueExtractor; } - public override SOBR.DirectShape Convert(IRevitDirectShape target) + public override SOBR.DirectShape Convert(DB.DirectShape target) { var category = target.Category.GetBuiltInCategory().GetSchemaBuilderCategoryFromBuiltIn(); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ElementTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ElementTopLevelConverterToSpeckle.cs index cbd1cd9e06..c3b96c9001 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ElementTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ElementTopLevelConverterToSpeckle.cs @@ -1,27 +1,25 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; +using Objects.BuiltElements.Revit; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: not currently used? clearly some missing pieces -[NameAndRankValue(nameof(IRevitElement), 0)] -public class ElementTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.Element), 0)] +public class ElementTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly IDisplayValueExtractor _displayValueExtractor; + private readonly DisplayValueExtractor _displayValueExtractor; - public ElementTopLevelConverterToSpeckle(IDisplayValueExtractor displayValueExtractor) + public ElementTopLevelConverterToSpeckle(DisplayValueExtractor displayValueExtractor) { _displayValueExtractor = displayValueExtractor; } - public override SOBR.RevitElement Convert(IRevitElement target) + public override RevitElement Convert(DB.Element target) { - SOBR.RevitElement speckleElement = new(); + RevitElement speckleElement = new(); - var element = target.Document.GetElement(target.GetTypeId()); - var symbol = element?.ToFamilySymbol(); - if (symbol is not null) + if (target.Document.GetElement(target.GetTypeId()) is DB.FamilySymbol symbol) { speckleElement.family = symbol.FamilyName; speckleElement.type = symbol.Name; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ExtrusionRoofToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ExtrusionRoofToSpeckleTopLevelConverter.cs index 8dfeb7907a..d46c93794f 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ExtrusionRoofToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ExtrusionRoofToSpeckleTopLevelConverter.cs @@ -1,34 +1,32 @@ using Objects.BuiltElements.Revit.RevitRoof; -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Extensions; +using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; + +using Speckle.Converters.RevitShared.Extensions; namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(IRevitExtrusionRoof), 0)] +[NameAndRankValue(nameof(DB.ExtrusionRoof), 0)] public class ExtrusionRoofToSpeckleTopLevelConverter - : BaseTopLevelConverterToSpeckle + : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter _levelConverter; - private readonly ITypedConverter _modelCurveArrayConverter; - private readonly ITypedConverter _pointConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IHostedElementConversionToSpeckle _hostedElementConverter; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitFilterFactory _revitFilterFactory; + private readonly ITypedConverter _levelConverter; + private readonly ITypedConverter _modelCurveArrayConverter; + private readonly ITypedConverter _pointConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly HostedElementConversionToSpeckle _hostedElementConverter; + private readonly ParameterObjectAssigner _parameterObjectAssigner; public ExtrusionRoofToSpeckleTopLevelConverter( - ITypedConverter levelConverter, - ITypedConverter modelCurveArrayConverter, - ITypedConverter pointConverter, - IParameterValueExtractor parameterValueExtractor, - IDisplayValueExtractor displayValueExtractor, - IHostedElementConversionToSpeckle hostedElementConverter, - IParameterObjectAssigner parameterObjectAssigner, - IRevitFilterFactory revitFilterFactory + ITypedConverter levelConverter, + ITypedConverter modelCurveArrayConverter, + ITypedConverter pointConverter, + ParameterValueExtractor parameterValueExtractor, + DisplayValueExtractor displayValueExtractor, + HostedElementConversionToSpeckle hostedElementConverter, + ParameterObjectAssigner parameterObjectAssigner ) { _levelConverter = levelConverter; @@ -38,36 +36,35 @@ IRevitFilterFactory revitFilterFactory _displayValueExtractor = displayValueExtractor; _hostedElementConverter = hostedElementConverter; _parameterObjectAssigner = parameterObjectAssigner; - _revitFilterFactory = revitFilterFactory; } - public override RevitExtrusionRoof Convert(IRevitExtrusionRoof target) + public override RevitExtrusionRoof Convert(DB.ExtrusionRoof target) { var speckleExtrusionRoof = new RevitExtrusionRoof { - start = _parameterValueExtractor.GetValueAsDouble(target, RevitBuiltInParameter.EXTRUSION_START_PARAM), - end = _parameterValueExtractor.GetValueAsDouble(target, RevitBuiltInParameter.EXTRUSION_END_PARAM) + start = _parameterValueExtractor.GetValueAsDouble(target, DB.BuiltInParameter.EXTRUSION_START_PARAM), + end = _parameterValueExtractor.GetValueAsDouble(target, DB.BuiltInParameter.EXTRUSION_END_PARAM) }; - var plane = target.GetProfile()[0].SketchPlane.GetPlane(); + var plane = target.GetProfile().get_Item(0).SketchPlane.GetPlane(); speckleExtrusionRoof.referenceLine = new SOG.Line( _pointConverter.Convert(plane.Origin.Add(plane.XVec.Normalize().Negate())), _pointConverter.Convert(plane.Origin) ); - var level = _parameterValueExtractor.GetValueAsRevitLevel( + var level = _parameterValueExtractor.GetValueAsDocumentObject( target, - RevitBuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM + DB.BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM ); speckleExtrusionRoof.level = _levelConverter.Convert(level); speckleExtrusionRoof.outline = _modelCurveArrayConverter.Convert(target.GetProfile()); - var elementType = target.Document.GetElement(target.GetTypeId()).NotNull().ToType().NotNull(); + var elementType = (DB.ElementType)target.Document.GetElement(target.GetTypeId()); speckleExtrusionRoof.type = elementType.Name; speckleExtrusionRoof.family = elementType.FamilyName; _parameterObjectAssigner.AssignParametersToBase(target, speckleExtrusionRoof); speckleExtrusionRoof.displayValue = _displayValueExtractor.GetDisplayValue(target); speckleExtrusionRoof.elements = _hostedElementConverter - .ConvertHostedElements(target.GetHostedElementIds(_revitFilterFactory)) + .ConvertHostedElements(target.GetHostedElementIds()) .ToList(); return speckleExtrusionRoof; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FamilyInstanceTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FamilyInstanceTopLevelConverterToSpeckle.cs index b408d104cc..446dcd4383 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FamilyInstanceTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FamilyInstanceTopLevelConverterToSpeckle.cs @@ -1,26 +1,24 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: bin for now? This is also a parent child relationship and may need a pattern for this // so we don't end up with some god FamilyInstanceTopLevelConverterToSpeckle converter -[NameAndRankValue(nameof(IRevitFamilyInstance), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public sealed class FamilyInstanceTopLevelConverterToSpeckle - : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.FamilyInstance), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public sealed class FamilyInstanceTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter _elementConverter; - private readonly ITypedConverter _beamConversion; - private readonly ITypedConverter _columnConversion; - private readonly ITypedConverter _braceConversion; + private readonly ITypedConverter _elementConverter; + private readonly ITypedConverter _beamConversion; + private readonly ITypedConverter _columnConversion; + private readonly ITypedConverter _braceConversion; public FamilyInstanceTopLevelConverterToSpeckle( - ITypedConverter elementConverter, - ITypedConverter beamConversion, - ITypedConverter columnConversion, - ITypedConverter braceConversion + ITypedConverter elementConverter, + ITypedConverter beamConversion, + ITypedConverter columnConversion, + ITypedConverter braceConversion ) { _elementConverter = elementConverter; @@ -29,13 +27,13 @@ public FamilyInstanceTopLevelConverterToSpeckle( _braceConversion = braceConversion; } - public override Base Convert(IRevitFamilyInstance target) + public override Base Convert(DB.FamilyInstance target) { return target.StructuralType switch { - RevitStructuralType.Beam => _beamConversion.Convert(target), - RevitStructuralType.Column => _columnConversion.Convert(target), - RevitStructuralType.Brace => _braceConversion.Convert(target), + DB.Structure.StructuralType.Beam => _beamConversion.Convert(target), + DB.Structure.StructuralType.Column => _columnConversion.Convert(target), + DB.Structure.StructuralType.Brace => _braceConversion.Convert(target), // POC: return generic element conversion or throw? // diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FloorTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FloorTopLevelConverterToSpeckle.cs index eb292cae5b..13d0d3086f 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FloorTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FloorTopLevelConverterToSpeckle.cs @@ -1,33 +1,32 @@ using Objects; -using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; -namespace Speckle.Converters.RevitShared.ToSpeckle; +namespace Speckle.Converters.Common; // POC: reminder - writing classes and creating interfaces is a bit like organising your space // if you have a structure for organising things, your interfaces, then finding your stuff, your classes & methods, becomes easy // having a lack of interfaces or large interfaces is a bit like lacking structure, when all of your stuff, your classes & methods // clould be anywhere or all in once place - rooting through box 274 for something you need, when said box has a miriad different // and unrelated items, is no fun. Plus when you need that item, you end up bringing out the whole box/ -[NameAndRankValue(nameof(IRevitFloor), 0)] -public class FloorTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.Floor), 0)] +public class FloorTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter> _curveArrArrayConverter; - private readonly ITypedConverter _levelConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly IDisplayValueExtractor _displayValueExtractor; + private readonly ITypedConverter> _curveArrArrayConverter; + private readonly ITypedConverter _levelConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly ParameterObjectAssigner _parameterObjectAssigner; + private readonly DisplayValueExtractor _displayValueExtractor; private readonly ISlopeArrowExtractor _slopeArrowExtractor; public FloorTopLevelConverterToSpeckle( - ITypedConverter> curveArrArrayConverter, - ITypedConverter levelConverter, - IParameterValueExtractor parameterValueExtractor, - IParameterObjectAssigner parameterObjectAssigner, - IDisplayValueExtractor displayValueExtractor, + ITypedConverter> curveArrArrayConverter, + ITypedConverter levelConverter, + ParameterValueExtractor parameterValueExtractor, + ParameterObjectAssigner parameterObjectAssigner, + DisplayValueExtractor displayValueExtractor, ISlopeArrowExtractor slopeArrowExtractor ) { @@ -39,14 +38,14 @@ ISlopeArrowExtractor slopeArrowExtractor _slopeArrowExtractor = slopeArrowExtractor; } - public override SOBR.RevitFloor Convert(IRevitFloor target) + public override SOBR.RevitFloor Convert(DB.Floor target) { SOBR.RevitFloor speckleFloor = new(); - var sketch = target.Document.GetElement(target.SketchId).NotNull().ToSketch().NotNull(); + var sketch = (DB.Sketch)target.Document.GetElement(target.SketchId); List profiles = _curveArrArrayConverter.Convert(sketch.Profile); - IRevitElementType type = target.Document.GetElement(target.GetTypeId()).NotNull().ToType().NotNull(); + DB.ElementType type = (DB.ElementType)target.Document.GetElement(target.GetTypeId()); speckleFloor.family = type.FamilyName; speckleFloor.type = type.Name; @@ -62,13 +61,13 @@ public override SOBR.RevitFloor Convert(IRevitFloor target) speckleFloor.voids = profiles.Skip(1).ToList(); } - var level = _parameterValueExtractor.GetValueAsRevitLevel(target, RevitBuiltInParameter.LEVEL_PARAM); - speckleFloor.level = _levelConverter.Convert(level.NotNull()); + var level = _parameterValueExtractor.GetValueAsDocumentObject(target, DB.BuiltInParameter.LEVEL_PARAM); + speckleFloor.level = _levelConverter.Convert(level); speckleFloor.structural = - _parameterValueExtractor.GetValueAsBool(target, RevitBuiltInParameter.FLOOR_PARAM_IS_STRUCTURAL) ?? false; + _parameterValueExtractor.GetValueAsBool(target, DB.BuiltInParameter.FLOOR_PARAM_IS_STRUCTURAL) ?? false; double? slopeParam = null; - if (_parameterValueExtractor.TryGetValueAsDouble(target, RevitBuiltInParameter.ROOF_SLOPE, out var slope)) + if (_parameterValueExtractor.TryGetValueAsDouble(target, DB.BuiltInParameter.ROOF_SLOPE, out var slope)) { // Divide by 100 to convert from percentage to unitless ratio (rise over run) slopeParam = slope / 100d; @@ -84,10 +83,9 @@ public override SOBR.RevitFloor Convert(IRevitFloor target) return speckleFloor; } - private void TryAssignSlopeFromSlopeArrow(IRevitFloor target, SOBR.RevitFloor speckleFloor, double? slopeParam) + private void TryAssignSlopeFromSlopeArrow(DB.Floor target, SOBR.RevitFloor speckleFloor, double? slopeParam) { - var slopeArrow = _slopeArrowExtractor.GetSlopeArrow(target); - if (slopeArrow is null) + if (_slopeArrowExtractor.GetSlopeArrow(target) is not DB.ModelLine slopeArrow) { return; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FootPrintRoofToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FootPrintRoofToSpeckleTopLevelConverter.cs index 78600db3ff..1c8e74bb04 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FootPrintRoofToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/FootPrintRoofToSpeckleTopLevelConverter.cs @@ -1,33 +1,33 @@ -using Objects; +using Autodesk.Revit.DB; +using Objects; +using Objects.BuiltElements.Revit; using Objects.BuiltElements.Revit.RevitRoof; +using Objects.Geometry; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Extensions; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(IRevitFootPrintRoof), 0)] +[NameAndRankValue(nameof(DB.FootPrintRoof), 0)] public class FootPrintRoofToSpeckleTopLevelConverter - : BaseTopLevelConverterToSpeckle + : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter _levelConverter; - private readonly ITypedConverter _modelCurveArrArrayConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IHostedElementConversionToSpeckle _hostedElementConverter; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitFilterFactory _revitFilterFactory; + private readonly ITypedConverter _levelConverter; + private readonly ITypedConverter _modelCurveArrArrayConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly HostedElementConversionToSpeckle _hostedElementConverter; + private readonly ParameterObjectAssigner _parameterObjectAssigner; public FootPrintRoofToSpeckleTopLevelConverter( - ITypedConverter levelConverter, - ITypedConverter modelCurveArrArrayConverter, - IParameterValueExtractor parameterValueExtractor, - IDisplayValueExtractor displayValueExtractor, - IHostedElementConversionToSpeckle hostedElementConverter, - IParameterObjectAssigner parameterObjectAssigner, - IRevitFilterFactory revitFilterFactory + ITypedConverter levelConverter, + ITypedConverter modelCurveArrArrayConverter, + ParameterValueExtractor parameterValueExtractor, + DisplayValueExtractor displayValueExtractor, + HostedElementConversionToSpeckle hostedElementConverter, + ParameterObjectAssigner parameterObjectAssigner ) { _levelConverter = levelConverter; @@ -36,20 +36,25 @@ IRevitFilterFactory revitFilterFactory _displayValueExtractor = displayValueExtractor; _hostedElementConverter = hostedElementConverter; _parameterObjectAssigner = parameterObjectAssigner; - _revitFilterFactory = revitFilterFactory; } - public override RevitFootprintRoof Convert(IRevitFootPrintRoof target) + public override RevitFootprintRoof Convert(FootPrintRoof target) { - var baseLevel = _parameterValueExtractor.GetValueAsRevitLevel(target, RevitBuiltInParameter.ROOF_BASE_LEVEL_PARAM); + var baseLevel = _parameterValueExtractor.GetValueAsDocumentObject( + target, + DB.BuiltInParameter.ROOF_BASE_LEVEL_PARAM + ); // We don't currently validate the success of this TryGet, it is assumed some Roofs don't have a top-level. - IRevitLevel? topLevel; - _parameterValueExtractor.TryGetValueAsRevitLevel(target, RevitBuiltInParameter.ROOF_UPTO_LEVEL_PARAM, out topLevel); + _parameterValueExtractor.TryGetValueAsDocumentObject( + target, + DB.BuiltInParameter.ROOF_UPTO_LEVEL_PARAM, + out var topLevel + ); //POC: CNX-9403 can be null if the sides have different slopes. //We currently don't validate the success or failure of this TryGet as it's not necessary, but will be once we start the above ticket. - _parameterValueExtractor.TryGetValueAsDouble(target, RevitBuiltInParameter.ROOF_SLOPE, out var slope); + _parameterValueExtractor.TryGetValueAsDouble(target, DB.BuiltInParameter.ROOF_SLOPE, out var slope); RevitFootprintRoof speckleFootprintRoof = new() @@ -67,7 +72,7 @@ public override RevitFootprintRoof Convert(IRevitFootPrintRoof target) speckleFootprintRoof.outline = profiles.FirstOrDefault(); speckleFootprintRoof.voids = profiles.Skip(1).ToList(); - var elementType = target.Document.GetElement(target.GetTypeId()).NotNull().ToType().NotNull(); + var elementType = (ElementType)target.Document.GetElement(target.GetTypeId()); speckleFootprintRoof.type = elementType.Name; speckleFootprintRoof.family = elementType.FamilyName; @@ -76,7 +81,7 @@ public override RevitFootprintRoof Convert(IRevitFootPrintRoof target) _parameterObjectAssigner.AssignParametersToBase(target, speckleFootprintRoof); speckleFootprintRoof.displayValue = _displayValueExtractor.GetDisplayValue(target); speckleFootprintRoof.elements = _hostedElementConverter - .ConvertHostedElements(target.GetHostedElementIds(_revitFilterFactory)) + .ConvertHostedElements(target.GetHostedElementIds()) .ToList(); return speckleFootprintRoof; diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/HostedElementConversionToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/HostedElementConversionToSpeckle.cs index b927329b7e..f9643119e0 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/HostedElementConversionToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/HostedElementConversionToSpeckle.cs @@ -1,7 +1,7 @@ -using Speckle.Converters.Common; +using Autodesk.Revit.DB; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Models; -using Speckle.InterfaceGenerator; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -9,26 +9,22 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; // opportunity to rethink or confirm hosted element handling? Should this be a connector responsibiliy? // No interfacing out however... // CNX-9414 Re-evaluate hosted element conversions -[GenerateAutoInterface] -public class HostedElementConversionToSpeckle : IHostedElementConversionToSpeckle +public class HostedElementConversionToSpeckle { private readonly IRootToSpeckleConverter _converter; - private readonly IConversionContextStack _contextStack; + private readonly IRevitConversionContextStack _contextStack; - public HostedElementConversionToSpeckle( - IRootToSpeckleConverter converter, - IConversionContextStack contextStack - ) + public HostedElementConversionToSpeckle(IRootToSpeckleConverter converter, IRevitConversionContextStack contextStack) { _converter = converter; _contextStack = contextStack; } - public IEnumerable ConvertHostedElements(IEnumerable hostedElementIds) + public IEnumerable ConvertHostedElements(IEnumerable hostedElementIds) { foreach (var elemId in hostedElementIds) { - IRevitElement element = _contextStack.Current.Document.GetElement(elemId).NotNull(); + Element element = _contextStack.Current.Document.GetElement(elemId); Base @base; try diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ModelCurveToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ModelCurveToSpeckleTopLevelConverter.cs index f305468ece..240cbe4713 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ModelCurveToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/ModelCurveToSpeckleTopLevelConverter.cs @@ -1,29 +1,28 @@ -using Objects; +using Objects; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Revit.Interfaces; +using Speckle.Converters.RevitShared.Helpers; namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: ModelCurve looks a bit bogus and we may wish to revise what that is and how it inherits // see https://spockle.atlassian.net/browse/CNX-9381 -[NameAndRankValue(nameof(IRevitModelCurve), 0)] -public class ModelCurveToSpeckleTopLevelConverter - : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.ModelCurve), 0)] +public class ModelCurveToSpeckleTopLevelConverter : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter _curveConverter; - private readonly IConversionContextStack _conversionContext; + private readonly ITypedConverter _curveConverter; + private readonly IRevitConversionContextStack _conversionContext; public ModelCurveToSpeckleTopLevelConverter( - ITypedConverter curveConverter, - IConversionContextStack conversionContext + ITypedConverter curveConverter, + IRevitConversionContextStack conversionContext ) { _curveConverter = curveConverter; _conversionContext = conversionContext; } - public override SOBR.Curve.ModelCurve Convert(IRevitModelCurve target) + public override SOBR.Curve.ModelCurve Convert(DB.ModelCurve target) { var modelCurve = new SOBR.Curve.ModelCurve() { diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoofBaseToSpeckleTopLevelTopLevelConverter.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoofBaseToSpeckleTopLevelTopLevelConverter.cs index 805671c0a7..77f9ce831c 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoofBaseToSpeckleTopLevelTopLevelConverter.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoofBaseToSpeckleTopLevelTopLevelConverter.cs @@ -1,45 +1,40 @@ -using Objects.BuiltElements.Revit.RevitRoof; +using Autodesk.Revit.DB; +using Objects.BuiltElements.Revit.RevitRoof; using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Extensions; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(IRevitRoofBase), 0)] +[NameAndRankValue(nameof(DB.RoofBase), 0)] internal sealed class RoofBaseToSpeckleTopLevelTopLevelConverter - : BaseTopLevelConverterToSpeckle + : BaseTopLevelConverterToSpeckle { - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IHostedElementConversionToSpeckle _hostedElementConverter; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitFilterFactory _revitFilterFactory; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly HostedElementConversionToSpeckle _hostedElementConverter; + private readonly ParameterObjectAssigner _parameterObjectAssigner; public RoofBaseToSpeckleTopLevelTopLevelConverter( - IDisplayValueExtractor displayValueExtractor, - IHostedElementConversionToSpeckle hostedElementConverter, - IParameterObjectAssigner parameterObjectAssigner, - IRevitFilterFactory revitFilterFactory + DisplayValueExtractor displayValueExtractor, + HostedElementConversionToSpeckle hostedElementConverter, + ParameterObjectAssigner parameterObjectAssigner ) { _displayValueExtractor = displayValueExtractor; _hostedElementConverter = hostedElementConverter; _parameterObjectAssigner = parameterObjectAssigner; - _revitFilterFactory = revitFilterFactory; } - public override RevitRoof Convert(IRevitRoofBase target) + public override RevitRoof Convert(RoofBase target) { RevitRoof revitRoof = new(); - var elementType = target.Document.GetElement(target.GetTypeId()).NotNull().ToType().NotNull(); + var elementType = (ElementType)target.Document.GetElement(target.GetTypeId()); revitRoof.type = elementType.Name; revitRoof.family = elementType.FamilyName; _parameterObjectAssigner.AssignParametersToBase(target, revitRoof); revitRoof.displayValue = _displayValueExtractor.GetDisplayValue(target); - revitRoof.elements = _hostedElementConverter - .ConvertHostedElements(target.GetHostedElementIds(_revitFilterFactory)) - .ToList(); + revitRoof.elements = _hostedElementConverter.ConvertHostedElements(target.GetHostedElementIds()).ToList(); return revitRoof; } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoomTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoomTopLevelConverterToSpeckle.cs index 6baaa3d6aa..6e4e1f91cb 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoomTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/RoomTopLevelConverterToSpeckle.cs @@ -3,27 +3,26 @@ using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; using Speckle.Core.Models; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; -[NameAndRankValue(nameof(IRevitRoom), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class RoomTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DBA.Room), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class RoomTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IParameterObjectAssigner _parameterObjectAssigner; - private readonly ITypedConverter _levelConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly ITypedConverter _locationConverter; - private readonly ITypedConverter, SOG.Polycurve> _boundarySegmentConverter; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly ParameterObjectAssigner _parameterObjectAssigner; + private readonly ITypedConverter _levelConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly ITypedConverter _locationConverter; + private readonly ITypedConverter, SOG.Polycurve> _boundarySegmentConverter; public RoomTopLevelConverterToSpeckle( - IDisplayValueExtractor displayValueExtractor, - IParameterObjectAssigner parameterObjectAssigner, - ITypedConverter levelConverter, - IParameterValueExtractor parameterValueExtractor, - ITypedConverter locationConverter, - ITypedConverter, SOG.Polycurve> boundarySegmentConverter + DisplayValueExtractor displayValueExtractor, + ParameterObjectAssigner parameterObjectAssigner, + ITypedConverter levelConverter, + ParameterValueExtractor parameterValueExtractor, + ITypedConverter locationConverter, + ITypedConverter, SOG.Polycurve> boundarySegmentConverter ) { _displayValueExtractor = displayValueExtractor; @@ -34,19 +33,19 @@ public RoomTopLevelConverterToSpeckle( _boundarySegmentConverter = boundarySegmentConverter; } - public override SOBE.Room Convert(IRevitRoom target) + public override SOBE.Room Convert(DBA.Room target) { var number = target.Number; - var name = _parameterValueExtractor.GetValueAsString(target, RevitBuiltInParameter.ROOM_NAME); - var area = _parameterValueExtractor.GetValueAsDouble(target, RevitBuiltInParameter.ROOM_AREA); + var name = _parameterValueExtractor.GetValueAsString(target, DB.BuiltInParameter.ROOM_NAME); + var area = _parameterValueExtractor.GetValueAsDouble(target, DB.BuiltInParameter.ROOM_AREA); var displayValue = _displayValueExtractor.GetDisplayValue(target); var basePoint = (SOG.Point)_locationConverter.Convert(target.Location); var level = _levelConverter.Convert(target.Level); var profiles = target - .GetBoundarySegments() - .Select(c => (ICurve)_boundarySegmentConverter.Convert(c.ToList())) + .GetBoundarySegments(new DB.SpatialElementBoundaryOptions()) + .Select(c => (ICurve)_boundarySegmentConverter.Convert(c)) .ToList(); var outline = profiles.First(); diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopographyTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopographyTopLevelConverterToSpeckle.cs index ce34b66376..eea4ea51c9 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopographyTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopographyTopLevelConverterToSpeckle.cs @@ -1,28 +1,27 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: needs review feels, BIG, feels like it could be broken down.. // i.e. GetParams(), GetGeom()? feels like it's doing too much -[NameAndRankValue(nameof(IRevitTopographySurface), 0)] +[NameAndRankValue(nameof(DBA.TopographySurface), 0)] public class TopographyTopLevelConverterToSpeckle - : BaseTopLevelConverterToSpeckle + : BaseTopLevelConverterToSpeckle { - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IParameterObjectAssigner _parameterObjectAssigner; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly ParameterObjectAssigner _parameterObjectAssigner; public TopographyTopLevelConverterToSpeckle( - IDisplayValueExtractor displayValueExtractor, - IParameterObjectAssigner parameterObjectAssigner + DisplayValueExtractor displayValueExtractor, + ParameterObjectAssigner parameterObjectAssigner ) { _displayValueExtractor = displayValueExtractor; _parameterObjectAssigner = parameterObjectAssigner; } - public override SOBR.RevitTopography Convert(IRevitTopographySurface target) + public override SOBR.RevitTopography Convert(DBA.TopographySurface target) { var speckleTopo = new SOBR.RevitTopography { diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/WallTopLevelConverterToSpeckle.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/WallTopLevelConverterToSpeckle.cs index e9a0dbafc1..8e0cce3ba9 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/WallTopLevelConverterToSpeckle.cs +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/WallTopLevelConverterToSpeckle.cs @@ -6,35 +6,32 @@ using Speckle.Core.Models.Extensions; using Speckle.Converters.RevitShared.Extensions; using Objects.BuiltElements.Revit; -using Speckle.Revit.Interfaces; namespace Speckle.Converters.RevitShared.ToSpeckle; // POC: needs review feels, BIG, feels like it could be broken down.. // i.e. GetParams(), GetGeom()? feels like it's doing too much -[NameAndRankValue(nameof(IRevitWall), 0)] -public class WallTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle +[NameAndRankValue(nameof(DB.Wall), 0)] +public class WallTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly ITypedConverter _curveConverter; - private readonly ITypedConverter _levelConverter; - private readonly ITypedConverter> _curveArrArrayConverter; - private readonly IParameterValueExtractor _parameterValueExtractor; - private readonly IConversionContextStack _contextStack; - private readonly IDisplayValueExtractor _displayValueExtractor; - private readonly IParameterObjectAssigner _parameterObjectAssigner; + private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _levelConverter; + private readonly ITypedConverter> _curveArrArrayConverter; + private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly IRevitConversionContextStack _contextStack; + private readonly DisplayValueExtractor _displayValueExtractor; + private readonly ParameterObjectAssigner _parameterObjectAssigner; private readonly IRootToSpeckleConverter _converter; - private readonly IRevitFilterFactory _revitFilterFactory; public WallTopLevelConverterToSpeckle( - ITypedConverter curveConverter, - ITypedConverter levelConverter, - ITypedConverter> curveArrArrayConverter, - IConversionContextStack contextStack, - IParameterValueExtractor parameterValueExtractor, - IDisplayValueExtractor displayValueExtractor, - IParameterObjectAssigner parameterObjectAssigner, - IRootToSpeckleConverter converter, - IRevitFilterFactory revitFilterFactory + ITypedConverter curveConverter, + ITypedConverter levelConverter, + ITypedConverter> curveArrArrayConverter, + IRevitConversionContextStack contextStack, + ParameterValueExtractor parameterValueExtractor, + DisplayValueExtractor displayValueExtractor, + ParameterObjectAssigner parameterObjectAssigner, + IRootToSpeckleConverter converter ) { _curveConverter = curveConverter; @@ -45,10 +42,9 @@ IRevitFilterFactory revitFilterFactory _displayValueExtractor = displayValueExtractor; _parameterObjectAssigner = parameterObjectAssigner; _converter = converter; - _revitFilterFactory = revitFilterFactory; } - public override SOBR.RevitWall Convert(IRevitWall target) + public override SOBR.RevitWall Convert(DB.Wall target) { SOBR.RevitWall speckleWall = new() { family = target.WallType.FamilyName.ToString(), type = target.WallType.Name }; @@ -61,10 +57,9 @@ public override SOBR.RevitWall Convert(IRevitWall target) return speckleWall; } - private void AssignSpecificParameters(IRevitWall target, RevitWall speckleWall) + private void AssignSpecificParameters(DB.Wall target, RevitWall speckleWall) { - var locationCurve = target.GetLocationAsLocationCurve(); - if (locationCurve is null) + if (target.Location is not DB.LocationCurve locationCurve) { throw new SpeckleConversionException( "Incorrect assumption was made that all Revit Wall location properties would be of type \"LocationCurve\"" @@ -73,41 +68,46 @@ private void AssignSpecificParameters(IRevitWall target, RevitWall speckleWall) speckleWall.baseLine = _curveConverter.Convert(locationCurve.Curve); - var level = _parameterValueExtractor.GetValueAsRevitLevel(target, RevitBuiltInParameter.WALL_BASE_CONSTRAINT); + var level = _parameterValueExtractor.GetValueAsDocumentObject( + target, + DB.BuiltInParameter.WALL_BASE_CONSTRAINT + ); speckleWall.level = _levelConverter.Convert(level); - var topLevel = _parameterValueExtractor.GetValueAsRevitLevel(target, RevitBuiltInParameter.WALL_BASE_CONSTRAINT); + var topLevel = _parameterValueExtractor.GetValueAsDocumentObject( + target, + DB.BuiltInParameter.WALL_BASE_CONSTRAINT + ); speckleWall.topLevel = _levelConverter.Convert(topLevel); // POC : what to do if these parameters are unset (instead of assigning default) _ = _parameterValueExtractor.TryGetValueAsDouble( target, - RevitBuiltInParameter.WALL_USER_HEIGHT_PARAM, + DB.BuiltInParameter.WALL_USER_HEIGHT_PARAM, out double? height ); speckleWall.height = height ?? 0; _ = _parameterValueExtractor.TryGetValueAsDouble( target, - RevitBuiltInParameter.WALL_BASE_OFFSET, + DB.BuiltInParameter.WALL_BASE_OFFSET, out double? baseOffset ); speckleWall.baseOffset = baseOffset ?? 0; _ = _parameterValueExtractor.TryGetValueAsDouble( target, - RevitBuiltInParameter.WALL_TOP_OFFSET, + DB.BuiltInParameter.WALL_TOP_OFFSET, out double? topOffset ); speckleWall.topOffset = topOffset ?? 0; speckleWall.structural = - _parameterValueExtractor.GetValueAsBool(target, RevitBuiltInParameter.WALL_STRUCTURAL_SIGNIFICANT) ?? false; + _parameterValueExtractor.GetValueAsBool(target, DB.BuiltInParameter.WALL_STRUCTURAL_SIGNIFICANT) ?? false; speckleWall.flipped = target.Flipped; } - private List GetChildElements(IRevitWall target) + private List GetChildElements(DB.Wall target) { List wallChildren = new(); - var grid = target.CurtainGrid; - if (grid is not null) + if (target.CurtainGrid is DB.CurtainGrid grid) { wallChildren.AddRange(ConvertElements(grid.GetMullionIds())); wallChildren.AddRange(ConvertElements(grid.GetPanelIds())); @@ -116,19 +116,19 @@ private List GetChildElements(IRevitWall target) { wallChildren.AddRange(ConvertElements(target.GetStackedWallMemberIds())); } - wallChildren.AddRange(ConvertElements(target.GetHostedElementIds(_revitFilterFactory))); + wallChildren.AddRange(ConvertElements(target.GetHostedElementIds())); return wallChildren; } - private IEnumerable ConvertElements(IEnumerable elementIds) + private IEnumerable ConvertElements(IEnumerable elementIds) { - foreach (IRevitElementId elementId in elementIds) + foreach (DB.ElementId elementId in elementIds) { - yield return _converter.Convert(_contextStack.Current.Document.GetElement(elementId).NotNull()); + yield return _converter.Convert(_contextStack.Current.Document.GetElement(elementId)); } } - private void AssignDisplayValue(IRevitWall target, RevitWall speckleWall) + private void AssignDisplayValue(DB.Wall target, RevitWall speckleWall) { if (target.CurtainGrid is null) { @@ -159,9 +159,9 @@ private void AssignHostedElements(SOBR.RevitWall speckleWall, List hostedO } } - private void AssignVoids(IRevitWall target, SOBR.RevitWall speckleWall) + private void AssignVoids(DB.Wall target, SOBR.RevitWall speckleWall) { - IRevitCurveArrArray? profile = target.Document.GetElement(target.SketchId)?.ToSketch()?.Profile; + DB.CurveArrArray? profile = ((DB.Sketch)target.Document.GetElement(target.SketchId))?.Profile; if (profile is null) { return; diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs index 6c315439fe..9117848c90 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs @@ -1,7 +1,7 @@ using Speckle.Autofac.DependencyInjection; using Speckle.Converters.Common; +using Rhino; using Speckle.Converters.Common.DependencyInjection; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.DependencyInjection; @@ -9,9 +9,8 @@ public class RhinoConverterModule : ISpeckleModule { public void Load(SpeckleContainerBuilder builder) { - builder.AddConverterCommon(); + builder.AddConverterCommon(); // single stack per conversion - builder.AddScoped, RhinoConversionContextStack>(); - builder.AddScoped(); + builder.AddScoped, RhinoConversionContextStack>(); } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoRootElementProvider.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoRootElementProvider.cs deleted file mode 100644 index 58a13d8107..0000000000 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoRootElementProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Rhino7.Interfaces; - -namespace Speckle.Converters.Rhino7.DependencyInjection; - -public class RhinoRootElementProvider : IRootElementProvider -{ - public Type GetRootType() => typeof(IRhinoObject); -} diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj index a9a52748e3..78870eeb41 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj @@ -11,6 +11,6 @@ - + diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json index 7e98fae831..a897641f42 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json @@ -18,18 +18,18 @@ "resolved": "1.14.1", "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" }, + "RhinoCommon": { + "type": "Direct", + "requested": "[7.13.21348.13001, )", + "resolved": "7.13.21348.13001", + "contentHash": "JQdaNw61ddBqIe08E9O4N/grwrN1hjDHcYW7tWylwCZyFR7SepoCD4NS+6LN6+oSQhNbhLi9Bf+hQOFYFdRAEA==" + }, "Speckle.InterfaceGenerator": { "type": "Direct", "requested": "[0.9.5, )", "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Speckle.Rhino7.Interfaces": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "TcbfXlRMnQRat1JodgW+YW5FflTYem1GGo9DtKA+6iAuVaYagN5dxsrM5LE6M3pCnEV9rkEQOjFo7sgnnbo4mw==" - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -216,6 +216,11 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, + "Speckle.Revit2023.Interfaces": { + "type": "Transitive", + "resolved": "0.1.1-preview.0.24", + "contentHash": "BSVpOUJc9g6ISrw8GxvtkglTlITpHEDYNOhxv1ZPbckBsI0yO36JiphhQV4q57ERqD9PpCozUJkVhlCaxWeS6A==" + }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -377,8 +382,8 @@ "speckle.converters.rhino7": { "type": "Project", "dependencies": { - "Speckle.Converters.Common": "[2.0.999-local, )", - "Speckle.Rhino7.Interfaces": "[0.1.1-preview.0.28, )" + "RhinoCommon": "[7.13.21348.13001, )", + "Speckle.Converters.Common": "[2.0.999-local, )" } }, "Microsoft.Extensions.Logging.Abstractions": { diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/GlobalUsings.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/GlobalUsings.cs index c88d8e3105..baa44c188e 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/GlobalUsings.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/GlobalUsings.cs @@ -1,2 +1,3 @@ +global using RG = Rhino.Geometry; global using SOG = Objects.Geometry; global using SOP = Objects.Primitive; diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoConversionContextStack.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoConversionContextStack.cs index 799f32b350..79ac2f77a4 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoConversionContextStack.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoConversionContextStack.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; +using Rhino; using Speckle.Converters.Common; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7; @@ -10,11 +10,8 @@ namespace Speckle.Converters.Rhino7; "CA1711:Identifiers should not have incorrect suffix", Justification = "Name ends in Stack but it is in fact a Stack, just not inheriting from `System.Collections.Stack`" )] -public class RhinoConversionContextStack : ConversionContextStack +public class RhinoConversionContextStack : ConversionContextStack { - public RhinoConversionContextStack( - IRhinoDocFactory rhinoDocFactory, - IHostToSpeckleUnitConverter unitConverter - ) - : base(rhinoDocFactory.ActiveDoc(), rhinoDocFactory.ActiveDoc().ModelUnitSystem, unitConverter) { } + public RhinoConversionContextStack(IHostToSpeckleUnitConverter unitConverter) + : base(RhinoDoc.ActiveDoc, RhinoDoc.ActiveDoc.ModelUnitSystem, unitConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoToSpeckleUnitConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoToSpeckleUnitConverter.cs index f7953bc383..4f4f9c77e4 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoToSpeckleUnitConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/RhinoToSpeckleUnitConverter.cs @@ -1,29 +1,29 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Core.Kits; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7; -public class RhinoToSpeckleUnitConverter : IHostToSpeckleUnitConverter +public class RhinoToSpeckleUnitConverter : IHostToSpeckleUnitConverter { - private readonly Dictionary _unitMapping = new(); + private readonly Dictionary _unitMapping = new(); public RhinoToSpeckleUnitConverter() { // POC: CNX-9269 Add unit test to ensure these don't change. - _unitMapping[RhinoUnitSystem.None] = Units.Meters; - _unitMapping[RhinoUnitSystem.Millimeters] = Units.Millimeters; - _unitMapping[RhinoUnitSystem.Centimeters] = Units.Centimeters; - _unitMapping[RhinoUnitSystem.Meters] = Units.Meters; - _unitMapping[RhinoUnitSystem.Kilometers] = Units.Kilometers; - _unitMapping[RhinoUnitSystem.Inches] = Units.Inches; - _unitMapping[RhinoUnitSystem.Feet] = Units.Feet; - _unitMapping[RhinoUnitSystem.Yards] = Units.Yards; - _unitMapping[RhinoUnitSystem.Miles] = Units.Miles; - _unitMapping[RhinoUnitSystem.Unset] = Units.Meters; + _unitMapping[UnitSystem.None] = Units.Meters; + _unitMapping[UnitSystem.Millimeters] = Units.Millimeters; + _unitMapping[UnitSystem.Centimeters] = Units.Centimeters; + _unitMapping[UnitSystem.Meters] = Units.Meters; + _unitMapping[UnitSystem.Kilometers] = Units.Kilometers; + _unitMapping[UnitSystem.Inches] = Units.Inches; + _unitMapping[UnitSystem.Feet] = Units.Feet; + _unitMapping[UnitSystem.Yards] = Units.Yards; + _unitMapping[UnitSystem.Miles] = Units.Miles; + _unitMapping[UnitSystem.Unset] = Units.Meters; } - public string ConvertOrThrow(RhinoUnitSystem hostUnit) + public string ConvertOrThrow(UnitSystem hostUnit) { if (_unitMapping.TryGetValue(hostUnit, out string value)) { diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj index 206a1eecf0..bf1bdbd6de 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj @@ -3,11 +3,12 @@ net48 + - + - + diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/SpeckleToHostGeometryBaseTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/SpeckleToHostGeometryBaseTopLevelConverter.cs index 3d5e09c1a0..75ff2162c2 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/SpeckleToHostGeometryBaseTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/SpeckleToHostGeometryBaseTopLevelConverter.cs @@ -1,28 +1,25 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Kits; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7; public abstract class SpeckleToHostGeometryBaseTopLevelConverter : IToHostTopLevelConverter where TIn : Base - where TOut : IRhinoGeometryBase + where TOut : RG.GeometryBase { - protected IConversionContextStack ContextStack { get; private set; } + protected IConversionContextStack ContextStack { get; private set; } private readonly ITypedConverter _geometryBaseConverter; - private readonly IRhinoTransformFactory _transformFactory; protected SpeckleToHostGeometryBaseTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory transformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) { ContextStack = contextStack; _geometryBaseConverter = geometryBaseConverter; - _transformFactory = transformFactory; } public object Convert(Base target) @@ -38,7 +35,7 @@ public object Convert(Base target) if (castedBase["units"] is string units) { var scaleFactor = Units.GetConversionFactor(units, ContextStack.Current.SpeckleUnits); - var scale = _transformFactory.Scale(_transformFactory.Origin, scaleFactor); + var scale = RG.Transform.Scale(RG.Point3d.Origin, scaleFactor); result.Transform(scale); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/ArcToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/ArcToHostConverter.cs index 63d745dec6..0068c38ef2 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/ArcToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/ArcToHostConverter.cs @@ -1,38 +1,34 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; /// /// Converts a SpeckleArcRaw object to a Rhino.Geometry.Arc object or Rhino.Geometry.ArcCurve object. /// -public class ArcToHostConverter : ITypedConverter, ITypedConverter +public class ArcToHostConverter : ITypedConverter, ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IRhinoArcFactory _rhinoArcFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _intervalConverter; public ArcToHostConverter( - ITypedConverter pointConverter, - ITypedConverter intervalConverter, - IRhinoArcFactory rhinoArcFactory + ITypedConverter pointConverter, + ITypedConverter intervalConverter ) { _pointConverter = pointConverter; this._intervalConverter = intervalConverter; - _rhinoArcFactory = rhinoArcFactory; } /// - /// Converts a object to a object. + /// Converts a object to a object. /// /// The Speckle Arc object to convert. - /// The converted object. + /// The converted object. /// ⚠️ This conversion does NOT perform scaling. ///
⚠️ This method does not preserve the original curve domain
- public IRhinoArc Convert(SOG.Arc target) + public RG.Arc Convert(SOG.Arc target) { - var rhinoArc = _rhinoArcFactory.Create( + var rhinoArc = new RG.Arc( _pointConverter.Convert(target.startPoint), _pointConverter.Convert(target.midPoint), _pointConverter.Convert(target.endPoint) @@ -43,16 +39,16 @@ public IRhinoArc Convert(SOG.Arc target) // POC: CNX-9271 Potential code-smell by directly implementing the interface. We should discuss this further but // since we're using the interfaces instead of the direct type, this may not be an issue. /// - /// Converts a object to a object. + /// Converts a object to a object. /// /// The object to convert. - /// The converted object. + /// The converted object. /// ⚠️ This conversion does NOT perform scaling. - ///
⚠️ Converting to instead of preserves the domain of the curve.
- IRhinoArcCurve ITypedConverter.Convert(SOG.Arc target) + ///
⚠️ Converting to instead of preserves the domain of the curve.
+ RG.ArcCurve ITypedConverter.Convert(SOG.Arc target) { var rhinoArc = Convert(target); - var arcCurve = _rhinoArcFactory.Create(rhinoArc, _intervalConverter.Convert(target.domain)); + var arcCurve = new RG.ArcCurve(rhinoArc) { Domain = _intervalConverter.Convert(target.domain) }; return arcCurve; } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/BrepToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/BrepToHostConverter.cs index c579d736a1..db94e2f7f0 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/BrepToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/BrepToHostConverter.cs @@ -1,26 +1,24 @@ using Objects; +using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class BrepToHostConverter : ITypedConverter +public class BrepToHostConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _curveConverter; - private readonly ITypedConverter _surfaceConverter; - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IRhinoBrepFactory _rhinoBrepFactory; + private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _surfaceConverter; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _intervalConverter; public BrepToHostConverter( - IConversionContextStack contextStack, - ITypedConverter curveConverter, - ITypedConverter surfaceConverter, - ITypedConverter pointConverter, - ITypedConverter intervalConverter, - IRhinoBrepFactory rhinoBrepFactory + IConversionContextStack contextStack, + ITypedConverter curveConverter, + ITypedConverter surfaceConverter, + ITypedConverter pointConverter, + ITypedConverter intervalConverter ) { _contextStack = contextStack; @@ -28,11 +26,10 @@ IRhinoBrepFactory rhinoBrepFactory _surfaceConverter = surfaceConverter; _pointConverter = pointConverter; _intervalConverter = intervalConverter; - _rhinoBrepFactory = rhinoBrepFactory; } /// - /// Converts a Speckle to a Rhino . + /// Converts a Speckle to a Rhino . /// /// /// This method converts a Speckle Brep object to its equivalent Rhino Brep representation. @@ -43,11 +40,11 @@ IRhinoBrepFactory rhinoBrepFactory /// The Speckle Brep object to be converted. /// The equivalent Rhino Brep object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoBrep Convert(SOG.Brep target) + public RG.Brep Convert(SOG.Brep target) { var tolerance = _contextStack.Current.Document.ModelAbsoluteTolerance; - var rhinoBrep = _rhinoBrepFactory.Create(); + var rhinoBrep = new RG.Brep(); // Geometry goes in first, always. Order doesn't matter. target.Curve3D.ForEach(curve => rhinoBrep.AddEdgeCurve(_curveConverter.Convert(curve))); @@ -73,21 +70,21 @@ public IRhinoBrep Convert(SOG.Brep target) } /// - /// Converts a Speckle to a Rhino and adds it to the provided . + /// Converts a Speckle to a Rhino and adds it to the provided . /// /// /// A consists of individual trims. There are special cases for singular trims and trims with defined edge indices. /// Note that edge cases in Brep structures are not fully covered by this method and should be reviewed for robustness improvement. - /// This operation alters the state of the provided by adding a new loop. + /// This operation alters the state of the provided by adding a new loop. /// - /// The where the new loop will be added. + /// The where the new loop will be added. /// The to be converted and added to . /// The tolerance factor used when adding trims and setting their tolerances. - private void ConvertSpeckleBrepLoop(IRhinoBrep rhinoBrep, SOG.BrepLoop speckleLoop, double tol) + private void ConvertSpeckleBrepLoop(RG.Brep rhinoBrep, SOG.BrepLoop speckleLoop, double tol) { var f = rhinoBrep.Faces[speckleLoop.FaceIndex]; - rhinoBrep.Loops.Add((RhinoBrepLoopType)speckleLoop.Type, f); + rhinoBrep.Loops.Add((RG.BrepLoopType)speckleLoop.Type, f); // POC: This works but it doesn't fully cover all Brep edge cases and could be the cause of some of our failed Rhino->Rhino breps. // We should check Rhino.Inside as they have similar code structure. @@ -95,7 +92,7 @@ private void ConvertSpeckleBrepLoop(IRhinoBrep rhinoBrep, SOG.BrepLoop speckleLo .ToList() .ForEach(trim => { - IRhinoBrepTrim rhTrim; + RG.BrepTrim rhTrim; if (trim.EdgeIndex != -1) { rhTrim = rhinoBrep.Trims.Add( @@ -110,7 +107,7 @@ private void ConvertSpeckleBrepLoop(IRhinoBrep rhinoBrep, SOG.BrepLoop speckleLo rhTrim = rhinoBrep.Trims.AddSingularTrim( rhinoBrep.Vertices[trim.EndIndex], rhinoBrep.Loops[trim.LoopIndex], - (RhinoIsoStatus)trim.IsoStatus, + (RG.IsoStatus)trim.IsoStatus, trim.CurveIndex ); } @@ -119,8 +116,8 @@ private void ConvertSpeckleBrepLoop(IRhinoBrep rhinoBrep, SOG.BrepLoop speckleLo rhTrim = rhinoBrep.Trims.Add(trim.IsReversed, rhinoBrep.Loops[trim.LoopIndex], trim.CurveIndex); } - rhTrim.IsoStatus = (RhinoIsoStatus)trim.IsoStatus; - rhTrim.TrimType = (RhinoBrepTrimType)trim.TrimType; + rhTrim.IsoStatus = (RG.IsoStatus)trim.IsoStatus; + rhTrim.TrimType = (RG.BrepTrimType)trim.TrimType; rhTrim.SetTolerances(tol, tol); }); } @@ -136,7 +133,7 @@ private void ConvertSpeckleBrepLoop(IRhinoBrep rhinoBrep, SOG.BrepLoop speckleLo /// is untrimmed, and hence added directly as a reference to the curve it points to. /// If the edge is trimmed, it is added based on vertices and subdomain using the supplied tolerance /// - private void ConvertSpeckleBrepEdge(IRhinoBrep rhinoBrep, SOG.BrepEdge speckleEdge, double tolerance) + private void ConvertSpeckleBrepEdge(RG.Brep rhinoBrep, SOG.BrepEdge speckleEdge, double tolerance) { if ( speckleEdge.Domain == null @@ -161,11 +158,11 @@ private void ConvertSpeckleBrepEdge(IRhinoBrep rhinoBrep, SOG.BrepEdge speckleEd } /// - /// Converts a into a and adds it to the provided . + /// Converts a into a and adds it to the provided . /// /// The Rhinoceros brep geometry to which the converted face is added. /// The Speckle brep face to be converted and added. - private void ConvertSpeckleBrepFace(IRhinoBrep rhinoBrep, SOG.BrepFace speckleFace) + private void ConvertSpeckleBrepFace(RG.Brep rhinoBrep, SOG.BrepFace speckleFace) { var f = rhinoBrep.Faces.Add(speckleFace.SurfaceIndex); f.OrientationIsReversed = speckleFace.OrientationReversed; diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CircleToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CircleToHostConverter.cs index 1fbdfd4a2e..1431d3fc1a 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CircleToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CircleToHostConverter.cs @@ -1,52 +1,46 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; /// -/// This class is responsible for converting a into and objects. +/// This class is responsible for converting a into and objects. /// Implements the interface, -/// providing implementation for to and conversion. +/// providing implementation for to and conversion. /// -public class CircleToHostConverter - : ITypedConverter, - ITypedConverter +public class CircleToHostConverter : ITypedConverter, ITypedConverter { - private readonly ITypedConverter _planeConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IRhinoCircleFactory _rhinoCircleFactory; + private readonly ITypedConverter _planeConverter; + private readonly ITypedConverter _intervalConverter; /// /// Constructs a new instance of the class. /// /// - /// An implementation of used to convert into . + /// An implementation of used to convert into . /// /// - /// An implementation of used to convert into . + /// An implementation of used to convert into . /// public CircleToHostConverter( - ITypedConverter intervalConverter, - ITypedConverter planeConverter, - IRhinoCircleFactory rhinoCircleFactory + ITypedConverter intervalConverter, + ITypedConverter planeConverter ) { _intervalConverter = intervalConverter; _planeConverter = planeConverter; - _rhinoCircleFactory = rhinoCircleFactory; } /// - /// Converts the given object into a object. + /// Converts the given object into a object. /// /// The object to convert. - /// The resulting object. + /// The resulting object. /// /// Thrown when the radius of the given object is null. /// /// ⚠️ This conversion does NOT perform scaling. - ///
⚠️ This conversion does not preserve the curve domain. If you need it preserved you must request a conversion to conversion instead
- public IRhinoCircle Convert(SOG.Circle target) + ///
⚠️ This conversion does not preserve the curve domain. If you need it preserved you must request a conversion to conversion instead
+ public RG.Circle Convert(SOG.Circle target) { if (target.radius == null) { @@ -56,9 +50,9 @@ public IRhinoCircle Convert(SOG.Circle target) var plane = _planeConverter.Convert(target.plane); var radius = target.radius.Value; - return _rhinoCircleFactory.Create(plane, radius); + return new RG.Circle(plane, radius); } - IRhinoArcCurve ITypedConverter.Convert(SOG.Circle target) => - _rhinoCircleFactory.Create(Convert(target), _intervalConverter.Convert(target.domain)); + RG.ArcCurve ITypedConverter.Convert(SOG.Circle target) => + new(Convert(target)) { Domain = _intervalConverter.Convert(target.domain) }; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CurveToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CurveToHostConverter.cs index d96d413258..a61425dc2a 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CurveToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/CurveToHostConverter.cs @@ -1,29 +1,28 @@ using Objects; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class CurveToHostConverter : ITypedConverter +public class CurveToHostConverter : ITypedConverter { - private readonly ITypedConverter _lineConverter; - private readonly ITypedConverter _arcConverter; - private readonly ITypedConverter _ellipseConverter; - private readonly ITypedConverter _spiralConverter; - private readonly ITypedConverter _circleConverter; - private readonly ITypedConverter _polylineConverter; - private readonly ITypedConverter _polyCurveConverter; - private readonly ITypedConverter _nurbsCurveConverter; + private readonly ITypedConverter _lineConverter; + private readonly ITypedConverter _arcConverter; + private readonly ITypedConverter _ellipseConverter; + private readonly ITypedConverter _spiralConverter; + private readonly ITypedConverter _circleConverter; + private readonly ITypedConverter _polylineConverter; + private readonly ITypedConverter _polyCurveConverter; + private readonly ITypedConverter _nurbsCurveConverter; public CurveToHostConverter( - ITypedConverter lineConverter, - ITypedConverter arcConverter, - ITypedConverter ellipseConverter, - ITypedConverter spiralConverter, - ITypedConverter circleConverter, - ITypedConverter polylineConverter, - ITypedConverter polyCurveConverter, - ITypedConverter nurbsCurveConverter + ITypedConverter lineConverter, + ITypedConverter arcConverter, + ITypedConverter ellipseConverter, + ITypedConverter spiralConverter, + ITypedConverter circleConverter, + ITypedConverter polylineConverter, + ITypedConverter polyCurveConverter, + ITypedConverter nurbsCurveConverter ) { _lineConverter = lineConverter; @@ -37,13 +36,13 @@ public CurveToHostConverter( } /// - /// Converts a given ICurve object to an IRhinoCurve object. + /// Converts a given ICurve object to an RG.Curve object. /// /// The ICurve object to convert. - /// The converted IRhinoCurve object. + /// The converted RG.Curve object. /// Thrown when the conversion is not supported for the given type of curve. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoCurve Convert(ICurve target) => + public RG.Curve Convert(ICurve target) => target switch { SOG.Line line => _lineConverter.Convert(line), diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/EllipseToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/EllipseToHostConverter.cs index c45fa5c3ab..74f309a61f 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/EllipseToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/EllipseToHostConverter.cs @@ -1,57 +1,49 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; public class EllipseToHostConverter - : ITypedConverter, - ITypedConverter + : ITypedConverter, + ITypedConverter { - private readonly ITypedConverter _planeConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IRhinoEllipseFactory _rhinoEllipseFactory; + private readonly ITypedConverter _planeConverter; + private readonly ITypedConverter _intervalConverter; public EllipseToHostConverter( - ITypedConverter planeConverter, - ITypedConverter intervalConverter, - IRhinoEllipseFactory rhinoEllipseFactory + ITypedConverter planeConverter, + ITypedConverter intervalConverter ) { _planeConverter = planeConverter; _intervalConverter = intervalConverter; - _rhinoEllipseFactory = rhinoEllipseFactory; } /// - /// Converts an instance of to an while preserving geometric properties. + /// Converts an instance of to an while preserving geometric properties. /// /// The instance to be converted. - /// The resulting after conversion. + /// The resulting after conversion. /// Thrown when or properties are null. /// ⚠️ This conversion does NOT perform scaling. - ///
⚠️ This conversion does not preserve the curve domain. If you need it preserved you must request a conversion to conversion instead
- public IRhinoEllipse Convert(SOG.Ellipse target) + ///
⚠️ This conversion does not preserve the curve domain. If you need it preserved you must request a conversion to conversion instead
+ public RG.Ellipse Convert(SOG.Ellipse target) { if (!target.firstRadius.HasValue || !target.secondRadius.HasValue) { throw new InvalidOperationException($"Ellipses cannot have null radii"); } - return _rhinoEllipseFactory.Create( - _planeConverter.Convert(target.plane), - target.firstRadius.Value, - target.secondRadius.Value - ); + return new RG.Ellipse(_planeConverter.Convert(target.plane), target.firstRadius.Value, target.secondRadius.Value); } /// - /// Converts the provided into a representation. + /// Converts the provided into a representation. /// /// The to convert. /// - /// A that represents the provided . + /// A that represents the provided . /// - IRhinoNurbsCurve ITypedConverter.Convert(SOG.Ellipse target) + RG.NurbsCurve ITypedConverter.Convert(SOG.Ellipse target) { var rhinoEllipse = Convert(target); var rhinoNurbsEllipse = rhinoEllipse.ToNurbsCurve(); diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/FlatPointListToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/FlatPointListToHostConverter.cs index 97c2786b44..f0363a387d 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/FlatPointListToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/FlatPointListToHostConverter.cs @@ -1,21 +1,14 @@ -using Speckle.Converters.Common.Objects; +using Rhino.Collections; +using Speckle.Converters.Common.Objects; using Speckle.Core.Logging; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; /// /// Converts a flat list of raw double values to a Point3dList. /// -public class FlatPointListToHostConverter : ITypedConverter, IRhinoPoint3dList> +public class FlatPointListToHostConverter : ITypedConverter, Point3dList> { - private readonly IRhinoPointFactory _rhinoPointFactory; - - public FlatPointListToHostConverter(IRhinoPointFactory rhinoPointFactory) - { - _rhinoPointFactory = rhinoPointFactory; - } - /// /// Converts a flat list of raw double values to a Point3dList. /// @@ -26,20 +19,20 @@ public FlatPointListToHostConverter(IRhinoPointFactory rhinoPointFactory) /// with the numbers being coordinates of each point in the format {x1, y1, z1, x2, y2, z2, ..., xN, yN, zN} /// /// Throws when the input list count is not a multiple of 3. - public IRhinoPoint3dList Convert(IReadOnlyList target) + public Point3dList Convert(IReadOnlyList target) { if (target.Count % 3 != 0) { throw new SpeckleException("Array malformed: length%3 != 0."); } - var points = new List(target.Count / 3); + var points = new List(target.Count / 3); for (int i = 2; i < target.Count; i += 3) { - points.Add(_rhinoPointFactory.Create(target[i - 2], target[i - 1], target[i])); + points.Add(new RG.Point3d(target[i - 2], target[i - 1], target[i])); } - return _rhinoPointFactory.Create(points); + return new Point3dList(points); } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/IntervalToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/IntervalToHostConverter.cs index ddaa476970..f201283ebd 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/IntervalToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/IntervalToHostConverter.cs @@ -1,17 +1,9 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class IntervalToHostConverter : ITypedConverter +public class IntervalToHostConverter : ITypedConverter { - private readonly IRhinoIntervalFactory _rhinoIntervalFactory; - - public IntervalToHostConverter(IRhinoIntervalFactory rhinoIntervalFactory) - { - _rhinoIntervalFactory = rhinoIntervalFactory; - } - /// /// Converts a Speckle Interval object to a Rhino.Geometry.Interval object. /// @@ -19,13 +11,13 @@ public IntervalToHostConverter(IRhinoIntervalFactory rhinoIntervalFactory) /// The converted Rhino.Geometry.Interval object. /// Thrown when the start or end value of the Interval is null. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoInterval Convert(SOP.Interval target) + public RG.Interval Convert(SOP.Interval target) { if (!target.start.HasValue || !target.end.HasValue) // POC: CNX-9272 Interval start and end being nullable makes no sense. { throw new ArgumentException("Interval start/end cannot be null"); } - return _rhinoIntervalFactory.Create(target.start.Value, target.end.Value); + return new RG.Interval(target.start.Value, target.end.Value); } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/LineToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/LineToHostConverter.cs index a66222299f..c549e96741 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/LineToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/LineToHostConverter.cs @@ -1,20 +1,14 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class LineToHostConverter : ITypedConverter, ITypedConverter +public class LineToHostConverter : ITypedConverter, ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly IRhinoLineFactory _rhinoLineFactory; + private readonly ITypedConverter _pointConverter; - public LineToHostConverter( - ITypedConverter pointConverter, - IRhinoLineFactory rhinoLineFactory - ) + public LineToHostConverter(ITypedConverter pointConverter) { _pointConverter = pointConverter; - _rhinoLineFactory = rhinoLineFactory; } /// @@ -26,16 +20,15 @@ IRhinoLineFactory rhinoLineFactory /// ///
⚠️ This conversion does not preserve the curve domain. /// If you need it preserved you must request a conversion to - /// conversion instead + /// conversion instead ///
- public IRhinoLine Convert(SOG.Line target) => - _rhinoLineFactory.Create(_pointConverter.Convert(target.start), _pointConverter.Convert(target.end)); + public RG.Line Convert(SOG.Line target) => + new(_pointConverter.Convert(target.start), _pointConverter.Convert(target.end)); /// /// Converts a Speckle Line object to a Rhino LineCurve object. /// /// The Speckle Line object to convert. /// Returns the resulting Rhino LineCurve object. - IRhinoLineCurve ITypedConverter.Convert(SOG.Line target) => - _rhinoLineFactory.Create(Convert(target)); + RG.LineCurve ITypedConverter.Convert(SOG.Line target) => new(Convert(target)); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/MeshToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/MeshToHostConverter.cs index e24adb8ad1..d3917dafd3 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/MeshToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/MeshToHostConverter.cs @@ -1,28 +1,17 @@ using System.Drawing; using Objects.Utils; +using Rhino.Collections; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class MeshToHostConverter : ITypedConverter +public class MeshToHostConverter : ITypedConverter { - private readonly ITypedConverter, IRhinoPoint3dList> _pointListConverter; - private readonly IRhinoMeshFactory _rhinoMeshFactory; - private readonly IRhinoNgonFactory _rhinoNgonFactory; - private readonly IRhinoPointFactory _rhinoPointFactory; - - public MeshToHostConverter( - ITypedConverter, IRhinoPoint3dList> pointListConverter, - IRhinoMeshFactory rhinoMeshFactory, - IRhinoNgonFactory rhinoNgonFactory, - IRhinoPointFactory rhinoPointFactory - ) + private readonly ITypedConverter, Point3dList> _pointListConverter; + + public MeshToHostConverter(ITypedConverter, Point3dList> pointListConverter) { _pointListConverter = pointListConverter; - _rhinoMeshFactory = rhinoMeshFactory; - _rhinoNgonFactory = rhinoNgonFactory; - _rhinoPointFactory = rhinoPointFactory; } /// @@ -31,11 +20,11 @@ IRhinoPointFactory rhinoPointFactory /// The Speckle mesh object to convert. /// A Rhino mesh object converted from the Speckle mesh. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoMesh Convert(SOG.Mesh target) + public RG.Mesh Convert(SOG.Mesh target) { target.AlignVerticesWithTexCoordsByIndex(); - IRhinoMesh m = _rhinoMeshFactory.Create(); + RG.Mesh m = new(); var vertices = _pointListConverter.Convert(target.vertices); var colors = target.colors.Select(Color.FromArgb).ToArray(); @@ -54,7 +43,7 @@ public IRhinoMesh Convert(SOG.Mesh target) // POC: CNX-9274 We should abstract this into the `Mesh` class, or some utility class adjacent to it // All converters need to do this so it's going to be a source of repetition // and it is directly tied to how we serialise the data in the mesh. - private void AssignMeshFaces(SOG.Mesh target, IRhinoMesh m) + private void AssignMeshFaces(SOG.Mesh target, RG.Mesh m) { int i = 0; while (i < target.faces.Count) @@ -70,12 +59,14 @@ private void AssignMeshFaces(SOG.Mesh target, IRhinoMesh m) if (n == 3) { // triangle - m.Faces.AddFace(target.faces[i + 1], target.faces[i + 2], target.faces[i + 3]); + m.Faces.AddFace(new RG.MeshFace(target.faces[i + 1], target.faces[i + 2], target.faces[i + 3])); } else if (n == 4) { // quad - m.Faces.AddFace(target.faces[i + 1], target.faces[i + 2], target.faces[i + 3], target.faces[i + 4]); + m.Faces.AddFace( + new RG.MeshFace(target.faces[i + 1], target.faces[i + 2], target.faces[i + 3], target.faces[i + 4]) + ); } else { @@ -85,10 +76,11 @@ private void AssignMeshFaces(SOG.Mesh target, IRhinoMesh m) var faceIndices = new List(triangles.Count); for (int t = 0; t < triangles.Count; t += 3) { - faceIndices.Add(m.Faces.AddFace(triangles[t], triangles[t + 1], triangles[t + 2])); + var face = new RG.MeshFace(triangles[t], triangles[t + 1], triangles[t + 2]); + faceIndices.Add(m.Faces.AddFace(face)); } - IRhinoMeshNgon ngon = _rhinoNgonFactory.Create(target.faces.GetRange(i + 1, n), faceIndices); + RG.MeshNgon ngon = RG.MeshNgon.Create(target.faces.GetRange(i + 1, n), faceIndices); m.Ngons.AddNgon(ngon); } @@ -97,13 +89,13 @@ private void AssignMeshFaces(SOG.Mesh target, IRhinoMesh m) m.Faces.CullDegenerateFaces(); } - private void AssignTextureCoordinates(SOG.Mesh target, IRhinoMesh m) + private void AssignTextureCoordinates(SOG.Mesh target, RG.Mesh m) { - var textureCoordinates = new IRhinoPoint2f[target.TextureCoordinatesCount]; + var textureCoordinates = new RG.Point2f[target.TextureCoordinatesCount]; for (int ti = 0; ti < target.TextureCoordinatesCount; ti++) { var (u, v) = target.GetTextureCoordinate(ti); - textureCoordinates[ti] = _rhinoPointFactory.Create(u, v); + textureCoordinates[ti] = new RG.Point2f(u, v); } m.TextureCoordinates.SetTextureCoordinates(textureCoordinates); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/NurbsCurveToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/NurbsCurveToHostConverter.cs index 9e2ee516f4..9f9bf52811 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/NurbsCurveToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/NurbsCurveToHostConverter.cs @@ -1,24 +1,15 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class NurbsCurveToHostConverter : ITypedConverter +public class NurbsCurveToHostConverter : ITypedConverter { - private readonly IRhinoPointFactory _rhinoPointFactory; - private readonly IRhinoCurveFactory _rhinoCurveFactory; - private readonly ITypedConverter _intervalConverter; + private readonly ITypedConverter _intervalConverter; - public NurbsCurveToHostConverter( - ITypedConverter intervalConverter, - IRhinoCurveFactory rhinoCurveFactory, - IRhinoPointFactory rhinoPointFactory - ) + public NurbsCurveToHostConverter(ITypedConverter intervalConverter) { _intervalConverter = intervalConverter; - _rhinoCurveFactory = rhinoCurveFactory; - _rhinoPointFactory = rhinoPointFactory; } /// @@ -28,14 +19,14 @@ IRhinoPointFactory rhinoPointFactory /// The converted Rhino NurbsCurve object. /// Thrown when the conversion fails. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoNurbsCurve Convert(SOG.Curve target) + public RG.NurbsCurve Convert(SOG.Curve target) { - IRhinoNurbsCurve nurbsCurve = _rhinoCurveFactory.Create(target.degree, target.points.Count / 3); + RG.NurbsCurve nurbsCurve = new(target.degree, target.points.Count / 3); // Hyper optimised curve control point conversion for (int i = 2, j = 0; i < target.points.Count; i += 3, j++) { - var pt = _rhinoPointFactory.Create(target.points[i - 2], target.points[i - 1], target.points[i]); // Skip the point converter for performance + var pt = new RG.Point3d(target.points[i - 2], target.points[i - 1], target.points[i]); // Skip the point converter for performance nurbsCurve.Points.SetPoint(j, pt, target.weights[j]); } @@ -46,11 +37,11 @@ public IRhinoNurbsCurve Convert(SOG.Curve target) { if (extraKnots == 2) { - nurbsCurve.Knots.SetKnot(j, target.knots[j + 1]); + nurbsCurve.Knots[j] = target.knots[j + 1]; } else { - nurbsCurve.Knots.SetKnot(j, target.knots[j]); + nurbsCurve.Knots[j] = target.knots[j]; } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PlaneToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PlaneToHostConverter.cs index 4b18fac738..49e10ab69e 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PlaneToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PlaneToHostConverter.cs @@ -1,23 +1,19 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class PlaneToHostConverter : ITypedConverter +public class PlaneToHostConverter : ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _vectorConverter; - private readonly IRhinoPlaneFactory _rhinoPlaneFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _vectorConverter; public PlaneToHostConverter( - ITypedConverter pointConverter, - ITypedConverter vectorConverter, - IRhinoPlaneFactory rhinoPlaneFactory + ITypedConverter pointConverter, + ITypedConverter vectorConverter ) { _pointConverter = pointConverter; _vectorConverter = vectorConverter; - _rhinoPlaneFactory = rhinoPlaneFactory; } /// @@ -26,8 +22,8 @@ IRhinoPlaneFactory rhinoPlaneFactory /// The Speckle Plane object to be converted. /// The converted Rhino Plane object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoPlane Convert(SOG.Plane target) => - _rhinoPlaneFactory.Create( + public RG.Plane Convert(SOG.Plane target) => + new( _pointConverter.Convert(target.origin), _vectorConverter.Convert(target.xdir), _vectorConverter.Convert(target.ydir) diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointCloudToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointCloudToHostConverter.cs index f4a67b8d8d..a6d749b15c 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointCloudToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointCloudToHostConverter.cs @@ -1,21 +1,16 @@ using System.Drawing; +using Rhino.Collections; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class PointCloudToHostConverter : ITypedConverter +public class PointCloudToHostConverter : ITypedConverter { - private readonly ITypedConverter, IRhinoPoint3dList> _pointListConverter; - private readonly IRhinoPointCloudFactory _rhinoPointCloudFactory; + private readonly ITypedConverter, Point3dList> _pointListConverter; - public PointCloudToHostConverter( - ITypedConverter, IRhinoPoint3dList> pointListConverter, - IRhinoPointCloudFactory rhinoPointCloudFactory - ) + public PointCloudToHostConverter(ITypedConverter, Point3dList> pointListConverter) { _pointListConverter = pointListConverter; - _rhinoPointCloudFactory = rhinoPointCloudFactory; } /// @@ -24,10 +19,10 @@ IRhinoPointCloudFactory rhinoPointCloudFactory /// The raw Speckle Pointcloud object to convert. /// The converted Rhino PointCloud object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoPointCloud Convert(SOG.Pointcloud target) + public RG.PointCloud Convert(SOG.Pointcloud target) { var rhinoPoints = _pointListConverter.Convert(target.points); - var rhinoPointCloud = _rhinoPointCloudFactory.Create(rhinoPoints); + var rhinoPointCloud = new RG.PointCloud(rhinoPoints); if (target.colors.Count == rhinoPoints.Count) { diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointToHostConverter.cs index 35938f8ad4..8ce40bcb59 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PointToHostConverter.cs @@ -1,24 +1,16 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class PointToHostConverter : ITypedConverter, ITypedConverter +public class PointToHostConverter : ITypedConverter, ITypedConverter { - private readonly IRhinoPointFactory _rhinoPointFactory; - - public PointToHostConverter(IRhinoPointFactory rhinoPointFactory) - { - _rhinoPointFactory = rhinoPointFactory; - } - /// /// Converts a Speckle Point object to a Rhino Point3d object. /// /// The Speckle Point object to convert. /// The converted Rhino Point3d object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoPoint3d Convert(SOG.Point target) => _rhinoPointFactory.Create(target.x, target.y, target.z); + public RG.Point3d Convert(SOG.Point target) => new(target.x, target.y, target.z); /// /// Converts a Speckle Point object to a Rhino Point object. @@ -26,6 +18,5 @@ public PointToHostConverter(IRhinoPointFactory rhinoPointFactory) /// The Speckle Point object to convert. /// The converted Rhino Point object. /// ⚠️ This conversion does NOT perform scaling. - IRhinoPoint ITypedConverter.Convert(SOG.Point target) => - _rhinoPointFactory.Create(Convert(target)); + RG.Point ITypedConverter.Convert(SOG.Point target) => new(Convert(target)); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolyCurveToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolyCurveToHostConverter.cs index 6a2655ed48..3f35905090 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolyCurveToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolyCurveToHostConverter.cs @@ -2,24 +2,18 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Kits; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class PolyCurveToHostConverter : ITypedConverter +public class PolyCurveToHostConverter : ITypedConverter { - public ITypedConverter? CurveConverter { get; set; } // POC: CNX-9311 Circular dependency injected by the container using property. + public ITypedConverter? CurveConverter { get; set; } // POC: CNX-9311 Circular dependency injected by the container using property. - private readonly ITypedConverter _intervalConverter; - private readonly IRhinoCurveFactory _rhinoCurveFactory; + private readonly ITypedConverter _intervalConverter; - public PolyCurveToHostConverter( - ITypedConverter intervalConverter, - IRhinoCurveFactory rhinoCurveFactory - ) + public PolyCurveToHostConverter(ITypedConverter intervalConverter) { _intervalConverter = intervalConverter; - _rhinoCurveFactory = rhinoCurveFactory; } /// @@ -28,14 +22,13 @@ IRhinoCurveFactory rhinoCurveFactory /// The SpecklePolyCurve object to convert. /// The converted Rhino PolyCurve object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoPolyCurve Convert(SOG.Polycurve target) + public RG.PolyCurve Convert(SOG.Polycurve target) { - IRhinoPolyCurve result = _rhinoCurveFactory.Create(); - var converter = CurveConverter.NotNull(); + RG.PolyCurve result = new(); foreach (var segment in target.segments) { - var childCurve = converter.Convert(segment); + var childCurve = CurveConverter.NotNull().Convert(segment); bool success = result.AppendSegment(childCurve); if (!success) { diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolylineToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolylineToHostConverter.cs index b803a07943..5abe48fed5 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolylineToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/PolylineToHostConverter.cs @@ -1,25 +1,22 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; +using Rhino.Collections; +using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino7.ToHost.Raw; public class PolylineToHostConverter - : ITypedConverter, - ITypedConverter + : ITypedConverter, + ITypedConverter { - private readonly ITypedConverter, IRhinoPoint3dList> _pointListConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IRhinoLineFactory _rhinoLineFactory; + private readonly ITypedConverter, Point3dList> _pointListConverter; + private readonly ITypedConverter _intervalConverter; public PolylineToHostConverter( - ITypedConverter, IRhinoPoint3dList> pointListConverter, - ITypedConverter intervalConverter, - IRhinoLineFactory rhinoLineFactory + ITypedConverter, Point3dList> pointListConverter, + ITypedConverter intervalConverter ) { _pointListConverter = pointListConverter; _intervalConverter = intervalConverter; - _rhinoLineFactory = rhinoLineFactory; } /// @@ -31,9 +28,9 @@ IRhinoLineFactory rhinoLineFactory /// ///
⚠️ This conversion does not preserve the curve domain. /// If you need it preserved you must request a conversion to - /// conversion instead + /// conversion instead ///
- public IRhinoPolyline Convert(SOG.Polyline target) + public RG.Polyline Convert(SOG.Polyline target) { var points = _pointListConverter.Convert(target.value); @@ -42,7 +39,7 @@ public IRhinoPolyline Convert(SOG.Polyline target) points.Add(points[0]); } - var poly = _rhinoLineFactory.Create(points); + var poly = new RG.Polyline(points); return poly; } @@ -55,7 +52,7 @@ public IRhinoPolyline Convert(SOG.Polyline target) /// The Speckle polyline object to be converted. /// The converted Rhino Polyline object. /// ⚠️ This conversion does NOT perform scaling. - IRhinoPolylineCurve ITypedConverter.Convert(SOG.Polyline target) + RG.PolylineCurve ITypedConverter.Convert(SOG.Polyline target) { var poly = Convert(target).ToPolylineCurve(); poly.Domain = _intervalConverter.Convert(target.domain); diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SpiralToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SpiralToHostConverter.cs index c3cc3532ce..cb7f5a8745 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SpiralToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SpiralToHostConverter.cs @@ -1,16 +1,15 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class SpiralToHostConverter : ITypedConverter +public class SpiralToHostConverter : ITypedConverter { - private readonly ITypedConverter _polylineConverter; - private readonly ITypedConverter _intervalConverter; + private readonly ITypedConverter _polylineConverter; + private readonly ITypedConverter _intervalConverter; public SpiralToHostConverter( - ITypedConverter polylineConverter, - ITypedConverter intervalConverter + ITypedConverter polylineConverter, + ITypedConverter intervalConverter ) { _polylineConverter = polylineConverter; @@ -23,7 +22,7 @@ public SpiralToHostConverter( /// The Speckle Spiral object to be converted. /// A Rhino PolylineCurve object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoPolylineCurve Convert(SOG.Spiral target) + public RG.PolylineCurve Convert(SOG.Spiral target) { var result = _polylineConverter.Convert(target.displayValue); result.Domain = _intervalConverter.Convert(target.domain); diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SurfaceToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SurfaceToHostConverter.cs index 46689761a8..91da44ec59 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SurfaceToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/SurfaceToHostConverter.cs @@ -1,29 +1,21 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class SurfaceToHostConverter : ITypedConverter +public class SurfaceToHostConverter : ITypedConverter { - private readonly IRhinoSurfaceFactory _rhinoSurfaceFactory; - - public SurfaceToHostConverter(IRhinoSurfaceFactory rhinoSurfaceFactory) - { - _rhinoSurfaceFactory = rhinoSurfaceFactory; - } - /// /// Converts a raw Speckle surface to a Rhino NURBS surface. /// /// The raw Speckle surface to convert. /// The converted Rhino NURBS surface. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoNurbsSurface Convert(SOG.Surface target) + public RG.NurbsSurface Convert(SOG.Surface target) { // Create rhino surface var points = target.GetControlPoints().ToList(); - var result = _rhinoSurfaceFactory.Create( + var result = RG.NurbsSurface.Create( 3, target.rational, target.degreeU + 1, @@ -36,13 +28,13 @@ public IRhinoNurbsSurface Convert(SOG.Surface target) var correctUKnots = GetCorrectKnots(target.knotsU, target.countU, target.degreeU); for (int i = 0; i < correctUKnots.Count; i++) { - result.KnotsU.SetKnot(i, correctUKnots[i]); + result.KnotsU[i] = correctUKnots[i]; } var correctVKnots = GetCorrectKnots(target.knotsV, target.countV, target.degreeV); for (int i = 0; i < correctVKnots.Count; i++) { - result.KnotsV.SetKnot(i, correctVKnots[i]); + result.KnotsV[i] = correctVKnots[i]; } // Set control points diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/VectorToHostConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/VectorToHostConverter.cs index 85ff17692c..77e017f0fd 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/VectorToHostConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/VectorToHostConverter.cs @@ -1,22 +1,14 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.Raw; -public class VectorToHostConverter : ITypedConverter +public class VectorToHostConverter : ITypedConverter { - private readonly IRhinoVectorFactory _rhinoVectorFactory; - - public VectorToHostConverter(IRhinoVectorFactory rhinoVectorFactory) - { - _rhinoVectorFactory = rhinoVectorFactory; - } - /// /// Converts a Speckle.Vector object to a Rhino Vector3d object. /// /// The Speckle.Vector to be converted. /// The converted Rhino Vector3d object. /// ⚠️ This conversion does NOT perform scaling. - public IRhinoVector3d Convert(SOG.Vector target) => _rhinoVectorFactory.Create(target.x, target.y, target.z); + public RG.Vector3d Convert(SOG.Vector target) => new(target.x, target.y, target.z); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/ArcToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/ArcToHostTopLevelConverter.cs index ca8b4938bd..12c4420914 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/ArcToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/ArcToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Arc), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class ArcToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class ArcToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public ArcToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/BrepToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/BrepToHostTopLevelConverter.cs index 1c8706bd99..6ca70d3ad1 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/BrepToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/BrepToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Brep), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class BrepToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class BrepToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public BrepToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/CircleToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/CircleToHostTopLevelConverter.cs index 942854b10b..1493120e57 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/CircleToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/CircleToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Circle), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class CircleToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class CircleToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public CircleToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs index dbc35c205b..e6a4b03a41 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Ellipse), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class EllipseToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class EllipseToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public EllipseToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs index 34c5a989ae..811433890c 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs @@ -1,45 +1,42 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Kits; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(DisplayableObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class FallbackToHostTopLevelConverter : IToHostTopLevelConverter, - ITypedConverter> + ITypedConverter> { - private readonly ITypedConverter _lineConverter; - private readonly ITypedConverter _polylineConverter; - private readonly ITypedConverter _meshConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoTransformFactory _rhinoTransformFactory; + private readonly ITypedConverter _lineConverter; + private readonly ITypedConverter _polylineConverter; + private readonly ITypedConverter _meshConverter; + private readonly IConversionContextStack _contextStack; public FallbackToHostTopLevelConverter( - ITypedConverter lineConverter, - ITypedConverter polylineConverter, - ITypedConverter meshConverter, - IConversionContextStack contextStack, - IRhinoTransformFactory rhinoTransformFactory + ITypedConverter lineConverter, + ITypedConverter polylineConverter, + ITypedConverter meshConverter, + IConversionContextStack contextStack ) { _lineConverter = lineConverter; _polylineConverter = polylineConverter; _meshConverter = meshConverter; _contextStack = contextStack; - _rhinoTransformFactory = rhinoTransformFactory; } public object Convert(Base target) => Convert((DisplayableObject)target); - public List Convert(DisplayableObject target) + public List Convert(DisplayableObject target) { - var result = new List(); + var result = new List(); foreach (var item in target.displayValue) { - IRhinoGeometryBase x = item switch + RG.GeometryBase x = item switch { SOG.Line line => _lineConverter.Convert(line), SOG.Polyline polyline => _polylineConverter.Convert(polyline), @@ -53,7 +50,7 @@ public List Convert(DisplayableObject target) return result; } - private IRhinoTransform GetUnitsTransform(Base speckleObject) + private RG.Transform GetUnitsTransform(Base speckleObject) { /* * POC: CNX-9270 Looking at a simpler, more performant way of doing unit scaling on `ToNative` @@ -63,10 +60,10 @@ private IRhinoTransform GetUnitsTransform(Base speckleObject) if (speckleObject["units"] is string units) { var scaleFactor = Units.GetConversionFactor(units, _contextStack.Current.SpeckleUnits); - var scale = _rhinoTransformFactory.Scale(_rhinoTransformFactory.Origin, scaleFactor); + var scale = RG.Transform.Scale(RG.Point3d.Origin, scaleFactor); return scale; } - return _rhinoTransformFactory.Identity; + return RG.Transform.Identity; } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/LineToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/LineToHostTopLevelConverter.cs index 8767a91e06..5a64a3ebab 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/LineToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/LineToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Line), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class LineToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class LineToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public LineToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/MeshToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/MeshToHostTopLevelConverter.cs index 6cdacc4288..c7d047df3b 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/MeshToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/MeshToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class MeshToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class MeshToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public MeshToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs index 19201d066a..987b46161f 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Curve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class NurbsCurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class NurbsCurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public NurbsCurveToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs index c4e199b3d4..51a2613e90 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs @@ -1,17 +1,16 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Pointcloud), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointCloudToHostTopLevelConverter - : SpeckleToHostGeometryBaseTopLevelConverter + : SpeckleToHostGeometryBaseTopLevelConverter { public PointCloudToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointToHostTopLevelConverter.cs index 6922cf12ad..de10053ce9 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PointToHostTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Point), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class PointToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter +public class PointToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PointToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs index 96511e2856..d6f8d2f14b 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs @@ -1,17 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class PolycurveToHostTopLevelConverter - : SpeckleToHostGeometryBaseTopLevelConverter +public class PolycurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PolycurveToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs index c098b09930..081f217f04 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs @@ -1,17 +1,16 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Polyline), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolylineToHostTopLevelConverter - : SpeckleToHostGeometryBaseTopLevelConverter + : SpeckleToHostGeometryBaseTopLevelConverter { public PolylineToHostTopLevelConverter( - IConversionContextStack contextStack, - ITypedConverter geometryBaseConverter, - IRhinoTransformFactory rhinoTransformFactory + IConversionContextStack contextStack, + ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter, rhinoTransformFactory) { } + : base(contextStack, geometryBaseConverter) { } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs index f262520e97..8a3eee9cb7 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs @@ -1,23 +1,23 @@ using Objects; +using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class ArcCurveToSpeckleConverter : ITypedConverter, ITypedConverter +public class ArcCurveToSpeckleConverter : ITypedConverter, ITypedConverter { - private readonly ITypedConverter _circleConverter; - private readonly ITypedConverter _arcConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _circleConverter; + private readonly ITypedConverter _arcConverter; + private readonly ITypedConverter _intervalConverter; + private readonly IConversionContextStack _contextStack; public ArcCurveToSpeckleConverter( - ITypedConverter circleConverter, - ITypedConverter arcConverter, - ITypedConverter intervalConverter, - IConversionContextStack contextStack + ITypedConverter circleConverter, + ITypedConverter arcConverter, + ITypedConverter intervalConverter, + IConversionContextStack contextStack ) { _circleConverter = circleConverter; @@ -27,16 +27,16 @@ IConversionContextStack contextStack } /// - /// Converts an IRhinoArcCurve to an ICurve. + /// Converts an RG.ArcCurve to an ICurve. /// - /// The IRhinoArcCurve to convert. + /// The RG.ArcCurve to convert. /// The converted ICurve. /// /// ⚠️ If the provided ArcCurve is a complete circle, a Speckle Circle will be returned. /// Otherwise, the output will be a Speckle Arc.
/// ✅ This method preserves the domain of the original ArcCurve.
///
- public ICurve Convert(IRhinoArcCurve target) + public ICurve Convert(RG.ArcCurve target) { var tolerance = _contextStack.Current.Document.ModelAbsoluteTolerance; @@ -57,5 +57,5 @@ public ICurve Convert(IRhinoArcCurve target) // This also causes us to have to force cast ICurve to Base as a result, which is expected to always succeed but not nice. /// /// The converted ICurve with a cast to object - Base ITypedConverter.Convert(IRhinoArcCurve target) => (Base)Convert(target); + Base ITypedConverter.Convert(RG.ArcCurve target) => (Base)Convert(target); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcToSpeckleConverter.cs index 0458715c91..82c89c2551 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ArcToSpeckleConverter.cs @@ -1,30 +1,27 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class ArcToSpeckleConverter : ITypedConverter +public class ArcToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _planeConverter; - private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _boxFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _planeConverter; + private readonly ITypedConverter _boxConverter; + private readonly IConversionContextStack _contextStack; public ArcToSpeckleConverter( - ITypedConverter pointConverter, - ITypedConverter planeConverter, - ITypedConverter boxConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory boxFactory + ITypedConverter pointConverter, + ITypedConverter planeConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack ) { _pointConverter = pointConverter; _planeConverter = planeConverter; _boxConverter = boxConverter; _contextStack = contextStack; - _boxFactory = boxFactory; } /// @@ -35,7 +32,7 @@ IRhinoBoxFactory boxFactory /// /// This method assumes the domain of the arc is (0,1) as Arc types in Rhino do not have domain. You may want to request a conversion from ArcCurve instead. /// - public SOG.Arc Convert(IRhinoArc target) => + public SOG.Arc Convert(RG.Arc target) => new( _planeConverter.Convert(target.Plane), target.Radius, @@ -50,6 +47,6 @@ public SOG.Arc Convert(IRhinoArc target) => endPoint = _pointConverter.Convert(target.EndPoint), domain = new SOP.Interval(0, 1), length = target.Length, - bbox = _boxConverter.Convert(_boxFactory.CreateBox(target.BoundingBox())) + bbox = _boxConverter.Convert(new RG.Box(target.BoundingBox())) }; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BoxToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BoxToSpeckleConverter.cs index cae6a5d610..cebd6e5d70 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BoxToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BoxToSpeckleConverter.cs @@ -1,19 +1,19 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class BoxToSpeckleConverter : ITypedConverter +public class BoxToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _planeConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _planeConverter; + private readonly ITypedConverter _intervalConverter; + private readonly IConversionContextStack _contextStack; public BoxToSpeckleConverter( - ITypedConverter planeConverter, - ITypedConverter intervalConverter, - IConversionContextStack contextStack + ITypedConverter planeConverter, + ITypedConverter intervalConverter, + IConversionContextStack contextStack ) { _planeConverter = planeConverter; @@ -26,7 +26,7 @@ IConversionContextStack contextStack /// /// The Rhino Box object to convert. /// The converted Speckle Box object. - public SOG.Box Convert(IRhinoBox target) => + public SOG.Box Convert(RG.Box target) => new( _planeConverter.Convert(target.Plane), _intervalConverter.Convert(target.X), diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BrepToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BrepToSpeckleConverter.cs index 1ae05128f7..e74bb2f374 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BrepToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/BrepToSpeckleConverter.cs @@ -1,34 +1,30 @@ using Objects; +using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Kits; using Speckle.Core.Logging; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class BrepToSpeckleConverter : ITypedConverter +public class BrepToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _curveConverter; - private readonly ITypedConverter _surfaceConverter; - private readonly ITypedConverter _meshConverter; - private readonly ITypedConverter _boxConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; - private readonly IRhinoMeshFactory _rhinoMeshFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _surfaceConverter; + private readonly ITypedConverter _meshConverter; + private readonly ITypedConverter _boxConverter; + private readonly ITypedConverter _intervalConverter; + private readonly IConversionContextStack _contextStack; public BrepToSpeckleConverter( - ITypedConverter pointConverter, - ITypedConverter curveConverter, - ITypedConverter surfaceConverter, - ITypedConverter meshConverter, - ITypedConverter boxConverter, - ITypedConverter intervalConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory, - IRhinoMeshFactory rhinoMeshFactory + ITypedConverter pointConverter, + ITypedConverter curveConverter, + ITypedConverter surfaceConverter, + ITypedConverter meshConverter, + ITypedConverter boxConverter, + ITypedConverter intervalConverter, + IConversionContextStack contextStack ) { _pointConverter = pointConverter; @@ -38,8 +34,6 @@ IRhinoMeshFactory rhinoMeshFactory _boxConverter = boxConverter; _intervalConverter = intervalConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; - _rhinoMeshFactory = rhinoMeshFactory; } /// @@ -47,7 +41,7 @@ IRhinoMeshFactory rhinoMeshFactory /// /// The Brep object to convert. /// The converted Speckle Brep object. - public SOG.Brep Convert(IRhinoBrep target) + public SOG.Brep Convert(RG.Brep target) { var tol = _contextStack.Current.Document.ModelAbsoluteTolerance; target.Repair(tol); @@ -95,7 +89,7 @@ public SOG.Brep Convert(IRhinoBrep target) Orientation = (SOG.BrepOrientation)target.SolidOrientation, volume = target.IsSolid ? target.GetVolume() : 0, area = target.GetArea(), - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.GetBoundingBox(false))), + bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(false))), units = _contextStack.Current.SpeckleUnits }; @@ -112,7 +106,7 @@ public SOG.Brep Convert(IRhinoBrep target) return speckleBrep; } - private static List ConvertBrepFaces(IRhinoBrep brep, SOG.Brep speckleParent) => + private static List ConvertBrepFaces(RG.Brep brep, SOG.Brep speckleParent) => brep.Faces .Select( f => @@ -126,7 +120,7 @@ public SOG.Brep Convert(IRhinoBrep target) ) .ToList(); - private List ConvertBrepEdges(IRhinoBrep brep, SOG.Brep speckleParent) => + private List ConvertBrepEdges(RG.Brep brep, SOG.Brep speckleParent) => brep.Edges .Select( edge => @@ -142,13 +136,13 @@ public SOG.Brep Convert(IRhinoBrep target) ) .ToList(); - private List ConvertBrepTrims(IRhinoBrep brep, SOG.Brep speckleParent) => + private List ConvertBrepTrims(RG.Brep brep, SOG.Brep speckleParent) => brep.Trims .Select(trim => { var t = new SOG.BrepTrim( speckleParent, - trim.Edge?.EdgeIndex ?? -1, + trim.Edge.EdgeIndex, trim.Face.FaceIndex, trim.Loop.LoopIndex, trim.TrimCurveIndex, @@ -166,7 +160,7 @@ public SOG.Brep Convert(IRhinoBrep target) }) .ToList(); - private List ConvertBrepLoops(IRhinoBrep brep, SOG.Brep speckleParent) => + private List ConvertBrepLoops(RG.Brep brep, SOG.Brep speckleParent) => brep.Loops .Select( loop => @@ -179,13 +173,14 @@ public SOG.Brep Convert(IRhinoBrep target) ) .ToList(); - private IRhinoMesh? GetBrepDisplayMesh(IRhinoBrep brep) + private RG.Mesh? GetBrepDisplayMesh(RG.Brep brep) { - var joinedMesh = _rhinoMeshFactory.Create(); + var joinedMesh = new RG.Mesh(); // get from settings //Settings.TryGetValue("sendMeshSetting", out string meshSetting); + RG.MeshingParameters mySettings = new(0.05, 0.05); // switch (SelectedMeshSettings) // { // case MeshSettings.CurrentDoc: @@ -199,7 +194,7 @@ public SOG.Brep Convert(IRhinoBrep target) try { - joinedMesh.Append(_rhinoMeshFactory.CreateFromBrep(brep, 0.05, 0.05)); + joinedMesh.Append(RG.Mesh.CreateFromBrep(brep, mySettings)); return joinedMesh; } catch (Exception ex) when (!ex.IsFatal()) diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CircleToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CircleToSpeckleConverter.cs index 64ef397045..0e3f91e3bf 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CircleToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CircleToSpeckleConverter.cs @@ -1,35 +1,35 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class CircleToSpeckleConverter : ITypedConverter +public class CircleToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _planeConverter; - private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _planeConverter; + private readonly IConversionContextStack _contextStack; public CircleToSpeckleConverter( - ITypedConverter planeConverter, - IConversionContextStack contextStack + ITypedConverter planeConverter, + IConversionContextStack contextStack ) { _planeConverter = planeConverter; _contextStack = contextStack; } - public Base Convert(object target) => Convert((IRhinoCircle)target); + public Base Convert(object target) => Convert((RG.Circle)target); /// - /// Converts a IRhinoCircle object to a SOG.Circle object. + /// Converts a RG.Circle object to a SOG.Circle object. /// - /// The IRhinoCircle object to convert. + /// The RG.Circle object to convert. /// The converted SOG.Circle object. /// /// ⚠️ This conversion assumes the domain of a circle is (0,1) as Rhino Circle types do not have a domain. If you want to preserve the domain use ArcCurve conversion instead. /// - public SOG.Circle Convert(IRhinoCircle target) => + public SOG.Circle Convert(RG.Circle target) => new(_planeConverter.Convert(target.Plane), target.Radius, _contextStack.Current.SpeckleUnits) { domain = new SOP.Interval(0, 1), diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs index 0fa733ca87..d3747e2faf 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs @@ -1,14 +1,15 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; +using Speckle.Core.Models; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class ControlPointToSpeckleConverter : ITypedConverter +public class ControlPointToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConversionContextStack _contextStack; - public ControlPointToSpeckleConverter(IConversionContextStack contextStack) + public ControlPointToSpeckleConverter(IConversionContextStack contextStack) { _contextStack = contextStack; } @@ -18,6 +19,8 @@ public ControlPointToSpeckleConverter(IConversionContextStack /// The ControlPoint object to convert. /// The converted Speckle ControlPoint object. - public SOG.ControlPoint Convert(IRhinoControlPoint target) => + public SOG.ControlPoint Convert(RG.ControlPoint target) => new(target.Location.X, target.Location.Y, target.Location.Z, target.Weight, _contextStack.Current.SpeckleUnits); + + public Base Convert(object target) => Convert((RG.ControlPoint)target); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CurveToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CurveToSpeckleConverter.cs index 855a2d43d5..5c792ebaf8 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CurveToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/CurveToSpeckleConverter.cs @@ -1,25 +1,24 @@ using Objects; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; // POC: CNX-9278 This converter decides which specific curve conversion to use. IIndex may be a better choice. -public class CurveToSpeckleConverter : ITypedConverter, ITypedConverter +public class CurveToSpeckleConverter : ITypedConverter, ITypedConverter { - private readonly ITypedConverter _polyCurveConverter; - private readonly ITypedConverter _arcCurveConverter; - private readonly ITypedConverter _polylineConverter; - private readonly ITypedConverter _nurbsCurveConverter; - private readonly ITypedConverter _lineCurveConverter; + private readonly ITypedConverter _polyCurveConverter; + private readonly ITypedConverter _arcCurveConverter; + private readonly ITypedConverter _polylineConverter; + private readonly ITypedConverter _nurbsCurveConverter; + private readonly ITypedConverter _lineCurveConverter; public CurveToSpeckleConverter( - ITypedConverter polyCurveConverter, - ITypedConverter arcCurveConverter, - ITypedConverter polylineConverter, - ITypedConverter nurbsCurveConverter, - ITypedConverter lineCurveConverter + ITypedConverter polyCurveConverter, + ITypedConverter arcCurveConverter, + ITypedConverter polylineConverter, + ITypedConverter nurbsCurveConverter, + ITypedConverter lineCurveConverter ) { _polyCurveConverter = polyCurveConverter; @@ -38,31 +37,15 @@ public CurveToSpeckleConverter( /// This is the main converter when the type of curve you input or output does not matter to the caller.
/// ⚠️ If an unsupported type of Curve is input, it will be converted to NURBS. /// - public ICurve Convert(IRhinoCurve target) - { - var polyline = target.ToPolylineCurve(); - if (polyline is not null) - { - return _polylineConverter.Convert(polyline); - } - var arcCurve = target.ToArcCurve(); - if (arcCurve is not null) - { - return _arcCurveConverter.Convert(arcCurve); - } - var polyCurve = target.ToPolyCurve(); - if (polyCurve is not null) + public ICurve Convert(RG.Curve target) => + target switch { - return _polyCurveConverter.Convert(polyCurve); - } - var lineCurve = target.ToLineCurve(); - if (lineCurve is not null) - { - return _lineCurveConverter.Convert(lineCurve); - } - var nurbsCurve = target.ToNurbsCurve(); - return _nurbsCurveConverter.Convert(nurbsCurve); - } + RG.PolyCurve polyCurve => _polyCurveConverter.Convert(polyCurve), + RG.ArcCurve arcCurve => _arcCurveConverter.Convert(arcCurve), + RG.PolylineCurve polylineCurve => _polylineConverter.Convert(polylineCurve), + RG.LineCurve lineCurve => _lineCurveConverter.Convert(lineCurve), + _ => _nurbsCurveConverter.Convert(target.ToNurbsCurve()) + }; - Base ITypedConverter.Convert(IRhinoCurve target) => (Base)Convert(target); + Base ITypedConverter.Convert(RG.Curve target) => (Base)Convert(target); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/EllipseToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/EllipseToSpeckleConverter.cs index 0420067ae7..fc6b52cc8f 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/EllipseToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/EllipseToSpeckleConverter.cs @@ -1,27 +1,24 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class EllipseToSpeckleConverter : ITypedConverter +public class EllipseToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _planeConverter; - private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly ITypedConverter _planeConverter; + private readonly ITypedConverter _boxConverter; + private readonly IConversionContextStack _contextStack; public EllipseToSpeckleConverter( - ITypedConverter planeConverter, - ITypedConverter boxConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter planeConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack ) { _planeConverter = planeConverter; _boxConverter = boxConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -32,7 +29,7 @@ IRhinoBoxFactory rhinoBoxFactory /// /// ⚠️ Rhino ellipses are not curves. The result is a mathematical representation of an ellipse that can be converted into NURBS for display. /// - public SOG.Ellipse Convert(IRhinoEllipse target) + public SOG.Ellipse Convert(RG.Ellipse target) { var nurbsCurve = target.ToNurbsCurve(); return new( @@ -45,7 +42,7 @@ public SOG.Ellipse Convert(IRhinoEllipse target) domain = new SOP.Interval(0, 1), length = nurbsCurve.GetLength(), area = Math.PI * target.Radius1 * target.Radius2, - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(nurbsCurve.GetBoundingBox(true))) + bbox = _boxConverter.Convert(new RG.Box(nurbsCurve.GetBoundingBox(true))) }; } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/IntervalToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/IntervalToSpeckleConverter.cs index 8044a90e7d..272fecafdb 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/IntervalToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/IntervalToSpeckleConverter.cs @@ -1,14 +1,13 @@ using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class IntervalToSpeckleConverter : ITypedConverter +public class IntervalToSpeckleConverter : ITypedConverter { /// /// Converts a Rhino Interval object to a Speckle Interval object. /// /// The Rhino Interval object to be converted. /// The converted Speckle Interval object. - public SOP.Interval Convert(IRhinoInterval target) => new(target.T0, target.T1); + public SOP.Interval Convert(RG.Interval target) => new(target.T0, target.T1); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/LineToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/LineToSpeckleConverter.cs index dc480c79fd..f40620f78d 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/LineToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/LineToSpeckleConverter.cs @@ -1,27 +1,24 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class LineToSpeckleConverter : ITypedConverter, ITypedConverter +public class LineToSpeckleConverter : ITypedConverter, ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _boxConverter; + private readonly IConversionContextStack _contextStack; public LineToSpeckleConverter( - ITypedConverter pointConverter, - ITypedConverter boxConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter pointConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack ) { _pointConverter = pointConverter; _boxConverter = boxConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -32,13 +29,13 @@ IRhinoBoxFactory rhinoBoxFactory /// /// ⚠️ This conversion assumes the domain of a line is (0, LENGTH), as Rhino Lines do not have domain. If you want the domain preserved use LineCurve conversions instead. /// - public SOG.Line Convert(IRhinoLine target) => + public SOG.Line Convert(RG.Line target) => new(_pointConverter.Convert(target.From), _pointConverter.Convert(target.To), _contextStack.Current.SpeckleUnits) { length = target.Length, domain = new SOP.Interval(0, target.Length), - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.BoundingBox)) + bbox = _boxConverter.Convert(new RG.Box(target.BoundingBox)) }; - public SOG.Line Convert(IRhinoLineCurve target) => Convert(target.Line); + public SOG.Line Convert(RG.LineCurve target) => Convert(target.Line); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/MeshToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/MeshToSpeckleConverter.cs index cf7dfbc288..73aa3f4a8a 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/MeshToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/MeshToSpeckleConverter.cs @@ -1,25 +1,25 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -[NameAndRankValue(nameof(IRhinoMesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class MeshToSpeckleConverter : ITypedConverter +[NameAndRankValue(nameof(RG.Mesh), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class MeshToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _boxConverter; + private readonly IConversionContextStack _contextStack; public MeshToSpeckleConverter( - ITypedConverter boxConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter pointConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack ) { + _pointConverter = pointConverter; _boxConverter = boxConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -28,7 +28,7 @@ IRhinoBoxFactory rhinoBoxFactory /// The Rhino Mesh to be converted. /// The converted Speckle Mesh. /// Thrown when the Rhino Mesh has 0 vertices or faces. - public SOG.Mesh Convert(IRhinoMesh target) + public SOG.Mesh Convert(RG.Mesh target) { if (target.Vertices.Count == 0 || target.Faces.Count == 0) { @@ -38,7 +38,7 @@ public SOG.Mesh Convert(IRhinoMesh target) var vertexCoordinates = target.Vertices.ToPoint3dArray().SelectMany(pt => new[] { pt.X, pt.Y, pt.Z }).ToList(); var faces = new List(); - foreach (IRhinoMeshNgon polygon in target.GetNgonAndFacesEnumerable()) + foreach (RG.MeshNgon polygon in target.GetNgonAndFacesEnumerable()) { var vertIndices = polygon.BoundaryVertexIndexList(); int n = vertIndices.Length; @@ -55,7 +55,7 @@ public SOG.Mesh Convert(IRhinoMesh target) var colors = target.VertexColors.Select(cl => cl.ToArgb()).ToList(); var volume = target.IsClosed ? target.Volume() : 0; - var bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.GetBoundingBox(false))); + var bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(false))); return new SOG.Mesh(vertexCoordinates, faces, colors, textureCoordinates, _contextStack.Current.SpeckleUnits) { diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsCurveConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsCurveConverter.cs index 7c28b72c3d..6cf8dca53d 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsCurveConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsCurveConverter.cs @@ -1,30 +1,27 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class NurbsCurveConverter : ITypedConverter +public class NurbsCurveConverter : ITypedConverter { - private readonly ITypedConverter _polylineConverter; - private readonly ITypedConverter _intervalConverter; - private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly ITypedConverter _polylineConverter; + private readonly ITypedConverter _intervalConverter; + private readonly ITypedConverter _boxConverter; + private readonly IConversionContextStack _contextStack; public NurbsCurveConverter( - ITypedConverter polylineConverter, - ITypedConverter intervalConverter, - ITypedConverter boxConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter polylineConverter, + ITypedConverter intervalConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack ) { _polylineConverter = polylineConverter; _intervalConverter = intervalConverter; _boxConverter = boxConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -37,9 +34,13 @@ IRhinoBoxFactory rhinoBoxFactory /// It adds 1 extra knot at the start and end of the vector by repeating the first and last value. /// This is because Rhino's standard of (controlPoints + degree + 1) wasn't followed on other software. /// - public SOG.Curve Convert(IRhinoNurbsCurve target) + public SOG.Curve Convert(RG.NurbsCurve target) { target.ToPolyline(0, 1, 0, 0, 0, 0.1, 0, 0, true).TryGetPolyline(out var poly); + if (target.IsClosed) + { + poly.Add(poly[0]); + } SOG.Polyline displayValue = _polylineConverter.Convert(poly); @@ -62,7 +63,7 @@ public SOG.Curve Convert(IRhinoNurbsCurve target) domain = _intervalConverter.Convert(nurbsCurve.Domain), closed = nurbsCurve.IsClosed, length = nurbsCurve.GetLength(), - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(nurbsCurve.GetBoundingBox(true))) + bbox = _boxConverter.Convert(new RG.Box(nurbsCurve.GetBoundingBox(true))) }; return myCurve; diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs index 4f4952622a..0d663ff520 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs @@ -1,30 +1,28 @@ -using Speckle.Converters.Common; +using Rhino; +using Rhino.Geometry.Collections; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class NurbsSurfaceToSpeckleConverter : ITypedConverter +public class NurbsSurfaceToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _boxConverter; - private readonly ITypedConverter _intervalConverter; - private readonly ITypedConverter _controlPointConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly ITypedConverter _boxConverter; + private readonly ITypedConverter _intervalConverter; + private readonly ITypedConverter _controlPointConverter; + private readonly IConversionContextStack _contextStack; public NurbsSurfaceToSpeckleConverter( - ITypedConverter boxConverter, - ITypedConverter intervalConverter, - ITypedConverter controlPointConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter boxConverter, + ITypedConverter intervalConverter, + ITypedConverter controlPointConverter, + IConversionContextStack contextStack ) { _boxConverter = boxConverter; _intervalConverter = intervalConverter; _controlPointConverter = controlPointConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -32,7 +30,7 @@ IRhinoBoxFactory rhinoBoxFactory /// /// The NurbsSurface object to convert. /// A Surface object representing the converted NurbsSurface. - public SOG.Surface Convert(IRhinoNurbsSurface target) + public SOG.Surface Convert(RG.NurbsSurface target) { var result = new SOG.Surface { @@ -46,7 +44,7 @@ public SOG.Surface Convert(IRhinoNurbsSurface target) knotsU = target.KnotsU.ToList(), knotsV = target.KnotsV.ToList(), units = _contextStack.Current.SpeckleUnits, - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.GetBoundingBox(true))) + bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(true))) }; result.SetControlPoints(ControlPointsToSpeckle(target.Points)); @@ -54,7 +52,7 @@ public SOG.Surface Convert(IRhinoNurbsSurface target) return result; } - private List> ControlPointsToSpeckle(IRhinoNurbsSurfacePointList controlPoints) + private List> ControlPointsToSpeckle(NurbsSurfacePointList controlPoints) { var points = new List>(); for (var i = 0; i < controlPoints.CountU; i++) diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PlaneToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PlaneToSpeckleConverter.cs index b2a3264467..40d15be50c 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PlaneToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PlaneToSpeckleConverter.cs @@ -1,19 +1,19 @@ +using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class PlaneToSpeckleConverter : ITypedConverter +public class PlaneToSpeckleConverter : ITypedConverter { - private readonly ITypedConverter _vectorConverter; - private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _vectorConverter; + private readonly ITypedConverter _pointConverter; + private readonly IConversionContextStack _contextStack; public PlaneToSpeckleConverter( - ITypedConverter vectorConverter, - ITypedConverter pointConverter, - IConversionContextStack contextStack + ITypedConverter vectorConverter, + ITypedConverter pointConverter, + IConversionContextStack contextStack ) { _vectorConverter = vectorConverter; @@ -26,7 +26,7 @@ IConversionContextStack contextStack /// /// The instance of Rhino Plane to convert. /// The converted instance of Speckle Plane. - public SOG.Plane Convert(IRhinoPlane target) => + public SOG.Plane Convert(RG.Plane target) => new( _pointConverter.Convert(target.Origin), _vectorConverter.Convert(target.ZAxis), diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PointToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PointToSpeckleConverter.cs index c110af447a..2bfdfdae1c 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -1,16 +1,14 @@ +using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class PointToSpeckleConverter - : ITypedConverter, - ITypedConverter +public class PointToSpeckleConverter : ITypedConverter, ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConversionContextStack _contextStack; - public PointToSpeckleConverter(IConversionContextStack contextStack) + public PointToSpeckleConverter(IConversionContextStack contextStack) { _contextStack = contextStack; } @@ -20,8 +18,7 @@ public PointToSpeckleConverter(IConversionContextStack /// The Rhino 3D point to convert. /// The converted Speckle point. - public SOG.Point Convert(IRhinoPoint3d target) => - new(target.X, target.Y, target.Z, _contextStack.Current.SpeckleUnits); + public SOG.Point Convert(RG.Point3d target) => new(target.X, target.Y, target.Z, _contextStack.Current.SpeckleUnits); - public SOG.Point Convert(IRhinoPoint target) => Convert(target.Location); + public SOG.Point Convert(RG.Point target) => Convert(target.Location); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs index 10cdf491d5..6937d6b007 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs @@ -1,30 +1,26 @@ using Objects; +using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class PolyCurveToSpeckleConverter : ITypedConverter +public class PolyCurveToSpeckleConverter : ITypedConverter { - public ITypedConverter? CurveConverter { get; set; } // POC: CNX-9279 This created a circular dependency on the constructor, making it a property allows for the container to resolve it correctly - - private readonly ITypedConverter _intervalConverter; - private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + public ITypedConverter? CurveConverter { get; set; } // POC: CNX-9279 This created a circular dependency on the constructor, making it a property allows for the container to resolve it correctly + private readonly ITypedConverter _intervalConverter; + private readonly ITypedConverter _boxConverter; + private readonly IConversionContextStack _contextStack; public PolyCurveToSpeckleConverter( - ITypedConverter intervalConverter, - ITypedConverter boxConverter, - IConversionContextStack contextStack, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter intervalConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack ) { _intervalConverter = intervalConverter; _boxConverter = boxConverter; _contextStack = contextStack; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -36,14 +32,14 @@ IRhinoBoxFactory rhinoBoxFactory /// This method removes the nesting of the PolyCurve by duplicating the segments at a granular level. /// All PolyLIne, PolyCurve and NURBS curves with G1 discontinuities will be broken down. /// - public SOG.Polycurve Convert(IRhinoPolyCurve target) + public SOG.Polycurve Convert(RG.PolyCurve target) { var myPoly = new SOG.Polycurve { closed = target.IsClosed, domain = _intervalConverter.Convert(target.Domain), length = target.GetLength(), - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.GetBoundingBox(true))), + bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(true))), segments = target.DuplicateSegments().Select(x => CurveConverter.NotNull().Convert(x)).ToList(), units = _contextStack.Current.SpeckleUnits }; diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolylineToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolylineToSpeckleConverter.cs index 7682ceeb42..1ee241e7d1 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolylineToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/PolylineToSpeckleConverter.cs @@ -1,32 +1,29 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; public class PolylineToSpeckleConverter - : ITypedConverter, - ITypedConverter + : ITypedConverter, + ITypedConverter { - private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _boxConverter; - private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _boxConverter; + private readonly ITypedConverter _intervalConverter; + private readonly IConversionContextStack _contextStack; public PolylineToSpeckleConverter( - ITypedConverter pointConverter, - ITypedConverter boxConverter, - IConversionContextStack contextStack, - ITypedConverter intervalConverter, - IRhinoBoxFactory rhinoBoxFactory + ITypedConverter pointConverter, + ITypedConverter boxConverter, + IConversionContextStack contextStack, + ITypedConverter intervalConverter ) { _pointConverter = pointConverter; _boxConverter = boxConverter; _contextStack = contextStack; _intervalConverter = intervalConverter; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -35,12 +32,12 @@ IRhinoBoxFactory rhinoBoxFactory /// The Rhino polyline to be converted. /// The converted Speckle polyline. /// ⚠️ This conversion assumes domain interval is (0,LENGTH) as Rhino Polylines have no domain. If needed, you may want to use PolylineCurve conversion instead. - public SOG.Polyline Convert(IRhinoPolyline target) + public SOG.Polyline Convert(RG.Polyline target) { - var box = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.BoundingBox)); + var box = _boxConverter.Convert(new RG.Box(target.BoundingBox)); var points = target.Select(pt => _pointConverter.Convert(pt)).ToList(); - if (points[0] == points[^1] && target.IsClosed) + if (target.IsClosed) { points.RemoveAt(points.Count - 1); } @@ -51,8 +48,8 @@ public SOG.Polyline Convert(IRhinoPolyline target) ) { bbox = box, - length = target.Count, - domain = new(0, target.Count), + length = target.Length, + domain = new(0, target.Length), closed = target.IsClosed }; } @@ -63,7 +60,7 @@ public SOG.Polyline Convert(IRhinoPolyline target) /// The Rhino PolylineCurve to be converted. /// The converted Speckle polyline. /// ✅ This conversion respects the domain of the original PolylineCurve - public SOG.Polyline Convert(IRhinoPolylineCurve target) + public SOG.Polyline Convert(RG.PolylineCurve target) { var result = Convert(target.ToPolyline()); result.domain = _intervalConverter.Convert(target.Domain); diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/RawPointCloudToSpeckle.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/RawPointCloudToSpeckle.cs index f7d0fdee98..5e4a17e6cb 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/RawPointCloudToSpeckle.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/RawPointCloudToSpeckle.cs @@ -1,24 +1,21 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class RawPointCloudToSpeckle : ITypedConverter +public class RawPointCloudToSpeckle : ITypedConverter { - private readonly IConversionContextStack _contextStack; - private readonly ITypedConverter _boxConverter; - private readonly IRhinoBoxFactory _rhinoBoxFactory; + private readonly IConversionContextStack _contextStack; + private readonly ITypedConverter _boxConverter; public RawPointCloudToSpeckle( - IConversionContextStack contextStack, - ITypedConverter boxConverter, - IRhinoBoxFactory rhinoBoxFactory + IConversionContextStack contextStack, + ITypedConverter boxConverter ) { _contextStack = contextStack; _boxConverter = boxConverter; - _rhinoBoxFactory = rhinoBoxFactory; } /// @@ -26,12 +23,12 @@ IRhinoBoxFactory rhinoBoxFactory /// /// The Rhino PointCloud object to convert. /// The converted Speckle Pointcloud object. - public SOG.Pointcloud Convert(IRhinoPointCloud target) => + public SOG.Pointcloud Convert(RG.PointCloud target) => new() { points = target.GetPoints().SelectMany(pt => new[] { pt.X, pt.Y, pt.Z }).ToList(), colors = target.GetColors().Select(o => o.ToArgb()).ToList(), - bbox = _boxConverter.Convert(_rhinoBoxFactory.CreateBox(target.GetBoundingBox(true))), + bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(true))), units = _contextStack.Current.SpeckleUnits }; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/VectorToSpeckleConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/VectorToSpeckleConverter.cs index fe5de7db27..489eddedc4 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/VectorToSpeckleConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/Raw/VectorToSpeckleConverter.cs @@ -1,14 +1,14 @@ -using Speckle.Converters.Common; +using Rhino; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.Raw; -public class VectorToSpeckleConverter : ITypedConverter +public class VectorToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConversionContextStack _contextStack; - public VectorToSpeckleConverter(IConversionContextStack contextStack) + public VectorToSpeckleConverter(IConversionContextStack contextStack) { _contextStack = contextStack; } @@ -18,6 +18,6 @@ public VectorToSpeckleConverter(IConversionContextStack /// The Rhino Vector3d object to convert. /// The converted Speckle Vector object. - public SOG.Vector Convert(IRhinoVector3d target) => + public SOG.Vector Convert(RG.Vector3d target) => new(target.X, target.Y, target.Z, _contextStack.Current.SpeckleUnits); } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs index d55b39090c..7520c1bd83 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/BrepObjectToSpeckleTopLevelConverter.cs @@ -1,23 +1,23 @@ -using Speckle.Converters.Common; +using Rhino.DocObjects; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(IRhinoBrepObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(nameof(BrepObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class BrepObjectToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { - private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _curveConverter; - public BrepObjectToSpeckleTopLevelConverter(ITypedConverter curveConverter) + public BrepObjectToSpeckleTopLevelConverter(ITypedConverter curveConverter) { _curveConverter = curveConverter; } public Base Convert(object target) { - var curveObject = (IRhinoBrepObject)target; //can only be this type + var curveObject = (BrepObject)target; var speckleCurve = _curveConverter.Convert(curveObject.BrepGeometry); return speckleCurve; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs index 34fcf6c18e..a8214a0c97 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/CurveObjectToSpeckleTopLevelConverter.cs @@ -1,16 +1,15 @@ -using Speckle.Converters.Common; +using Rhino.DocObjects; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(IRhinoCurveObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class CurveObjectToSpeckleTopLevelConverter - : RhinoObjectToSpeckleTopLevelConverter +[NameAndRankValue(nameof(CurveObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class CurveObjectToSpeckleTopLevelConverter : RhinoObjectToSpeckleTopLevelConverter { - public CurveObjectToSpeckleTopLevelConverter(ITypedConverter conversion) + public CurveObjectToSpeckleTopLevelConverter(ITypedConverter conversion) : base(conversion) { } - protected override IRhinoCurve GetTypedGeometry(IRhinoCurveObject input) => input.CurveGeometry; + protected override RG.Curve GetTypedGeometry(CurveObject input) => input.CurveGeometry; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs index 3c5d93335d..46d2c27586 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/ExtrusionObjectToSpeckleTopLevelConverter.cs @@ -1,23 +1,23 @@ -using Speckle.Converters.Common; +using Rhino.DocObjects; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Core.Models; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(IRhinoExtrusionObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(nameof(ExtrusionObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class ExtrusionObjectToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter { - private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter _curveConverter; - public ExtrusionObjectToSpeckleTopLevelConverter(ITypedConverter curveConverter) + public ExtrusionObjectToSpeckleTopLevelConverter(ITypedConverter curveConverter) { _curveConverter = curveConverter; } public Base Convert(object target) { - var curveObject = (IRhinoExtrusionObject)target; //can only be this type + var curveObject = (ExtrusionObject)target; var speckleCurve = _curveConverter.Convert(curveObject.ExtrusionGeometry.ToBrep()); return speckleCurve; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs index 025e36fd99..f1c9675a04 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/MeshObjectToSpeckleTopLevelConverter.cs @@ -1,15 +1,14 @@ -using Speckle.Converters.Common; +using Rhino.DocObjects; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(IRhinoMeshObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class MeshObjectToSpeckleTopLevelConverter - : RhinoObjectToSpeckleTopLevelConverter +[NameAndRankValue(nameof(MeshObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class MeshObjectToSpeckleTopLevelConverter : RhinoObjectToSpeckleTopLevelConverter { - public MeshObjectToSpeckleTopLevelConverter(ITypedConverter conversion) + public MeshObjectToSpeckleTopLevelConverter(ITypedConverter conversion) : base(conversion) { } - protected override IRhinoMesh GetTypedGeometry(IRhinoMeshObject input) => input.MeshGeometry; + protected override RG.Mesh GetTypedGeometry(MeshObject input) => input.MeshGeometry; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs index b25c80d190..e741e38e49 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointCloudObjectToSpeckleTopLevelConverter.cs @@ -1,15 +1,15 @@ -using Speckle.Converters.Common; +using Rhino.DocObjects; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(IRhinoPointCloudObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(nameof(PointCloudObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointCloudObjectToSpeckleTopLevelConverter - : RhinoObjectToSpeckleTopLevelConverter + : RhinoObjectToSpeckleTopLevelConverter { - public PointCloudObjectToSpeckleTopLevelConverter(ITypedConverter conversion) + public PointCloudObjectToSpeckleTopLevelConverter(ITypedConverter conversion) : base(conversion) { } - protected override IRhinoPointCloud GetTypedGeometry(IRhinoPointCloudObject input) => input.PointCloudGeometry; + protected override RG.PointCloud GetTypedGeometry(PointCloudObject input) => input.PointCloudGeometry; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs index d127aa0266..7d9c750b64 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/PointObjectToSpeckleTopLevelConverter.cs @@ -1,15 +1,15 @@ -using Speckle.Converters.Common; +using Rhino.DocObjects; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Rhino7.Interfaces; namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(IRhinoPointObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(nameof(PointObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PointObjectToSpeckleTopLevelConverter - : RhinoObjectToSpeckleTopLevelConverter + : RhinoObjectToSpeckleTopLevelConverter { - public PointObjectToSpeckleTopLevelConverter(ITypedConverter conversion) + public PointObjectToSpeckleTopLevelConverter(ITypedConverter conversion) : base(conversion) { } - protected override IRhinoPoint GetTypedGeometry(IRhinoPointObject input) => input.PointGeometry; + protected override RG.Point GetTypedGeometry(PointObject input) => input.PointGeometry; } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/RhinoObjectToSpeckleTopLevelConverter.cs b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/RhinoObjectToSpeckleTopLevelConverter.cs index f86d7a09f5..edff24473a 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/RhinoObjectToSpeckleTopLevelConverter.cs +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToSpeckle/TopLevel/RhinoObjectToSpeckleTopLevelConverter.cs @@ -4,15 +4,15 @@ namespace Speckle.Converters.Rhino7.ToSpeckle.TopLevel; public abstract class RhinoObjectToSpeckleTopLevelConverter : IToSpeckleTopLevelConverter - where TTopLevelIn : notnull - where TInRaw : notnull + where TTopLevelIn : Rhino.DocObjects.RhinoObject + where TInRaw : RG.GeometryBase where TOutRaw : Base { - private readonly ITypedConverter _conversion; + public ITypedConverter Conversion { get; } protected RhinoObjectToSpeckleTopLevelConverter(ITypedConverter conversion) { - _conversion = conversion; + Conversion = conversion; } // POC: IIndex would fix this as I would just request the type from `RhinoObject.Geometry` directly. @@ -20,10 +20,10 @@ protected RhinoObjectToSpeckleTopLevelConverter(ITypedConverter public virtual Base Convert(object target) { - var typedTarget = (TTopLevelIn)target; //can only be this typee + var typedTarget = (TTopLevelIn)target; var typedGeometry = GetTypedGeometry(typedTarget); - var result = _conversion.Convert(typedGeometry); + var result = Conversion.Convert(typedGeometry); // POC: Any common operations for all RhinoObjects should be done here, not on the specific implementer // Things like user-dictionaries and other user-defined metadata. diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json index e88d9d0998..57b03cf40e 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json @@ -18,18 +18,18 @@ "resolved": "1.14.1", "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" }, + "RhinoCommon": { + "type": "Direct", + "requested": "[7.13.21348.13001, )", + "resolved": "7.13.21348.13001", + "contentHash": "JQdaNw61ddBqIe08E9O4N/grwrN1hjDHcYW7tWylwCZyFR7SepoCD4NS+6LN6+oSQhNbhLi9Bf+hQOFYFdRAEA==" + }, "Speckle.InterfaceGenerator": { "type": "Direct", "requested": "[0.9.5, )", "resolved": "0.9.5", "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" }, - "Speckle.Rhino7.Interfaces": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "TcbfXlRMnQRat1JodgW+YW5FflTYem1GGo9DtKA+6iAuVaYagN5dxsrM5LE6M3pCnEV9rkEQOjFo7sgnnbo4mw==" - }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json index 2586c0cd45..9529e2c9c7 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json @@ -262,29 +262,6 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", @@ -803,29 +780,6 @@ "Serilog": "2.10.0" } }, - "Speckle.Core": { - "type": "Transitive", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, "Speckle.Newtonsoft.Json": { "type": "Transitive", "resolved": "13.0.2", diff --git a/DUI3-DX/Directory.Packages.props b/DUI3-DX/Directory.Packages.props index 5e7ea97006..ece50df9a0 100644 --- a/DUI3-DX/Directory.Packages.props +++ b/DUI3-DX/Directory.Packages.props @@ -3,25 +3,22 @@ - - - - - - - + + + + diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs b/DUI3-DX/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs index 3168ac7709..93a7c326dd 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.Logging; +using Autofac; +using Microsoft.Extensions.Logging; using Serilog; using Speckle.Autofac.DependencyInjection; using Speckle.Connectors.Utils.Cancellation; @@ -19,6 +20,9 @@ public static void AddConnectorUtils(this SpeckleContainerBuilder builder) var serilogLogger = SpeckleLog.Logger; ILoggerFactory loggerFactory = new LoggerFactory().AddSerilog(serilogLogger); + builder.ContainerBuilder.Register(_ => loggerFactory).As().SingleInstance().AutoActivate(); + + builder.ContainerBuilder.RegisterGeneric(typeof(Logger<>)).As(typeof(ILogger<>)).SingleInstance(); builder.AddSingleton(loggerFactory); } } diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj index d379d2aace..125a1a6f7a 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj @@ -6,6 +6,7 @@ + diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json index 077e72b92b..2b72b82db0 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json @@ -2,6 +2,15 @@ "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { + "Autofac": { + "type": "Direct", + "requested": "[5.2.0, )", + "resolved": "5.2.0", + "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + } + }, "Microsoft.SourceLink.GitHub": { "type": "Direct", "requested": "[8.0.0, )", diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs index 07f974d26a..6a5fb37913 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs @@ -12,7 +12,6 @@ this SpeckleContainerBuilder builder where TRootToSpeckleConverter : class, IRootToSpeckleConverter where THostToSpeckleUnitConverter : class, IHostToSpeckleUnitConverter { - builder.ScanAssemblyOfType(); builder.AddScoped(); builder.AddScoped, THostToSpeckleUnitConverter>(); /* @@ -30,7 +29,7 @@ This will require consolidating across other connectors. builder.AddScoped(); - builder.RegisterConverters(); + builder.RegisterRawConversions(); builder.InjectNamedTypes(); builder.InjectNamedTypes(); } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs index 1c701cc642..c4a0800ce7 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs @@ -7,8 +7,6 @@ namespace Speckle.Converters.Common.DependencyInjection; public static class ConversionTypesInjector { - private record NamedType(string Name, int Rank, Type Type); - public static void InjectNamedTypes(this SpeckleContainerBuilder containerBuilder) where T : notnull { @@ -21,33 +19,33 @@ public static void InjectNamedTypes(this SpeckleContainerBuilder containerBui { var nameAndRank = x.GetCustomAttribute(); - return new NamedType(Name: nameAndRank.Name, Rank: nameAndRank.Rank, Type: x); + return (name: nameAndRank.Name, rank: nameAndRank.Rank, type: x); }) .ToList(); // we'll register the types accordingly - var names = byName.Select(x => x.Name).Distinct(); + var names = byName.Select(x => x.name).Distinct(); foreach (string name in names) { - var namedTypes = byName.Where(x => x.Name == name).OrderByDescending(y => y.Rank).ToList(); + var namedTypes = byName.Where(x => x.name == name).OrderByDescending(y => y.rank).ToList(); // first type found var first = namedTypes[0]; // POC: may need to be instance per lifecycle scope - containerBuilder.ContainerBuilder.RegisterType(first.Type).Keyed(first.Name).InstancePerLifetimeScope(); + containerBuilder.ContainerBuilder.RegisterType(first.type).Keyed(first.name).InstancePerLifetimeScope(); // POC: not sure yet if... // * This should be an array of types // * Whether the scope should be modified or modifiable // * Whether this is in the write project... hmmm // POC: IsAssignableFrom() - var secondaryType = first.Type.GetInterface(typeof(ITypedConverter<,>).Name); + var secondaryType = first.type.GetInterface(typeof(ITypedConverter<,>).Name); // POC: should we explode if no found? if (secondaryType != null) { containerBuilder.ContainerBuilder - .RegisterType(first.Type) + .RegisterType(first.type) .As(secondaryType) .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies) .InstancePerLifetimeScope(); @@ -59,8 +57,8 @@ public static void InjectNamedTypes(this SpeckleContainerBuilder containerBui { // POC: is this the right scope? containerBuilder.ContainerBuilder - .RegisterType(other.Type) - .Keyed($"{other.Name}|{other.Rank}") + .RegisterType(other.type) + .Keyed($"{other.name}|{other.rank}") .InstancePerLifetimeScope(); // POC: not sure yet if... @@ -69,11 +67,11 @@ public static void InjectNamedTypes(this SpeckleContainerBuilder containerBui // * Whether this is in the write project... hmmm // POC: IsAssignableFrom() // NOT very DRY - secondaryType = first.Type.GetInterface(typeof(ITypedConverter<,>).Name); + secondaryType = first.type.GetInterface(typeof(ITypedConverter<,>).Name); // POC: should we explode if no found? if (secondaryType != null) { - containerBuilder.ContainerBuilder.RegisterType(first.Type).As(secondaryType).InstancePerLifetimeScope(); + containerBuilder.ContainerBuilder.RegisterType(first.type).As(secondaryType).InstancePerLifetimeScope(); } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs index 7b8743151e..73745af1f7 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs @@ -6,29 +6,22 @@ namespace Speckle.Converters.Common.DependencyInjection; // POC: review and see if it can be made more generic, related to the // NameAndRankAttribute work that needs doing -public static class ConverterRegistration +public static class RawConversionRegisterer { - public static void RegisterConverters(this SpeckleContainerBuilder containerBuilder) + public static void RegisterRawConversions(this SpeckleContainerBuilder containerBuilder) { // POC: hard-coding speckle... :/ foreach (Type speckleType in containerBuilder.SpeckleTypes) { - foreach (var conversionInterface in RegisterConversionsForType(speckleType)) - { - containerBuilder.ContainerBuilder - .RegisterType(speckleType) - .As(conversionInterface) - .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies) - .InstancePerLifetimeScope(); - } + RegisterRawConversionsForType(containerBuilder.ContainerBuilder, speckleType); } } - private static IEnumerable RegisterConversionsForType(Type type) + private static void RegisterRawConversionsForType(ContainerBuilder containerBuilder, Type type) { if (!type.IsClass || type.IsAbstract) { - yield break; + return; } var rawConversionInterfaces = type.GetInterfaces() @@ -36,7 +29,11 @@ private static IEnumerable RegisterConversionsForType(Type type) foreach (var conversionInterface in rawConversionInterfaces) { - yield return conversionInterface.NotNull(); + containerBuilder + .RegisterType(type) + .As(conversionInterface) + .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies) + .InstancePerLifetimeScope(); } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/FakeType.cs b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/FakeType.cs deleted file mode 100644 index 517313bd4b..0000000000 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/FakeType.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Reflection; - -namespace Speckle.Converters.Common.Tests; - -public class FakeType : Type -{ - public FakeType(string name) - { - Name = name; - } - - public override object[] GetCustomAttributes(bool inherit) => throw new NotImplementedException(); - - public override bool IsDefined(Type attributeType, bool inherit) => throw new NotImplementedException(); - - public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override Type GetInterface(string name, bool ignoreCase) => throw new NotImplementedException(); - - public override Type[] GetInterfaces() => throw new NotImplementedException(); - - public override EventInfo GetEvent(string name, BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override EventInfo[] GetEvents(BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override Type[] GetNestedTypes(BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override Type GetNestedType(string name, BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override Type GetElementType() => throw new NotImplementedException(); - - protected override bool HasElementTypeImpl() => throw new NotImplementedException(); - - protected override PropertyInfo GetPropertyImpl( - string name, - BindingFlags bindingAttr, - Binder binder, - Type returnType, - Type[] types, - ParameterModifier[] modifiers - ) => throw new NotImplementedException(); - - public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) => throw new NotImplementedException(); - - protected override MethodInfo GetMethodImpl( - string name, - BindingFlags bindingAttr, - Binder binder, - CallingConventions callConvention, - Type[] types, - ParameterModifier[] modifiers - ) => throw new NotImplementedException(); - - public override MethodInfo[] GetMethods(BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override FieldInfo GetField(string name, BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override FieldInfo[] GetFields(BindingFlags bindingAttr) => throw new NotImplementedException(); - - public override MemberInfo[] GetMembers(BindingFlags bindingAttr) => throw new NotImplementedException(); - - protected override TypeAttributes GetAttributeFlagsImpl() => throw new NotImplementedException(); - - protected override bool IsArrayImpl() => throw new NotImplementedException(); - - protected override bool IsByRefImpl() => throw new NotImplementedException(); - - protected override bool IsPointerImpl() => throw new NotImplementedException(); - - protected override bool IsPrimitiveImpl() => throw new NotImplementedException(); - - protected override bool IsCOMObjectImpl() => throw new NotImplementedException(); - - public override object InvokeMember( - string name, - BindingFlags invokeAttr, - Binder binder, - object target, - object[] args, - ParameterModifier[] modifiers, - CultureInfo culture, - string[] namedParameters - ) => throw new NotImplementedException(); - - public override Type UnderlyingSystemType { get; } - - protected override ConstructorInfo GetConstructorImpl( - BindingFlags bindingAttr, - Binder binder, - CallingConventions callConvention, - Type[] types, - ParameterModifier[] modifiers - ) => throw new NotImplementedException(); - - public override string Name { get; } - - [SuppressMessage("Naming", "CA1720:Identifier contains type name")] - public override Guid GUID { get; } = Guid.Empty; - public override Module Module { get; } - public override Assembly Assembly { get; } - public override string FullName { get; } - public override string Namespace { get; } - public override string AssemblyQualifiedName { get; } - public override Type BaseType { get; } - - public override object[] GetCustomAttributes(Type attributeType, bool inherit) => throw new NotImplementedException(); -} diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/RootToSpeckleConverterTests.cs b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/RootToSpeckleConverterTests.cs deleted file mode 100644 index ae505bb94b..0000000000 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/RootToSpeckleConverterTests.cs +++ /dev/null @@ -1,66 +0,0 @@ -using FluentAssertions; -using Moq; -using NUnit.Framework; -using Speckle.Core.Models; - -namespace Speckle.Converters.Common.Tests; - -public class RootToSpeckleConverterTests -{ - private readonly MockRepository _repository = new(MockBehavior.Strict); - - private readonly Mock _rootConvertManager; - private readonly Mock _proxyMapper; - private readonly Mock _rootElementProvider; - - public RootToSpeckleConverterTests() - { - _rootConvertManager = _repository.Create(); - _proxyMapper = _repository.Create(); - _rootElementProvider = _repository.Create(); - } - - [TearDown] - public void Verify() => _repository.VerifyAll(); - - [Test] - public void Convert_BaseType() - { - try - { - Type baseType = new FakeType("baseType"); - Type hostType = new FakeType("hostType"); - - object target = new(); - Type targetType = new FakeType("targetType"); - - object wrappedTarget = new(); - Base converted = new(); - - _rootConvertManager.Setup(x => x.GetTargetType(target)).Returns(targetType); - _rootElementProvider.Setup(x => x.GetRootType()).Returns(baseType); - _proxyMapper.Setup(x => x.GetHostTypeFromMappedType(baseType)).Returns(hostType); - - _proxyMapper.Setup(x => x.GetMappedTypeFromHostType(targetType)).Returns((Type?)null); - _proxyMapper.Setup(x => x.GetMappedTypeFromProxyType(targetType)).Returns((Type?)null); - - _rootConvertManager.Setup(x => x.IsSubClass(baseType, targetType)).Returns(true); - _proxyMapper.Setup(x => x.CreateProxy(baseType, target)).Returns(wrappedTarget); - _rootConvertManager.Setup(x => x.Convert(baseType, wrappedTarget)).Returns(converted); - - var rootToSpeckleConverter = new RootToSpeckleConverter( - _proxyMapper.Object, - _rootConvertManager.Object, - _rootElementProvider.Object - ); - var testConverted = rootToSpeckleConverter.Convert(target); - - testConverted.Should().BeSameAs(converted); - } - catch (Exception e) - { - Console.WriteLine(e); - throw; - } - } -} diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj deleted file mode 100644 index e5baa8e603..0000000000 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net48 - x64 - false - true - - - - - - - - - - - - - - - - - diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json deleted file mode 100644 index 25241e1d85..0000000000 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.Tests/packages.lock.json +++ /dev/null @@ -1,468 +0,0 @@ -{ - "version": 2, - "dependencies": { - ".NETFramework,Version=v4.8": { - "FluentAssertions": { - "type": "Direct", - "requested": "[6.12.0, )", - "resolved": "6.12.0", - "contentHash": "ZXhHT2YwP9lajrwSKbLlFqsmCCvFJMoRSK9t7sImfnCyd0OB3MhgxdoMcVqxbq1iyxD6mD2fiackWmBb7ayiXQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.0" - } - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.10.0, )", - "resolved": "17.10.0", - "contentHash": "0/2HeACkaHEYU3wc83YlcD2Fi4LMtECJjqrtvw0lPi9DCEa35zSPt1j4fuvM8NagjDqJuh1Ja35WcRtn1Um6/A==", - "dependencies": { - "Microsoft.CodeCoverage": "17.10.0" - } - }, - "Microsoft.SourceLink.GitHub": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "8.0.0", - "Microsoft.SourceLink.Common": "8.0.0" - } - }, - "Moq": { - "type": "Direct", - "requested": "[4.20.70, )", - "resolved": "4.20.70", - "contentHash": "4rNnAwdpXJBuxqrOCzCyICXHSImOTRktCgCWXWykuF1qwoIsVvEnR7PjbMk/eLOxWvhmj5Kwt+kDV3RGUYcNwg==", - "dependencies": { - "Castle.Core": "5.1.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "NUnit": { - "type": "Direct", - "requested": "[4.1.0, )", - "resolved": "4.1.0", - "contentHash": "MT/DpAhjtiytzhTgTqIhBuWx4y26PKfDepYUHUM+5uv4TsryHC2jwFo5e6NhWkApCm/G6kZ80dRjdJFuAxq3rg==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "NUnit.Analyzers": { - "type": "Direct", - "requested": "[4.2.0, )", - "resolved": "4.2.0", - "contentHash": "4fJojPkzdoa4nB2+p6U+fITvPnVvwWSnsmiJ/Dl30xqiL3oxNbYvfeSLVd91hOmEjoUqSwN3Z7j1aFedjqWbUA==" - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.5, )", - "resolved": "0.9.5", - "contentHash": "oU/L7pN1R7q8KkbrpQ3WJnHirPHqn+9DEA7asOcUiggV5dzVg1A/VYs7GOSusD24njxXh03tE3a2oTLOjt3cVg==" - }, - "Speckle.Revit2023.Interfaces": { - "type": "Direct", - "requested": "[0.1.1-preview.0.28, )", - "resolved": "0.1.1-preview.0.28", - "contentHash": "7szXg/vRvP3Wdrn2ZGriVOfsw+bddlpVorBkCIhSHHs5qVTTG8IAIrI1l9dO0/aullaTMF+Xgxm9x3w1aXPiuA==" - }, - "Castle.Core": { - "type": "Transitive", - "resolved": "5.1.1", - "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==" - }, - "GraphQL.Client": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0", - "GraphQL.Client.Abstractions.Websocket": "6.0.0", - "System.Net.WebSockets.Client.Managed": "1.0.22", - "System.Reactive": "5.0.0" - } - }, - "GraphQL.Client.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", - "dependencies": { - "GraphQL.Primitives": "6.0.0" - } - }, - "GraphQL.Client.Abstractions.Websocket": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0" - } - }, - "GraphQL.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.10.0", - "contentHash": "yC7oSlnR54XO5kOuHlVOKtxomNNN1BWXX8lK1G2jaPXT9sUok7kCOoA4Pgs0qyFaCtMrNsprztYMeoEGqCm4uA==" - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "KGxbPeWsQMnmQy43DSBxAFtHz3l2JX8EWBSGUCvT3CuZ8KsuzbkqMIJMDOxWtG8eZSoCDI04aiVQjWuuV8HmSw==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.5", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "FTerRmQPqHrCrnoUzhBu+E+1DNGwyrAMLqHkAqOOOu5pGfyMOj8qQUBxI/gDtWtG11p49UxSfWmBzRNlwZqfUg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" - }, - "Polly": { - "type": "Transitive", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" - }, - "Polly.Contrib.WaitAndRetry": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" - }, - "Polly.Extensions.Http": { - "type": "Transitive", - "resolved": "3.0.0", - "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", - "dependencies": { - "Polly": "7.1.0" - } - }, - "Sentry": { - "type": "Transitive", - "resolved": "3.33.0", - "contentHash": "8vbD2o6IR2wrRrkSiRbnodWGWUOqIlwYtzpjvPNOb5raJdOf+zxMwfS8f6nx9bmrTTfDj7KrCB8C/5OuicAc8A==", - "dependencies": { - "System.Reflection.Metadata": "5.0.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Text.Json": "5.0.2" - } - }, - "Sentry.Serilog": { - "type": "Transitive", - "resolved": "3.33.0", - "contentHash": "V8BU7QGWg2qLYfNPqtuTBhC1opysny5l+Ifp6J6PhOeAxU0FssR7nYfbJVetrnLIoh2rd3DlJ6hHYYQosQYcUQ==", - "dependencies": { - "Sentry": "3.33.0", - "Serilog": "2.7.1" - } - }, - "Serilog": { - "type": "Transitive", - "resolved": "2.12.0", - "contentHash": "xaiJLIdu6rYMKfQMYUZgTy8YK7SMZjB4Yk50C/u//Z4OsvxkUfSPJy4nknfvwAC34yr13q7kcyh4grbwhSxyZg==" - }, - "Serilog.Enrichers.ClientInfo": { - "type": "Transitive", - "resolved": "1.3.0", - "contentHash": "mTc7PM+wC9Hr7LWSwqt5mmnlAr7RJs+eTb3PGPRhwdOackk95MkhUZognuxXEdlW19HAFNmEBTSBY5DfLwM8jQ==", - "dependencies": { - "Serilog": "2.4.0" - } - }, - "Serilog.Exceptions": { - "type": "Transitive", - "resolved": "8.4.0", - "contentHash": "nc/+hUw3lsdo0zCj0KMIybAu7perMx79vu72w0za9Nsi6mWyNkGXxYxakAjWB7nEmYL6zdmhEQRB4oJ2ALUeug==", - "dependencies": { - "Serilog": "2.8.0" - } - }, - "Serilog.Formatting.Compact": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "pNroKVjo+rDqlxNG5PXkRLpfSCuDOBY0ri6jp9PLe505ljqwhwZz8ospy2vWhQlFu5GkIesh3FcDs4n7sWZODA==", - "dependencies": { - "Serilog": "2.8.0" - } - }, - "Serilog.Sinks.Console": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "K6N5q+5fetjnJPvCmkWOpJ/V8IEIoMIB1s86OzBrbxwTyHxdx3pmz4H+8+O/Dc/ftUX12DM1aynx/dDowkwzqg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Serilog.Sinks.File": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "uwV5hdhWPwUH1szhO8PJpFiahqXmzPzJT/sOijH/kFgUx+cyoDTMM8MHD0adw9+Iem6itoibbUXHYslzXsLEAg==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Serilog.Sinks.PeriodicBatching": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "NDWR7m3PalVlGEq3rzoktrXikjFMLmpwF0HI4sowo8YDdU+gqPlTHlDQiOGxHfB0sTfjPA9JjA7ctKG9zqjGkw==", - "dependencies": { - "Serilog": "2.0.0" - } - }, - "Serilog.Sinks.Seq": { - "type": "Transitive", - "resolved": "5.2.2", - "contentHash": "1Csmo5ua7NKUe0yXUx+zsRefjAniPWcXFhUXxXG8pwo0iMiw2gjn9SOkgYnnxbgWqmlGv236w0N/dHc2v5XwMg==", - "dependencies": { - "Serilog": "2.12.0", - "Serilog.Formatting.Compact": "1.1.0", - "Serilog.Sinks.File": "5.0.0", - "Serilog.Sinks.PeriodicBatching": "3.1.0" - } - }, - "SerilogTimings": { - "type": "Transitive", - "resolved": "3.0.1", - "contentHash": "Zs28eTgszAMwpIrbBnWHBI50yuxL50p/dmAUWmy75+axdZYK/Sjm5/5m1N/CisR8acJUhTVcjPZrsB1P5iv0Uw==", - "dependencies": { - "Serilog": "2.10.0" - } - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "SQLitePCLRaw.bundle_e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", - "dependencies": { - "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", - "SQLitePCLRaw.provider.dynamic_cdecl": "2.1.4" - } - }, - "SQLitePCLRaw.core": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - }, - "SQLitePCLRaw.provider.dynamic_cdecl": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "ZsaKKhgYF9B1fvcnOGKl3EycNAwd9CRWX7v0rEfuPWhQQ5Jjpvf2VEHahiLIGHio3hxi3EIKFJw9KvyowWOUAw==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections.Immutable": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", - "dependencies": { - "System.Memory": "4.5.4" - } - }, - "System.DoubleNumerics": { - "type": "Transitive", - "resolved": "3.1.3", - "contentHash": "KRKEM/L3KBodjA9VOg3EifFVWUY6EOqaMB05UvPEDm7Zeby/kZW+4kdWUEPzW6xtkwf46p661L9NrbeeQhtLzw==", - "dependencies": { - "NETStandard.Library": "1.6.1" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Net.WebSockets.Client.Managed": { - "type": "Transitive", - "resolved": "1.0.22", - "contentHash": "WqEOxPlXjuZrIjUtXNE9NxEfU/n5E35iV2PtoZdJSUC4tlrqwHnTee+wvMIM4OUaJWmwrymeqcgYrE0IkGAgLA==", - "dependencies": { - "System.Buffers": "4.4.0", - "System.Numerics.Vectors": "4.4.0" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==", - "dependencies": { - "System.Collections.Immutable": "5.0.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==" - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "5.0.1", - "contentHash": "KmJ+CJXizDofbq6mpqDoRRLcxgOd2z9X3XoFNULSbvbqVRZkFX3istvr+MUjL6Zw1RT+RNdoI4GYidIINtgvqQ==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "5.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0", - "System.Text.Encodings.Web": "5.0.1", - "System.Threading.Tasks.Extensions": "4.5.4", - "System.ValueTuple": "4.5.0" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[7.0.0, )", - "resolved": "7.0.0", - "contentHash": "kmn78+LPVMOWeITUjIlfxUPDsI0R6G0RkeAMBmQxAJ7vBJn4q2dTva7pWi65ceN5vPGjJ9q/Uae2WKgvfktJAw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5" - } - }, - "Speckle.Core": { - "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.5", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Sentry": "3.33.0", - "Sentry.Serilog": "3.33.0", - "Serilog": "2.12.0", - "Serilog.Enrichers.ClientInfo": "1.3.0", - "Serilog.Exceptions": "8.4.0", - "Serilog.Sinks.Console": "4.1.0", - "Serilog.Sinks.Seq": "5.2.2", - "SerilogTimings": "3.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "System.DoubleNumerics": "3.1.3" - } - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", - "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" - } - } - } - } -} \ No newline at end of file diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/ContextWrapper.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/ContextWrapper.cs index 97d77a3389..02088f06bb 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/ContextWrapper.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/ContextWrapper.cs @@ -5,7 +5,7 @@ public class ContextWrapper : IDisposable { private IConversionContextStack? _stack; - public IConversionContext? Context { get; private set; } + public ConversionContext? Context { get; private set; } public ContextWrapper(IConversionContextStack stack) { diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContext.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContext.cs index c4423c1cc2..723877d0b9 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContext.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContext.cs @@ -1,9 +1,7 @@ -using Speckle.InterfaceGenerator; +namespace Speckle.Converters.Common; -namespace Speckle.Converters.Common; - -[GenerateAutoInterface] -public class ConversionContext : IConversionContext +// POC: record? +public class ConversionContext where TDocument : class { public ConversionContext(TDocument doc, string speckleUnits) diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContextStack.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContextStack.cs index 4575c4da49..918a29d3c1 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContextStack.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/ConversionContextStack.cs @@ -28,9 +28,9 @@ IHostToSpeckleUnitConverter unitConverter _stack.Push(new ConversionContext(_document, _unitConverter.ConvertOrThrow(hostUnit))); } - private readonly Stack> _stack = new(); + private readonly Stack> _stack = new(); - public IConversionContext Current => _stack.Peek(); + public ConversionContext Current => _stack.Peek(); public ContextWrapper Push(string speckleUnit) { @@ -39,7 +39,10 @@ public ContextWrapper Push(string speckleUnit) return new ContextWrapper(this); } - public ContextWrapper Push(THostUnit hostUnit) => Push(_unitConverter.ConvertOrThrow(hostUnit)); + public ContextWrapper Push(THostUnit hostUnit) + { + return Push(_unitConverter.ConvertOrThrow(hostUnit)); + } public void Pop() => _stack.Pop(); } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/IProxyMapper.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/IProxyMapper.cs deleted file mode 100644 index 8b467d9395..0000000000 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/IProxyMapper.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Speckle.Converters.Common; - -public interface IProxyMapper -{ - Type? GetMappedTypeFromHostType(Type type); - Type? GetMappedTypeFromProxyType(Type type); - Type? GetHostTypeFromMappedType(Type type); - - object CreateProxy(Type type, object toWrap); - - T CreateProxy(object toWrap); -} - -public record WrappedType(Type Type, object Target); - -// ghetto default interface implementation :( -public static class ProxyMapExtensions -{ - public static WrappedType? WrapIfExists(this IProxyMapper proxyMap, Type target, object toWrap) - { - var mappedType = proxyMap.GetMappedTypeFromHostType(target); - if (mappedType is not null) - { - return new(mappedType, proxyMap.CreateProxy(mappedType, toWrap)); - } - mappedType = proxyMap.GetMappedTypeFromProxyType(target); - if (mappedType is not null) - { - return new(mappedType, toWrap); - } - return null; - } -} diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/LegacyRootToSpeckleConverter.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/LegacyRootToSpeckleConverter.cs deleted file mode 100644 index 34cd5576a2..0000000000 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/LegacyRootToSpeckleConverter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common.Objects; -using Speckle.Core.Models; - -namespace Speckle.Converters.Common; - -public class LegacyRootToSpeckleConverter : IRootToSpeckleConverter -{ - private readonly IFactory _toSpeckle; - - public LegacyRootToSpeckleConverter(IFactory toSpeckle) - { - _toSpeckle = toSpeckle; - } - - public Base Convert(object target) - { - Type type = target.GetType(); - try - { - var objectConverter = _toSpeckle.ResolveInstance(type.Name); //poc: would be nice to have supertypes resolve - - if (objectConverter == null) - { - throw new NotSupportedException($"No conversion found for {type.Name}"); - } - var convertedObject = objectConverter.Convert(target); - - return convertedObject; - } - catch (SpeckleConversionException e) - { - Console.WriteLine(e); - throw; // Just rethrowing for now, Logs may be needed here. - } - } -} diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/RootConvertManager.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/RootConvertManager.cs index 6f29a573ad..4ae930fa1c 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/RootConvertManager.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/RootConvertManager.cs @@ -27,7 +27,7 @@ public Base Convert(Type type, object obj) if (objectConverter == null) { - throw new NotSupportedException($"No conversion found for {type.Name} with actual type of {obj.GetType()}"); + throw new NotSupportedException($"No conversion found for {type.Name}"); } var convertedObject = objectConverter.Convert(obj); diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs b/DUI3-DX/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs index 18ccad7495..d1807e231f 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs @@ -1,3 +1,5 @@ +using Speckle.Autofac.DependencyInjection; +using Speckle.Converters.Common.Objects; using Speckle.Core.Models; using Speckle.InterfaceGenerator; @@ -6,41 +8,32 @@ namespace Speckle.Converters.Common; [GenerateAutoInterface] public class RootToSpeckleConverter : IRootToSpeckleConverter { - private readonly IRootConvertManager _rootConvertManager; - private readonly IProxyMapper _proxyMapper; - private readonly IRootElementProvider _rootElementProvider; + private readonly IFactory _toSpeckle; - private readonly Type _revitElementType; - - public RootToSpeckleConverter( - IProxyMapper proxyMapper, - IRootConvertManager rootConvertManager, - IRootElementProvider rootElementProvider - ) + public RootToSpeckleConverter(IFactory toSpeckle) { - _proxyMapper = proxyMapper; - _rootConvertManager = rootConvertManager; - _rootElementProvider = rootElementProvider; - _revitElementType = _proxyMapper.GetHostTypeFromMappedType(_rootElementProvider.GetRootType()).NotNull(); + _toSpeckle = toSpeckle; } public Base Convert(object target) { - Type revitType = _rootConvertManager.GetTargetType(target); - var wrapper = _proxyMapper.WrapIfExists(revitType, target); - if (wrapper == null) + Type type = target.GetType(); + try { - //try to fallback to element type - if (_rootConvertManager.IsSubClass(_revitElementType, revitType)) + var objectConverter = _toSpeckle.ResolveInstance(type.Name); //poc: would be nice to have supertypes resolve + + if (objectConverter == null) { - return _rootConvertManager.Convert( - _rootElementProvider.GetRootType(), - _proxyMapper.CreateProxy(_rootElementProvider.GetRootType(), target) - ); + throw new NotSupportedException($"No conversion found for {type.Name}"); } - throw new NotSupportedException($"No wrapper found for Revit type: {revitType.Name}"); + var convertedObject = objectConverter.Convert(target); + + return convertedObject; + } + catch (SpeckleConversionException e) + { + Console.WriteLine(e); + throw; // Just rethrowing for now, Logs may be needed here. } - var (wrappedType, wrappedObject) = wrapper; - return _rootConvertManager.Convert(wrappedType, wrappedObject); } } From e11bace2658383ebf6a8f5fb54833d6808e564e7 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 27 Jun 2024 17:40:05 +0100 Subject: [PATCH 4/6] Fix all.sln (#3541) --- All.sln | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/All.sln b/All.sln index da15c240b4..3fffc2325d 100644 --- a/All.sln +++ b/All.sln @@ -556,8 +556,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConverterCivil2025", "Objec EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B1324D25-C601-40F2-8AE2-6131F492B911}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2023.Tests", "DUI3-DX\Converters\Revit\Speckle.Converters.Revit2023.Tests\Speckle.Converters.Revit2023.Tests.csproj", "{AEC26A0B-25F3-4544-A9D6-A427BFF79250}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2024", "DUI3-DX\Connectors\Autocad\Speckle.Connectors.Civil3d2024\Speckle.Connectors.Civil3d2024.csproj", "{DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024", "DUI3-DX\Converters\Autocad\2024\Speckle.Converters.Autocad2024\Speckle.Converters.Autocad2024.csproj", "{C9C28F31-1367-438C-83B0-049C3B3A3E3B}" @@ -2798,22 +2796,6 @@ Global {F06E4C37-4076-4272-9CA6-FB505E02CD31}.Release|Any CPU.Build.0 = Release|Any CPU {F06E4C37-4076-4272-9CA6-FB505E02CD31}.Release|x64.ActiveCfg = Release|Any CPU {F06E4C37-4076-4272-9CA6-FB505E02CD31}.Release|x64.Build.0 = Release|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug Mac|x64.ActiveCfg = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug Mac|x64.Build.0 = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug|x64.ActiveCfg = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Debug|x64.Build.0 = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release Mac|Any CPU.ActiveCfg = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release Mac|Any CPU.Build.0 = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release Mac|x64.ActiveCfg = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release Mac|x64.Build.0 = Debug|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|Any CPU.Build.0 = Release|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|x64.ActiveCfg = Release|Any CPU - {AEC26A0B-25F3-4544-A9D6-A427BFF79250}.Release|x64.Build.0 = Release|Any CPU {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}.Debug Mac|Any CPU.ActiveCfg = Debug|Any CPU {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}.Debug Mac|Any CPU.Build.0 = Debug|Any CPU {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E}.Debug Mac|x64.ActiveCfg = Debug|Any CPU @@ -3073,7 +3055,6 @@ Global {829688CD-CECE-4F6C-A5A0-032BB39CD9E0} = {BE521908-7944-46F3-98BF-B47D34509934} {70DEAA13-6DC8-44A0-B287-9E806A8054F1} = {890F3257-FCC2-4ED8-9180-22B3641B494C} {F06E4C37-4076-4272-9CA6-FB505E02CD31} = {BE521908-7944-46F3-98BF-B47D34509934} - {AEC26A0B-25F3-4544-A9D6-A427BFF79250} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {DDBBA313-69A6-40DE-AB3A-79EE5BF32A7E} = {743489BF-1941-43D5-8AF9-35C56D0DCC34} {C9C28F31-1367-438C-83B0-049C3B3A3E3B} = {804E065F-914C-414A-AF84-009312C3CFF6} {06082BAA-98E8-49B1-9D33-252B126A0561} = {804E065F-914C-414A-AF84-009312C3CFF6} From 0568a29d8e30857d9095446542b3cea7bed1d279 Mon Sep 17 00:00:00 2001 From: Dimitrie Stefanescu Date: Thu, 27 Jun 2024 21:10:04 +0100 Subject: [PATCH 5/6] Blocks POC (Rhino, Acad) (#3519) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(dui3): adds instance def and instance proxy classes to core * feat(dui3): rhino blocks send wip * feat(dui3): wip (works!) rhino blocks send & receive * some cleanup * wip fixes * wip cleanup * wip scaffolds acad * wip acad send instances and co * wip acad - getting close to wrapping up send * wip - units * feat(dui3): blocks poc wip: adds rhino layer manager, moves instance baking to instance manager, etc. * feat(dui3): blocks poc WIP - acad receive * wip acad instance receives * acad blocks - receive ok * feat(dui3): acad receive blocks ✅ more testing still needed! * feat(dui3): blocks poc minor refactors * feat(dui3): acad blocks proper cleanup * feat(dui3): blocks poc ready(ish) rhino & acad * chore(dui3): reverts accidental change * feat(dui3): adds comments/docs * chore(dui3): comments * fix(dui3): throws ex upwards * fix(dui3): blocks correctly handled in acad * update core reference and fix to not use interfaces * remove extra files --------- Co-authored-by: Adam Hathcock --- .../Models/Instances/IInstanceComponent.cs | 12 + .../Instances/InstanceDefinitionProxy.cs | 16 + Core/Core/Models/Instances/InstanceProxy.cs | 26 ++ .../packages.lock.json | 20 +- .../packages.lock.json | 20 +- .../Bindings/AutocadBasicConnectorBinding.cs | 47 ++- .../AutocadConnectorModule.cs | 27 ++ .../HostApp/AutocadInstanceObjectManager.cs | 368 ++++++++++++++++++ .../HostApp/AutocadLayerManager.cs | 83 +++- .../HostApp/Extensions/AcadUnitsExtension.cs | 39 ++ .../Receive/AutocadHostObjectBuilder.cs | 114 ++++-- .../Send/AutocadRootObjectBuilder.cs | 28 +- ...Speckle.Connectors.AutocadShared.projitems | 2 + .../packages.lock.json | 20 +- .../packages.lock.json | 20 +- .../Bindings/RhinoSendBinding.cs | 15 + .../RhinoConnectorModule.cs | 3 + .../Extensions/RhinoUnitsExtension.cs | 37 ++ .../HostApp/RhinoInstanceObjectsManager.cs | 254 ++++++++++++ .../HostApp/RhinoLayerManager.cs | 122 ++++++ .../Receive/RhinoHostObjectBuilder.cs | 186 +++++---- .../Operations/Send/RhinoRootObjectBuilder.cs | 99 ++--- .../packages.lock.json | 25 +- .../packages.lock.json | 16 +- .../packages.lock.json | 16 +- .../packages.lock.json | 16 +- .../packages.lock.json | 16 +- .../packages.lock.json | 16 +- .../packages.lock.json | 16 +- .../packages.lock.json | 16 +- .../XyzConversionToPointTests.cs | 59 --- .../packages.lock.json | 16 +- .../packages.lock.json | 21 +- .../packages.lock.json | 16 +- .../packages.lock.json | 20 +- .../Speckle.Connectors.DUI/packages.lock.json | 8 +- DUI3-DX/Directory.Packages.props | 4 +- .../Instances/IInstanceObjectsManager.cs | 53 +++ .../packages.lock.json | 6 +- .../packages.lock.json | 16 +- .../packages.lock.json | 14 +- 41 files changed, 1488 insertions(+), 440 deletions(-) create mode 100644 Core/Core/Models/Instances/IInstanceComponent.cs create mode 100644 Core/Core/Models/Instances/InstanceDefinitionProxy.cs create mode 100644 Core/Core/Models/Instances/InstanceProxy.cs create mode 100644 DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs create mode 100644 DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/Extensions/AcadUnitsExtension.cs create mode 100644 DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Extensions/RhinoUnitsExtension.cs create mode 100644 DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoInstanceObjectsManager.cs create mode 100644 DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoLayerManager.cs delete mode 100644 DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs create mode 100644 DUI3-DX/Sdk/Speckle.Connectors.Utils/Instances/IInstanceObjectsManager.cs diff --git a/Core/Core/Models/Instances/IInstanceComponent.cs b/Core/Core/Models/Instances/IInstanceComponent.cs new file mode 100644 index 0000000000..9a6478607d --- /dev/null +++ b/Core/Core/Models/Instances/IInstanceComponent.cs @@ -0,0 +1,12 @@ +namespace Speckle.Core.Models.Instances; + +/// +/// Abstracts over and for sorting and grouping in receive operations. +/// +public interface IInstanceComponent +{ + /// + /// The maximum "depth" at which this or was found. On receive, as instances can be composed of other instances, we need to start from the deepest instance elements first when reconstructing them, starting with definitions first. + /// + public int MaxDepth { get; set; } +} diff --git a/Core/Core/Models/Instances/InstanceDefinitionProxy.cs b/Core/Core/Models/Instances/InstanceDefinitionProxy.cs new file mode 100644 index 0000000000..0fde842faa --- /dev/null +++ b/Core/Core/Models/Instances/InstanceDefinitionProxy.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace Speckle.Core.Models.Instances; + +/// +/// A proxy class for an instance definition. +/// +public class InstanceDefinitionProxy : Base, IInstanceComponent +{ + /// + /// The original ids of the objects that are part of this definition, as present in the source host app. On receive, they will be mapped to corresponding newly created definition ids. + /// + public List Objects { get; set; } // source app application ids for the objects + + public int MaxDepth { get; set; } +} diff --git a/Core/Core/Models/Instances/InstanceProxy.cs b/Core/Core/Models/Instances/InstanceProxy.cs new file mode 100644 index 0000000000..5fa18496e9 --- /dev/null +++ b/Core/Core/Models/Instances/InstanceProxy.cs @@ -0,0 +1,26 @@ +using System.DoubleNumerics; + +namespace Speckle.Core.Models.Instances; + +/// +/// A proxy class for an instance (e.g, a rhino block, or an autocad block reference). +/// +public class InstanceProxy : Base, IInstanceComponent +{ + /// + /// The definition id as present in the original host app. On receive, it will be mapped to the newly created definition id. + /// + public string DefinitionId { get; set; } + + /// + /// The transform of the instance reference. + /// + public Matrix4x4 Transform { get; set; } + + /// + /// The units of the host application file. + /// + public string Units { get; set; } = Kits.Units.Meters; + + public int MaxDepth { get; set; } +} diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json index e890a9f47a..b975016a9b 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json @@ -383,7 +383,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -399,7 +399,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.arcgis3": { @@ -421,7 +421,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -455,9 +455,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -479,11 +479,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "System.Threading.Tasks.Dataflow": { diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json index 68bcf35809..0fff9ad56a 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json @@ -436,7 +436,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -452,7 +452,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.autocad2023": { @@ -474,7 +474,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -511,9 +511,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -535,11 +535,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "System.Threading.Tasks.Dataflow": { diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs index a87ea7f70d..a30179a2cb 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs @@ -8,6 +8,7 @@ using Speckle.Core.Credentials; using Speckle.Connectors.Autocad.HostApp.Extensions; using Speckle.Connectors.Utils; +using Speckle.Core.Logging; namespace Speckle.Connectors.Autocad.Bindings; @@ -108,34 +109,50 @@ public void HighlightModel(string modelCardId) return; } - HighlightObjectsOnView(objectIds); + HighlightObjectsOnView(objectIds, modelCardId); } - private void HighlightObjectsOnView(ObjectId[] objectIds) + private void HighlightObjectsOnView(ObjectId[] objectIds, string? modelCardId = null) { var doc = Application.DocumentManager.MdiActiveDocument; Parent.RunOnMainThread(() => { - doc.Editor.SetImpliedSelection(Array.Empty()); // Deselects - doc.Editor.SetImpliedSelection(objectIds); // Selects - doc.Editor.UpdateScreen(); + try + { + doc.Editor.SetImpliedSelection(Array.Empty()); // Deselects + doc.Editor.SetImpliedSelection(objectIds); // Selects + doc.Editor.UpdateScreen(); + + Extents3d selectedExtents = new(); - Extents3d selectedExtents = new(); + var tr = doc.TransactionManager.StartTransaction(); + foreach (ObjectId objectId in objectIds) + { + var entity = (Entity)tr.GetObject(objectId, OpenMode.ForRead); + if (entity != null) + { + selectedExtents.AddExtents(entity.GeometricExtents); + } + } - var tr = doc.TransactionManager.StartTransaction(); - foreach (ObjectId objectId in objectIds) + doc.Editor.Zoom(selectedExtents); + tr.Commit(); + Autodesk.AutoCAD.Internal.Utils.FlushGraphics(); + } + catch (Exception ex) when (!ex.IsFatal()) { - var entity = (Entity)tr.GetObject(objectId, OpenMode.ForRead); - if (entity != null) + if (modelCardId != null) + { + Commands.SetModelError(modelCardId, new OperationCanceledException("Failed to highlight objects.")); + } + else { - selectedExtents.AddExtents(entity.GeometricExtents); + // This will happen, in some cases, where we highlight individual objects. Should be caught by the top level handler and not + // crash the host app. + throw; } } - - doc.Editor.Zoom(selectedExtents); - tr.Commit(); - Autodesk.AutoCAD.Internal.Utils.FlushGraphics(); }); } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs index 731098b249..52da8c7d75 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs @@ -1,13 +1,23 @@ #if AUTOCAD +using Autodesk.AutoCAD.DatabaseServices; +using Speckle.Autofac; using Speckle.Autofac.DependencyInjection; using Speckle.Connectors.Autocad.Bindings; using Speckle.Connectors.Autocad.Filters; +using Speckle.Connectors.Autocad.HostApp; +using Speckle.Connectors.Autocad.Interfaces; using Speckle.Connectors.Autocad.Operations.Receive; using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Connectors.Autocad.Plugin; +using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; +using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card.SendFilter; +using Speckle.Connectors.DUI.WebView; +using Speckle.Connectors.Utils; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; +using Speckle.Connectors.Utils.Instances; using Speckle.Connectors.Utils.Operations; using Speckle.Core.Models.GraphTraversal; @@ -17,8 +27,24 @@ public class AutocadConnectorModule : ISpeckleModule { public void Load(SpeckleContainerBuilder builder) { + builder.AddAutofac(); + builder.AddConnectorUtils(); + builder.AddDUI(); + builder.AddDUIView(); + + // Register other connector specific types + builder.AddSingleton(); + builder.AddTransient(); + builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext + builder.AddSingleton(); + builder.AddSingleton(); + builder.AddSingleton(); + SharedConnectorModule.LoadShared(builder); + + builder.AddScoped(); + // Operations builder.AddScoped>(); builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); @@ -37,6 +63,7 @@ public void Load(SpeckleContainerBuilder builder) // register send conversion cache builder.AddSingleton(); + builder.AddScoped>, AutocadInstanceObjectManager>(); } } #endif diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs new file mode 100644 index 0000000000..11067f52ba --- /dev/null +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs @@ -0,0 +1,368 @@ +using System.DoubleNumerics; +using Autodesk.AutoCAD.DatabaseServices; +using Autodesk.AutoCAD.Geometry; +using Speckle.Connectors.Autocad.HostApp.Extensions; +using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Utils.Instances; +using Speckle.Core.Kits; +using Speckle.Core.Logging; +using Speckle.Core.Models; +using Speckle.Core.Models.Instances; + +namespace Speckle.Connectors.Autocad.HostApp; + +/// +/// +/// Expects to be a scoped dependency per send or receive operation. +/// +public class AutocadInstanceObjectManager : IInstanceObjectsManager> +{ + private readonly AutocadLayerManager _autocadLayerManager; + private Dictionary InstanceProxies { get; set; } = new(); + private Dictionary> InstanceProxiesByDefinitionId { get; set; } = new(); + private Dictionary DefinitionProxies { get; set; } = new(); + private Dictionary FlatAtomicObjects { get; set; } = new(); + + public AutocadInstanceObjectManager(AutocadLayerManager autocadLayerManager) + { + _autocadLayerManager = autocadLayerManager; + } + + public UnpackResult UnpackSelection(IEnumerable objects) + { + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + + foreach (var obj in objects) + { + if (obj.Root is BlockReference blockReference && !blockReference.IsDynamicBlock) + { + UnpackInstance(blockReference, 0, transaction); + } + + FlatAtomicObjects[obj.ApplicationId] = obj; + } + return new(FlatAtomicObjects.Values.ToList(), InstanceProxies, DefinitionProxies.Values.ToList()); + } + + private void UnpackInstance(BlockReference instance, int depth, Transaction transaction) + { + var instanceIdString = instance.Handle.Value.ToString(); + var definitionId = instance.BlockTableRecord; + + InstanceProxies[instanceIdString] = new InstanceProxy() + { + applicationId = instanceIdString, + DefinitionId = definitionId.ToString(), + MaxDepth = depth, + Transform = GetMatrix(instance.BlockTransform.ToArray()), + Units = Application.DocumentManager.CurrentDocument.Database.Insunits.ToSpeckleString() + }; + + // For each block instance that has the same definition, we need to keep track of the "maximum depth" at which is found. + // This will enable on receive to create them in the correct order (descending by max depth, interleaved definitions and instances). + // We need to interleave the creation of definitions and instances, as some definitions may depend on instances. + if ( + !InstanceProxiesByDefinitionId.TryGetValue( + definitionId.ToString(), + out List instanceProxiesWithSameDefinition + ) + ) + { + instanceProxiesWithSameDefinition = new List(); + InstanceProxiesByDefinitionId[definitionId.ToString()] = instanceProxiesWithSameDefinition; + } + + // We ensure that all previous instance proxies that have the same definition are at this max depth. I kind of have a feeling this can be done more elegantly, but YOLO + foreach (var instanceProxy in instanceProxiesWithSameDefinition) + { + instanceProxy.MaxDepth = depth; + } + + instanceProxiesWithSameDefinition.Add(InstanceProxies[instanceIdString]); + + if (DefinitionProxies.TryGetValue(definitionId.ToString(), out InstanceDefinitionProxy value)) + { + value.MaxDepth = depth; + return; // exit fast - we've parsed this one so no need to go further + } + + var definition = (BlockTableRecord)transaction.GetObject(definitionId, OpenMode.ForRead); + // definition.Origin + var definitionProxy = new InstanceDefinitionProxy() + { + applicationId = definitionId.ToString(), + Objects = new(), + MaxDepth = depth, + ["name"] = definition.Name, + ["comments"] = definition.Comments, + ["units"] = definition.Units // ? not sure needed? + }; + + // Go through each definition object + foreach (ObjectId id in definition) + { + var obj = transaction.GetObject(id, OpenMode.ForRead); + var handleIdString = obj.Handle.Value.ToString(); + definitionProxy.Objects.Add(handleIdString); + + if (obj is BlockReference blockReference && !blockReference.IsDynamicBlock) + { + UnpackInstance(blockReference, depth + 1, transaction); + } + FlatAtomicObjects[handleIdString] = new(obj, handleIdString); + } + + DefinitionProxies[definitionId.ToString()] = definitionProxy; + } + + public BakeResult BakeInstances( + List<(string[] layerPath, IInstanceComponent obj)> instanceComponents, + Dictionary> applicationIdMap, + string baseLayerName, + Action? onOperationProgressed + ) + { + var sortedInstanceComponents = instanceComponents + .OrderByDescending(x => x.obj.MaxDepth) // Sort by max depth, so we start baking from the deepest element first + .ThenBy(x => x.obj is InstanceDefinitionProxy ? 0 : 1) // Ensure we bake the deepest definition first, then any instances that depend on it + .ToList(); + + var definitionIdAndApplicationIdMap = new Dictionary(); + + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + var conversionResults = new List(); + var createdObjectIds = new List(); + var consumedObjectIds = new List(); + var count = 0; + + foreach (var (path, instanceOrDefinition) in sortedInstanceComponents) + { + try + { + onOperationProgressed?.Invoke("Converting blocks", (double)++count / sortedInstanceComponents.Count); + if (instanceOrDefinition is InstanceDefinitionProxy { applicationId: not null } definitionProxy) + { + // TODO: create definition (block table record) + var constituentEntities = definitionProxy.Objects + .Select(id => applicationIdMap.TryGetValue(id, out List value) ? value : null) + .Where(x => x is not null) + .SelectMany(ent => ent) + .ToList(); + + var record = new BlockTableRecord(); + var objectIds = new ObjectIdCollection(); + record.Name = baseLayerName; + if (definitionProxy["name"] is string name) + { + record.Name += name; + } + else + { + record.Name += definitionProxy.applicationId; + } + + foreach (var entity in constituentEntities) + { + // record.AppendEntity(entity); + objectIds.Add(entity.ObjectId); + } + + using var blockTable = (BlockTable) + transaction.GetObject(Application.DocumentManager.CurrentDocument.Database.BlockTableId, OpenMode.ForWrite); + var id = blockTable.Add(record); + record.AssumeOwnershipOf(objectIds); + + definitionIdAndApplicationIdMap[definitionProxy.applicationId] = id; + transaction.AddNewlyCreatedDBObject(record, true); + var consumedEntitiesHandleValues = constituentEntities.Select(ent => ent.Handle.Value.ToString()).ToArray(); + consumedObjectIds.AddRange(consumedEntitiesHandleValues); + createdObjectIds.RemoveAll(newId => consumedEntitiesHandleValues.Contains(newId)); + } + else if ( + instanceOrDefinition is InstanceProxy instanceProxy + && definitionIdAndApplicationIdMap.TryGetValue(instanceProxy.DefinitionId, out ObjectId definitionId) + ) + { + var matrix3d = GetMatrix3d(instanceProxy.Transform, instanceProxy.Units); + var insertionPoint = Point3d.Origin.TransformBy(matrix3d); + + var modelSpaceBlockTableRecord = Application.DocumentManager.CurrentDocument.Database.GetModelSpace( + OpenMode.ForWrite + ); + _autocadLayerManager.CreateLayerForReceive(path[0]); + var blockRef = new BlockReference(insertionPoint, definitionId) + { + BlockTransform = matrix3d, + Layer = path[0], + }; + + modelSpaceBlockTableRecord.AppendEntity(blockRef); + + if (instanceProxy.applicationId != null) + { + applicationIdMap[instanceProxy.applicationId] = new List { blockRef }; + } + + transaction.AddNewlyCreatedDBObject(blockRef, true); + conversionResults.Add( + new(Status.SUCCESS, instanceProxy, blockRef.Handle.Value.ToString(), "Instance (Block)") + ); + createdObjectIds.Add(blockRef.Handle.Value.ToString()); + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + conversionResults.Add(new(Status.ERROR, instanceOrDefinition as Base ?? new Base(), null, null, ex)); + } + } + transaction.Commit(); + return new(createdObjectIds, consumedObjectIds, conversionResults); + } + + /// + /// Cleans up any previously created instances. + /// POC: This function will not be able to delete block definitions if the user creates a new one composed out of received definitions. + /// + /// + public void PurgeInstances(string namePrefix) + { + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + var instanceDefinitionsToDelete = new Dictionary(); + + // Helper function that recurses through a given block table record's constituent objects and purges inner instances as required. + void TraverseAndClean(BlockTableRecord btr) + { + foreach (var objectId in btr) + { + var obj = transaction.GetObject(objectId, OpenMode.ForRead) as BlockReference; + if (obj == null) + { + continue; + } + var definition = (BlockTableRecord)transaction.GetObject(obj.BlockTableRecord, OpenMode.ForRead); + if (obj.IsErased) + { + TraverseAndClean(definition); + continue; + } + + obj.UpgradeOpen(); + obj.Erase(); + TraverseAndClean(definition); + instanceDefinitionsToDelete[obj.BlockTableRecord.ToString()] = definition; + } + } + + using var blockTable = (BlockTable) + transaction.GetObject(Application.DocumentManager.CurrentDocument.Database.BlockTableId, OpenMode.ForRead); + + // deep clean definitions + foreach (var btrId in blockTable) + { + var btr = (BlockTableRecord)transaction.GetObject(btrId, OpenMode.ForRead); + if (btr.Name.Contains(namePrefix)) // POC: this is tightly coupled with a naming convention for definitions in the instance object manager + { + TraverseAndClean(btr); + instanceDefinitionsToDelete[btr.Name] = btr; + } + } + + foreach (var def in instanceDefinitionsToDelete.Values) + { + def.UpgradeOpen(); + def.Erase(); + } + + transaction.Commit(); + } + + private Matrix4x4 GetMatrix(double[] t) + { + return new Matrix4x4( + t[0], + t[1], + t[2], + t[3], + t[4], + t[5], + t[6], + t[7], + t[8], + t[9], + t[10], + t[11], + t[12], + t[13], + t[14], + t[15] + ); + } + + private Matrix3d GetMatrix3d(Matrix4x4 matrix, string units) + { + var sf = Units.GetConversionFactor( + units, + Application.DocumentManager.CurrentDocument.Database.Insunits.ToSpeckleString() + ); + + var scaledTransform = new[] + { + matrix.M11, + matrix.M12, + matrix.M13, + matrix.M14 * sf, + matrix.M21, + matrix.M22, + matrix.M23, + matrix.M24 * sf, + matrix.M31, + matrix.M32, + matrix.M33, + matrix.M34 * sf, + matrix.M41, + matrix.M42, + matrix.M43, + matrix.M44 + }; + + var m3d = new Matrix3d(scaledTransform); + if (!m3d.IsScaledOrtho()) + { + m3d = new Matrix3d(MakePerpendicular(m3d)); + } + + return m3d; + } + + // https://forums.autodesk.com/t5/net/set-blocktransform-values/m-p/6452121#M49479 + private static double[] MakePerpendicular(Matrix3d matrix) + { + // Get the basis vectors of the matrix + Vector3d right = new(matrix[0, 0], matrix[1, 0], matrix[2, 0]); + Vector3d up = new(matrix[0, 1], matrix[1, 1], matrix[2, 1]); + + Vector3d newForward = right.CrossProduct(up).GetNormal(); + Vector3d newUp = newForward.CrossProduct(right).GetNormal(); + + return new[] + { + right.X, + newUp.X, + newForward.X, + matrix[0, 3], + right.Y, + newUp.Y, + newForward.Y, + matrix[1, 3], + right.Z, + newUp.Z, + newForward.Z, + matrix[2, 3], + 0.0, + 0.0, + 0.0, + matrix[3, 3], + }; + } +} diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs index 87b1f00ca7..d172bea860 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs @@ -1,9 +1,14 @@ using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.LayerManager; +using Speckle.Core.Models; +using Speckle.Core.Models.GraphTraversal; namespace Speckle.Connectors.Autocad.HostApp; +/// +/// Expects to be a scoped dependency for a given operation and helps with layer creation and cleanup. +/// public class AutocadLayerManager { private readonly AutocadContext _autocadContext; @@ -11,38 +16,30 @@ public class AutocadLayerManager // POC: Will be addressed to move it into AutocadContext! private Document Doc => Application.DocumentManager.MdiActiveDocument; + private readonly HashSet _uniqueLayerNames = new(); public AutocadLayerManager(AutocadContext autocadContext) { _autocadContext = autocadContext; } - /// - /// Constructs layer name with prefix and valid characters. - /// - /// Prefix to add layer name. - /// list of entries to concat with hyphen. - /// Full layer name with provided prefix and path. - public string LayerFullName(string baseLayerPrefix, string path) - { - var layerFullName = baseLayerPrefix + string.Join("-", path); - return _autocadContext.RemoveInvalidChars(layerFullName); - } - /// /// Will create a layer with the provided name, or, if it finds an existing one, will "purge" all objects from it. /// This ensures we're creating the new objects we've just received rather than overlaying them. /// /// Name to search layer for purge and create. - public void CreateLayerOrPurge(string layerName) + public void CreateLayerForReceive(string layerName) { - // POC: Will be addressed to move it into AutocadContext! - Document doc = Application.DocumentManager.MdiActiveDocument; - doc.LockDocument(); - using Transaction transaction = doc.TransactionManager.StartTransaction(); + if (!_uniqueLayerNames.Add(layerName)) + { + return; + } + + Doc.LockDocument(); + using Transaction transaction = Doc.TransactionManager.StartTransaction(); LayerTable? layerTable = - transaction.TransactionManager.GetObject(doc.Database.LayerTableId, OpenMode.ForRead) as LayerTable; + transaction.TransactionManager.GetObject(Doc.Database.LayerTableId, OpenMode.ForRead) as LayerTable; LayerTableRecord layerTableRecord = new() { Name = layerName }; bool hasLayer = layerTable != null && layerTable.Has(layerName); @@ -50,7 +47,7 @@ public void CreateLayerOrPurge(string layerName) { TypedValue[] tvs = { new((int)DxfCode.LayerName, layerName) }; SelectionFilter selectionFilter = new(tvs); - SelectionSet selectionResult = doc.Editor.SelectAll(selectionFilter).Value; + SelectionSet selectionResult = Doc.Editor.SelectAll(selectionFilter).Value; if (selectionResult == null) { return; @@ -69,7 +66,38 @@ public void CreateLayerOrPurge(string layerName) transaction.Commit(); } - // POC: Consider to extract somehow in factory or service! + public void DeleteAllLayersByPrefix(string prefix) + { + Doc.LockDocument(); + using Transaction transaction = Doc.TransactionManager.StartTransaction(); + + var layerTable = (LayerTable)transaction.TransactionManager.GetObject(Doc.Database.LayerTableId, OpenMode.ForRead); + foreach (var layerId in layerTable) + { + var layer = (LayerTableRecord)transaction.GetObject(layerId, OpenMode.ForRead); + var layerName = layer.Name; + if (layer.Name.Contains(prefix)) + { + // Delete objects from this layer + TypedValue[] tvs = { new((int)DxfCode.LayerName, layerName) }; + SelectionFilter selectionFilter = new(tvs); + SelectionSet selectionResult = Doc.Editor.SelectAll(selectionFilter).Value; + if (selectionResult == null) + { + return; + } + foreach (SelectedObject selectedObject in selectionResult) + { + transaction.GetObject(selectedObject.ObjectId, OpenMode.ForWrite).Erase(); + } + // Delete layer + layer.UpgradeOpen(); + layer.Erase(); + } + } + transaction.Commit(); + } + /// /// Creates a layer filter for the just received model, grouped under a top level filter "Speckle". Note: manual close and open of the layer properties panel required (it's an acad thing). /// This comes in handy to quickly access the layers created for this specific model. @@ -114,4 +142,19 @@ public void CreateLayerFilter(string projectName, string modelName) groupFilter.NestedFilters.Add(layerFilter); Doc.Database.LayerFilters = layerFilterTree; } + + /// + /// Gets a valid layer name for a given context. + /// + /// + /// + /// + public string GetLayerPath(TraversalContext context, string baseLayerPrefix) + { + string[] collectionBasedPath = context.GetAscendantOfType().Select(c => c.name).Reverse().ToArray(); + string[] path = collectionBasedPath.Length != 0 ? collectionBasedPath : context.GetPropertyPath().ToArray(); + + var name = baseLayerPrefix + string.Join("-", path); + return _autocadContext.RemoveInvalidChars(name); + } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/Extensions/AcadUnitsExtension.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/Extensions/AcadUnitsExtension.cs new file mode 100644 index 0000000000..f4ee8e3a66 --- /dev/null +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/Extensions/AcadUnitsExtension.cs @@ -0,0 +1,39 @@ +using Autodesk.AutoCAD.DatabaseServices; +using Speckle.Core.Kits; +using Speckle.Core.Logging; + +namespace Speckle.Connectors.Autocad.HostApp.Extensions; + +public static class AcadUnitsExtension +{ + public static string ToSpeckleString(this UnitsValue units) + { + switch (units) + { + case UnitsValue.Millimeters: + return Units.Millimeters; + case UnitsValue.Centimeters: + return Units.Centimeters; + case UnitsValue.Meters: + return Units.Meters; + case UnitsValue.Kilometers: + return Units.Kilometers; + case UnitsValue.Inches: + case UnitsValue.USSurveyInch: + return Units.Inches; + case UnitsValue.Feet: + case UnitsValue.USSurveyFeet: + return Units.Feet; + case UnitsValue.Yards: + case UnitsValue.USSurveyYard: + return Units.Yards; + case UnitsValue.Miles: + case UnitsValue.USSurveyMile: + return Units.Miles; + case UnitsValue.Undefined: + return Units.None; + default: + throw new SpeckleException($"The Unit System \"{units}\" is unsupported."); + } + } +} diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs index e5b720aad7..3e2e44c0fe 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs @@ -1,30 +1,41 @@ using Autodesk.AutoCAD.DatabaseServices; using Speckle.Connectors.Autocad.HostApp; using Speckle.Connectors.Autocad.HostApp.Extensions; +using Speckle.Connectors.Autocad.Operations.Send; using Speckle.Core.Models; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Utils.Instances; using Speckle.Converters.Common; using Speckle.Core.Logging; using Speckle.Core.Models.GraphTraversal; +using Speckle.Core.Models.Instances; namespace Speckle.Connectors.Autocad.Operations.Receive; +/// +/// Expects to be a scoped dependency per receive operation. +/// public class AutocadHostObjectBuilder : IHostObjectBuilder { private readonly AutocadLayerManager _autocadLayerManager; private readonly IRootToHostConverter _converter; private readonly GraphTraversal _traversalFunction; + // private readonly HashSet _uniqueLayerNames = new(); + private readonly IInstanceObjectsManager> _instanceObjectsManager; + public AutocadHostObjectBuilder( IRootToHostConverter converter, GraphTraversal traversalFunction, - AutocadLayerManager autocadLayerManager + AutocadLayerManager autocadLayerManager, + IInstanceObjectsManager> instanceObjectsManager ) { _converter = converter; _traversalFunction = traversalFunction; _autocadLayerManager = autocadLayerManager; + _instanceObjectsManager = instanceObjectsManager; } public HostObjectBuilderResult Build( @@ -43,20 +54,68 @@ CancellationToken cancellationToken //TODO: make the layerManager handle \/ ? string baseLayerPrefix = $"SPK-{projectName}-{modelName}-"; - HashSet uniqueLayerNames = new(); + + PreReceiveDeepClean(baseLayerPrefix); List results = new(); List bakedObjectIds = new(); - foreach (var tc in _traversalFunction.TraverseWithProgress(rootObject, onOperationProgressed, cancellationToken)) + + // return new(bakedObjectIds, results); + + var objectGraph = _traversalFunction.Traverse(rootObject).Where(obj => obj.Current is not Collection); + + // POC: these are not captured by traversal, so we need to re-add them here + var instanceDefinitionProxies = (rootObject["instanceDefinitionProxies"] as List) + ?.Cast() + .ToList(); + + var instanceComponents = new List<(string[] path, IInstanceComponent obj)>(); + // POC: these are not captured by traversal, so we need to re-add them here + if (instanceDefinitionProxies != null && instanceDefinitionProxies.Count > 0) + { + var transformed = instanceDefinitionProxies.Select(proxy => (Array.Empty(), proxy as IInstanceComponent)); + instanceComponents.AddRange(transformed); + } + + var atomicObjects = new List<(string layerName, Base obj)>(); + + foreach (TraversalContext tc in objectGraph) + { + var layerName = _autocadLayerManager.GetLayerPath(tc, baseLayerPrefix); + if (tc.Current is IInstanceComponent instanceComponent) + { + instanceComponents.Add((new string[] { layerName }, instanceComponent)); + } + else + { + atomicObjects.Add((layerName, tc.Current)); + } + } + + // Stage 1: Convert atomic objects + Dictionary> applicationIdMap = new(); + var count = 0; + foreach (var (layerName, atomicObject) in atomicObjects) { + onOperationProgressed?.Invoke("Converting objects", (double)++count / atomicObjects.Count); try { - var convertedObjects = ConvertObject(tc, baseLayerPrefix, uniqueLayerNames).ToList(); + var convertedObjects = ConvertObject(atomicObject, layerName).ToList(); + + if (atomicObject.applicationId != null) + { + applicationIdMap[atomicObject.applicationId] = convertedObjects; + } results.AddRange( convertedObjects.Select( e => - new ReceiveConversionResult(Status.SUCCESS, tc.Current, e.Handle.Value.ToString(), e.GetType().ToString()) + new ReceiveConversionResult( + Status.SUCCESS, + atomicObject, + e.Handle.Value.ToString(), + e.GetType().ToString() + ) ) ); @@ -64,32 +123,44 @@ CancellationToken cancellationToken } catch (Exception ex) when (!ex.IsFatal()) { - results.Add(new(Status.ERROR, tc.Current, null, null, ex)); + results.Add(new(Status.ERROR, atomicObject, null, null, ex)); } } + // Stage 2: Convert instances + var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = _instanceObjectsManager.BakeInstances( + instanceComponents, + applicationIdMap, + baseLayerPrefix, + onOperationProgressed + ); + + bakedObjectIds.RemoveAll(id => consumedObjectIds.Contains(id)); + bakedObjectIds.AddRange(createdInstanceIds); + results.RemoveAll(result => result.ResultId != null && consumedObjectIds.Contains(result.ResultId)); + results.AddRange(instanceConversionResults); + return new(bakedObjectIds, results); } - private IEnumerable ConvertObject(TraversalContext tc, string baseLayerPrefix, ISet uniqueLayerNames) + private void PreReceiveDeepClean(string baseLayerPrefix) + { + _autocadLayerManager.DeleteAllLayersByPrefix(baseLayerPrefix); + _instanceObjectsManager.PurgeInstances(baseLayerPrefix); + } + + private IEnumerable ConvertObject(Base obj, string layerName) { using TransactionContext transactionContext = TransactionContext.StartTransaction( Application.DocumentManager.MdiActiveDocument ); - string layerFullName = GetLayerPath(tc, baseLayerPrefix); + _autocadLayerManager.CreateLayerForReceive(layerName); - if (uniqueLayerNames.Add(layerFullName)) - { - _autocadLayerManager.CreateLayerOrPurge(layerFullName); - } - - //POC: this transaction used to be called in the converter, We've moved it here to unify converter implementation - //POC: Is this transaction 100% needed? we are already inside a transaction? object converted; using (var tr = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction()) { - converted = _converter.Convert(tc.Current); + converted = _converter.Convert(obj); tr.Commit(); } @@ -103,17 +174,8 @@ private IEnumerable ConvertObject(TraversalContext tc, string baseLayerP continue; } - conversionResult.AppendToDb(layerFullName); - + conversionResult.AppendToDb(layerName); yield return conversionResult; } } - - private string GetLayerPath(TraversalContext context, string baseLayerPrefix) - { - string[] collectionBasedPath = context.GetAscendantOfType().Select(c => c.name).ToArray(); - string[] path = collectionBasedPath.Length != 0 ? collectionBasedPath : context.GetPropertyPath().ToArray(); - - return _autocadLayerManager.LayerFullName(baseLayerPrefix, string.Join("-", path)); //TODO: reverse path? - } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs index 3073a07b25..5c09948f3b 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs @@ -3,10 +3,12 @@ using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Utils.Instances; using Speckle.Connectors.Utils.Operations; using Speckle.Converters.Common; using Speckle.Core.Logging; using Speckle.Core.Models; +using Speckle.Core.Models.Instances; namespace Speckle.Connectors.Autocad.Operations.Send; @@ -15,11 +17,17 @@ public class AutocadRootObjectBuilder : IRootObjectBuilder private readonly IRootToSpeckleConverter _converter; private readonly string[] _documentPathSeparator = { "\\" }; private readonly ISendConversionCache _sendConversionCache; + private readonly IInstanceObjectsManager> _instanceObjectsManager; - public AutocadRootObjectBuilder(IRootToSpeckleConverter converter, ISendConversionCache sendConversionCache) + public AutocadRootObjectBuilder( + IRootToSpeckleConverter converter, + ISendConversionCache sendConversionCache, + IInstanceObjectsManager> instanceObjectManager + ) { _converter = converter; _sendConversionCache = sendConversionCache; + _instanceObjectsManager = instanceObjectManager; } public RootObjectBuilderResult Build( @@ -43,16 +51,24 @@ public RootObjectBuilderResult Build( Dictionary collectionCache = new(); int count = 0; - List results = new(objects.Count); + var (atomicObjects, instanceProxies, instanceDefinitionProxies) = _instanceObjectsManager.UnpackSelection(objects); + // POC: until we formalise a bit more the root object + modelWithLayers["instanceDefinitionProxies"] = instanceDefinitionProxies; + + List results = new(); var cacheHitCount = 0; - foreach (var (dbObject, applicationId) in objects) + + foreach (var (dbObject, applicationId) in atomicObjects) { ct.ThrowIfCancellationRequested(); - try { Base converted; - if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference value)) + if (dbObject is BlockReference && instanceProxies.TryGetValue(applicationId, out InstanceProxy instanceProxy)) + { + converted = instanceProxy; + } + else if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference value)) { converted = value; cacheHitCount++; @@ -84,7 +100,7 @@ public RootObjectBuilderResult Build( // POC: add logging } - onOperationProgressed?.Invoke("Converting", (double)++count / objects.Count); + onOperationProgressed?.Invoke("Converting", (double)++count / atomicObjects.Count); } // POC: Log would be nice, or can be removed. diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems index dd0f8afa29..b95639804d 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems @@ -17,12 +17,14 @@ + + diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json index b6c4d13a4c..71a6fee082 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json @@ -439,7 +439,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -455,7 +455,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.autocad2024": { @@ -477,7 +477,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -520,9 +520,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -544,11 +544,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "System.Threading.Tasks.Dataflow": { diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json index 0a002c7391..503e92ef50 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json @@ -454,7 +454,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -463,14 +463,14 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -517,9 +517,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -541,11 +541,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "Speckle.Revit.API": { diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs index f0fd3a63d3..7e4e6be8a3 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs @@ -1,4 +1,5 @@ using Rhino; +using Rhino.Commands; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; @@ -64,6 +65,20 @@ ITopLevelExceptionHandler topLevelExceptionHandler private void SubscribeToRhinoEvents() { + RhinoDoc.LayerTableEvent += (_, _) => + { + Commands.RefreshSendFilters(); + }; + + Command.BeginCommand += (_, e) => + { + if (e.CommandEnglishName == "BlockEdit") + { + var selectedObject = RhinoDoc.ActiveDoc.Objects.GetSelectedObjects(false, false).First(); + ChangedObjectIds.Add(selectedObject.Id.ToString()); + } + }; + RhinoDoc.AddRhinoObject += (_, e) => _topLevelExceptionHandler.CatchUnhandled(() => { diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs index 7be48aa2b6..a21fee9903 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/DependencyInjection/RhinoConnectorModule.cs @@ -19,6 +19,7 @@ using Speckle.Connectors.Utils; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; +using Speckle.Connectors.Utils.Instances; using Speckle.Connectors.Utils.Operations; using Speckle.Core.Models.GraphTraversal; @@ -70,5 +71,7 @@ public void Load(SpeckleContainerBuilder builder) builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); builder.AddScoped, RhinoRootObjectBuilder>(); + builder.AddScoped>, RhinoInstanceObjectsManager>(); + builder.AddScoped(); } } diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Extensions/RhinoUnitsExtension.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Extensions/RhinoUnitsExtension.cs new file mode 100644 index 0000000000..2d431afadc --- /dev/null +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Extensions/RhinoUnitsExtension.cs @@ -0,0 +1,37 @@ +using Rhino; +using Speckle.Core.Kits; +using Speckle.Core.Logging; + +namespace Speckle.Connectors.Rhino7.Extensions; + +public static class RhinoUnitsExtension +{ + public static string ToSpeckleString(this UnitSystem unitSystem) + { + switch (unitSystem) + { + case UnitSystem.None: + return Units.Meters; + case UnitSystem.Millimeters: + return Units.Millimeters; + case UnitSystem.Centimeters: + return Units.Centimeters; + case UnitSystem.Meters: + return Units.Meters; + case UnitSystem.Kilometers: + return Units.Kilometers; + case UnitSystem.Inches: + return Units.Inches; + case UnitSystem.Feet: + return Units.Feet; + case UnitSystem.Yards: + return Units.Yards; + case UnitSystem.Miles: + return Units.Miles; + case UnitSystem.Unset: + return Units.Meters; + default: + throw new SpeckleException($"The Unit System \"{unitSystem}\" is unsupported."); + } + } +} diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoInstanceObjectsManager.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoInstanceObjectsManager.cs new file mode 100644 index 0000000000..e79073bddf --- /dev/null +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoInstanceObjectsManager.cs @@ -0,0 +1,254 @@ +using System.DoubleNumerics; +using Rhino; +using Rhino.DocObjects; +using Rhino.Geometry; +using Speckle.Connectors.Rhino7.Extensions; +using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Utils.Instances; +using Speckle.Core.Kits; +using Speckle.Core.Logging; +using Speckle.Core.Models; +using Speckle.Core.Models.Instances; + +namespace Speckle.Connectors.Rhino7.HostApp; + +/// +/// +/// Expects to be a scoped dependency per send or receive operation. +/// +public class RhinoInstanceObjectsManager : IInstanceObjectsManager> +{ + private readonly Dictionary _instanceProxies = new(); + private readonly Dictionary> _instanceProxiesByDefinitionId = new(); + private readonly Dictionary _definitionProxies = new(); + private readonly Dictionary _flatAtomicObjects = new(); + private readonly RhinoLayerManager _layerManager; + + public RhinoInstanceObjectsManager(RhinoLayerManager layerManager) + { + _layerManager = layerManager; + } + + public UnpackResult UnpackSelection(IEnumerable objects) + { + foreach (var obj in objects) + { + if (obj is InstanceObject instanceObject) + { + UnpackInstance(instanceObject); + } + _flatAtomicObjects[obj.Id.ToString()] = obj; + } + return new(_flatAtomicObjects.Values.ToList(), _instanceProxies, _definitionProxies.Values.ToList()); + } + + private void UnpackInstance(InstanceObject instance, int depth = 0) + { + var instanceId = instance.Id.ToString(); + var instanceDefinitionId = instance.InstanceDefinition.Id.ToString(); + var currentDoc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around + + _instanceProxies[instanceId] = new InstanceProxy() + { + applicationId = instanceId, + DefinitionId = instance.InstanceDefinition.Id.ToString(), + Transform = XFormToMatrix(instance.InstanceXform), + MaxDepth = depth, + Units = currentDoc.ModelUnitSystem.ToSpeckleString() + }; + + // For each block instance that has the same definition, we need to keep track of the "maximum depth" at which is found. + // This will enable on receive to create them in the correct order (descending by max depth, interleaved definitions and instances). + // We need to interleave the creation of definitions and instances, as some definitions may depend on instances. + if ( + !_instanceProxiesByDefinitionId.TryGetValue( + instanceDefinitionId, + out List instanceProxiesWithSameDefinition + ) + ) + { + instanceProxiesWithSameDefinition = new List(); + _instanceProxiesByDefinitionId[instanceDefinitionId] = instanceProxiesWithSameDefinition; + } + + // We ensure that all previous instance proxies that have the same definition are at this max depth. I kind of have a feeling this can be done more elegantly, but YOLO + foreach (var instanceProxy in instanceProxiesWithSameDefinition) + { + instanceProxy.MaxDepth = depth; + } + + instanceProxiesWithSameDefinition.Add(_instanceProxies[instanceId]); + + if (_definitionProxies.TryGetValue(instanceDefinitionId, out InstanceDefinitionProxy value)) + { + value.MaxDepth = depth; + return; + } + + var definition = new InstanceDefinitionProxy + { + applicationId = instanceDefinitionId, + Objects = new List(), + MaxDepth = depth, + ["name"] = instance.InstanceDefinition.Name, + ["description"] = instance.InstanceDefinition.Description + }; + + _definitionProxies[instance.InstanceDefinition.Id.ToString()] = definition; + + foreach (var obj in instance.InstanceDefinition.GetObjects()) + { + definition.Objects.Add(obj.Id.ToString()); + if (obj is InstanceObject localInstance) + { + UnpackInstance(localInstance, depth + 1); + } + _flatAtomicObjects[obj.Id.ToString()] = obj; + } + } + + /// + /// Bakes in the host app doc instances. Assumes constituent atomic objects already present in the host app. + /// + /// Instance definitions and instances that need creating. + /// A dict mapping { original application id -> [resulting application ids post conversion] } + /// + public BakeResult BakeInstances( + List<(string[] layerPath, IInstanceComponent obj)> instanceComponents, + Dictionary> applicationIdMap, + string baseLayerName, + Action? onOperationProgressed + ) + { + // var doc = _contextStack.Current.Document; + var doc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around + + var sortedInstanceComponents = instanceComponents + .OrderByDescending(x => x.obj.MaxDepth) // Sort by max depth, so we start baking from the deepest element first + .ThenBy(x => x.obj is InstanceDefinitionProxy ? 0 : 1) // Ensure we bake the deepest definition first, then any instances that depend on it + .ToList(); + var definitionIdAndApplicationIdMap = new Dictionary(); + + var count = 0; + var conversionResults = new List(); + var createdObjectIds = new List(); + var consumedObjectIds = new List(); + foreach (var (path, instanceOrDefinition) in sortedInstanceComponents) + { + onOperationProgressed?.Invoke("Converting blocks", (double)++count / sortedInstanceComponents.Count); + try + { + if (instanceOrDefinition is InstanceDefinitionProxy definitionProxy) + { + var currentApplicationObjectsIds = definitionProxy.Objects + .Select(x => applicationIdMap.TryGetValue(x, out List value) ? value : null) + .Where(x => x is not null) + .SelectMany(id => id) + .ToList(); + + var definitionGeometryList = new List(); + var attributes = new List(); + + foreach (var id in currentApplicationObjectsIds) + { + var docObject = doc.Objects.FindId(new Guid(id)); + definitionGeometryList.Add(docObject.Geometry); + attributes.Add(docObject.Attributes); + } + + // POC: Currently we're relying on the definition name for identification if it's coming from speckle and from which model; could we do something else? + var defName = $"{baseLayerName} ({definitionProxy.applicationId})"; + var defIndex = doc.InstanceDefinitions.Add( + defName, + "No description", // POC: perhaps bring it along from source? We'd need to look at ACAD first + Point3d.Origin, + definitionGeometryList, + attributes + ); + + // POC: check on defIndex -1, means we haven't created anything - this is most likely an recoverable error at this stage + if (defIndex == -1) + { + throw new ConversionException("Failed to create an instance defintion object."); + } + + if (definitionProxy.applicationId != null) + { + definitionIdAndApplicationIdMap[definitionProxy.applicationId] = defIndex; + } + + // Rhino deletes original objects on block creation - we should do the same. + doc.Objects.Delete(currentApplicationObjectsIds.Select(stringId => new Guid(stringId)), false); + consumedObjectIds.AddRange(currentApplicationObjectsIds); + createdObjectIds.RemoveAll(id => consumedObjectIds.Contains(id)); // in case we've consumed some existing instances + } + + if ( + instanceOrDefinition is InstanceProxy instanceProxy + && definitionIdAndApplicationIdMap.TryGetValue(instanceProxy.DefinitionId, out int index) + ) + { + var transform = MatrixToTransform(instanceProxy.Transform, instanceProxy.Units); + var layerIndex = _layerManager.GetAndCreateLayerFromPath(path, baseLayerName); + var id = doc.Objects.AddInstanceObject(index, transform, new ObjectAttributes() { LayerIndex = layerIndex }); + if (instanceProxy.applicationId != null) + { + applicationIdMap[instanceProxy.applicationId] = new List() { id.ToString() }; + } + + createdObjectIds.Add(id.ToString()); + conversionResults.Add(new(Status.SUCCESS, instanceProxy, id.ToString(), "Instance (Block)")); + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + conversionResults.Add(new(Status.ERROR, instanceOrDefinition as Base ?? new Base(), null, null, ex)); + } + } + + return new(createdObjectIds, consumedObjectIds, conversionResults); + } + + public void PurgeInstances(string namePrefix) + { + var currentDoc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around + foreach (var definition in currentDoc.InstanceDefinitions) + { + if (!definition.IsDeleted && definition.Name.Contains(namePrefix)) + { + currentDoc.InstanceDefinitions.Delete(definition.Index, true, false); + } + } + } + + private Matrix4x4 XFormToMatrix(Transform t) => + new(t.M00, t.M01, t.M02, t.M03, t.M10, t.M11, t.M12, t.M13, t.M20, t.M21, t.M22, t.M23, t.M30, t.M31, t.M32, t.M33); + + private Transform MatrixToTransform(Matrix4x4 matrix, string units) + { + var currentDoc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around + var conversionFactor = Units.GetConversionFactor(units, currentDoc.ModelUnitSystem.ToSpeckleString()); + + var t = Transform.Identity; + t.M00 = matrix.M11; + t.M01 = matrix.M12; + t.M02 = matrix.M13; + t.M03 = matrix.M14 * conversionFactor; + + t.M10 = matrix.M21; + t.M11 = matrix.M22; + t.M12 = matrix.M23; + t.M13 = matrix.M24 * conversionFactor; + + t.M20 = matrix.M31; + t.M21 = matrix.M32; + t.M22 = matrix.M33; + t.M23 = matrix.M34 * conversionFactor; + + t.M30 = matrix.M41; + t.M31 = matrix.M42; + t.M32 = matrix.M43; + t.M33 = matrix.M44; + return t; + } +} diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoLayerManager.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoLayerManager.cs new file mode 100644 index 0000000000..55323bf099 --- /dev/null +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/HostApp/RhinoLayerManager.cs @@ -0,0 +1,122 @@ +using System.Diagnostics.Contracts; +using Rhino; +using Rhino.DocObjects; +using Speckle.Core.Models; +using Speckle.Core.Models.GraphTraversal; + +namespace Speckle.Connectors.Rhino7.HostApp; + +/// +/// Utility class managing layer creation and/or extraction from rhino. Expects to be a scoped dependency per send or receive operation. +/// +public class RhinoLayerManager +{ + private readonly Dictionary _hostLayerCache = new(); + private readonly Dictionary _layerCollectionCache = new(); + + /// + /// Creates the base layer and adds it to the cache. + /// + /// + public void CreateBaseLayer(string baseLayerName) + { + var index = RhinoDoc.ActiveDoc.Layers.Add(new Layer { Name = baseLayerName }); // POC: too much effort right now to wrap around the interfaced layers and doc + // var index = _contextStack.Current.Document.Layers.Add(new Layer { Name = baseLayerName }); + _hostLayerCache.Add(baseLayerName, index); + } + + /// + /// For receive: Use this method to construct layers in the host app when receiving.. + /// + /// + /// + /// + public int GetAndCreateLayerFromPath(string[] path, string baseLayerName) + { + var fullLayerName = string.Join(Layer.PathSeparator, path); + if (_hostLayerCache.TryGetValue(fullLayerName, out int existingLayerIndex)) + { + return existingLayerIndex; + } + + var currentLayerName = baseLayerName; + var currentDocument = RhinoDoc.ActiveDoc; // POC: too much effort right now to wrap around the interfaced layers + + var previousLayer = currentDocument.Layers.FindName(currentLayerName); + foreach (var layerName in path) + { + currentLayerName = baseLayerName + Layer.PathSeparator + layerName; + currentLayerName = currentLayerName.Replace("{", "").Replace("}", ""); // Rhino specific cleanup for gh (see RemoveInvalidRhinoChars) + if (_hostLayerCache.TryGetValue(currentLayerName, out int value)) + { + previousLayer = currentDocument.Layers.FindIndex(value); + continue; + } + + var cleanNewLayerName = layerName.Replace("{", "").Replace("}", ""); + var newLayer = new Layer { Name = cleanNewLayerName, ParentLayerId = previousLayer.Id }; + var index = currentDocument.Layers.Add(newLayer); + _hostLayerCache.Add(currentLayerName, index); + previousLayer = currentDocument.Layers.FindIndex(index); // note we need to get the correct id out, hence why we're double calling this + } + return previousLayer.Index; + } + + /// + /// For send: Use this method to construct the root commit object while converting objects. + /// Returns the host collection corresponding to the provided layer. If it's the first time that it is being asked for, it will be created and stored in the root object collection. + /// + /// The layer you want the equivalent collection for. + /// The root object that will be sent to Speckle, and will host all collections. + /// + public Collection GetHostObjectCollection(Layer layer, Collection rootObjectCollection) + { + if (_layerCollectionCache.TryGetValue(layer.Index, out Collection value)) + { + return value; + } + + var names = layer.FullPath.Split(new[] { Layer.PathSeparator }, StringSplitOptions.None); + var path = names[0]; + var index = 0; + var previousCollection = rootObjectCollection; + foreach (var layerName in names) + { + var existingLayerIndex = RhinoDoc.ActiveDoc.Layers.FindByFullPath(path, -1); + Collection? childCollection = null; + if (_layerCollectionCache.TryGetValue(existingLayerIndex, out Collection? collection)) + { + childCollection = collection; + } + else + { + childCollection = new Collection(layerName, "layer") + { + applicationId = RhinoDoc.ActiveDoc.Layers[existingLayerIndex].Id.ToString() + }; + previousCollection.elements.Add(childCollection); + _layerCollectionCache[existingLayerIndex] = childCollection; + } + + previousCollection = childCollection; + + if (index < names.Length - 1) + { + path += Layer.PathSeparator + names[index + 1]; + } + index++; + } + + _layerCollectionCache[layer.Index] = previousCollection; + return previousCollection; + } + + [Pure] + public string[] GetLayerPath(TraversalContext context) + { + string[] collectionBasedPath = context.GetAscendantOfType().Select(c => c.name).ToArray(); + string[] reverseOrderPath = + collectionBasedPath.Length != 0 ? collectionBasedPath : context.GetPropertyPath().ToArray(); + return reverseOrderPath.Reverse().ToArray(); + } +} diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs index 02f653f08a..1967f3a2bf 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Receive/RhinoHostObjectBuilder.cs @@ -1,31 +1,43 @@ -using System.Diagnostics.Contracts; using Rhino; using Rhino.DocObjects; using Rhino.Geometry; +using Speckle.Connectors.Rhino7.HostApp; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Utils.Instances; using Speckle.Converters.Common; using Speckle.Core.Logging; using Speckle.Core.Models; using Speckle.Core.Models.GraphTraversal; +using Speckle.Core.Models.Instances; namespace Speckle.Connectors.Rhino7.Operations.Receive; +/// +/// Expects to be a scoped dependency per receive operation. +/// public class RhinoHostObjectBuilder : IHostObjectBuilder { private readonly IRootToHostConverter _converter; private readonly IConversionContextStack _contextStack; private readonly GraphTraversal _traverseFunction; + private readonly IInstanceObjectsManager> _instanceObjectsManager; + private readonly RhinoLayerManager _layerManager; + public RhinoHostObjectBuilder( IRootToHostConverter converter, IConversionContextStack contextStack, - GraphTraversal traverseFunction + GraphTraversal traverseFunction, + RhinoLayerManager layerManager, + IInstanceObjectsManager> instanceObjectsManager ) { _converter = converter; _contextStack = contextStack; _traverseFunction = traverseFunction; + _layerManager = layerManager; + _instanceObjectsManager = instanceObjectsManager; } public HostObjectBuilderResult Build( @@ -43,77 +55,136 @@ CancellationToken cancellationToken .TraverseWithProgress(rootObject, onOperationProgressed, cancellationToken) .Where(obj => obj.Current is not Collection); - var conversionResults = BakeObjects(objectsToConvert, baseLayerName); + var instanceDefinitionProxies = (rootObject["instanceDefinitionProxies"] as List) + ?.Cast() + .ToList(); + + var conversionResults = BakeObjects( + objectsToConvert, + instanceDefinitionProxies, + baseLayerName, + onOperationProgressed + ); _contextStack.Current.Document.Views.Redraw(); return conversionResults; } - // POC: Potentially refactor out into an IObjectBaker. - private HostObjectBuilderResult BakeObjects(IEnumerable objectsGraph, string baseLayerName) + private HostObjectBuilderResult BakeObjects( + IEnumerable objectsGraph, + List? instanceDefinitionProxies, + string baseLayerName, + Action? onOperationProgressed + ) { RhinoDoc doc = _contextStack.Current.Document; var rootLayerIndex = _contextStack.Current.Document.Layers.Find(Guid.Empty, baseLayerName, RhinoMath.UnsetIntIndex); - // POC: We could move this out into a separate service for testing and re-use. - // Cleans up any previously received objects - if (rootLayerIndex != RhinoMath.UnsetIntIndex) - { - Layer documentLayer = doc.Layers[rootLayerIndex]; - Layer[]? childLayers = documentLayer.GetChildren(); - if (childLayers != null) - { - using var layerNoDraw = new DisableRedrawScope(doc.Views); - foreach (var layer in childLayers) - { - var purgeSuccess = doc.Layers.Purge(layer.Index, true); - if (!purgeSuccess) - { - Console.WriteLine($"Failed to purge layer: {layer}"); - } - } - } - } - - var cache = new Dictionary(); - rootLayerIndex = doc.Layers.Add(new Layer { Name = baseLayerName }); - cache.Add(baseLayerName, rootLayerIndex); + PreReceiveDeepClean(baseLayerName, rootLayerIndex); + _layerManager.CreateBaseLayer(baseLayerName); using var noDraw = new DisableRedrawScope(doc.Views); var conversionResults = new List(); var bakedObjectIds = new List(); - foreach (TraversalContext tc in objectsGraph) + var instanceComponents = new List<(string[] layerPath, IInstanceComponent obj)>(); + + // POC: these are not captured by traversal, so we need to re-add them here + if (instanceDefinitionProxies != null && instanceDefinitionProxies.Count > 0) { - try - { - var path = GetLayerPath(tc); + var transformed = instanceDefinitionProxies.Select(proxy => (Array.Empty(), proxy as IInstanceComponent)); + instanceComponents.AddRange(transformed); + } - var fullLayerName = string.Join(Layer.PathSeparator, path); - var layerIndex = cache.TryGetValue(fullLayerName, out int value) - ? value - : GetAndCreateLayerFromPath(path, baseLayerName, cache); + var atomicObjects = new List<(string[] layerPath, Base obj)>(); - var result = _converter.Convert(tc.Current); + // Split up the instances from the non-instances + foreach (TraversalContext tc in objectsGraph) + { + var path = _layerManager.GetLayerPath(tc); + if (tc.Current is IInstanceComponent instanceComponent) + { + instanceComponents.Add((path, instanceComponent)); + } + else + { + atomicObjects.Add((path, tc.Current)); + } + } - var conversionIds = HandleConversionResult(result, tc.Current, layerIndex); + // Stage 1: Convert atomic objects + // Note: this can become encapsulated later in an "atomic object baker" of sorts, if needed. + var applicationIdMap = new Dictionary>(); // used in converting blocks in stage 2. keeps track of original app id => resulting new app ids post baking + var count = 0; + foreach (var (path, obj) in atomicObjects) + { + onOperationProgressed?.Invoke("Converting objects", (double)++count / atomicObjects.Count); + try + { + var layerIndex = _layerManager.GetAndCreateLayerFromPath(path, baseLayerName); + var result = _converter.Convert(obj); + var conversionIds = HandleConversionResult(result, obj, layerIndex).ToList(); foreach (var r in conversionIds) { - conversionResults.Add(new(Status.SUCCESS, tc.Current, r, result.GetType().ToString())); + conversionResults.Add(new(Status.SUCCESS, obj, r, result.GetType().ToString())); bakedObjectIds.Add(r); } + + if (obj.applicationId != null) + { + applicationIdMap[obj.applicationId] = conversionIds; + } } catch (Exception ex) when (!ex.IsFatal()) { - conversionResults.Add(new(Status.ERROR, tc.Current, null, null, ex)); + conversionResults.Add(new(Status.ERROR, obj, null, null, ex)); } } + // Stage 2: Convert instances + var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = _instanceObjectsManager.BakeInstances( + instanceComponents, + applicationIdMap, + baseLayerName, + onOperationProgressed + ); + + bakedObjectIds.RemoveAll(id => consumedObjectIds.Contains(id)); // remove all objects that have been "consumed" + bakedObjectIds.AddRange(createdInstanceIds); // add instance ids + conversionResults.RemoveAll(result => result.ResultId != null && consumedObjectIds.Contains(result.ResultId)); // remove all conversion results for atomic objects that have been consumed (POC: not that cool, but prevents problems on object highlighting) + conversionResults.AddRange(instanceConversionResults); // add instance conversion results to our list + + // Stage 3: Return return new(bakedObjectIds, conversionResults); } + private void PreReceiveDeepClean(string baseLayerName, int rootLayerIndex) + { + _instanceObjectsManager.PurgeInstances(baseLayerName); + + var doc = _contextStack.Current.Document; + // Cleans up any previously received objects + if (rootLayerIndex != RhinoMath.UnsetIntIndex) + { + var documentLayer = doc.Layers[rootLayerIndex]; + var childLayers = documentLayer.GetChildren(); + if (childLayers != null) + { + using var layerNoDraw = new DisableRedrawScope(doc.Views); + foreach (var layer in childLayers) + { + var purgeSuccess = doc.Layers.Purge(layer.Index, true); + if (!purgeSuccess) + { + Console.WriteLine($"Failed to purge layer: {layer}"); + } + } + } + } + } + private IReadOnlyList HandleConversionResult(object conversionResult, Base originalObject, int layerIndex) { var doc = _contextStack.Current.Document; @@ -149,39 +220,4 @@ private Group BakeObjectsAsGroup(string groupName, IEnumerable lis var group = _contextStack.Current.Document.Groups.FindIndex(groupIndex); return group; } - - // POC: This is the original DUI3 function, this will grow over time as we add more conversions that are missing, so it should be refactored out into an ILayerManager or some sort of service. - private int GetAndCreateLayerFromPath(string[] path, string baseLayerName, Dictionary cache) - { - var currentLayerName = baseLayerName; - RhinoDoc currentDocument = _contextStack.Current.Document; - - var previousLayer = currentDocument.Layers.FindName(currentLayerName); - foreach (var layerName in path) - { - currentLayerName = baseLayerName + Layer.PathSeparator + layerName; - currentLayerName = currentLayerName.Replace("{", "").Replace("}", ""); // Rhino specific cleanup for gh (see RemoveInvalidRhinoChars) - if (cache.TryGetValue(currentLayerName, out int value)) - { - previousLayer = currentDocument.Layers.FindIndex(value); - continue; - } - - var cleanNewLayerName = layerName.Replace("{", "").Replace("}", ""); - var newLayer = new Layer { Name = cleanNewLayerName, ParentLayerId = previousLayer.Id }; - var index = currentDocument.Layers.Add(newLayer); - cache.Add(currentLayerName, index); - previousLayer = currentDocument.Layers.FindIndex(index); // note we need to get the correct id out, hence why we're double calling this - } - return previousLayer.Index; - } - - [Pure] - private static string[] GetLayerPath(TraversalContext context) - { - string[] collectionBasedPath = context.GetAscendantOfType().Select(c => c.name).ToArray(); - string[] reverseOrderPath = - collectionBasedPath.Length != 0 ? collectionBasedPath : context.GetPropertyPath().ToArray(); - return reverseOrderPath.Reverse().ToArray(); - } } diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Send/RhinoRootObjectBuilder.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Send/RhinoRootObjectBuilder.cs index 2d5996c97a..03d01c8568 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Send/RhinoRootObjectBuilder.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Operations/Send/RhinoRootObjectBuilder.cs @@ -1,13 +1,15 @@ using System.Diagnostics; -using Rhino.DocObjects; using Rhino; +using Rhino.DocObjects; using Speckle.Core.Models; using Speckle.Autofac.DependencyInjection; using Speckle.Converters.Common; using Speckle.Connectors.DUI.Models.Card.SendFilter; +using Speckle.Connectors.Rhino7.HostApp; using Speckle.Connectors.Utils.Builders; using Speckle.Connectors.Utils.Caching; using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Utils.Instances; using Speckle.Connectors.Utils.Operations; using Speckle.Core.Logging; @@ -20,11 +22,23 @@ public class RhinoRootObjectBuilder : IRootObjectBuilder { private readonly IUnitOfWorkFactory _unitOfWorkFactory; private readonly ISendConversionCache _sendConversionCache; - - public RhinoRootObjectBuilder(IUnitOfWorkFactory unitOfWorkFactory, ISendConversionCache sendConversionCache) + private readonly IInstanceObjectsManager> _instanceObjectsManager; + private readonly IConversionContextStack _contextStack; + private readonly RhinoLayerManager _layerManager; + + public RhinoRootObjectBuilder( + IUnitOfWorkFactory unitOfWorkFactory, + ISendConversionCache sendConversionCache, + IConversionContextStack contextStack, + RhinoLayerManager layerManager, + IInstanceObjectsManager> instanceObjectsManager + ) { _unitOfWorkFactory = unitOfWorkFactory; _sendConversionCache = sendConversionCache; + _contextStack = contextStack; + _layerManager = layerManager; + _instanceObjectsManager = instanceObjectsManager; } public RootObjectBuilderResult Build( @@ -46,22 +60,28 @@ private RootObjectBuilderResult ConvertObjects( using var uow = _unitOfWorkFactory.Resolve(); var converter = uow.Service; - var rootObjectCollection = new Collection { name = RhinoDoc.ActiveDoc.Name ?? "Unnamed document" }; + var rootObjectCollection = new Collection { name = _contextStack.Current.Document.Name ?? "Unnamed document" }; int count = 0; Dictionary layerCollectionCache = new(); + var (atomicObjects, instanceProxies, instanceDefinitionProxies) = _instanceObjectsManager.UnpackSelection( + rhinoObjects + ); + + // POC: we should formalise this, sooner or later - or somehow fix it a bit more + rootObjectCollection["instanceDefinitionProxies"] = instanceDefinitionProxies; // this won't work re traversal on receive + // POC: Handle blocks. List results = new(rhinoObjects.Count); var cacheHitCount = 0; - foreach (RhinoObject rhinoObject in rhinoObjects) + foreach (RhinoObject rhinoObject in atomicObjects) { cancellationToken.ThrowIfCancellationRequested(); + // RhinoDoc.ActiveDoc.Layers + var layer = _contextStack.Current.Document.Layers[rhinoObject.Attributes.LayerIndex]; - // POC: This uses the ActiveDoc but it is bad practice to do so. A context object should be injected that would contain the Doc. - var layer = RhinoDoc.ActiveDoc.Layers[rhinoObject.Attributes.LayerIndex]; - - var collectionHost = GetHostObjectCollection(layerCollectionCache, layer, rootObjectCollection); + var collectionHost = _layerManager.GetHostObjectCollection(layer, rootObjectCollection); var applicationId = rhinoObject.Id.ToString(); try @@ -70,8 +90,11 @@ private RootObjectBuilderResult ConvertObjects( // What we actually do here is check if the object has been previously converted AND has not changed. // If that's the case, we insert in the host collection just its object reference which has been saved from the prior conversion. Base converted; - - if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference value)) + if (rhinoObject is InstanceObject) + { + converted = instanceProxies[applicationId]; + } + else if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference value)) { converted = value; cacheHitCount++; @@ -106,58 +129,4 @@ private RootObjectBuilderResult ConvertObjects( // 5. profit return new(rootObjectCollection, results); } - - /// - /// Returns the host collection based on the provided layer. If it's not found, it will be created and hosted within the the rootObjectCollection. - /// - /// - /// - /// - /// - private Collection GetHostObjectCollection( - Dictionary layerCollectionCache, - Layer layer, - Collection rootObjectCollection - ) - { - // POC: This entire implementation should be broken down and potentially injected in. - if (layerCollectionCache.TryGetValue(layer.Index, out Collection value)) - { - return value; - } - - var names = layer.FullPath.Split(new[] { Layer.PathSeparator }, StringSplitOptions.None); - var path = names[0]; - var index = 0; - var previousCollection = rootObjectCollection; - foreach (var layerName in names) - { - var existingLayerIndex = RhinoDoc.ActiveDoc.Layers.FindByFullPath(path, -1); - Collection? childCollection = null; - if (layerCollectionCache.TryGetValue(existingLayerIndex, out Collection? collection)) - { - childCollection = collection; - } - else - { - childCollection = new Collection(layerName, "layer") - { - applicationId = RhinoDoc.ActiveDoc.Layers[existingLayerIndex].Id.ToString() - }; - previousCollection.elements.Add(childCollection); - layerCollectionCache[existingLayerIndex] = childCollection; - } - - previousCollection = childCollection; - - if (index < names.Length - 1) - { - path += Layer.PathSeparator + names[index + 1]; - } - index++; - } - - layerCollectionCache[layer.Index] = previousCollection; - return previousCollection; - } } diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json index 42b0399f3e..53de68cb60 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json @@ -285,11 +285,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Revit2023.Interfaces": { - "type": "Transitive", - "resolved": "0.1.1-preview.0.24", - "contentHash": "BSVpOUJc9g6ISrw8GxvtkglTlITpHEDYNOhxv1ZPbckBsI0yO36JiphhQV4q57ERqD9PpCozUJkVhlCaxWeS6A==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -449,7 +444,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -465,14 +460,14 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "speckle.converters.common": { "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -516,9 +511,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -540,11 +535,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "System.Threading.Tasks.Dataflow": { diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json index 383e499052..9f83e4c13d 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json @@ -370,7 +370,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -394,9 +394,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -418,11 +418,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json index 18027e4d25..b77f27c0be 100644 --- a/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json +++ b/DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json @@ -363,7 +363,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -374,9 +374,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -398,11 +398,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json index e9931ee09e..e51635ea86 100644 --- a/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json @@ -374,7 +374,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -402,9 +402,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -426,11 +426,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json index b114e8a7c5..3c281f9dcf 100644 --- a/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2023/Speckle.Converters.Autocad2023/packages.lock.json @@ -364,7 +364,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -379,9 +379,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -403,11 +403,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json index 8eee516ff1..fe9923d926 100644 --- a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json @@ -374,7 +374,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -402,9 +402,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -426,11 +426,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json index 5ef4059ca1..0a1d936cee 100644 --- a/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json +++ b/DUI3-DX/Converters/Autocad/2024/Speckle.Converters.Autocad2024/packages.lock.json @@ -364,7 +364,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -379,9 +379,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -403,11 +403,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json index a1186a3a61..254754bd42 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json @@ -358,7 +358,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -387,9 +387,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -411,11 +411,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "Speckle.Revit.API": { diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs deleted file mode 100644 index 471ca0be47..0000000000 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023.Tests/XyzConversionToPointTests.cs +++ /dev/null @@ -1,59 +0,0 @@ -using FluentAssertions; -using Moq; -using NUnit.Framework; -using Speckle.Converters.Common; -using Speckle.Converters.RevitShared.Services; -using Speckle.Converters.RevitShared.ToSpeckle; -using Speckle.Revit.Interfaces; - -namespace Speckle.Converters.Revit2023.Tests; - -public class XyzConversionToPointTests -{ - private readonly MockRepository _repository = new(MockBehavior.Strict); - - private readonly Mock> _revitConversionContextStack; - private readonly Mock _scalingServiceToSpeckle; - - public XyzConversionToPointTests() - { - _revitConversionContextStack = _repository.Create>(); - _scalingServiceToSpeckle = _repository.Create(); - } - - [TearDown] - public void Verify() => _repository.VerifyAll(); - - [Test] - public void Convert_Point() - { - var x = 3.1; - var y = 3.2; - var z = 3.3; - var xScaled = 4.1; - var yScaled = 4.2; - var zScaled = 4.3; - var xyz = _repository.Create(); - xyz.Setup(x => x.X).Returns(x); - xyz.Setup(x => x.Y).Returns(y); - xyz.Setup(x => x.Z).Returns(z); - - var units = "units"; - var conversionContext = _repository.Create>(); - conversionContext.Setup(x => x.SpeckleUnits).Returns(units); - - _scalingServiceToSpeckle.Setup(a => a.ScaleLength(x)).Returns(xScaled); - _scalingServiceToSpeckle.Setup(a => a.ScaleLength(y)).Returns(yScaled); - _scalingServiceToSpeckle.Setup(a => a.ScaleLength(z)).Returns(zScaled); - - _revitConversionContextStack.Setup(x => x.Current).Returns(conversionContext.Object); - - var converter = new XyzConversionToPoint(_scalingServiceToSpeckle.Object, _revitConversionContextStack.Object); - var point = converter.Convert(xyz.Object); - - point.x.Should().Be(xScaled); - point.y.Should().Be(yScaled); - point.z.Should().Be(zScaled); - point.units.Should().Be(units); - } -} diff --git a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json index 0fbae10307..742efddba5 100644 --- a/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json +++ b/DUI3-DX/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json @@ -364,7 +364,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -379,9 +379,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -403,11 +403,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json index a897641f42..8094f14468 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json @@ -216,11 +216,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Revit2023.Interfaces": { - "type": "Transitive", - "resolved": "0.1.1-preview.0.24", - "contentHash": "BSVpOUJc9g6ISrw8GxvtkglTlITpHEDYNOhxv1ZPbckBsI0yO36JiphhQV4q57ERqD9PpCozUJkVhlCaxWeS6A==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -369,7 +364,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "speckle.converters.common.dependencyinjection": { @@ -398,9 +393,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -422,11 +417,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json index 57b03cf40e..98fcfe0158 100644 --- a/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json +++ b/DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json @@ -364,7 +364,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -379,9 +379,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -403,11 +403,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json index 9529e2c9c7..ff084cdbee 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json @@ -426,7 +426,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -435,7 +435,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -460,9 +460,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -865,7 +865,7 @@ "Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", "Speckle.Connectors.Utils": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )", + "Speckle.Core": "[3.0.1-alpha.14, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -874,7 +874,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -895,9 +895,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json b/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json index d1e30f591b..9f44602e71 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/packages.lock.json @@ -39,9 +39,9 @@ }, "Speckle.Core": { "type": "Direct", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -538,7 +538,7 @@ "dependencies": { "Serilog.Extensions.Logging": "[7.0.0, )", "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Core": "[3.0.1-alpha.11, )" + "Speckle.Core": "[3.0.1-alpha.14, )" } }, "Serilog.Extensions.Logging": { diff --git a/DUI3-DX/Directory.Packages.props b/DUI3-DX/Directory.Packages.props index ece50df9a0..f8e92452ff 100644 --- a/DUI3-DX/Directory.Packages.props +++ b/DUI3-DX/Directory.Packages.props @@ -16,8 +16,8 @@ - - + + diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/Instances/IInstanceObjectsManager.cs b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Instances/IInstanceObjectsManager.cs new file mode 100644 index 0000000000..532e42ed0e --- /dev/null +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/Instances/IInstanceObjectsManager.cs @@ -0,0 +1,53 @@ +using Speckle.Connectors.Utils.Conversion; +using Speckle.Core.Models.Instances; + +namespace Speckle.Connectors.Utils.Instances; + +/// +/// A utility class that helps manage host application blocks in send/receive operations. This expects to be a scoped dependendency per send/receive operation. +/// POC: could be split into two - instance unpacker and instance baker. +/// +/// Host application object type, e.g. RhinoObject +/// The type of the applicationIdMap values. +public interface IInstanceObjectsManager +{ + /// + /// Given a list of host application objects, it will unpack them into atomic objects, instance proxies and instance proxy definitions. + /// + /// Raw selection from the host application. + UnpackResult UnpackSelection(IEnumerable objects); + + /// + /// Will bake a set of instance components (instances and instance definitions) in the host app. + /// + /// + /// + /// + /// + /// + BakeResult BakeInstances( + List<(string[] layerPath, IInstanceComponent obj)> instanceComponents, + Dictionary applicationIdMap, + string baseLayerName, + Action? onOperationProgressed + ); + + /// + /// Cleans up previously baked instances and associated definitions containing the `namePrefix` in their name. + /// Note: this is based on the convention that all defintions have their name set to a model based prefix. + /// + /// The name prefix to search and delete by. + void PurgeInstances(string namePrefix); +} + +public record UnpackResult( + List AtomicObjects, + Dictionary InstanceProxies, + List InstanceDefinitionProxies +); + +public record BakeResult( + List CreatedInstanceIds, + List ConsumedObjectIds, + List InstanceConversionResults +); diff --git a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json index 2b72b82db0..990763d412 100644 --- a/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Connectors.Utils/packages.lock.json @@ -48,9 +48,9 @@ }, "Speckle.Core": { "type": "Direct", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json index 19523196d8..cb39bea478 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json @@ -464,7 +464,7 @@ "type": "Project", "dependencies": { "Speckle.Autofac": "[2.0.999-local, )", - "Speckle.Objects": "[3.0.1-alpha.11, )" + "Speckle.Objects": "[3.0.1-alpha.14, )" } }, "Microsoft.Extensions.Logging.Abstractions": { @@ -479,9 +479,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -503,11 +503,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } } } diff --git a/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json b/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json index 0bd34a6305..23035de679 100644 --- a/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json +++ b/DUI3-DX/Sdk/Speckle.Converters.Common/packages.lock.json @@ -35,11 +35,11 @@ }, "Speckle.Objects": { "type": "Direct", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==", "dependencies": { - "Speckle.Core": "3.0.1-alpha.11" + "Speckle.Core": "3.0.1-alpha.14" } }, "GraphQL.Client": { @@ -472,9 +472,9 @@ }, "Speckle.Core": { "type": "CentralTransitive", - "requested": "[3.0.1-alpha.11, )", - "resolved": "3.0.1-alpha.11", - "contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==", + "requested": "[3.0.1-alpha.14, )", + "resolved": "3.0.1-alpha.14", + "contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", From cbe19c76d4c27a752ece17b56f788f03c9df9486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuzhan=20Koral?= <45078678+oguzhankoral@users.noreply.github.com> Date: Fri, 28 Jun 2024 18:00:44 +0300 Subject: [PATCH 6/6] DUI3-448 both model card types need 2 clicks to actually cancel 1 to stop operation and 1 to refresh progress bar (#3538) * Do not send any progress update if cancelled * Use cts instead ct --------- Co-authored-by: KatKatKateryna --- .../Bindings/ArcGISReceiveBinding.cs | 8 ++------ .../Bindings/ArcGISSendBinding.cs | 8 ++------ .../Bindings/AutocadReceiveBinding.cs | 8 ++------ .../Bindings/AutocadSendBinding.cs | 8 ++------ .../Bindings/RevitSendBinding.cs | 8 ++------ .../Bindings/RhinoReceiveBinding.cs | 8 ++------ .../Bindings/RhinoSendBinding.cs | 8 ++------ .../Bindings/IBasicConnectorBinding.cs | 12 ++++++++++-- 8 files changed, 24 insertions(+), 44 deletions(-) diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs index fcccc93f25..489e7296bd 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs @@ -58,7 +58,8 @@ public async Task Receive(string modelCardId) modelCard.ModelName.NotNull(), modelCard.SelectedVersionId.NotNull(), cts.Token, - (status, progress) => OnSendOperationProgress(modelCardId, status, progress) + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts) ) .ConfigureAwait(false); @@ -77,10 +78,5 @@ public async Task Receive(string modelCardId) } } - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } - public void CancelReceive(string modelCardId) => _cancellationManager.CancelOperation(modelCardId); } diff --git a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs index 4c0215694b..9ef113e74d 100644 --- a/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs +++ b/DUI3-DX/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs @@ -350,7 +350,8 @@ public async Task Send(string modelCardId) .Execute( mapMembers, sendInfo, - (status, progress) => OnSendOperationProgress(modelCardId, status, progress), + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); @@ -407,9 +408,4 @@ private void RunExpirationChecks(bool idsDeleted) Commands.SetModelsExpired(expiredSenderIds); ChangedObjectIds = new HashSet(); } - - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs index 2faf89f7ad..b1973d331d 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs @@ -65,7 +65,8 @@ public async Task Receive(string modelCardId) modelCard.ModelName.NotNull(), modelCard.SelectedVersionId.NotNull(), cts.Token, - onOperationProgressed: (status, progress) => OnSendOperationProgress(modelCardId, status, progress) + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts) ) .ConfigureAwait(false); @@ -83,9 +84,4 @@ public async Task Receive(string modelCardId) Application.DocumentManager.DocumentActivationEnabled = true; } } - - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } } diff --git a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs index 32cc40fbe7..820fb90097 100644 --- a/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs +++ b/DUI3-DX/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs @@ -167,7 +167,8 @@ private async Task SendInternal(string modelCardId) .Execute( autocadObjects, sendInfo, - (status, progress) => OnSendOperationProgress(modelCardId, status, progress), + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); @@ -191,10 +192,5 @@ private async Task SendInternal(string modelCardId) } } - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } - public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId); } diff --git a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs index 99e6492b79..ee437aeea2 100644 --- a/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs +++ b/DUI3-DX/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs @@ -112,7 +112,8 @@ public async Task Send(string modelCardId) .Execute( revitObjects, sendInfo, - (status, progress) => OnSendOperationProgress(modelCardId, status, progress), + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); @@ -130,11 +131,6 @@ public async Task Send(string modelCardId) } } - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } - /// /// Keeps track of the changed element ids as well as checks if any of them need to trigger /// a filter refresh (e.g., views being added). diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs index 951ff40f6f..6c78f254df 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoReceiveBinding.cs @@ -60,7 +60,8 @@ public async Task Receive(string modelCardId) modelCard.ModelName.NotNull(), modelCard.SelectedVersionId.NotNull(), cts.Token, - (status, progress) => OnSendOperationProgress(modelCardId, status, progress) + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts) ) .ConfigureAwait(false); @@ -79,10 +80,5 @@ public async Task Receive(string modelCardId) } } - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } - public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId); } diff --git a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs index 7e4e6be8a3..9005692407 100644 --- a/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs +++ b/DUI3-DX/Connectors/Rhino/Speckle.Connectors.Rhino7/Bindings/RhinoSendBinding.cs @@ -174,7 +174,8 @@ public async Task Send(string modelCardId) .Execute( rhinoObjects, sendInfo, - (status, progress) => OnSendOperationProgress(modelCardId, status, progress), + (status, progress) => + Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress), cts), cts.Token ) .ConfigureAwait(false); @@ -193,11 +194,6 @@ public async Task Send(string modelCardId) } } - private void OnSendOperationProgress(string modelCardId, string status, double? progress) - { - Commands.SetModelProgress(modelCardId, new ModelCardProgress(modelCardId, status, progress)); - } - public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId); /// diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs index 7b38ee9fbd..c88da91a81 100644 --- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs +++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs @@ -75,8 +75,16 @@ public void SetGlobalNotification(ToastNotificationType type, string title, stri } ); - public void SetModelProgress(string modelCardId, ModelCardProgress progress) => - Bridge.Send(SET_MODEL_PROGRESS_UI_COMMAND_NAME, new { modelCardId, progress }); + public void SetModelProgress(string modelCardId, ModelCardProgress progress, CancellationTokenSource cts) + { + // NOTE: To prevent potential race condition + // After cancelling operation some parts could still send last progress update which was set progress on UI + // after it forced to be undefined. This is the safest way to prevent any case like this. + if (!cts.IsCancellationRequested) + { + Bridge.Send(SET_MODEL_PROGRESS_UI_COMMAND_NAME, new { modelCardId, progress }); + } + } public void SetModelError(string modelCardId, Exception error) => Bridge.Send(SET_MODEL_ERROR_UI_COMMAND_NAME, new { modelCardId, error = error.Message });