diff --git a/.editorconfig b/.editorconfig index 36ae31f9a..a133ead38 100644 --- a/.editorconfig +++ b/.editorconfig @@ -239,6 +239,9 @@ dotnet_diagnostic.ide0290.severity = suggestion # primary constructors: subjecti dotnet_diagnostic.ide0290.severity = suggestion # Use primary constructor: Subjective dotnet_diagnostic.ide0037.severity = suggestion # Use inferred member names: Sometimes its nice to be explicit dotnet_diagnostic.ide0301.severity = suggestion # Use collection expression for empty: Subjective, intent +dotnet_diagnostic.ide0021.severity = suggestion # Use expression body for constructors : Subjective +dotnet_diagnostic.ide0090.severity = suggestion # Simplify new expression : Subjective + dotnet_diagnostic.ide0047.severity = suggestion # Parentheses preferences: IDEs don't properly pick it up # Maintainability rules diff --git a/Build/Program.cs b/Build/Program.cs index 40649c5bc..dba17b3a1 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -16,6 +16,7 @@ const string BUILD_SERVER_VERSION = "build-server-version"; const string CLEAN_LOCKS = "clean-locks"; const string CHECK_SOLUTIONS = "check-solutions"; +const string DEEP_CLEAN = "deep-clean"; //need to pass arguments /*var arguments = new List(); @@ -40,6 +41,33 @@ } ); +Target( + DEEP_CLEAN, + () => + { + foreach (var f in Glob.Directories(".", "**/bin")) + { + if (f.StartsWith("Build")) + { + continue; + } + Console.WriteLine("Found and will delete: " + f); + Directory.Delete(f, true); + } + foreach (var f in Glob.Directories(".", "**/obj")) + { + if (f.StartsWith("Build")) + { + continue; + } + Console.WriteLine("Found and will delete: " + f); + Directory.Delete(f, true); + } + Console.WriteLine("Running restore now."); + Run("dotnet", "restore .\\Speckle.Connectors.sln --no-cache"); + } +); + Target( CLEAN, ForEach("**/output"), diff --git a/Build/Solutions.cs b/Build/Solutions.cs index 7e0f372ef..dfdad4d08 100644 --- a/Build/Solutions.cs +++ b/Build/Solutions.cs @@ -45,7 +45,6 @@ void CheckAndRemoveKnown(string projectName) CheckAndRemoveKnown("Speckle.Objects"); CheckAndRemoveKnown("Speckle.Sdk"); - CheckAndRemoveKnown("Speckle.Sdk.Logging"); if (localProjects.Count != 0) { throw new InvalidOperationException( diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs index 5456bbd05..f31984bc3 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISReceiveBinding.cs @@ -1,12 +1,17 @@ +using ArcGIS.Desktop.Core; +using ArcGIS.Desktop.Mapping; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Logging; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.ArcGIS3; +using Speckle.Converters.ArcGIS3.Utils; +using Speckle.Converters.Common; using Speckle.Sdk; namespace Speckle.Connectors.ArcGIS.Bindings; @@ -16,29 +21,32 @@ public sealed class ArcGISReceiveBinding : IReceiveBinding public string Name { get; } = "receiveBinding"; private readonly CancellationManager _cancellationManager; private readonly DocumentModelStore _store; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; + private readonly IArcGISConversionSettingsFactory _arcGISConversionSettingsFactory; private ReceiveBindingUICommands Commands { get; } - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } public ArcGISReceiveBinding( DocumentModelStore store, - IBridge parent, + IBrowserBridge parent, CancellationManager cancellationManager, - IUnitOfWorkFactory unitOfWorkFactory, + IServiceProvider serviceProvider, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + IArcGISConversionSettingsFactory arcGisConversionSettingsFactory ) { _store = store; _cancellationManager = cancellationManager; Parent = parent; Commands = new ReceiveBindingUICommands(parent); - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _operationProgressManager = operationProgressManager; _logger = logger; + _arcGISConversionSettingsFactory = arcGisConversionSettingsFactory; } public async Task Receive(string modelCardId) @@ -53,12 +61,20 @@ public async Task Receive(string modelCardId) } CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); - - using IUnitOfWork unitOfWork = _unitOfWorkFactory.Resolve(); - + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize( + _arcGISConversionSettingsFactory.Create( + Project.Current, + MapView.Active.Map, + new CRSoffsetRotation(MapView.Active.Map) + ) + ); // Receive host objects - var receiveOperationResults = await unitOfWork - .Service.Execute( + var receiveOperationResults = await scope + .ServiceProvider.GetRequiredService() + .Execute( modelCard.GetReceiveInfo("ArcGIS"), // POC: get host app name from settings? same for GetSendInfo cancellationToken, (status, progress) => diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs index 4376d697a..44cb30e72 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSelectionBinding.cs @@ -8,9 +8,9 @@ namespace Speckle.Connectors.ArcGIS.Bindings; public class ArcGISSelectionBinding : ISelectionBinding { public string Name => "selectionBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } - public ArcGISSelectionBinding(IBridge parent) + public ArcGISSelectionBinding(IBrowserBridge parent) { Parent = parent; var topLevelHandler = parent.TopLevelExceptionHandler; diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs index 444f65715..1f70d7f65 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/ArcGISSendBinding.cs @@ -1,14 +1,17 @@ using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; using ArcGIS.Core.Data; +using ArcGIS.Desktop.Core; using ArcGIS.Desktop.Editing.Events; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; using ArcGIS.Desktop.Mapping.Events; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; using Speckle.Connectors.ArcGIS.Filters; -using Speckle.Connectors.ArcGIS.Utils; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Exceptions; @@ -17,9 +20,9 @@ using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Settings; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.ArcGIS3; +using Speckle.Converters.ArcGIS3.Utils; +using Speckle.Converters.Common; using Speckle.Sdk; using Speckle.Sdk.Common; @@ -29,17 +32,17 @@ public sealed class ArcGISSendBinding : ISendBinding { public string Name => "sendBinding"; public SendBindingUICommands Commands { get; } - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly DocumentModelStore _store; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; // POC: unused? :D + private readonly IServiceProvider _serviceProvider; private readonly List _sendFilters; private readonly CancellationManager _cancellationManager; private readonly ISendConversionCache _sendConversionCache; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; private readonly ITopLevelExceptionHandler _topLevelExceptionHandler; - private readonly MapMembersUtils _mapMemberUtils; + private readonly IArcGISConversionSettingsFactory _arcGISConversionSettingsFactory; /// /// Used internally to aggregate the changed objects' id. Note we're using a concurrent dictionary here as the expiry check method is not thread safe, and this was causing problems. See: @@ -54,25 +57,25 @@ public sealed class ArcGISSendBinding : ISendBinding public ArcGISSendBinding( DocumentModelStore store, - IBridge parent, + IBrowserBridge parent, IEnumerable sendFilters, - IUnitOfWorkFactory unitOfWorkFactory, + IServiceProvider serviceProvider, CancellationManager cancellationManager, ISendConversionCache sendConversionCache, IOperationProgressManager operationProgressManager, ILogger logger, - MapMembersUtils mapMemberUtils + IArcGISConversionSettingsFactory arcGisConversionSettingsFactory ) { _store = store; - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _sendFilters = sendFilters.ToList(); _cancellationManager = cancellationManager; _sendConversionCache = sendConversionCache; _operationProgressManager = operationProgressManager; _logger = logger; _topLevelExceptionHandler = parent.TopLevelExceptionHandler; - _mapMemberUtils = mapMemberUtils; + _arcGISConversionSettingsFactory = arcGisConversionSettingsFactory; Parent = parent; Commands = new SendBindingUICommands(parent); @@ -357,7 +360,7 @@ private void GetIdsForMapMemberPropertiesChangedEvent(MapMemberPropertiesChanged public async Task Send(string modelCardId) { //poc: dupe code between connectors - using var unitOfWork = _unitOfWorkFactory.Resolve>(); + try { if (_store.GetModelById(modelCardId) is not SenderModelCard modelCard) @@ -371,6 +374,16 @@ public async Task Send(string modelCardId) var sendResult = await QueuedTask .Run(async () => { + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize( + _arcGISConversionSettingsFactory.Create( + Project.Current, + MapView.Active.Map, + new CRSoffsetRotation(MapView.Active.Map) + ) + ); List mapMembers = modelCard .SendFilter.NotNull() .GetObjectIds() @@ -399,8 +412,9 @@ public async Task Send(string modelCardId) } } - var result = await unitOfWork - .Service.Execute( + var result = await scope + .ServiceProvider.GetRequiredService>() + .Execute( mapMembers, modelCard.GetSendInfo("ArcGIS"), // POC: get host app name from settings? same for GetReceiveInfo (status, progress) => diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs index c2ccada09..86e4b1d7c 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Bindings/BasicConnectorBinding.cs @@ -6,7 +6,7 @@ using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; -using Speckle.Connectors.Utils.Common; +using Speckle.Sdk; using Speckle.Sdk.Common; using ArcProject = ArcGIS.Desktop.Core.Project; @@ -16,14 +16,16 @@ namespace Speckle.Connectors.ArcGIS.Bindings; public class BasicConnectorBinding : IBasicConnectorBinding { public string Name => "baseBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } public BasicConnectorBindingCommands Commands { get; } private readonly DocumentModelStore _store; + private readonly ISpeckleApplication _speckleApplication; - public BasicConnectorBinding(DocumentModelStore store, IBridge parent) + public BasicConnectorBinding(DocumentModelStore store, IBrowserBridge parent, ISpeckleApplication speckleApplication) { _store = store; + _speckleApplication = speckleApplication; Parent = parent; Commands = new BasicConnectorBindingCommands(parent); @@ -33,11 +35,11 @@ public BasicConnectorBinding(DocumentModelStore store, IBridge parent) }; } - public string GetSourceApplicationName() => Speckle.Connectors.Utils.Connector.Slug; + public string GetSourceApplicationName() => _speckleApplication.Slug; - public string GetSourceApplicationVersion() => Speckle.Connectors.Utils.Connector.VersionString; + public string GetSourceApplicationVersion() => _speckleApplication.HostApplicationVersion; - public string GetConnectorVersion() => typeof(BasicConnectorBinding).Assembly.GetVersion(); + public string GetConnectorVersion() => _speckleApplication.SpeckleVersion; public DocumentInfo? GetDocumentInfo() { diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/DependencyInjection/ArcGISConnectorModule.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/DependencyInjection/ArcGISConnectorModule.cs index 3ef5f418e..c9d61bbe0 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/DependencyInjection/ArcGISConnectorModule.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/DependencyInjection/ArcGISConnectorModule.cs @@ -1,24 +1,21 @@ using ArcGIS.Desktop.Mapping; -using Autofac; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.ArcGIS.Bindings; using Speckle.Connectors.ArcGIS.Filters; using Speckle.Connectors.ArcGIS.HostApp; using Speckle.Connectors.ArcGIS.Operations.Receive; using Speckle.Connectors.ArcGis.Operations.Send; using Speckle.Connectors.ArcGIS.Utils; +using Speckle.Connectors.Common; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; -using Speckle.Connectors.DUI.Bridge; 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.Converters.Common; using Speckle.Sdk.Models.GraphTraversal; // POC: This is a temp reference to root object senders to tweak CI failing after having generic interfaces into common project. @@ -26,58 +23,47 @@ namespace Speckle.Connectors.ArcGIS.DependencyInjection; -public class ArcGISConnectorModule : ISpeckleModule +public static class ArcGISConnectorModule { - public void Load(SpeckleContainerBuilder builder) + public static void AddArcGIS(this IServiceCollection serviceCollection) { - builder.AddAutofac(); - builder.AddConnectorUtils(); - builder.AddDUI(); - builder.AddDUIView(); + serviceCollection.AddConnectorUtils(); + serviceCollection.AddDUI(); + serviceCollection.AddDUIView(); - // POC: Overwriting the SyncToMainThread to SyncToCurrentThread for ArcGIS only! - // On SendOperation, once we called QueuedTask, it expect to run everything on same thread. - // builder.AddSingletonInstance(); - - builder.AddSingleton(); + serviceCollection.AddSingleton(); // Register bindings - builder.AddSingleton(); - builder.AddSingleton("connectorName", "ArcGIS"); // POC: Easier like this for now, should be cleaned up later - builder.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); - builder.ContainerBuilder.RegisterType().As().AsSelf().SingleInstance(); - builder.AddSingleton(c => - c.Resolve().Parent.TopLevelExceptionHandler - ); + serviceCollection.RegisterTopLevelExceptionHandler(); - builder - .ContainerBuilder.RegisterType() - .As() - .As() - .SingleInstance(); + serviceCollection.AddSingleton(sp => sp.GetRequiredService()); + serviceCollection.AddSingleton(); - builder.AddSingleton(); - builder.AddSingleton(); - builder.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); - builder.AddTransient(); - builder.AddScoped(); - builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); + serviceCollection.AddTransient(); + serviceCollection.AddScoped(); + serviceCollection.AddSingleton(DefaultTraversal.CreateTraversalFunc()); // register send operation and dependencies - builder.AddScoped>(); - builder.AddScoped(); - builder.AddScoped, ArcGISRootObjectBuilder>(); + serviceCollection.AddScoped>(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped, ArcGISRootObjectBuilder>(); - builder.AddScoped(); - builder.AddScoped(); + serviceCollection.AddScoped(); - builder.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); // register send conversion cache - builder.AddSingleton(); + serviceCollection.AddSingleton(); // operation progress manager - builder.AddSingleton(); + serviceCollection.AddSingleton(); } } diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets index 7de833c38..7f7e5427e 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Esri.ArcGISPro.Extensions30.Speckle.targets @@ -204,8 +204,8 @@ - - + + diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/HostApp/SyncToQueuedTask.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/HostApp/SyncToQueuedTask.cs index 58aa7875c..946676ee1 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/HostApp/SyncToQueuedTask.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/HostApp/SyncToQueuedTask.cs @@ -1,5 +1,5 @@ using ArcGIS.Desktop.Framework.Threading.Tasks; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Operations; namespace Speckle.Connectors.ArcGIS.HostApp; diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Receive/HostObjectBuilder.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Receive/ArcGISHostObjectBuilder.cs similarity index 92% rename from Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Receive/HostObjectBuilder.cs rename to Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Receive/ArcGISHostObjectBuilder.cs index 6b53f122c..dcd97e4d7 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Receive/HostObjectBuilder.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Receive/ArcGISHostObjectBuilder.cs @@ -5,9 +5,10 @@ using ArcGIS.Desktop.Mapping; using Speckle.Connectors.ArcGIS.HostApp; using Speckle.Connectors.ArcGIS.Utils; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Instances; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Instances; +using Speckle.Connectors.Common.Operations; using Speckle.Converters.ArcGIS3; using Speckle.Converters.ArcGIS3.Utils; using Speckle.Converters.Common; @@ -28,27 +29,27 @@ public class ArcGISHostObjectBuilder : IHostObjectBuilder private readonly IRootToHostConverter _converter; private readonly IFeatureClassUtils _featureClassUtils; private readonly ILocalToGlobalUnpacker _localToGlobalUnpacker; - private readonly ILocalToGlobalConverterUtils _localToGlobalConverterUtils; + private readonly LocalToGlobalConverterUtils _localToGlobalConverterUtils; private readonly ICrsUtils _crsUtils; // POC: figure out the correct scope to only initialize on Receive - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly GraphTraversal _traverseFunction; private readonly ArcGISColorManager _colorManager; public ArcGISHostObjectBuilder( IRootToHostConverter converter, - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, IFeatureClassUtils featureClassUtils, ILocalToGlobalUnpacker localToGlobalUnpacker, - ILocalToGlobalConverterUtils localToGlobalConverterUtils, + LocalToGlobalConverterUtils localToGlobalConverterUtils, ICrsUtils crsUtils, GraphTraversal traverseFunction, ArcGISColorManager colorManager ) { _converter = converter; - _contextStack = contextStack; + _settingsStore = settingsStore; _featureClassUtils = featureClassUtils; _localToGlobalUnpacker = localToGlobalUnpacker; _localToGlobalConverterUtils = localToGlobalConverterUtils; @@ -72,7 +73,7 @@ CancellationToken cancellationToken onOperationProgressed?.Invoke("Converting", null); // get materials - List? materials = (rootObject["renderMaterialProxies"] as List) + List? materials = (rootObject[ProxyKeys.RENDER_MATERIAL] as List) ?.Cast() .ToList(); if (materials != null) @@ -81,7 +82,7 @@ CancellationToken cancellationToken } // get colors - List? colors = (rootObject["colorProxies"] as List)?.Cast().ToList(); + List? colors = (rootObject[ProxyKeys.COLOR] as List)?.Cast().ToList(); if (colors != null) { _colorManager.ParseColors(colors, onOperationProgressed); @@ -239,12 +240,12 @@ private List GetObjectsToConvert(Base rootObject) // get CRS from any present VectorLayer Base? vLayer = objectsToConvertTc.FirstOrDefault(x => x.Current is VectorLayer)?.Current; - _crsUtils.FindSetCrsDataOnReceive(vLayer); + using var crs = _crsUtils.FindSetCrsDataOnReceive(vLayer); // TODO help // now filter the objects objectsToConvertTc = objectsToConvertTc.Where(ctx => ctx.Current is not Collection).ToList(); - var instanceDefinitionProxies = (rootObject["instanceDefinitionProxies"] as List) + var instanceDefinitionProxies = (rootObject[ProxyKeys.INSTANCE_DEFINITION] as List) ?.Cast() .ToList(); @@ -305,8 +306,7 @@ string modelName { // get layer details string? datasetId = trackerItem.DatasetId; // should not be null here - Uri uri = - new($"{_contextStack.Current.Document.SpeckleDatabasePath.AbsolutePath.Replace('/', '\\')}\\{datasetId}"); + Uri uri = new($"{_settingsStore.Current.SpeckleDatabasePath.AbsolutePath.Replace('/', '\\')}\\{datasetId}"); string nestedLayerName = trackerItem.NestedLayerName; // add group for the current layer @@ -316,7 +316,7 @@ string modelName // if no general group layer found if (createdLayerGroups.Count == 0) { - Map map = _contextStack.Current.Document.Map; + Map map = _settingsStore.Current.Map; GroupLayer mainGroupLayer = LayerFactory.Instance.CreateGroupLayer(map, 0, $"{projectName}: {modelName}"); mainGroupLayer.SetExpanded(true); createdLayerGroups["Basic Speckle Group"] = mainGroupLayer; // key doesn't really matter here @@ -339,9 +339,9 @@ string modelName // if Scene // https://community.esri.com/t5/arcgis-pro-sdk-questions/sdk-equivalent-to-changing-layer-s-elevation/td-p/1346139 - if (_contextStack.Current.Document.Map.IsScene) + if (_settingsStore.Current.Map.IsScene) { - var groundSurfaceLayer = _contextStack.Current.Document.Map.GetGroundElevationSurfaceLayer(); + var groundSurfaceLayer = _settingsStore.Current.Map.GetGroundElevationSurfaceLayer(); var layerElevationSurface = new CIMLayerElevationSurface { ElevationSurfaceLayerURI = groundSurfaceLayer.URI, diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Send/ArcGISRootObjectBuilder.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Send/ArcGISRootObjectBuilder.cs index ad7876021..604e3e5f3 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Send/ArcGISRootObjectBuilder.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Operations/Send/ArcGISRootObjectBuilder.cs @@ -1,19 +1,19 @@ using System.Diagnostics; -using ArcGIS.Core.Geometry; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; using Microsoft.Extensions.Logging; using Speckle.Connectors.ArcGIS.HostApp; using Speckle.Connectors.ArcGIS.Utils; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Extensions; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Extensions; +using Speckle.Connectors.Common.Operations; using Speckle.Converters.ArcGIS3; using Speckle.Converters.Common; using Speckle.Objects.GIS; using Speckle.Sdk; +using Speckle.Sdk.Logging; using Speckle.Sdk.Models; using Speckle.Sdk.Models.Collections; using Speckle.Sdk.Models.Proxies; @@ -28,28 +28,33 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder private readonly IRootToSpeckleConverter _rootToSpeckleConverter; private readonly ISendConversionCache _sendConversionCache; private readonly ArcGISColorManager _colorManager; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly MapMembersUtils _mapMemberUtils; private readonly ILogger _logger; + private readonly ISdkActivityFactory _activityFactory; public ArcGISRootObjectBuilder( ISendConversionCache sendConversionCache, ArcGISColorManager colorManager, - IConversionContextStack contextStack, + IConverterSettingsStore converterSettings, IRootToSpeckleConverter rootToSpeckleConverter, MapMembersUtils mapMemberUtils, - ILogger logger + ILogger logger, + ISdkActivityFactory activityFactory ) { _sendConversionCache = sendConversionCache; _colorManager = colorManager; - _contextStack = contextStack; + _converterSettings = converterSettings; _rootToSpeckleConverter = rootToSpeckleConverter; _mapMemberUtils = mapMemberUtils; _logger = logger; + _activityFactory = activityFactory; } +#pragma warning disable CA1506 public async Task Build( +#pragma warning restore CA1506 IReadOnlyList objects, SendInfo sendInfo, Action? onOperationProgressed = null, @@ -62,6 +67,7 @@ public async Task Build( int count = 0; Collection rootObjectCollection = new() { name = MapView.Active.Map.Name }; //TODO: Collections + rootObjectCollection["units"] = _converterSettings.Current.SpeckleUnits; List results = new(objects.Count); var cacheHitCount = 0; @@ -74,99 +80,111 @@ public async Task Build( ); onOperationProgressed?.Invoke("Converting", null); - - foreach ((MapMember mapMember, _) in layersWithDisplayPriority) + using (var __ = _activityFactory.Start("Converting objects")) { - ct.ThrowIfCancellationRequested(); - var collectionHost = rootObjectCollection; - string applicationId = mapMember.URI; - string sourceType = mapMember.GetType().Name; - - Base converted; - try + foreach ((MapMember mapMember, _) in layersWithDisplayPriority) { - int groupCount = nestedGroups.Count; // bake here, because count will change in the loop - // if the layer is not a part of the group, reset groups - for (int i = 0; i < groupCount; i++) - { - if (nestedGroups.Count > 0 && !nestedGroups[0].Item1.Layers.Select(x => x.URI).Contains(applicationId)) - { - nestedGroups.RemoveAt(0); - } - else - { - // break at the first group, which contains current layer - break; - } - } + ct.ThrowIfCancellationRequested(); - // don't use cache for group layers - if ( - mapMember is not GroupLayer - && _sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value) - ) - { - converted = value; - cacheHitCount++; - } - else + using (var convertingActivity = _activityFactory.Start("Converting object")) { - if (mapMember is GroupLayer group) + var collectionHost = rootObjectCollection; + string applicationId = mapMember.URI; + string sourceType = mapMember.GetType().Name; + + Base converted; + try { - // group layer will always come before it's contained layers - // keep active group last in the list - converted = new Collection(); - nestedGroups.Insert(0, (group, (Collection)converted)); + int groupCount = nestedGroups.Count; // bake here, because count will change in the loop + // if the layer is not a part of the group, reset groups + for (int i = 0; i < groupCount; i++) + { + if (nestedGroups.Count > 0 && !nestedGroups[0].Item1.Layers.Select(x => x.URI).Contains(applicationId)) + { + nestedGroups.RemoveAt(0); + } + else + { + // break at the first group, which contains current layer + break; + } + } + + // don't use cache for group layers + if ( + mapMember is not GroupLayer + && _sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value) + ) + { + converted = value; + cacheHitCount++; + } + else + { + if (mapMember is GroupLayer group) + { + // group layer will always come before it's contained layers + // keep active group last in the list + converted = new Collection(); + nestedGroups.Insert(0, (group, (Collection)converted)); + } + else + { + converted = await QueuedTask + .Run(() => (Collection)_rootToSpeckleConverter.Convert(mapMember)) + .ConfigureAwait(false); + + // get units & Active CRS (for writing geometry coords) + converted["units"] = _converterSettings.Current.SpeckleUnits; + + var spatialRef = _converterSettings.Current.ActiveCRSoffsetRotation.SpatialReference; + converted["crs"] = new CRS + { + wkt = spatialRef.Wkt, + name = spatialRef.Name, + offset_y = Convert.ToSingle(_converterSettings.Current.ActiveCRSoffsetRotation.LatOffset), + offset_x = Convert.ToSingle(_converterSettings.Current.ActiveCRSoffsetRotation.LonOffset), + rotation = Convert.ToSingle(_converterSettings.Current.ActiveCRSoffsetRotation.TrueNorthRadians), + units_native = _converterSettings.Current.SpeckleUnits + }; + } + + // other common properties for layers and groups + converted["name"] = mapMember.Name; + converted.applicationId = applicationId; + } + + if ( + nestedGroups.Count == 0 + || nestedGroups.Count == 1 && nestedGroups[0].Item2.applicationId == applicationId + ) + { + // add to host if no groups, or current root group + collectionHost.elements.Add(converted); + } + else + { + // if we are adding a layer inside the group + var parentCollection = nestedGroups.FirstOrDefault(x => + x.Item1.Layers.Select(y => y.URI).Contains(applicationId) + ); + parentCollection.Item2.elements.Add(converted); + } + + results.Add(new(Status.SUCCESS, applicationId, sourceType, converted)); + convertingActivity?.SetStatus(SdkActivityStatusCode.Ok); } - else + catch (Exception ex) when (!ex.IsFatal()) { - converted = await QueuedTask - .Run(() => (Collection)_rootToSpeckleConverter.Convert(mapMember)) - .ConfigureAwait(false); - - // get units & Active CRS (for writing geometry coords) - converted["units"] = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpeckleUnitString; - - var spatialRef = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference; - converted["crs"] = new CRS - { - wkt = spatialRef.Wkt, - name = spatialRef.Name, - offset_y = Convert.ToSingle(_contextStack.Current.Document.ActiveCRSoffsetRotation.LatOffset), - offset_x = Convert.ToSingle(_contextStack.Current.Document.ActiveCRSoffsetRotation.LonOffset), - rotation = Convert.ToSingle(_contextStack.Current.Document.ActiveCRSoffsetRotation.TrueNorthRadians), - units_native = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpeckleUnitString, - }; + _logger.LogSendConversionError(ex, sourceType); + results.Add(new(Status.ERROR, applicationId, sourceType, null, ex)); + convertingActivity?.SetStatus(SdkActivityStatusCode.Error); + convertingActivity?.RecordException(ex); } - - // other common properties for layers and groups - converted["name"] = mapMember.Name; - converted.applicationId = applicationId; - } - - if (nestedGroups.Count == 0 || nestedGroups.Count == 1 && nestedGroups[0].Item2.applicationId == applicationId) - { - // add to host if no groups, or current root group - collectionHost.elements.Add(converted); - } - else - { - // if we are adding a layer inside the group - var parentCollection = nestedGroups.FirstOrDefault(x => - x.Item1.Layers.Select(y => y.URI).Contains(applicationId) - ); - parentCollection.Item2.elements.Add(converted); } - results.Add(new(Status.SUCCESS, applicationId, sourceType, converted)); + onOperationProgressed?.Invoke("Converting", (double)++count / objects.Count); } - catch (Exception ex) when (!ex.IsFatal()) - { - _logger.LogSendConversionError(ex, sourceType); - results.Add(new(Status.ERROR, applicationId, sourceType, null, ex)); - } - - onOperationProgressed?.Invoke("Converting", (double)++count / objects.Count); } if (results.All(x => x.Status == Status.ERROR)) @@ -176,7 +194,7 @@ mapMember is not GroupLayer // POC: Add Color Proxies List colorProxies = _colorManager.UnpackColors(layersWithDisplayPriority); - rootObjectCollection["colorProxies"] = colorProxies; + rootObjectCollection[ProxyKeys.COLOR] = colorProxies; // POC: Log would be nice, or can be removed. Debug.WriteLine( diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj index 16518abdb..66bded104 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/Speckle.Connectors.ArcGIS3.csproj @@ -27,9 +27,9 @@ - + - + diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleDUI3Wrapper.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleDUI3Wrapper.cs index 2c120c765..b14e1ee2e 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleDUI3Wrapper.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleDUI3Wrapper.cs @@ -1,4 +1,5 @@ using System.Windows.Controls; +using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.DUI.WebView; namespace Speckle.Connectors.ArcGIS; @@ -12,6 +13,6 @@ public SpeckleDUI3Wrapper() private void Initialize() { - Content = SpeckleModule.Current.Container.Resolve(); + Content = SpeckleModule.Current.Container.GetRequiredService(); } } diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleModule.cs b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleModule.cs index f857ebd52..64370fdf2 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleModule.cs +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/SpeckleModule.cs @@ -1,10 +1,9 @@ -using System.IO; -using System.Reflection; using ArcGIS.Desktop.Framework; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; -using Speckle.Connectors.Utils; -using Speckle.Sdk.Common; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Connectors.ArcGIS.DependencyInjection; +using Speckle.Connectors.Common; +using Speckle.Connectors.DUI; +using Speckle.Converters.ArcGIS3; using Speckle.Sdk.Host; using Module = ArcGIS.Desktop.Framework.Contracts.Module; @@ -24,22 +23,19 @@ internal sealed class SpeckleModule : Module public static SpeckleModule Current => s_this ??= (SpeckleModule)FrameworkApplication.FindModule("ConnectorArcGIS_Module"); - public SpeckleContainer Container { get; } + public ServiceProvider Container { get; } public SpeckleModule() { AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.OnAssemblyResolve; - var builder = SpeckleContainerBuilder.CreateInstance(); + var services = new ServiceCollection(); // init DI - _disposableLogger = Connector.Initialize(HostApplications.ArcGIS, GetVersion()); - - Container = builder - .LoadAutofacModules( - Assembly.GetExecutingAssembly(), - [Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull()] - ) - .Build(); + _disposableLogger = services.Initialize(HostApplications.ArcGIS, GetVersion()); + services.AddArcGIS(); + services.AddArcGISConverters(); + Container = services.BuildServiceProvider(); + Container.UseDUI(); } private HostAppVersion GetVersion() @@ -60,6 +56,7 @@ protected override bool CanUnload() //TODO - add your business logic //return false to ~cancel~ Application close _disposableLogger?.Dispose(); + Container.Dispose(); return true; } } diff --git a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json index 07d216f8b..53c11bdb0 100644 --- a/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json +++ b/Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json @@ -10,9 +10,9 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -96,54 +96,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -178,11 +175,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -213,6 +205,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -223,24 +220,26 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -251,14 +250,8 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.arcgis3": { "type": "Project", @@ -267,44 +260,32 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.arcgis3.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Converters.ArcGIS3": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, - "Autofac": { - "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" - }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Web.WebView2": { @@ -315,29 +296,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2022/Speckle.Connectors.Autocad2022.csproj b/Connectors/Autocad/Speckle.Connectors.Autocad2022/Speckle.Connectors.Autocad2022.csproj index 41052f262..53fc11282 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2022/Speckle.Connectors.Autocad2022.csproj +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2022/Speckle.Connectors.Autocad2022.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2022/packages.lock.json b/Connectors/Autocad/Speckle.Connectors.Autocad2022/packages.lock.json index dcb96ab04..5db40f1a2 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2022/packages.lock.json +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2022/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -99,59 +91,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -187,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -224,22 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -253,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -266,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -301,24 +255,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -329,14 +280,8 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.autocad2022": { "type": "Project", @@ -345,55 +290,39 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.autocad2022.dependencyinjection": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )", - "Speckle.Converters.Autocad2022": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -403,29 +332,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj b/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj index 42432de14..4b52daee3 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2023/Speckle.Connectors.Autocad2023.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json b/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json index 3553dcc35..848ab1403 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2023/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -99,59 +91,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -187,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -224,22 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -253,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -266,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -301,24 +255,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -329,14 +280,8 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.autocad2023": { "type": "Project", @@ -345,55 +290,39 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.autocad2023.dependencyinjection": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )", - "Speckle.Converters.Autocad2023": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -403,29 +332,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2024/Speckle.Connectors.Autocad2024.csproj b/Connectors/Autocad/Speckle.Connectors.Autocad2024/Speckle.Connectors.Autocad2024.csproj index 4aab772af..6b2e10aea 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2024/Speckle.Connectors.Autocad2024.csproj +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2024/Speckle.Connectors.Autocad2024.csproj @@ -12,7 +12,7 @@ - + diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2024/packages.lock.json b/Connectors/Autocad/Speckle.Connectors.Autocad2024/packages.lock.json index 095cb6970..487e222a2 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2024/packages.lock.json +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2024/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -99,59 +91,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -187,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -224,22 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -253,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -266,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -301,24 +255,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -329,14 +280,8 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.autocad2024": { "type": "Project", @@ -346,55 +291,39 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.autocad2024.dependencyinjection": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )", - "Speckle.Converters.Autocad2024": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -404,29 +333,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2025/Speckle.Connectors.Autocad2025.csproj b/Connectors/Autocad/Speckle.Connectors.Autocad2025/Speckle.Connectors.Autocad2025.csproj index dfb209d6e..f07bc0537 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2025/Speckle.Connectors.Autocad2025.csproj +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2025/Speckle.Connectors.Autocad2025.csproj @@ -15,7 +15,7 @@ - + diff --git a/Connectors/Autocad/Speckle.Connectors.Autocad2025/packages.lock.json b/Connectors/Autocad/Speckle.Connectors.Autocad2025/packages.lock.json index e601a9187..5943d991f 100644 --- a/Connectors/Autocad/Speckle.Connectors.Autocad2025/packages.lock.json +++ b/Connectors/Autocad/Speckle.Connectors.Autocad2025/packages.lock.json @@ -90,54 +90,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -172,11 +169,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -207,6 +199,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -217,24 +214,26 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -245,14 +244,8 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.autocad2025": { "type": "Project", @@ -262,52 +255,39 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.autocad2025.dependencyinjection": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )", - "Speckle.Converters.Autocad2025": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, - "Autofac": { - "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" - }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -317,29 +297,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs index a4dab3f4b..0381cbac8 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadBasicConnectorBinding.cs @@ -1,10 +1,10 @@ using Autodesk.AutoCAD.DatabaseServices; +using Microsoft.Extensions.Logging; using Speckle.Connectors.Autocad.HostApp.Extensions; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; -using Speckle.Connectors.Utils.Common; using Speckle.Sdk; using Speckle.Sdk.Common; using Speckle.Sdk.Credentials; @@ -13,31 +13,44 @@ namespace Speckle.Connectors.Autocad.Bindings; public class AutocadBasicConnectorBinding : IBasicConnectorBinding { + private readonly IAccountManager _accountManager; public string Name { get; set; } = "baseBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly DocumentModelStore _store; + private readonly ISpeckleApplication _speckleApplication; + private readonly ILogger _logger; public BasicConnectorBindingCommands Commands { get; } - public AutocadBasicConnectorBinding(DocumentModelStore store, IBridge parent) + public AutocadBasicConnectorBinding( + DocumentModelStore store, + IBrowserBridge parent, + IAccountManager accountManager, + ISpeckleApplication speckleApplication, + ILogger logger + ) { _store = store; Parent = parent; + _accountManager = accountManager; + _speckleApplication = speckleApplication; Commands = new BasicConnectorBindingCommands(parent); _store.DocumentChanged += (_, _) => { Commands.NotifyDocumentChanged(); }; + + _logger = logger; } - public string GetConnectorVersion() => typeof(AutocadBasicConnectorBinding).Assembly.GetVersion(); + public string GetConnectorVersion() => _speckleApplication.SpeckleVersion; - public string GetSourceApplicationName() => Utils.Connector.Slug; + public string GetSourceApplicationName() => _speckleApplication.Slug; - public string GetSourceApplicationVersion() => Utils.Connector.VersionString; + public string GetSourceApplicationVersion() => _speckleApplication.HostApplicationVersion; - public Account[] GetAccounts() => AccountManager.GetAccounts().ToArray(); + public Account[] GetAccounts() => _accountManager.GetAccounts().ToArray(); public DocumentInfo? GetDocumentInfo() { @@ -82,8 +95,10 @@ public void HighlightModel(string modelCardId) var objectIds = Array.Empty(); var model = _store.GetModelById(modelCardId); + if (model == null) { + _logger.LogError("Model was null when highlighting received model"); return; } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs index e2449d792..27d6dd57b 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadReceiveBinding.cs @@ -1,12 +1,14 @@ +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Logging; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.Autocad; +using Speckle.Converters.Common; using Speckle.Sdk; namespace Speckle.Connectors.Autocad.Bindings; @@ -14,30 +16,36 @@ namespace Speckle.Connectors.Autocad.Bindings; public sealed class AutocadReceiveBinding : IReceiveBinding { public string Name => "receiveBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly DocumentModelStore _store; private readonly CancellationManager _cancellationManager; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; + private readonly IAutocadConversionSettingsFactory _autocadConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; private ReceiveBindingUICommands Commands { get; } public AutocadReceiveBinding( DocumentModelStore store, - IBridge parent, + IBrowserBridge parent, CancellationManager cancellationManager, - IUnitOfWorkFactory unitOfWorkFactory, + IServiceProvider serviceProvider, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + IAutocadConversionSettingsFactory autocadConversionSettingsFactory, + ISpeckleApplication speckleApplication ) { _store = store; _cancellationManager = cancellationManager; - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _operationProgressManager = operationProgressManager; _logger = logger; + _autocadConversionSettingsFactory = autocadConversionSettingsFactory; + _speckleApplication = speckleApplication; Parent = parent; Commands = new ReceiveBindingUICommands(parent); } @@ -46,7 +54,10 @@ ILogger logger public async Task Receive(string modelCardId) { - using var unitOfWork = _unitOfWorkFactory.Resolve(); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_autocadConversionSettingsFactory.Create(Application.DocumentManager.CurrentDocument)); try { // Get receiver card @@ -64,9 +75,10 @@ public async Task Receive(string modelCardId) Application.DocumentManager.DocumentActivationEnabled = false; // Receive host objects - var operationResults = await unitOfWork - .Service.Execute( - modelCard.GetReceiveInfo(Speckle.Connectors.Utils.Connector.Slug), + var operationResults = await scope + .ServiceProvider.GetRequiredService() + .Execute( + modelCard.GetReceiveInfo(_speckleApplication.Slug), cancellationToken, (status, progress) => _operationProgressManager.SetModelProgress( diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs index 310f98a4a..2e7d789c7 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSelectionBinding.cs @@ -14,9 +14,9 @@ public class AutocadSelectionBinding : ISelectionBinding public string Name => "selectionBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } - public AutocadSelectionBinding(IBridge parent) + public AutocadSelectionBinding(IBrowserBridge parent) { _topLevelExceptionHandler = parent.TopLevelExceptionHandler; Parent = parent; diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs index 895d83252..6856f58b6 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Bindings/AutocadSendBinding.cs @@ -1,10 +1,13 @@ using System.Collections.Concurrent; using Autodesk.AutoCAD.DatabaseServices; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; using Speckle.Connectors.Autocad.HostApp; using Speckle.Connectors.Autocad.HostApp.Extensions; using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Exceptions; @@ -13,9 +16,8 @@ using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Settings; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.Autocad; +using Speckle.Converters.Common; using Speckle.Sdk; using Speckle.Sdk.Common; @@ -26,17 +28,19 @@ public sealed class AutocadSendBinding : ISendBinding public string Name => "sendBinding"; public SendBindingUICommands Commands { get; } private OperationProgressManager OperationProgressManager { get; } - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly DocumentModelStore _store; private readonly IAutocadIdleManager _idleManager; private readonly List _sendFilters; private readonly CancellationManager _cancellationManager; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; private readonly ISendConversionCache _sendConversionCache; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; private readonly ITopLevelExceptionHandler _topLevelExceptionHandler; + private readonly IAutocadConversionSettingsFactory _autocadConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; /// /// Used internally to aggregate the changed objects' id. Note we're using a concurrent dictionary here as the expiry check method is not thread safe, and this was causing problems. See: @@ -49,23 +53,27 @@ public sealed class AutocadSendBinding : ISendBinding public AutocadSendBinding( DocumentModelStore store, IAutocadIdleManager idleManager, - IBridge parent, + IBrowserBridge parent, IEnumerable sendFilters, CancellationManager cancellationManager, - IUnitOfWorkFactory unitOfWorkFactory, + IServiceProvider serviceProvider, ISendConversionCache sendConversionCache, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + IAutocadConversionSettingsFactory autocadConversionSettingsFactory, + ISpeckleApplication speckleApplication ) { _store = store; _idleManager = idleManager; - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _cancellationManager = cancellationManager; _sendFilters = sendFilters.ToList(); _sendConversionCache = sendConversionCache; _operationProgressManager = operationProgressManager; _logger = logger; + _autocadConversionSettingsFactory = autocadConversionSettingsFactory; + _speckleApplication = speckleApplication; _topLevelExceptionHandler = parent.TopLevelExceptionHandler; Parent = parent; Commands = new SendBindingUICommands(parent); @@ -153,7 +161,10 @@ private async Task SendInternal(string modelCardId) throw new InvalidOperationException("No publish model card was found."); } - using var uow = _unitOfWorkFactory.Resolve>(); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_autocadConversionSettingsFactory.Create(Application.DocumentManager.CurrentDocument)); CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); @@ -173,10 +184,11 @@ private async Task SendInternal(string modelCardId) throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!"); } - var sendResult = await uow - .Service.Execute( + var sendResult = await scope + .ServiceProvider.GetRequiredService>() + .Execute( autocadObjects, - modelCard.GetSendInfo(Speckle.Connectors.Utils.Connector.Slug), + modelCard.GetSendInfo(_speckleApplication.Slug), (status, progress) => _operationProgressManager.SetModelProgress( Parent, diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs index 777a2ed66..1b5760727 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs @@ -1,21 +1,17 @@ #if AUTOCAD -using Speckle.Autofac.DependencyInjection; -using Speckle.Connectors.DUI.Bindings; +using Microsoft.Extensions.DependencyInjection; namespace Speckle.Connectors.Autocad.DependencyInjection; -public class AutocadConnectorModule : ISpeckleModule +public static class AutocadConnectorModule { - public void Load(SpeckleContainerBuilder builder) + public static void AddAutocad(this IServiceCollection serviceCollection) { - SharedRegistration.Load(builder); + serviceCollection.AddAutocadBase(); // Operations - SharedRegistration.LoadSend(builder); - SharedRegistration.LoadReceive(builder); - - // Register bindings - builder.AddSingleton("connectorName", "Autocad"); // POC: Easier like this for now, should be cleaned up later + serviceCollection.LoadSend(); + serviceCollection.LoadReceive(); } } #endif diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/Civil3dConnectorModule.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/Civil3dConnectorModule.cs index deb723ac3..3cfd3a5cb 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/Civil3dConnectorModule.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/Civil3dConnectorModule.cs @@ -1,19 +1,14 @@ #if CIVIL3D - -using Speckle.Autofac.DependencyInjection; -using Speckle.Connectors.DUI.Bindings; +using Microsoft.Extensions.DependencyInjection; namespace Speckle.Connectors.Autocad.DependencyInjection; -public class Civil3dConnectorModule : ISpeckleModule +public static class Civil3dConnectorModule { - public void Load(SpeckleContainerBuilder builder) + public static void AddCivil3d(this IServiceCollection serviceCollection) { - SharedRegistration.Load(builder); - SharedRegistration.LoadSend(builder); - - // Register bindings - builder.AddSingleton("connectorName", "Civil3d"); // POC: Easier like this for now, should be cleaned up later + serviceCollection.AddAutocadBase(); + serviceCollection.LoadSend(); } } #endif diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/SharedRegistration.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/SharedRegistration.cs index cd9b3c7bb..762810747 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/SharedRegistration.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/SharedRegistration.cs @@ -1,101 +1,101 @@ using Autodesk.AutoCAD.DatabaseServices; -using Autofac; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.Autocad.Bindings; using Speckle.Connectors.Autocad.Filters; using Speckle.Connectors.Autocad.HostApp; using Speckle.Connectors.Autocad.Operations.Receive; using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Connectors.Common; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Instances; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; -using Speckle.Connectors.DUI.Bridge; 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.Converters.Common; using Speckle.Sdk.Models.GraphTraversal; namespace Speckle.Connectors.Autocad.DependencyInjection; public static class SharedRegistration { - public static void Load(SpeckleContainerBuilder builder) + public static void AddAutocadBase(this IServiceCollection serviceCollection) { - builder.AddAutofac(); - builder.AddConnectorUtils(); - builder.AddDUI(); - builder.AddDUIView(); + serviceCollection.AddConnectorUtils(); + serviceCollection.AddDUI(); + serviceCollection.AddDUIView(); // Register other connector specific types - builder.AddTransient(); - builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext - builder.AddSingleton(); - builder.AddSingleton(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddSingleton(); - builder.AddSingleton>(); + serviceCollection.AddTransient(); + serviceCollection.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + + // Unpackers and builders + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddSingleton(); // operation progress manager - builder.AddSingleton(); + serviceCollection.AddSingleton(); // Register bindings - builder.AddSingleton(); - builder.AddSingleton(); - builder.AddSingleton(); - builder - .ContainerBuilder.RegisterType() - .As() - .As() - .SingleInstance(); - - //Top Level ExceptionHandler - builder.ContainerBuilder.RegisterType().As().AsSelf().SingleInstance(); - builder.AddSingleton(c => - c.Resolve().Parent.TopLevelExceptionHandler - ); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(sp => sp.GetRequiredService()); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + + serviceCollection.RegisterTopLevelExceptionHandler(); } - public static void LoadSend(SpeckleContainerBuilder builder) + public static void LoadSend(this IServiceCollection serviceCollection) { // Operations - builder.AddScoped>(); + serviceCollection.AddScoped>(); // Object Builders - builder.AddScoped, AutocadRootObjectBuilder>(); + serviceCollection.AddScoped, AutocadRootObjectBuilder>(); // Register bindings - builder.AddSingleton(); + serviceCollection.AddSingleton(); // register send filters - builder.AddTransient(); + serviceCollection.AddTransient(); // register send conversion cache - builder.AddSingleton(); - builder.AddScoped< + serviceCollection.AddSingleton(); + serviceCollection.AddScoped< IInstanceObjectsManager>, InstanceObjectsManager> >(); - builder.AddScoped(); } - public static void LoadReceive(SpeckleContainerBuilder builder) + public static void LoadReceive(this IServiceCollection serviceCollection) { // traversal - builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); + serviceCollection.AddSingleton(DefaultTraversal.CreateTraversalFunc()); // Object Builders - builder.AddScoped(); + serviceCollection.AddScoped(); // Register bindings - builder.AddSingleton(); + serviceCollection.AddSingleton(); } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorBaker.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorBaker.cs new file mode 100644 index 000000000..c85986493 --- /dev/null +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorBaker.cs @@ -0,0 +1,78 @@ +using Autodesk.AutoCAD.Colors; +using Microsoft.Extensions.Logging; +using Speckle.Sdk; +using Speckle.Sdk.Models.Proxies; +using AutocadColor = Autodesk.AutoCAD.Colors.Color; + +namespace Speckle.Connectors.Autocad.HostApp; + +/// +/// Expects to be a scoped dependency for a given operation and helps with layer creation and cleanup. +/// +public class AutocadColorBaker +{ + private readonly ILogger _logger; + + public AutocadColorBaker(ILogger logger) + { + _logger = logger; + } + + /// + /// For receive operations + /// + public Dictionary ObjectColorsIdMap { get; } = new(); + + /// + /// Parse Color Proxies and stores in ObjectColorIdMap the relationship between object ids and colors + /// + /// + /// + public void ParseColors(List colorProxies, Action? onOperationProgressed) + { + var count = 0; + foreach (ColorProxy colorProxy in colorProxies) + { + try + { + onOperationProgressed?.Invoke("Converting colors", (double)++count / colorProxies.Count); + + // skip any colors with source = layer, since object color default source is by layer + if (colorProxy["source"] is string source && source == "layer") + { + continue; + } + + foreach (string objectId in colorProxy.objects) + { + AutocadColor convertedColor = ConvertColorProxyToColor(colorProxy); +#if NET8_0 + ObjectColorsIdMap.TryAdd(objectId, convertedColor); +#else + if (!ObjectColorsIdMap.ContainsKey(objectId)) + { + ObjectColorsIdMap.Add(objectId, convertedColor); + } +#endif + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed parsing color proxy"); + } + } + } + + private AutocadColor ConvertColorProxyToColor(ColorProxy colorProxy) + { + // if source = block, return a default ByBlock color + if (colorProxy["source"] is string source && source == "block") + { + return AutocadColor.FromColorIndex(ColorMethod.ByBlock, 0); + } + + return colorProxy["autocadColorIndex"] is long index + ? AutocadColor.FromColorIndex(ColorMethod.ByAci, (short)index) + : AutocadColor.FromColor(System.Drawing.Color.FromArgb(colorProxy.value)); + } +} diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorManager.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorUnpacker.cs similarity index 66% rename from Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorManager.cs rename to Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorUnpacker.cs index ac212ac29..537042bfe 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorManager.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadColorUnpacker.cs @@ -1,7 +1,9 @@ using Autodesk.AutoCAD.Colors; using Autodesk.AutoCAD.DatabaseServices; +using Microsoft.Extensions.Logging; using Speckle.Connectors.Autocad.HostApp.Extensions; using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Sdk; using Speckle.Sdk.Models.Proxies; using AutocadColor = Autodesk.AutoCAD.Colors.Color; @@ -10,21 +12,61 @@ namespace Speckle.Connectors.Autocad.HostApp; /// /// Expects to be a scoped dependency for a given operation and helps with layer creation and cleanup. /// -public class AutocadColorManager +public class AutocadColorUnpacker { - // POC: Will be addressed to move it into AutocadContext! - private Document Doc => Application.DocumentManager.MdiActiveDocument; + private readonly ILogger _logger; - /// - /// For receive operations - /// - public Dictionary ObjectColorsIdMap { get; } = new(); + public AutocadColorUnpacker(ILogger logger) + { + _logger = logger; + } /// /// For send operations /// private Dictionary ColorProxies { get; } = new(); + /// + /// Iterates through a given set of autocad objects and layers to collect colors. + /// + /// atomic root objects, including instance objects + /// layers used by atomic objects + /// + public List UnpackColors( + List unpackedAutocadRootObjects, + List layers + ) + { + // Stage 1: unpack colors from objects + foreach (AutocadRootObject rootObj in unpackedAutocadRootObjects) + { + try + { + Entity entity = rootObj.Root; + ProcessObjectColor(rootObj.ApplicationId, entity.Color); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to unpack colors from Autocad Entity"); + } + } + + // Stage 2: make sure we collect layer colors as well + foreach (LayerTableRecord layer in layers) + { + try + { + ProcessObjectColor(layer.GetSpeckleApplicationId(), layer.Color); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to unpack colors from Autocad Layer"); + } + } + + return ColorProxies.Values.ToList(); + } + /// /// Processes an object's color and adds the object id to a color proxy in if object color is set ByAci, ByColor, or ByBlock. /// Skips processing ByPen for now, because I don't understand what this means. @@ -68,7 +110,14 @@ private ColorProxy ConvertColorToColorProxy(AutocadColor color) string name = color.ColorNameForDisplay; string id = color.GetSpeckleApplicationId(); - ColorProxy colorProxy = new(argb, id, name) { objects = new() }; + ColorProxy colorProxy = + new() + { + value = argb, + applicationId = id, + name = name, + objects = new() + }; // add the color source as well for receiving in other apps // POC: in order to support full fidelity color support across autocad and rhino, we need to keep track of the color source property. Not sure if this is the best place to keep track of the source, vs on a ColorSourceProxy or as a property on the atomic object. @@ -92,77 +141,4 @@ private ColorProxy ConvertColorToColorProxy(AutocadColor color) return colorProxy; } - - /// - /// Iterates through a given set of autocad objects and layers to collect colors. - /// - /// atomic root objects, including instance objects - /// layers used by atomic objects - /// - public List UnpackColors( - List unpackedAutocadRootObjects, - List layers - ) - { - // Stage 1: unpack colors from objects - foreach (AutocadRootObject rootObj in unpackedAutocadRootObjects) - { - Entity entity = rootObj.Root; - ProcessObjectColor(rootObj.ApplicationId, entity.Color); - } - - // Stage 2: make sure we collect layer colors as well - foreach (LayerTableRecord layer in layers) - { - ProcessObjectColor(layer.GetSpeckleApplicationId(), layer.Color); - } - - return ColorProxies.Values.ToList(); - } - - public AutocadColor ConvertColorProxyToColor(ColorProxy colorProxy) - { - // if source = block, return a default ByBlock color - if (colorProxy["source"] is string source && source == "block") - { - return AutocadColor.FromColorIndex(ColorMethod.ByBlock, 0); - } - - return colorProxy["autocadColorIndex"] is long index - ? AutocadColor.FromColorIndex(ColorMethod.ByAci, (short)index) - : AutocadColor.FromColor(System.Drawing.Color.FromArgb(colorProxy.value)); - } - - /// - /// Parse Color Proxies and stores in ObjectColorIdMap the relationship between object ids and colors - /// - /// - /// - public void ParseColors(List colorProxies, Action? onOperationProgressed) - { - var count = 0; - foreach (ColorProxy colorProxy in colorProxies) - { - onOperationProgressed?.Invoke("Converting colors", (double)++count / colorProxies.Count); - - // skip any colors with source = layer, since object color default source is by layer - if (colorProxy["source"] is string source && source == "layer") - { - continue; - } - - foreach (string objectId in colorProxy.objects) - { - AutocadColor convertedColor = ConvertColorProxyToColor(colorProxy); -#if NET8_0 - ObjectColorsIdMap.TryAdd(objectId, convertedColor); -#else - if (!ObjectColorsIdMap.ContainsKey(objectId)) - { - ObjectColorsIdMap.Add(objectId, convertedColor); - } -#endif - } - } - } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupManager.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupBaker.cs similarity index 52% rename from Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupManager.cs rename to Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupBaker.cs index 38937dda2..9a40b5040 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupManager.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupBaker.cs @@ -1,63 +1,25 @@ using Autodesk.AutoCAD.DatabaseServices; -using Speckle.Connectors.Autocad.HostApp.Extensions; -using Speckle.Connectors.Autocad.Operations.Send; -using Speckle.Connectors.Utils.Conversion; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Conversion; using Speckle.Sdk; using Speckle.Sdk.Models.Proxies; namespace Speckle.Connectors.Autocad.HostApp; /// -/// This resource expects to be injected "fresh" in each send/receive operation (scoped lifetime). Extracts group information from a set of objects into proxies in send operations; also creates groups from a set of proxies in receive operations. +/// This resource expects to be injected "fresh" in each receive operation (scoped lifetime). +/// Extracts group information from a set of objects into proxies in send operations; also creates groups from a set of proxies in receive operations. +/// TODO: Oguzhan! Check whats happening on second receive unless purge groups? naming etc.. /// -public class AutocadGroupManager +public class AutocadGroupBaker { + private readonly ILogger _logger; private readonly AutocadContext _autocadContext; - public AutocadGroupManager(AutocadContext autocadContext) + public AutocadGroupBaker(AutocadContext autocadContext, ILogger logger) { _autocadContext = autocadContext; - } - - /// - /// Unpacks a selection of atomic objects into their groups - /// - /// - /// - public List UnpackGroups(IEnumerable autocadObjects) - { - var groupProxies = new Dictionary(); - - using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); - - foreach (var (dbObject, applicationId) in autocadObjects) - { - var persistentReactorIds = dbObject.GetPersistentReactorIds(); - foreach (ObjectId oReactorId in persistentReactorIds) - { - var obj = transaction.GetObject(oReactorId, OpenMode.ForRead); - if (obj is not Group group) - { - continue; - } - var groupAppId = group.GetSpeckleApplicationId(); - if (groupProxies.TryGetValue(groupAppId, out GroupProxy? groupProxy)) - { - groupProxy.objects.Add(applicationId); - } - else - { - groupProxies[groupAppId] = new() - { - applicationId = groupAppId, - name = group.Name, - objects = [applicationId] - }; - } - } - } - - return groupProxies.Values.ToList(); + _logger = logger; } /// @@ -66,6 +28,7 @@ public List UnpackGroups(IEnumerable autocadObjec /// /// /// + // TODO: Oguzhan! Do not report here too! But this is TBD that we don't know the shape of the report yet. public List CreateGroups( IEnumerable groupProxies, Dictionary> applicationIdMap @@ -103,9 +66,10 @@ Dictionary> applicationIdMap groupCreationTransaction.AddNewlyCreatedDBObject(newGroup, true); } - catch (Exception e) when (!e.IsFatal()) + catch (Exception ex) when (!ex.IsFatal()) { - results.Add(new ReceiveConversionResult(Status.ERROR, gp, null, null, e)); + results.Add(new ReceiveConversionResult(Status.ERROR, gp, null, null, ex)); + _logger.LogError(ex, "Failed to bake Autocad Group"); } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupUnpacker.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupUnpacker.cs new file mode 100644 index 000000000..a39e23eb4 --- /dev/null +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadGroupUnpacker.cs @@ -0,0 +1,69 @@ +using Autodesk.AutoCAD.DatabaseServices; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Autocad.HostApp.Extensions; +using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Sdk; +using Speckle.Sdk.Models.Proxies; + +namespace Speckle.Connectors.Autocad.HostApp; + +/// +/// This resource expects to be injected "fresh" in each send/receive operation (scoped lifetime). Extracts group information from a set of objects into proxies in send operations; also creates groups from a set of proxies in receive operations. +/// +public class AutocadGroupUnpacker +{ + private readonly ILogger _logger; + + public AutocadGroupUnpacker(ILogger logger) + { + _logger = logger; + } + + /// + /// Unpacks a selection of atomic objects into their groups + /// + /// + /// + public List UnpackGroups(IEnumerable autocadObjects) + { + var groupProxies = new Dictionary(); + + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + + foreach (var (dbObject, applicationId) in autocadObjects) + { + try + { + var persistentReactorIds = dbObject.GetPersistentReactorIds(); + foreach (ObjectId oReactorId in persistentReactorIds) + { + var obj = transaction.GetObject(oReactorId, OpenMode.ForRead); + if (obj is not Group group) + { + continue; + } + var groupAppId = group.GetSpeckleApplicationId(); + if (groupProxies.TryGetValue(groupAppId, out GroupProxy? groupProxy)) + { + groupProxy.objects.Add(applicationId); + } + else + { + groupProxies[groupAppId] = new() + { + applicationId = groupAppId, + name = group.Name, + objects = [applicationId] + }; + } + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed on unpacking Autocad group"); + } + } + + return groupProxies.Values.ToList(); + } +} diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceBaker.cs similarity index 55% rename from Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs rename to Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceBaker.cs index f4d2dafa0..080535164 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceObjectManager.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceBaker.cs @@ -1,9 +1,10 @@ using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Geometry; +using Microsoft.Extensions.Logging; using Speckle.Connectors.Autocad.HostApp.Extensions; -using Speckle.Connectors.Autocad.Operations.Send; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Instances; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Instances; +using Speckle.Converters.Autocad; using Speckle.Converters.Common; using Speckle.DoubleNumerics; using Speckle.Sdk; @@ -16,151 +17,32 @@ namespace Speckle.Connectors.Autocad.HostApp; /// -/// Expects to be a scoped dependency per send or receive operation. -/// POC: Split later unpacker and baker. +/// Expects to be a scoped dependency receive operation. /// -public class AutocadInstanceObjectManager : IInstanceUnpacker, IInstanceBaker> +public class AutocadInstanceBaker : IInstanceBaker> { - private readonly AutocadLayerManager _autocadLayerManager; - private readonly AutocadColorManager _autocadColorManager; - private readonly AutocadMaterialManager _autocadMaterialManager; - private readonly IHostToSpeckleUnitConverter _unitsConverter; + private readonly AutocadLayerBaker _layerBaker; + private readonly AutocadColorBaker _colorBaker; + private readonly AutocadMaterialBaker _materialBaker; private readonly AutocadContext _autocadContext; + private readonly ILogger _logger; + private readonly IConverterSettingsStore _converterSettings; - private readonly IInstanceObjectsManager> _instanceObjectsManager; - - public AutocadInstanceObjectManager( - AutocadLayerManager autocadLayerManager, - AutocadColorManager autocadColorManager, - AutocadMaterialManager autocadMaterialManager, - IHostToSpeckleUnitConverter unitsConverter, + public AutocadInstanceBaker( + AutocadLayerBaker layerBaker, + AutocadColorBaker colorBaker, + AutocadMaterialBaker materialBaker, AutocadContext autocadContext, - IInstanceObjectsManager> instanceObjectsManager + ILogger logger, + IConverterSettingsStore converterSettings ) { - _autocadLayerManager = autocadLayerManager; - _autocadColorManager = autocadColorManager; - _autocadMaterialManager = autocadMaterialManager; - _unitsConverter = unitsConverter; + _layerBaker = layerBaker; + _colorBaker = colorBaker; + _materialBaker = materialBaker; _autocadContext = autocadContext; - _instanceObjectsManager = instanceObjectsManager; - } - - public UnpackResult UnpackSelection(IEnumerable objects) - { - using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); - - foreach (var obj in objects) - { - // Note: isDynamicBlock always returns false for a selection of doc objects. Instances of dynamic blocks are represented in the document as blocks that have - // a definition reference to the anonymous block table record. - if (obj.Root is BlockReference blockReference && !blockReference.IsDynamicBlock) - { - UnpackInstance(blockReference, 0, transaction); - } - _instanceObjectsManager.AddAtomicObject(obj.ApplicationId, obj); - } - return _instanceObjectsManager.GetUnpackResult(); - } - - private void UnpackInstance(BlockReference instance, int depth, Transaction transaction) - { - string instanceId = instance.GetSpeckleApplicationId(); - - // If this instance has a reference to an anonymous block, it means it's spawned from a dynamic block. Anonymous blocks are - // used to represent specific "instances" of dynamic ones. - // We do not want to send the full dynamic block definition, but its current "instance", as such here we're making sure we - // take up the anon block table reference definition (if it exists). If it's not an instance of a dynamic block, we're - // using the normal def reference. - ObjectId definitionId = !instance.AnonymousBlockTableRecord.IsNull - ? instance.AnonymousBlockTableRecord - : instance.BlockTableRecord; - - InstanceProxy instanceProxy = - new() - { - applicationId = instanceId, - definitionId = definitionId.ToString(), - maxDepth = depth, - transform = GetMatrix(instance.BlockTransform.ToArray()), - units = _unitsConverter.ConvertOrThrow(Application.DocumentManager.CurrentDocument.Database.Insunits) - }; - _instanceObjectsManager.AddInstanceProxy(instanceId, instanceProxy); - - // 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 ( - !_instanceObjectsManager.TryGetInstanceProxiesFromDefinitionId( - definitionId.ToString(), - out List instanceProxiesWithSameDefinition - ) - ) - { - instanceProxiesWithSameDefinition = new List(); - _instanceObjectsManager.AddInstanceProxiesByDefinitionId( - 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 instanceProxyWithSameDefinition in instanceProxiesWithSameDefinition) - { - if (instanceProxyWithSameDefinition.maxDepth < depth) - { - instanceProxyWithSameDefinition.maxDepth = depth; - } - } - - instanceProxiesWithSameDefinition.Add(_instanceObjectsManager.GetInstanceProxy(instanceId)); - - if ( - _instanceObjectsManager.TryGetInstanceDefinitionProxy(definitionId.ToString(), out InstanceDefinitionProxy value) - ) - { - int depthDifference = depth - value.maxDepth; - if (depthDifference > 0) - { - // all MaxDepth of children definitions and its instances should be increased with difference of depth - _instanceObjectsManager.UpdateChildrenMaxDepth(value, depthDifference); - } - return; - } - - var definition = (BlockTableRecord)transaction.GetObject(definitionId, OpenMode.ForRead); - var definitionProxy = new InstanceDefinitionProxy() - { - applicationId = definitionId.ToString(), - objects = new(), - maxDepth = depth, - name = !instance.AnonymousBlockTableRecord.IsNull ? "Dynamic instance " + definitionId : definition.Name, - ["comments"] = definition.Comments - }; - - // Go through each definition object - foreach (ObjectId id in definition) - { - Entity obj = (Entity)transaction.GetObject(id, OpenMode.ForRead); - - // In the case of dynamic blocks, this prevents sending objects that are not visibile in its current state. - if (!obj.Visible) - { - continue; - } - - string appId = obj.GetSpeckleApplicationId(); - definitionProxy.objects.Add(appId); - - if (obj is BlockReference blockReference) - { - UnpackInstance(blockReference, depth + 1, transaction); - } - - _instanceObjectsManager.AddAtomicObject(appId, new(obj, appId)); - } - - _instanceObjectsManager.AddDefinitionProxy(definitionId.ToString(), definitionProxy); + _logger = logger; + _converterSettings = converterSettings; } public BakeResult BakeInstances( @@ -238,20 +120,14 @@ instanceOrDefinition is InstanceProxy instanceProxy ); // POC: collectionPath for instances should be an array of size 1, because we are flattening collections on traversal - string layerName = _autocadLayerManager.CreateLayerForReceive(collectionPath, baseLayerName); + string layerName = _layerBaker.CreateLayerForReceive(collectionPath, baseLayerName); // get color and material if any string instanceId = instanceProxy.applicationId ?? instanceProxy.id; - AutocadColor? objColor = _autocadColorManager.ObjectColorsIdMap.TryGetValue( - instanceId, - out AutocadColor? color - ) + AutocadColor? objColor = _colorBaker.ObjectColorsIdMap.TryGetValue(instanceId, out AutocadColor? color) ? color : null; - ObjectId objMaterial = _autocadMaterialManager.ObjectMaterialsIdMap.TryGetValue( - instanceId, - out ObjectId matId - ) + ObjectId objMaterial = _materialBaker.ObjectMaterialsIdMap.TryGetValue(instanceId, out ObjectId matId) ? matId : ObjectId.Null; @@ -280,6 +156,7 @@ out ObjectId matId } catch (Exception ex) when (!ex.IsFatal()) { + _logger.LogError(ex, "Failed to create an instance from proxy"); conversionResults.Add(new(Status.ERROR, instanceOrDefinition as Base ?? new Base(), null, null, ex)); } } @@ -346,34 +223,9 @@ void TraverseAndClean(BlockTableRecord btr) 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, - _unitsConverter.ConvertOrThrow(Application.DocumentManager.CurrentDocument.Database.Insunits) - ); + var sf = Units.GetConversionFactor(units, _converterSettings.Current.SpeckleUnits); var scaledTransform = new[] { @@ -405,7 +257,7 @@ private Matrix3d GetMatrix3d(Matrix4x4 matrix, string units) } // https://forums.autodesk.com/t5/net/set-blocktransform-values/m-p/6452121#M49479 - private static double[] MakePerpendicular(Matrix3d matrix) + private double[] MakePerpendicular(Matrix3d matrix) { // Get the basis vectors of the matrix Vector3d right = new(matrix[0, 0], matrix[1, 0], matrix[2, 0]); @@ -414,8 +266,8 @@ private static double[] MakePerpendicular(Matrix3d matrix) Vector3d newForward = right.CrossProduct(up).GetNormal(); Vector3d newUp = newForward.CrossProduct(right).GetNormal(); - return new[] - { + return + [ right.X, newUp.X, newForward.X, @@ -431,7 +283,7 @@ private static double[] MakePerpendicular(Matrix3d matrix) 0.0, 0.0, 0.0, - matrix[3, 3], - }; + matrix[3, 3] + ]; } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceUnpacker.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceUnpacker.cs new file mode 100644 index 000000000..b8db9366b --- /dev/null +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadInstanceUnpacker.cs @@ -0,0 +1,161 @@ +using Autodesk.AutoCAD.DatabaseServices; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Autocad.HostApp.Extensions; +using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Connectors.Common.Instances; +using Speckle.Converters.Common; +using Speckle.DoubleNumerics; +using Speckle.Sdk; +using Speckle.Sdk.Models.Instances; + +namespace Speckle.Connectors.Autocad.HostApp; + +/// +/// Expects to be a scoped dependency per send operation. +/// +public class AutocadInstanceUnpacker : IInstanceUnpacker +{ + private readonly IHostToSpeckleUnitConverter _unitsConverter; + private readonly IInstanceObjectsManager> _instanceObjectsManager; + private readonly ILogger _logger; + + public AutocadInstanceUnpacker( + IHostToSpeckleUnitConverter unitsConverter, + IInstanceObjectsManager> instanceObjectsManager, + ILogger logger + ) + { + _unitsConverter = unitsConverter; + _instanceObjectsManager = instanceObjectsManager; + _logger = logger; + } + + public UnpackResult UnpackSelection(IEnumerable objects) + { + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + + foreach (var obj in objects) + { + // Note: isDynamicBlock always returns false for a selection of doc objects. Instances of dynamic blocks are represented in the document as blocks that have + // a definition reference to the anonymous block table record. + if (obj.Root is BlockReference blockReference && !blockReference.IsDynamicBlock) + { + UnpackInstance(blockReference, 0, transaction); + } + _instanceObjectsManager.AddAtomicObject(obj.ApplicationId, obj); + } + return _instanceObjectsManager.GetUnpackResult(); + } + + private void UnpackInstance(BlockReference instance, int depth, Transaction transaction) + { + try + { + string instanceId = instance.GetSpeckleApplicationId(); + + // If this instance has a reference to an anonymous block, it means it's spawned from a dynamic block. Anonymous blocks are + // used to represent specific "instances" of dynamic ones. + // We do not want to send the full dynamic block definition, but its current "instance", as such here we're making sure we + // take up the anon block table reference definition (if it exists). If it's not an instance of a dynamic block, we're + // using the normal def reference. + ObjectId definitionId = !instance.AnonymousBlockTableRecord.IsNull + ? instance.AnonymousBlockTableRecord + : instance.BlockTableRecord; + + InstanceProxy instanceProxy = + new() + { + applicationId = instanceId, + definitionId = definitionId.ToString(), + maxDepth = depth, + transform = GetMatrix(instance.BlockTransform.ToArray()), + units = _unitsConverter.ConvertOrThrow(Application.DocumentManager.CurrentDocument.Database.Insunits) + }; + _instanceObjectsManager.AddInstanceProxy(instanceId, instanceProxy); + + // 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 ( + !_instanceObjectsManager.TryGetInstanceProxiesFromDefinitionId( + definitionId.ToString(), + out List? instanceProxiesWithSameDefinition + ) + ) + { + instanceProxiesWithSameDefinition = new List(); + _instanceObjectsManager.AddInstanceProxiesByDefinitionId( + 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 instanceProxyWithSameDefinition in instanceProxiesWithSameDefinition) + { + if (instanceProxyWithSameDefinition.maxDepth < depth) + { + instanceProxyWithSameDefinition.maxDepth = depth; + } + } + + instanceProxiesWithSameDefinition.Add(_instanceObjectsManager.GetInstanceProxy(instanceId)); + + if ( + _instanceObjectsManager.TryGetInstanceDefinitionProxy( + definitionId.ToString(), + out InstanceDefinitionProxy? value + ) + ) + { + int depthDifference = depth - value.maxDepth; + if (depthDifference > 0) + { + // all MaxDepth of children definitions and its instances should be increased with difference of depth + _instanceObjectsManager.UpdateChildrenMaxDepth(value, depthDifference); + } + return; + } + + var definition = (BlockTableRecord)transaction.GetObject(definitionId, OpenMode.ForRead); + var definitionProxy = new InstanceDefinitionProxy() + { + applicationId = definitionId.ToString(), + objects = new(), + maxDepth = depth, + name = !instance.AnonymousBlockTableRecord.IsNull ? "Dynamic instance " + definitionId : definition.Name + }; + + // Go through each definition object + foreach (ObjectId id in definition) + { + Entity obj = (Entity)transaction.GetObject(id, OpenMode.ForRead); + + // In the case of dynamic blocks, this prevents sending objects that are not visibile in its current state. + if (!obj.Visible) + { + continue; + } + + string appId = obj.GetSpeckleApplicationId(); + definitionProxy.objects.Add(appId); + + if (obj is BlockReference blockReference) + { + UnpackInstance(blockReference, depth + 1, transaction); + } + + _instanceObjectsManager.AddAtomicObject(appId, new(obj, appId)); + } + + _instanceObjectsManager.AddDefinitionProxy(definitionId.ToString(), definitionProxy); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed unpacking Autocad instance"); + } + } + + private Matrix4x4 GetMatrix(double[] t) => + new(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]); +} diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerBaker.cs similarity index 70% rename from Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs rename to Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerBaker.cs index abc7d5ac1..a7beefdb5 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerManager.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerBaker.cs @@ -1,59 +1,30 @@ -using Autodesk.AutoCAD.DatabaseServices; +using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.LayerManager; -using Speckle.Connectors.Autocad.HostApp.Extensions; -using Speckle.Converters.Common; +using Speckle.Connectors.Common.Operations.Receive; using Speckle.Sdk.Models.Collections; -using Speckle.Sdk.Models.GraphTraversal; using AutocadColor = Autodesk.AutoCAD.Colors.Color; 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 +public class AutocadLayerBaker : TraversalContextUnpacker { - private readonly AutocadContext _autocadContext; - private readonly AutocadMaterialManager _materialManager; - private readonly AutocadColorManager _colorManager; private readonly string _layerFilterName = "Speckle"; - public Dictionary CollectionCache { get; } = new(); - - // POC: Will be addressed to move it into AutocadContext! + private readonly AutocadContext _autocadContext; + private readonly AutocadMaterialBaker _materialBaker; + private readonly AutocadColorBaker _colorBaker; private Document Doc => Application.DocumentManager.MdiActiveDocument; private readonly HashSet _uniqueLayerNames = new(); - public AutocadLayerManager( + public AutocadLayerBaker( AutocadContext autocadContext, - AutocadMaterialManager materialManager, - AutocadColorManager colorManager + AutocadMaterialBaker materialBaker, + AutocadColorBaker colorBaker ) { _autocadContext = autocadContext; - _materialManager = materialManager; - _colorManager = colorManager; - } - - public Layer GetOrCreateSpeckleLayer(Entity entity, Transaction tr, out LayerTableRecord? layer) - { - string layerName = entity.Layer; - layer = null; - if (CollectionCache.TryGetValue(layerName, out Layer? speckleLayer)) - { - return speckleLayer; - } - if (tr.GetObject(entity.LayerId, OpenMode.ForRead) is LayerTableRecord autocadLayer) - { - // Layers and geometries can have same application ids..... - // We should prevent it for sketchup converter. Because when it happens "objects_to_bake" definition - // is changing on the way if it happens. - speckleLayer = new Layer(layerName) { applicationId = autocadLayer.GetSpeckleApplicationId() }; // Do not use handle directly, see note in the 'GetSpeckleApplicationId' method - CollectionCache[layerName] = speckleLayer; - layer = autocadLayer; - return speckleLayer; - } - throw new SpeckleConversionException("Unexpected condition in GetOrCreateSpeckleLayer"); + _materialBaker = materialBaker; + _colorBaker = colorBaker; } /// @@ -73,7 +44,7 @@ public string CreateLayerForReceive(Collection[] layerPath, string baseLayerPref // get the color and material if any, of the leaf collection with a color AutocadColor? layerColor = null; ObjectId layerMaterial = ObjectId.Null; - if (_colorManager.ObjectColorsIdMap.Count > 0 || _materialManager.ObjectMaterialsIdMap.Count > 0) + if (_colorBaker.ObjectColorsIdMap.Count > 0 || _materialBaker.ObjectMaterialsIdMap.Count > 0) { bool foundColor = false; bool foundMaterial = false; @@ -85,12 +56,12 @@ public string CreateLayerForReceive(Collection[] layerPath, string baseLayerPref if (!foundColor) { - foundColor = _colorManager.ObjectColorsIdMap.TryGetValue(layerId, out layerColor); + foundColor = _colorBaker.ObjectColorsIdMap.TryGetValue(layerId, out layerColor); } if (!foundMaterial) { - foundMaterial = _materialManager.ObjectMaterialsIdMap.TryGetValue(layerId, out layerMaterial); + foundMaterial = _materialBaker.ObjectMaterialsIdMap.TryGetValue(layerId, out layerMaterial); } if (foundColor && foundMaterial) @@ -227,22 +198,4 @@ public void CreateLayerFilter(string projectName, string modelName) groupFilter.NestedFilters.Add(layerFilter); Doc.Database.LayerFilters = layerFilterTree; } - - /// - /// Gets a valid collection representing a layer for a given context. - /// - /// - /// A new Speckle Layer object - public Collection[] GetLayerPath(TraversalContext context) - { - Collection[] collectionBasedPath = context.GetAscendantOfType().Reverse().ToArray(); - - if (collectionBasedPath.Length == 0) - { - string[] path = context.GetPropertyPath().Reverse().ToArray(); - collectionBasedPath = [new Collection(string.Join("-", path))]; - } - - return collectionBasedPath; - } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerUnpacker.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerUnpacker.cs new file mode 100644 index 000000000..9905f4257 --- /dev/null +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadLayerUnpacker.cs @@ -0,0 +1,32 @@ +using Autodesk.AutoCAD.DatabaseServices; +using Speckle.Connectors.Autocad.HostApp.Extensions; +using Speckle.Converters.Common; +using Speckle.Sdk.Models.Collections; + +namespace Speckle.Connectors.Autocad.HostApp; + +public class AutocadLayerUnpacker +{ + private readonly Dictionary _layerCollectionCache = new(); + + public Layer GetOrCreateSpeckleLayer(Entity entity, Transaction tr, out LayerTableRecord? layer) + { + string layerName = entity.Layer; + layer = null; + if (_layerCollectionCache.TryGetValue(layerName, out Layer? speckleLayer)) + { + return speckleLayer; + } + if (tr.GetObject(entity.LayerId, OpenMode.ForRead) is LayerTableRecord autocadLayer) + { + // Layers and geometries can have same application ids..... + // We should prevent it for sketchup converter. Because when it happens "objects_to_bake" definition + // is changing on the way if it happens. + speckleLayer = new Layer(layerName) { applicationId = autocadLayer.GetSpeckleApplicationId() }; // Do not use handle directly, see note in the 'GetSpeckleApplicationId' method + _layerCollectionCache[layerName] = speckleLayer; + layer = autocadLayer; + return speckleLayer; + } + throw new SpeckleConversionException("Unexpected condition in GetOrCreateSpeckleLayer"); + } +} diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialManager.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialBaker.cs similarity index 53% rename from Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialManager.cs rename to Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialBaker.cs index 129b053b1..086ae3a1c 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialManager.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialBaker.cs @@ -1,11 +1,11 @@ using Autodesk.AutoCAD.Colors; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.GraphicsInterface; -using Speckle.Connectors.Autocad.HostApp.Extensions; -using Speckle.Connectors.Autocad.Operations.Send; -using Speckle.Connectors.Utils.Conversion; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Conversion; using Speckle.Objects.Other; using Speckle.Sdk; +using Speckle.Sdk.Models; using Material = Autodesk.AutoCAD.DatabaseServices.Material; using RenderMaterial = Speckle.Objects.Other.RenderMaterial; @@ -14,104 +14,131 @@ namespace Speckle.Connectors.Autocad.HostApp; /// /// Expects to be a scoped dependency for a given operation and helps with layer creation and cleanup. /// -public class AutocadMaterialManager +public class AutocadMaterialBaker { + private readonly ILogger _logger; private readonly AutocadContext _autocadContext; - - // POC: Will be addressed to move it into AutocadContext! private Document Doc => Application.DocumentManager.MdiActiveDocument; - public Dictionary ObjectMaterialsIdMap { get; } = new(); - public AutocadMaterialManager(AutocadContext autocadContext) + public AutocadMaterialBaker(AutocadContext autocadContext, ILogger logger) { _autocadContext = autocadContext; + _logger = logger; } - private RenderMaterialProxy ConvertMaterialToRenderMaterialProxy(Material material, string id) + /// + /// Try to get material id from original object or its parent (if provided) as fallback). + /// It covers one-to-many problem, i.e. + /// - rhino: Brep (material id is extracted into render material proxy objects) -> [Mesh, Mesh, ...] (child objects application ids ARE NOT EXIST in render material proxy objects) + /// - revit : RevitElement (material IS NOT extracted into render material proxy objects) -> [Mesh, Mesh...] (child objects application ids EXIST in render material proxy objects) + /// + /// + /// This is a question that we need to answer where to handle these cases. + /// We alsa do reverse search for layer render materials on Revit Receive, and mutating the proxy list accordingly. + /// These cases are increasing, and need some ideation around it before going more messy. + /// + public bool TryGetMaterialId(Base originalObject, Base? parentObject, out ObjectId materialId) { - EntityColor diffuseColor = material.Diffuse.Color.Color; - System.Drawing.Color diffuse = System.Drawing.Color.FromArgb( - diffuseColor.Red, - diffuseColor.Green, - diffuseColor.Blue - ); - - string name = material.Name; - double opacity = material.Opacity.Percentage; + materialId = ObjectId.Null; + var originalObjectId = originalObject.applicationId ?? originalObject.id; + if (ObjectMaterialsIdMap.TryGetValue(originalObjectId, out ObjectId originalObjectMaterialId)) + { + materialId = originalObjectMaterialId; + return true; + } - RenderMaterial renderMaterial = new(opacity: opacity, diffuse: diffuse) { name = name, applicationId = id }; + if (parentObject is null) + { + return false; + } - // Add additional properties - renderMaterial["ior"] = material.Refraction.Index; - renderMaterial["reflectivity"] = material.Reflectivity; + var subObjectId = parentObject.applicationId ?? parentObject.id; + if (ObjectMaterialsIdMap.TryGetValue(subObjectId, out ObjectId subObjectMaterialId)) + { + materialId = subObjectMaterialId; + return true; + } - return new(renderMaterial, new()) { applicationId = id }; + return false; } /// - /// Iterates through a given set of autocad objects and collects their materials. Note: expects objects to be "atomic", and extracted out of their instances already. + /// Removes all materials with a name starting with from the active document /// - /// - /// - /// - public List UnpackMaterials( - List unpackedAutocadObjects, - List layers - ) + /// + public void PurgeMaterials(string namePrefix) { - Dictionary materialProxies = new(); using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); - - // Stage 1: unpack materials from objects - foreach (AutocadRootObject rootObj in unpackedAutocadObjects) + if (transaction.GetObject(Doc.Database.MaterialDictionaryId, OpenMode.ForWrite) is DBDictionary materialDict) { - Entity entity = rootObj.Root; - - // skip inherited materials - if (entity.Material == "ByLayer" || entity.Material == "ByBlock") - { - continue; - } - - if (transaction.GetObject(entity.MaterialId, OpenMode.ForRead) is Material material) + foreach (var entry in materialDict) { - string materialId = material.GetSpeckleApplicationId(); - if (materialProxies.TryGetValue(materialId, out RenderMaterialProxy? value)) + try { - value.objects.Add(rootObj.ApplicationId); + if (entry.Key.Contains(namePrefix)) + { + materialDict.Remove(entry.Value); + } } - else + catch (Exception ex) when (!ex.IsFatal()) { - RenderMaterialProxy materialProxy = ConvertMaterialToRenderMaterialProxy(material, materialId); - materialProxy.objects.Add(rootObj.ApplicationId); - materialProxies[materialId] = materialProxy; + _logger.LogError(ex, "Failed to purge a material from the document"); } } } + transaction.Commit(); + } + + public void ParseAndBakeRenderMaterials( + List materialProxies, + string baseLayerPrefix, + Action? onOperationProgressed + ) + { + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + var materialDict = transaction.GetObject(Doc.Database.MaterialDictionaryId, OpenMode.ForWrite) as DBDictionary; + + if (materialDict == null) + { + // POC: we should report failed conversion here if material dict is not accessible, but it is not linked to a Base source + transaction.Commit(); + return; + } - // Stage 2: make sure we collect layer colors as well - foreach (LayerTableRecord layer in layers) + var count = 0; + foreach (RenderMaterialProxy materialProxy in materialProxies) { - if (transaction.GetObject(layer.MaterialId, OpenMode.ForRead) is Material material) + onOperationProgressed?.Invoke("Converting render materials", (double)++count / materialProxies.Count); + + // bake render material + RenderMaterial renderMaterial = materialProxy.value; + string renderMaterialId = renderMaterial.applicationId ?? renderMaterial.id; + ObjectId materialId = ObjectId.Null; + + if (!ObjectMaterialsIdMap.TryGetValue(renderMaterialId, out materialId)) { - string materialId = material.GetSpeckleApplicationId(); - string layerId = layer.GetSpeckleApplicationId(); // Do not use handle directly, see note in the 'GetSpeckleApplicationId' method - if (materialProxies.TryGetValue(materialId, out RenderMaterialProxy? value)) - { - value.objects.Add(layerId); - } - else - { - RenderMaterialProxy materialProxy = ConvertMaterialToRenderMaterialProxy(material, materialId); - materialProxy.objects.Add(layerId); - materialProxies[materialId] = materialProxy; - } + (materialId, ReceiveConversionResult result) = BakeMaterial( + renderMaterial, + baseLayerPrefix, + materialDict, + transaction + ); + } + + if (materialId == ObjectId.Null) + { + continue; + } + + // parse render material object ids + foreach (string objectId in materialProxy.objects) + { + ObjectMaterialsIdMap[objectId] = materialId; } } transaction.Commit(); - return materialProxies.Values.ToList(); } private (ObjectId, ReceiveConversionResult) BakeMaterial( @@ -165,103 +192,8 @@ Transaction tr } catch (Exception ex) when (!ex.IsFatal()) { + _logger.LogError(ex, "Failed to add a material to the document"); return (materialId, new(Status.ERROR, renderMaterial, null, null, ex)); } } - - /// - /// Removes all materials with a name starting with from the active document - /// - /// - public void PurgeMaterials(string namePrefix) - { - using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); - if (transaction.GetObject(Doc.Database.MaterialDictionaryId, OpenMode.ForWrite) is DBDictionary materialDict) - { - foreach (var entry in materialDict) - { - if (entry.Key.Contains(namePrefix)) - { - materialDict.Remove(entry.Value); - } - } - } - transaction.Commit(); - } - - public List ParseAndBakeRenderMaterials( - List materialProxies, - string baseLayerPrefix, - Action? onOperationProgressed - ) - { - List results = new(); - Dictionary objectRenderMaterialsIdMap = new(); - - using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); - var materialDict = transaction.GetObject(Doc.Database.MaterialDictionaryId, OpenMode.ForWrite) as DBDictionary; - - if (materialDict == null) - { - // POC: we should report failed conversion here if material dict is not accessible, but it is not linked to a Base source - transaction.Commit(); - return results; - } - - var count = 0; - foreach (RenderMaterialProxy materialProxy in materialProxies) - { - onOperationProgressed?.Invoke("Converting render materials", (double)++count / materialProxies.Count); - - // bake render material - RenderMaterial renderMaterial = materialProxy.value; - string renderMaterialId = renderMaterial.applicationId ?? renderMaterial.id; - ObjectId materialId = ObjectId.Null; - - if (!ObjectMaterialsIdMap.TryGetValue(renderMaterialId, out materialId)) - { - (materialId, ReceiveConversionResult result) = BakeMaterial( - renderMaterial, - baseLayerPrefix, - materialDict, - transaction - ); - - results.Add(result); - } - else - { - // POC: this shouldn't happen, but will if there are render materials with the same applicationID - results.Add( - new( - Status.ERROR, - renderMaterial, - exception: new ArgumentException("Another render material of the same id has already been created.") - ) - ); - } - - if (materialId == ObjectId.Null) - { - results.Add( - new( - Status.ERROR, - renderMaterial, - exception: new InvalidOperationException("Render material failed to be added to document.") - ) - ); - - continue; - } - - // parse render material object ids - foreach (string objectId in materialProxy.objects) - { - ObjectMaterialsIdMap[objectId] = materialId; - } - } - - transaction.Commit(); - return results; - } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialUnpacker.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialUnpacker.cs new file mode 100644 index 000000000..db26b6dee --- /dev/null +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/HostApp/AutocadMaterialUnpacker.cs @@ -0,0 +1,129 @@ +using Autodesk.AutoCAD.Colors; +using Autodesk.AutoCAD.DatabaseServices; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Autocad.HostApp.Extensions; +using Speckle.Connectors.Autocad.Operations.Send; +using Speckle.Objects.Other; +using Speckle.Sdk; +using Material = Autodesk.AutoCAD.DatabaseServices.Material; +using RenderMaterial = Speckle.Objects.Other.RenderMaterial; + +namespace Speckle.Connectors.Autocad.HostApp; + +/// +/// Expects to be a scoped dependency for a given operation and helps with layer creation and cleanup. +/// +public class AutocadMaterialUnpacker +{ + private readonly ILogger _logger; + + public AutocadMaterialUnpacker(ILogger logger) + { + _logger = logger; + } + + /// + /// Iterates through a given set of autocad objects and collects their materials. Note: expects objects to be "atomic", and extracted out of their instances already. + /// + /// + /// + /// + public List UnpackMaterials( + List unpackedAutocadObjects, + List layers + ) + { + Dictionary materialProxies = new(); + using var transaction = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); + + // Stage 1: unpack materials from objects + foreach (AutocadRootObject rootObj in unpackedAutocadObjects) + { + try + { + Entity entity = rootObj.Root; + + // skip inherited materials + if (entity.Material == "ByLayer" || entity.Material == "ByBlock") + { + continue; + } + + if (transaction.GetObject(entity.MaterialId, OpenMode.ForRead) is Material material) + { + string materialId = material.GetSpeckleApplicationId(); + if (materialProxies.TryGetValue(materialId, out RenderMaterialProxy? value)) + { + value.objects.Add(rootObj.ApplicationId); + } + else + { + RenderMaterialProxy materialProxy = ConvertMaterialToRenderMaterialProxy(material, materialId); + materialProxy.objects.Add(rootObj.ApplicationId); + materialProxies[materialId] = materialProxy; + } + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to unpack render material from Autocad Entity"); + } + } + + // Stage 2: make sure we collect layer colors as well + foreach (LayerTableRecord layer in layers) + { + try + { + if (transaction.GetObject(layer.MaterialId, OpenMode.ForRead) is Material material) + { + string materialId = material.GetSpeckleApplicationId(); + string layerId = layer.GetSpeckleApplicationId(); // Do not use handle directly, see note in the 'GetSpeckleApplicationId' method + if (materialProxies.TryGetValue(materialId, out RenderMaterialProxy? value)) + { + value.objects.Add(layerId); + } + else + { + RenderMaterialProxy materialProxy = ConvertMaterialToRenderMaterialProxy(material, materialId); + materialProxy.objects.Add(layerId); + materialProxies[materialId] = materialProxy; + } + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to unpack render material from Autocad Layer"); + } + } + + transaction.Commit(); + return materialProxies.Values.ToList(); + } + + private RenderMaterialProxy ConvertMaterialToRenderMaterialProxy(Material material, string id) + { + EntityColor diffuseColor = material.Diffuse.Color.Color; + System.Drawing.Color diffuse = System.Drawing.Color.FromArgb( + diffuseColor.Red, + diffuseColor.Green, + diffuseColor.Blue + ); + + string name = material.Name; + double opacity = material.Opacity.Percentage; + + RenderMaterial renderMaterial = new(opacity: opacity, diffuse: diffuse) { name = name, applicationId = id }; + + // Add additional properties + renderMaterial["ior"] = material.Refraction.Index; + renderMaterial["reflectivity"] = material.Reflectivity; + + return new RenderMaterialProxy() + { + value = renderMaterial, + objects = new(), + applicationId = id + }; + } +} diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs index 87812f241..6b3b1129d 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs @@ -1,17 +1,15 @@ using Autodesk.AutoCAD.DatabaseServices; using Speckle.Connectors.Autocad.HostApp; using Speckle.Connectors.Autocad.HostApp.Extensions; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Operations; +using Speckle.Connectors.Common.Operations.Receive; using Speckle.Converters.Common; -using Speckle.Objects.Other; using Speckle.Sdk; using Speckle.Sdk.Models; using Speckle.Sdk.Models.Collections; -using Speckle.Sdk.Models.GraphTraversal; using Speckle.Sdk.Models.Instances; -using Speckle.Sdk.Models.Proxies; using AutocadColor = Autodesk.AutoCAD.Colors.Color; namespace Speckle.Connectors.Autocad.Operations.Receive; @@ -21,37 +19,37 @@ namespace Speckle.Connectors.Autocad.Operations.Receive; /// public class AutocadHostObjectBuilder : IHostObjectBuilder { - private readonly AutocadLayerManager _autocadLayerManager; + private readonly AutocadLayerBaker _layerBaker; private readonly IRootToHostConverter _converter; - private readonly GraphTraversal _traversalFunction; private readonly ISyncToThread _syncToThread; - private readonly AutocadGroupManager _groupManager; - private readonly AutocadMaterialManager _materialManager; - private readonly AutocadColorManager _colorManager; - private readonly AutocadInstanceObjectManager _instanceObjectsManager; + private readonly AutocadGroupBaker _groupBaker; + private readonly AutocadMaterialBaker _materialBaker; + private readonly AutocadColorBaker _colorBaker; + private readonly AutocadInstanceBaker _instanceBaker; private readonly AutocadContext _autocadContext; + private readonly RootObjectUnpacker _rootObjectUnpacker; public AutocadHostObjectBuilder( IRootToHostConverter converter, - GraphTraversal traversalFunction, - AutocadLayerManager autocadLayerManager, - AutocadGroupManager groupManager, - AutocadInstanceObjectManager instanceObjectsManager, - AutocadMaterialManager materialManager, - AutocadColorManager colorManager, + AutocadLayerBaker layerBaker, + AutocadGroupBaker groupBaker, + AutocadInstanceBaker instanceBaker, + AutocadMaterialBaker materialBaker, + AutocadColorBaker colorBaker, ISyncToThread syncToThread, - AutocadContext autocadContext + AutocadContext autocadContext, + RootObjectUnpacker rootObjectUnpacker ) { _converter = converter; - _traversalFunction = traversalFunction; - _autocadLayerManager = autocadLayerManager; - _groupManager = groupManager; - _instanceObjectsManager = instanceObjectsManager; - _materialManager = materialManager; - _colorManager = colorManager; + _layerBaker = layerBaker; + _groupBaker = groupBaker; + _instanceBaker = instanceBaker; + _materialBaker = materialBaker; + _colorBaker = colorBaker; _syncToThread = syncToThread; _autocadContext = autocadContext; + _rootObjectUnpacker = rootObjectUnpacker; } public Task Build( @@ -60,89 +58,61 @@ public Task Build( string modelName, Action? onOperationProgressed, CancellationToken _ - ) - { - return _syncToThread.RunOnThread(() => + ) => + // NOTE: This is the only place we apply ISyncToThread across connectors. We need to sync up with main thread here + // after GetObject and Deserialization. It is anti-pattern now. Happiness level 3/10 but works. + _syncToThread.RunOnThread(() => { // Prompt the UI conversion started. Progress bar will swoosh. onOperationProgressed?.Invoke("Converting", null); // Layer filter for received commit with project and model name - _autocadLayerManager.CreateLayerFilter(projectName, modelName); + _layerBaker.CreateLayerFilter(projectName, modelName); + // 0 - Clean then Rock n Roll! string baseLayerPrefix = _autocadContext.RemoveInvalidChars($"SPK-{projectName}-{modelName}-"); - PreReceiveDeepClean(baseLayerPrefix); - List results = new(); - List bakedObjectIds = new(); - - var objectGraph = _traversalFunction.Traverse(rootObject).Where(obj => obj.Current is not Collection); + // 1 - Unpack objects and proxies from root commit object + var unpackedRoot = _rootObjectUnpacker.Unpack(rootObject); - // POC: these are not captured by traversal, so we need to re-add them here - var instanceDefinitionProxies = (rootObject["instanceDefinitionProxies"] as List) - ?.Cast() - .ToList(); + // 2 - Split atomic objects and instance components with their path + var (atomicObjects, instanceComponents) = _rootObjectUnpacker.SplitAtomicObjectsAndInstances( + unpackedRoot.ObjectsToConvert + ); + var atomicObjectsWithPath = _layerBaker.GetAtomicObjectsWithPath(atomicObjects); + var instanceComponentsWithPath = _layerBaker.GetInstanceComponentsWithPath(instanceComponents); - var instanceComponents = new List<(Collection[] path, IInstanceComponent obj)>(); // POC: these are not captured by traversal, so we need to re-add them here - if (instanceDefinitionProxies != null && instanceDefinitionProxies.Count > 0) + if (unpackedRoot.DefinitionProxies != null && unpackedRoot.DefinitionProxies.Count > 0) { - var transformed = instanceDefinitionProxies.Select(proxy => + var transformed = unpackedRoot.DefinitionProxies.Select(proxy => (Array.Empty(), proxy as IInstanceComponent) ); - instanceComponents.AddRange(transformed); + instanceComponentsWithPath.AddRange(transformed); } - // POC: get colors - List? colors = (rootObject["colorProxies"] as List)?.Cast().ToList(); - if (colors != null) + // 3 - Bake materials and colors, as they are used later down the line by layers and objects + if (unpackedRoot.RenderMaterialProxies != null) { - _colorManager.ParseColors(colors, onOperationProgressed); - } - - // POC: get render materials - List? renderMaterials = (rootObject["renderMaterialProxies"] as List) - ?.Cast() - .ToList(); - - if (renderMaterials != null) - { - List materialResults = _materialManager.ParseAndBakeRenderMaterials( - renderMaterials, + _materialBaker.ParseAndBakeRenderMaterials( + unpackedRoot.RenderMaterialProxies, baseLayerPrefix, onOperationProgressed ); - - results.AddRange(materialResults); } - // POC: get group proxies - var groupProxies = (rootObject["groupProxies"] as List)?.Cast().ToList(); - - var atomicObjects = new List<(Collection[] layerPath, Base obj)>(); - - foreach (TraversalContext tc in objectGraph) + if (unpackedRoot.ColorProxies != null) { - // create new speckle layer from layer path - Collection[] layerPath = _autocadLayerManager.GetLayerPath(tc); - switch (tc.Current) - { - case IInstanceComponent instanceComponent: - instanceComponents.Add((layerPath, instanceComponent)); - break; - case GroupProxy: - continue; - default: - atomicObjects.Add((layerPath, tc.Current)); - break; - } + _colorBaker.ParseColors(unpackedRoot.ColorProxies, onOperationProgressed); } - // Stage 1: Convert atomic objects + // 5 - Convert atomic objects + List results = new(); + List bakedObjectIds = new(); Dictionary> applicationIdMap = new(); var count = 0; - foreach (var (layerPath, atomicObject) in atomicObjects) + foreach (var (layerPath, atomicObject) in atomicObjectsWithPath) { string objectId = atomicObject.applicationId ?? atomicObject.id; onOperationProgressed?.Invoke("Converting objects", (double)++count / atomicObjects.Count); @@ -169,9 +139,9 @@ CancellationToken _ } } - // Stage 2: Convert instances - var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = _instanceObjectsManager.BakeInstances( - instanceComponents, + // 6 - Convert instances + var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = _instanceBaker.BakeInstances( + instanceComponentsWithPath, applicationIdMap, baseLayerPrefix, onOperationProgressed @@ -182,27 +152,29 @@ CancellationToken _ results.RemoveAll(result => result.ResultId != null && consumedObjectIds.Contains(result.ResultId)); results.AddRange(instanceConversionResults); - // Stage 3: Create group - if (groupProxies != null) + // 7 - Create groups + if (unpackedRoot.GroupProxies != null) { - List groupResults = _groupManager.CreateGroups(groupProxies, applicationIdMap); + List groupResults = _groupBaker.CreateGroups( + unpackedRoot.GroupProxies, + applicationIdMap + ); results.AddRange(groupResults); } return new HostObjectBuilderResult(bakedObjectIds, results); }); - } private void PreReceiveDeepClean(string baseLayerPrefix) { - _autocadLayerManager.DeleteAllLayersByPrefix(baseLayerPrefix); - _instanceObjectsManager.PurgeInstances(baseLayerPrefix); - _materialManager.PurgeMaterials(baseLayerPrefix); + _layerBaker.DeleteAllLayersByPrefix(baseLayerPrefix); + _instanceBaker.PurgeInstances(baseLayerPrefix); + _materialBaker.PurgeMaterials(baseLayerPrefix); } private IEnumerable ConvertObject(Base obj, Collection[] layerPath, string baseLayerNamePrefix) { - string layerName = _autocadLayerManager.CreateLayerForReceive(layerPath, baseLayerNamePrefix); + string layerName = _layerBaker.CreateLayerForReceive(layerPath, baseLayerNamePrefix); var convertedEntities = new List(); using var tr = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); @@ -226,15 +198,15 @@ private IEnumerable ConvertObject(Base obj, Collection[] layerPath, stri return convertedEntities; } - private Entity BakeObject(Entity entity, Base originalObject, string layerName) + private Entity BakeObject(Entity entity, Base originalObject, string layerName, Base? parentObject = null) { var objId = originalObject.applicationId ?? originalObject.id; - if (_colorManager.ObjectColorsIdMap.TryGetValue(objId, out AutocadColor? color)) + if (_colorBaker.ObjectColorsIdMap.TryGetValue(objId, out AutocadColor? color)) { entity.Color = color; } - if (_materialManager.ObjectMaterialsIdMap.TryGetValue(objId, out ObjectId matId)) + if (_materialBaker.TryGetMaterialId(originalObject, parentObject, out ObjectId matId)) { entity.MaterialId = matId; } @@ -245,14 +217,14 @@ private Entity BakeObject(Entity entity, Base originalObject, string layerName) private List BakeObjectsAsGroup( IEnumerable<(object, Base)> fallbackConversionResult, - Base originatingObject, + Base parentObject, string layerName, string baseLayerName ) { var ids = new ObjectIdCollection(); var entities = new List(); - foreach (var (conversionResult, originalBaseObject) in fallbackConversionResult) + foreach (var (conversionResult, originalObject) in fallbackConversionResult) { if (conversionResult is not Entity entity) { @@ -260,7 +232,7 @@ string baseLayerName continue; } - BakeObject(entity, originalBaseObject, layerName); + BakeObject(entity, originalObject, layerName, parentObject); ids.Add(entity.ObjectId); entities.Add(entity); } @@ -270,7 +242,7 @@ string baseLayerName tr.GetObject(Application.DocumentManager.CurrentDocument.Database.GroupDictionaryId, OpenMode.ForWrite); var groupName = _autocadContext.RemoveInvalidChars( - $@"{originatingObject.speckle_type.Split('.').Last()} - {originatingObject.applicationId ?? originatingObject.id} ({baseLayerName})" + $@"{parentObject.speckle_type.Split('.').Last()} - {parentObject.applicationId ?? parentObject.id} ({baseLayerName})" ); var newGroup = new Group(groupName, true); diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs index e0624513e..ba521c1ab 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Send/AutocadRootObjectBuilder.cs @@ -1,20 +1,19 @@ -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Autodesk.AutoCAD.DatabaseServices; using Microsoft.Extensions.Logging; using Speckle.Connectors.Autocad.HostApp; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Extensions; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Extensions; +using Speckle.Connectors.Common.Operations; +using Speckle.Converters.Autocad; using Speckle.Converters.Common; -using Speckle.Objects.Other; using Speckle.Sdk; +using Speckle.Sdk.Logging; using Speckle.Sdk.Models; using Speckle.Sdk.Models.Collections; using Speckle.Sdk.Models.Instances; -using Speckle.Sdk.Models.Proxies; namespace Speckle.Connectors.Autocad.Operations.Send; @@ -22,38 +21,48 @@ public class AutocadRootObjectBuilder : IRootObjectBuilder { private readonly IRootToSpeckleConverter _converter; private readonly string[] _documentPathSeparator = ["\\"]; + private readonly IConverterSettingsStore _converterSettings; private readonly ISendConversionCache _sendConversionCache; - private readonly AutocadInstanceObjectManager _instanceObjectsManager; - private readonly AutocadMaterialManager _materialManager; - private readonly AutocadColorManager _colorManager; - private readonly AutocadLayerManager _layerManager; - private readonly AutocadGroupManager _groupManager; - private readonly ISyncToThread _syncToThread; + private readonly AutocadInstanceUnpacker _instanceUnpacker; + private readonly AutocadMaterialUnpacker _materialUnpacker; + private readonly AutocadColorUnpacker _colorUnpacker; + private readonly AutocadLayerUnpacker _layerUnpacker; + private readonly AutocadGroupUnpacker _groupUnpacker; private readonly ILogger _logger; + private readonly ISdkActivityFactory _activityFactory; public AutocadRootObjectBuilder( IRootToSpeckleConverter converter, ISendConversionCache sendConversionCache, - AutocadInstanceObjectManager instanceObjectManager, - AutocadMaterialManager materialManager, - AutocadColorManager colorManager, - AutocadLayerManager layerManager, - AutocadGroupManager groupManager, - ISyncToThread syncToThread, - ILogger logger + AutocadInstanceUnpacker instanceObjectManager, + AutocadMaterialUnpacker materialUnpacker, + AutocadColorUnpacker colorUnpacker, + AutocadLayerUnpacker layerUnpacker, + AutocadGroupUnpacker groupUnpacker, + ILogger logger, + ISdkActivityFactory activityFactory, + IConverterSettingsStore converterSettings ) { _converter = converter; _sendConversionCache = sendConversionCache; - _instanceObjectsManager = instanceObjectManager; - _materialManager = materialManager; - _colorManager = colorManager; - _layerManager = layerManager; - _groupManager = groupManager; - _syncToThread = syncToThread; + _instanceUnpacker = instanceObjectManager; + _materialUnpacker = materialUnpacker; + _colorUnpacker = colorUnpacker; + _layerUnpacker = layerUnpacker; + _groupUnpacker = groupUnpacker; _logger = logger; + _activityFactory = activityFactory; + _converterSettings = converterSettings; } + public Task Build( + IReadOnlyList objects, + SendInfo sendInfo, + Action? onOperationProgressed = null, + CancellationToken ct = default + ) => Task.FromResult(BuildSync(objects, sendInfo, onOperationProgressed, ct)); + [SuppressMessage( "Maintainability", "CA1506:Avoid excessive class coupling", @@ -63,80 +72,59 @@ It is already simplified but has many different references since it is a builder proxy classes yet. So I'm supressing this one now!!! """ )] - public Task Build( + private RootObjectBuilderResult BuildSync( IReadOnlyList objects, SendInfo sendInfo, - Action? onOperationProgressed = null, - CancellationToken ct = default + Action? onOperationProgressed, + CancellationToken ct ) { - return _syncToThread.RunOnThread(() => + // 0 - Init the root + Collection root = + new() + { + name = Application + .DocumentManager.CurrentDocument.Name // POC: https://spockle.atlassian.net/browse/CNX-9319 + .Split(_documentPathSeparator, StringSplitOptions.None) + .Reverse() + .First() + }; + root["units"] = _converterSettings.Current.SpeckleUnits; + + // TODO: better handling for document and transactions!! + Document doc = Application.DocumentManager.CurrentDocument; + using Transaction tr = doc.Database.TransactionManager.StartTransaction(); + + // 1 - Unpack the instances + var (atomicObjects, instanceProxies, instanceDefinitionProxies) = _instanceUnpacker.UnpackSelection(objects); + root[ProxyKeys.INSTANCE_DEFINITION] = instanceDefinitionProxies; + + // 2 - Unpack the groups + root[ProxyKeys.GROUP] = _groupUnpacker.UnpackGroups(atomicObjects); + using (var _ = _activityFactory.Start("Converting objects")) { - Collection modelWithLayers = - new() - { - name = Application - .DocumentManager.CurrentDocument.Name // POC: https://spockle.atlassian.net/browse/CNX-9319 - .Split(_documentPathSeparator, StringSplitOptions.None) - .Reverse() - .First() - }; - - // TODO: better handling for document and transactions!! - Document doc = Application.DocumentManager.CurrentDocument; - using Transaction tr = doc.Database.TransactionManager.StartTransaction(); - - // Keeps track of autocad layers used, so we can pass them on later to the material and color unpacker. - List usedAcadLayers = new(); - int count = 0; - - var (atomicObjects, instanceProxies, instanceDefinitionProxies) = _instanceObjectsManager.UnpackSelection( - objects - ); - + // 3 - Convert atomic objects + List usedAcadLayers = new(); // Keeps track of autocad layers used, so we can pass them on later to the material and color unpacker. List results = new(); - var cacheHitCount = 0; - + int count = 0; foreach (var (entity, applicationId) in atomicObjects) { ct.ThrowIfCancellationRequested(); - string sourceType = entity.GetType().ToString(); - try + using (var convertActivity = _activityFactory.Start("Converting object")) { - Base converted; - if (entity is BlockReference && instanceProxies.TryGetValue(applicationId, out InstanceProxy? instanceProxy)) - { - converted = instanceProxy; - } - else if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value)) - { - converted = value; - cacheHitCount++; - } - else - { - converted = _converter.Convert(entity); - converted.applicationId = applicationId; - } - // Create and add a collection for each layer if not done so already. - Layer layer = _layerManager.GetOrCreateSpeckleLayer(entity, tr, out LayerTableRecord? autocadLayer); + Layer layer = _layerUnpacker.GetOrCreateSpeckleLayer(entity, tr, out LayerTableRecord? autocadLayer); if (autocadLayer is not null) { usedAcadLayers.Add(autocadLayer); - modelWithLayers.elements.Add(layer); + root.elements.Add(layer); } - layer.elements.Add(converted); - results.Add(new(Status.SUCCESS, applicationId, sourceType, converted)); - } - catch (Exception ex) when (!ex.IsFatal()) - { - _logger.LogSendConversionError(ex, sourceType); + var result = ConvertAutocadEntity(entity, applicationId, layer, instanceProxies, sendInfo.ProjectId); + results.Add(result); - results.Add(new(Status.ERROR, applicationId, sourceType, null, ex)); + onOperationProgressed?.Invoke("Converting", (double)++count / atomicObjects.Count); } - onOperationProgressed?.Invoke("Converting", (double)++count / atomicObjects.Count); } if (results.All(x => x.Status == Status.ERROR)) @@ -144,37 +132,49 @@ public Task Build( throw new SpeckleConversionException("Failed to convert all objects."); // fail fast instead creating empty commit! It will appear as model card error with red color. } - // POC: Log would be nice, or can be removed. - Debug.WriteLine( - $"Cache hit count {cacheHitCount} out of {objects.Count} ({(double)cacheHitCount / objects.Count})" - ); + // 4 - Unpack the render material proxies + root[ProxyKeys.RENDER_MATERIAL] = _materialUnpacker.UnpackMaterials(atomicObjects, usedAcadLayers); + + // 5 - Unpack the color proxies + root[ProxyKeys.COLOR] = _colorUnpacker.UnpackColors(atomicObjects, usedAcadLayers); - var conversionFailedAppIds = results - .FindAll(result => result.Status == Status.ERROR) - .Select(result => result.SourceId); + return new RootObjectBuilderResult(root, results); + } + } - // Cleans up objects that failed to convert from definition proxies. - // see https://linear.app/speckle/issue/CNX-115/viewer-handle-gracefully-instances-with-elements-that-failed-to - foreach (var definitionProxy in instanceDefinitionProxies) + private SendConversionResult ConvertAutocadEntity( + Entity entity, + string applicationId, + Collection collectionHost, + IReadOnlyDictionary instanceProxies, + string projectId + ) + { + string sourceType = entity.GetType().ToString(); + try + { + Base converted; + if (entity is BlockReference && instanceProxies.TryGetValue(applicationId, out InstanceProxy? instanceProxy)) { - definitionProxy.objects.RemoveAll(id => conversionFailedAppIds.Contains(id)); + converted = instanceProxy; + } + else if (_sendConversionCache.TryGetValue(projectId, applicationId, out ObjectReference? value)) + { + converted = value; + } + else + { + converted = _converter.Convert(entity); + converted.applicationId = applicationId; } - // Set definition proxies - modelWithLayers["instanceDefinitionProxies"] = instanceDefinitionProxies; - - // set groups - List groupProxies = _groupManager.UnpackGroups(atomicObjects); - modelWithLayers["groupProxies"] = groupProxies; - - // set materials - List materialProxies = _materialManager.UnpackMaterials(atomicObjects, usedAcadLayers); - modelWithLayers["renderMaterialProxies"] = materialProxies; - - // set colors - List colorProxies = _colorManager.UnpackColors(atomicObjects, usedAcadLayers); - modelWithLayers["colorProxies"] = colorProxies; - return new RootObjectBuilderResult(modelWithLayers, results); - }); + collectionHost.elements.Add(converted); + return new(Status.SUCCESS, applicationId, sourceType, converted); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogSendConversionError(ex, sourceType); + return new(Status.ERROR, applicationId, sourceType, null, ex); + } } } diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadCommand.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadCommand.cs index acba8d556..526e6ee7a 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadCommand.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadCommand.cs @@ -1,20 +1,23 @@ using System.Drawing; -using System.IO; -using System.Reflection; using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.Windows; -using Speckle.Autofac.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Connectors.Autocad.DependencyInjection; +using Speckle.Connectors.Common; +using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.WebView; -using Speckle.Connectors.Utils; -using Speckle.Sdk.Common; - +#if AUTOCAD +using Speckle.Converters.Autocad; +#elif CIVIL3D +using Speckle.Converters.Civil3d; +#endif namespace Speckle.Connectors.Autocad.Plugin; public class AutocadCommand { private static PaletteSet? PaletteSet { get; set; } private static readonly Guid s_id = new("3223E594-1B09-4E54-B3DD-8EA0BECE7BA5"); - public SpeckleContainer? Container { get; private set; } + public ServiceProvider? Container { get; private set; } private IDisposable? _disposableLogger; public const string COMMAND_STRING = "SpeckleBeta"; @@ -33,18 +36,20 @@ public void Command() DockEnabled = (DockSides)((int)DockSides.Left + (int)DockSides.Right) }; - var builder = SpeckleContainerBuilder.CreateInstance(); - // init DI - _disposableLogger = Connector.Initialize(AppUtils.App, AppUtils.Version); - Container = builder - .LoadAutofacModules( - Assembly.GetExecutingAssembly(), - [Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull()] - ) - .Build(); - - var panelWebView = Container.Resolve(); + var services = new ServiceCollection(); + _disposableLogger = services.Initialize(AppUtils.App, AppUtils.Version); +#if AUTOCAD + services.AddAutocad(); + services.AddAutocadConverters(); +#elif CIVIL3D + services.AddCivil3d(); + services.AddCivil3dConverters(); +#endif + Container = services.BuildServiceProvider(); + Container.UseDUI(); + + var panelWebView = Container.GetRequiredService(); PaletteSet.AddVisual("Speckle (Beta) for Autocad WebView", panelWebView); diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadExtensionApplication.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadExtensionApplication.cs index a089b7c69..b7580d793 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadExtensionApplication.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadExtensionApplication.cs @@ -1,5 +1,5 @@ using Autodesk.AutoCAD.Runtime; -using Speckle.Autofac; +using Speckle.Connectors.Common; namespace Speckle.Connectors.Autocad.Plugin; diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadRibbon.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadRibbon.cs index 6c1284b0f..7d6dc8b30 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadRibbon.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Plugin/AutocadRibbon.cs @@ -4,7 +4,6 @@ using System.Windows.Media.Imaging; using Autodesk.Windows; using Speckle.Sdk; -using Speckle.Sdk.Logging; namespace Speckle.Connectors.Autocad.Plugin; @@ -178,18 +177,9 @@ private bool TryLoadPngImgSource(string sourceName, out System.Windows.Media.Ima { stream = assembly.GetManifestResourceStream(resource); } - catch (FileLoadException flEx) - { - SpeckleLog.Logger.Error(flEx, "Could not load app image source: {exceptionMessage}"); - } - catch (FileNotFoundException fnfEx) - { - SpeckleLog.Logger.Error(fnfEx, "Could not find app image source: {exceptionMessage}"); - } - catch (NotImplementedException niEx) - { - SpeckleLog.Logger.Error(niEx, "App image source could not be loaded: {exceptionMessage}"); - } + catch (FileLoadException) { } + catch (FileNotFoundException) { } + catch (NotImplementedException) { } if (stream is null) { diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems index 8656167b2..4798dce73 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Speckle.Connectors.AutocadShared.projitems @@ -17,15 +17,20 @@ - - - + + + + + + + + + - - + diff --git a/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj b/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj index 396b5d4fd..87f0841ce 100644 --- a/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj +++ b/Connectors/Autocad/Speckle.Connectors.Civil3d2024/Speckle.Connectors.Civil3d2024.csproj @@ -13,7 +13,7 @@ - + diff --git a/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json b/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json index 0aacc1750..d95249c49 100644 --- a/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json +++ b/Connectors/Autocad/Speckle.Connectors.Civil3d2024/packages.lock.json @@ -71,14 +71,6 @@ "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", @@ -108,59 +100,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -196,11 +179,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -233,22 +211,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -262,8 +240,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -275,32 +253,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -310,24 +264,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -338,71 +289,50 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, - "speckle.converters.autocad2023": { + "speckle.converters.civil3d2024": { "type": "Project", "dependencies": { - "Speckle.AutoCAD.API": "[2023.0.0, )", + "Speckle.AutoCAD.API": "[2024.0.0, )", + "Speckle.Civil3D.API": "[2024.0.0, )", "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.autocad2023.dependencyinjection": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )", - "Speckle.Converters.Autocad2023": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -412,29 +342,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Revit/Speckle.Connectors.Revit2022/Speckle.Connectors.Revit2022.csproj b/Connectors/Revit/Speckle.Connectors.Revit2022/Speckle.Connectors.Revit2022.csproj index 345517069..15ef4476a 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2022/Speckle.Connectors.Revit2022.csproj +++ b/Connectors/Revit/Speckle.Connectors.Revit2022/Speckle.Connectors.Revit2022.csproj @@ -25,13 +25,9 @@ - - - - - + diff --git a/Connectors/Revit/Speckle.Connectors.Revit2022/packages.lock.json b/Connectors/Revit/Speckle.Connectors.Revit2022/packages.lock.json index 606936416..10245828f 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2022/packages.lock.json +++ b/Connectors/Revit/Speckle.Connectors.Revit2022/packages.lock.json @@ -90,14 +90,6 @@ "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", @@ -127,59 +119,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -215,11 +198,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -252,22 +230,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -281,8 +259,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -294,32 +272,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -329,101 +283,75 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.converters.revit2022": { "type": "Project", "dependencies": { "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", "Speckle.Revit.API": "[2022.0.2.1, )" } }, - "speckle.converters.revit2022.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", - "Speckle.Converters.Revit2022": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Revit.API": { @@ -434,20 +362,20 @@ }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj b/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj index e16e6a242..ae7323b64 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj +++ b/Connectors/Revit/Speckle.Connectors.Revit2023/Speckle.Connectors.Revit2023.csproj @@ -24,13 +24,9 @@ - - - - - + @@ -39,7 +35,6 @@ - Always diff --git a/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json b/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json index 6472e3233..12286f08c 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json +++ b/Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json @@ -90,14 +90,6 @@ "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", @@ -127,59 +119,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -215,11 +198,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -252,22 +230,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -281,8 +259,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -294,32 +272,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -329,49 +283,32 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.converters.revit2023": { @@ -381,48 +318,40 @@ "Speckle.Revit.API": "[2023.0.0, )" } }, - "speckle.converters.revit2023.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", - "Speckle.Converters.Revit2023": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Revit.API": { @@ -433,20 +362,20 @@ }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Revit/Speckle.Connectors.Revit2024/Speckle.Connectors.Revit2024.csproj b/Connectors/Revit/Speckle.Connectors.Revit2024/Speckle.Connectors.Revit2024.csproj index 226a12cbd..c3e0887b5 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2024/Speckle.Connectors.Revit2024.csproj +++ b/Connectors/Revit/Speckle.Connectors.Revit2024/Speckle.Connectors.Revit2024.csproj @@ -24,13 +24,9 @@ - - - - - + diff --git a/Connectors/Revit/Speckle.Connectors.Revit2024/packages.lock.json b/Connectors/Revit/Speckle.Connectors.Revit2024/packages.lock.json index 8e5b63025..36bb56210 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2024/packages.lock.json +++ b/Connectors/Revit/Speckle.Connectors.Revit2024/packages.lock.json @@ -90,14 +90,6 @@ "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", @@ -127,59 +119,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -215,11 +198,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -252,22 +230,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -281,8 +259,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -294,32 +272,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -329,49 +283,32 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.converters.revit2024": { @@ -381,48 +318,40 @@ "Speckle.Revit.API": "[2024.0.0, )" } }, - "speckle.converters.revit2024.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", - "Speckle.Converters.Revit2024": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Revit.API": { @@ -433,20 +362,20 @@ }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Revit/Speckle.Connectors.Revit2025/Speckle.Connectors.Revit2025.csproj b/Connectors/Revit/Speckle.Connectors.Revit2025/Speckle.Connectors.Revit2025.csproj index eb189f145..bb46333a0 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2025/Speckle.Connectors.Revit2025.csproj +++ b/Connectors/Revit/Speckle.Connectors.Revit2025/Speckle.Connectors.Revit2025.csproj @@ -17,13 +17,9 @@ - - - - - + diff --git a/Connectors/Revit/Speckle.Connectors.Revit2025/packages.lock.json b/Connectors/Revit/Speckle.Connectors.Revit2025/packages.lock.json index f62f09643..39e6473a6 100644 --- a/Connectors/Revit/Speckle.Connectors.Revit2025/packages.lock.json +++ b/Connectors/Revit/Speckle.Connectors.Revit2025/packages.lock.json @@ -112,54 +112,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -194,11 +191,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -229,6 +221,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -239,24 +236,26 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -267,28 +266,14 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.converters.revit2025": { @@ -298,37 +283,32 @@ "Speckle.Revit.API": "[2025.0.0, )" } }, - "speckle.converters.revit2025.dependencyinjection": { - "type": "Project", + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", - "Speckle.Converters.Revit2025": "[1.0.0, )" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, - "Autofac": { - "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" - }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -338,11 +318,11 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Revit.API": { @@ -353,20 +333,20 @@ }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs index d358df924..7fe9a1e82 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/BasicConnectorBindingRevit.cs @@ -1,11 +1,10 @@ -using System.Reflection; using Autodesk.Revit.DB; +using Microsoft.Extensions.Logging; using Revit.Async; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.RevitShared; -using Speckle.Connectors.Utils.Common; using Speckle.Converters.RevitShared.Helpers; using Speckle.Sdk; using Speckle.Sdk.Common; @@ -16,19 +15,29 @@ internal sealed class BasicConnectorBindingRevit : IBasicConnectorBinding { // POC: name and bridge might be better for them to be protected props? public string Name { get; private set; } - public IBridge Parent { get; private set; } + public IBrowserBridge Parent { get; private set; } public BasicConnectorBindingCommands Commands { get; } private readonly DocumentModelStore _store; private readonly RevitContext _revitContext; - - public BasicConnectorBindingRevit(DocumentModelStore store, IBridge parent, RevitContext revitContext) + private readonly ISpeckleApplication _speckleApplication; + private readonly ILogger _logger; + + public BasicConnectorBindingRevit( + DocumentModelStore store, + IBrowserBridge parent, + RevitContext revitContext, + ISpeckleApplication speckleApplication, + ILogger logger + ) { Name = "baseBinding"; Parent = parent; _store = store; _revitContext = revitContext; + _speckleApplication = speckleApplication; + _logger = logger; Commands = new BasicConnectorBindingCommands(parent); // POC: event binding? @@ -38,11 +47,11 @@ public BasicConnectorBindingRevit(DocumentModelStore store, IBridge parent, Revi }; } - public string GetConnectorVersion() => Assembly.GetAssembly(GetType()).NotNull().GetVersion(); + public string GetConnectorVersion() => _speckleApplication.SpeckleVersion; - public string GetSourceApplicationName() => Speckle.Connectors.Utils.Connector.Slug.ToLower(); // POC: maybe not right place but... // ANOTHER POC: We should align this naming from somewhere in common DUI projects instead old structs. I know there are other POC comments around this + public string GetSourceApplicationName() => _speckleApplication.Slug; - public string GetSourceApplicationVersion() => Speckle.Connectors.Utils.Connector.VersionString; // POC: maybe not right place but... + public string GetSourceApplicationVersion() => _speckleApplication.HostApplicationVersion; public DocumentInfo? GetDocumentInfo() { @@ -75,17 +84,37 @@ public BasicConnectorBindingRevit(DocumentModelStore store, IBridge parent, Revi public void HighlightModel(string modelCardId) { - SenderModelCard model = (SenderModelCard)_store.GetModelById(modelCardId); + var model = _store.GetModelById(modelCardId); + + if (model is null) + { + _logger.LogError("Model was null when highlighting received model"); + return; + } var activeUIDoc = _revitContext.UIApplication?.ActiveUIDocument ?? throw new SpeckleException("Unable to retrieve active UI document"); - var elementIds = model - .SendFilter.NotNull() - .GetObjectIds() - .Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid)) - .ToList(); + var elementIds = new List(); + + if (model is SenderModelCard senderModelCard) + { + elementIds = senderModelCard + .SendFilter.NotNull() + .GetObjectIds() + .Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid)) + .ToList(); + } + + if (model is ReceiverModelCard receiverModelCard) + { + elementIds = receiverModelCard + .BakedObjectIds.NotNull() + .Select(uid => ElementIdHelper.GetElementIdFromUniqueId(activeUIDoc.Document, uid)) + .ToList(); + } + if (elementIds.Count == 0) { Commands.SetModelError(modelCardId, new InvalidOperationException("No objects found to highlight.")); diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs index 4f4ed5f2e..04c363a18 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitBaseBinding.cs @@ -9,12 +9,12 @@ internal abstract class RevitBaseBinding : IBinding { // POC: name and bridge might be better for them to be protected props? public string Name { get; } - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } protected readonly DocumentModelStore Store; protected readonly RevitContext RevitContext; - protected RevitBaseBinding(string name, DocumentModelStore store, IBridge parent, RevitContext revitContext) + protected RevitBaseBinding(string name, DocumentModelStore store, IBrowserBridge parent, RevitContext revitContext) { Name = name; Parent = parent; diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitReceiveBinding.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitReceiveBinding.cs index 8646a385b..51e9fdec2 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitReceiveBinding.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitReceiveBinding.cs @@ -1,13 +1,15 @@ +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Logging; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk; namespace Speckle.Connectors.Revit.Bindings; @@ -15,29 +17,35 @@ namespace Speckle.Connectors.Revit.Bindings; internal sealed class RevitReceiveBinding : IReceiveBinding { public string Name => "receiveBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; private readonly CancellationManager _cancellationManager; private readonly DocumentModelStore _store; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; + private readonly IRevitConversionSettingsFactory _revitConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; private ReceiveBindingUICommands Commands { get; } public RevitReceiveBinding( DocumentModelStore store, CancellationManager cancellationManager, - IBridge parent, - IUnitOfWorkFactory unitOfWorkFactory, + IBrowserBridge parent, + IServiceProvider serviceProvider, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + IRevitConversionSettingsFactory revitConversionSettingsFactory, + ISpeckleApplication speckleApplication ) { Parent = parent; _store = store; - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _operationProgressManager = operationProgressManager; _logger = logger; + _revitConversionSettingsFactory = revitConversionSettingsFactory; + _speckleApplication = speckleApplication; _cancellationManager = cancellationManager; Commands = new ReceiveBindingUICommands(parent); @@ -47,7 +55,6 @@ ILogger logger public async Task Receive(string modelCardId) { - using var unitOfWork = _unitOfWorkFactory.Resolve(); try { // Get receiver card @@ -59,10 +66,21 @@ public async Task Receive(string modelCardId) CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize( + _revitConversionSettingsFactory.Create( + DetailLevelType.Coarse, //TODO figure out + null, + false + ) + ); // Receive host objects - HostObjectBuilderResult conversionResults = await unitOfWork - .Service.Execute( - modelCard.GetReceiveInfo(Speckle.Connectors.Utils.Connector.Slug), + HostObjectBuilderResult conversionResults = await scope + .ServiceProvider.GetRequiredService() + .Execute( + modelCard.GetReceiveInfo(_speckleApplication.Slug), cancellationToken, (status, progress) => _operationProgressManager.SetModelProgress( diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs index 56778760d..2dab7cd4b 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/RevitSendBinding.cs @@ -1,8 +1,10 @@ using System.Collections.Concurrent; using Autodesk.Revit.DB; -using Autofac; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Exceptions; @@ -14,9 +16,7 @@ using Speckle.Connectors.Revit.HostApp; using Speckle.Connectors.Revit.Operations.Send.Settings; using Speckle.Connectors.Revit.Plugin; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk; @@ -28,12 +28,14 @@ internal sealed class RevitSendBinding : RevitBaseBinding, ISendBinding { private readonly IRevitIdleManager _idleManager; private readonly CancellationManager _cancellationManager; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; private readonly ISendConversionCache _sendConversionCache; private readonly IOperationProgressManager _operationProgressManager; private readonly ToSpeckleSettingsManager _toSpeckleSettingsManager; private readonly ILogger _logger; private readonly ElementUnpacker _elementUnpacker; + private readonly IRevitConversionSettingsFactory _revitConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; /// /// Used internally to aggregate the changed objects' id. Note we're using a concurrent dictionary here as the expiry check method is not thread safe, and this was causing problems. See: @@ -48,24 +50,28 @@ public RevitSendBinding( RevitContext revitContext, DocumentModelStore store, CancellationManager cancellationManager, - IBridge bridge, - IUnitOfWorkFactory unitOfWorkFactory, + IBrowserBridge bridge, + IServiceProvider serviceProvider, ISendConversionCache sendConversionCache, IOperationProgressManager operationProgressManager, ToSpeckleSettingsManager toSpeckleSettingsManager, ILogger logger, - ElementUnpacker elementUnpacker + ElementUnpacker elementUnpacker, + IRevitConversionSettingsFactory revitConversionSettingsFactory, + ISpeckleApplication speckleApplication ) : base("sendBinding", store, bridge, revitContext) { _idleManager = idleManager; _cancellationManager = cancellationManager; - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _sendConversionCache = sendConversionCache; _operationProgressManager = operationProgressManager; _toSpeckleSettingsManager = toSpeckleSettingsManager; _logger = logger; _elementUnpacker = elementUnpacker; + _revitConversionSettingsFactory = revitConversionSettingsFactory; + _speckleApplication = speckleApplication; var topLevelExceptionHandler = Parent.TopLevelExceptionHandler; Commands = new SendBindingUICommands(bridge); @@ -85,7 +91,11 @@ public List GetSendFilters() } public List GetSendSettings() => - [new DetailLevelSetting(DetailLevelType.Medium), new ReferencePointSetting(ReferencePointType.InternalOrigin)]; + [ + new DetailLevelSetting(DetailLevelType.Medium), + new ReferencePointSetting(ReferencePointType.InternalOrigin), + new SendParameterNullOrEmptyStringsSetting(false) + ]; public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId); @@ -107,18 +117,20 @@ public async Task Send(string modelCardId) CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); - using IUnitOfWork> sendOperation = _unitOfWorkFactory.Resolve>( - b => - { - b.RegisterType().SingleInstance(); - b.Register(c => _toSpeckleSettingsManager.GetToSpeckleSettings(modelCard)); - } - ); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize( + _revitConversionSettingsFactory.Create( + _toSpeckleSettingsManager.GetDetailLevelSetting(modelCard), + _toSpeckleSettingsManager.GetReferencePointSetting(modelCard), + _toSpeckleSettingsManager.GetSendParameterNullOrEmptyStringsSetting(modelCard) + ) + ); var activeUIDoc = RevitContext.UIApplication?.ActiveUIDocument ?? throw new SpeckleException("Unable to retrieve active UI document"); - List revitObjects = modelCard .SendFilter.NotNull() .GetObjectIds() @@ -131,10 +143,11 @@ public async Task Send(string modelCardId) throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!"); } - var sendResult = await sendOperation - .Service.Execute( + var sendResult = await scope + .ServiceProvider.GetRequiredService>() + .Execute( revitObjects, - modelCard.GetSendInfo(Speckle.Connectors.Utils.Connector.Slug), + modelCard.GetSendInfo(_speckleApplication.Slug), (status, progress) => _operationProgressManager.SetModelProgress( Parent, diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs index 384b3d082..174131ee2 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Bindings/SelectionBinding.cs @@ -18,7 +18,7 @@ public SelectionBinding( RevitContext revitContext, DocumentModelStore store, IRevitIdleManager revitIdleManager, - IBridge parent + IBrowserBridge parent ) : base("selectionBinding", store, parent, revitContext) { diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs index c0f76b9d7..c93151223 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/DependencyInjection/RevitConnectorModule.cs @@ -1,8 +1,10 @@ using Autodesk.Revit.DB; -using Autofac; using CefSharp; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Connectors.Common; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; @@ -13,89 +15,84 @@ using Speckle.Connectors.Revit.Operations.Send; using Speckle.Connectors.Revit.Operations.Send.Settings; using Speckle.Connectors.Revit.Plugin; -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.Sdk.Models.GraphTraversal; namespace Speckle.Connectors.Revit.DependencyInjection; // POC: should interface out things that are not -public class RevitConnectorModule : ISpeckleModule +public static class ServiceRegistration { - public void Load(SpeckleContainerBuilder builder) + public static void AddRevit(this IServiceCollection serviceCollection) { - builder.AddAutofac(); - builder.AddConnectorUtils(); - builder.AddDUI(); - RegisterUiDependencies(builder); + serviceCollection.AddConnectorUtils(); + serviceCollection.AddDUI(); + RegisterUiDependencies(serviceCollection); - builder.AddSingletonInstance(); // register - builder.AddSingleton(); + serviceCollection.AddSingleton(); // Storage Schema - builder.AddScoped(); - builder.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); // POC: we need to review the scopes and create a document on what the policy is // and where the UoW should be // register UI bindings - builder.AddSingleton(); - builder.AddSingleton("connectorName", "Revit"); // POC: Easier like this for now, should be cleaned up later - builder.AddSingleton(); - builder.AddSingleton(); - builder.AddSingleton(); - // builder.AddSingleton(); // TODO: Have it back once we comfortable enough! - builder.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); - builder.ContainerBuilder.RegisterType().As().AsSelf().SingleInstance(); - builder.AddSingleton(c => - c.Resolve().Parent.TopLevelExceptionHandler - ); + serviceCollection.RegisterTopLevelExceptionHandler(); - builder - .ContainerBuilder.RegisterType() - .As() - .As() - .SingleInstance(); + serviceCollection.AddSingleton(sp => sp.GetRequiredService()); + serviceCollection.AddSingleton(); // send operation and dependencies - builder.AddScoped>(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped, RevitRootObjectBuilder>(); - builder.AddSingleton(); - builder.AddSingleton(); + serviceCollection.AddScoped>(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped, RevitRootObjectBuilder>(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); // receive operation and dependencies - builder.AddScoped(); - builder.AddScoped(); - builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(DefaultTraversal.CreateTraversalFunc()); + + serviceCollection.AddScoped(); // operation progress manager - builder.AddSingleton(); + serviceCollection.AddSingleton(); } - public void RegisterUiDependencies(SpeckleContainerBuilder builder) + public static void RegisterUiDependencies(IServiceCollection serviceCollection) { #if REVIT2022 //different versons for different versions of CEF - builder.AddSingleton(new BindingOptions() { CamelCaseJavascriptNames = false }); - builder.AddSingleton(); - builder.AddSingleton(c => c.Resolve()); - builder.AddSingleton(); + serviceCollection.AddSingleton(new BindingOptions() { CamelCaseJavascriptNames = false }); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(sp => sp.GetRequiredService()); + serviceCollection.AddSingleton(); #else - // POC: different versons for different versions of CEF - builder.AddSingleton(BindingOptions.DefaultBinder); + // different versions for different versions of CEF + serviceCollection.AddSingleton(BindingOptions.DefaultBinder); var panel = new CefSharpPanel(); panel.Browser.JavascriptObjectRepository.NameConverter = null; - builder.AddSingleton(panel); - builder.AddSingleton(c => c.Resolve()); - builder.AddSingleton(); + serviceCollection.AddSingleton(panel); + serviceCollection.AddSingleton(c => c.GetRequiredService()); + serviceCollection.AddSingleton(); #endif } } diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/ElementUnpacker.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/ElementUnpacker.cs index 4d0554eae..235aba240 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/ElementUnpacker.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/ElementUnpacker.cs @@ -132,6 +132,22 @@ public List GetElementsAndSubelementIdsFromAtomicObjects(List e } } break; + case FootPrintRoof footPrintRoof: + if (footPrintRoof.CurtainGrids is { } gs) + { + foreach (CurtainGrid roofGrid in gs) + { + foreach (var mullionId in roofGrid.GetMullionIds()) + { + ids.Add(mullionId.ToString()); + } + foreach (var panelId in roofGrid.GetPanelIds()) + { + ids.Add(panelId.ToString()); + } + } + } + break; default: break; } diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitGroupBaker.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitGroupBaker.cs new file mode 100644 index 000000000..81c2a8e4f --- /dev/null +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitGroupBaker.cs @@ -0,0 +1,133 @@ +using Autodesk.Revit.DB; +using Speckle.Connectors.Common.Operations.Receive; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Sdk.Models.GraphTraversal; + +namespace Speckle.Connectors.Revit.HostApp; + +/// +/// On receive, this class will help structure atomic objects into nested revit groups based on the hierarchy that they're coming from. Expects to be a scoped dependency per receive operation. +/// How to use: during atomic object conversion, on each succesful conversion call . Afterward, at the end of the recieve operation, call to actually create the groups in the revit document. +/// +public class RevitGroupBaker : TraversalContextUnpacker +{ + private readonly IConverterSettingsStore _converterSettings; + private readonly RevitUtils _revitUtils; + + public RevitGroupBaker(IConverterSettingsStore converterSettings, RevitUtils revitUtils) + { + _converterSettings = converterSettings; + _revitUtils = revitUtils; + } + + /// + /// Adds the object to the correct group in preparation for at the end of the receive operation. + /// + /// + /// + public void AddToGroupMapping(TraversalContext traversalContext, Element revitElement) + { + var collectionPath = GetCollectionPath(traversalContext); + var currentLayerName = string.Empty; + FakeGroup? previousGroup = null; + var currentDepth = 0; + + foreach (var collection in collectionPath) + { + currentLayerName += collection.name + "-"; + if (_groupCache.TryGetValue(currentLayerName, out var g)) + { + previousGroup = g; + currentDepth++; + continue; + } + + var group = new FakeGroup() + { + // POC group names should be unique + Name = _revitUtils.RemoveInvalidChars(currentLayerName[..^1]), + Depth = currentDepth++, + Parent = previousGroup! + }; + _groupCache[currentLayerName] = group; + previousGroup = group; + } + + previousGroup!.Ids.Add(revitElement.Id); + } + + private readonly Dictionary _groupCache = new(); + + /// + /// Bakes the accumulated groups in Revit, with their objects. + /// + /// + public void BakeGroups(string baseGroupName) + { + var orderedGroups = _groupCache.Values.OrderByDescending(group => group.Depth); + Group? lastGroup = null; + + foreach (var group in orderedGroups) + { + var docGroup = _converterSettings.Current.Document.Create.NewGroup(group.Ids); + group.Parent?.Ids.Add(docGroup.Id); + docGroup.GroupType.Name = group.Name; + lastGroup = docGroup; + } + + lastGroup!.GroupType.Name = _revitUtils.RemoveInvalidChars(baseGroupName); + } + + public void PurgeGroups(string baseGroupName) + { + var document = _converterSettings.Current.Document; + var groups = GetGroupsByName(document, baseGroupName); + + foreach (var group in groups) + { + List subgroupTypeIds = new List(); + CollectSubGroupTypeIds(document, group, subgroupTypeIds); + document.Delete(subgroupTypeIds); + } + } + + private List GetGroupsByName(Autodesk.Revit.DB.Document doc, string groupName) + { + var validGroupName = _revitUtils.RemoveInvalidChars(groupName); + + using (var collector = new FilteredElementCollector(doc)) + { + ICollection groupElements = collector.OfClass(typeof(Group)).ToElements(); + List groups = groupElements.Cast().Where(g => g.GroupType.Name == validGroupName).ToList(); + return groups; + } + } + + private void CollectSubGroupTypeIds(Autodesk.Revit.DB.Document document, Group group, List subGroupTypeIds) + { + ICollection groupMemberIds = group.GetMemberIds(); + + foreach (ElementId memberId in groupMemberIds) + { + Element element = document.GetElement(memberId); + + if (element is Group subgroup) + { + subGroupTypeIds.Add(subgroup.GroupType.Id); + CollectSubGroupTypeIds(document, subgroup, subGroupTypeIds); + } + } + } + + /// + /// Little intermediate data structure that helps with the operations above. + /// + private sealed class FakeGroup + { + public List Ids { get; set; } = new(); + public int Depth { get; set; } + public string Name { get; set; } + public FakeGroup Parent { get; set; } + } +} diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitMaterialBaker.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitMaterialBaker.cs new file mode 100644 index 000000000..d883c6c9c --- /dev/null +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitMaterialBaker.cs @@ -0,0 +1,166 @@ +using Autodesk.Revit.DB; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Operations.Receive; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Objects.Other; +using Speckle.Sdk; +using Speckle.Sdk.Models.Collections; +using Speckle.Sdk.Models.Extensions; +using Speckle.Sdk.Models.GraphTraversal; + +namespace Speckle.Connectors.Revit.HostApp; + +/// +/// Utility class that converts and bakes materials in Revit. Expects to be a scoped dependency per unit of work. +/// +public class RevitMaterialBaker +{ + private readonly IConverterSettingsStore _converterSettings; + private readonly ILogger _logger; + private readonly RevitUtils _revitUtils; + + public RevitMaterialBaker( + ILogger logger, + RevitUtils revitUtils, + IConverterSettingsStore converterSettings + ) + { + _logger = logger; + _revitUtils = revitUtils; + _converterSettings = converterSettings; + } + + /// + /// Checks the every atomic object has render material or not, if not it tries to find it from its layer tree and mutates + /// its render material proxy objects list with the traversal current. It will also map displayable objects' display values to their + /// respective material proxy. + /// + public void MapLayersRenderMaterials(RootObjectUnpackerResult unpackedRoot) + { + if (unpackedRoot.RenderMaterialProxies is null) + { + return; + } + + foreach (var context in unpackedRoot.ObjectsToConvert) + { + if (context.Current.applicationId is null) + { + continue; + } + + var targetRenderMaterialProxy = unpackedRoot.RenderMaterialProxies.FirstOrDefault(rmp => + rmp.objects.Contains(context.Current.applicationId) + ); + + if (targetRenderMaterialProxy is null) + { + var layerParents = context.GetAscendants().Where(parent => parent is Layer); + + var layer = layerParents.FirstOrDefault(layer => + unpackedRoot.RenderMaterialProxies.Any(rmp => rmp.objects.Contains(layer.applicationId!)) + ); + + if (layer is not null) + { + var layerRenderMaterialProxy = unpackedRoot.RenderMaterialProxies.First(rmp => + rmp.objects.Contains(layer.applicationId!) + ); + + targetRenderMaterialProxy = layerRenderMaterialProxy; + } + } + + if (targetRenderMaterialProxy is null) + { + continue; // exit fast, no proxy, we can't do much more. + } + // We mutate the existing proxy list that comes from source application. Because we do not keep track of parent-child relationship of objects in terms of render materials. + targetRenderMaterialProxy.objects.Add(context.Current.applicationId!); + + // This is somewhat evil: we're unpacking here displayable elements by adding their display value to the target render material proxy. + // If the display value items do not have an application id, we will generate one. + var displayable = context.Current.TryGetDisplayValue(); + if (displayable != null) + { + foreach (var @base in displayable) + { + if (@base.applicationId == null) + { + var guid = Guid.NewGuid().ToString(); + @base.applicationId = guid; + targetRenderMaterialProxy.objects.Add(guid); + } + else + { + targetRenderMaterialProxy.objects.Add(@base.applicationId); + } + } + } + } + } + + /// + /// Will bake render materials in the revit document. + /// + /// + /// + /// + public Dictionary BakeMaterials( + List speckleRenderMaterialProxies, + string baseLayerName + ) + { + Dictionary objectIdAndMaterialIndexMap = new(); + foreach (var proxy in speckleRenderMaterialProxies) + { + var speckleRenderMaterial = proxy.value; + + try + { + var diffuse = System.Drawing.Color.FromArgb(speckleRenderMaterial.diffuse); + double transparency = 1 - speckleRenderMaterial.opacity; + double smoothness = 1 - speckleRenderMaterial.roughness; + string materialId = speckleRenderMaterial.applicationId ?? speckleRenderMaterial.id; + string matName = _revitUtils.RemoveInvalidChars($"{speckleRenderMaterial.name}-({materialId})-{baseLayerName}"); + + var newMaterialId = Autodesk.Revit.DB.Material.Create(_converterSettings.Current.Document, matName); + var revitMaterial = (Autodesk.Revit.DB.Material)_converterSettings.Current.Document.GetElement(newMaterialId); + revitMaterial.Color = new Color(diffuse.R, diffuse.G, diffuse.B); + + revitMaterial.Transparency = (int)(transparency * 100); + revitMaterial.Shininess = (int)(speckleRenderMaterial.metalness * 128); + revitMaterial.Smoothness = (int)(smoothness * 128); + + foreach (var objectId in proxy.objects) + { + objectIdAndMaterialIndexMap[objectId] = revitMaterial.Id; + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to create material in Revit"); + } + } + + return objectIdAndMaterialIndexMap; + } + + public void PurgeMaterials(string baseGroupName) + { + var validBaseGroupName = _revitUtils.RemoveInvalidChars(baseGroupName); + var document = _converterSettings.Current.Document; + + using (var collector = new FilteredElementCollector(document)) + { + var materialIds = collector + .OfClass(typeof(Autodesk.Revit.DB.Material)) + .Where(m => m.Name.Contains(validBaseGroupName)) + .Select(m => m.Id) + .ToList(); + + document.Delete(materialIds); + } + } +} diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitUtils.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitUtils.cs new file mode 100644 index 000000000..59b9b9559 --- /dev/null +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/RevitUtils.cs @@ -0,0 +1,18 @@ +namespace Speckle.Connectors.Revit.HostApp; + +public class RevitUtils +{ + // see Revit Parameter Name Limitations here + // https://www.autodesk.com/support/technical/article/caas/tsarticles/ts/3RVyShGL7OMlDJPLasuKFL.html + private const string REVIT_INVALID_CHARS = @"\:{}[]|;<>?`~"; + + public string RemoveInvalidChars(string str) + { + foreach (char c in REVIT_INVALID_CHARS) + { + str = str.Replace(c.ToString(), string.Empty); + } + + return str; + } +} diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SendCollectionManager.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SendCollectionManager.cs index a73a65b9a..cd34cd8d3 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SendCollectionManager.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/HostApp/SendCollectionManager.cs @@ -1,5 +1,6 @@ using Autodesk.Revit.DB; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk.Models.Collections; namespace Speckle.Connectors.Revit.HostApp; @@ -9,12 +10,12 @@ namespace Speckle.Connectors.Revit.HostApp; /// public class SendCollectionManager { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly Dictionary _collectionCache = new(); - public SendCollectionManager(IRevitConversionContextStack contextStack) + public SendCollectionManager(IConverterSettingsStore converterSettings) { - _contextStack = contextStack; + _converterSettings = converterSettings; } /// @@ -26,7 +27,7 @@ public SendCollectionManager(IRevitConversionContextStack contextStack) /// public Collection GetAndCreateObjectHostCollection(Element element, Collection rootObject) { - var doc = _contextStack.Current.Document; + var doc = _converterSettings.Current.Document; var path = new List(); // Step 1: create path components. Currently, this is diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/HideWarningsFailuresPreprocessor.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/HideWarningsFailuresPreprocessor.cs new file mode 100644 index 000000000..d758e3f57 --- /dev/null +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/HideWarningsFailuresPreprocessor.cs @@ -0,0 +1,17 @@ +using Autodesk.Revit.DB; + +namespace Speckle.Connectors.Revit.Operations.Receive; + +/// +/// This class will suppress warnings on the Revit UI +/// Currently we use it after Revit receive when we create the group hierarchy +/// + +public class HideWarningsFailuresPreprocessor : IFailuresPreprocessor +{ + public FailureProcessingResult PreprocessFailures(FailuresAccessor failuresAccessor) + { + failuresAccessor.DeleteAllWarnings(); + return FailureProcessingResult.Continue; + } +} diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/ITransactionManager.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/ITransactionManager.cs index d698dfac0..76bf66776 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/ITransactionManager.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/ITransactionManager.cs @@ -9,5 +9,7 @@ public interface ITransactionManager : IDisposable void RollbackSubTransaction(); void RollbackTransaction(); void StartSubtransaction(); - void StartTransaction(); + + // POC improve how the error handling behaviour is selected + void StartTransaction(bool enableFailurePreprocessor = false); } diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitContextAccessor.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitContextAccessor.cs index d4d068d2f..297587790 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitContextAccessor.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitContextAccessor.cs @@ -1,5 +1,5 @@ using Revit.Async; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Operations; namespace Speckle.Connectors.Revit.Operations.Receive; diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs index 34abe5f20..dafc18681 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs @@ -1,42 +1,60 @@ using Autodesk.Revit.DB; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Operations; +using Microsoft.Extensions.Logging; +using Revit.Async; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Instances; +using Speckle.Connectors.Common.Operations.Receive; +using Speckle.Connectors.Revit.HostApp; using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk; using Speckle.Sdk.Logging; using Speckle.Sdk.Models; -using Speckle.Sdk.Models.Collections; -using Speckle.Sdk.Models.GraphTraversal; namespace Speckle.Connectors.Revit.Operations.Receive; -/// -/// Potentially consolidate all application specific IHostObjectBuilders -/// https://spockle.atlassian.net/browse/DUI3-465 -/// internal sealed class RevitHostObjectBuilder : IHostObjectBuilder, IDisposable { private readonly IRootToHostConverter _converter; - private readonly IRevitConversionContextStack _contextStack; - private readonly GraphTraversal _traverseFunction; + private readonly IConverterSettingsStore _converterSettings; + private readonly RevitMaterialCacheSingleton _revitMaterialCacheSingleton; private readonly ITransactionManager _transactionManager; - private readonly ISyncToThread _syncToThread; + private readonly ILocalToGlobalUnpacker _localToGlobalUnpacker; + private readonly LocalToGlobalConverterUtils _localToGlobalConverterUtils; + private readonly RevitGroupBaker _groupBaker; + private readonly RevitMaterialBaker _materialBaker; + private readonly ILogger _logger; + + private readonly RootObjectUnpacker _rootObjectUnpacker; + private readonly ISdkActivityFactory _activityFactory; public RevitHostObjectBuilder( IRootToHostConverter converter, - IRevitConversionContextStack contextStack, - GraphTraversal traverseFunction, + IConverterSettingsStore converterSettings, ITransactionManager transactionManager, - ISyncToThread syncToThread + ISdkActivityFactory activityFactory, + ILocalToGlobalUnpacker localToGlobalUnpacker, + LocalToGlobalConverterUtils localToGlobalConverterUtils, + RevitGroupBaker groupManager, + RevitMaterialBaker materialBaker, + RootObjectUnpacker rootObjectUnpacker, + ILogger logger, + RevitMaterialCacheSingleton revitMaterialCacheSingleton ) { _converter = converter; - _contextStack = contextStack; - _traverseFunction = traverseFunction; + _converterSettings = converterSettings; _transactionManager = transactionManager; - _syncToThread = syncToThread; + _localToGlobalUnpacker = localToGlobalUnpacker; + _localToGlobalConverterUtils = localToGlobalConverterUtils; + _groupBaker = groupManager; + _materialBaker = materialBaker; + _rootObjectUnpacker = rootObjectUnpacker; + _logger = logger; + _revitMaterialCacheSingleton = revitMaterialCacheSingleton; + _activityFactory = activityFactory; } public Task Build( @@ -46,55 +64,144 @@ public Task Build( Action? onOperationProgressed, CancellationToken cancellationToken ) => - _syncToThread.RunOnThread(() => + RevitTask.RunAsync(() => BuildSync(rootObject, projectName, modelName, onOperationProgressed, cancellationToken)); + + private HostObjectBuilderResult BuildSync( + Base rootObject, + string projectName, + string modelName, + Action? onOperationProgressed, + CancellationToken cancellationToken + ) + { + var baseGroupName = $"Project {projectName}: Model {modelName}"; // TODO: unify this across connectors! + + onOperationProgressed?.Invoke("Converting", null); + using var activity = _activityFactory.Start("Build"); + + // 0 - Clean then Rock n Roll! 🎸 + using TransactionGroup preReceiveCleanTransaction = new(_converterSettings.Current.Document, "Pre-receive clean"); + preReceiveCleanTransaction.Start(); + _transactionManager.StartTransaction(true); + + try { - using var activity = SpeckleActivityFactory.Start("Build"); - IEnumerable objectsToConvert; - using (var _ = SpeckleActivityFactory.Start("Traverse")) - { - objectsToConvert = _traverseFunction.Traverse(rootObject).Where(obj => obj.Current is not Collection); - } + PreReceiveDeepClean(baseGroupName); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to clean up before receive in Revit"); + } + + using (var _ = _activityFactory.Start("Commit")) + { + _transactionManager.CommitTransaction(); + preReceiveCleanTransaction.Assimilate(); + } - using TransactionGroup transactionGroup = - new(_contextStack.Current.Document, $"Received data from {projectName}"); - transactionGroup.Start(); - _transactionManager.StartTransaction(); + // 1 - Unpack objects and proxies from root commit object + var unpackedRoot = _rootObjectUnpacker.Unpack(rootObject); + var localToGlobalMaps = _localToGlobalUnpacker.Unpack( + unpackedRoot.DefinitionProxies, + unpackedRoot.ObjectsToConvert.ToList() + ); - var conversionResults = BakeObjects(objectsToConvert); + using TransactionGroup transactionGroup = + new(_converterSettings.Current.Document, $"Received data from {projectName}"); + transactionGroup.Start(); + _transactionManager.StartTransaction(); - using (var _ = SpeckleActivityFactory.Start("Commit")) + if (unpackedRoot.RenderMaterialProxies != null) + { + _materialBaker.MapLayersRenderMaterials(unpackedRoot); + // NOTE: do not set _contextStack.RenderMaterialProxyCache directly, things stop working. Ogu/Dim do not know why :) not a problem as we hopefully will refactor some of these hacks out. + var map = _materialBaker.BakeMaterials(unpackedRoot.RenderMaterialProxies, baseGroupName); + foreach (var kvp in map) { - _transactionManager.CommitTransaction(); - transactionGroup.Assimilate(); + _revitMaterialCacheSingleton.ObjectIdAndMaterialIndexMap.Add(kvp.Key, kvp.Value); } - return conversionResults; - }); + } - // POC: Potentially refactor out into an IObjectBaker. - private HostObjectBuilderResult BakeObjects(IEnumerable objectsGraph) - { - using (var _ = SpeckleActivityFactory.Start("BakeObjects")) + var conversionResults = BakeObjects(localToGlobalMaps, onOperationProgressed, cancellationToken); + + using (var _ = _activityFactory.Start("Commit")) { - var conversionResults = new List(); + _transactionManager.CommitTransaction(); + transactionGroup.Assimilate(); + } - // NOTE!!!! Add 'UniqueId' of the elements once we have receiving in place, otherwise highlight logic will fail. - var bakedObjectIds = new List(); + using TransactionGroup createGroupTransaction = new(_converterSettings.Current.Document, "Creating group"); + createGroupTransaction.Start(); + _transactionManager.StartTransaction(true); - foreach (TraversalContext tc in objectsGraph) + try + { + _groupBaker.BakeGroups(baseGroupName); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to create group after receiving elements in Revit"); + } + + using (var _ = _activityFactory.Start("Commit")) + { + _transactionManager.CommitTransaction(); + createGroupTransaction.Assimilate(); + } + + _revitMaterialCacheSingleton.ObjectIdAndMaterialIndexMap.Clear(); // Massive hack! + + return conversionResults; + } + + private HostObjectBuilderResult BakeObjects( + List localToGlobalMaps, + Action? onOperationProgressed, + CancellationToken cancellationToken + ) + { + using var _ = _activityFactory.Start("BakeObjects"); + var conversionResults = new List(); + var bakedObjectIds = new List(); + int count = 0; + + foreach (LocalToGlobalMap localToGlobalMap in localToGlobalMaps) + { + cancellationToken.ThrowIfCancellationRequested(); + try { - try + using var activity = _activityFactory.Start("BakeObject"); + var atomicObject = _localToGlobalConverterUtils.TransformObjects( + localToGlobalMap.AtomicObject, + localToGlobalMap.Matrix + ); + var result = _converter.Convert(atomicObject); + onOperationProgressed?.Invoke("Converting", (double)++count / localToGlobalMaps.Count); + + // Note: our current converter always returns a DS for now + if (result is DirectShape ds) { - using var activity = SpeckleActivityFactory.Start("BakeObject"); - var result = _converter.Convert(tc.Current); + bakedObjectIds.Add(ds.UniqueId.ToString()); + _groupBaker.AddToGroupMapping(localToGlobalMap.TraversalContext, ds); } - catch (Exception ex) when (!ex.IsFatal()) + else { - conversionResults.Add(new(Status.ERROR, tc.Current, null, null, ex)); + throw new SpeckleConversionException($"Failed to cast {result.GetType()} to Direct Shape."); } + conversionResults.Add(new(Status.SUCCESS, atomicObject, ds.UniqueId, "Direct Shape")); + } + catch (Exception ex) when (!ex.IsFatal()) + { + conversionResults.Add(new(Status.ERROR, localToGlobalMap.AtomicObject, null, null, ex)); } - - return new(bakedObjectIds, conversionResults); } + return new(bakedObjectIds, conversionResults); + } + + private void PreReceiveDeepClean(string baseGroupName) + { + _groupBaker.PurgeGroups(baseGroupName); + _materialBaker.PurgeMaterials(baseGroupName); } public void Dispose() diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/TransactionManager.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/TransactionManager.cs index aa2ec3153..2ed7f7ab5 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/TransactionManager.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/TransactionManager.cs @@ -1,5 +1,6 @@ using Autodesk.Revit.DB; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Connectors.Revit.Operations.Receive; @@ -9,12 +10,17 @@ namespace Speckle.Connectors.Revit.Operations.Receive; /// public sealed class TransactionManager : ITransactionManager { - private readonly IRevitConversionContextStack _contextStack; - private Document Document => _contextStack.Current.Document; + private readonly IConverterSettingsStore _converterSettings; + private readonly IFailuresPreprocessor _errorPreprocessingService; + private Document Document => _converterSettings.Current.Document; - public TransactionManager(IRevitConversionContextStack contextStack) + public TransactionManager( + IConverterSettingsStore converterSettings, + IFailuresPreprocessor errorPreprocessingService + ) { - _contextStack = contextStack; + _converterSettings = converterSettings; + _errorPreprocessingService = errorPreprocessingService; } // poc : these are being disposed. I'm not sure why I need to supress this warning @@ -23,17 +29,21 @@ public TransactionManager(IRevitConversionContextStack contextStack) private SubTransaction? _subTransaction; #pragma warning restore CA2213 // Disposable fields should be disposed - public void StartTransaction() + // POC find a better way to use IFailuresPreprocessor + public void StartTransaction(bool enableFailurePreprocessor = false) { if (_transaction == null || !_transaction.IsValidObject || _transaction.GetStatus() != TransactionStatus.Started) { _transaction = new Transaction(Document, "Speckle Transaction"); - var failOpts = _transaction.GetFailureHandlingOptions(); - // POC: make sure to implement and add the failure preprocessor - // https://spockle.atlassian.net/browse/DUI3-461 - //failOpts.SetFailuresPreprocessor(_errorPreprocessingService); - failOpts.SetClearAfterRollback(true); - _transaction.SetFailureHandlingOptions(failOpts); + + if (enableFailurePreprocessor) + { + var failOpts = _transaction.GetFailureHandlingOptions(); + failOpts.SetFailuresPreprocessor(_errorPreprocessingService); + failOpts.SetClearAfterRollback(true); + _transaction.SetFailureHandlingOptions(failOpts); + } + _transaction.Start(); } } diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs index b3b293e8c..b832de98f 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/RevitRootObjectBuilder.cs @@ -1,15 +1,17 @@ -using System.Diagnostics; using Autodesk.Revit.DB; using Microsoft.Extensions.Logging; +using Revit.Async; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Extensions; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Exceptions; using Speckle.Connectors.Revit.HostApp; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Extensions; -using Speckle.Connectors.Utils.Operations; using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Sdk; using Speckle.Sdk.Models; using Speckle.Sdk.Models.Collections; @@ -20,124 +22,124 @@ public class RevitRootObjectBuilder : IRootObjectBuilder { // POC: SendSelection and RevitConversionContextStack should be interfaces, former needs interfaces private readonly IRootToSpeckleConverter _converter; - private readonly IRevitConversionContextStack _conversionContextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly Collection _rootObject; private readonly ISendConversionCache _sendConversionCache; - private readonly ISyncToThread _syncToThread; private readonly ElementUnpacker _elementUnpacker; private readonly SendCollectionManager _sendCollectionManager; + private readonly RevitMaterialCacheSingleton _revitMaterialCacheSingleton; private readonly ILogger _logger; + private readonly ParameterDefinitionHandler _parameterDefinitionHandler; public RevitRootObjectBuilder( IRootToSpeckleConverter converter, - IRevitConversionContextStack conversionContextStack, + IConverterSettingsStore converterSettings, ISendConversionCache sendConversionCache, - ISyncToThread syncToThread, ElementUnpacker elementUnpacker, SendCollectionManager sendCollectionManager, - ILogger logger + ILogger logger, + ParameterDefinitionHandler parameterDefinitionHandler, + RevitMaterialCacheSingleton revitMaterialCacheSingleton ) { _converter = converter; - _conversionContextStack = conversionContextStack; + _converterSettings = converterSettings; _sendConversionCache = sendConversionCache; - _syncToThread = syncToThread; _elementUnpacker = elementUnpacker; _sendCollectionManager = sendCollectionManager; + _revitMaterialCacheSingleton = revitMaterialCacheSingleton; _logger = logger; + _parameterDefinitionHandler = parameterDefinitionHandler; _rootObject = new Collection() { - name = _conversionContextStack.Current.Document.PathName.Split('\\').Last().Split('.').First() + name = _converterSettings.Current.Document.PathName.Split('\\').Last().Split('.').First() }; + _rootObject["units"] = _converterSettings.Current.SpeckleUnits; } - public Task Build( + public async Task Build( IReadOnlyList objects, SendInfo sendInfo, Action? onOperationProgressed = null, CancellationToken ct = default - ) => - _syncToThread.RunOnThread(() => - { - var doc = _conversionContextStack.Current.Document; + ) + { + var doc = _converterSettings.Current.Document; - if (doc.IsFamilyDocument) - { - throw new SpeckleException("Family Environment documents are not supported."); - } + if (doc.IsFamilyDocument) + { + throw new SpeckleException("Family Environment documents are not supported."); + } - var revitElements = new List(); + var revitElements = new List(); - // Convert ids to actual revit elements - foreach (var id in objects) + // Convert ids to actual revit elements + foreach (var id in objects) + { + var el = _converterSettings.Current.Document.GetElement(id); + if (el != null) { - var el = _conversionContextStack.Current.Document.GetElement(id); - if (el != null) - { - revitElements.Add(el); - } + revitElements.Add(el); } + } - if (revitElements.Count == 0) - { - throw new SpeckleSendFilterException("No objects were found. Please update your send filter!"); - } + if (revitElements.Count == 0) + { + throw new SpeckleSendFilterException("No objects were found. Please update your send filter!"); + } - // Unpack groups (& other complex data structures) - var atomicObjects = _elementUnpacker.UnpackSelectionForConversion(revitElements).ToList(); + List results = new(revitElements.Count); - var countProgress = 0; - var cacheHitCount = 0; - List results = new(revitElements.Count); + // Unpack groups (& other complex data structures) + var atomicObjects = _elementUnpacker.UnpackSelectionForConversion(revitElements).ToList(); - foreach (Element revitElement in atomicObjects) + var countProgress = 0; + var cacheHitCount = 0; + + foreach (Element revitElement in atomicObjects) + { + ct.ThrowIfCancellationRequested(); + string applicationId = revitElement.UniqueId; + string sourceType = revitElement.GetType().Name; + try { - ct.ThrowIfCancellationRequested(); - string applicationId = revitElement.UniqueId; // NOTE: converter set applicationIds to unique ids; if we ever change this in the converter, behaviour here needs to match. - string sourceType = revitElement.GetType().Name; - try + Base converted; + if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value)) { - Base converted; - if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value)) - { - converted = value; - cacheHitCount++; - } - else - { - converted = _converter.Convert(revitElement); - converted.applicationId = applicationId; - } - - var collection = _sendCollectionManager.GetAndCreateObjectHostCollection(revitElement, _rootObject); - collection.elements.Add(converted); - results.Add(new(Status.SUCCESS, applicationId, sourceType, converted)); + converted = value; + cacheHitCount++; } - catch (Exception ex) when (!ex.IsFatal()) + else { - _logger.LogSendConversionError(ex, sourceType); - results.Add(new(Status.ERROR, applicationId, sourceType, null, ex)); + converted = await RevitTask.RunAsync(() => _converter.Convert(revitElement)).ConfigureAwait(false); // Could we run these batched? Is there maybe a performance penalty for running these to speckle conversions individually in revittask.runasync? + converted.applicationId = applicationId; } - onOperationProgressed?.Invoke("Converting", (double)++countProgress / atomicObjects.Count); + var collection = _sendCollectionManager.GetAndCreateObjectHostCollection(revitElement, _rootObject); + collection.elements.Add(converted); + results.Add(new(Status.SUCCESS, applicationId, sourceType, converted)); } - - if (results.All(x => x.Status == Status.ERROR)) + catch (Exception ex) when (!ex.IsFatal()) { - throw new SpeckleConversionException("Failed to convert all objects."); // fail fast instead creating empty commit! It will appear as model card error with red color. + _logger.LogSendConversionError(ex, sourceType); + results.Add(new(Status.ERROR, applicationId, sourceType, null, ex)); } - var idsAndSubElementIds = _elementUnpacker.GetElementsAndSubelementIdsFromAtomicObjects(atomicObjects); - var materialProxies = _conversionContextStack.RenderMaterialProxyCache.GetRenderMaterialProxyListForObjects( - idsAndSubElementIds - ); - _rootObject["renderMaterialProxies"] = materialProxies; + onOperationProgressed?.Invoke("Converting", (double)++countProgress / atomicObjects.Count); + } + + if (results.All(x => x.Status == Status.ERROR)) + { + throw new SpeckleConversionException("Failed to convert all objects."); + } - Debug.WriteLine( - $"Cache hit count {cacheHitCount} out of {objects.Count} ({(double)cacheHitCount / objects.Count})" - ); + var idsAndSubElementIds = _elementUnpacker.GetElementsAndSubelementIdsFromAtomicObjects(atomicObjects); + var materialProxies = _revitMaterialCacheSingleton.GetRenderMaterialProxyListForObjects(idsAndSubElementIds); + _rootObject[ProxyKeys.RENDER_MATERIAL] = materialProxies; + // NOTE: these are currently not used anywhere, so we could even skip them (?). + _rootObject[ProxyKeys.PARAMETER_DEFINITIONS] = _parameterDefinitionHandler.Definitions; - return new RootObjectBuilderResult(_rootObject, results); - }); + return new RootObjectBuilderResult(_rootObject, results); + } } diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/SendParameterNullOrEmptyStringsSetting.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/SendParameterNullOrEmptyStringsSetting.cs new file mode 100644 index 000000000..390502256 --- /dev/null +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/SendParameterNullOrEmptyStringsSetting.cs @@ -0,0 +1,12 @@ +using Speckle.Connectors.DUI.Settings; + +namespace Speckle.Connectors.Revit.Operations.Send.Settings; + +public class SendParameterNullOrEmptyStringsSetting(bool value) : ICardSetting +{ + public string? Id { get; set; } = "nullemptyparams"; + public string? Title { get; set; } = "Send null/empty parameters"; + public string? Type { get; set; } = "boolean"; + public List? Enum { get; set; } + public object? Value { get; set; } = value; +} diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/ToSpeckleSettingsManager.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/ToSpeckleSettingsManager.cs index 15f20855d..9c2bac4fe 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/ToSpeckleSettingsManager.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Send/Settings/ToSpeckleSettingsManager.cs @@ -1,15 +1,17 @@ using Autodesk.Revit.DB; using Autodesk.Revit.UI; +using Speckle.Connectors.Common.Caching; using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.Revit.HostApp; -using Speckle.Connectors.Utils.Caching; using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Settings; +using Speckle.InterfaceGenerator; using Speckle.Sdk.Common; namespace Speckle.Connectors.Revit.Operations.Send.Settings; -public class ToSpeckleSettingsManager +[GenerateAutoInterface] +public class ToSpeckleSettingsManager : IToSpeckleSettingsManager { private readonly RevitContext _revitContext; private readonly ISendConversionCache _sendConversionCache; @@ -18,6 +20,7 @@ public class ToSpeckleSettingsManager // cache invalidation process run with ModelCardId since the settings are model specific private readonly Dictionary _detailLevelCache = new(); private readonly Dictionary _referencePointCache = new(); + private readonly Dictionary _sendNullParamsCache = new(); public ToSpeckleSettingsManager( RevitContext revitContext, @@ -30,15 +33,7 @@ ElementUnpacker elementUnpacker _sendConversionCache = sendConversionCache; } - public ToSpeckleSettings GetToSpeckleSettings(SenderModelCard modelCard) - { - DetailLevelType detailLevel = GetDetailLevelSetting(modelCard); - Transform? referencePointTransform = GetReferencePointSetting(modelCard); - - return new ToSpeckleSettings(detailLevel, referencePointTransform); - } - - private DetailLevelType GetDetailLevelSetting(SenderModelCard modelCard) + public DetailLevelType GetDetailLevelSetting(SenderModelCard modelCard) { var fidelityString = modelCard.Settings?.First(s => s.Id == "detailLevel").Value as string; if ( @@ -50,9 +45,7 @@ fidelityString is not null { if (previousType != fidelity) { - var objectIds = modelCard.SendFilter != null ? modelCard.SendFilter.GetObjectIds() : []; - var unpackedObjectIds = _elementUnpacker.GetUnpackedElementIds(objectIds); - _sendConversionCache.EvictObjects(unpackedObjectIds); + EvictCacheForModelCard(modelCard); } } _detailLevelCache[modelCard.ModelCardId.NotNull()] = fidelity; @@ -62,7 +55,7 @@ fidelityString is not null throw new ArgumentException($"Invalid geometry fidelity value: {fidelityString}"); } - private Transform? GetReferencePointSetting(SenderModelCard modelCard) + public Transform? GetReferencePointSetting(SenderModelCard modelCard) { var referencePointString = modelCard.Settings?.First(s => s.Id == "referencePoint").Value as string; if ( @@ -82,9 +75,7 @@ out ReferencePointType referencePoint // invalidate conversion cache if the transform has changed if (previousTransform != currentTransform) { - var objectIds = modelCard.SendFilter != null ? modelCard.SendFilter.GetObjectIds() : []; - var unpackedObjectIds = _elementUnpacker.GetUnpackedElementIds(objectIds); - _sendConversionCache.EvictObjects(unpackedObjectIds); + EvictCacheForModelCard(modelCard); } } @@ -95,6 +86,29 @@ out ReferencePointType referencePoint throw new ArgumentException($"Invalid reference point value: {referencePointString}"); } + public bool GetSendParameterNullOrEmptyStringsSetting(SenderModelCard modelCard) + { + var value = modelCard.Settings?.First(s => s.Id == "nullemptyparams").Value as bool?; + var returnValue = value != null && value.NotNull(); + if (_sendNullParamsCache.TryGetValue(modelCard.ModelCardId.NotNull(), out bool? previousValue)) + { + if (previousValue != returnValue) + { + EvictCacheForModelCard(modelCard); + } + } + + _sendNullParamsCache[modelCard.ModelCardId] = returnValue; + return returnValue; + } + + private void EvictCacheForModelCard(SenderModelCard modelCard) + { + var objectIds = modelCard.SendFilter != null ? modelCard.SendFilter.GetObjectIds() : []; + var unpackedObjectIds = _elementUnpacker.GetUnpackedElementIds(objectIds); + _sendConversionCache.EvictObjects(unpackedObjectIds); + } + private Transform? GetTransform(RevitContext context, ReferencePointType referencePointType) { Transform? referencePointTransform = null; diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitCefPlugin.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitCefPlugin.cs index 6653aecbe..30b5bb5a3 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitCefPlugin.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitCefPlugin.cs @@ -6,10 +6,11 @@ using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.UI; using CefSharp; +using Microsoft.Extensions.DependencyInjection; using Revit.Async; +using Speckle.Connectors.Common; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; -using Speckle.Connectors.Utils; using Speckle.Converters.RevitShared.Helpers; using Speckle.Sdk; @@ -18,24 +19,27 @@ namespace Speckle.Connectors.Revit.Plugin; internal sealed class RevitCefPlugin : IRevitPlugin { private readonly UIControlledApplication _uIControlledApplication; - private readonly IEnumerable> _bindings; // should be lazy to ensure the bindings are not created too early + private readonly IServiceProvider _serviceProvider; // should be lazy to ensure the bindings are not created too early private readonly BindingOptions _bindingOptions; private readonly RevitContext _revitContext; private readonly CefSharpPanel _cefSharpPanel; + private readonly ISpeckleApplication _speckleApplication; public RevitCefPlugin( UIControlledApplication uIControlledApplication, - IEnumerable> bindings, + IServiceProvider serviceProvider, BindingOptions bindingOptions, RevitContext revitContext, - CefSharpPanel cefSharpPanel + CefSharpPanel cefSharpPanel, + ISpeckleApplication speckleApplication ) { _uIControlledApplication = uIControlledApplication; - _bindings = bindings; + _serviceProvider = serviceProvider; _bindingOptions = bindingOptions; _revitContext = revitContext; _cefSharpPanel = cefSharpPanel; + _speckleApplication = speckleApplication; } public void Initialise() @@ -70,7 +74,7 @@ private void CreateTabAndRibbonPanel(UIControlledApplication application) var dui3Button = (PushButton) specklePanel.AddItem( new PushButtonData( - Connector.Name, + _speckleApplication.HostApplication, Connector.TabTitle, typeof(RevitExternalApplication).Assembly.Location, typeof(SpeckleRevitCommand).FullName @@ -78,13 +82,16 @@ private void CreateTabAndRibbonPanel(UIControlledApplication application) ); string path = typeof(RevitCefPlugin).Assembly.Location; - dui3Button.Image = LoadPngImgSource($"Speckle.Connectors.Revit{Connector.VersionString}.Assets.logo16.png", path); + dui3Button.Image = LoadPngImgSource( + $"Speckle.Connectors.Revit{_speckleApplication.HostApplicationVersion}.Assets.logo16.png", + path + ); dui3Button.LargeImage = LoadPngImgSource( - $"Speckle.Connectors.Revit{Connector.VersionString}.Assets.logo32.png", + $"Speckle.Connectors.Revit{_speckleApplication.HostApplicationVersion}.Assets.logo32.png", path ); dui3Button.ToolTipImage = LoadPngImgSource( - $"Speckle.Connectors.Revit{Connector.VersionString}.Assets.logo32.png", + $"Speckle.Connectors.Revit{_speckleApplication.HostApplicationVersion}.Assets.logo32.png", path ); dui3Button.ToolTip = "Speckle (Beta) for Revit"; @@ -108,8 +115,9 @@ private void OnApplicationInitialized(object? sender, Autodesk.Revit.DB.Events.A /// private void PostApplicationInit() { + var bindings = _serviceProvider.GetRequiredService>(); // binding the bindings to each bridge - foreach (IBinding binding in _bindings.Select(x => x.Value)) + foreach (IBinding binding in bindings) { Debug.WriteLine(binding.Name); binding.Parent.AssociateWithBinding(binding); @@ -122,12 +130,12 @@ private void PostApplicationInit() return; } -#if DEBUG +#if DEBUG || LOCAL _cefSharpPanel.Browser.ShowDevTools(); #endif - foreach (IBinding binding in _bindings.Select(x => x.Value)) + foreach (IBinding binding in bindings) { - IBridge bridge = binding.Parent; + IBrowserBridge bridge = binding.Parent; #if REVIT2025_OR_GREATER _cefSharpPanel.Browser.JavascriptObjectRepository.Register(bridge.FrontendBoundName, bridge, _bindingOptions); diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs index 2b29e0a68..0cd5c1b60 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitExternalApplication.cs @@ -1,11 +1,11 @@ -using System.IO; -using System.Reflection; using Autodesk.Revit.UI; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; -using Speckle.Connectors.Utils; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common; +using Speckle.Connectors.DUI; +using Speckle.Connectors.Revit.DependencyInjection; +using Speckle.Converters.RevitShared; using Speckle.Sdk; -using Speckle.Sdk.Common; using Speckle.Sdk.Host; namespace Speckle.Connectors.Revit.Plugin; @@ -14,7 +14,7 @@ internal sealed class RevitExternalApplication : IExternalApplication { private IRevitPlugin? _revitPlugin; - private SpeckleContainer? _container; + private ServiceProvider? _container; private IDisposable? _disposableLogger; // POC: move to somewhere central? @@ -41,23 +41,25 @@ public Result OnStartup(UIControlledApplication application) { // POC: not sure what this is doing... could be messing up our Aliasing???? AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.OnAssemblyResolve; + var services = new ServiceCollection(); // init DI - _disposableLogger = Connector.Initialize(HostApplications.Revit, GetVersion()); - _container = SpeckleContainerBuilder - .CreateInstance() - .LoadAutofacModules( - Assembly.GetExecutingAssembly(), - [Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull()] - ) - .AddSingleton(application) // inject UIControlledApplication application - .Build(); + _disposableLogger = services.Initialize(HostApplications.Revit, GetVersion()); + services.AddRevit(); + services.AddRevitConverters(); + services.AddSingleton(application); + _container = services.BuildServiceProvider(); + _container.UseDUI(); // resolve root object - _revitPlugin = _container.Resolve(); + _revitPlugin = _container.GetRequiredService(); _revitPlugin.Initialise(); } catch (Exception e) when (!e.IsFatal()) { + _container + .GetRequiredService() + .CreateLogger() + .LogCritical(e, "Unhandled exception"); // POC: feedback? return Result.Failed; } @@ -74,6 +76,7 @@ public Result OnShutdown(UIControlledApplication application) // need to look for commonality _revitPlugin?.Shutdown(); _disposableLogger?.Dispose(); + _container?.Dispose(); } catch (Exception e) when (!e.IsFatal()) { diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitWebViewPlugin.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitWebViewPlugin.cs index e9b205548..5f6e3b135 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitWebViewPlugin.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Plugin/RevitWebViewPlugin.cs @@ -7,7 +7,7 @@ using Autodesk.Revit.UI; using Revit.Async; using Speckle.Connectors.DUI.WebView; -using Speckle.Connectors.Utils; +using Speckle.Connectors.Common; using Speckle.Converters.RevitShared.Helpers; using Speckle.Sdk; @@ -18,6 +18,7 @@ internal sealed class RevitWebViewPlugin : IRevitPlugin private readonly UIControlledApplication _uIControlledApplication; private readonly RevitContext _revitContext; private readonly DUI3ControlWebViewDockable _webViewPanel; + private readonly ISpeckleApplication _speckleApplication; [System.Diagnostics.CodeAnalysis.SuppressMessage( "Style", @@ -27,12 +28,14 @@ internal sealed class RevitWebViewPlugin : IRevitPlugin public RevitWebViewPlugin( UIControlledApplication uIControlledApplication, RevitContext revitContext, - DUI3ControlWebViewDockable webViewPanel + DUI3ControlWebViewDockable webViewPanel, + ISpeckleApplication speckleApplication ) { _uIControlledApplication = uIControlledApplication; _revitContext = revitContext; _webViewPanel = webViewPanel; + _speckleApplication = speckleApplication; } public void Initialise() @@ -75,13 +78,16 @@ private void CreateTabAndRibbonPanel(UIControlledApplication application) ); string path = typeof(RevitWebViewPlugin).Assembly.Location; - dui3Button.Image = LoadPngImgSource($"Speckle.Connectors.Revit{Connector.VersionString}.Assets.logo16.png", path); + dui3Button.Image = LoadPngImgSource( + $"Speckle.Connectors.Revit{_speckleApplication.HostApplicationVersion}.Assets.logo16.png", + path + ); dui3Button.LargeImage = LoadPngImgSource( - $"Speckle.Connectors.Revit{Connector.VersionString}.Assets.logo32.png", + $"Speckle.Connectors.Revit{_speckleApplication.HostApplicationVersion}.Assets.logo32.png", path ); dui3Button.ToolTipImage = LoadPngImgSource( - $"Speckle.Connectors.Revit{Connector.VersionString}.Assets.logo32.png", + $"Speckle.Connectors.Revit{_speckleApplication.HostApplicationVersion}.Assets.logo32.png", path ); dui3Button.ToolTip = "Speckle (Beta) for Revit"; diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems b/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems index 561a2f5d2..e4e01eb32 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Speckle.Connectors.RevitShared.projitems @@ -22,10 +22,14 @@ + + + + @@ -33,6 +37,7 @@ + diff --git a/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj b/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj index 2ff7dd71d..7f5b6168c 100644 --- a/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj +++ b/Connectors/Rhino/Speckle.Connectors.Rhino7/Speckle.Connectors.Rhino7.csproj @@ -12,11 +12,8 @@ - - - - - + + diff --git a/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json b/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json index cd98d287d..d8bdfd8c6 100644 --- a/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json +++ b/Connectors/Rhino/Speckle.Connectors.Rhino7/packages.lock.json @@ -71,14 +71,6 @@ "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", @@ -108,59 +100,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -196,11 +179,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -233,22 +211,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -262,8 +240,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -275,32 +253,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -310,24 +264,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -338,28 +289,14 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.converters.rhino7": { @@ -369,38 +306,32 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.rhino7.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Rhino7": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -410,29 +341,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Rhino/Speckle.Connectors.Rhino8/Speckle.Connectors.Rhino8.csproj b/Connectors/Rhino/Speckle.Connectors.Rhino8/Speckle.Connectors.Rhino8.csproj index 6b25de79e..6d1450e11 100644 --- a/Connectors/Rhino/Speckle.Connectors.Rhino8/Speckle.Connectors.Rhino8.csproj +++ b/Connectors/Rhino/Speckle.Connectors.Rhino8/Speckle.Connectors.Rhino8.csproj @@ -7,16 +7,13 @@ - - + + - - - - - + + diff --git a/Connectors/Rhino/Speckle.Connectors.Rhino8/packages.lock.json b/Connectors/Rhino/Speckle.Connectors.Rhino8/packages.lock.json index 75d40892b..b7832193a 100644 --- a/Connectors/Rhino/Speckle.Connectors.Rhino8/packages.lock.json +++ b/Connectors/Rhino/Speckle.Connectors.Rhino8/packages.lock.json @@ -71,14 +71,6 @@ "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", @@ -108,59 +100,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -196,11 +179,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -233,22 +211,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -262,8 +240,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -275,32 +253,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -310,24 +264,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -338,28 +289,14 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.converters.rhino8": { @@ -369,38 +306,32 @@ "Speckle.Converters.Common": "[1.0.0, )" } }, - "speckle.converters.rhino8.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Rhino8": "[1.0.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -410,29 +341,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs index df990fa46..32596d9cc 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoBasicConnectorBinding.cs @@ -6,7 +6,7 @@ using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.Rhino.Extensions; -using Speckle.Connectors.Utils.Common; +using Speckle.Sdk; using Speckle.Sdk.Common; namespace Speckle.Connectors.Rhino.Bindings; @@ -14,15 +14,21 @@ namespace Speckle.Connectors.Rhino.Bindings; public class RhinoBasicConnectorBinding : IBasicConnectorBinding { public string Name => "baseBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } public BasicConnectorBindingCommands Commands { get; } private readonly DocumentModelStore _store; + private readonly ISpeckleApplication _speckleApplication; - public RhinoBasicConnectorBinding(DocumentModelStore store, IBridge parent) + public RhinoBasicConnectorBinding( + DocumentModelStore store, + IBrowserBridge parent, + ISpeckleApplication speckleApplication + ) { _store = store; Parent = parent; + _speckleApplication = speckleApplication; Commands = new BasicConnectorBindingCommands(parent); _store.DocumentChanged += (_, _) => @@ -31,11 +37,11 @@ public RhinoBasicConnectorBinding(DocumentModelStore store, IBridge parent) }; } - public string GetConnectorVersion() => typeof(RhinoBasicConnectorBinding).Assembly.GetVersion(); + public string GetConnectorVersion() => _speckleApplication.SpeckleVersion; - public string GetSourceApplicationName() => Speckle.Connectors.Utils.Connector.Slug; + public string GetSourceApplicationName() => _speckleApplication.Slug; - public string GetSourceApplicationVersion() => "7"; + public string GetSourceApplicationVersion() => _speckleApplication.HostApplicationVersion; public DocumentInfo? GetDocumentInfo() { diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoReceiveBinding.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoReceiveBinding.cs index 79a560e31..a5b1e0e2a 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoReceiveBinding.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoReceiveBinding.cs @@ -1,13 +1,16 @@ -using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Rhino; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Logging; using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.Common; +using Speckle.Converters.Rhino; using Speckle.Sdk; namespace Speckle.Connectors.Rhino.Bindings; @@ -15,29 +18,35 @@ namespace Speckle.Connectors.Rhino.Bindings; public class RhinoReceiveBinding : IReceiveBinding { public string Name => "receiveBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly CancellationManager _cancellationManager; private readonly DocumentModelStore _store; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; + private readonly IRhinoConversionSettingsFactory _rhinoConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; private ReceiveBindingUICommands Commands { get; } public RhinoReceiveBinding( DocumentModelStore store, CancellationManager cancellationManager, - IBridge parent, - IUnitOfWorkFactory unitOfWorkFactory, + IBrowserBridge parent, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + IRhinoConversionSettingsFactory rhinoConversionSettingsFactory, + IServiceProvider serviceProvider, + ISpeckleApplication speckleApplication ) { Parent = parent; _store = store; - _unitOfWorkFactory = unitOfWorkFactory; _operationProgressManager = operationProgressManager; _logger = logger; + _rhinoConversionSettingsFactory = rhinoConversionSettingsFactory; + _serviceProvider = serviceProvider; + _speckleApplication = speckleApplication; _cancellationManager = cancellationManager; Commands = new ReceiveBindingUICommands(parent); } @@ -46,7 +55,10 @@ ILogger logger public async Task Receive(string modelCardId) { - using var unitOfWork = _unitOfWorkFactory.Resolve(); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_rhinoConversionSettingsFactory.Create(RhinoDoc.ActiveDoc)); try { // Get receiver card @@ -59,9 +71,10 @@ public async Task Receive(string modelCardId) CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); // Receive host objects - HostObjectBuilderResult conversionResults = await unitOfWork - .Service.Execute( - modelCard.GetReceiveInfo(Speckle.Connectors.Utils.Connector.Slug), + HostObjectBuilderResult conversionResults = await scope + .ServiceProvider.GetRequiredService() + .Execute( + modelCard.GetReceiveInfo(_speckleApplication.Slug), cancellationToken, (status, progress) => _operationProgressManager.SetModelProgress( diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSelectionBinding.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSelectionBinding.cs index de9f85973..f5fc16c08 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSelectionBinding.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSelectionBinding.cs @@ -12,9 +12,9 @@ public class RhinoSelectionBinding : ISelectionBinding private const string SELECTION_EVENT = "setSelection"; public string Name => "selectionBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } - public RhinoSelectionBinding(IRhinoIdleManager idleManager, IBridge parent) + public RhinoSelectionBinding(IRhinoIdleManager idleManager, IBrowserBridge parent) { _idleManager = idleManager; Parent = parent; diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSendBinding.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSendBinding.cs index b33869068..d7912654a 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSendBinding.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Bindings/RhinoSendBinding.cs @@ -1,9 +1,12 @@ using System.Collections.Concurrent; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Rhino; using Rhino.Commands; using Rhino.DocObjects; -using Speckle.Autofac.DependencyInjection; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Exceptions; @@ -13,9 +16,8 @@ using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Settings; using Speckle.Connectors.Rhino.HostApp; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Operations; +using Speckle.Converters.Common; +using Speckle.Converters.Rhino; using Speckle.Sdk; using Speckle.Sdk.Common; @@ -25,17 +27,19 @@ public sealed class RhinoSendBinding : ISendBinding { public string Name => "sendBinding"; public SendBindingUICommands Commands { get; } - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private readonly DocumentModelStore _store; private readonly IRhinoIdleManager _idleManager; - private readonly IUnitOfWorkFactory _unitOfWorkFactory; + private readonly IServiceProvider _serviceProvider; private readonly List _sendFilters; private readonly CancellationManager _cancellationManager; private readonly ISendConversionCache _sendConversionCache; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; private readonly ITopLevelExceptionHandler _topLevelExceptionHandler; + private readonly IRhinoConversionSettingsFactory _rhinoConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; /// /// Used internally to aggregate the changed objects' id. Note we're using a concurrent dictionary here as the expiry check method is not thread safe, and this was causing problems. See: @@ -48,23 +52,27 @@ public sealed class RhinoSendBinding : ISendBinding public RhinoSendBinding( DocumentModelStore store, IRhinoIdleManager idleManager, - IBridge parent, + IBrowserBridge parent, IEnumerable sendFilters, - IUnitOfWorkFactory unitOfWorkFactory, + IServiceProvider serviceProvider, CancellationManager cancellationManager, ISendConversionCache sendConversionCache, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + IRhinoConversionSettingsFactory rhinoConversionSettingsFactory, + ISpeckleApplication speckleApplication ) { _store = store; _idleManager = idleManager; - _unitOfWorkFactory = unitOfWorkFactory; + _serviceProvider = serviceProvider; _sendFilters = sendFilters.ToList(); _cancellationManager = cancellationManager; _sendConversionCache = sendConversionCache; _operationProgressManager = operationProgressManager; _logger = logger; + _rhinoConversionSettingsFactory = rhinoConversionSettingsFactory; + _speckleApplication = speckleApplication; _topLevelExceptionHandler = parent.TopLevelExceptionHandler.Parent.TopLevelExceptionHandler; Parent = parent; Commands = new SendBindingUICommands(parent); // POC: Commands are tightly coupled with their bindings, at least for now, saves us injecting a factory. @@ -146,7 +154,10 @@ private void SubscribeToRhinoEvents() public async Task Send(string modelCardId) { - using var unitOfWork = _unitOfWorkFactory.Resolve>(); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_rhinoConversionSettingsFactory.Create(RhinoDoc.ActiveDoc)); try { if (_store.GetModelById(modelCardId) is not SenderModelCard modelCard) @@ -170,10 +181,11 @@ public async Task Send(string modelCardId) throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!"); } - var sendResult = await unitOfWork - .Service.Execute( + var sendResult = await scope + .ServiceProvider.GetRequiredService>() + .Execute( rhinoObjects, - modelCard.GetSendInfo(Speckle.Connectors.Utils.Connector.Slug), + modelCard.GetSendInfo(_speckleApplication.Slug), (status, progress) => _operationProgressManager.SetModelProgress( Parent, diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/DependencyInjection/RhinoConnectorModule.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/DependencyInjection/RhinoConnectorModule.cs deleted file mode 100644 index 7af8e17df..000000000 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/DependencyInjection/RhinoConnectorModule.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Autofac; -using Rhino.Commands; -using Rhino.DocObjects; -using Rhino.PlugIns; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; -using Speckle.Connectors.DUI; -using Speckle.Connectors.DUI.Bindings; -using Speckle.Connectors.DUI.Bridge; -using Speckle.Connectors.DUI.Models; -using Speckle.Connectors.DUI.Models.Card.SendFilter; -using Speckle.Connectors.DUI.WebView; -using Speckle.Connectors.Rhino.Bindings; -using Speckle.Connectors.Rhino.Filters; -using Speckle.Connectors.Rhino.HostApp; -using Speckle.Connectors.Rhino.Operations.Receive; -using Speckle.Connectors.Rhino.Operations.Send; -using Speckle.Connectors.Rhino.Plugin; -using Speckle.Connectors.Utils; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Instances; -using Speckle.Connectors.Utils.Operations; -using Speckle.Sdk.Models.GraphTraversal; - -namespace Speckle.Connectors.Rhino.DependencyInjection; - -public class RhinoConnectorModule : ISpeckleModule -{ - public void Load(SpeckleContainerBuilder builder) - { - // Register instances initialised by Rhino - builder.AddSingleton(SpeckleConnectorsRhinoPlugin.Instance); - builder.AddSingleton(SpeckleConnectorsRhinoCommand.Instance); - - builder.AddAutofac(); - builder.AddConnectorUtils(); - builder.AddDUI(); - builder.AddDUIView(); - - // POC: Overwriting the SyncToMainThread to SyncToCurrentThread for Rhino! - builder.AddSingletonInstance(); - - // Register other connector specific types - builder.AddSingleton(); - builder.AddSingleton(); - builder.AddSingleton(); - - // Register bindings - builder.AddSingleton(); - builder.AddSingleton("connectorName", "Rhino"); // POC: Easier like this for now, should be cleaned up later - builder.AddSingleton(); - - builder.ContainerBuilder.RegisterType().As().AsSelf().SingleInstance(); - builder.AddSingleton(c => - c.Resolve().Parent.TopLevelExceptionHandler - ); - - builder - .ContainerBuilder.RegisterType() - .As() - .As() - .SingleInstance(); - - builder.AddSingleton(); - builder.AddSingleton(); - builder.AddSingleton(); - - // binding dependencies - builder.AddTransient(); - - // register send filters - builder.AddScoped(); - builder.AddScoped(); - - // register send conversion cache - builder.AddSingleton(); - - // register send operation and dependencies - builder.AddScoped>(); - builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); - - builder.AddScoped, RhinoRootObjectBuilder>(); - builder.AddScoped< - IInstanceObjectsManager>, - InstanceObjectsManager> - >(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - - // operation progress manager - builder.AddSingleton(); - } -} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorBaker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorBaker.cs new file mode 100644 index 000000000..7c1f38fd8 --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorBaker.cs @@ -0,0 +1,63 @@ +using Microsoft.Extensions.Logging; +using Rhino.DocObjects; +using Speckle.Sdk; +using Speckle.Sdk.Models.Proxies; + +namespace Speckle.Connectors.Rhino.HostApp; + +public class RhinoColorBaker +{ + private readonly ILogger _logger; + + public RhinoColorBaker(ILogger logger) + { + _logger = logger; + } + + /// + /// For receive operations + /// + public Dictionary ObjectColorsIdMap { get; } = new(); + + /// + /// Parse Color Proxies and stores in ObjectColorsIdMap the relationship between object ids and colors + /// + /// + public void ParseColors(List colorProxies) + { + foreach (ColorProxy colorProxy in colorProxies) + { + try + { + ObjectColorSource source = ObjectColorSource.ColorFromObject; + if (colorProxy["source"] is string proxySource) + { + switch (proxySource) + { + case "layer": + continue; // skip any colors with source = layer, since object color default source is by layer + case "block": + source = ObjectColorSource.ColorFromParent; + break; + case "material": + source = ObjectColorSource.ColorFromMaterial; + break; + } + } + + foreach (string objectId in colorProxy.objects) + { + Color convertedColor = Color.FromArgb(colorProxy.value); + if (!ObjectColorsIdMap.TryGetValue(objectId, out (Color, ObjectColorSource) _)) + { + ObjectColorsIdMap.Add(objectId, (convertedColor, source)); + } + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Error parsing color proxy"); // TODO: Check with Jedd! + } + } + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorManager.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorUnpacker.cs similarity index 66% rename from Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorManager.cs rename to Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorUnpacker.cs index 857f6b4ee..11b87fba1 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorManager.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoColorUnpacker.cs @@ -1,19 +1,20 @@ +using Microsoft.Extensions.Logging; using Rhino; using Rhino.DocObjects; using Speckle.Connectors.Rhino.Extensions; +using Speckle.Sdk; using Speckle.Sdk.Models.Proxies; namespace Speckle.Connectors.Rhino.HostApp; -/// -/// Utility class managing colors on objects and layers. Expects to be a scoped dependency per send or receive operation. -/// -public class RhinoColorManager +public class RhinoColorUnpacker { - /// - /// For receive operations - /// - public Dictionary ObjectColorsIdMap { get; } = new(); + private readonly ILogger _logger; + + public RhinoColorUnpacker(ILogger logger) + { + _logger = logger; + } /// /// For send operations @@ -65,7 +66,14 @@ private ColorProxy ConvertColorToColorProxy(Color color, ObjectColorSource sourc string id = color.GetSpeckleApplicationId(source); string? name = color.IsNamedColor ? color.Name : null; - ColorProxy colorProxy = new(argb, id, name) { objects = new() }; + ColorProxy colorProxy = + new() + { + value = argb, + applicationId = id, + name = name, + objects = new() + }; // add the color source as well for receiving in other apps // POC: in order to have high-fidelity color props, we need to send the source somewhere. Currently this is attached to the color proxy, but have discussed sending it as a separate proxy or as an property on the atomic object. TBD if this is the best place for it. @@ -98,55 +106,34 @@ public List UnpackColors(List atomicObjects, List - /// Parse Color Proxies and stores in ObjectColorsIdMap the relationship between object ids and colors - /// - /// - public void ParseColors(List colorProxies) - { - foreach (ColorProxy colorProxy in colorProxies) - { - ObjectColorSource source = ObjectColorSource.ColorFromObject; - if (colorProxy["source"] is string proxySource) + try { - switch (proxySource) - { - case "layer": - continue; // skip any colors with source = layer, since object color default source is by layer - case "block": - source = ObjectColorSource.ColorFromParent; - break; - case "material": - source = ObjectColorSource.ColorFromMaterial; - break; - } + ProcessObjectColor(layer.Id.ToString(), layer.Color, ObjectColorSource.ColorFromObject); } - - foreach (string objectId in colorProxy.objects) + catch (Exception ex) when (!ex.IsFatal()) { - Color convertedColor = Color.FromArgb(colorProxy.value); - if (!ObjectColorsIdMap.TryGetValue(objectId, out (Color, ObjectColorSource) _)) - { - ObjectColorsIdMap.Add(objectId, (convertedColor, source)); - } + _logger.LogError(ex, "Failed to unpack colors from Rhino Layer"); } } + + return ColorProxies.Values.ToList(); } } diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupBaker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupBaker.cs new file mode 100644 index 000000000..fcf52d524 --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupBaker.cs @@ -0,0 +1,67 @@ +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common; +using Speckle.Converters.Rhino; +using Speckle.Sdk; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models.Proxies; + +namespace Speckle.Connectors.Rhino.HostApp; + +public class RhinoGroupBaker +{ + private readonly IConverterSettingsStore _converterSettings; + private readonly ILogger _logger; + private readonly ISdkActivityFactory _activityFactory; + + public RhinoGroupBaker( + IConverterSettingsStore converterSettings, + ILogger logger, + ISdkActivityFactory activityFactory + ) + { + _converterSettings = converterSettings; + _logger = logger; + _activityFactory = activityFactory; + } + + public void BakeGroups( + List groupProxies, + Dictionary> applicationIdMap, + string baseLayerName + ) + { + using var _ = _activityFactory.Start(); + foreach (GroupProxy groupProxy in groupProxies.OrderBy(g => g.objects.Count)) + { + try + { + var appIds = groupProxy.objects.SelectMany(oldObjId => applicationIdMap[oldObjId]).Select(id => new Guid(id)); + var groupName = (groupProxy.name ?? "No Name Group") + $" ({baseLayerName})"; + _converterSettings.Current.Document.Groups.Add(groupName, appIds); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to bake Rhino Group"); + } + } + } + + public void PurgeGroups(string baseLayerName) + { + for (int i = _converterSettings.Current.Document.Groups.Count; i >= 0; i--) + { + try + { + var group = _converterSettings.Current.Document.Groups.FindIndex(i); + if (group is { Name: not null } && group.Name.Contains(baseLayerName)) + { + _converterSettings.Current.Document.Groups.Delete(i); + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to purge Rhino Group"); + } + } + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupManager.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupManager.cs deleted file mode 100644 index c1b626041..000000000 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupManager.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Rhino; -using Rhino.DocObjects; -using Speckle.Converters.Common; -using Speckle.Sdk.Logging; -using Speckle.Sdk.Models.Proxies; - -namespace Speckle.Connectors.Rhino.HostApp; - -/// -/// Unpacks the group lists for each object and sub-objects. -/// POC: Split me into group unpacker and group baker classes please! -/// It should be in scoped lifetime. -/// -public class RhinoGroupManager // POC: later make it more clean with RhinoGroupUnpacker Packer??? + see same POC comments in instance managers -{ - private readonly IConversionContextStack _contextStack; - - public RhinoGroupManager(IConversionContextStack contextStack) - { - _contextStack = contextStack; - } - - public Dictionary GroupProxies { get; } = new(); - - public void UnpackGroups(IEnumerable rhinoObjects) - { - foreach (RhinoObject rhinoObject in rhinoObjects) - { - if (rhinoObject is InstanceObject instanceObject) - { - UnpackGroups(instanceObject.GetSubObjects()); - } - var groupList = rhinoObject.GetGroupList(); - if (groupList is null) - { - continue; - } - var groups = groupList.Select(gi => RhinoDoc.ActiveDoc.Groups.FindIndex(gi)); - foreach (Group group in groups) - { - if (GroupProxies.TryGetValue(group.Id.ToString(), out GroupProxy? groupProxy)) - { - groupProxy.objects.Add(rhinoObject.Id.ToString()); - } - else - { - GroupProxies[group.Id.ToString()] = new GroupProxy() - { - applicationId = group.Id.ToString(), - name = group.Name, - objects = [rhinoObject.Id.ToString()] - }; - } - } - } - } - - public void BakeGroups( - List groupProxies, - Dictionary> applicationIdMap, - string baseLayerName - ) - { - using var _ = SpeckleActivityFactory.Start(); - foreach (GroupProxy groupProxy in groupProxies.OrderBy(g => g.objects.Count)) - { - var appIds = groupProxy.objects.SelectMany(oldObjId => applicationIdMap[oldObjId]).Select(id => new Guid(id)); - var groupName = (groupProxy.name ?? "No Name Group") + $" ({baseLayerName})"; - _contextStack.Current.Document.Groups.Add(groupName, appIds); - } - } - - public void PurgeGroups(string baseLayerName) - { - for (int i = _contextStack.Current.Document.Groups.Count; i >= 0; i--) - { - var group = _contextStack.Current.Document.Groups.FindIndex(i); - if (group is { Name: not null } && group.Name.Contains(baseLayerName)) - { - _contextStack.Current.Document.Groups.Delete(i); - } - } - } -} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupUnpacker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupUnpacker.cs new file mode 100644 index 000000000..dc478db23 --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoGroupUnpacker.cs @@ -0,0 +1,59 @@ +using Microsoft.Extensions.Logging; +using Rhino; +using Rhino.DocObjects; +using Speckle.Sdk; +using Speckle.Sdk.Models.Proxies; + +namespace Speckle.Connectors.Rhino.HostApp; + +public class RhinoGroupUnpacker +{ + private readonly ILogger _logger; + + public RhinoGroupUnpacker(ILogger logger) + { + _logger = logger; + } + + public Dictionary GroupProxies { get; } = new(); + + public void UnpackGroups(IEnumerable rhinoObjects) + { + foreach (RhinoObject rhinoObject in rhinoObjects) + { + try + { + if (rhinoObject is InstanceObject instanceObject) + { + UnpackGroups(instanceObject.GetSubObjects()); + } + var groupList = rhinoObject.GetGroupList(); + if (groupList is null) + { + continue; + } + var groups = groupList.Select(gi => RhinoDoc.ActiveDoc.Groups.FindIndex(gi)); + foreach (Group group in groups) + { + if (GroupProxies.TryGetValue(group.Id.ToString(), out GroupProxy? groupProxy)) + { + groupProxy.objects.Add(rhinoObject.Id.ToString()); + } + else + { + GroupProxies[group.Id.ToString()] = new GroupProxy() + { + applicationId = group.Id.ToString(), + name = group.Name, + objects = [rhinoObject.Id.ToString()] + }; + } + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed on unpacking Rhino group"); + } + } + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceObjectsManager.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceBaker.cs similarity index 58% rename from Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceObjectsManager.cs rename to Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceBaker.cs index fc189e9d8..c3c971ba6 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceObjectsManager.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceBaker.cs @@ -1,9 +1,10 @@ +using Microsoft.Extensions.Logging; using Rhino; using Rhino.DocObjects; using Rhino.Geometry; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Instances; using Speckle.Connectors.Rhino.Extensions; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Instances; using Speckle.DoubleNumerics; using Speckle.Sdk; using Speckle.Sdk.Common; @@ -13,116 +14,24 @@ namespace Speckle.Connectors.Rhino.HostApp; -/// -/// Expects to be a scoped dependency per send or receive operation. -/// POC: Split later unpacker and baker. -/// -public class RhinoInstanceObjectsManager : IInstanceUnpacker, IInstanceBaker> +public class RhinoInstanceBaker : IInstanceBaker> { - private readonly RhinoLayerManager _layerManager; - private readonly RhinoMaterialManager _materialManager; - private readonly RhinoColorManager _colorManager; - private readonly IInstanceObjectsManager> _instanceObjectsManager; - - public RhinoInstanceObjectsManager( - RhinoLayerManager layerManager, - RhinoMaterialManager materialManager, - RhinoColorManager colorManager, - IInstanceObjectsManager> instanceObjectsManager + private readonly RhinoMaterialBaker _materialBaker; + private readonly RhinoLayerBaker _layerBaker; + private readonly RhinoColorBaker _colorBaker; + private readonly ILogger _logger; + + public RhinoInstanceBaker( + RhinoLayerBaker layerBaker, + RhinoMaterialBaker rhinoMaterialBaker, + RhinoColorBaker colorBaker, + ILogger logger ) { - _layerManager = layerManager; - _materialManager = materialManager; - _colorManager = colorManager; - _instanceObjectsManager = instanceObjectsManager; - } - - public UnpackResult UnpackSelection(IEnumerable objects) - { - foreach (var obj in objects) - { - if (obj is InstanceObject instanceObject) - { - UnpackInstance(instanceObject); - } - _instanceObjectsManager.AddAtomicObject(obj.Id.ToString(), obj); - } - return _instanceObjectsManager.GetUnpackResult(); - } - - 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 - - InstanceProxy instanceProxy = - new() - { - applicationId = instanceId, - definitionId = instance.InstanceDefinition.Id.ToString(), - transform = XFormToMatrix(instance.InstanceXform), - maxDepth = depth, - units = currentDoc.ModelUnitSystem.ToSpeckleString() - }; - _instanceObjectsManager.AddInstanceProxy(instanceId, instanceProxy); - - // 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 ( - !_instanceObjectsManager.TryGetInstanceProxiesFromDefinitionId( - instanceDefinitionId, - out List instanceProxiesWithSameDefinition - ) - ) - { - instanceProxiesWithSameDefinition = new List(); - _instanceObjectsManager.AddInstanceProxiesByDefinitionId(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 instanceProxyWithSameDefinition in instanceProxiesWithSameDefinition) - { - if (instanceProxyWithSameDefinition.maxDepth < depth) - { - instanceProxyWithSameDefinition.maxDepth = depth; - } - } - - instanceProxiesWithSameDefinition.Add(_instanceObjectsManager.GetInstanceProxy(instanceId)); - - if (_instanceObjectsManager.TryGetInstanceDefinitionProxy(instanceDefinitionId, out InstanceDefinitionProxy value)) - { - int depthDifference = depth - value.maxDepth; - if (depthDifference > 0) - { - // all MaxDepth of children definitions and its instances should be increased with difference of depth - _instanceObjectsManager.UpdateChildrenMaxDepth(value, depthDifference); - } - return; - } - - var definition = new InstanceDefinitionProxy - { - applicationId = instanceDefinitionId, - objects = new List(), - maxDepth = depth, - name = instance.InstanceDefinition.Name, - ["description"] = instance.InstanceDefinition.Description - }; - - _instanceObjectsManager.AddDefinitionProxy(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); - } - _instanceObjectsManager.AddAtomicObject(obj.Id.ToString(), obj); - } + _layerBaker = layerBaker; + _materialBaker = rhinoMaterialBaker; + _colorBaker = colorBaker; + _logger = logger; } /// @@ -209,18 +118,18 @@ instanceOrDefinition is InstanceProxy instanceProxy var transform = MatrixToTransform(instanceProxy.transform, instanceProxy.units); // POC: having layer creation during instance bake means no render materials!! - int layerIndex = _layerManager.GetAndCreateLayerFromPath(layerCollection, baseLayerName, out bool _); + int layerIndex = _layerBaker.GetAndCreateLayerFromPath(layerCollection, baseLayerName); string instanceProxyId = instanceProxy.applicationId ?? instanceProxy.id; ObjectAttributes atts = new() { LayerIndex = layerIndex }; - if (_materialManager.ObjectIdAndMaterialIndexMap.TryGetValue(instanceProxyId, out int mIndex)) + if (_materialBaker.ObjectIdAndMaterialIndexMap.TryGetValue(instanceProxyId, out int mIndex)) { atts.MaterialIndex = mIndex; atts.MaterialSource = ObjectMaterialSource.MaterialFromObject; } - if (_colorManager.ObjectColorsIdMap.TryGetValue(instanceProxyId, out (Color, ObjectColorSource) color)) + if (_colorBaker.ObjectColorsIdMap.TryGetValue(instanceProxyId, out (Color, ObjectColorSource) color)) { atts.ObjectColor = color.Item1; atts.ColorSource = color.Item2; @@ -240,6 +149,7 @@ instanceOrDefinition is InstanceProxy instanceProxy } catch (Exception ex) when (!ex.IsFatal()) { + _logger.LogError(ex, "Failed to create an instance from proxy"); conversionResults.Add(new(Status.ERROR, instanceOrDefinition as Base ?? new Base(), null, null, ex)); } } @@ -259,9 +169,6 @@ public void PurgeInstances(string namePrefix) } } - 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 diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceUnpacker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceUnpacker.cs new file mode 100644 index 000000000..ed1c812ee --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoInstanceUnpacker.cs @@ -0,0 +1,131 @@ +using Microsoft.Extensions.Logging; +using Rhino; +using Rhino.DocObjects; +using Rhino.Geometry; +using Speckle.Connectors.Common.Instances; +using Speckle.Connectors.Rhino.Extensions; +using Speckle.DoubleNumerics; +using Speckle.Sdk; +using Speckle.Sdk.Models.Instances; + +namespace Speckle.Connectors.Rhino.HostApp; + +public class RhinoInstanceUnpacker : IInstanceUnpacker +{ + private readonly IInstanceObjectsManager> _instanceObjectsManager; + private readonly ILogger _logger; + + public RhinoInstanceUnpacker( + IInstanceObjectsManager> instanceObjectsManager, + ILogger logger + ) + { + _instanceObjectsManager = instanceObjectsManager; + _logger = logger; + } + + public UnpackResult UnpackSelection(IEnumerable objects) + { + foreach (var obj in objects) + { + if (obj is InstanceObject instanceObject) + { + UnpackInstance(instanceObject); + } + _instanceObjectsManager.AddAtomicObject(obj.Id.ToString(), obj); + } + return _instanceObjectsManager.GetUnpackResult(); + } + + private void UnpackInstance(InstanceObject instance, int depth = 0) + { + try + { + var instanceId = instance.Id.ToString(); + var instanceDefinitionId = instance.InstanceDefinition.Id.ToString(); + var currentDoc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around + + InstanceProxy instanceProxy = + new() + { + applicationId = instanceId, + definitionId = instance.InstanceDefinition.Id.ToString(), + transform = XFormToMatrix(instance.InstanceXform), + maxDepth = depth, + units = currentDoc.ModelUnitSystem.ToSpeckleString() + }; + _instanceObjectsManager.AddInstanceProxy(instanceId, instanceProxy); + + // 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 ( + !_instanceObjectsManager.TryGetInstanceProxiesFromDefinitionId( + instanceDefinitionId, + out List? instanceProxiesWithSameDefinition + ) + ) + { + instanceProxiesWithSameDefinition = new List(); + _instanceObjectsManager.AddInstanceProxiesByDefinitionId( + 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 instanceProxyWithSameDefinition in instanceProxiesWithSameDefinition) + { + if (instanceProxyWithSameDefinition.maxDepth < depth) + { + instanceProxyWithSameDefinition.maxDepth = depth; + } + } + + instanceProxiesWithSameDefinition.Add(_instanceObjectsManager.GetInstanceProxy(instanceId)); + + if ( + _instanceObjectsManager.TryGetInstanceDefinitionProxy(instanceDefinitionId, out InstanceDefinitionProxy? value) + ) + { + int depthDifference = depth - value.maxDepth; + if (depthDifference > 0) + { + // all MaxDepth of children definitions and its instances should be increased with difference of depth + _instanceObjectsManager.UpdateChildrenMaxDepth(value, depthDifference); + } + + return; + } + + var definition = new InstanceDefinitionProxy + { + applicationId = instanceDefinitionId, + objects = new List(), + maxDepth = depth, + name = instance.InstanceDefinition.Name, + ["description"] = instance.InstanceDefinition.Description + }; + + _instanceObjectsManager.AddDefinitionProxy(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); + } + + _instanceObjectsManager.AddAtomicObject(obj.Id.ToString(), obj); + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed unpacking Rhino instance"); + } + } + + 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); +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerBaker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerBaker.cs new file mode 100644 index 000000000..14f4b62ea --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerBaker.cs @@ -0,0 +1,93 @@ +using Rhino; +using Rhino.DocObjects; +using Speckle.Connectors.Common.Operations.Receive; +using Speckle.Sdk.Models.Collections; +using Layer = Rhino.DocObjects.Layer; + +namespace Speckle.Connectors.Rhino.HostApp; + +/// +/// Utility class managing layer creation. Expects to be a scoped dependency per receive operation. +/// +public class RhinoLayerBaker : TraversalContextUnpacker +{ + private readonly RhinoMaterialBaker _materialBaker; + private readonly RhinoColorBaker _colorBaker; + private readonly Dictionary _hostLayerCache = new(); + + public RhinoLayerBaker(RhinoMaterialBaker materialBaker, RhinoColorBaker colorBaker) + { + _materialBaker = materialBaker; + _colorBaker = colorBaker; + } + + /// + /// 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 + _hostLayerCache.Add(baseLayerName, index); + } + + /// + /// For receive: Use this method to construct layers in the host app when receiving. It progressively caches layers while creating them, so a second call to get the same layer will be fast. + /// + public int GetAndCreateLayerFromPath(Collection[] collectionPath, string baseLayerName) + { + var layerPath = collectionPath.Select(o => string.IsNullOrWhiteSpace(o.name) ? "unnamed" : o.name); + var layerFullName = string.Join(Layer.PathSeparator, layerPath); + + if (_hostLayerCache.TryGetValue(layerFullName, out int existingLayerIndex)) + { + return existingLayerIndex; + } + + var currentLayerName = baseLayerName; + var currentDocument = RhinoDoc.ActiveDoc; // POC: too much effort right now to wrap around the interfaced layers + Layer previousLayer = currentDocument.Layers.FindName(currentLayerName); + + foreach (Collection collection in collectionPath) + { + currentLayerName += Layer.PathSeparator + collection.name; + 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 = collection.name.Replace("{", "").Replace("}", ""); + Layer newLayer = new() { Name = cleanNewLayerName, ParentLayerId = previousLayer.Id }; + + // set material + if ( + _materialBaker.ObjectIdAndMaterialIndexMap.TryGetValue( + collection.applicationId ?? collection.id, + out int mIndex + ) + ) + { + newLayer.RenderMaterialIndex = mIndex; + } + + // set color + if ( + _colorBaker.ObjectColorsIdMap.TryGetValue( + collection.applicationId ?? collection.id, + out (Color, ObjectColorSource) color + ) + ) + { + newLayer.Color = color.Item1; + } + + int 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; + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerManager.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerManager.cs deleted file mode 100644 index e1b335db7..000000000 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerManager.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System.Diagnostics.Contracts; -using Rhino; -using Rhino.DocObjects; -using Speckle.Sdk.Models.Collections; -using Speckle.Sdk.Models.GraphTraversal; -using Layer = Rhino.DocObjects.Layer; -using SpeckleLayer = Speckle.Sdk.Models.Collections.Layer; - -namespace Speckle.Connectors.Rhino.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 RhinoMaterialManager _materialManager; - private readonly RhinoColorManager _colorManager; - private readonly Dictionary _hostLayerCache = new(); - private readonly Dictionary _layerCollectionCache = new(); - - public RhinoLayerManager(RhinoMaterialManager materialManager, RhinoColorManager colorManager) - { - _materialManager = materialManager; - _colorManager = colorManager; - } - - /// - /// 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. It progressively caches layers while creating them, so a second call to get the same layer will be fast. - /// - public int GetAndCreateLayerFromPath(Collection[] collectionPath, string baseLayerName, out bool isNewLayer) - { - isNewLayer = true; - var layerPath = collectionPath.Select(o => string.IsNullOrWhiteSpace(o.name) ? "unnamed" : o.name); - var layerFullName = string.Join(Layer.PathSeparator, layerPath); - - if (_hostLayerCache.TryGetValue(layerFullName, out int existingLayerIndex)) - { - isNewLayer = false; - return existingLayerIndex; - } - - var currentLayerName = baseLayerName; - var currentDocument = RhinoDoc.ActiveDoc; // POC: too much effort right now to wrap around the interfaced layers - Layer previousLayer = currentDocument.Layers.FindName(currentLayerName); - foreach (Collection collection in collectionPath) - { - currentLayerName += Layer.PathSeparator + collection.name; - 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 = collection.name.Replace("{", "").Replace("}", ""); - Layer newLayer = new() { Name = cleanNewLayerName, ParentLayerId = previousLayer.Id }; - - // set material - if ( - _materialManager.ObjectIdAndMaterialIndexMap.TryGetValue( - collection.applicationId ?? collection.id, - out int mIndex - ) - ) - { - newLayer.RenderMaterialIndex = mIndex; - } - - // set color - if ( - _colorManager.ObjectColorsIdMap.TryGetValue( - collection.applicationId ?? collection.id, - out (Color, ObjectColorSource) color - ) - ) - { - newLayer.Color = color.Item1; - } - - int 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 SpeckleLayer(layerName) - { - 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; - } - - /// - /// Gets the full path of the layer, concatenated with Rhino's Layer. - /// - /// - /// - [Pure] - //POC test me! - public Collection[] GetLayerPath(TraversalContext context) - { - Collection[] collectionBasedPath = context.GetAscendantOfType().Reverse().ToArray(); - - Collection[] collectionPath = - collectionBasedPath.Length != 0 - ? collectionBasedPath - : context - .GetPropertyPath() - .Reverse() - .Select(o => new Collection() { applicationId = Guid.NewGuid().ToString(), name = o }) - .ToArray(); - - return collectionPath; - } -} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerUnpacker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerUnpacker.cs new file mode 100644 index 000000000..229eaf779 --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoLayerUnpacker.cs @@ -0,0 +1,65 @@ +using Rhino; +using Speckle.Sdk.Models.Collections; +using Layer = Rhino.DocObjects.Layer; +using SpeckleLayer = Speckle.Sdk.Models.Collections.Layer; + +namespace Speckle.Connectors.Rhino.HostApp; + +/// +/// Utility class managing layer extraction. Expects to be a scoped dependency per send operation. +/// +public class RhinoLayerUnpacker +{ + private readonly Dictionary _layerCollectionCache = new(); + + /// + /// 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 SpeckleLayer(layerName) + { + 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/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialBaker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialBaker.cs new file mode 100644 index 000000000..e89ca6ee8 --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialBaker.cs @@ -0,0 +1,112 @@ +using Microsoft.Extensions.Logging; +using Rhino; +using Speckle.Converters.Common; +using Speckle.Converters.Rhino; +using Speckle.Objects.Other; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Material = Rhino.DocObjects.Material; + +namespace Speckle.Connectors.Rhino.HostApp; + +public class RhinoMaterialBaker +{ + private readonly IConverterSettingsStore _converterSettings; + private readonly ILogger _logger; + + public RhinoMaterialBaker( + IConverterSettingsStore converterSettings, + ILogger logger + ) + { + _converterSettings = converterSettings; + _logger = logger; + } + + /// + /// A map keeping track of ids, either layer id or object id, and their material index. It's generated from the material proxy list as we bake materials; must be called in advance for this to be populated with the correct data. + /// + public Dictionary ObjectIdAndMaterialIndexMap { get; } = new(); + + public void BakeMaterials(List speckleRenderMaterialProxies, string baseLayerName) + { + var doc = _converterSettings.Current.Document; // POC: too much right now to interface around + // List conversionResults = new(); // TODO: return this guy + + foreach (var proxy in speckleRenderMaterialProxies) + { + var speckleRenderMaterial = proxy.value; + + try + { + // POC: Currently we're relying on the render material name for identification if it's coming from speckle and from which model; could we do something else? + string materialId = speckleRenderMaterial.applicationId ?? speckleRenderMaterial.id; + string matName = $"{speckleRenderMaterial.name}-({materialId})-{baseLayerName}"; + matName = matName.Replace("[", "").Replace("]", ""); // "Material" doesn't like square brackets if we create from here. Once they created from Rhino UI, all good.. + Color diffuse = Color.FromArgb(speckleRenderMaterial.diffuse); + Color emissive = Color.FromArgb(speckleRenderMaterial.emissive); + double transparency = 1 - speckleRenderMaterial.opacity; + + Material rhinoMaterial = + new() + { + Name = matName, + DiffuseColor = diffuse, + EmissionColor = emissive, + Transparency = transparency + }; + + // try to get additional properties + if (speckleRenderMaterial["ior"] is double ior) + { + rhinoMaterial.IndexOfRefraction = ior; + } + if (speckleRenderMaterial["shine"] is double shine) + { + rhinoMaterial.Shine = shine; + } + + int matIndex = doc.Materials.Add(rhinoMaterial); + + // POC: check on matIndex -1, means we haven't created anything - this is most likely an recoverable error at this stage + if (matIndex == -1) + { + throw new ConversionException("Failed to add a material to the document."); + } + + // Create the object <> material index map + foreach (var objectId in proxy.objects) + { + ObjectIdAndMaterialIndexMap[objectId] = matIndex; + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to add a material to the document"); + } + } + } + + /// + /// Removes all materials with a name starting with from the active document + /// + /// + public void PurgeMaterials(string namePrefix) + { + var currentDoc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around + foreach (Material material in currentDoc.Materials) + { + try + { + if (!material.IsDeleted && material.Name != null && material.Name.Contains(namePrefix)) + { + currentDoc.Materials.Delete(material); + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to purge a material from the document"); + } + } + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs deleted file mode 100644 index 3a0e93780..000000000 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialManager.cs +++ /dev/null @@ -1,235 +0,0 @@ -using Rhino; -using Rhino.DocObjects; -using Rhino.Render; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Converters.Common; -using Speckle.Objects.Other; -using Speckle.Sdk; -using Speckle.Sdk.Common; -using Material = Rhino.DocObjects.Material; -using PhysicallyBasedMaterial = Rhino.DocObjects.PhysicallyBasedMaterial; -using RenderMaterial = Rhino.Render.RenderMaterial; -using SpeckleRenderMaterial = Speckle.Objects.Other.RenderMaterial; - -namespace Speckle.Connectors.Rhino.HostApp; - -/// -/// Utility class managing layer creation and/or extraction from rhino. Expects to be a scoped dependency per send or receive operation. -/// -public class RhinoMaterialManager -{ - private readonly IConversionContextStack _contextStack; - - public RhinoMaterialManager(IConversionContextStack contextStack) - { - _contextStack = contextStack; - } - - // converts a rhino material to a rhino render material - private RenderMaterial ConvertMaterialToRenderMaterial(Material material) - { - // get physically based render material - Material pbMaterial = material; - if (!material.IsPhysicallyBased) - { - pbMaterial = new(); - pbMaterial.CopyFrom(material); - pbMaterial.ToPhysicallyBased(); - } - - return RenderMaterial.FromMaterial(pbMaterial, null); - } - - private SpeckleRenderMaterial ConvertRenderMaterialToSpeckle(RenderMaterial renderMaterial) - { - PhysicallyBasedMaterial pbRenderMaterial = renderMaterial.ConvertToPhysicallyBased( - RenderTexture.TextureGeneration.Allow - ); - - // get opacity - // POC: pbr will return opacity = 0 for these because they are not pbr materials, they are transparent materials with IOR. Currently hardcoding 0.2 value in lieu of proper type support in rhino. - double opacity = (renderMaterial.SmellsLikeGem || renderMaterial.SmellsLikeGlass) ? 0.2 : pbRenderMaterial.Opacity; - - string renderMaterialName = renderMaterial.Name ?? "default"; // default rhino material has no name - Color diffuse = pbRenderMaterial.BaseColor.AsSystemColor(); - Color emissive = renderMaterial.TypeName.Equals("Emission") - ? pbRenderMaterial.Material.EmissionColor - : pbRenderMaterial.Emission.AsSystemColor(); // pbRenderMaterial.emission gives wrong color for emission materials, and material.emissioncolor gives the wrong value for most others *shrug* - - SpeckleRenderMaterial speckleRenderMaterial = - new(opacity, pbRenderMaterial.Metallic, pbRenderMaterial.Roughness, diffuse, emissive) - { - name = renderMaterialName, - applicationId = renderMaterial.Id.ToString() - }; - - // add additional dynamic props for rhino material receive - speckleRenderMaterial["typeName"] = renderMaterial.TypeName; - speckleRenderMaterial["ior"] = pbRenderMaterial.Material.IndexOfRefraction; - speckleRenderMaterial["shine"] = pbRenderMaterial.Material.Shine; - - return speckleRenderMaterial; - } - - /// - /// A map keeping track of ids, either layer id or object id, and their material index. It's generated from the material proxy list as we bake materials; must be called in advance for this to be populated with the correct data. - /// - public Dictionary ObjectIdAndMaterialIndexMap { get; } = new(); - - public void BakeMaterials(List speckleRenderMaterialProxies, string baseLayerName) - { - var doc = _contextStack.Current.Document; // POC: too much right now to interface around - List conversionResults = new(); // TODO: return this guy - - foreach (var proxy in speckleRenderMaterialProxies) - { - var speckleRenderMaterial = proxy.value; - - try - { - // POC: Currently we're relying on the render material name for identification if it's coming from speckle and from which model; could we do something else? - string materialId = speckleRenderMaterial.applicationId ?? speckleRenderMaterial.id; - string matName = $"{speckleRenderMaterial.name}-({materialId})-{baseLayerName}"; - matName = matName.Replace("[", "").Replace("]", ""); // "Material" doesn't like square brackets if we create from here. Once they created from Rhino UI, all good.. - Color diffuse = Color.FromArgb(speckleRenderMaterial.diffuse); - Color emissive = Color.FromArgb(speckleRenderMaterial.emissive); - double transparency = 1 - speckleRenderMaterial.opacity; - - Material rhinoMaterial = - new() - { - Name = matName, - DiffuseColor = diffuse, - EmissionColor = emissive, - Transparency = transparency - }; - - // try to get additional properties - if (speckleRenderMaterial["ior"] is double ior) - { - rhinoMaterial.IndexOfRefraction = ior; - } - if (speckleRenderMaterial["shine"] is double shine) - { - rhinoMaterial.Shine = shine; - } - - int matIndex = doc.Materials.Add(rhinoMaterial); - - // POC: check on matIndex -1, means we haven't created anything - this is most likely an recoverable error at this stage - if (matIndex == -1) - { - throw new ConversionException("Failed to add a material to the document."); - } - - // Create the object <> material index map - foreach (var objectId in proxy.objects) - { - ObjectIdAndMaterialIndexMap[objectId] = matIndex; - } - - conversionResults.Add(new(Status.SUCCESS, speckleRenderMaterial, matName, "Material")); - } - catch (Exception ex) when (!ex.IsFatal()) - { - conversionResults.Add(new(Status.ERROR, speckleRenderMaterial, null, null, ex)); - } - } - } - - /// - /// Removes all materials with a name starting with from the active document - /// - /// - public void PurgeMaterials(string namePrefix) - { - var currentDoc = RhinoDoc.ActiveDoc; // POC: too much right now to interface around - foreach (Material material in currentDoc.Materials) - { - if (!material.IsDeleted && material.Name != null && material.Name.Contains(namePrefix)) - { - currentDoc.Materials.Delete(material); - } - } - } - - public List UnpackRenderMaterial(List atomicObjects) - { - Dictionary renderMaterialProxies = new(); - Dictionary usedLayerMap = new(); - - // Stage 1: unpack materials from objects, and collect their uniqe layers in the process - foreach (RhinoObject rhinoObject in atomicObjects) - { - var layer = RhinoDoc.ActiveDoc.Layers[rhinoObject.Attributes.LayerIndex]; - usedLayerMap[layer.Id.ToString()] = layer; - - if (rhinoObject.Attributes.MaterialSource != ObjectMaterialSource.MaterialFromObject) - { - continue; // TODO: will not catch layer materials - } - - var rhinoRenderMaterial = rhinoObject.GetRenderMaterial(true); - var rhinoMaterial = rhinoObject.GetMaterial(true); - var rhinoMaterialId = rhinoRenderMaterial?.Id.ToString() ?? rhinoMaterial?.Id.ToString(); - - if (rhinoMaterialId == null) - { - continue; - } - - if (renderMaterialProxies.TryGetValue(rhinoMaterialId, out RenderMaterialProxy? value)) - { - value.objects.Add(rhinoObject.Id.ToString()); - } - else - { - // TY Rhino api for being a bit confused about materials 💖 - SpeckleRenderMaterial? myMaterial = null; - if (rhinoRenderMaterial is not null) - { - myMaterial = ConvertRenderMaterialToSpeckle(rhinoRenderMaterial); - } - else if (rhinoMaterial is not null) - { - RenderMaterial convertedRender = ConvertMaterialToRenderMaterial(rhinoMaterial); - myMaterial = ConvertRenderMaterialToSpeckle(convertedRender); - } - - if (myMaterial is not null) - { - renderMaterialProxies[rhinoMaterialId] = new RenderMaterialProxy() - { - value = myMaterial, - objects = [rhinoObject.Id.ToString()] - }; - } - } - } - - // Stage 2: make sure we collect layer materials as well - foreach (var layer in usedLayerMap.Values) - { - var material = layer.RenderMaterial; - if (material is null) - { - continue; - } - - if (renderMaterialProxies.TryGetValue(material.Id.ToString(), out RenderMaterialProxy? value)) - { - value.objects.Add(layer.Id.ToString()); - } - else - { - renderMaterialProxies[material.Id.ToString()] = new RenderMaterialProxy() - { - value = ConvertRenderMaterialToSpeckle(material), - objects = [layer.Id.ToString()] - }; - } - } - - return renderMaterialProxies.Values.ToList(); - } -} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialUnpacker.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialUnpacker.cs new file mode 100644 index 000000000..24a31a5fc --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/RhinoMaterialUnpacker.cs @@ -0,0 +1,196 @@ +using Microsoft.Extensions.Logging; +using Rhino; +using Rhino.DocObjects; +using Rhino.Render; +using Speckle.Objects.Other; +using Speckle.Sdk; +using Material = Rhino.DocObjects.Material; +using PhysicallyBasedMaterial = Rhino.DocObjects.PhysicallyBasedMaterial; +using RenderMaterial = Rhino.Render.RenderMaterial; +using SpeckleRenderMaterial = Speckle.Objects.Other.RenderMaterial; + +namespace Speckle.Connectors.Rhino.HostApp; + +public class RhinoMaterialUnpacker +{ + private readonly ILogger _logger; + + public RhinoMaterialUnpacker(ILogger logger) + { + _logger = logger; + } + + public List UnpackRenderMaterial(List atomicObjects) + { + Dictionary renderMaterialProxies = new(); + Dictionary usedLayerMap = new(); + + // Stage 1: unpack materials from objects, and collect their uniqe layers in the process + foreach (RhinoObject rhinoObject in atomicObjects) + { + try + { + var layer = RhinoDoc.ActiveDoc.Layers[rhinoObject.Attributes.LayerIndex]; + usedLayerMap[layer.Id.ToString()] = layer; + + if (rhinoObject.Attributes.MaterialSource != ObjectMaterialSource.MaterialFromObject) + { + continue; // TODO: will not catch layer materials + } + + var rhinoRenderMaterial = rhinoObject.GetRenderMaterial(true); + var rhinoMaterial = rhinoObject.GetMaterial(true); + var rhinoMaterialId = rhinoRenderMaterial?.Id.ToString() ?? rhinoMaterial?.Id.ToString(); + + if (rhinoMaterialId == null) + { + continue; + } + + if (renderMaterialProxies.TryGetValue(rhinoMaterialId, out RenderMaterialProxy? value)) + { + value.objects.Add(rhinoObject.Id.ToString()); + } + else + { + // TY Rhino api for being a bit confused about materials 💖 + SpeckleRenderMaterial? myMaterial = null; + if (rhinoRenderMaterial is not null) + { + myMaterial = ConvertRenderMaterialToSpeckle(rhinoRenderMaterial); + } + else if (rhinoMaterial is not null) + { + RenderMaterial convertedRender = ConvertMaterialToRenderMaterial(rhinoMaterial); + myMaterial = ConvertRenderMaterialToSpeckle(convertedRender); + } + + if (myMaterial is not null) + { + renderMaterialProxies[rhinoMaterialId] = new RenderMaterialProxy() + { + value = myMaterial, + objects = [rhinoObject.Id.ToString()] + }; + } + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to unpack render material from RhinoObject"); + } + } + + // Stage 2: make sure we collect layer materials as well + foreach (var layer in usedLayerMap.Values) + { + try + { + // 1. Try to create from RenderMaterial + var renderMaterial = layer.RenderMaterial; + if (renderMaterial is not null) + { + if (renderMaterialProxies.TryGetValue(renderMaterial.Id.ToString(), out RenderMaterialProxy? value)) + { + value.objects.Add(layer.Id.ToString()); + } + else + { + renderMaterialProxies[renderMaterial.Id.ToString()] = new RenderMaterialProxy() + { + value = ConvertRenderMaterialToSpeckle(renderMaterial), + objects = [layer.Id.ToString()] + }; + } + + continue; + } + + // 2. As fallback, try to create from index + // ON RECEIVE: when creating a layer on receive we cannot set RenderMaterial to layer. (RhinoCommon API limitation, it tested) + // We can only set render material index of layer. So for the second send, we also need to check its index! + var renderMaterialIndex = layer.RenderMaterialIndex; + if (renderMaterialIndex == -1) + { + continue; + } + + var renderMaterialFromIndex = RhinoDoc.ActiveDoc.Materials[renderMaterialIndex]; + if (renderMaterialFromIndex is null) + { + continue; + } + + if ( + renderMaterialProxies.TryGetValue( + renderMaterialFromIndex.Id.ToString(), + out RenderMaterialProxy? renderMaterialProxy + ) + ) + { + renderMaterialProxy.objects.Add(layer.Id.ToString()); + } + else + { + renderMaterialProxies[renderMaterialFromIndex.Id.ToString()] = new RenderMaterialProxy() + { + value = ConvertRenderMaterialToSpeckle(ConvertMaterialToRenderMaterial(renderMaterialFromIndex)), + objects = [layer.Id.ToString()] + }; + } + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, "Failed to unpack render material from Rhino Layer"); + } + } + + return renderMaterialProxies.Values.ToList(); + } + + // converts a rhino material to a rhino render material + private RenderMaterial ConvertMaterialToRenderMaterial(Material material) + { + // get physically based render material + Material pbMaterial = material; + if (!material.IsPhysicallyBased) + { + pbMaterial = new(); + pbMaterial.CopyFrom(material); + pbMaterial.ToPhysicallyBased(); + } + + return RenderMaterial.FromMaterial(pbMaterial, null); + } + + private SpeckleRenderMaterial ConvertRenderMaterialToSpeckle(RenderMaterial renderMaterial) + { + PhysicallyBasedMaterial pbRenderMaterial = renderMaterial.ConvertToPhysicallyBased( + RenderTexture.TextureGeneration.Allow + ); + + // get opacity + // POC: pbr will return opacity = 0 for these because they are not pbr materials, they are transparent materials with IOR. Currently hardcoding 0.2 value in lieu of proper type support in rhino. + double opacity = (renderMaterial.SmellsLikeGem || renderMaterial.SmellsLikeGlass) ? 0.2 : pbRenderMaterial.Opacity; + + string renderMaterialName = renderMaterial.Name ?? "default"; // default rhino material has no name + Color diffuse = pbRenderMaterial.BaseColor.AsSystemColor(); + Color emissive = renderMaterial.TypeName.Equals("Emission") + ? pbRenderMaterial.Material.EmissionColor + : pbRenderMaterial.Emission.AsSystemColor(); // pbRenderMaterial.emission gives wrong color for emission materials, and material.emissioncolor gives the wrong value for most others *shrug* + + SpeckleRenderMaterial speckleRenderMaterial = + new(opacity, pbRenderMaterial.Metallic, pbRenderMaterial.Roughness, diffuse, emissive) + { + name = renderMaterialName, + applicationId = renderMaterial.Id.ToString() + }; + + // add additional dynamic props for rhino material receive + speckleRenderMaterial["typeName"] = renderMaterial.TypeName; + speckleRenderMaterial["ior"] = pbRenderMaterial.Material.IndexOfRefraction; + speckleRenderMaterial["shine"] = pbRenderMaterial.Material.Shine; + + return speckleRenderMaterial; + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/SpeckleRhinoPanelHost.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/SpeckleRhinoPanelHost.cs index 4bc9e2f3f..02654613c 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/SpeckleRhinoPanelHost.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/HostApp/SpeckleRhinoPanelHost.cs @@ -1,6 +1,7 @@ using System.Runtime.InteropServices; using System.Windows; using System.Windows.Controls; +using Microsoft.Extensions.DependencyInjection; using Rhino.UI; using Speckle.Connectors.DUI.WebView; using Speckle.Connectors.Rhino.Plugin; @@ -14,10 +15,10 @@ public class SpeckleRhinoPanelHost : RhinoWindows.Controls.WpfElementHost private readonly DUI3ControlWebView? _webView; public SpeckleRhinoPanelHost(uint docSn) - : base(SpeckleConnectorsRhinoPlugin.Instance.Container?.Resolve(), null) + : base(SpeckleConnectorsRhinoPlugin.Instance.Container?.GetRequiredService(), null) { _docSn = docSn; - _webView = SpeckleConnectorsRhinoPlugin.Instance.Container?.Resolve(); + _webView = SpeckleConnectorsRhinoPlugin.Instance.Container?.GetRequiredService(); Panels.Closed += PanelsOnClosed; } diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs index 3b9e09e10..90a6a5783 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Receive/RhinoHostObjectBuilder.cs @@ -1,19 +1,17 @@ using Rhino; using Rhino.DocObjects; using Rhino.Geometry; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Operations.Receive; using Speckle.Connectors.Rhino.HostApp; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Operations; using Speckle.Converters.Common; +using Speckle.Converters.Rhino; using Speckle.Sdk; using Speckle.Sdk.Logging; using Speckle.Sdk.Models; using Speckle.Sdk.Models.Collections; -using Speckle.Sdk.Models.GraphTraversal; using Speckle.Sdk.Models.Instances; -using Speckle.Sdk.Models.Proxies; -using RenderMaterialProxy = Speckle.Objects.Other.RenderMaterialProxy; namespace Speckle.Connectors.Rhino.Operations.Receive; @@ -23,36 +21,36 @@ namespace Speckle.Connectors.Rhino.Operations.Receive; public class RhinoHostObjectBuilder : IHostObjectBuilder { private readonly IRootToHostConverter _converter; - private readonly IConversionContextStack _contextStack; - private readonly GraphTraversal _traverseFunction; - private readonly RhinoInstanceObjectsManager _instanceObjectsManager; - private readonly RhinoLayerManager _layerManager; - private readonly RhinoMaterialManager _materialManager; - private readonly RhinoColorManager _colorManager; - private readonly RhinoGroupManager _groupManager; - private readonly ISyncToThread _syncToThread; + private readonly IConverterSettingsStore _converterSettings; + private readonly RhinoInstanceBaker _instanceBaker; + private readonly RhinoLayerBaker _layerBaker; + private readonly RhinoMaterialBaker _materialBaker; + private readonly RhinoColorBaker _colorBaker; + private readonly RhinoGroupBaker _groupBaker; + private readonly RootObjectUnpacker _rootObjectUnpacker; + private readonly ISdkActivityFactory _activityFactory; public RhinoHostObjectBuilder( IRootToHostConverter converter, - IConversionContextStack contextStack, - GraphTraversal traverseFunction, - RhinoLayerManager layerManager, - RhinoInstanceObjectsManager instanceObjectsManager, - RhinoMaterialManager materialManager, - RhinoColorManager colorManager, - RhinoGroupManager groupManager, - ISyncToThread syncToThread + IConverterSettingsStore converterSettings, + RhinoLayerBaker layerBaker, + RootObjectUnpacker rootObjectUnpacker, + RhinoInstanceBaker instanceBaker, + RhinoMaterialBaker materialBaker, + RhinoColorBaker colorBaker, + RhinoGroupBaker groupBaker, + ISdkActivityFactory activityFactory ) { _converter = converter; - _contextStack = contextStack; - _traverseFunction = traverseFunction; - _layerManager = layerManager; - _instanceObjectsManager = instanceObjectsManager; - _materialManager = materialManager; - _colorManager = colorManager; - _groupManager = groupManager; - _syncToThread = syncToThread; + _converterSettings = converterSettings; + _rootObjectUnpacker = rootObjectUnpacker; + _instanceBaker = instanceBaker; + _materialBaker = materialBaker; + _colorBaker = colorBaker; + _layerBaker = layerBaker; + _groupBaker = groupBaker; + _activityFactory = activityFactory; } public Task Build( @@ -63,176 +61,130 @@ public Task Build( CancellationToken cancellationToken ) { - return _syncToThread.RunOnThread(() => - { - using var activity = SpeckleActivityFactory.Start("Build"); - // POC: This is where the top level base-layer name is set. Could be abstracted or injected in the context? - var baseLayerName = $"Project {projectName}: Model {modelName}"; - - var objectsToConvert = _traverseFunction.Traverse(rootObject).Where(obj => obj.Current is not Collection); - var instanceDefinitionProxies = (rootObject["instanceDefinitionProxies"] as List) - ?.Cast() - .ToList(); - - var groupProxies = (rootObject["groupProxies"] as List)?.Cast().ToList(); - - List? renderMaterials = (rootObject["renderMaterialProxies"] as List) - ?.Cast() - .ToList(); - - List? colors = (rootObject["colorProxies"] as List)?.Cast().ToList(); + using var activity = _activityFactory.Start("Build"); + // POC: This is where the top level base-layer name is set. Could be abstracted or injected in the context? + var baseLayerName = $"Project {projectName}: Model {modelName}"; - var conversionResults = BakeObjects( - objectsToConvert, - instanceDefinitionProxies, - groupProxies, - renderMaterials, - colors, - baseLayerName, - onOperationProgressed - ); + // 0 - Clean then Rock n Roll! + PreReceiveDeepClean(baseLayerName); + _layerBaker.CreateBaseLayer(baseLayerName); - _contextStack.Current.Document.Views.Redraw(); - - return conversionResults; - }); - } + // 1 - Unpack objects and proxies from root commit object + var unpackedRoot = _rootObjectUnpacker.Unpack(rootObject); - private HostObjectBuilderResult BakeObjects( - IEnumerable objectsGraph, - List? instanceDefinitionProxies, - List? groupProxies, - List? materialProxies, - List? colorProxies, - string baseLayerName, - Action? onOperationProgressed - ) - { - List<(Collection[] collectionPath, Base obj)> atomicObjects = new(); - RhinoDoc doc = _contextStack.Current.Document; - List<(Collection[] collectionPath, IInstanceComponent obj)> instanceComponents = new(); + // 2 - Split atomic objects and instance components with their path + var (atomicObjects, instanceComponents) = _rootObjectUnpacker.SplitAtomicObjectsAndInstances( + unpackedRoot.ObjectsToConvert + ); + var atomicObjectsWithPath = _layerBaker.GetAtomicObjectsWithPath(atomicObjects); + var instanceComponentsWithPath = _layerBaker.GetInstanceComponentsWithPath(instanceComponents); - using (var _ = SpeckleActivityFactory.Start("Traversal")) + // 2.1 - these are not captured by traversal, so we need to re-add them here + if (unpackedRoot.DefinitionProxies != null && unpackedRoot.DefinitionProxies.Count > 0) { - PreReceiveDeepClean(baseLayerName); - _layerManager.CreateBaseLayer(baseLayerName); - - // 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); - } - - // Split up the instances from the non-instances - foreach (TraversalContext tc in objectsGraph) - { - Collection[] collectionPath = _layerManager.GetLayerPath(tc); - - if (tc.Current is IInstanceComponent instanceComponent) - { - instanceComponents.Add((collectionPath, instanceComponent)); - } - else - { - atomicObjects.Add((collectionPath, tc.Current)); - } - } + var transformed = unpackedRoot.DefinitionProxies.Select(proxy => + (Array.Empty(), proxy as IInstanceComponent) + ); + instanceComponentsWithPath.AddRange(transformed); } - // Stage 0: Bake materials and colors, as they are used later down the line by layers and objects + // 3 - Bake materials and colors, as they are used later down the line by layers and objects onOperationProgressed?.Invoke("Converting materials and colors", null); - if (materialProxies != null) + if (unpackedRoot.RenderMaterialProxies != null) { - using var _ = SpeckleActivityFactory.Start("Render Materials"); - _materialManager.BakeMaterials(materialProxies, baseLayerName); + using var _ = _activityFactory.Start("Render Materials"); + _materialBaker.BakeMaterials(unpackedRoot.RenderMaterialProxies, baseLayerName); } - if (colorProxies != null) + if (unpackedRoot.ColorProxies != null) { - _colorManager.ParseColors(colorProxies); + _colorBaker.ParseColors(unpackedRoot.ColorProxies); } - // Stage 0.1: Pre bake layers + // 4 - Bake layers // See [CNX-325: Rhino: Change receive operation order to increase performance](https://linear.app/speckle/issue/CNX-325/rhino-change-receive-operation-order-to-increase-performance) onOperationProgressed?.Invoke("Baking layers (redraw disabled)", null); - using (var _ = SpeckleActivityFactory.Start("Pre baking layers")) + using (var _ = _activityFactory.Start("Pre baking layers")) { - using var layerNoDraw = new DisableRedrawScope(doc.Views); - foreach (var (path, _) in atomicObjects) + using var layerNoDraw = new DisableRedrawScope(_converterSettings.Current.Document.Views); + foreach (var (path, _) in atomicObjectsWithPath) { - _layerManager.GetAndCreateLayerFromPath(path, baseLayerName, out bool _); + _layerBaker.GetAndCreateLayerFromPath(path, baseLayerName); } } - // Stage 1: Convert atomic objects + // 5 - Convert atomic objects List bakedObjectIds = new(); Dictionary> applicationIdMap = new(); // This map is used in converting blocks in stage 2. keeps track of original app id => resulting new app ids post baking List conversionResults = new(); int count = 0; - using (var _ = SpeckleActivityFactory.Start("Converting objects")) + using (var _ = _activityFactory.Start("Converting objects")) { - foreach (var (path, obj) in atomicObjects) + foreach (var (path, obj) in atomicObjectsWithPath) { - onOperationProgressed?.Invoke("Converting objects", (double)++count / atomicObjects.Count); - try + using (var convertActivity = _activityFactory.Start("Converting object")) { - // 1: create layer - int layerIndex = _layerManager.GetAndCreateLayerFromPath(path, baseLayerName, out bool _); - - // 2: convert - var result = _converter.Convert(obj); - - // 3: bake - var conversionIds = new List(); - if (result is GeometryBase geometryBase) - { - var guid = BakeObject(geometryBase, obj, layerIndex); - conversionIds.Add(guid.ToString()); - } - else if (result is IEnumerable<(object, Base)> fallbackConversionResult) - { - var guids = BakeObjectsAsGroup(fallbackConversionResult, obj, layerIndex, baseLayerName); - conversionIds.AddRange(guids.Select(id => id.ToString())); - } - - if (conversionIds.Count == 0) - { - throw new SpeckleConversionException($"Failed to convert object."); - } - - // 4: log - var id = conversionIds[0]; // this is group id if it is a one to many conversion, otherwise id of object itself - conversionResults.Add(new(Status.SUCCESS, obj, id, result.GetType().ToString())); - if (conversionIds.Count == 1) + onOperationProgressed?.Invoke("Converting objects", (double)++count / atomicObjects.Count); + try { - bakedObjectIds.Add(id); + // 1: get pre-created layer from cache in layer baker + int layerIndex = _layerBaker.GetAndCreateLayerFromPath(path, baseLayerName); + + // 2: convert + var result = _converter.Convert(obj); + + // 3: bake + var conversionIds = new List(); + if (result is GeometryBase geometryBase) + { + var guid = BakeObject(geometryBase, obj, layerIndex); + conversionIds.Add(guid.ToString()); + } + else if (result is IEnumerable<(object, Base)> fallbackConversionResult) + { + var guids = BakeObjectsAsGroup(fallbackConversionResult, obj, layerIndex, baseLayerName); + conversionIds.AddRange(guids.Select(id => id.ToString())); + } + + if (conversionIds.Count == 0) + { + throw new SpeckleConversionException($"Failed to convert object."); + } + + // 4: log + var id = conversionIds[0]; // this is group id if it is a one to many conversion, otherwise id of object itself + conversionResults.Add(new(Status.SUCCESS, obj, id, result.GetType().ToString())); + if (conversionIds.Count == 1) + { + bakedObjectIds.Add(id); + } + else + { + // first item always a group id if it is a one-to-many, + // we do not want to deal with later groups and its sub elements. It causes a huge issue on performance. + bakedObjectIds.AddRange(conversionIds.Skip(1)); + } + + // 5: populate app id map + applicationIdMap[obj.applicationId ?? obj.id] = conversionIds; + convertActivity?.SetStatus(SdkActivityStatusCode.Ok); } - else + catch (Exception ex) when (!ex.IsFatal()) { - // first item always a group id if it is a one-to-many, - // we do not want to deal with later groups and its sub elements. It causes a huge issue on performance. - bakedObjectIds.AddRange(conversionIds.Skip(1)); + conversionResults.Add(new(Status.ERROR, obj, null, null, ex)); + convertActivity?.SetStatus(SdkActivityStatusCode.Error); + convertActivity?.RecordException(ex); } - - // 5: populate app id map - applicationIdMap[obj.applicationId ?? obj.id] = conversionIds; - } - catch (Exception ex) when (!ex.IsFatal()) - { - conversionResults.Add(new(Status.ERROR, obj, null, null, ex)); } } } - // Stage 2: Convert instances - using (var _ = SpeckleActivityFactory.Start("Converting instances")) + // 6 - Convert instances + using (var _ = _activityFactory.Start("Converting instances")) { - var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = _instanceObjectsManager.BakeInstances( - instanceComponents, + var (createdInstanceIds, consumedObjectIds, instanceConversionResults) = _instanceBaker.BakeInstances( + instanceComponentsWithPath, applicationIdMap, baseLayerName, onOperationProgressed @@ -244,25 +196,30 @@ private HostObjectBuilderResult BakeObjects( conversionResults.AddRange(instanceConversionResults); // add instance conversion results to our list } - // Stage 3: Groups - if (groupProxies is not null) + // 7 - Create groups + if (unpackedRoot.GroupProxies is not null) { - _groupManager.BakeGroups(groupProxies, applicationIdMap, baseLayerName); + _groupBaker.BakeGroups(unpackedRoot.GroupProxies, applicationIdMap, baseLayerName); } - // Stage 4: Return - return new(bakedObjectIds, conversionResults); + _converterSettings.Current.Document.Views.Redraw(); + + return Task.FromResult(new HostObjectBuilderResult(bakedObjectIds, conversionResults)); } private void PreReceiveDeepClean(string baseLayerName) { // Remove all previously received layers and render materials from the document - int rootLayerIndex = _contextStack.Current.Document.Layers.Find(Guid.Empty, baseLayerName, RhinoMath.UnsetIntIndex); + int rootLayerIndex = _converterSettings.Current.Document.Layers.Find( + Guid.Empty, + baseLayerName, + RhinoMath.UnsetIntIndex + ); - _instanceObjectsManager.PurgeInstances(baseLayerName); - _materialManager.PurgeMaterials(baseLayerName); + _instanceBaker.PurgeInstances(baseLayerName); + _materialBaker.PurgeMaterials(baseLayerName); - var doc = _contextStack.Current.Document; + var doc = _converterSettings.Current.Document; // Cleans up any previously received objects if (rootLayerIndex != RhinoMath.UnsetIntIndex) { @@ -283,7 +240,7 @@ private void PreReceiveDeepClean(string baseLayerName) } // Cleans up any previously received group - _groupManager.PurgeGroups(baseLayerName); + _groupBaker.PurgeGroups(baseLayerName); } private Guid BakeObject(GeometryBase obj, Base originalObject, int layerIndex) @@ -291,19 +248,19 @@ private Guid BakeObject(GeometryBase obj, Base originalObject, int layerIndex) ObjectAttributes atts = new() { LayerIndex = layerIndex }; var objectId = originalObject.applicationId ?? originalObject.id; - if (_materialManager.ObjectIdAndMaterialIndexMap.TryGetValue(objectId, out int mIndex)) + if (_materialBaker.ObjectIdAndMaterialIndexMap.TryGetValue(objectId, out int mIndex)) { atts.MaterialIndex = mIndex; atts.MaterialSource = ObjectMaterialSource.MaterialFromObject; } - if (_colorManager.ObjectColorsIdMap.TryGetValue(objectId, out (Color, ObjectColorSource) color)) + if (_colorBaker.ObjectColorsIdMap.TryGetValue(objectId, out (Color, ObjectColorSource) color)) { atts.ObjectColor = color.Item1; atts.ColorSource = color.Item2; } - return _contextStack.Current.Document.Objects.Add(obj, atts); + return _converterSettings.Current.Document.Objects.Add(obj, atts); } private List BakeObjectsAsGroup( @@ -326,11 +283,11 @@ string baseLayerName objectIds.Add(id); } - var groupIndex = _contextStack.Current.Document.Groups.Add( + var groupIndex = _converterSettings.Current.Document.Groups.Add( $@"{originatingObject.speckle_type.Split('.').Last()} - {originatingObject.applicationId ?? originatingObject.id} ({baseLayerName})", objectIds ); - var group = _contextStack.Current.Document.Groups.FindIndex(groupIndex); + var group = _converterSettings.Current.Document.Groups.FindIndex(groupIndex); objectIds.Insert(0, group.Id); return objectIds; } diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Send/RhinoRootObjectBuilder.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Send/RhinoRootObjectBuilder.cs index 278cc4eb0..a0119da16 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Send/RhinoRootObjectBuilder.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Operations/Send/RhinoRootObjectBuilder.cs @@ -1,15 +1,15 @@ using Microsoft.Extensions.Logging; -using Rhino; using Rhino.DocObjects; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Extensions; +using Speckle.Connectors.Common.Instances; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.Rhino.HostApp; -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Caching; -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Extensions; -using Speckle.Connectors.Utils.Instances; -using Speckle.Connectors.Utils.Operations; using Speckle.Converters.Common; +using Speckle.Converters.Rhino; using Speckle.Sdk; using Speckle.Sdk.Logging; using Speckle.Sdk.Models; @@ -26,38 +26,38 @@ public class RhinoRootObjectBuilder : IRootObjectBuilder { private readonly IRootToSpeckleConverter _rootToSpeckleConverter; private readonly ISendConversionCache _sendConversionCache; - private readonly RhinoInstanceObjectsManager _instanceObjectsManager; - private readonly RhinoGroupManager _rhinoGroupManager; - private readonly IConversionContextStack _contextStack; - private readonly RhinoLayerManager _layerManager; - private readonly RhinoMaterialManager _materialManager; - private readonly RhinoColorManager _colorManager; - private readonly ISyncToThread _syncToThread; + private readonly IConverterSettingsStore _converterSettings; + private readonly RhinoLayerUnpacker _layerUnpacker; + private readonly RhinoInstanceUnpacker _instanceUnpacker; + private readonly RhinoGroupUnpacker _groupUnpacker; + private readonly RhinoMaterialUnpacker _materialUnpacker; + private readonly RhinoColorUnpacker _colorUnpacker; private readonly ILogger _logger; + private readonly ISdkActivityFactory _activityFactory; public RhinoRootObjectBuilder( - ISendConversionCache sendConversionCache, - IConversionContextStack contextStack, - RhinoLayerManager layerManager, - RhinoInstanceObjectsManager instanceObjectsManager, - RhinoGroupManager rhinoGroupManager, IRootToSpeckleConverter rootToSpeckleConverter, - RhinoMaterialManager materialManager, - RhinoColorManager colorManager, - ISyncToThread syncToThread, - ILogger logger + ISendConversionCache sendConversionCache, + IConverterSettingsStore converterSettings, + RhinoLayerUnpacker layerUnpacker, + RhinoInstanceUnpacker instanceUnpacker, + RhinoGroupUnpacker groupUnpacker, + RhinoMaterialUnpacker materialUnpacker, + RhinoColorUnpacker colorUnpacker, + ILogger logger, + ISdkActivityFactory activityFactory ) { _sendConversionCache = sendConversionCache; - _contextStack = contextStack; - _layerManager = layerManager; - _instanceObjectsManager = instanceObjectsManager; - _rhinoGroupManager = rhinoGroupManager; + _converterSettings = converterSettings; + _layerUnpacker = layerUnpacker; + _instanceUnpacker = instanceUnpacker; + _groupUnpacker = groupUnpacker; _rootToSpeckleConverter = rootToSpeckleConverter; - _materialManager = materialManager; - _colorManager = colorManager; - _syncToThread = syncToThread; + _materialUnpacker = materialUnpacker; + _colorUnpacker = colorUnpacker; _logger = logger; + _activityFactory = activityFactory; } public Task Build( @@ -65,73 +65,84 @@ public Task Build( SendInfo sendInfo, Action? onOperationProgressed = null, CancellationToken cancellationToken = default - ) => - _syncToThread.RunOnThread(() => - { - using var activity = SpeckleActivityFactory.Start("Build"); - Collection rootObjectCollection = new() { name = _contextStack.Current.Document.Name ?? "Unnamed document" }; - int count = 0; - - UnpackResult unpackResults; - using (var _ = SpeckleActivityFactory.Start("UnpackSelection")) - { - unpackResults = _instanceObjectsManager.UnpackSelection(rhinoObjects); - } + ) => Task.FromResult(BuildSync(rhinoObjects, sendInfo, onOperationProgressed, cancellationToken)); - var (atomicObjects, instanceProxies, instanceDefinitionProxies) = unpackResults; - // 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 + private RootObjectBuilderResult BuildSync( + IReadOnlyList rhinoObjects, + SendInfo sendInfo, + Action? onOperationProgressed, + CancellationToken cancellationToken + ) + { + using var activity = _activityFactory.Start("Build"); + // 0 - Init the root + Collection rootObjectCollection = new() { name = _converterSettings.Current.Document.Name ?? "Unnamed document" }; + rootObjectCollection["units"] = _converterSettings.Current.SpeckleUnits; + + // 1 - Unpack the instances + UnpackResult unpackResults; + using (var _ = _activityFactory.Start("UnpackSelection")) + { + unpackResults = _instanceUnpacker.UnpackSelection(rhinoObjects); + } - _rhinoGroupManager.UnpackGroups(rhinoObjects); - rootObjectCollection["groupProxies"] = _rhinoGroupManager.GroupProxies.Values; + var (atomicObjects, instanceProxies, instanceDefinitionProxies) = unpackResults; + // POC: we should formalise this, sooner or later - or somehow fix it a bit more + rootObjectCollection[ProxyKeys.INSTANCE_DEFINITION] = instanceDefinitionProxies; // this won't work re traversal on receive - // POC: Handle blocks. - List results = new(atomicObjects.Count); + // 2 - Unpack the groups + _groupUnpacker.UnpackGroups(rhinoObjects); + rootObjectCollection[ProxyKeys.GROUP] = _groupUnpacker.GroupProxies.Values; - HashSet versionLayers = new(); - using (var _ = SpeckleActivityFactory.Start("Convert all")) + // 3 - Convert atomic objects + List results = new(atomicObjects.Count); + HashSet versionLayers = new(); + int count = 0; + using (var _ = _activityFactory.Start("Convert all")) + { + foreach (RhinoObject rhinoObject in atomicObjects) { - foreach (RhinoObject rhinoObject in atomicObjects) - { - using var _2 = SpeckleActivityFactory.Start("Convert"); - cancellationToken.ThrowIfCancellationRequested(); + using var _2 = _activityFactory.Start("Convert"); + cancellationToken.ThrowIfCancellationRequested(); - // handle layer - Layer layer = _contextStack.Current.Document.Layers[rhinoObject.Attributes.LayerIndex]; - versionLayers.Add(layer); - Collection collectionHost = _layerManager.GetHostObjectCollection(layer, rootObjectCollection); + // handle layer + Layer layer = _converterSettings.Current.Document.Layers[rhinoObject.Attributes.LayerIndex]; + versionLayers.Add(layer); + Collection collectionHost = _layerUnpacker.GetHostObjectCollection(layer, rootObjectCollection); - results.Add(ConvertRhinoObject(rhinoObject, collectionHost, instanceProxies, sendInfo)); + var result = ConvertRhinoObject(rhinoObject, collectionHost, instanceProxies, sendInfo.ProjectId); + results.Add(result); - ++count; - onOperationProgressed?.Invoke("Converting", (double)count / atomicObjects.Count); + ++count; + onOperationProgressed?.Invoke("Converting", (double)count / atomicObjects.Count); - // NOTE: useful for testing ui states, pls keep for now so we can easily uncomment - // Thread.Sleep(550); - } + // NOTE: useful for testing ui states, pls keep for now so we can easily uncomment + // Thread.Sleep(550); } + } - if (results.All(x => x.Status == Status.ERROR)) - { - throw new SpeckleConversionException("Failed to convert all objects."); // fail fast instead creating empty commit! It will appear as model card error with red color. - } + if (results.All(x => x.Status == Status.ERROR)) + { + throw new SpeckleConversionException("Failed to convert all objects."); // fail fast instead creating empty commit! It will appear as model card error with red color. + } - using (var _ = SpeckleActivityFactory.Start("UnpackRenderMaterials")) - { - // set render materials and colors - rootObjectCollection["renderMaterialProxies"] = _materialManager.UnpackRenderMaterial(atomicObjects); - rootObjectCollection["colorProxies"] = _colorManager.UnpackColors(atomicObjects, versionLayers.ToList()); - } + using (var _ = _activityFactory.Start("UnpackRenderMaterials")) + { + // 4 - Unpack the render material proxies + rootObjectCollection[ProxyKeys.RENDER_MATERIAL] = _materialUnpacker.UnpackRenderMaterial(atomicObjects); - // 5. profit - return new RootObjectBuilderResult(rootObjectCollection, results); - }); + // 5 - Unpack the color proxies + rootObjectCollection[ProxyKeys.COLOR] = _colorUnpacker.UnpackColors(atomicObjects, versionLayers.ToList()); + } + + return new RootObjectBuilderResult(rootObjectCollection, results); + } private SendConversionResult ConvertRhinoObject( RhinoObject rhinoObject, Collection collectionHost, IReadOnlyDictionary instanceProxies, - SendInfo sendInfo + string projectId ) { string applicationId = rhinoObject.Id.ToString(); @@ -146,7 +157,7 @@ SendInfo sendInfo { converted = instanceProxies[applicationId]; } - else if (_sendConversionCache.TryGetValue(sendInfo.ProjectId, applicationId, out ObjectReference? value)) + else if (_sendConversionCache.TryGetValue(projectId, applicationId, out ObjectReference? value)) { converted = value; } diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/DependencyInjection/RhinoPlugin.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Plugin/RhinoPlugin.cs similarity index 100% rename from Connectors/Rhino/Speckle.Connectors.RhinoShared/DependencyInjection/RhinoPlugin.cs rename to Connectors/Rhino/Speckle.Connectors.RhinoShared/Plugin/RhinoPlugin.cs diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Plugin/Speckle.Connectors.RhinoPlugin.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Plugin/Speckle.Connectors.RhinoPlugin.cs index e2dc70b16..66e1690d0 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Plugin/Speckle.Connectors.RhinoPlugin.cs +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Plugin/Speckle.Connectors.RhinoPlugin.cs @@ -1,12 +1,10 @@ -using System.IO; -using System.Reflection; +using Microsoft.Extensions.DependencyInjection; using Rhino.PlugIns; -using Speckle.Autofac; -using Speckle.Autofac.DependencyInjection; +using Speckle.Connectors.Common; +using Speckle.Connectors.DUI; using Speckle.Connectors.Rhino.DependencyInjection; -using Speckle.Connectors.Utils; +using Speckle.Converters.Rhino; using Speckle.Sdk; -using Speckle.Sdk.Common; using Speckle.Sdk.Host; using Speckle.Sdk.Models.Extensions; @@ -26,7 +24,7 @@ public class SpeckleConnectorsRhinoPlugin : PlugIn private IDisposable? _disposableLogger; protected override string LocalPlugInName => "Speckle (Beta) for Rhino"; - public SpeckleContainer? Container { get; private set; } + public ServiceProvider? Container { get; private set; } public SpeckleConnectorsRhinoPlugin() { @@ -47,20 +45,17 @@ protected override LoadReturnCode OnLoad(ref string errorMessage) try { AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolver.OnAssemblyResolve; - _disposableLogger = Connector.Initialize(HostApplications.Rhino, GetVersion()); + var services = new ServiceCollection(); + _disposableLogger = services.Initialize(HostApplications.Rhino, GetVersion()); + services.AddRhino(); + services.AddRhinoConverters(); - // POC: We must load the Rhino connector module manually because we only search for DLL files when calling `LoadAutofacModules`, // but the Rhino connector has `.rhp` as it's extension. - Container = SpeckleContainerBuilder - .CreateInstance() - .LoadAutofacModules( - Assembly.GetExecutingAssembly(), - [Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull()] - ) - .Build(); + Container = services.BuildServiceProvider(); + Container.UseDUI(); // Resolve root plugin object and initialise. - _rhinoPlugin = Container.Resolve(); + _rhinoPlugin = Container.GetRequiredService(); _rhinoPlugin.Initialise(); return LoadReturnCode.Success; @@ -87,6 +82,7 @@ protected override void OnShutdown() { _rhinoPlugin?.Shutdown(); _disposableLogger?.Dispose(); + Container?.Dispose(); base.OnShutdown(); } } diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Registration/ServiceRegistration.cs b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Registration/ServiceRegistration.cs new file mode 100644 index 000000000..62b231a90 --- /dev/null +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Registration/ServiceRegistration.cs @@ -0,0 +1,99 @@ +using Microsoft.Extensions.DependencyInjection; +using Rhino.Commands; +using Rhino.DocObjects; +using Rhino.PlugIns; +using Speckle.Connectors.Common; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Instances; +using Speckle.Connectors.Common.Operations; +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.Rhino.Bindings; +using Speckle.Connectors.Rhino.Filters; +using Speckle.Connectors.Rhino.HostApp; +using Speckle.Connectors.Rhino.Operations.Receive; +using Speckle.Connectors.Rhino.Operations.Send; +using Speckle.Connectors.Rhino.Plugin; +using Speckle.Sdk.Models.GraphTraversal; + +namespace Speckle.Connectors.Rhino.DependencyInjection; + +public static class ServiceRegistration +{ + public static void AddRhino(this IServiceCollection serviceCollection) + { + // Register instances initialised by Rhino + serviceCollection.AddSingleton(SpeckleConnectorsRhinoPlugin.Instance); + serviceCollection.AddSingleton(SpeckleConnectorsRhinoCommand.Instance); + + serviceCollection.AddConnectorUtils(); + serviceCollection.AddDUI(); + serviceCollection.AddDUIView(); + + // POC: Overwriting the SyncToMainThread to SyncToCurrentThread for Rhino! + // builder.AddSingletonInstance(); + + // Register other connector specific types + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + + // Register bindings + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); // POC: Easier like this for now, should be cleaned up later + serviceCollection.AddSingleton(); + + serviceCollection.RegisterTopLevelExceptionHandler(); + + serviceCollection.AddSingleton(sp => sp.GetRequiredService()); + serviceCollection.AddSingleton(); + + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + + // binding dependencies + serviceCollection.AddTransient(); + + // register send filters + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + // register send conversion cache + serviceCollection.AddSingleton(); + + // register send operation and dependencies + serviceCollection.AddScoped>(); + serviceCollection.AddSingleton(DefaultTraversal.CreateTraversalFunc()); + + serviceCollection.AddScoped, RhinoRootObjectBuilder>(); + serviceCollection.AddScoped< + IInstanceObjectsManager>, + InstanceObjectsManager> + >(); + + // Register unpackers and bakers + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + // operation progress manager + serviceCollection.AddSingleton(); + } +} diff --git a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Speckle.Connectors.RhinoShared.projitems b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Speckle.Connectors.RhinoShared.projitems index 1c09551e3..0042fd675 100644 --- a/Connectors/Rhino/Speckle.Connectors.RhinoShared/Speckle.Connectors.RhinoShared.projitems +++ b/Connectors/Rhino/Speckle.Connectors.RhinoShared/Speckle.Connectors.RhinoShared.projitems @@ -21,25 +21,30 @@ - - + + + - + + - - - - + + + + + + + diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs deleted file mode 100644 index 35eb5082c..000000000 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/ArcGISConverterModule.cs +++ /dev/null @@ -1,33 +0,0 @@ -using ArcGIS.Core.Geometry; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.ArcGIS3.Utils; -using Speckle.Converters.Common; -using Speckle.Converters.Common.DependencyInjection; - -namespace Speckle.Converters.ArcGIS3.DependencyInjection; - -public class ArcGISConverterModule : ISpeckleModule -{ - public void Load(SpeckleContainerBuilder builder) - { - // add single root converter - //don't need a host specific RootToSpeckleConverter - builder.AddRootCommon(); - - // add application converters - builder.AddApplicationConverters(); - - // most things should be InstancePerLifetimeScope so we get one per operation - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - builder.AddScoped(); - - builder.AddScoped, ArcGISToSpeckleUnitConverter>(); - - // single stack per conversion - builder.AddScoped, ArcGISConversionContextStack>(); - } -} diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj b/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj deleted file mode 100644 index 781795854..000000000 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/Speckle.Converters.ArcGIS3.DependencyInjection.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0-windows - x64 - Debug;Release;Local - - - - - - - diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json b/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json deleted file mode 100644 index 93feb8aef..000000000 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "version": 2, - "dependencies": { - "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" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.arcgis3": { - "type": "Project", - "dependencies": { - "Esri.ArcGISPro.Extensions30": "[3.2.0.49743, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Autofac": { - "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" - }, - "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": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettings.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettings.cs new file mode 100644 index 000000000..24af9bf1d --- /dev/null +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettings.cs @@ -0,0 +1,13 @@ +using ArcGIS.Desktop.Core; +using ArcGIS.Desktop.Mapping; +using Speckle.Converters.ArcGIS3.Utils; + +namespace Speckle.Converters.ArcGIS3; + +public record ArcGISConversionSettings( + Project Project, + Map Map, + Uri SpeckleDatabasePath, + CRSoffsetRotation ActiveCRSoffsetRotation, + string SpeckleUnits +); diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionContextStack.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs similarity index 68% rename from Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionContextStack.cs rename to Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs index 2808fa549..a26000363 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionContextStack.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConversionSettingsFactory.cs @@ -1,38 +1,34 @@ -using System.Diagnostics.CodeAnalysis; -using ArcGIS.Core.Data; +using ArcGIS.Core.Data; using ArcGIS.Core.Data.DDL; using ArcGIS.Desktop.Core; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; using Speckle.Converters.ArcGIS3.Utils; using Speckle.Converters.Common; +using Speckle.InterfaceGenerator; namespace Speckle.Converters.ArcGIS3; -public class ArcGISDocument +[GenerateAutoInterface] +public class ArcGISConversionSettingsFactory(IHostToSpeckleUnitConverter unitConverter) + : IArcGISConversionSettingsFactory { - public Project Project { get; } - public Map Map { get; } - public Uri SpeckleDatabasePath { get; } - public CRSoffsetRotation ActiveCRSoffsetRotation { get; set; } - - public ArcGISDocument() - { - Project = Project.Current; - Map = MapView.Active.Map; - SpeckleDatabasePath = EnsureOrAddSpeckleDatabase(); - // CRS of either: incoming commit to be applied to all received objects, or CRS to convert all objects to, before sending - // created per Send/Receive operation, will be the same for all objects in the operation - ActiveCRSoffsetRotation = new CRSoffsetRotation(MapView.Active.Map); - } - - private const string FGDB_NAME = "Speckle.gdb"; + public ArcGISConversionSettings Create(Project project, Map map, CRSoffsetRotation activeCRSoffsetRotation) => + new( + project, + map, + EnsureOrAddSpeckleDatabase(), + activeCRSoffsetRotation, + unitConverter.ConvertOrThrow(activeCRSoffsetRotation.SpatialReference.Unit) + ); public Uri EnsureOrAddSpeckleDatabase() { return AddDatabaseToProject(GetDatabasePath()); } + private const string FGDB_NAME = "Speckle.gdb"; + public Uri GetDatabasePath() { try @@ -109,18 +105,3 @@ public Uri AddDatabaseToProject(Uri databasePath) return databasePath; } } - -// POC: Suppressed naming warning for now, but we should evaluate if we should follow this or disable it. -[SuppressMessage( - "Naming", - "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 ArcGISConversionContextStack : ConversionContextStack -{ - public ArcGISConversionContextStack( - IHostToSpeckleUnitConverter unitConverter, - ArcGISDocument arcGisDocument - ) - : base(arcGisDocument, MapView.Active.Map.SpatialReference.Unit, unitConverter) { } -} diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConverterModule.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConverterModule.cs new file mode 100644 index 000000000..6597df04a --- /dev/null +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ArcGISConverterModule.cs @@ -0,0 +1,38 @@ +using System.Reflection; +using ArcGIS.Core.Geometry; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.ArcGIS3.Utils; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk; + +namespace Speckle.Converters.ArcGIS3; + +public static class ArcGISConverterModule +{ + public static void AddArcGISConverters(this IServiceCollection serviceCollection) + { + var converterAssembly = Assembly.GetExecutingAssembly(); + //register types by default + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + // add single root converter + //don't need a host specific RootToSpeckleConverter + serviceCollection.AddRootCommon(converterAssembly); + + // add application converters + serviceCollection.AddApplicationConverters(converterAssembly); + + // most things should be InstancePerLifetimeScope so we get one per operation + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + // single stack per conversion + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + } +} diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/FakeTopLevelConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/FakeTopLevelConverter.cs deleted file mode 100644 index cac2710cd..000000000 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/FakeTopLevelConverter.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Objects.Geometry; -using Speckle.Sdk.Models; - -namespace Speckle.Converters.ArcGIS3; - -[NameAndRankValue(nameof(String), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class FakeTopLevelConverter : IToSpeckleTopLevelConverter, ITypedConverter -{ - public Base Convert(object target) => Convert((String)target); - - public Point Convert(String target) - { - return new Point(0, 0, 100) { ["customText"] = target }; - } -} diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MeshListToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MeshListToHostConverter.cs index 7d5b982fa..f49c986d8 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MeshListToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MeshListToHostConverter.cs @@ -7,15 +7,15 @@ namespace Speckle.Converters.ArcGIS3.ToHost.Raw; public class MeshListToHostConverter : ITypedConverter, ACG.Multipatch> { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public MeshListToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public ACG.Multipatch Convert(List target) @@ -24,8 +24,7 @@ public ACG.Multipatch Convert(List target) { throw new SpeckleConversionException("Feature contains no geometries"); } - ACG.MultipatchBuilderEx multipatchPart = - new(_contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference); + ACG.MultipatchBuilderEx multipatchPart = new(_settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference); foreach (SOG.Mesh part in target) { @@ -40,10 +39,12 @@ public ACG.Multipatch Convert(List target) int ptIndex = part.faces[i]; newPatch.AddPoint( _pointConverter.Convert( - new SOG.Point(part.vertices[ptIndex * 3], part.vertices[ptIndex * 3 + 1], part.vertices[ptIndex * 3 + 2]) - { - units = part.units - } + new SOG.Point( + part.vertices[ptIndex * 3], + part.vertices[ptIndex * 3 + 1], + part.vertices[ptIndex * 3 + 2], + part.units + ) ) ); } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MultipatchListToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MultipatchListToHostConverter.cs index 44c961e9b..14cf4c965 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MultipatchListToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/MultipatchListToHostConverter.cs @@ -26,7 +26,7 @@ public ACG.Multipatch Convert(List target) { newPatch.AddPoint( _pointConverter.Convert( - new SOG.Point(part.vertices[i * 3], part.vertices[i * 3 + 1], part.vertices[i * 3 + 2]) + new SOG.Point(part.vertices[i * 3], part.vertices[i * 3 + 1], part.vertices[i * 3 + 2], part.units) ) ); } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/PointSingleToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/PointSingleToHostConverter.cs index 401681ee0..e042575bb 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/PointSingleToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/Raw/PointSingleToHostConverter.cs @@ -6,25 +6,26 @@ namespace Speckle.Converters.ArcGIS3.ToHost.Raw; public class PointToHostConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public PointToHostConverter(IConversionContextStack contextStack) + public PointToHostConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Point)target); public ACG.MapPoint Convert(SOG.Point target) { - SOG.Point scaledMovedRotatedPoint = _contextStack.Current.Document.ActiveCRSoffsetRotation.OffsetRotateOnReceive( - target + SOG.Point scaledMovedRotatedPoint = _settingsStore.Current.ActiveCRSoffsetRotation.OffsetRotateOnReceive( + target, + _settingsStore.Current.SpeckleUnits ); return new ACG.MapPointBuilderEx( scaledMovedRotatedPoint.x, scaledMovedRotatedPoint.y, scaledMovedRotatedPoint.z, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs index 684f9c5e9..83db8e40d 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/ArcToHostConverter.cs @@ -8,15 +8,15 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; public class ArcToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public ArcToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Arc)target); @@ -35,13 +35,13 @@ public ACG.Polyline Convert(SOG.Arc target) fromPt, toPt, new ACG.Coordinate2D(midPt), - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ); return new ACG.PolylineBuilderEx( segment, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs index 36b50d7d5..993f84d9a 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/CircleToHostConverter.cs @@ -9,15 +9,15 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; public class CircleToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public CircleToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Circle)target); @@ -37,18 +37,18 @@ public ACG.Polyline Convert(SOG.Circle target) // create a native ArcGIS circle segment ACG.MapPoint centerPt = _pointConverter.Convert(target.plane.origin); - double scaleFactor = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double scaleFactor = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); ACG.EllipticArcSegment circleSegment = ACG.EllipticArcBuilderEx.CreateCircle( new ACG.Coordinate2D(centerPt.X, centerPt.Y), (double)target.radius * scaleFactor, ACG.ArcOrientation.ArcClockwise, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ); return new ACG.PolylineBuilderEx( circleSegment, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs index efb80a8cf..27b87b537 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/EllipseToHostConverter.cs @@ -9,15 +9,15 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; public class EllipseToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public EllipseToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Ellipse)target); @@ -35,12 +35,12 @@ public ACG.Polyline Convert(SOG.Ellipse target) } ACG.MapPoint centerPt = _pointConverter.Convert(target.plane.origin); - double scaleFactor = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double scaleFactor = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); // set default values double angle = Math.Atan2(target.plane.xdir.y, target.plane.xdir.x) - + _contextStack.Current.Document.ActiveCRSoffsetRotation.TrueNorthRadians; + + _settingsStore.Current.ActiveCRSoffsetRotation.TrueNorthRadians; double majorAxisRadius = (double)target.firstRadius; double minorAxisRatio = (double)target.secondRadius / majorAxisRadius; @@ -58,13 +58,13 @@ public ACG.Polyline Convert(SOG.Ellipse target) majorAxisRadius * scaleFactor, minorAxisRatio, ACG.ArcOrientation.ArcCounterClockwise, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ); return new ACG.PolylineBuilderEx( segment, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs index 6a8bd1ec5..47e6b5c9d 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/LineToHostConverter.cs @@ -8,15 +8,15 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; public class LineSingleToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public LineSingleToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Line)target); @@ -28,7 +28,7 @@ public ACG.Polyline Convert(SOG.Line target) return new ACG.PolylineBuilderEx( points, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs index 9220e640e..39bb8ab7e 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolycurveToHostConverter.cs @@ -7,19 +7,16 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; [NameAndRankValue(nameof(SOG.Polycurve), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class PolycurveToHostConverter : IToHostTopLevelConverter, ITypedConverter { - private readonly ITypedConverter _pointConverter; private readonly IRootToHostConverter _converter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PolycurveToHostConverter( - ITypedConverter pointConverter, IRootToHostConverter converter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { - _pointConverter = pointConverter; _converter = converter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Polycurve)target); @@ -54,7 +51,7 @@ public ACG.Polyline Convert(SOG.Polycurve target) return new ACG.PolylineBuilderEx( segments, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs index dcc537370..b6842cdc9 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToHost/TopLevel/PolylineToHostConverter.cs @@ -8,15 +8,15 @@ namespace Speckle.Converters.ArcGIS3.ToHost.TopLevel; public class PolylineToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PolylineToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Polyline)target); @@ -32,7 +32,7 @@ public ACG.Polyline Convert(SOG.Polyline target) return new ACG.PolylineBuilderEx( points, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/EnvelopBoxToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/EnvelopBoxToSpeckleConverter.cs index ec05fbd66..09ea3e94e 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/EnvelopBoxToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/EnvelopBoxToSpeckleConverter.cs @@ -7,15 +7,15 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; public class EnvelopToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; public EnvelopToSpeckleConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter pointConverter ) { - _contextStack = contextStack; + _settingsStore = settingsStore; _pointConverter = pointConverter; } @@ -25,18 +25,18 @@ public SOG.Box Convert(Envelope target) target.XMin, target.YMin, target.ZMin, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); MapPoint pointMax = new MapPointBuilderEx( target.XMax, target.YMax, target.ZMax, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); SOG.Point minPtSpeckle = _pointConverter.Convert(pointMin); SOG.Point maxPtSpeckle = _pointConverter.Convert(pointMax); - var units = _contextStack.Current.SpeckleUnits; + var units = _settingsStore.Current.SpeckleUnits; SOG.Plane plane = new() @@ -54,7 +54,7 @@ public SOG.Box Convert(Envelope target) xSize = new Interval { start = minPtSpeckle.x, end = maxPtSpeckle.x }, ySize = new Interval { start = minPtSpeckle.y, end = maxPtSpeckle.y }, zSize = new Interval { start = minPtSpeckle.z, end = maxPtSpeckle.z }, - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisFeatureToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisFeatureToSpeckleConverter.cs index f9a6f5371..21087a9bb 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisFeatureToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisFeatureToSpeckleConverter.cs @@ -1,5 +1,6 @@ using ArcGIS.Core.Data; using Speckle.Converters.ArcGIS3.Utils; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Objects; using Speckle.Sdk.Models; @@ -14,6 +15,7 @@ public class GisFeatureToSpeckleConverter : ITypedConverter<(Row, string), IGisF private readonly ITypedConverter> _polygonConverter; private readonly ITypedConverter> _multipatchConverter; private readonly ITypedConverter _attributeConverter; + private readonly IConverterSettingsStore _settingsStore; public GisFeatureToSpeckleConverter( ITypedConverter pointConverter, @@ -21,7 +23,8 @@ public GisFeatureToSpeckleConverter( ITypedConverter> polylineConverter, ITypedConverter> polygonConverter, ITypedConverter> multipatchConverter, - ITypedConverter attributeConverter + ITypedConverter attributeConverter, + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; @@ -30,6 +33,7 @@ ITypedConverter attributeConverter _polygonConverter = polygonConverter; _multipatchConverter = multipatchConverter; _attributeConverter = attributeConverter; + _settingsStore = settingsStore; } private List GetPolygonDisplayMeshes(List polygons) @@ -38,10 +42,11 @@ ITypedConverter attributeConverter foreach (SGIS.PolygonGeometry polygon in polygons) { // POC: check for voids, we cannot generate display value correctly if any of the polygons have voids - if (polygon.voids.Count > 0) - { - return new(); - } + // Return meshed boundary for now, ignore voids + // if (polygon.voids.Count > 0) + // { + // return new(); + // } // ensure counter-clockwise orientation for up-facing mesh faces bool isClockwise = polygon.boundary.IsClockwisePolygon(); @@ -54,7 +59,13 @@ ITypedConverter attributeConverter // generate Mesh List faces = new() { boundaryPts.Count }; faces.AddRange(Enumerable.Range(0, boundaryPts.Count).ToList()); - SOG.Mesh mesh = new(boundaryPts.SelectMany(x => new List { x.x, x.y, x.z }).ToList(), faces); + SOG.Mesh mesh = + new() + { + vertices = boundaryPts.SelectMany(x => new List { x.x, x.y, x.z }).ToList(), + faces = faces, + units = _settingsStore.Current.SpeckleUnits + }; displayVal.Add(mesh); } @@ -66,7 +77,13 @@ ITypedConverter attributeConverter List displayVal = new(); foreach (SGIS.GisMultipatchGeometry geo in multipatch) { - SOG.Mesh displayMesh = new(geo.vertices, geo.faces); + SOG.Mesh displayMesh = + new() + { + vertices = geo.vertices, + faces = geo.faces, + units = _settingsStore.Current.SpeckleUnits + }; displayVal.Add(displayMesh); } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisRasterToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisRasterToSpeckleConverter.cs index 1128426f4..2c4938dc8 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisRasterToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/GisRasterToSpeckleConverter.cs @@ -8,11 +8,11 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; public class GisRasterToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public GisRasterToSpeckleConverter(IConversionContextStack contextStack) + public GisRasterToSpeckleConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((Raster)target); @@ -172,7 +172,14 @@ public RasterElement Convert(Raster target) } } - SOG.Mesh mesh = new(newCoords, newFaces, newColors, null, _contextStack.Current.SpeckleUnits, null) { }; + SOG.Mesh mesh = + new() + { + vertices = newCoords, + faces = newFaces, + colors = newColors, + units = _settingsStore.Current.SpeckleUnits + }; rasterElement.displayValue = new List() { mesh }; return rasterElement; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/MultipatchFeatureToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/MultipatchFeatureToSpeckleConverter.cs index c36ad6c6e..4214d68d9 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/MultipatchFeatureToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/MultipatchFeatureToSpeckleConverter.cs @@ -10,15 +10,15 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; /// public class MultipatchFeatureToSpeckleConverter : ITypedConverter> { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; public MultipatchFeatureToSpeckleConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter pointConverter ) { - _contextStack = contextStack; + _settingsStore = settingsStore; _pointConverter = pointConverter; } @@ -26,7 +26,7 @@ public IReadOnlyList Convert(ACG.Multipatch target) { List converted = new(); // placeholder, needs to be declared in order to be used in the Ring patch type - SGIS.PolygonGeometry3d polygonGeom = new() { }; + SGIS.PolygonGeometry3d polygonGeom = new() { units = _settingsStore.Current.SpeckleUnits }; // convert and store all multipatch points per Part List> allPoints = new(); @@ -52,19 +52,19 @@ public IReadOnlyList Convert(ACG.Multipatch target) if (patchType == ACG.PatchType.TriangleStrip) { SGIS.GisMultipatchGeometry multipatch = target.CompleteMultipatchTriangleStrip(allPoints, idx); - multipatch.units = _contextStack.Current.SpeckleUnits; + multipatch.units = _settingsStore.Current.SpeckleUnits; converted.Add(multipatch); } else if (patchType == ACG.PatchType.Triangles) { SGIS.GisMultipatchGeometry multipatch = target.CompleteMultipatchTriangles(allPoints, idx); - multipatch.units = _contextStack.Current.SpeckleUnits; + multipatch.units = _settingsStore.Current.SpeckleUnits; converted.Add(multipatch); } else if (patchType == ACG.PatchType.TriangleFan) { SGIS.GisMultipatchGeometry multipatch = target.CompleteMultipatchTriangleFan(allPoints, idx); - multipatch.units = _contextStack.Current.SpeckleUnits; + multipatch.units = _settingsStore.Current.SpeckleUnits; converted.Add(multipatch); } // in case of RingMultipatch - return PolygonGeometry3d @@ -78,10 +78,10 @@ public IReadOnlyList Convert(ACG.Multipatch target) } // first ring means a start of a new PolygonGeometry3d - polygonGeom = new() { voids = new List() }; + polygonGeom = new() { voids = new List(), units = _settingsStore.Current.SpeckleUnits }; List pointCoords = allPoints[idx].SelectMany(x => new List() { x.x, x.y, x.z }).ToList(); - SOG.Polyline polyline = new() { value = pointCoords, units = _contextStack.Current.SpeckleUnits }; + SOG.Polyline polyline = new() { value = pointCoords, units = _settingsStore.Current.SpeckleUnits }; polygonGeom.boundary = polyline; // if it's already the last part, add to list @@ -93,7 +93,7 @@ public IReadOnlyList Convert(ACG.Multipatch target) else if (patchType == ACG.PatchType.Ring) { List pointCoords = allPoints[idx].SelectMany(x => new List() { x.x, x.y, x.z }).ToList(); - SOG.Polyline polyline = new() { value = pointCoords, units = _contextStack.Current.SpeckleUnits }; + SOG.Polyline polyline = new() { value = pointCoords, units = _settingsStore.Current.SpeckleUnits }; // every outer ring is oriented clockwise bool isClockwise = polyline.IsClockwisePolygon(); @@ -106,7 +106,12 @@ public IReadOnlyList Convert(ACG.Multipatch target) { // add existing polygon to list, start a new polygon with a boundary converted.Add(polygonGeom); - polygonGeom = new() { voids = new List(), boundary = polyline }; + polygonGeom = new() + { + voids = new List(), + boundary = polyline, + units = _settingsStore.Current.SpeckleUnits + }; } // if it's already the last part, add to list if (idx == target.PartCount - 1) diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PointToSpeckleConverter.cs index a450a81cb..4e04bdd27 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -6,11 +6,11 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; public class PointToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public PointToSpeckleConverter(IConversionContextStack contextStack) + public PointToSpeckleConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public SOG.Point Convert(MapPoint target) @@ -19,12 +19,12 @@ public SOG.Point Convert(MapPoint target) { // reproject to Active CRS if ( - GeometryEngine.Instance.Project(target, _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference) + GeometryEngine.Instance.Project(target, _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference) is not MapPoint reprojectedPt ) { throw new SpeckleConversionException( - $"Conversion to Spatial Reference {_contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference.Name} failed" + $"Conversion to Spatial Reference {_settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference.Name} failed" ); } @@ -36,27 +36,23 @@ is not MapPoint reprojectedPt ) { throw new SpeckleConversionException( - $"Conversion to Spatial Reference {_contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference.Name} failed: coordinates undefined" + $"Conversion to Spatial Reference {_settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference.Name} failed: coordinates undefined" ); } // convert to Speckle Pt SOG.Point reprojectedSpecklePt = - new( - reprojectedPt.X, - reprojectedPt.Y, - reprojectedPt.Z, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpeckleUnitString - ); - SOG.Point scaledMovedRotatedPoint = _contextStack.Current.Document.ActiveCRSoffsetRotation.OffsetRotateOnSend( - reprojectedSpecklePt + new(reprojectedPt.X, reprojectedPt.Y, reprojectedPt.Z, _settingsStore.Current.SpeckleUnits); + SOG.Point scaledMovedRotatedPoint = _settingsStore.Current.ActiveCRSoffsetRotation.OffsetRotateOnSend( + reprojectedSpecklePt, + _settingsStore.Current.SpeckleUnits ); return scaledMovedRotatedPoint; } catch (ArgumentException ex) { throw new SpeckleConversionException( - $"Conversion to Spatial Reference {_contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference.Name} failed", + $"Conversion to Spatial Reference {_settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference.Name} failed", ex ); } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolygonFeatureToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolygonFeatureToSpeckleConverter.cs index 75c1958e5..8d242f41f 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolygonFeatureToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolygonFeatureToSpeckleConverter.cs @@ -7,10 +7,15 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; public class PolygonFeatureToSpeckleConverter : ITypedConverter> { private readonly ITypedConverter _segmentConverter; + private readonly IConverterSettingsStore _settingsStore; - public PolygonFeatureToSpeckleConverter(ITypedConverter segmentConverter) + public PolygonFeatureToSpeckleConverter( + ITypedConverter segmentConverter, + IConverterSettingsStore settingsStore + ) { _segmentConverter = segmentConverter; + _settingsStore = settingsStore; } public IReadOnlyList Convert(ACG.Polygon target) @@ -35,7 +40,12 @@ public IReadOnlyList Convert(ACG.Polygon target) bool isExteriorRing = target.IsExteriorRing(idx); if (isExteriorRing) { - polygon = new() { boundary = polyline, voids = new List() }; + polygon = new() + { + boundary = polyline, + voids = new List(), + units = _settingsStore.Current.SpeckleUnits + }; polygonList.Add(polygon); } else // interior part diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolylineFeatureToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolylineFeatureToSpeckleConverter.cs index 7906fe6f7..9d014424d 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolylineFeatureToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/PolylineFeatureToSpeckleConverter.cs @@ -6,15 +6,15 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; public class PolyineFeatureToSpeckleConverter : ITypedConverter> { private readonly ITypedConverter _segmentConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PolyineFeatureToSpeckleConverter( ITypedConverter segmentConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _segmentConverter = segmentConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public IReadOnlyList Convert(ACG.Polyline target) @@ -26,10 +26,9 @@ public PolyineFeatureToSpeckleConverter( // densify the polylines with curves using precision value of the Map's Spatial Reference if (target.HasCurves) { - double tolerance = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference.XYTolerance; - double conversionFactorToMeter = _contextStack + double tolerance = _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference.XYTolerance; + double conversionFactorToMeter = _settingsStore .Current - .Document .ActiveCRSoffsetRotation .SpatialReference .Unit diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/SegmentCollectionToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/SegmentCollectionToSpeckleConverter.cs index d959da4c0..01647583b 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/SegmentCollectionToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/Raw/SegmentCollectionToSpeckleConverter.cs @@ -5,15 +5,15 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.Raw; public class SegmentCollectionToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; public SegmentCollectionToSpeckleConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter pointConverter ) { - _contextStack = contextStack; + _settingsStore = settingsStore; _pointConverter = pointConverter; } @@ -33,13 +33,12 @@ public SOG.Polyline Convert(ACG.ReadOnlySegmentCollection target) ACG.Polyline polylineFromSegment = new ACG.PolylineBuilderEx( segment, ACG.AttributeFlags.HasZ, - _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference + _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference ).ToGeometry(); - double tolerance = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference.XYTolerance; - double conversionFactorToMeter = _contextStack + double tolerance = _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference.XYTolerance; + double conversionFactorToMeter = _settingsStore .Current - .Document .ActiveCRSoffsetRotation .SpatialReference .Unit @@ -113,7 +112,7 @@ public SOG.Polyline Convert(ACG.ReadOnlySegmentCollection target) { value = points.SelectMany(pt => new[] { pt.x, pt.y, pt.z, }).ToList(), closed = closed, - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; return polyline; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/PointcloudLayerToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/PointcloudLayerToSpeckleConverter.cs index 825228519..978d036b4 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/PointcloudLayerToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/PointcloudLayerToSpeckleConverter.cs @@ -15,17 +15,17 @@ public class PointCloudToSpeckleConverter { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PointCloudToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } private int GetPointColor(LasPoint pt, object renderer) @@ -103,7 +103,7 @@ public SGIS.VectorLayer Convert(LasDatasetLayer target) colors = speckleColors, sizes = values, bbox = _boxConverter.Convert(target.QueryExtent()), - units = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpeckleUnitString + units = _settingsStore.Current.SpeckleUnits }; speckleLayer.elements.Add(cloud); diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/RasterLayerToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/RasterLayerToSpeckleConverter.cs index bcc2fbb01..c806ba9a3 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/RasterLayerToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/RasterLayerToSpeckleConverter.cs @@ -1,5 +1,4 @@ using ArcGIS.Core.Data.Raster; -using ArcGIS.Core.Geometry; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Objects.GIS; @@ -12,15 +11,15 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.TopLevel; public class RasterLayerToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter { private readonly ITypedConverter _gisRasterConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public RasterLayerToSpeckleConverter( ITypedConverter gisRasterConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _gisRasterConverter = gisRasterConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) @@ -37,7 +36,7 @@ public SGIS.RasterLayer Convert(RasterLayer target) // get active map CRS if layer CRS is empty if (spatialRefRaster.Unit is null) { - spatialRefRaster = _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference; + spatialRefRaster = _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference; } speckleLayer.rasterCrs = new CRS { diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/TableToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/TableToSpeckleConverter.cs index 020a8a21c..b3d8a3a9b 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/TableToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/TableToSpeckleConverter.cs @@ -60,7 +60,7 @@ public VectorLayer Convert(StandaloneTable target) // create new element attributes from the existing attributes, based on the vector layer visible fields // POC: this should be refactored to store the feature layer properties in the context stack, so this logic can be done in the gisFeatureConverter Base elementAttributes = new(); - foreach (string elementAtt in element.attributes.GetDynamicPropertyKeys()) + foreach (string elementAtt in element.attributes.DynamicPropertyKeys) { if (visibleFields.Contains(elementAtt)) { diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/VectorLayerToSpeckleConverter.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/VectorLayerToSpeckleConverter.cs index d3f5b499c..eff7ea7d8 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/VectorLayerToSpeckleConverter.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/ToSpeckle/TopLevel/VectorLayerToSpeckleConverter.cs @@ -1,5 +1,4 @@ using ArcGIS.Core.Data; -using ArcGIS.Core.Geometry; using ArcGIS.Desktop.Mapping; using Speckle.Converters.ArcGIS3.Utils; using Speckle.Converters.Common; @@ -14,15 +13,10 @@ namespace Speckle.Converters.ArcGIS3.ToSpeckle.TopLevel; public class VectorLayerToSpeckleConverter : IToSpeckleTopLevelConverter, ITypedConverter { private readonly ITypedConverter<(Row, string), IGisFeature> _gisFeatureConverter; - private readonly IConversionContextStack _contextStack; - public VectorLayerToSpeckleConverter( - ITypedConverter<(Row, string), IGisFeature> gisFeatureConverter, - IConversionContextStack contextStack - ) + public VectorLayerToSpeckleConverter(ITypedConverter<(Row, string), IGisFeature> gisFeatureConverter) { _gisFeatureConverter = gisFeatureConverter; - _contextStack = contextStack; } public Base Convert(object target) @@ -83,7 +77,7 @@ public VectorLayer Convert(FeatureLayer target) // create new element attributes from the existing attributes, based on the vector layer visible fields // POC: this should be refactored to store the feeature layer properties in the context stack, so this logic can be done in the gisFeatureConverter Base elementAttributes = new(); - foreach (string elementAtt in element.attributes.GetDynamicPropertyKeys()) + foreach (string elementAtt in element.attributes.DynamicPropertyKeys) { if (visibleFieldDescriptions.Contains(elementAtt)) { diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs index cd9e4b99c..bebb9097b 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CRSoffsetRotation.cs @@ -16,16 +16,15 @@ namespace Speckle.Converters.ArcGIS3.Utils; public struct CRSoffsetRotation { public ACG.SpatialReference SpatialReference { get; } - public string SpeckleUnitString { get; set; } public double LatOffset { get; set; } public double LonOffset { get; set; } public double TrueNorthRadians { get; set; } - public SOG.Point OffsetRotateOnReceive(SOG.Point pointOriginal) + public SOG.Point OffsetRotateOnReceive(SOG.Point pointOriginal, string speckleUnitString) { // scale point to match units of the SpatialReference string originalUnits = pointOriginal.units; - SOG.Point point = ScalePoint(pointOriginal, originalUnits, SpeckleUnitString); + SOG.Point point = ScalePoint(pointOriginal, originalUnits, speckleUnitString); // 1. rotate coordinates NormalizeAngle(); @@ -34,16 +33,16 @@ public SOG.Point OffsetRotateOnReceive(SOG.Point pointOriginal) // 2. offset coordinates x2 += LonOffset; y2 += LatOffset; - SOG.Point movedPoint = new(x2, y2, point.z, SpeckleUnitString); + SOG.Point movedPoint = new(x2, y2, point.z, speckleUnitString); return movedPoint; } - public SOG.Point OffsetRotateOnSend(SOG.Point point) + public SOG.Point OffsetRotateOnSend(SOG.Point point, string speckleUnitString) { // scale point to match units of the SpatialReference string originalUnits = point.units; - point = ScalePoint(point, originalUnits, SpeckleUnitString); + point = ScalePoint(point, originalUnits, speckleUnitString); // 1. offset coordinates NormalizeAngle(); @@ -52,7 +51,7 @@ public SOG.Point OffsetRotateOnSend(SOG.Point point) // 2. rotate coordinates double x2 = x * Math.Cos(TrueNorthRadians) + y * Math.Sin(TrueNorthRadians); double y2 = -x * Math.Sin(TrueNorthRadians) + y * Math.Cos(TrueNorthRadians); - SOG.Point movedPoint = new(x2, y2, point.z, SpeckleUnitString); + SOG.Point movedPoint = new(x2, y2, point.z, speckleUnitString); return movedPoint; } @@ -63,11 +62,6 @@ private readonly SOG.Point ScalePoint(SOG.Point point, string fromUnit, string t return new SOG.Point(point.x * scaleFactor, point.y * scaleFactor, point.z * scaleFactor, toUnit); } - private readonly string GetSpeckleUnit(ACG.SpatialReference spatialReference) - { - return new ArcGISToSpeckleUnitConverter().ConvertOrThrow(spatialReference.Unit); - } - private void NormalizeAngle() { if (TrueNorthRadians < -2 * Math.PI || TrueNorthRadians > 2 * Math.PI) @@ -112,7 +106,6 @@ private void NormalizeAngle() public CRSoffsetRotation(ACG.SpatialReference spatialReference) { SpatialReference = spatialReference; - SpeckleUnitString = GetSpeckleUnit(spatialReference); LatOffset = 0; LonOffset = 0; TrueNorthRadians = 0; @@ -127,7 +120,6 @@ public CRSoffsetRotation(Map map) ACG.SpatialReference spatialReference = map.SpatialReference; SpatialReference = spatialReference; - SpeckleUnitString = GetSpeckleUnit(spatialReference); // read from metadata string metadata = map.GetMetadata(); @@ -185,7 +177,6 @@ double trueNorthRadians ) { SpatialReference = spatialReference; - SpeckleUnitString = GetSpeckleUnit(spatialReference); LatOffset = latOffset; LonOffset = lonOffset; TrueNorthRadians = trueNorthRadians; diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CrsUtils.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CrsUtils.cs index 735388a18..8177e3096 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CrsUtils.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/CrsUtils.cs @@ -5,16 +5,9 @@ namespace Speckle.Converters.ArcGIS3.Utils; [GenerateAutoInterface] -public class CrsUtils : ICrsUtils +public class CrsUtils(IConverterSettingsStore settingsStore) : ICrsUtils { - private readonly IConversionContextStack _contextStack; - - public CrsUtils(IConversionContextStack contextStack) - { - _contextStack = contextStack; - } - - public void FindSetCrsDataOnReceive(Base? rootObj) + public IDisposable? FindSetCrsDataOnReceive(Base? rootObj) { if (rootObj is SGIS.VectorLayer vLayer) { @@ -31,12 +24,14 @@ public void FindSetCrsDataOnReceive(Base? rootObj) double trueNorthRadians = System.Convert.ToDouble((vLayer.crs?.rotation == null) ? 0 : vLayer.crs.rotation); double latOffset = System.Convert.ToDouble((vLayer.crs?.offset_y == null) ? 0 : vLayer.crs.offset_y); double lonOffset = System.Convert.ToDouble((vLayer.crs?.offset_x == null) ? 0 : vLayer.crs.offset_x); - _contextStack.Current.Document.ActiveCRSoffsetRotation = new CRSoffsetRotation( - spatialRef, - latOffset, - lonOffset, - trueNorthRadians + return settingsStore.Push(x => + x with + { + ActiveCRSoffsetRotation = new CRSoffsetRotation(spatialRef, latOffset, lonOffset, trueNorthRadians) + } ); } + + return null; } } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/FeatureClassUtils.cs b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/FeatureClassUtils.cs index acaea4e63..7f851c03c 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/FeatureClassUtils.cs +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/FeatureClassUtils.cs @@ -15,15 +15,15 @@ namespace Speckle.Converters.ArcGIS3.Utils; public class FeatureClassUtils : IFeatureClassUtils { private readonly IArcGISFieldUtils _fieldsUtils; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public FeatureClassUtils( IArcGISFieldUtils fieldsUtils, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _fieldsUtils = fieldsUtils; - _contextStack = contextStack; + _settingsStore = settingsStore; } public void ClearExistingDataset(string featureClassName) @@ -66,8 +66,7 @@ public void ClearExistingDataset(string featureClassName) private Geodatabase GetDatabase() { // get database - FileGeodatabaseConnectionPath fileGeodatabaseConnectionPath = - new(_contextStack.Current.Document.SpeckleDatabasePath); + FileGeodatabaseConnectionPath fileGeodatabaseConnectionPath = new(_settingsStore.Current.SpeckleDatabasePath); Geodatabase geodatabase = new(fileGeodatabaseConnectionPath); return geodatabase; @@ -98,7 +97,7 @@ private Geodatabase GetDatabase() speckleType = speckleType.Length > 10 ? speckleType[..9] : speckleType; string? parentId = context.Parent?.Current.id; - CRSoffsetRotation activeSR = _contextStack.Current.Document.ActiveCRSoffsetRotation; + CRSoffsetRotation activeSR = _settingsStore.Current.ActiveCRSoffsetRotation; string xOffset = Convert.ToString(activeSR.LonOffset).Replace(".", "_"); xOffset = xOffset.Length > 15 ? xOffset[..14] : xOffset; @@ -217,7 +216,7 @@ List conversionTrackers try { ShapeDescription shpDescription = - new(geomType, _contextStack.Current.Document.ActiveCRSoffsetRotation.SpatialReference) { HasZ = true }; + new(geomType, _settingsStore.Current.ActiveCRSoffsetRotation.SpatialReference) { HasZ = true }; FeatureClassDescription featureClassDescription = new(featureClassName, fields, shpDescription); FeatureClassToken featureClassToken = schemaBuilder.Create(featureClassDescription); } diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json index 4b76c7cb0..7800a6e94 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json +++ b/Converters/ArcGIS/Speckle.Converters.ArcGIS3/packages.lock.json @@ -88,6 +88,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -121,11 +169,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -156,6 +199,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -166,62 +214,61 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Autocad/Speckle.Converters.Autocad2022.DependencyInjection/Speckle.Converters.Autocad2022.DependencyInjection.csproj b/Converters/Autocad/Speckle.Converters.Autocad2022.DependencyInjection/Speckle.Converters.Autocad2022.DependencyInjection.csproj deleted file mode 100644 index fa38de026..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2022.DependencyInjection/Speckle.Converters.Autocad2022.DependencyInjection.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - - - - diff --git a/Converters/Autocad/Speckle.Converters.Autocad2022.DependencyInjection/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2022.DependencyInjection/packages.lock.json deleted file mode 100644 index efc2b8582..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2022.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.autocad2022": { - "type": "Project", - "dependencies": { - "Speckle.AutoCAD.API": "[2022.0.2, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.AutoCAD.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2022.0.2", - "contentHash": "NFHXnlkBjzM8Bau52d6eF6m0+etHddGx7qlWN8YyrfTtGyz+AmPvF8fgxcLgyjAcB3W4Wim11JeYuEoTNH1X0w==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Autocad/Speckle.Converters.Autocad2022/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2022/packages.lock.json index 4c14e3c65..1263be458 100644 --- a/Converters/Autocad/Speckle.Converters.Autocad2022/packages.lock.json +++ b/Converters/Autocad/Speckle.Converters.Autocad2022/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,65 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj b/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj deleted file mode 100644 index f54a9bb23..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/Speckle.Converters.Autocad2023.DependencyInjection.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - - - - diff --git a/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json deleted file mode 100644 index bb613c481..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2023.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.autocad2023": { - "type": "Project", - "dependencies": { - "Speckle.AutoCAD.API": "[2023.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.AutoCAD.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2023.0.0", - "contentHash": "aNfiNw9zRW8pCl8AAQK7afEJuea4bJ4sFNsGVSDrdq1egaonZrwALU01dSyFNCE8tne86eVjlprpOGG6r0+G/A==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json index 3bafebb12..0de215d7c 100644 --- a/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json +++ b/Converters/Autocad/Speckle.Converters.Autocad2023/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,65 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj b/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj deleted file mode 100644 index f899360ef..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/Speckle.Converters.Autocad2024.DependencyInjection.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - - - - diff --git a/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json deleted file mode 100644 index 59e20ad65..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2024.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,432 +0,0 @@ -{ - "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.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.Extensions.Configuration": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" - } - }, - "Microsoft.Extensions.Configuration.Abstractions": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", - "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" - } - }, - "Microsoft.Extensions.Configuration.Binder": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", - "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.ComponentModel.Annotations": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.connectors.dui": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", - "System.Threading.Tasks.Dataflow": "[6.0.0, )" - } - }, - "speckle.connectors.dui.webview": { - "type": "Project", - "dependencies": { - "Microsoft.Web.WebView2": "[1.0.1938.49, )", - "Speckle.Connectors.DUI": "[1.0.0, )" - } - }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.autocad2024": { - "type": "Project", - "dependencies": { - "Speckle.AutoCAD.API": "[2024.0.0, )", - "Speckle.Connectors.DUI.WebView": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Microsoft.Extensions.Logging": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Microsoft.Web.WebView2": { - "type": "CentralTransitive", - "requested": "[1.0.1938.49, )", - "resolved": "1.0.1938.49", - "contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw==" - }, - "Speckle.AutoCAD.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2024.0.0", - "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - }, - "System.Threading.Tasks.Dataflow": { - "type": "CentralTransitive", - "requested": "[6.0.0, )", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - } - } - } -} \ No newline at end of file diff --git a/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json index a9113678c..281b57525 100644 --- a/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json +++ b/Converters/Autocad/Speckle.Converters.Autocad2024/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -99,59 +91,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -187,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -224,22 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -253,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -266,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -301,24 +255,21 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -329,49 +280,42 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -381,29 +325,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Converters/Autocad/Speckle.Converters.Autocad2025.DependencyInjection/Speckle.Converters.Autocad2025.DependencyInjection.csproj b/Converters/Autocad/Speckle.Converters.Autocad2025.DependencyInjection/Speckle.Converters.Autocad2025.DependencyInjection.csproj deleted file mode 100644 index 610e1a408..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2025.DependencyInjection/Speckle.Converters.Autocad2025.DependencyInjection.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net8.0-windows - x64 - Debug;Release;Local - - - - - - - - - - - - - - diff --git a/Converters/Autocad/Speckle.Converters.Autocad2025.DependencyInjection/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2025.DependencyInjection/packages.lock.json deleted file mode 100644 index bb881bada..000000000 --- a/Converters/Autocad/Speckle.Converters.Autocad2025.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,345 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net8.0-windows7.0": { - "Autofac": { - "type": "Direct", - "requested": "[5.2.0, )", - "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, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.Extensions.Configuration": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" - } - }, - "Microsoft.Extensions.Configuration.Abstractions": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", - "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" - } - }, - "Microsoft.Extensions.Configuration.Binder": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" - }, - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.connectors.dui": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", - "System.Threading.Tasks.Dataflow": "[6.0.0, )" - } - }, - "speckle.connectors.dui.webview": { - "type": "Project", - "dependencies": { - "Microsoft.Web.WebView2": "[1.0.1938.49, )", - "Speckle.Connectors.DUI": "[1.0.0, )" - } - }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.autocad2025": { - "type": "Project", - "dependencies": { - "Speckle.AutoCAD.API": "[2025.0.0, )", - "Speckle.Connectors.DUI.WebView": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Microsoft.Extensions.Logging": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Microsoft.Web.WebView2": { - "type": "CentralTransitive", - "requested": "[1.0.1938.49, )", - "resolved": "1.0.1938.49", - "contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw==" - }, - "Speckle.AutoCAD.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2025.0.0", - "contentHash": "dqEgZ+bTqAG0tx0WwdnTZcbNKH2igzhOr3SMXtRYai7yIqXiz5btZ4Mf2bmfxbmxLucww3GKVpdZoI+PSZlMuQ==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - }, - "System.Threading.Tasks.Dataflow": { - "type": "CentralTransitive", - "requested": "[6.0.0, )", - "resolved": "6.0.0", - "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" - } - } - } -} \ No newline at end of file diff --git a/Converters/Autocad/Speckle.Converters.Autocad2025/packages.lock.json b/Converters/Autocad/Speckle.Converters.Autocad2025/packages.lock.json index fbdddcf50..1ccdd07a0 100644 --- a/Converters/Autocad/Speckle.Converters.Autocad2025/packages.lock.json +++ b/Converters/Autocad/Speckle.Converters.Autocad2025/packages.lock.json @@ -90,54 +90,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -172,11 +169,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -207,6 +199,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -217,24 +214,26 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -245,46 +244,42 @@ "Speckle.Connectors.DUI": "[1.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" + } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.Web.WebView2": { "type": "CentralTransitive", @@ -294,29 +289,29 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/AutocadConverterModule.cs b/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/AutocadConverterModule.cs deleted file mode 100644 index dfee8179f..000000000 --- a/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/AutocadConverterModule.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Autodesk.AutoCAD.ApplicationServices; -using Autodesk.AutoCAD.DatabaseServices; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Autocad; -using Speckle.Converters.Common; -using Speckle.Converters.Common.DependencyInjection; - -namespace Speckle.Converters.AutocadShared.DependencyInjection; - -public class AutocadConverterModule : ISpeckleModule -{ - public void Load(SpeckleContainerBuilder builder) - { - // add single root converter - builder.AddRootCommon(); - - // add application converters and context stack - builder.AddApplicationConverters(); - builder.AddScoped, AutocadConversionContextStack>(); - } -} diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/Speckle.Converters.AutocadShared.DependencyInjection.projitems b/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/Speckle.Converters.AutocadShared.DependencyInjection.projitems deleted file mode 100644 index b031ea832..000000000 --- a/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/Speckle.Converters.AutocadShared.DependencyInjection.projitems +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 6e7d959f-8383-4dc2-bfc2-fcea4ecc60b3 - - - Speckle.Converters.AutocadShared.DependencyInjection - - - - - \ No newline at end of file diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/Speckle.Converters.AutocadShared.DependencyInjection.shproj b/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/Speckle.Converters.AutocadShared.DependencyInjection.shproj deleted file mode 100644 index 4144a5550..000000000 --- a/Converters/Autocad/Speckle.Converters.AutocadShared.DependencyInjection/Speckle.Converters.AutocadShared.DependencyInjection.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - 6e7d959f-8383-4dc2-bfc2-fcea4ecc60b3 - 14.0 - - - - - - - - diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionContextStack.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionContextStack.cs index 1e08b6596..e69de29bb 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionContextStack.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionContextStack.cs @@ -1,21 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Autodesk.AutoCAD.DatabaseServices; -using Speckle.Converters.Common; - -namespace Speckle.Converters.Autocad; - -// POC: Suppressed naming warning for now, but we should evaluate if we should follow this or disable it. -[SuppressMessage( - "Naming", - "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 AutocadConversionContextStack : ConversionContextStack -{ - public AutocadConversionContextStack(IHostToSpeckleUnitConverter unitConverter) - : base( - Application.DocumentManager.CurrentDocument, - Application.DocumentManager.CurrentDocument.Database.Insunits, - unitConverter - ) { } -} diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionSettings.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionSettings.cs new file mode 100644 index 000000000..093f92e9b --- /dev/null +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionSettings.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.Autocad; + +public record AutocadConversionSettings(Document Document, string SpeckleUnits); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionSettingsFactory.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionSettingsFactory.cs new file mode 100644 index 000000000..08b4d4a68 --- /dev/null +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadConversionSettingsFactory.cs @@ -0,0 +1,12 @@ +using Speckle.Converters.Common; +using Speckle.InterfaceGenerator; + +namespace Speckle.Converters.Autocad; + +[GenerateAutoInterface] +public class AutocadConversionSettingsFactory(IHostToSpeckleUnitConverter unitsConverter) + : IAutocadConversionSettingsFactory +{ + public AutocadConversionSettings Create(Document document) => + new(document, unitsConverter.ConvertOrThrow(document.Database.Insunits)); +} diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadRootToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadRootToHostConverter.cs index 9247b1d32..8edea41f3 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadRootToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/AutocadRootToHostConverter.cs @@ -1,30 +1,31 @@ using Autodesk.AutoCAD.DatabaseServices; -using Speckle.Autofac.DependencyInjection; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk.Common; using Speckle.Sdk.Models; namespace Speckle.Converters.Autocad; public class AutocadRootToHostConverter : IRootToSpeckleConverter { - private readonly IFactory _toSpeckle; - private readonly IConversionContextStack _contextStack; + private readonly IConverterManager _toSpeckle; + private readonly IConverterSettingsStore _settingsStore; public AutocadRootToHostConverter( - IFactory toSpeckle, - IConversionContextStack contextStack + IConverterManager toSpeckle, + IConverterSettingsStore settingsStore ) { _toSpeckle = toSpeckle; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) { if (target is not DBObject dbObject) { - throw new NotSupportedException( + throw new ConversionNotSupportedException( $"Conversion of {target.GetType().Name} to Speckle is not supported. Only objects that inherit from DBObject are." ); } @@ -33,15 +34,15 @@ public Base Convert(object target) try { - using (var l = _contextStack.Current.Document.LockDocument()) + using (var l = _settingsStore.Current.Document.LockDocument()) { - using (var tr = _contextStack.Current.Document.Database.TransactionManager.StartTransaction()) + using (var tr = _settingsStore.Current.Document.Database.TransactionManager.StartTransaction()) { - var objectConverter = _toSpeckle.ResolveInstance(type.Name); + var objectConverter = _toSpeckle.ResolveConverter(type); if (objectConverter == null) { - throw new NotSupportedException($"No conversion found for {target.GetType().Name}"); + throw new ConversionNotSupportedException($"No conversion found for {target.GetType().Name}"); } var convertedObject = objectConverter.Convert(dbObject); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/GlobalUsings.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/GlobalUsings.cs index 5be307894..6f30de24d 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/GlobalUsings.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/GlobalUsings.cs @@ -1,7 +1,6 @@ global using ABR = Autodesk.AutoCAD.BoundaryRepresentation; global using ADB = Autodesk.AutoCAD.DatabaseServices; global using AG = Autodesk.AutoCAD.Geometry; -global using Application = Autodesk.AutoCAD.ApplicationServices.Core.Application; global using Document = Autodesk.AutoCAD.ApplicationServices.Document; global using SOG = Speckle.Objects.Geometry; global using SOP = Speckle.Objects.Primitive; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ServiceRegistration.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ServiceRegistration.cs new file mode 100644 index 000000000..ba08d05b0 --- /dev/null +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ServiceRegistration.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk; + +namespace Speckle.Converters.Autocad; + +public static class ServiceRegistration +{ + public static void AddAutocadConverters(this IServiceCollection serviceCollection) + { + var converterAssembly = Assembly.GetExecutingAssembly(); + //register types by default + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + // add single root converter + serviceCollection.AddRootCommon(converterAssembly); + + // add application converters and context stack + serviceCollection.AddApplicationConverters(converterAssembly); + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + } +} diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/Speckle.Converters.AutocadShared.projitems b/Converters/Autocad/Speckle.Converters.AutocadShared/Speckle.Converters.AutocadShared.projitems index 8fb784a3a..f7089bc6f 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/Speckle.Converters.AutocadShared.projitems +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/Speckle.Converters.AutocadShared.projitems @@ -9,11 +9,14 @@ Speckle.Converters.AutocadShared + + + diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs index 37f9268bc..c86714f4e 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/ArcToHostConverter.cs @@ -9,17 +9,17 @@ public class ArcToHostConverter : IToHostTopLevelConverter, ITypedConverter _arcConverter; private readonly ITypedConverter _planeConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public ArcToHostConverter( ITypedConverter arcConverter, ITypedConverter planeConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _arcConverter = arcConverter; _planeConverter = planeConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Arc)target); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs index 8c3c53464..67faf5769 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/CircleToHostConverter.cs @@ -10,17 +10,17 @@ public class CircleToHostConverter : IToHostTopLevelConverter, ITypedConverter _pointConverter; private readonly ITypedConverter _vectorConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public CircleToHostConverter( ITypedConverter pointConverter, ITypedConverter vectorConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _vectorConverter = vectorConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Circle)target); @@ -29,7 +29,7 @@ public ADB.Circle Convert(SOG.Circle target) { AG.Vector3d normal = _vectorConverter.Convert(target.plane.normal); AG.Point3d origin = _pointConverter.Convert(target.plane.origin); - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); var radius = f * target.radius; return new(origin, normal, radius); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs index 22927a7a6..e179d15da 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/EllipseToHostConverter.cs @@ -10,17 +10,17 @@ public class EllipseToHostConverter : IToHostTopLevelConverter, ITypedConverter< { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _vectorConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public EllipseToHostConverter( ITypedConverter pointConverter, ITypedConverter vectorConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _vectorConverter = vectorConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Ellipse)target); @@ -28,7 +28,7 @@ public EllipseToHostConverter( /// Throws if any ellipse radius value is null. public ADB.Ellipse Convert(SOG.Ellipse target) { - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); AG.Point3d origin = _pointConverter.Convert(target.plane.origin); AG.Vector3d normal = _vectorConverter.Convert(target.plane.normal); AG.Vector3d xAxis = _vectorConverter.Convert(target.plane.xdir); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs index 5a1312f80..340a601c4 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/MeshToHostConverter.cs @@ -10,15 +10,15 @@ namespace Speckle.Converters.Autocad.Geometry; public class MeshToHostConverter : IToHostTopLevelConverter, ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public MeshToHostConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Mesh)target); @@ -40,13 +40,14 @@ public ADB.PolyFaceMesh Convert(SOG.Mesh target) ADB.PolyFaceMesh mesh = new(); - ADB.Transaction tr = _contextStack.Current.Document.TransactionManager.TopTransaction; + //TODO using? + ADB.Transaction tr = _settingsStore.Current.Document.TransactionManager.TopTransaction; mesh.SetDatabaseDefaults(); // append mesh to blocktable record - necessary before adding vertices and faces var btr = (ADB.BlockTableRecord) - tr.GetObject(_contextStack.Current.Document.Database.CurrentSpaceId, ADB.OpenMode.ForWrite); + tr.GetObject(_settingsStore.Current.Document.Database.CurrentSpaceId, ADB.OpenMode.ForWrite); btr.AppendEntity(mesh); tr.AddNewlyCreatedDBObject(mesh, true); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/SpeckleFallbackToHostConversion.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/SpeckleFallbackToHostConversion.cs index d53418f8c..570ed0302 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/SpeckleFallbackToHostConversion.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Geometry/SpeckleFallbackToHostConversion.cs @@ -1,4 +1,4 @@ -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; @@ -12,18 +12,21 @@ public class SpeckleFallbackToAutocadTopLevelConverter private readonly ITypedConverter _lineConverter; private readonly ITypedConverter _polylineConverter; private readonly ITypedConverter _meshConverter; + private readonly ITypedConverter _arcConverter; private readonly ITypedConverter _pointConverter; public SpeckleFallbackToAutocadTopLevelConverter( ITypedConverter lineConverter, ITypedConverter polylineConverter, ITypedConverter meshConverter, + ITypedConverter arcConverter, ITypedConverter pointConverter ) { _lineConverter = lineConverter; _polylineConverter = polylineConverter; _meshConverter = meshConverter; + _arcConverter = arcConverter; _pointConverter = pointConverter; } @@ -39,6 +42,7 @@ public SpeckleFallbackToAutocadTopLevelConverter( SOG.Line line => _lineConverter.Convert(line), SOG.Polyline polyline => _polylineConverter.Convert(polyline), SOG.Mesh mesh => _meshConverter.Convert(mesh), + SOG.Arc arc => _arcConverter.Convert(arc), SOG.Point point => _pointConverter.Convert(point), _ => throw new NotSupportedException($"Found unsupported fallback geometry: {item.GetType()}") }; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline2dRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline2dRawConverter.cs index 8d0a001a9..b3ad64154 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline2dRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline2dRawConverter.cs @@ -1,3 +1,4 @@ +using Speckle.Converters.Autocad; using Speckle.Converters.Autocad.Extensions; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -9,15 +10,15 @@ public class AutocadPolycurveToHostPolyline2dRawConverter : ITypedConverter { private readonly ITypedConverter _vectorConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public AutocadPolycurveToHostPolyline2dRawConverter( ITypedConverter vectorConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _vectorConverter = vectorConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public ADB.Polyline2d Convert(SOG.Autocad.AutocadPolycurve target) @@ -35,7 +36,7 @@ public ADB.Polyline2d Convert(SOG.Autocad.AutocadPolycurve target) } // get vertices - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); List points = target.value.ConvertToPoint3d(f); // check for invalid bulges @@ -62,9 +63,9 @@ public ADB.Polyline2d Convert(SOG.Autocad.AutocadPolycurve target) }; // add polyline2d to document - ADB.Transaction tr = _contextStack.Current.Document.TransactionManager.TopTransaction; + ADB.Transaction tr = _settingsStore.Current.Document.TransactionManager.TopTransaction; var btr = (ADB.BlockTableRecord) - tr.GetObject(_contextStack.Current.Document.Database.CurrentSpaceId, ADB.OpenMode.ForWrite); + tr.GetObject(_settingsStore.Current.Document.Database.CurrentSpaceId, ADB.OpenMode.ForWrite); btr.AppendEntity(polyline); tr.AddNewlyCreatedDBObject(polyline, true); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline3dRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline3dRawConverter.cs index d58073f0d..20c47f7dc 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline3dRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolyline3dRawConverter.cs @@ -1,3 +1,4 @@ +using Speckle.Converters.Autocad; using Speckle.Converters.Autocad.Extensions; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -8,26 +9,26 @@ namespace Speckle.Converters.Autocad2023.ToHost.Raw; public class AutocadPolycurveToHostPolyline3dRawConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public AutocadPolycurveToHostPolyline3dRawConverter(IConversionContextStack contextStack) + public AutocadPolycurveToHostPolyline3dRawConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public ADB.Polyline3d Convert(SOG.Autocad.AutocadPolycurve target) { // get vertices - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); List points = target.value.ConvertToPoint3d(f); // create the polyline3d using the empty constructor ADB.Polyline3d polyline = new() { Closed = target.closed }; // add polyline3d to document - ADB.Transaction tr = _contextStack.Current.Document.TransactionManager.TopTransaction; + ADB.Transaction tr = _settingsStore.Current.Document.TransactionManager.TopTransaction; var btr = (ADB.BlockTableRecord) - tr.GetObject(_contextStack.Current.Document.Database.CurrentSpaceId, ADB.OpenMode.ForWrite); + tr.GetObject(_settingsStore.Current.Document.Database.CurrentSpaceId, ADB.OpenMode.ForWrite); btr.AppendEntity(polyline); tr.AddNewlyCreatedDBObject(polyline, true); diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolylineRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolylineRawConverter.cs index 57e2e5126..dff137087 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolylineRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/AutocadPolycurveToHostPolylineRawConverter.cs @@ -1,3 +1,4 @@ +using Speckle.Converters.Autocad; using Speckle.Converters.Autocad.Extensions; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -8,15 +9,15 @@ namespace Speckle.Converters.Autocad2023.ToHost.Raw; public class AutocadPolycurveToHostPolylineRawConverter : ITypedConverter { private readonly ITypedConverter _vectorConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public AutocadPolycurveToHostPolylineRawConverter( ITypedConverter vectorConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _vectorConverter = vectorConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public ADB.Polyline Convert(SOG.Autocad.AutocadPolycurve target) @@ -28,7 +29,7 @@ public ADB.Polyline Convert(SOG.Autocad.AutocadPolycurve target) ); } - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); List points2d = target.value.ConvertToPoint2d(f); ADB.Polyline polyline = diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PointToHostRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PointToHostRawConverter.cs index 7673ac2e7..b70327eb6 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PointToHostRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PointToHostRawConverter.cs @@ -6,16 +6,16 @@ namespace Speckle.Converters.Autocad.ToHost.Raw; public class PointToHostRawConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public PointToHostRawConverter(IConversionContextStack contextStack) + public PointToHostRawConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public AG.Point3d Convert(SOG.Point target) { - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); AG.Point3d point = new(target.x * f, target.y * f, target.z * f); return point; } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PolycurveToHostPolylineRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PolycurveToHostPolylineRawConverter.cs index 1a3425ebe..d7ab9ea8b 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PolycurveToHostPolylineRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/PolycurveToHostPolylineRawConverter.cs @@ -1,3 +1,4 @@ +using Speckle.Converters.Autocad; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -8,15 +9,15 @@ namespace Speckle.Converters.AutocadShared.ToHost.Raw; /// public class PolycurveToHostPolylineRawConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; public PolycurveToHostPolylineRawConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter pointConverter ) { - _contextStack = contextStack; + _settingsStore = settingsStore; _pointConverter = pointConverter; } @@ -26,7 +27,7 @@ public ADB.Polyline Convert(SOG.Polycurve target) AG.Plane plane = new( AG.Point3d.Origin, - AG.Vector3d.ZAxis.TransformBy(_contextStack.Current.Document.Editor.CurrentUserCoordinateSystem) + AG.Vector3d.ZAxis.TransformBy(_settingsStore.Current.Document.Editor.CurrentUserCoordinateSystem) ); int count = 0; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/VectorToHostRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/VectorToHostRawConverter.cs index c08e7eda5..a5630b09c 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/VectorToHostRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToHost/Raw/VectorToHostRawConverter.cs @@ -7,18 +7,18 @@ namespace Speckle.Converters.Autocad.ToHost.Raw; public class VectorToHostRawConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public VectorToHostRawConverter(IConversionContextStack contextStack) + public VectorToHostRawConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((SOG.Vector)target); public AG.Vector3d Convert(SOG.Vector target) { - double f = Units.GetConversionFactor(target.units, _contextStack.Current.SpeckleUnits); + double f = Units.GetConversionFactor(target.units, _settingsStore.Current.SpeckleUnits); return new(target.x * f, target.y * f, target.z * f); } } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs index 536910c54..5e5cffd92 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolyfaceMeshToSpeckleConverter.cs @@ -16,17 +16,17 @@ public class DBPolyfaceMeshToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBPolyfaceMeshToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => RawConvert((ADB.PolyFaceMesh)target); @@ -37,7 +37,7 @@ public SOG.Mesh RawConvert(ADB.PolyFaceMesh target) List faces = new(); List faceVisibility = new(); List colors = new(); - using (ADB.Transaction tr = _contextStack.Current.Document.Database.TransactionManager.StartTransaction()) + using (ADB.Transaction tr = _settingsStore.Current.Document.Database.TransactionManager.StartTransaction()) { foreach (ADB.ObjectId id in target) { @@ -93,8 +93,12 @@ public SOG.Mesh RawConvert(ADB.PolyFaceMesh target) SOG.Box bbox = _boxConverter.Convert(target.GeometricExtents); SOG.Mesh speckleMesh = - new(vertices, faces, colors, null, _contextStack.Current.SpeckleUnits) + new() { + vertices = vertices, + faces = faces, + colors = colors, + units = _settingsStore.Current.SpeckleUnits, bbox = bbox, ["faceVisibility"] = faceVisibility }; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs index e9e27cd84..519e7615f 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline2dToSpeckleConverter.cs @@ -25,7 +25,7 @@ public class Polyline2dToSpeckleConverter private readonly ITypedConverter _splineConverter; private readonly ITypedConverter _vectorConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public Polyline2dToSpeckleConverter( ITypedConverter arcConverter, @@ -34,7 +34,7 @@ public Polyline2dToSpeckleConverter( ITypedConverter splineConverter, ITypedConverter vectorConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _arcConverter = arcConverter; @@ -43,7 +43,7 @@ public Polyline2dToSpeckleConverter( _splineConverter = splineConverter; _vectorConverter = vectorConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Polyline2d)target); @@ -78,7 +78,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline2d target) List vertices = target .GetSubEntities( ADB.OpenMode.ForRead, - _contextStack.Current.Document.TransactionManager.TopTransaction + _settingsStore.Current.Document.TransactionManager.TopTransaction ) .Where(e => e.VertexType != ADB.Vertex2dType.CurveFitVertex && e.VertexType != ADB.Vertex2dType.SplineFitVertex) // Do not collect fit vertex points, they are not used for creation .ToList(); @@ -160,7 +160,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline2d target) if (isSpline) { SOG.Curve spline = _splineConverter.Convert(target.Spline); - SOG.Polyline displayValue = segmentValues.ConvertToSpecklePolyline(_contextStack.Current.SpeckleUnits); + SOG.Polyline displayValue = segmentValues.ConvertToSpecklePolyline(_settingsStore.Current.SpeckleUnits); if (displayValue != null) { spline.displayValue = displayValue; @@ -185,7 +185,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline2d target) length = target.Length, area = target.Area, bbox = bbox, - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; return polycurve; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs index 53c3a5608..42b8b4c13 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/Polyline3dToSpeckleConverter.cs @@ -21,19 +21,19 @@ public class Polyline3dToSpeckleConverter private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _splineConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public Polyline3dToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter splineConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _splineConverter = splineConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Polyline3d)target); @@ -60,7 +60,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline3d target) List vertices = target .GetSubEntities( ADB.OpenMode.ForRead, - _contextStack.Current.Document.TransactionManager.TopTransaction + _settingsStore.Current.Document.TransactionManager.TopTransaction ) .Where(e => e.VertexType != ADB.Vertex3dType.FitVertex) // Do not collect fit vertex points, they are not used for creation .ToList(); @@ -94,7 +94,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline3d target) } } - SOG.Polyline displayValue = segmentValues.ConvertToSpecklePolyline(_contextStack.Current.SpeckleUnits); + SOG.Polyline displayValue = segmentValues.ConvertToSpecklePolyline(_settingsStore.Current.SpeckleUnits); if (displayValue != null) { spline.displayValue = displayValue; @@ -105,7 +105,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline3d target) // for simple polyline3ds just get the polyline segment from the value else { - SOG.Polyline polyline = value.ConvertToSpecklePolyline(_contextStack.Current.SpeckleUnits); + SOG.Polyline polyline = value.ConvertToSpecklePolyline(_settingsStore.Current.SpeckleUnits); if (target.Closed) { polyline.closed = true; @@ -125,7 +125,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline3d target) closed = target.Closed, length = target.Length, bbox = bbox, - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; return polycurve; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs index ac8a1f925..c8e8895de 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/PolylineToSpeckleConverter.cs @@ -19,21 +19,21 @@ public class PolylineToSpeckleConverter private readonly ITypedConverter _arcConverter; private readonly ITypedConverter _vectorConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PolylineToSpeckleConverter( ITypedConverter lineConverter, ITypedConverter arcConverter, ITypedConverter vectorConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _lineConverter = lineConverter; _arcConverter = arcConverter; _vectorConverter = vectorConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Polyline)target); @@ -86,7 +86,7 @@ public SOG.Autocad.AutocadPolycurve Convert(ADB.Polyline target) length = target.Length, area = target.Area, bbox = bbox, - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; return polycurve; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs index ccc33b05b..212a9d93b 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Geometry/SubDMeshToSpeckleConverter.cs @@ -9,17 +9,17 @@ public class DBSubDMeshToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBSubDMeshToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => RawConvert((ADB.SubDMesh)target); @@ -72,7 +72,15 @@ public SOG.Mesh RawConvert(ADB.SubDMesh target) // bbox SOG.Box bbox = _boxConverter.Convert(target.GeometricExtents); - SOG.Mesh speckleMesh = new(vertices, faces, colors, null, _contextStack.Current.SpeckleUnits) { bbox = bbox }; + SOG.Mesh speckleMesh = + new() + { + vertices = vertices, + faces = faces, + colors = colors, + units = _settingsStore.Current.SpeckleUnits, + bbox = bbox + }; return speckleMesh; } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/BoxToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/BoxToSpeckleRawConverter.cs index 79fe86b63..60a675f23 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/BoxToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/BoxToSpeckleRawConverter.cs @@ -7,15 +7,15 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Raw; public class BoxToSpeckleRawConverter : ITypedConverter { private readonly ITypedConverter _planeConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public BoxToSpeckleRawConverter( ITypedConverter planeConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _planeConverter = planeConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Extents3d)target); @@ -29,7 +29,7 @@ public SOG.Box Convert(ADB.Extents3d target) double volume = xSize.Length * ySize.Length * zSize.Length; // get the base plane of the bounding box from extents and current UCS - var ucs = _contextStack.Current.Document.Editor.CurrentUserCoordinateSystem.CoordinateSystem3d; + var ucs = _settingsStore.Current.Document.Editor.CurrentUserCoordinateSystem.CoordinateSystem3d; AG.Plane acadPlane = new(target.MinPoint, ucs.Xaxis, ucs.Yaxis); SOG.Plane plane = _planeConverter.Convert(acadPlane); @@ -40,7 +40,7 @@ public SOG.Box Convert(ADB.Extents3d target) xSize = xSize, ySize = ySize, zSize = zSize, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, volume = volume, }; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/CircularArc3dToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/CircularArc3dToSpeckleRawConverter.cs index e927194a5..912868884 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/CircularArc3dToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/CircularArc3dToSpeckleRawConverter.cs @@ -7,17 +7,17 @@ public class CircularArc3dToSpeckleConverter : ITypedConverter _pointConverter; private readonly ITypedConverter _planeConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public CircularArc3dToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter planeConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _planeConverter = planeConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public SOG.Arc Convert(AG.CircularArc3d target) @@ -27,16 +27,7 @@ public SOG.Arc Convert(AG.CircularArc3d target) SOG.Point end = _pointConverter.Convert(target.EndPoint); double startParam = target.GetParameterOf(target.StartPoint); double endParam = target.GetParameterOf(target.EndPoint); - AG.Point3d midPoint = target.EvaluatePoint(endParam - startParam / 2.0); - - // some circular arcs will **not** return a correct value from `EvaluatePoint` using the indicated parameter at the midpoint. - // so far, this has happened with some arc segments in the polyline method. They will have an end param > 1, and evaluatePoint returns the endpoint - // this is why we are checking for midpoint == endpoint, and using a [0,1] parameterization if this is the case. - if (midPoint.IsEqualTo(target.EndPoint)) - { - midPoint = target.EvaluatePoint(0.5); - } - + AG.Point3d midPoint = target.EvaluatePoint(target.StartAngle + (target.EndAngle - target.StartAngle) / 2); SOG.Point mid = _pointConverter.Convert(midPoint); SOG.Arc arc = @@ -46,7 +37,7 @@ public SOG.Arc Convert(AG.CircularArc3d target) target.StartAngle, target.EndAngle, target.EndAngle - target.StartAngle, // POC: testing, unsure - _contextStack.Current.SpeckleUnits + _settingsStore.Current.SpeckleUnits ) { startPoint = start, diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBArcToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBArcToSpeckleRawConverter.cs index b1cfe0011..1e4d619be 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBArcToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBArcToSpeckleRawConverter.cs @@ -9,19 +9,19 @@ public class DBArcToSpeckleRawConverter : ITypedConverter private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _planeConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBArcToSpeckleRawConverter( ITypedConverter pointConverter, ITypedConverter planeConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _planeConverter = planeConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Arc)target); @@ -42,7 +42,7 @@ public SOG.Arc Convert(ADB.Arc target) target.StartAngle, target.EndAngle, target.TotalAngle, - _contextStack.Current.SpeckleUnits + _settingsStore.Current.SpeckleUnits ) { startPoint = start, diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCircleToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCircleToSpeckleRawConverter.cs index 3029cb006..2014997ff 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCircleToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCircleToSpeckleRawConverter.cs @@ -8,17 +8,17 @@ public class DBCircleToSpeckleRawConverter : ITypedConverter _planeConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBCircleToSpeckleRawConverter( ITypedConverter planeConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _planeConverter = planeConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Circle)target); @@ -32,7 +32,7 @@ public SOG.Circle Convert(ADB.Circle target) { plane = plane, radius = target.Radius, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, length = target.Circumference, bbox = bbox }; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCurveToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCurveToSpeckleRawConverter.cs index 9944f712b..789d6db00 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCurveToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBCurveToSpeckleRawConverter.cs @@ -15,7 +15,7 @@ public class DBCurveToSpeckleRawConverter : ITypedConverter _circleConverter; private readonly ITypedConverter _ellipseConverter; private readonly ITypedConverter _splineConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBCurveToSpeckleRawConverter( ITypedConverter lineConverter, @@ -26,7 +26,7 @@ public DBCurveToSpeckleRawConverter( ITypedConverter circleConverter, ITypedConverter ellipseConverter, ITypedConverter splineConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _lineConverter = lineConverter; @@ -37,7 +37,7 @@ public DBCurveToSpeckleRawConverter( _circleConverter = circleConverter; _ellipseConverter = ellipseConverter; _splineConverter = splineConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBEllipseToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBEllipseToSpeckleRawConverter.cs index 54b1cf947..39acc0a66 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBEllipseToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBEllipseToSpeckleRawConverter.cs @@ -8,17 +8,17 @@ public class DBEllipseToSpeckleRawConverter : ITypedConverter _planeConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBEllipseToSpeckleRawConverter( ITypedConverter planeConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _planeConverter = planeConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Ellipse)target); @@ -37,7 +37,7 @@ public SOG.Ellipse Convert(ADB.Ellipse target) plane = plane, firstRadius = target.MajorRadius, secondRadius = target.MinorRadius, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, domain = new SOP.Interval { start = 0, end = Math.PI * 2 }, trimDomain = trim, length = target.GetDistanceAtParameter(target.EndParam), diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBLineToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBLineToSpeckleRawConverter.cs index 9c70c70e3..666ba22ec 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBLineToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBLineToSpeckleRawConverter.cs @@ -8,29 +8,27 @@ public class DBLineToSpeckleRawConverter : ITypedConverter { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBLineToSpeckleRawConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Line)target); public SOG.Line Convert(ADB.Line target) => - new( - _pointConverter.Convert(target.StartPoint), - _pointConverter.Convert(target.EndPoint), - _contextStack.Current.SpeckleUnits - ) + new() { - length = target.Length, + start = _pointConverter.Convert(target.StartPoint), + end = _pointConverter.Convert(target.EndPoint), + units = _settingsStore.Current.SpeckleUnits, domain = new SOP.Interval { start = 0, end = target.Length }, bbox = _boxConverter.Convert(target.GeometricExtents) }; diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSolid3dToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSolid3dToSpeckleRawConverter.cs index c665b574e..93dcc700d 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSolid3dToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSolid3dToSpeckleRawConverter.cs @@ -8,17 +8,17 @@ public class Solid3dToSpeckleRawConverter : ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public Solid3dToSpeckleRawConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Solid3d)target); @@ -71,9 +71,11 @@ public SOG.Mesh Convert(ADB.Solid3d target) // create speckle mesh SOG.Mesh mesh = - new(convertedVertices, faces) + new() { - units = _contextStack.Current.SpeckleUnits, + vertices = convertedVertices, + faces = faces, + units = _settingsStore.Current.SpeckleUnits, bbox = bbox, area = area, volume = volume diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSplineToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSplineToSpeckleRawConverter.cs index 8c7de2495..608da74b8 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSplineToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/DBSplineToSpeckleRawConverter.cs @@ -10,17 +10,17 @@ public class DBSplineToSpeckleRawConverter : ITypedConverter _intervalConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public DBSplineToSpeckleRawConverter( ITypedConverter intervalConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _intervalConverter = intervalConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((ADB.Spline)target); @@ -109,8 +109,8 @@ public SOG.Curve Convert(ADB.Spline target) length = length, domain = domain, bbox = _boxConverter.Convert(target.GeometricExtents), - units = _contextStack.Current.SpeckleUnits, - displayValue = target.Database is not null ? GetDisplayValue(target) : null!, + units = _settingsStore.Current.SpeckleUnits, + displayValue = target.Database is not null ? GetDisplayValue(target) : null!, //TODO change? }; // POC: get display value if this is a database-resident spline @@ -129,7 +129,7 @@ private SOG.Polyline GetDisplayValue(ADB.Spline spline) case ADB.Polyline2d o: verticesList = o.GetSubEntities( ADB.OpenMode.ForRead, - _contextStack.Current.Document.TransactionManager.TopTransaction + _settingsStore.Current.Document.TransactionManager.TopTransaction ) .Where(e => e.VertexType != ADB.Vertex2dType.SplineControlVertex) // POC: not validated yet! .SelectMany(o => o.Position.ToArray()) @@ -139,7 +139,7 @@ private SOG.Polyline GetDisplayValue(ADB.Spline spline) case ADB.Polyline3d o: verticesList = o.GetSubEntities( ADB.OpenMode.ForRead, - _contextStack.Current.Document.TransactionManager.TopTransaction + _settingsStore.Current.Document.TransactionManager.TopTransaction ) .Where(e => e.VertexType != ADB.Vertex3dType.ControlVertex) .SelectMany(o => o.Position.ToArray()) @@ -147,6 +147,6 @@ private SOG.Polyline GetDisplayValue(ADB.Spline spline) break; } - return verticesList.ConvertToSpecklePolyline(_contextStack.Current.SpeckleUnits); + return verticesList.ConvertToSpecklePolyline(_settingsStore.Current.SpeckleUnits); } } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/LineSegment3dToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/LineSegment3dToSpeckleRawConverter.cs index a184159f0..66a9875d2 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/LineSegment3dToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/LineSegment3dToSpeckleRawConverter.cs @@ -6,25 +6,23 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Raw; public class LineSegment3dToSpeckleRawConverter : ITypedConverter { private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public LineSegment3dToSpeckleRawConverter( ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public SOG.Line Convert(AG.LineSegment3d target) => - new( - _pointConverter.Convert(target.StartPoint), - _pointConverter.Convert(target.EndPoint), - _contextStack.Current.SpeckleUnits - ) + new() { - length = target.Length, + start = _pointConverter.Convert(target.StartPoint), + end = _pointConverter.Convert(target.EndPoint), + units = _settingsStore.Current.SpeckleUnits, domain = new SOP.Interval { start = 0, end = target.Length }, }; } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PlaneToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PlaneToSpeckleRawConverter.cs index 3a569be96..6a24731ed 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PlaneToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PlaneToSpeckleRawConverter.cs @@ -8,17 +8,17 @@ public class PlaneToSpeckleRawConverter : ITypedConverter { private readonly ITypedConverter _vectorConverter; private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PlaneToSpeckleRawConverter( ITypedConverter vectorConverter, ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _vectorConverter = vectorConverter; _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((AG.Plane)target); @@ -30,6 +30,6 @@ public SOG.Plane Convert(AG.Plane target) => normal = _vectorConverter.Convert(target.Normal), xdir = _vectorConverter.Convert(target.GetCoordinateSystem().Xaxis), ydir = _vectorConverter.Convert(target.GetCoordinateSystem().Yaxis), - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, }; } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PointToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PointToSpeckleRawConverter.cs index fde8a9dd1..a1e71fc87 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PointToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/PointToSpeckleRawConverter.cs @@ -5,12 +5,12 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Raw; public class PointToSpeckleRawConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public PointToSpeckleRawConverter(IConversionContextStack contextStack) + public PointToSpeckleRawConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } - public SOG.Point Convert(AG.Point3d target) => new(target.X, target.Y, target.Z, _contextStack.Current.SpeckleUnits); + public SOG.Point Convert(AG.Point3d target) => new(target.X, target.Y, target.Z, _settingsStore.Current.SpeckleUnits); } diff --git a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/VectorToSpeckleRawConverter.cs b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/VectorToSpeckleRawConverter.cs index 2eca1149e..6c9dddf68 100644 --- a/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/VectorToSpeckleRawConverter.cs +++ b/Converters/Autocad/Speckle.Converters.AutocadShared/ToSpeckle/Raw/VectorToSpeckleRawConverter.cs @@ -5,13 +5,13 @@ namespace Speckle.Converters.Autocad.ToSpeckle.Raw; public class VectorToSpeckleRawConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public VectorToSpeckleRawConverter(IConversionContextStack contextStack) + public VectorToSpeckleRawConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } public SOG.Vector Convert(AG.Vector3d target) => - new(target.X, target.Y, target.Z, _contextStack.Current.SpeckleUnits); + new(target.X, target.Y, target.Z, _settingsStore.Current.SpeckleUnits); } diff --git a/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/Civil3dConverterModule.cs b/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/Civil3dConverterModule.cs deleted file mode 100644 index 7e3e7e992..000000000 --- a/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/Civil3dConverterModule.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Autodesk.AutoCAD.ApplicationServices; -using Autodesk.AutoCAD.DatabaseServices; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Autocad; -using Speckle.Converters.Civil3d; -using Speckle.Converters.Common; -using Speckle.Converters.Common.DependencyInjection; - -namespace Speckle.Converters.Civil3d2024.DependencyInjection; - -public class Civil3dConverterModule : ISpeckleModule -{ - public void Load(SpeckleContainerBuilder builder) - { - // Register single root - builder.AddRootCommon(); - - // register all application converters - builder.AddApplicationConverters(); - builder.AddApplicationConverters(); - builder.AddScoped, Civil3dConversionContextStack>(); - builder.AddScoped, AutocadConversionContextStack>(); - } -} diff --git a/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/Speckle.Converters.Civil3d2024.DependencyInjection.csproj b/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/Speckle.Converters.Civil3d2024.DependencyInjection.csproj deleted file mode 100644 index 518746893..000000000 --- a/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/Speckle.Converters.Civil3d2024.DependencyInjection.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - - diff --git a/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/packages.lock.json b/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/packages.lock.json deleted file mode 100644 index aa96ac783..000000000 --- a/Converters/Civil3d/Speckle.Converters.Civil3d2024.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,329 +0,0 @@ -{ - "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.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.civil3d2024": { - "type": "Project", - "dependencies": { - "Speckle.AutoCAD.API": "[2024.0.0, )", - "Speckle.Civil3D.API": "[2024.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.AutoCAD.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2024.0.0", - "contentHash": "pZZ5uI+NXhZaQnsqRkgp/rywqBAjDObDJ9XNFGJvemT5k2OthDpHzlK/mKxz8QDCYie7uImQ8dv3uWj2QUFDPw==" - }, - "Speckle.Civil3D.API": { - "type": "CentralTransitive", - "requested": "[2024.0.0, )", - "resolved": "2024.0.0", - "contentHash": "9Q7M1k0DotN8w7MkiScQezErRdnZ4dAkxBMcPNhHSWoth/lSaT6UPV1aYEdl90RhehJWG4l3O7U2e3OXvVSFdw==", - "dependencies": { - "Speckle.AutoCAD.API": "2024.0.0" - } - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Civil3d/Speckle.Converters.Civil3d2024/packages.lock.json b/Converters/Civil3d/Speckle.Converters.Civil3d2024/packages.lock.json index b12cfb7c7..ef914dc48 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3d2024/packages.lock.json +++ b/Converters/Civil3d/Speckle.Converters.Civil3d2024/packages.lock.json @@ -71,14 +71,6 @@ "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", @@ -106,6 +98,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -139,11 +179,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -176,17 +211,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -200,8 +240,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -213,32 +253,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -248,65 +264,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dConversionContextStack.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dConversionContextStack.cs deleted file mode 100644 index 0d803db25..000000000 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dConversionContextStack.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Speckle.Converters.Common; - -namespace Speckle.Converters.Civil3d; - -// POC: Suppressed naming warning for now, but we should evaluate if we should follow this or disable it. -[SuppressMessage( - "Naming", - "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 Civil3dConversionContextStack : ConversionContextStack -{ - public Civil3dConversionContextStack(IHostToSpeckleUnitConverter unitConverter) - : base( - Application.DocumentManager.CurrentDocument, - GetDocBuiltInUnit(Application.DocumentManager.CurrentDocument), - unitConverter - ) { } - - private static AAEC.BuiltInUnit GetDocBuiltInUnit(Document doc) - { - AAEC.BuiltInUnit unit = AAEC.BuiltInUnit.Dimensionless; - - using (ADB.Transaction tr = doc.Database.TransactionManager.StartTransaction()) - { - ADB.ObjectId id = AAEC.ApplicationServices.DrawingSetupVariables.GetInstance(doc.Database, false); - if (tr.GetObject(id, ADB.OpenMode.ForRead) is AAEC.ApplicationServices.DrawingSetupVariables setupVariables) - { - unit = setupVariables.LinearUnit; - } - - tr.Commit(); - } - - return unit; - } -} diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dConversionSettings.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dConversionSettings.cs new file mode 100644 index 000000000..96d14528c --- /dev/null +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dConversionSettings.cs @@ -0,0 +1,7 @@ +namespace Speckle.Converters.Civil3d; + +public record Civil3dConversionSettings +{ + public Document Document { get; init; } + public string SpeckleUnits { get; init; } +} diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToHostConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToHostConverter.cs index 71c696687..e9dbd3379 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToHostConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Civil3dRootToHostConverter.cs @@ -1,30 +1,31 @@ using Autodesk.AutoCAD.DatabaseServices; -using Speckle.Autofac.DependencyInjection; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk.Common; using Speckle.Sdk.Models; namespace Speckle.Converters.Civil3d; public class Civil3dRootToHostConverter : IRootToSpeckleConverter { - private readonly IFactory _toSpeckle; - private readonly IConversionContextStack _contextStack; + private readonly IConverterManager _toSpeckle; + private readonly IConverterSettingsStore _settingsStore; public Civil3dRootToHostConverter( - IFactory toSpeckle, - IConversionContextStack contextStack + IConverterManager toSpeckle, + IConverterSettingsStore settingsStore ) { _toSpeckle = toSpeckle; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) { if (target is not DBObject dbObject) { - throw new NotSupportedException( + throw new ConversionNotSupportedException( $"Conversion of {target.GetType().Name} to Speckle is not supported. Only objects that inherit from DBObject are." ); } @@ -33,15 +34,15 @@ public Base Convert(object target) try { - using (var l = _contextStack.Current.Document.LockDocument()) + using (var l = _settingsStore.Current.Document.LockDocument()) { - using (var tr = _contextStack.Current.Document.Database.TransactionManager.StartTransaction()) + using (var tr = _settingsStore.Current.Document.Database.TransactionManager.StartTransaction()) { - var objectConverter = _toSpeckle.ResolveInstance(type.Name); + var objectConverter = _toSpeckle.ResolveConverter(type); if (objectConverter == null) { - throw new NotSupportedException($"No conversion found for {target.GetType().Name}"); + throw new ConversionNotSupportedException($"No conversion found for {target.GetType().Name}"); } var convertedObject = objectConverter.Convert(dbObject); diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ServiceRegistration.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ServiceRegistration.cs new file mode 100644 index 000000000..0b001f819 --- /dev/null +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ServiceRegistration.cs @@ -0,0 +1,35 @@ +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Autocad; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk; + +namespace Speckle.Converters.Civil3d; + +public static class ServiceRegistration +{ + public static void AddCivil3dConverters(this IServiceCollection serviceCollection) + { + var civil3dAssembly = typeof(Civil3dConversionSettings).Assembly; + var autocadAssembly = typeof(AutocadConversionSettings).Assembly; + //register types by default + serviceCollection.AddMatchingInterfacesAsTransient(civil3dAssembly); + serviceCollection.AddMatchingInterfacesAsTransient(autocadAssembly); + // Register single root + serviceCollection.AddRootCommon(civil3dAssembly); + + // register all application converters + serviceCollection.AddApplicationConverters( + civil3dAssembly + ); + serviceCollection.AddApplicationConverters(autocadAssembly); + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + } +} diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems index 1dc6ebd3b..117817a09 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/Speckle.Converters.Civil3dShared.projitems @@ -9,10 +9,11 @@ Speckle.Converters.Civil3dShared - + + diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/PipeToSpeckleConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/PipeToSpeckleConverter.cs index dc8149972..d79ea563f 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/PipeToSpeckleConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/BuiltElements/PipeToSpeckleConverter.cs @@ -15,7 +15,7 @@ public class PipeToSpeckleConverter : IToSpeckleTopLevelConverter private readonly ITypedConverter _boxConverter; private readonly ITypedConverter _solidConverter; private readonly ITypedConverter> _propertySetConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PipeToSpeckleConverter( ITypedConverter pointConverter, @@ -23,7 +23,7 @@ public PipeToSpeckleConverter( ITypedConverter boxConverter, ITypedConverter solidConverter, ITypedConverter> propertySetConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; @@ -31,7 +31,7 @@ public PipeToSpeckleConverter( _boxConverter = boxConverter; _solidConverter = solidConverter; _propertySetConverter = propertySetConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((CDB.Pipe)target); @@ -48,7 +48,7 @@ public SOBE.Pipe Convert(CDB.Pipe target) diameter = target.InnerDiameterOrWidth, length = target.Length3DToInsideEdge, displayValue = new List { pipeMesh }, - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; // POC: not setting property sets yet, need to determine connector parameter interoperability diff --git a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/PropertySetToSpeckleRawConverter.cs b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/PropertySetToSpeckleRawConverter.cs index d80c8c205..c2517f70b 100644 --- a/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/PropertySetToSpeckleRawConverter.cs +++ b/Converters/Civil3d/Speckle.Converters.Civil3dShared/ToSpeckle/Raw/PropertySetToSpeckleRawConverter.cs @@ -9,17 +9,17 @@ public class PropertySetToSpeckleRawConverter : ITypedConverter _vectorConverter; private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PropertySetToSpeckleRawConverter( ITypedConverter vectorConverter, ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _vectorConverter = vectorConverter; _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public List Convert(object target) => Convert((AECPropDB.PropertySet)target); @@ -28,7 +28,8 @@ public List Convert(AECPropDB.PropertySet target) { List properties = new(); - ADB.Transaction tr = _contextStack.Current.Document.TransactionManager.TopTransaction; + //TODO using? + ADB.Transaction tr = _settingsStore.Current.Document.TransactionManager.TopTransaction; AECPropDB.PropertySetDefinition setDef = (AECPropDB.PropertySetDefinition) tr.GetObject(target.PropertySetDefinition, ADB.OpenMode.ForRead); diff --git a/Converters/Revit/Speckle.Converters.Revit2022.DependencyInjection/Speckle.Converters.Revit2022.DependencyInjection.csproj b/Converters/Revit/Speckle.Converters.Revit2022.DependencyInjection/Speckle.Converters.Revit2022.DependencyInjection.csproj deleted file mode 100644 index 659f7ab05..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2022.DependencyInjection/Speckle.Converters.Revit2022.DependencyInjection.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - diff --git a/Converters/Revit/Speckle.Converters.Revit2022.DependencyInjection/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2022.DependencyInjection/packages.lock.json deleted file mode 100644 index b163aa2ea..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2022.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,320 +0,0 @@ -{ - "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, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.revit2022": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Converters.Common.DependencyInjection": "[1.0.0, )", - "Speckle.Revit.API": "[2022.0.2.1, )" - } - }, - "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.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Revit.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2022.0.2.1", - "contentHash": "IrLN4WyI2ix+g3zCpo7sX8zNB3FrtrdQ3E2RpceGVPNG00v8OfD+Kei7o1bn1u/ML46iBYRAr/JcsLbwfUQsBw==" - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.Revit2022.Tests/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2022.Tests/packages.lock.json index c916d8428..3dbff6d8e 100644 --- a/Converters/Revit/Speckle.Converters.Revit2022.Tests/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2022.Tests/packages.lock.json @@ -156,6 +156,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -216,11 +264,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -251,6 +294,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -287,28 +335,21 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "4.4.0", "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.testing": { @@ -318,43 +359,49 @@ "NUnit": "[4.1.0, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.Revit2022/Speckle.Converters.Revit2022.csproj b/Converters/Revit/Speckle.Converters.Revit2022/Speckle.Converters.Revit2022.csproj index b5e3408f7..32599b3d9 100644 --- a/Converters/Revit/Speckle.Converters.Revit2022/Speckle.Converters.Revit2022.csproj +++ b/Converters/Revit/Speckle.Converters.Revit2022/Speckle.Converters.Revit2022.csproj @@ -15,7 +15,6 @@ - diff --git a/Converters/Revit/Speckle.Converters.Revit2022/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2022/packages.lock.json index 43ae6412f..864ede376 100644 --- a/Converters/Revit/Speckle.Converters.Revit2022/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2022/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,72 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj b/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj deleted file mode 100644 index 333b08a8e..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/Speckle.Converters.Revit2023.DependencyInjection.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - diff --git a/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json deleted file mode 100644 index 1c623ec50..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2023.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.revit2023": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Revit.API": "[2023.0.0, )" - } - }, - "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.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Revit.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2023.0.0", - "contentHash": "tq40eD7psgTbV+epNouYyqfo6+hEi7FmXZqcxEOsAV7zfYyWhL6Rt3vmojkWGNuerGbH6oRI6KIIxrnlCNb8Hw==" - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json index bc58a32eb..68a841dfb 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2023.Tests/packages.lock.json @@ -156,6 +156,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -216,11 +264,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -251,6 +294,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -287,28 +335,21 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "4.4.0", "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.testing": { @@ -318,43 +359,49 @@ "NUnit": "[4.1.0, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json index 230c1062f..9d9b1da8e 100644 --- a/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2023/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,65 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.Revit2024.DependencyInjection/Speckle.Converters.Revit2024.DependencyInjection.csproj b/Converters/Revit/Speckle.Converters.Revit2024.DependencyInjection/Speckle.Converters.Revit2024.DependencyInjection.csproj deleted file mode 100644 index 409a718f5..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2024.DependencyInjection/Speckle.Converters.Revit2024.DependencyInjection.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net48 - x64 - Debug;Release;Local - - - - - - - - - - - diff --git a/Converters/Revit/Speckle.Converters.Revit2024.DependencyInjection/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2024.DependencyInjection/packages.lock.json deleted file mode 100644 index 78a4a818d..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2024.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.revit2024": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Revit.API": "[2024.0.0, )" - } - }, - "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.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Revit.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2024.0.0", - "contentHash": "a4dsvZ00ocvzTgCD6dUdydf0jIZDVcDhs6dUX9cv+y3aTDbU8rmzhYXWt8sThedIG+IPSVa0vHmAH9pKiJL3SQ==" - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.Revit2024.Tests/Speckle.Converters.Revit2024.Tests.csproj b/Converters/Revit/Speckle.Converters.Revit2024.Tests/Speckle.Converters.Revit2024.Tests.csproj index 43d7c78d9..58a09acda 100644 --- a/Converters/Revit/Speckle.Converters.Revit2024.Tests/Speckle.Converters.Revit2024.Tests.csproj +++ b/Converters/Revit/Speckle.Converters.Revit2024.Tests/Speckle.Converters.Revit2024.Tests.csproj @@ -25,6 +25,6 @@ - + diff --git a/Converters/Revit/Speckle.Converters.Revit2024.Tests/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2024.Tests/packages.lock.json index df0868eeb..cdf30fe53 100644 --- a/Converters/Revit/Speckle.Converters.Revit2024.Tests/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2024.Tests/packages.lock.json @@ -78,7 +78,7 @@ }, "Speckle.Revit2024.Fakes": { "type": "Direct", - "requested": "[0.3.0, )", + "requested": "[0.3.0, 1.0.0)", "resolved": "0.3.0", "contentHash": "gBwoXQDphcbfexbNojI+9Isht8M3citP9j3cMMsnDJPlj7l1rXHzFmzZ7sn0OzuKzmcG92sGvyR1RvsGUtfqYw==", "dependencies": { @@ -156,6 +156,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -216,11 +264,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -251,6 +294,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -287,28 +335,21 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "4.4.0", "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.testing": { @@ -318,43 +359,49 @@ "NUnit": "[4.1.0, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.Revit2024/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2024/packages.lock.json index d05968287..401fd38c2 100644 --- a/Converters/Revit/Speckle.Converters.Revit2024/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2024/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,65 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.Revit2025.DependencyInjection/Speckle.Converters.Revit2025.DependencyInjection.csproj b/Converters/Revit/Speckle.Converters.Revit2025.DependencyInjection/Speckle.Converters.Revit2025.DependencyInjection.csproj deleted file mode 100644 index de65bc22d..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2025.DependencyInjection/Speckle.Converters.Revit2025.DependencyInjection.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net8.0-windows - x64 - Debug;Release;Local - - - - - - - - - - - diff --git a/Converters/Revit/Speckle.Converters.Revit2025.DependencyInjection/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2025.DependencyInjection/packages.lock.json deleted file mode 100644 index 84d22454d..000000000 --- a/Converters/Revit/Speckle.Converters.Revit2025.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "version": 2, - "dependencies": { - "net8.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" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.3", - "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.revit2025": { - "type": "Project", - "dependencies": { - "Speckle.Converters.Common": "[1.0.0, )", - "Speckle.Revit.API": "[2025.0.0, )" - } - }, - "Autofac": { - "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Revit.API": { - "type": "CentralTransitive", - "requested": "[2023.0.0, )", - "resolved": "2025.0.0", - "contentHash": "Hwf/3Ydc7KxvjgD9pSZKLSJRsFTsxYg95YyTm6f43hcsGjmk49GsLFQt921Z9OcvUVewOggQHcmBgti+P2EPHw==" - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.Revit2025/packages.lock.json b/Converters/Revit/Speckle.Converters.Revit2025/packages.lock.json index 64a398da3..e72b2bd01 100644 --- a/Converters/Revit/Speckle.Converters.Revit2025/packages.lock.json +++ b/Converters/Revit/Speckle.Converters.Revit2025/packages.lock.json @@ -88,6 +88,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -121,11 +169,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -156,6 +199,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -166,62 +214,61 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/RevitConverterModule.cs b/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/RevitConverterModule.cs index 5335c03ad..d2daf71af 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/RevitConverterModule.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/RevitConverterModule.cs @@ -4,6 +4,8 @@ using Speckle.Converters.Common.DependencyInjection; using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Converters.RevitShared.ToSpeckle; namespace Speckle.Converters.RevitShared.DependencyInjection; @@ -12,7 +14,7 @@ public class RevitConverterModule : ISpeckleModule public void Load(SpeckleContainerBuilder builder) { //register types by default - builder.ScanAssemblyOfType(); + builder.ScanAssemblyOfType(); // Register single root builder.AddRootCommon(); @@ -29,7 +31,10 @@ public void Load(SpeckleContainerBuilder builder) builder.AddScoped(); // POC: the concrete type can come out if we remove all the reference to it - builder.AddScoped(); + builder.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); builder.AddScoped(); @@ -38,9 +43,11 @@ public void Load(SpeckleContainerBuilder builder) builder.AddScoped(); builder.AddScoped(); builder.AddScoped(); - builder.AddScoped(); builder.AddScoped(); builder.AddScoped(); + + builder.AddScoped(); + builder.AddScoped(); } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/Speckle.Converters.RevitShared.DependencyInjection.projitems b/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/Speckle.Converters.RevitShared.DependencyInjection.projitems deleted file mode 100644 index 27e72735b..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/Speckle.Converters.RevitShared.DependencyInjection.projitems +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 9655be78-8070-4c9f-b0dc-68cb6150b52c - - - Speckle.Converters.RevitShared.DependencyInjection - - - - - \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/Speckle.Converters.RevitShared.DependencyInjection.shproj b/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/Speckle.Converters.RevitShared.DependencyInjection.shproj deleted file mode 100644 index 82d8850e4..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared.DependencyInjection/Speckle.Converters.RevitShared.DependencyInjection.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - {E1C43415-3200-45F4-8BF2-A4DD7D7F2ED6} - 14.0 - - - - - - - - \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.RevitShared.Tests/ModelCurveArrayToSpeckleConverterTests.cs b/Converters/Revit/Speckle.Converters.RevitShared.Tests/ModelCurveArrayToSpeckleConverterTests.cs index e7da376ba..239def92f 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared.Tests/ModelCurveArrayToSpeckleConverterTests.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared.Tests/ModelCurveArrayToSpeckleConverterTests.cs @@ -2,9 +2,9 @@ using NUnit.Framework; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Raw; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Testing; @@ -15,7 +15,7 @@ public class ModelCurveArrayToSpeckleConverterTests : MoqTest [Test] public void Convert_Empty() { - var revitConversionContextStack = Create(); + var revitConversionContextStack = Create>(); var scalingServiceToSpeckle = Create(); var curveConverter = Create>(); @@ -32,7 +32,7 @@ public void Convert_Empty() [Test] public void Convert() { - var revitConversionContextStack = Create(); + var revitConversionContextStack = Create>(); var scalingServiceToSpeckle = Create(); var curveConverter = Create>(); @@ -50,11 +50,10 @@ public void Convert() geometry2.Setup(x => x.Length).Returns(3); geometry2.Setup(x => x.GetEndPoint(1)).Returns(endpoint2.Object); - var context = Create>(); - revitConversionContextStack.Setup(x => x.Current).Returns(context.Object); - var units = "units"; - context.Setup(x => x.SpeckleUnits).Returns(units); + revitConversionContextStack + .Setup(x => x.Current) + .Returns(new RevitConversionSettings(null!, DetailLevelType.Coarse, null, units, false)); var scaleLength = 2.2; scalingServiceToSpeckle.Setup(x => x.ScaleLength(2 + 3)).Returns(scaleLength); diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs b/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs index c8ac6f92e..55548012e 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/Extensions/ParameterExtensions.cs @@ -2,6 +2,7 @@ namespace Speckle.Converters.RevitShared.Extensions; +[Obsolete("Will be removed in the near future")] public static class ParameterExtensions { /// @@ -16,16 +17,14 @@ public static string GetInternalName(this DB.Parameter rp) { return rp.GUID.ToString(); } - else - { - var def = (InternalDefinition)rp.Definition; - if (def.BuiltInParameter == BuiltInParameter.INVALID) - { - return def.Name; - } - return def.BuiltInParameter.ToString(); + var def = (InternalDefinition)rp.Definition; + if (def.BuiltInParameter == BuiltInParameter.INVALID) + { + return def.Name; } + + return def.BuiltInParameter.ToString(); } public static BuiltInParameter? GetBuiltInParameter(this Parameter rp) diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs index df4f89988..d0f13f026 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/DisplayValueExtractor.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk.Common; @@ -13,7 +14,7 @@ private readonly ITypedConverter< List > _meshByMaterialConverter; private readonly ILogger _logger; - private readonly IRevitConversionContextStack _revitConversionContextStack; + private readonly IConverterSettingsStore _converterSettings; public DisplayValueExtractor( ITypedConverter< @@ -21,12 +22,12 @@ public DisplayValueExtractor( List > meshByMaterialConverter, ILogger logger, - IRevitConversionContextStack revitConversionContextStack + IConverterSettingsStore converterSettings ) { _meshByMaterialConverter = meshByMaterialConverter; _logger = logger; - _revitConversionContextStack = revitConversionContextStack; + _converterSettings = converterSettings; } public List GetDisplayValue(DB.Element element, DB.Options? options = null) @@ -67,7 +68,12 @@ IRevitConversionContextStack revitConversionContextStack meshesByMaterial[materialId] = value; } - value.Add(face.Triangulate()); + var mesh = face.Triangulate(); //Revit API can return null here + if (mesh is null) + { + continue; + } + value.Add(mesh); } } @@ -86,10 +92,7 @@ IRevitConversionContextStack revitConversionContextStack private (List, List) GetSolidsAndMeshesFromElement(DB.Element element, DB.Options? options) { //options = ViewSpecificOptions ?? options ?? new Options() { DetailLevel = DetailLevelSetting }; - options ??= new DB.Options - { - DetailLevel = _detailLevelMap[_revitConversionContextStack.ToSpeckleSettings.DetailLevel] - }; + options ??= new DB.Options { DetailLevel = _detailLevelMap[_converterSettings.Current.DetailLevel] }; DB.GeometryElement geom; try diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs deleted file mode 100644 index 1c9431a28..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/IRevitConversionContextStack.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Autodesk.Revit.DB; -using Speckle.Converters.Common; -using Speckle.Converters.RevitShared.Settings; - -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 -{ - public RevitMaterialCacheSingleton RenderMaterialProxyCache { get; } - public ToSpeckleSettings ToSpeckleSettings { get; } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs deleted file mode 100644 index 493e2e440..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/ParameterObjectAssigner.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Autodesk.Revit.DB; -using Microsoft.Extensions.Logging; -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Sdk.Models; - -namespace Speckle.Converters.RevitShared.Helpers; - -// POC: rationalise whether this and ParameterObjectBuilder are sufficiently different?? -// did it go away? -public sealed class ParameterObjectAssigner -{ - private readonly ITypedConverter _paramConverter; - private readonly ParameterValueExtractor _parameterValueExtractor; - private readonly ILogger _logger; - - public ParameterObjectAssigner( - ITypedConverter paramConverter, - ParameterValueExtractor parameterValueExtractor, - ILogger logger - ) - { - _paramConverter = paramConverter; - _parameterValueExtractor = parameterValueExtractor; - _logger = logger; - } - - public void AssignParametersToBase(Element target, Base @base) - { - 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 != ElementId.InvalidElementId && target is not Level) //ignore type props of levels..! - { - var elementType = target.Document.GetElement(elementId); - // I don't think we should be adding the type parameters to the object like this - Dictionary typeParameters = _parameterValueExtractor.GetAllRemainingParams(elementType); - AssignSpeckleParamToBaseObject(typeParameters, paramBase, true); - } - - if (paramBase.GetMembers(DynamicBaseMemberType.Dynamic).Count > 0) - { - @base["parameters"] = paramBase; - } - } - - private void AssignSpeckleParamToBaseObject( - IEnumerable> parameters, - Base paramBase, - bool isTypeParameter = false - ) - { - //sort by key - foreach (var kv in parameters.OrderBy(x => x.Key)) - { - try - { - SOBR.Parameter speckleParam = _paramConverter.Convert(kv.Value); - speckleParam.isTypeParameter = isTypeParameter; - paramBase[kv.Key] = speckleParam; - } - // POC swallow and continue seems bad? - // maybe hoover these into one exception or into our reporting strategy - catch (InvalidPropNameException) - { - //ignore - } - // POC swallow and continue seems bad? - // maybe hoover these into one exception or into our reporting strategy - catch (SpeckleConversionException ex) - { - _logger.LogWarning(ex, $"Error thrown when trying to set property named {kv.Key}"); - } - } - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs deleted file mode 100644 index 7c6d1590d..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitConversionContextStack.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Autodesk.Revit.DB; -using Speckle.Converters.Common; -using Speckle.Converters.RevitShared.Settings; - -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 ToSpeckleSettings ToSpeckleSettings { get; } - - /// - /// Persistent cache (across conversions) for all generated render material proxies. Note this cache stores a list of render material proxies per element id. - /// - public RevitMaterialCacheSingleton RenderMaterialProxyCache { get; } - - public const double TOLERANCE = 0.0164042; // 5mm in ft - - public RevitConversionContextStack( - RevitContext context, - IHostToSpeckleUnitConverter unitConverter, - RevitMaterialCacheSingleton renderMaterialProxyCache, - ToSpeckleSettings toSpeckleSettings - ) - : 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 - ) - { - ToSpeckleSettings = toSpeckleSettings; - RenderMaterialProxyCache = renderMaterialProxyCache; - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitMaterialCacheSingleton.cs b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitMaterialCacheSingleton.cs index 919409bfa..2a441f241 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitMaterialCacheSingleton.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/Helpers/RevitMaterialCacheSingleton.cs @@ -8,6 +8,7 @@ namespace Speckle.Converters.RevitShared.Helpers; /// /// Why is this needed? Because two reasons: send caching bypasses converter and revit conversions typically generate multiple display values per element. Ask dim for more and he might start crying. /// +/// TODO: this dude needs to be split into single responsability (render materials and material quantities), and removed from the context - as it's not needed for it to be there. It can be DI'ed as appropriate (see ParameterDefinitionHandler) /// public class RevitMaterialCacheSingleton { @@ -17,6 +18,11 @@ public class RevitMaterialCacheSingleton /// public Dictionary> ObjectRenderMaterialProxiesMap { get; } = new(); + /// + /// POC: The map we mutate PER RECEIVE operation, this smells a LOT! Once we have better conversion context stack that we can manage our data between connector - converter, this property must go away! + /// + public Dictionary ObjectIdAndMaterialIndexMap { get; } = new(); + /// /// map (DB.Material id, RevitMaterial). This can be generated from converting render materials or material quantities. /// diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs index 0872d3494..b24c986ba 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ReferencePointConverter.cs @@ -1,21 +1,18 @@ +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; + namespace Speckle.Converters.RevitShared.Helpers; /// /// POC: reference point functionality needs to be revisited (we are currently baking in these transforms into all geometry using the point and vector converters, and losing the transform). /// This converter uses the transform in the reference point setting and provides methods to transform points /// -public class ReferencePointConverter : IReferencePointConverter +public class ReferencePointConverter(IConverterSettingsStore converterSettings) + : IReferencePointConverter { - private readonly IRevitConversionContextStack _contextStack; - - public ReferencePointConverter(IRevitConversionContextStack contextStack) - { - _contextStack = contextStack; - } - public DB.XYZ ConvertToExternalCoordinates(DB.XYZ p, bool isPoint) { - if (_contextStack.ToSpeckleSettings.ReferencePointTransform is DB.Transform transform) + if (converterSettings.Current.ReferencePointTransform is DB.Transform transform) { return isPoint ? transform.Inverse.OfPoint(p) : transform.Inverse.OfVector(p); } @@ -25,7 +22,7 @@ public DB.XYZ ConvertToExternalCoordinates(DB.XYZ p, bool isPoint) public DB.XYZ ConvertToInternalCoordinates(DB.XYZ p, bool isPoint) { - if (_contextStack.ToSpeckleSettings.ReferencePointTransform is DB.Transform transform) + if (converterSettings.Current.ReferencePointTransform is DB.Transform transform) { return isPoint ? transform.OfPoint(p) : transform.OfVector(p); } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs index c130c30c6..505ca0d9e 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToHostConverter.cs @@ -1,28 +1,68 @@ +using Autodesk.Revit.DB; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk.Models; namespace Speckle.Converters.RevitShared; public class RevitRootToHostConverter : IRootToHostConverter { - private readonly IConverterResolver _converterResolver; + private readonly IConverterSettingsStore _converterSettings; + private readonly ITypedConverter> _baseToGeometryConverter; - public RevitRootToHostConverter(IConverterResolver converterResolver) + public RevitRootToHostConverter( + ITypedConverter> baseToGeometryConverter, + IConverterSettingsStore converterSettings + ) { - _converterResolver = converterResolver; + _baseToGeometryConverter = baseToGeometryConverter; + _converterSettings = converterSettings; } public object Convert(Base target) { - var objectConverter = _converterResolver.GetConversionForType(target.GetType()); + List geometryObjects = _baseToGeometryConverter.Convert(target); - if (objectConverter == null) + if (geometryObjects.Count == 0) { - throw new SpeckleConversionException($"No conversion found for {target.GetType().Name}"); + throw new SpeckleConversionException($"No supported conversion for {target.speckle_type} found."); } - return objectConverter.Convert(target) - ?? throw new SpeckleConversionException($"Conversion of object with type {target.GetType()} returned null"); + // create direct shape from geometries + DB.DirectShape result = CreateDirectShape(geometryObjects, target["category"] as string); + + return result; + } + + private DB.DirectShape CreateDirectShape(List geometry, string? category) + { + // set ds category + var dsCategory = BuiltInCategory.OST_GenericModel; + if (category is string categoryString) + { + var res = Enum.TryParse($"OST_{categoryString}", out DB.BuiltInCategory cat); + if (res) + { + var c = Category.GetCategory(_converterSettings.Current.Document, cat); + if (c is not null && DirectShape.IsValidCategoryId(c.Id, _converterSettings.Current.Document)) + { + dsCategory = cat; + } + } + } + + var result = DirectShape.CreateElement(_converterSettings.Current.Document, new DB.ElementId(dsCategory)); + + // check for valid geometry + if (!result.IsValidShape(geometry)) + { + _converterSettings.Current.Document.Delete(result.Id); + throw new SpeckleConversionException("Invalid geometry (eg unbounded curves) found for creating directshape."); + } + + result.SetShape(geometry); + + return result; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs index db0dac628..120f81c37 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/RevitRootToSpeckleConverter.cs @@ -1,37 +1,48 @@ +using Autodesk.Revit.DB; +using Microsoft.Extensions.Logging; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.Common.Registration; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Sdk; using Speckle.Sdk.Models; namespace Speckle.Converters.RevitShared; -// POC: maybe possible to restrict the access so this cannot be created directly? public class RevitRootToSpeckleConverter : IRootToSpeckleConverter { - private readonly IConverterResolver _toSpeckle; - private readonly ParameterValueExtractor _parameterValueExtractor; + private readonly IConverterManager _toSpeckle; private readonly ITypedConverter>> _materialQuantityConverter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; + private readonly ParameterExtractor _parameterExtractor; + private readonly ILogger _logger; + + private readonly Dictionary _worksetCache = new(); public RevitRootToSpeckleConverter( - IConverterResolver toSpeckle, - ParameterValueExtractor parameterValueExtractor, + IConverterManager toSpeckle, ITypedConverter>> materialQuantityConverter, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings, + ParameterExtractor parameterExtractor, + ILogger logger ) { _toSpeckle = toSpeckle; - _parameterValueExtractor = parameterValueExtractor; _materialQuantityConverter = materialQuantityConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; + _parameterExtractor = parameterExtractor; + _logger = logger; } - // 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 (target is not DB.Element element) + { + throw new SpeckleConversionException($"Target object is not a db element, it's a {target.GetType()}"); + } + + var objectConverter = _toSpeckle.ResolveConverter(target.GetType(), true); if (objectConverter == null) { @@ -42,33 +53,44 @@ public Base Convert(object target) objectConverter.Convert(target) ?? throw new SpeckleConversionException($"Conversion of object with type {target.GetType()} returned null"); - if (target is DB.Element element) // Note: aren't all targets DB elements? + result.applicationId = element.UniqueId; + + // POC DirectShapes have RevitCategory enum as the type or the category property, DS category property is already set in the converter + // trying to set the category as a string will throw + // the category should be moved to be set in each converter instead of the root to speckle converter + if (target is not DB.DirectShape) { - result.applicationId = element.UniqueId; + result["category"] = element.Category?.Name; + } - // POC DirectShapes have RevitCategory enum as the type or the category property, DS category property is already set in the converter - // trying to set the category as a string will throw - // the category should be moved to be set in each converter instead of the root to speckle converter - if (target is not DB.DirectShape) - { - result["category"] = element.Category?.Name; - } + try + { + result["materialQuantities"] = _materialQuantityConverter.Convert(element); + } + catch (Exception e) when (!e.IsFatal()) + { + _logger.LogWarning(e, $"Failed to extract material quantities from element {target.GetType().Name}"); + } - try - { - result["materialQuantities"] = _materialQuantityConverter.Convert(element); - } - catch (Exception e) when (!e.IsFatal()) - { - // TODO: report quantities not retrievable - } + try + { + var parameters = _parameterExtractor.GetParameters(element); + // NOTE: we're conflicting with a strongly typed (Base) `parameters` property set on revit elements. We can revert this to be back to parameters later, but this will mean frontend legwork to add another special parsing case for the properties view of an object. + result["properties"] = parameters; + } + catch (Exception e) when (!e.IsFatal()) + { + _logger.LogWarning(e, $"Failed to extract parameters from element {target.GetType().Name}"); + } - // POC: we've discussed sending Materials as Proxies, containing the object ids of material quantities. - // POC: this would require redesigning the MaterialQuantities class to no longer have Material as a property. TBD post december. - // POC: should we assign parameters here instead? - //_parameterObjectAssigner.AssignParametersToBase(element, result); - // _parameterValueExtractor.RemoveUniqueId(element.UniqueId); + result["worksetId"] = element.WorksetId.ToString(); + if (!_worksetCache.TryGetValue(element.WorksetId, out var worksetName)) + { + Workset workset = _converterSettings.Current.Document.GetWorksetTable().GetWorkset(element.WorksetId); + worksetName = workset.Name; + _worksetCache[element.WorksetId] = worksetName; } + result["worksetName"] = worksetName; return result; } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ServiceRegistration.cs b/Converters/Revit/Speckle.Converters.RevitShared/ServiceRegistration.cs new file mode 100644 index 000000000..787d41326 --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/ServiceRegistration.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Registration; +using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Converters.RevitShared.ToSpeckle; +using Speckle.Sdk; + +namespace Speckle.Converters.RevitShared; + +public static class ServiceRegistration +{ + public static IServiceCollection AddRevitConverters(this IServiceCollection serviceCollection) + { + var converterAssembly = Assembly.GetExecutingAssembly(); + //register types by default + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + // Register single root + serviceCollection.AddRootCommon(converterAssembly); + + // register all application converters + serviceCollection.AddApplicationConverters(converterAssembly); + + serviceCollection.AddScoped(); + serviceCollection.AddSingleton(new RevitContext()); + + serviceCollection.AddSingleton(new RevitMaterialCacheSingleton()); + + // POC: do we need ToSpeckleScalingService as is, do we need to interface it out? + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + // POC: the concrete type can come out if we remove all the reference to it + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + return serviceCollection; + } +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs index d254974af..c081a4629 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/Services/ScalingServiceToSpeckle.cs @@ -1,5 +1,6 @@ using Autodesk.Revit.DB; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Settings; using Speckle.InterfaceGenerator; namespace Speckle.Converters.RevitShared.Services; @@ -12,10 +13,10 @@ public sealed class ScalingServiceToSpeckle : IScalingServiceToSpeckle private readonly double _defaultLengthConversionFactor; // POC: this seems like the reverse relationship - public ScalingServiceToSpeckle(IRevitConversionContextStack contextStack) + public ScalingServiceToSpeckle(IConverterSettingsStore converterSettings) { // POC: this is accurate for the current context stack - Units documentUnits = contextStack.Current.Document.GetUnits(); + Units documentUnits = converterSettings.Current.Document.GetUnits(); FormatOptions formatOptions = documentUnits.GetFormatOptions(SpecTypeId.Length); var lengthUnitsTypeId = formatOptions.GetUnitTypeId(); _defaultLengthConversionFactor = ScaleStatic(1, lengthUnitsTypeId); diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Settings/DetailLevelType.cs b/Converters/Revit/Speckle.Converters.RevitShared/Settings/DetailLevelType.cs new file mode 100644 index 000000000..21dc0a31b --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/Settings/DetailLevelType.cs @@ -0,0 +1,8 @@ +namespace Speckle.Converters.RevitShared.Settings; + +public enum DetailLevelType +{ + Coarse, + Medium, + Fine +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Settings/ReferencePointType.cs b/Converters/Revit/Speckle.Converters.RevitShared/Settings/ReferencePointType.cs new file mode 100644 index 000000000..0a21caa9f --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/Settings/ReferencePointType.cs @@ -0,0 +1,8 @@ +namespace Speckle.Converters.RevitShared.Settings; + +public enum ReferencePointType +{ + InternalOrigin, + ProjectBase, + Survey +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Settings/RevitConversionSettings.cs b/Converters/Revit/Speckle.Converters.RevitShared/Settings/RevitConversionSettings.cs new file mode 100644 index 000000000..45e0e8b53 --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/Settings/RevitConversionSettings.cs @@ -0,0 +1,10 @@ +namespace Speckle.Converters.RevitShared.Settings; + +public record RevitConversionSettings( + DB.Document Document, + DetailLevelType DetailLevel, + DB.Transform? ReferencePointTransform, + string SpeckleUnits, + bool SendParameterNullOrEmptyStrings, + double Tolerance = 0.0164042 // 5mm in ft +); diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Settings/RevitConversionSettingsFactory.cs b/Converters/Revit/Speckle.Converters.RevitShared/Settings/RevitConversionSettingsFactory.cs new file mode 100644 index 000000000..93339a409 --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/Settings/RevitConversionSettingsFactory.cs @@ -0,0 +1,31 @@ +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Helpers; +using Speckle.InterfaceGenerator; +using Speckle.Sdk.Common; + +namespace Speckle.Converters.RevitShared.Settings; + +[GenerateAutoInterface] +public class RevitConversionSettingsFactory( + RevitContext revitContext, + IHostToSpeckleUnitConverter unitConverter +) : IRevitConversionSettingsFactory +{ + public RevitConversionSettings Create( + DetailLevelType detailLevelType, + DB.Transform? referencePointTransform, + bool sendEmptyOrNullParams, + double tolerance = 0.0164042 // 5mm in ft + ) + { + var document = revitContext.UIApplication.NotNull().ActiveUIDocument.Document; + return new( + document, + detailLevelType, + referencePointTransform, + unitConverter.ConvertOrThrow(document.GetUnits().GetFormatOptions(DB.SpecTypeId.Length).GetUnitTypeId()), + sendEmptyOrNullParams, + tolerance + ); + } +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Settings/ToSpeckleSettings.cs b/Converters/Revit/Speckle.Converters.RevitShared/Settings/ToSpeckleSettings.cs deleted file mode 100644 index 379dc6b1a..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/Settings/ToSpeckleSettings.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Autodesk.Revit.DB; - -namespace Speckle.Converters.RevitShared.Settings; - -public enum DetailLevelType -{ - Coarse, - Medium, - Fine -} - -public enum ReferencePointType -{ - InternalOrigin, - ProjectBase, - Survey -} - -public record ToSpeckleSettings(DetailLevelType DetailLevel, Transform? ReferencePointTransform); diff --git a/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems b/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems index f45779154..c33cdb8a9 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems +++ b/Converters/Revit/Speckle.Converters.RevitShared/Speckle.Converters.RevitShared.projitems @@ -22,41 +22,31 @@ - + - + - + + + + + + - - - - - - - - - - - - - - - - - - + + + @@ -101,14 +91,15 @@ - - + + + \ No newline at end of file diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/BaseToHostGeometryObjectConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/BaseToHostGeometryObjectConverter.cs new file mode 100644 index 000000000..ac4685557 --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/BaseToHostGeometryObjectConverter.cs @@ -0,0 +1,61 @@ +using System.Collections; +using Speckle.Converters.Common.Objects; +using Speckle.Objects; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Extensions; + +namespace Speckle.Converters.RevitShared.ToSpeckle; + +public class BaseToHostGeometryObjectConverter : ITypedConverter> +{ + private readonly ITypedConverter _pointConverter; + private readonly ITypedConverter _curveConverter; + private readonly ITypedConverter> _meshConverter; + + public BaseToHostGeometryObjectConverter( + ITypedConverter pointConverter, + ITypedConverter curveConverter, + ITypedConverter> meshConverter + ) + { + _pointConverter = pointConverter; + _curveConverter = curveConverter; + _meshConverter = meshConverter; + } + + public List Convert(Base target) + { + List result = new(); + + switch (target) + { + case SOG.Point point: + var xyz = _pointConverter.Convert(point); + result.Add(DB.Point.Create(xyz)); + break; + case ICurve curve: + var curves = _curveConverter.Convert(curve).Cast(); + result.AddRange(curves); + break; + case SOG.Mesh mesh: + var meshes = _meshConverter.Convert(mesh).Cast(); + result.AddRange(meshes); + break; + default: + var displayValue = target.TryGetDisplayValue(); + if ((displayValue is IList && !displayValue.Any()) || displayValue is null) + { + throw new NotSupportedException($"No display value found for {target.speckle_type}"); + } + + foreach (var display in displayValue) + { + result.AddRange(Convert(display)); + } + + break; + } + + return result; + } +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/CircleConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/CircleConverterToHost.cs index 1add57b0a..8fe941f05 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/CircleConverterToHost.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/CircleConverterToHost.cs @@ -17,6 +17,8 @@ public CircleConverterToHost(ScalingServiceToHost scalingService, ITypedConverte public DB.Arc Convert(SOG.Circle target) { var plane = _planeConverter.Convert(target.plane); - return DB.Arc.Create(plane, _scalingService.ScaleToNative(target.radius, target.units), 0, 2 * Math.PI); + var arc = DB.Arc.Create(plane, _scalingService.ScaleToNative(target.radius, target.units), 0, 2 * Math.PI); + arc.MakeBound(0, arc.Period); + return arc; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/ICurveConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/ICurveConverterToHost.cs index 74ec7d7af..419145159 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/ICurveConverterToHost.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/ICurveConverterToHost.cs @@ -61,23 +61,11 @@ public DB.CurveArray Convert(ICurve target) return _polylineConverter.Convert(spiral.displayValue); case SOG.Curve nurbs: + if (nurbs.closed) // NOTE: ensure we always nicely convert cyclical curves + { + return _polylineConverter.Convert(nurbs.displayValue); + } var n = _curveConverter.Convert(nurbs); - - // poc : in original converter, we were passing a bool into this method 'splitIfClosed'. - // https://spockle.atlassian.net/browse/DUI3-462 - // I'm not entirely sure why we need to split curves, but there are several occurances - // of the method being called and overriding the bool to be true. - - //if (IsCurveClosed(n) && splitIfClosed) - //{ - // var split = SplitCurveInTwoHalves(n); - // curveArray.Append(split.Item1); - // curveArray.Append(split.Item2); - //} - //else - //{ - // curveArray.Append(n); - //} curveArray.Append(n); return curveArray; @@ -99,30 +87,4 @@ public DB.CurveArray Convert(ICurve target) throw new SpeckleConversionException($"The provided geometry of type {target.GetType()} is not a supported"); } } - - public bool IsCurveClosed(DB.Curve nativeCurve, double tol = 1E-6) - { - var endPoint = nativeCurve.GetEndPoint(0); - var source = nativeCurve.GetEndPoint(1); - var distanceTo = endPoint.DistanceTo(source); - return distanceTo < tol; - } - - public (DB.Curve, DB.Curve) SplitCurveInTwoHalves(DB.Curve nativeCurve) - { - using var curveArray = new DB.CurveArray(); - // Revit does not like single curve loop edges, so we split them in two. - var start = nativeCurve.GetEndParameter(0); - var end = nativeCurve.GetEndParameter(1); - var mid = start + (end - start) / 2; - - var a = nativeCurve.Clone(); - a.MakeBound(start, mid); - curveArray.Append(a); - var b = nativeCurve.Clone(); - b.MakeBound(mid, end); - curveArray.Append(b); - - return (a, b); - } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/MeshConverterToHost.cs similarity index 77% rename from Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs rename to Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/MeshConverterToHost.cs index 54868bcc2..a5652fb60 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/MeshConverterToHost.cs @@ -1,30 +1,26 @@ using Autodesk.Revit.DB; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.ToSpeckle; +using Speckle.Converters.RevitShared.Helpers; using Speckle.DoubleNumerics; -using Speckle.Objects.Other; namespace Speckle.Converters.RevitShared.ToHost.TopLevel; -[NameAndRankValue(nameof(SOG.Mesh), 0)] -public class MeshToHostTopLevelConverter - : BaseTopLevelConverterToHost, - ITypedConverter +public class MeshConverterToHost : ITypedConverter> { private readonly ITypedConverter _pointConverter; - private readonly ITypedConverter _materialConverter; + private readonly RevitMaterialCacheSingleton _revitMaterialCacheSingleton; - public MeshToHostTopLevelConverter( + public MeshConverterToHost( ITypedConverter pointConverter, - ITypedConverter materialConverter + RevitMaterialCacheSingleton revitMaterialCacheSingleton ) { _pointConverter = pointConverter; - _materialConverter = materialConverter; + _revitMaterialCacheSingleton = revitMaterialCacheSingleton; } - public override GeometryObject[] Convert(SOG.Mesh mesh) + public List Convert(SOG.Mesh mesh) { TessellatedShapeBuilderTarget target = TessellatedShapeBuilderTarget.Mesh; TessellatedShapeBuilderFallback fallback = TessellatedShapeBuilderFallback.Salvage; @@ -37,14 +33,19 @@ public override GeometryObject[] Convert(SOG.Mesh mesh) }; var valid = tsb.AreTargetAndFallbackCompatible(target, fallback); - //tsb.OpenConnectedFaceSet(target == TessellatedShapeBuilderTarget.Solid); tsb.OpenConnectedFaceSet(false); var vertices = ArrayToPoints(mesh.vertices, mesh.units); ElementId materialId = ElementId.InvalidElementId; - if (mesh["renderMaterial"] is RenderMaterial renderMaterial) + + if ( + _revitMaterialCacheSingleton.ObjectIdAndMaterialIndexMap.TryGetValue( + mesh.applicationId ?? mesh.id, + out var mappedElementId + ) + ) { - materialId = _materialConverter.Convert(renderMaterial).Id; + materialId = mappedElementId; } int i = 0; @@ -67,7 +68,7 @@ public override GeometryObject[] Convert(SOG.Mesh mesh) tsb.AddFace(face1); triPoints = new List { points[1], points[2], points[3] }; - ; + var face2 = new TessellatedFace(triPoints, materialId); tsb.AddFace(face2); } @@ -85,7 +86,7 @@ public override GeometryObject[] Convert(SOG.Mesh mesh) tsb.Build(); var result = tsb.GetBuildResult(); - return result.GetGeometricalObjects().ToArray(); + return result.GetGeometricalObjects().ToList(); } private static bool IsNonPlanarQuad(IList points) diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/PolylineConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/PolylineConverterToHost.cs index b95012fd4..9011cce00 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/PolylineConverterToHost.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/Geometry/PolylineConverterToHost.cs @@ -1,7 +1,8 @@ using Autodesk.Revit.DB; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Geometry; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -10,17 +11,17 @@ public class PolylineConverterToHost : ITypedConverter _lineConverter; private readonly ScalingServiceToHost _scalingService; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public PolylineConverterToHost( ITypedConverter lineConverter, ScalingServiceToHost scalingService, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _lineConverter = lineConverter; _scalingService = scalingService; - _contextStack = contextStack; + _converterSettings = converterSettings; } public CurveArray Convert(Polyline target) @@ -37,7 +38,15 @@ public CurveArray Convert(Polyline target) var lastPt = pts[0]; for (var i = 1; i < pts.Count; i++) { - var success = TryAppendLineSafely(curveArray, new SOG.Line(lastPt, pts[i], target.units)); + var success = TryAppendLineSafely( + curveArray, + new SOG.Line + { + start = lastPt, + end = pts[i], + units = target.units + } + ); if (success) { lastPt = pts[i]; @@ -46,7 +55,15 @@ public CurveArray Convert(Polyline target) if (target.closed) { - TryAppendLineSafely(curveArray, new SOG.Line(pts[^1], pts[0], target.units)); + TryAppendLineSafely( + curveArray, + new SOG.Line + { + start = pts[^1], + end = pts[0], + units = target.units + } + ); } } return curveArray; @@ -63,7 +80,7 @@ public CurveArray Convert(Polyline target) public bool IsLineTooShort(SOG.Line line) { var scaleToNative = _scalingService.ScaleToNative(SOG.Point.Distance(line.start, line.end), line.units); - return scaleToNative < _contextStack.Current.Document.Application.ShortCurveTolerance; + return scaleToNative < _converterSettings.Current.Document.Application.ShortCurveTolerance; } /// diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/RenderMaterialToHostConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/RenderMaterialToHostConverter.cs index a9946b2d8..73427cc03 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/RenderMaterialToHostConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/RenderMaterialToHostConverter.cs @@ -1,55 +1,55 @@ -using System.Text.RegularExpressions; -using Autodesk.Revit.DB; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Objects.Other; - -namespace Speckle.Converters.RevitShared.ToHost.Raw; - -public class RenderMaterialToHostConverter : ITypedConverter -{ - private readonly IRevitConversionContextStack _contextStack; - - public RenderMaterialToHostConverter(IRevitConversionContextStack contextStack) - { - _contextStack = contextStack; - } - - public DB.Material Convert(RenderMaterial target) - { - string matName = RemoveProhibitedCharacters(target.name); - - using FilteredElementCollector collector = new(_contextStack.Current.Document); - - // Try and find an existing material - var existing = collector - .OfClass(typeof(DB.Material)) - .Cast() - .FirstOrDefault(m => string.Equals(m.Name, matName, StringComparison.CurrentCultureIgnoreCase)); - - if (existing != null) - { - return existing; - } - - // Create new material - ElementId materialId = DB.Material.Create(_contextStack.Current.Document, matName ?? Guid.NewGuid().ToString()); - DB.Material mat = (DB.Material)_contextStack.Current.Document.GetElement(materialId); - - var sysColor = System.Drawing.Color.FromArgb(target.diffuse); - mat.Color = new DB.Color(sysColor.R, sysColor.G, sysColor.B); - mat.Transparency = (int)((1d - target.opacity) * 100d); - - return mat; - } - - private string RemoveProhibitedCharacters(string s) - { - if (string.IsNullOrEmpty(s)) - { - return s; - } - - return Regex.Replace(s, "[\\[\\]{}|;<>?`~]", ""); - } -} +// using System.Text.RegularExpressions; +// using Autodesk.Revit.DB; +// using Speckle.Converters.Common.Objects; +// using Speckle.Converters.RevitShared.Helpers; +// using Speckle.Objects.Other; +// +// namespace Speckle.Converters.RevitShared.ToHost.Raw; +// +// public class RenderMaterialToHostConverter : ITypedConverter +// { +// private readonly IRevitConversionContextStack _contextStack; +// +// public RenderMaterialToHostConverter(IRevitConversionContextStack contextStack) +// { +// _contextStack = contextStack; +// } +// +// public DB.Material Convert(RenderMaterial target) +// { +// string matName = RemoveProhibitedCharacters(target.name); +// +// using FilteredElementCollector collector = new(_contextStack.Current.Document); +// +// // Try and find an existing material +// var existing = collector +// .OfClass(typeof(DB.Material)) +// .Cast() +// .FirstOrDefault(m => string.Equals(m.Name, matName, StringComparison.CurrentCultureIgnoreCase)); +// +// if (existing != null) +// { +// return existing; +// } +// +// // Create new material +// ElementId materialId = DB.Material.Create(_contextStack.Current.Document, matName ?? Guid.NewGuid().ToString()); +// DB.Material mat = (DB.Material)_contextStack.Current.Document.GetElement(materialId); +// +// var sysColor = System.Drawing.Color.FromArgb(target.diffuse); +// mat.Color = new DB.Color(sysColor.R, sysColor.G, sysColor.B); +// mat.Transparency = (int)((1d - target.opacity) * 100d); +// +// return mat; +// } +// +// private string RemoveProhibitedCharacters(string s) +// { +// if (string.IsNullOrEmpty(s)) +// { +// return s; +// } +// +// return Regex.Replace(s, "[\\[\\]{}|;<>?`~]", ""); +// } +// } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/SurfaceConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/SurfaceConverterToHost.cs deleted file mode 100644 index 13c64925f..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/Raw/SurfaceConverterToHost.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Autodesk.Revit.DB; -using Speckle.Converters.Common.Objects; -using Speckle.Objects.Geometry; - -namespace Speckle.Converters.RevitShared.ToHost.Raw; - -public class SurfaceConverterToHost : ITypedConverter -{ - private readonly ITypedConverter _pointConverter; - - public SurfaceConverterToHost(ITypedConverter pointConverter) - { - _pointConverter = pointConverter; - } - - public BRepBuilderSurfaceGeometry Convert(SOG.Surface target) - { - var uvBox = new DB.BoundingBoxUV(target.knotsU[0], target.knotsV[0], target.knotsU[^1], target.knotsV[^1]); - var surfPts = target.GetControlPoints(); - var uKnots = SurfaceKnotsToNative(target.knotsU); - var vKnots = SurfaceKnotsToNative(target.knotsV); - var cPts = ControlPointsToNative(surfPts); - - BRepBuilderSurfaceGeometry result; - if (!target.rational) - { - result = BRepBuilderSurfaceGeometry.CreateNURBSSurface( - target.degreeU, - target.degreeV, - uKnots, - vKnots, - cPts, - false, - uvBox - ); - } - else - { - var weights = ControlPointWeightsToNative(surfPts); - result = BRepBuilderSurfaceGeometry.CreateNURBSSurface( - target.degreeU, - target.degreeV, - uKnots, - vKnots, - cPts, - weights, - false, - uvBox - ); - } - - return result; - } - - private double[] SurfaceKnotsToNative(List list) - { - var count = list.Count; - var knots = new double[count + 2]; - - int j = 0, - k = 0; - while (j < count) - { - knots[++k] = list[j++]; - } - - knots[0] = knots[1]; - knots[count + 1] = knots[count]; - - return knots; - } - - public XYZ[] ControlPointsToNative(List> controlPoints) - { - var uCount = controlPoints.Count; - var vCount = controlPoints[0].Count; - var count = uCount * vCount; - var points = new DB.XYZ[count]; - int p = 0; - - controlPoints.ForEach(row => - row.ForEach(pt => - { - var point = new SOG.Point(pt.x, pt.y, pt.z, pt.units); - points[p++] = _pointConverter.Convert(point); - }) - ); - - return points; - } - - public double[] ControlPointWeightsToNative(List> controlPoints) - { - var uCount = controlPoints.Count; - var vCount = controlPoints[0].Count; - var count = uCount * vCount; - var weights = new double[count]; - int p = 0; - - controlPoints.ForEach(row => row.ForEach(pt => weights[p++] = pt.weight)); - - return weights; - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/BaseTopLevelConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/BaseTopLevelConverterToHost.cs deleted file mode 100644 index efb74cb62..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/BaseTopLevelConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Sdk.Models; - -namespace Speckle.Converters.RevitShared.ToSpeckle; - -public abstract class BaseTopLevelConverterToHost : IToHostTopLevelConverter - where TSpeckle : Base - where THost : notnull -{ - public abstract THost Convert(TSpeckle target); - - public object Convert(Base target) - { - var result = Convert((TSpeckle)target); - return result; - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs deleted file mode 100644 index f5d1eb00e..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs +++ /dev/null @@ -1,231 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.Services; -using Speckle.Converters.RevitShared.ToSpeckle; -using Speckle.Objects; -using Speckle.Objects.Other; - -namespace Speckle.Converters.RevitShared.ToHost.TopLevel; - -[NameAndRankValue(nameof(SOG.Brep), 0)] -public sealed class BrepTopLevelConverterToHost - : BaseTopLevelConverterToHost, - ITypedConverter -{ - private readonly IRevitConversionContextStack _contextStack; - private readonly ScalingServiceToHost _scalingService; - private readonly ITypedConverter _materialConverter; - private readonly ITypedConverter _surfaceConverter; - private readonly ITypedConverter _curveConverter; - - public BrepTopLevelConverterToHost( - IRevitConversionContextStack contextStack, - ScalingServiceToHost scalingService, - ITypedConverter materialConverter, - ITypedConverter surfaceConverter, - ITypedConverter curveConverter - ) - { - _contextStack = contextStack; - _scalingService = scalingService; - _materialConverter = materialConverter; - _surfaceConverter = surfaceConverter; - _curveConverter = curveConverter; - } - - public override DB.Solid Convert(SOG.Brep target) - { - //Make sure face references are calculated by revit - var bRepType = DB.BRepType.OpenShell; - switch (target.Orientation) - { - case SOG.BrepOrientation.Inward: - bRepType = DB.BRepType.Void; - break; - case SOG.BrepOrientation.Outward: - bRepType = DB.BRepType.Solid; - break; - } - - DB.ElementId? materialId = null; - if (target["renderMaterial"] is RenderMaterial renderMaterial) - { - materialId = _materialConverter.Convert(renderMaterial).Id; - } - - using var builder = new DB.BRepBuilder(bRepType); - - builder.SetAllowShortEdges(); - builder.AllowRemovalOfProblematicFaces(); - var brepEdges = new List[target.Edges.Count]; - foreach (var face in target.Faces) - { - var faceId = builder.AddFace(_surfaceConverter.Convert(face.Surface), face.OrientationReversed); - if (materialId is not null) - { - builder.SetFaceMaterialId(faceId, materialId); - } - - foreach (var loop in face.Loops) - { - var loopId = builder.AddLoop(faceId); - if (face.OrientationReversed) - { - loop.TrimIndices.Reverse(); - } - - foreach (var trim in loop.Trims) - { - if ( - trim.TrimType != SOG.BrepTrimType.Boundary - && trim.TrimType != SOG.BrepTrimType.Mated - && trim.TrimType != SOG.BrepTrimType.Seam - ) - { - continue; - } - - if (trim.Edge == null) - { - continue; - } - - var edgeIds = brepEdges[trim.EdgeIndex]; - if (edgeIds == null) - { - // First time we see this edge, convert it and add - edgeIds = brepEdges[trim.EdgeIndex] = new List(); - var bRepBuilderGeometryIds = BrepEdgeToNative(trim.Edge).Select(edge => builder.AddEdge(edge)); - edgeIds.AddRange(bRepBuilderGeometryIds); - } - - var trimReversed = face.OrientationReversed ? !trim.IsReversed : trim.IsReversed; - if (trimReversed) - { - for (int e = edgeIds.Count - 1; e >= 0; --e) - { - if (builder.IsValidEdgeId(edgeIds[e])) - { - builder.AddCoEdge(loopId, edgeIds[e], true); - } - } - } - else - { - for (int e = 0; e < edgeIds.Count; ++e) - { - if (builder.IsValidEdgeId(edgeIds[e])) - { - builder.AddCoEdge(loopId, edgeIds[e], false); - } - } - } - } - builder.FinishLoop(loopId); - } - builder.FinishFace(faceId); - } - - var bRepBuilderOutcome = builder.Finish(); - if (bRepBuilderOutcome == DB.BRepBuilderOutcome.Failure || !builder.IsResultAvailable()) - { - throw new SpeckleConversionException("BRepBuilder failed for unknown reason"); - } - - var result = builder.GetResult(); - return result; - } - - public List BrepEdgeToNative(SOG.BrepEdge edge) - { - // TODO: Trim curve with domain. Unsure if this is necessary as all our curves are converted to NURBS on Rhino output. - var nativeCurveArray = _curveConverter.Convert(edge.Curve); - bool isTrimmed = - edge.Curve.domain != null - && edge.Domain != null - && (edge.Curve.domain.start != edge.Domain.start || edge.Curve.domain.end != edge.Domain.end); - if (nativeCurveArray.Size == 1) - { - var nativeCurve = nativeCurveArray.get_Item(0); - - if (edge.ProxyCurveIsReversed) - { - nativeCurve = nativeCurve.CreateReversed(); - } - - if (nativeCurve == null) - { - return new List(); - } - - if (isTrimmed) - { - nativeCurve.MakeBound(edge.Domain?.start ?? 0, edge.Domain?.end ?? 1); - } - - if (!nativeCurve.IsBound) - { - nativeCurve.MakeBound(0, nativeCurve.Period); - } - - if (IsCurveClosed(nativeCurve)) - { - var (first, second) = SplitCurveInTwoHalves(nativeCurve); - if (edge.ProxyCurveIsReversed) - { - first = first.CreateReversed(); - second = second.CreateReversed(); - } - var halfEdgeA = DB.BRepBuilderEdgeGeometry.Create(first); - var halfEdgeB = DB.BRepBuilderEdgeGeometry.Create(second); - return edge.ProxyCurveIsReversed - ? new List { halfEdgeA, halfEdgeB } - : new List { halfEdgeB, halfEdgeA }; - } - - // TODO: Remove short segments if smaller than 'Revit.ShortCurveTolerance'. - var fullEdge = DB.BRepBuilderEdgeGeometry.Create(nativeCurve); - return new List { fullEdge }; - } - - var iterator = edge.ProxyCurveIsReversed ? nativeCurveArray.ReverseIterator() : nativeCurveArray.ForwardIterator(); - - var result = new List(); - while (iterator.MoveNext()) - { - var crv = (DB.Curve)iterator.Current; - if (edge.ProxyCurveIsReversed) - { - crv = crv.CreateReversed(); - } - - result.Add(DB.BRepBuilderEdgeGeometry.Create(crv)); - } - - return result; - } - - private bool IsCurveClosed(DB.Curve nativeCurve, double tol = 1E-6) - { - var endPoint = nativeCurve.GetEndPoint(0); - var source = nativeCurve.GetEndPoint(1); - var distanceTo = endPoint.DistanceTo(source); - return distanceTo < tol; - } - - private (DB.Curve, DB.Curve) SplitCurveInTwoHalves(DB.Curve nativeCurve) - { - // Revit does not like single curve loop edges, so we split them in two. - var start = nativeCurve.GetEndParameter(0); - var end = nativeCurve.GetEndParameter(1); - var mid = start + (end - start) / 2; - - var a = nativeCurve.Clone(); - a.MakeBound(start, mid); - var b = nativeCurve.Clone(); - b.MakeBound(mid, end); - - return (a, b); - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/DirectShapeTopLevelConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/DirectShapeTopLevelConverterToHost.cs deleted file mode 100644 index e7e58731f..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/DirectShapeTopLevelConverterToHost.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToSpeckle; -using Speckle.Objects; -using Speckle.Objects.Geometry; - -namespace Speckle.Converters.RevitShared.ToHost.TopLevel; - -[NameAndRankValue(nameof(SOBR.DirectShape), 0)] -public sealed class DirectShapeTopLevelConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter brepConverter, - ITypedConverter curveConverter, - ITypedConverter meshConverter, - IRevitCategories revitCategories, - ParameterValueSetter parameterValueSetter -) : BaseTopLevelConverterToHost> -{ - public override List Convert(SOBR.DirectShape target) - { - var converted = new List(); - - target.baseGeometries.ForEach(b => - { - switch (b) - { - case SOG.Brep brep: - converted.Add(brepConverter.Convert(brep)); - break; - case SOG.Mesh mesh: - converted.AddRange(meshConverter.Convert(mesh)); - break; - case ICurve curve: - converted.AddRange(curveConverter.Convert(curve).Cast()); - break; - default: - throw new SpeckleConversionException( - $"Incompatible geometry type: {b.GetType()} is not supported in DirectShape conversions." - ); - } - }); - - //from 2.16 onwards use the builtInCategory field for direct shape fallback - DB.BuiltInCategory bic = DB.BuiltInCategory.OST_GenericModel; - if (!Enum.TryParse(target["builtInCategory"] as string, out bic)) - { - //pre 2.16 or coming from grasshopper, using the enum - //TODO: move away from enum logic - if ((int)target.category != -1) - { - var bicName = revitCategories.GetBuiltInFromSchemaBuilderCategory(target.category); -#pragma warning disable IDE0002 // Simplify Member Access - _ = DB.BuiltInCategory.TryParse(bicName, out bic); -#pragma warning restore IDE0002 // Simplify Member Access - } - } - - var cat = contextStack.Current.Document.Settings.Categories.get_Item(bic); - - using var revitDs = DB.DirectShape.CreateElement(contextStack.Current.Document, cat.Id); - if (target.applicationId != null) - { - revitDs.ApplicationId = target.applicationId; - } - - revitDs.ApplicationDataId = Guid.NewGuid().ToString(); - revitDs.SetShape(converted); - revitDs.Name = target.name; - parameterValueSetter.SetInstanceParameters(revitDs, target); - - return converted; - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/GridlineToHostTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/GridlineToHostTopLevelConverter.cs deleted file mode 100644 index 288aaafc5..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/GridlineToHostTopLevelConverter.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToSpeckle; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.TopLevel; - -[NameAndRankValue(nameof(SOBE.GridLine), 0)] -internal sealed class GridlineToHostTopLevelConverter : BaseTopLevelConverterToHost -{ - private readonly ITypedConverter _curveConverter; - private readonly IRevitConversionContextStack _contextStack; - - public GridlineToHostTopLevelConverter( - ITypedConverter curveConverter, - IRevitConversionContextStack contextStack - ) - { - _curveConverter = curveConverter; - _contextStack = contextStack; - } - - public override DB.Grid Convert(SOBE.GridLine target) - { - DB.Curve curve = _curveConverter.Convert(target.baseLine).get_Item(0); - - using DB.Grid revitGrid = curve switch - { - DB.Arc arc => DB.Grid.Create(_contextStack.Current.Document, arc), - DB.Line line => DB.Grid.Create(_contextStack.Current.Document, line), - _ => throw new SpeckleConversionException($"Grid line curve is of type {curve.GetType()} which is not supported") - }; - - if (!string.IsNullOrEmpty(target.label) && !GridNameIsTaken(target.label)) - { - revitGrid.Name = target.label; - } - - return revitGrid; - } - - private bool GridNameIsTaken(string gridName) - { - using var collector = new DB.FilteredElementCollector(_contextStack.Current.Document); - - IEnumerable gridNames = collector - .WhereElementIsNotElementType() - .OfClass(typeof(DB.Grid)) - .ToElements() - .Cast() - .Select(grid => grid.Name); - - return gridNames.Contains(gridName); - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/LevelToHostTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/LevelToHostTopLevelConverter.cs deleted file mode 100644 index b68592bdd..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/LevelToHostTopLevelConverter.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.Services; -using Speckle.Converters.RevitShared.ToSpeckle; - -namespace Speckle.Converters.RevitShared.ToHost.ToLevel; - -[NameAndRankValue(nameof(SOBE.Level), 0)] -public class LevelToHostTopLevelConverter : BaseTopLevelConverterToHost -{ - private readonly IRevitConversionContextStack _contextStack; - private readonly ScalingServiceToHost _scalingService; - - public LevelToHostTopLevelConverter(IRevitConversionContextStack contextStack, ScalingServiceToHost scalingService) - { - _contextStack = contextStack; - _scalingService = scalingService; - } - - public override DB.Level Convert(SOBE.Level target) - { - using var documentLevelCollector = new DB.FilteredElementCollector(_contextStack.Current.Document); - var docLevels = documentLevelCollector.OfClass(typeof(DB.Level)).ToElements().Cast(); - - // POC : I'm not really understanding the linked use case for this. Do we want to bring this over? - - //bool elevationMatch = true; - ////level by name component - //if (target is RevitLevel speckleRevitLevel && speckleRevitLevel.referenceOnly) - //{ - // //see: https://speckle.community/t/revit-connector-levels-and-spaces/2824/5 - // elevationMatch = false; - // if (GetExistingLevelByName(docLevels, target.name) is DB.Level existingLevelWithSameName) - // { - // return existingLevelWithSameName; - // } - //} - - DB.Level revitLevel; - var targetElevation = _scalingService.ScaleToNative(target.elevation, target.units); - - if (GetExistingLevelByElevation(docLevels, targetElevation) is DB.Level existingLevel) - { - revitLevel = existingLevel; - } - else - { - revitLevel = DB.Level.Create(_contextStack.Current.Document, targetElevation); - revitLevel.Name = target.name; - - if (target is SOBR.RevitLevel rl && rl.createView) - { - using var viewPlan = CreateViewPlan(target.name, revitLevel.Id); - } - } - - return revitLevel; - } - - private static DB.Level GetExistingLevelByElevation(IEnumerable docLevels, double elevation) - { - return docLevels.First(l => Math.Abs(l.Elevation - elevation) < RevitConversionContextStack.TOLERANCE); - } - - private DB.ViewPlan CreateViewPlan(string name, DB.ElementId levelId) - { - using var collector = new DB.FilteredElementCollector(_contextStack.Current.Document); - var vt = collector - .OfClass(typeof(DB.ViewFamilyType)) - .First(el => ((DB.ViewFamilyType)el).ViewFamily == DB.ViewFamily.FloorPlan); - - var view = DB.ViewPlan.Create(_contextStack.Current.Document, vt.Id, levelId); - view.Name = name; - - return view; - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs deleted file mode 100644 index 5ba4c40cb..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Collections; -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Objects; -using Speckle.Sdk.Common; - -namespace Speckle.Converters.RevitShared.ToSpeckle; - -[NameAndRankValue(nameof(SOBR.Curve.ModelCurve), 0)] -public class ModelCurveToHostTopLevelConverter : BaseTopLevelConverterToHost -{ - private readonly ITypedConverter _curveConverter; - private readonly IRevitConversionContextStack _contextStack; - - public ModelCurveToHostTopLevelConverter( - ITypedConverter curveConverter, - IRevitConversionContextStack conversionContext - ) - { - _curveConverter = curveConverter; - _contextStack = conversionContext; - } - - public override DB.ModelCurve[] Convert(SOBR.Curve.ModelCurve target) => - ModelCurvesFromEnumerator(_curveConverter.Convert(target.baseCurve).GetEnumerator(), target.baseCurve).ToArray(); - - private IEnumerable ModelCurvesFromEnumerator(IEnumerator curveEnum, ICurve speckleLine) - { - while (curveEnum.MoveNext() && curveEnum.Current != null) - { - var curve = (DB.Curve)curveEnum.Current; - // Curves must be bound in order to be valid model curves - if (!curve.IsBound) - { - if (speckleLine.domain.end - speckleLine.domain.start <= 0) - { - speckleLine.domain.start = 0; - speckleLine.domain.end = Math.PI * 2; - } - curve.MakeBound(speckleLine.domain.start, speckleLine.domain.end); - } - - if (_contextStack.Current.Document.IsFamilyDocument) - { - yield return _contextStack.Current.Document.FamilyCreate.NewModelCurve( - curve, - NewSketchPlaneFromCurve(curve, _contextStack.Current.Document) - ); - } - else - { - yield return _contextStack.Current.Document.Create.NewModelCurve( - curve, - NewSketchPlaneFromCurve(curve, _contextStack.Current.Document) - ); - } - } - } - - /// - /// Credits: Grevit - /// Creates a new Sketch Plane from a Curve - /// https://github.com/grevit-dev/Grevit/blob/3c7a5cc198e00dfa4cc1e892edba7c7afd1a3f84/Grevit.Revit/Utilities.cs#L402 - /// - /// Curve to get plane from - /// Plane of the curve - private DB.SketchPlane NewSketchPlaneFromCurve(DB.Curve curve, DB.Document doc) - { - DB.XYZ startPoint = curve.GetEndPoint(0); - DB.XYZ endPoint = curve.GetEndPoint(1); - - // If Start end Endpoint are the same check further points. - int i = 2; - while (startPoint == endPoint && endPoint != null) - { - endPoint = curve.GetEndPoint(i); - i++; - } - - // Plane to return - DB.Plane plane; - - // If Z Values are equal the Plane is XY - if (startPoint.Z == endPoint.NotNull().Z) - { - plane = DB.Plane.CreateByNormalAndOrigin(DB.XYZ.BasisZ, startPoint); - } - // If X Values are equal the Plane is YZ - else if (startPoint.X == endPoint.X) - { - plane = DB.Plane.CreateByNormalAndOrigin(DB.XYZ.BasisX, startPoint); - } - // If Y Values are equal the Plane is XZ - else if (startPoint.Y == endPoint.Y) - { - plane = DB.Plane.CreateByNormalAndOrigin(DB.XYZ.BasisY, startPoint); - } - // Otherwise the Planes Normal Vector is not X,Y or Z. - // We draw lines from the Origin to each Point and use the Plane this one spans up. - else - { - using DB.CurveArray curves = new(); - curves.Append(curve); - curves.Append(DB.Line.CreateBound(new DB.XYZ(0, 0, 0), startPoint)); - curves.Append(DB.Line.CreateBound(endPoint, new DB.XYZ(0, 0, 0))); - - plane = DB.Plane.CreateByThreePoints(startPoint, new DB.XYZ(0, 0, 0), endPoint); - } - - return DB.SketchPlane.Create(doc, plane); - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs deleted file mode 100644 index a8ad6d8b2..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Autodesk.Revit.DB; -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToSpeckle; - -namespace Speckle.Converters.RevitShared.ToHost.TopLevel; - -[NameAndRankValue(nameof(SOG.Point), 0)] -public sealed class PointToHostTopLevelConverter - : BaseTopLevelConverterToHost, - ITypedConverter -{ - private readonly IRevitConversionContextStack _contextStack; - private readonly ITypedConverter _pointConverter; - - public PointToHostTopLevelConverter( - IRevitConversionContextStack contextStack, - ITypedConverter pointConverter - ) - { - _contextStack = contextStack; - _pointConverter = pointConverter; - } - - [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Disposal transfter")] - public override DB.Solid Convert(SOG.Point target) - { - List profile = new(); - - XYZ center = _pointConverter.Convert(target); - - double radius = .2; - - XYZ profilePlus = center.Add(new XYZ(0, radius, 0)); - XYZ profileMinus = center.Subtract(new XYZ(0, radius, 0)); - - profile.Add(Line.CreateBound(profilePlus, profileMinus)); - profile.Add(Arc.Create(profileMinus, profilePlus, center.Add(new XYZ(radius, 0, 0)))); - - using SolidOptions options = new(ElementId.InvalidElementId, ElementId.InvalidElementId); - - using Frame frame = new(center, XYZ.BasisX, XYZ.BasisZ.Multiply(-1), XYZ.BasisY); - - if (!Frame.CanDefineRevitGeometry(frame)) - { - throw new SpeckleConversionException("Unable to define Revit geometry"); - } - - CurveLoop curveLoop = CurveLoop.Create(profile); - Solid sphere = GeometryCreationUtilities.CreateRevolvedGeometry(frame, [curveLoop], 0, 2 * Math.PI, options); - - using DirectShape ds = DirectShape.CreateElement( - _contextStack.Current.Document, - new ElementId(BuiltInCategory.OST_GenericModel) - ); - - ds.ApplicationId = target.applicationId ?? "appId"; - ds.ApplicationDataId = "Geometry object id"; - ds.SetShape([sphere]); - - return sphere; - } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/ArcToDirectShapeConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/ArcToDirectShapeConverterToHost.cs deleted file mode 100644 index 4c06ea105..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/ArcToDirectShapeConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Arc), 0)] -public class ArcToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public ArcToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CircleToDirectShapeConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CircleToDirectShapeConverterToHost.cs deleted file mode 100644 index 53585b0f4..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CircleToDirectShapeConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Circle), 0)] -public class CircleToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public CircleToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CurveToDirectShapeConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CurveToDirectShapeConverterToHost.cs deleted file mode 100644 index 83bfc4226..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CurveToDirectShapeConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Curve), 0)] -public class CurveToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public CurveToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CurveToDirectShapeConverterToHostBase.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CurveToDirectShapeConverterToHostBase.cs deleted file mode 100644 index 0c9bfd83f..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/CurveToDirectShapeConverterToHostBase.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Objects; -using Speckle.Sdk.Models; - -namespace Speckle.Converters.RevitShared.ToHost.TopLevel; - -public abstract class CurveToDirectShapeConverterToHostBase - : ITypedConverter>, - IToHostTopLevelConverter - where TCurve : Base, ICurve -{ - private readonly IRevitConversionContextStack _contextStack; - private readonly ITypedConverter _curveConverter; - - protected CurveToDirectShapeConverterToHostBase( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - { - _contextStack = contextStack; - _curveConverter = curveConverter; - } - - public List Convert(TCurve target) - { - var converted = new List(); - - DB.CurveArray curveArray = _curveConverter.Convert(target); - converted.AddRange(curveArray.Cast()); - - var genericModelCategory = _contextStack.Current.Document.Settings.Categories.get_Item( - DB.BuiltInCategory.OST_GenericModel - ); - - using var revitDs = DB.DirectShape.CreateElement(_contextStack.Current.Document, genericModelCategory.Id); - if (target is Base speckleObject && speckleObject.applicationId != null) - { - revitDs.ApplicationId = speckleObject.applicationId; - } - - revitDs.ApplicationDataId = Guid.NewGuid().ToString(); - revitDs.SetShape(converted); - revitDs.Name = "CurveAsDirectShape"; - - return converted; - } - - public object Convert(Base target) => Convert((TCurve)target); -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/EllipseToDirectShapeConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/EllipseToDirectShapeConverterToHost.cs deleted file mode 100644 index 505a2d5ac..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/EllipseToDirectShapeConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Ellipse), 0)] -public class EllipseToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public EllipseToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/LineToDirectShapeConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/LineToDirectShapeConverterToHost.cs deleted file mode 100644 index 1cd3924f6..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/LineToDirectShapeConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Line), 0)] -public class LineToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public LineToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/PolycurveConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/PolycurveConverterToHost.cs deleted file mode 100644 index 3bfa552ed..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/PolycurveConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Polycurve), 0)] -public class PolycurveToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public PolycurveToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/PolylineConverterToHost.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/PolylineConverterToHost.cs deleted file mode 100644 index a8fcbc6df..000000000 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToHost/TopLevel/ToDirectShape/PolylineConverterToHost.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Speckle.Converters.Common; -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; -using Speckle.Converters.RevitShared.ToHost.TopLevel; -using Speckle.Objects; - -namespace Speckle.Converters.RevitShared.ToHost.Raw.Geometry; - -[NameAndRankValue(nameof(SOG.Polyline), 0)] -public class PolylineToDirectShapeConverterToHost : CurveToDirectShapeConverterToHostBase -{ - public PolylineToDirectShapeConverterToHost( - IRevitConversionContextStack contextStack, - ITypedConverter curveConverter - ) - : base(contextStack, curveConverter) { } -} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Parameters/ParameterDefinitionHandler.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Parameters/ParameterDefinitionHandler.cs new file mode 100644 index 000000000..f556656d4 --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Parameters/ParameterDefinitionHandler.cs @@ -0,0 +1,68 @@ +namespace Speckle.Converters.RevitShared.ToSpeckle; + +/// +/// Keeps track during a send conversion operation of the definitions used. +/// +public class ParameterDefinitionHandler +{ + /// + /// Keeps track of all parameter definitions used in the current send operation. This should be attached to the root commit object post conversion. + /// + /// POC: Note that we're abusing dictionaries in here because we've yet to have a simple way to serialize non-base derived classes (or structs?) + public Dictionary> Definitions { get; } = new(); + + /// + /// Extracts out and stores in the parameter's definition. + /// + /// + /// + public (string internalDefinitionName, string humanReadableName, string groupName) HandleDefinition( + DB.Parameter parameter + ) + { + var definition = parameter.Definition; + var internalDefinitionName = definition.Name; // aka real, internal name + var humanReadableName = definition.Name; + + if (parameter.IsShared) + { + internalDefinitionName = parameter.GUID.ToString(); // Note: unsure it's needed + } + + if ( + definition is DB.InternalDefinition internalDefinition + && internalDefinition.BuiltInParameter != DB.BuiltInParameter.INVALID + ) + { + internalDefinitionName = internalDefinition.BuiltInParameter.ToString(); + } + +#pragma warning disable CA1854 // swapping leads to nullability errors; should be resolved once we type this more strongly. + if (Definitions.ContainsKey(internalDefinitionName)) +#pragma warning restore CA1854 + { + var def = Definitions[internalDefinitionName]; + return (internalDefinitionName, humanReadableName, def["group"]! as string ?? "unknown group"); + } + + string? units = null; + if (parameter.StorageType == DB.StorageType.Double) + { + units = DB.LabelUtils.GetLabelForUnit(parameter.GetUnitTypeId()); + } + + var group = DB.LabelUtils.GetLabelForGroup(parameter.Definition.GetGroupTypeId()); + + Definitions[internalDefinitionName] = new Dictionary() + { + ["definitionName"] = internalDefinitionName, + ["name"] = humanReadableName, + ["units"] = units, + ["isShared"] = parameter.IsShared, + ["isReadOnly"] = parameter.IsReadOnly, + ["group"] = group + }; + + return (internalDefinitionName, humanReadableName, group); + } +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Parameters/ParameterExtractor.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Parameters/ParameterExtractor.cs new file mode 100644 index 000000000..c554eaf75 --- /dev/null +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Parameters/ParameterExtractor.cs @@ -0,0 +1,159 @@ +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common; +using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; +using Speckle.Sdk; + +namespace Speckle.Converters.RevitShared.ToSpeckle; + +/// +/// Extracts parameters out from an element and populates the cache. Expects to be scoped per operation. +/// +public class ParameterExtractor +{ + /// POC: Note that we're abusing dictionaries in here because we've yet to have a simple way to serialize non-base derived classes (or structs?) + private readonly ParameterDefinitionHandler _parameterDefinitionHandler; + + private readonly ILogger _logger; + private readonly IConverterSettingsStore _settingsStore; + private readonly ScalingServiceToSpeckle _scalingServiceToSpeckle; + + public ParameterExtractor( + IConverterSettingsStore settingsStore, + ScalingServiceToSpeckle scalingServiceToSpeckle, + ParameterDefinitionHandler parameterDefinitionHandler, + ILogger logger + ) + { + _parameterDefinitionHandler = parameterDefinitionHandler; + _logger = logger; + _settingsStore = settingsStore; + _scalingServiceToSpeckle = scalingServiceToSpeckle; + } + + private readonly Dictionary>> _typeParameterCache = + new(); + + /// + /// Extracts parameters out from an element and populates the cache. Expects to be scoped per operation. + /// + /// + /// + public Dictionary GetParameters(DB.Element element) + { + // NOTE: Woe and despair, I'm really abusing dictionaries here. See note at the top of class. + var instanceParameterDictionary = ParseParameterSet(element.Parameters); + + var typeId = element.GetTypeId(); + if (typeId == DB.ElementId.InvalidElementId) + { + return CreateParameterDictionary(instanceParameterDictionary, null); + } + + if ( + _typeParameterCache.TryGetValue( + typeId, + out Dictionary>? typeParameterDictionary + ) + ) + { + return CreateParameterDictionary(instanceParameterDictionary, typeParameterDictionary); + } + + if (_settingsStore.Current.Document.GetElement(typeId) is not DB.ElementType type) + { + return CreateParameterDictionary(instanceParameterDictionary, null); + } + + typeParameterDictionary = ParseParameterSet(type.Parameters); + _typeParameterCache[typeId] = typeParameterDictionary; + + return CreateParameterDictionary(instanceParameterDictionary, typeParameterDictionary); + } + + private Dictionary CreateParameterDictionary( + Dictionary> instanceParams, + Dictionary>? typeParams + ) + { + return new Dictionary() + { + ["Instance Parameters"] = instanceParams, + ["Type Parameters"] = typeParams + }; + } + + private Dictionary> ParseParameterSet(DB.ParameterSet parameters) + { + var dict = new Dictionary>(); + foreach (DB.Parameter parameter in parameters) + { + try + { + var value = GetValue(parameter); + var isNullOrEmpty = value == null || (value is string s && string.IsNullOrEmpty(s)); + if (!_settingsStore.Current.SendParameterNullOrEmptyStrings && isNullOrEmpty) + { + continue; + } + + var (internalDefinitionName, humanReadableName, groupName) = _parameterDefinitionHandler.HandleDefinition( + parameter + ); + + var param = new Dictionary() + { + ["value"] = value, + ["name"] = humanReadableName, + ["internalDefinitionName"] = internalDefinitionName + }; + + if (!dict.TryGetValue(groupName, out Dictionary? paramGroup)) + { + paramGroup = new Dictionary(); + dict[groupName] = paramGroup; + } + + var targetKey = humanReadableName; + if (paramGroup.ContainsKey(humanReadableName)) + { + targetKey = internalDefinitionName; + } + + paramGroup[targetKey] = param; + } + catch (Exception e) when (!e.IsFatal()) + { + _logger.LogWarning(e, $"Failed to convert parameter {parameter.Definition.Name}"); + } + } + + return dict; + } + + private readonly Dictionary _elementNameCache = new(); + + private object? GetValue(DB.Parameter parameter) + { + switch (parameter.StorageType) + { + case DB.StorageType.Double: + return _scalingServiceToSpeckle.Scale(parameter.AsDouble(), parameter.GetUnitTypeId()); + case DB.StorageType.Integer: + return parameter.AsInteger(); + case DB.StorageType.ElementId: + var elId = parameter.AsElementId()!; + if (_elementNameCache.TryGetValue(elId, out string? value)) + { + return value; + } + var docElement = _settingsStore.Current.Document.GetElement(elId); + var docElementName = docElement?.Name ?? elId.ToString(); + _elementNameCache[parameter.AsElementId()] = docElementName; + return docElementName; + case DB.StorageType.String: + default: + return parameter.AsString(); + } + } +} diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BeamConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BeamConversionToSpeckle.cs index d1956c0a6..b6c4617c6 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BeamConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BeamConversionToSpeckle.cs @@ -1,6 +1,7 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Sdk.Models; @@ -16,24 +17,21 @@ public class BeamConversionToSpeckle : ITypedConverter _levelConverter; private readonly ParameterValueExtractor _parameterValueExtractor; private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public BeamConversionToSpeckle( ITypedConverter locationConverter, ITypedConverter levelConverter, ParameterValueExtractor parameterValueExtractor, DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _locationConverter = locationConverter; _levelConverter = levelConverter; _parameterValueExtractor = parameterValueExtractor; _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; } public SOBR.RevitBeam Convert(DB.FamilyInstance target) @@ -60,11 +58,9 @@ public SOBR.RevitBeam Convert(DB.FamilyInstance target) baseLine = baseCurve, level = _levelConverter.Convert(level), displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; - _parameterObjectAssigner.AssignParametersToBase(target, speckleBeam); - return speckleBeam; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BoundarySegmentConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BoundarySegmentConversionToSpeckle.cs index ddd8ce1e6..dc335f2dc 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BoundarySegmentConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BoundarySegmentConversionToSpeckle.cs @@ -1,5 +1,6 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -7,15 +8,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class BoundarySegmentConversionToSpeckle : ITypedConverter, SOG.Polycurve> { private readonly ITypedConverter _curveConverter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public BoundarySegmentConversionToSpeckle( ITypedConverter curveConverter, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _curveConverter = curveConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; } public SOG.Polycurve Convert(IList target) @@ -37,7 +38,7 @@ public SOG.Polycurve Convert(IList target) segments.Add(curve); } - var poly = new SOG.Polycurve { segments = segments, units = _contextStack.Current.SpeckleUnits }; + var poly = new SOG.Polycurve { segments = segments, units = _converterSettings.Current.SpeckleUnits }; return poly; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BraceToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BraceToSpeckleConverter.cs index 28c0c2700..5c6b2f7ea 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BraceToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/BraceToSpeckleConverter.cs @@ -1,5 +1,6 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk.Models; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -11,15 +12,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class BraceToSpeckleConverter : ITypedConverter { private readonly ITypedConverter _beamConverter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public BraceToSpeckleConverter( ITypedConverter beamConverter, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _beamConverter = beamConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; } public SOBR.RevitBrace Convert(DB.FamilyInstance target) @@ -39,7 +40,7 @@ public SOBR.RevitBrace Convert(DB.FamilyInstance target) family = beam.family, parameters = beam.parameters, displayValue = beam.displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; var dynamicProps = beam.GetMembers(DynamicBaseMemberType.Dynamic); diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ColumnConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ColumnConversionToSpeckle.cs index 1e638d39e..fdd18f583 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ColumnConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ColumnConversionToSpeckle.cs @@ -2,6 +2,7 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Objects.BuiltElements.Revit; using Speckle.Sdk.Common; @@ -17,24 +18,21 @@ public class ColumnConversionToSpeckle : ITypedConverter _levelConverter; private readonly ParameterValueExtractor _parameterValueExtractor; private readonly DisplayValueExtractor _displayValueExtractor; - private readonly IRevitConversionContextStack _contextStack; - private readonly ParameterObjectAssigner _parameterObjectAssigner; + private readonly IConverterSettingsStore _converterSettings; public ColumnConversionToSpeckle( ITypedConverter locationConverter, ITypedConverter levelConverter, ParameterValueExtractor parameterValueExtractor, DisplayValueExtractor displayValueExtractor, - IRevitConversionContextStack contextStack, - ParameterObjectAssigner parameterObjectAssigner + IConverterSettingsStore converterSettings ) { _locationConverter = locationConverter; _levelConverter = levelConverter; _parameterValueExtractor = parameterValueExtractor; _displayValueExtractor = displayValueExtractor; - _contextStack = contextStack; - _parameterObjectAssigner = parameterObjectAssigner; + _converterSettings = converterSettings; } public RevitColumn Convert(DB.FamilyInstance target) @@ -51,7 +49,7 @@ public RevitColumn Convert(DB.FamilyInstance target) handFlipped = target.HandFlipped, isSlanted = target.IsSlantedColumn, displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; if ( @@ -106,8 +104,6 @@ out var topOffset speckleColumn.rotation = locationPoint.Rotation; } - _parameterObjectAssigner.AssignParametersToBase(target, speckleColumn); - return speckleColumn; } @@ -132,11 +128,17 @@ out var topOffset // return RevitInstanceToSpeckle(revitColumn, out notes, null); //} - return new SOG.Line( - basePoint, - new SOG.Point(basePoint.x, basePoint.y, topLevelElevation + topLevelOffset, _contextStack.Current.SpeckleUnits), - _contextStack.Current.SpeckleUnits - ); + return new SOG.Line + { + start = basePoint, + end = new SOG.Point( + basePoint.x, + basePoint.y, + topLevelElevation + topLevelOffset, + _converterSettings.Current.SpeckleUnits + ), + units = _converterSettings.Current.SpeckleUnits, + }; } return null; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/ArcToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/ArcToSpeckleConverter.cs index 5a8beb73d..829404935 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/ArcToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/ArcToSpeckleConverter.cs @@ -1,25 +1,26 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Primitive; namespace Speckle.Converters.RevitShared.ToSpeckle; public class ArcToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; private readonly ITypedConverter _planeConverter; private readonly ScalingServiceToSpeckle _scalingService; public ArcToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter, ITypedConverter planeConverter, ScalingServiceToSpeckle scalingService ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; _planeConverter = planeConverter; _scalingService = scalingService; @@ -48,7 +49,7 @@ public SOG.Arc Convert(DB.Arc target) startAngle = startAngle, endAngle = endAngle, angleRadians = endAngle - startAngle, - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, endPoint = _xyzToPointConverter.Convert(end), startPoint = _xyzToPointConverter.Convert(start), midPoint = _xyzToPointConverter.Convert(mid), diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs index 28705b631..f9baa10c7 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/BoundingBoxXYZToSpeckleConverter.cs @@ -1,22 +1,23 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Primitive; namespace Speckle.Converters.RevitShared.ToSpeckle; public class BoundingBoxXYZToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; private readonly ITypedConverter _planeConverter; public BoundingBoxXYZToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter, ITypedConverter planeConverter ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; _planeConverter = planeConverter; } @@ -41,7 +42,7 @@ public SOG.Box Convert(DB.BoundingBoxXYZ target) ySize = new Interval { start = min.y, end = max.y }, zSize = new Interval { start = min.z, end = max.z }, basePlane = _planeConverter.Convert(plane), - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; return box; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CircleToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CircleToSpeckleConverter.cs index 7abdc08cf..e7d776cc8 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CircleToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CircleToSpeckleConverter.cs @@ -1,22 +1,23 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; public class CircleToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _planeConverter; private readonly ScalingServiceToSpeckle _scalingService; public CircleToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter planeConverter, ScalingServiceToSpeckle scalingService ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _planeConverter = planeConverter; _scalingService = scalingService; } @@ -31,7 +32,7 @@ public SOG.Circle Convert(DB.Arc target) { plane = _planeConverter.Convert(arcPlane), radius = _scalingService.ScaleLength(target.Radius), - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, length = _scalingService.ScaleLength(target.Length) }; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs index b80d50fd8..762bc40a9 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrArrayToSpecklePolycurveConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.RevitShared.Raw; -internal sealed class CurveArrArrayToSpecklePolycurveConverter : ITypedConverter> +public sealed class CurveArrArrayToSpecklePolycurveConverter : ITypedConverter> { private readonly ITypedConverter _curveArrayConverter; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrayConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrayConversionToSpeckle.cs index 872d47aa3..de781d89a 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrayConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/CurveArrayConversionToSpeckle.cs @@ -1,7 +1,8 @@ using Autodesk.Revit.DB; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Objects.Geometry; @@ -9,17 +10,17 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public sealed class CurveArrayConversionToSpeckle : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ScalingServiceToSpeckle _scalingService; private readonly ITypedConverter _curveConverter; public CurveArrayConversionToSpeckle( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ScalingServiceToSpeckle scalingService, ITypedConverter curveConverter ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _scalingService = scalingService; _curveConverter = curveConverter; } @@ -30,9 +31,9 @@ public Polycurve Convert(CurveArray target) return new Polycurve() { - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, closed = - curves.First().GetEndPoint(0).DistanceTo(curves.Last().GetEndPoint(1)) < RevitConversionContextStack.TOLERANCE, + curves.First().GetEndPoint(0).DistanceTo(curves.Last().GetEndPoint(1)) < _converterSettings.Current.Tolerance, length = _scalingService.ScaleLength(curves.Sum(x => x.Length)), segments = curves.Select(x => _curveConverter.Convert(x)).ToList() }; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/EllipseToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/EllipseToSpeckleConverter.cs index 491f4bd3a..51c4aa7b5 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/EllipseToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/EllipseToSpeckleConverter.cs @@ -1,23 +1,24 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Primitive; namespace Speckle.Converters.RevitShared.ToSpeckle; public class EllipseToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _planeConverter; private readonly ScalingServiceToSpeckle _scalingService; public EllipseToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter planeConverter, ScalingServiceToSpeckle scalingService ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _planeConverter = planeConverter; _scalingService = scalingService; } @@ -40,7 +41,7 @@ public SOG.Ellipse Convert(DB.Ellipse target) domain = Interval.UnitInterval, trimDomain = trim, length = _scalingService.ScaleLength(target.Length), - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/LineConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/LineConversionToSpeckle.cs index efde9204f..dd35662ef 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/LineConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/LineConversionToSpeckle.cs @@ -1,23 +1,24 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Primitive; namespace Speckle.Converters.RevitShared.ToSpeckle; public class LineConversionToSpeckle : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; private readonly ScalingServiceToSpeckle _scalingService; public LineConversionToSpeckle( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter, ScalingServiceToSpeckle scalingService ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; _scalingService = scalingService; } @@ -25,10 +26,9 @@ ScalingServiceToSpeckle scalingService public SOG.Line Convert(DB.Line target) => new() { - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, start = _xyzToPointConverter.Convert(target.GetEndPoint(0)), end = _xyzToPointConverter.Convert(target.GetEndPoint(1)), domain = new Interval { start = target.GetEndParameter(0), end = target.GetEndParameter(1) }, - length = _scalingService.ScaleLength(target.Length) }; } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs index af7118dfd..40c60762d 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshByMaterialDictionaryToSpeckle.cs @@ -1,29 +1,32 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Other; using Speckle.Objects.Other.Revit; +using Speckle.Sdk.Common; namespace Speckle.Converters.RevitShared.ToSpeckle; public class MeshByMaterialDictionaryToSpeckle : ITypedConverter<(Dictionary> target, DB.ElementId parentElementId), List> { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _materialConverter; private readonly ITypedConverter, SOG.Mesh> _meshListConverter; - private readonly RevitMaterialCacheSingleton _materialCacheSingleton; + private readonly RevitMaterialCacheSingleton _revitMaterialCacheSingleton; public MeshByMaterialDictionaryToSpeckle( ITypedConverter materialConverter, ITypedConverter, SOG.Mesh> meshListConverter, - IRevitConversionContextStack contextStack, - RevitMaterialCacheSingleton materialCacheSingleton + IConverterSettingsStore converterSettings, + RevitMaterialCacheSingleton revitMaterialCacheSingleton ) { _materialConverter = materialConverter; _meshListConverter = meshListConverter; - _contextStack = contextStack; - _materialCacheSingleton = materialCacheSingleton; + _converterSettings = converterSettings; + _revitMaterialCacheSingleton = revitMaterialCacheSingleton; } /// @@ -43,10 +46,10 @@ RevitMaterialCacheSingleton materialCacheSingleton public List Convert((Dictionary> target, DB.ElementId parentElementId) args) { var result = new List(args.target.Keys.Count); - var objectRenderMaterialProxiesMap = _contextStack.RenderMaterialProxyCache.ObjectRenderMaterialProxiesMap; + var objectRenderMaterialProxiesMap = _revitMaterialCacheSingleton.ObjectRenderMaterialProxiesMap; var materialProxyMap = new Dictionary(); - objectRenderMaterialProxiesMap[args.parentElementId.ToString()!] = materialProxyMap; + objectRenderMaterialProxiesMap[args.parentElementId.ToString().NotNull()] = materialProxyMap; if (args.target.Count == 0) { @@ -56,6 +59,7 @@ RevitMaterialCacheSingleton materialCacheSingleton foreach (var keyValuePair in args.target) { DB.ElementId materialId = keyValuePair.Key; + string materialIdString = materialId.ToString().NotNull(); List meshes = keyValuePair.Value; // use the meshlist converter to convert the mesh values into a single speckle mesh @@ -63,22 +67,22 @@ RevitMaterialCacheSingleton materialCacheSingleton speckleMesh.applicationId = Guid.NewGuid().ToString(); // NOTE: as we are composing meshes out of multiple ones for the same material, we need to generate our own application id. c'est la vie. // get the render material if any - if (_contextStack.Current.Document.GetElement(materialId) is DB.Material material) + if (_converterSettings.Current.Document.GetElement(materialId) is DB.Material material) { (RevitMaterial _, RenderMaterial convertedRenderMaterial) = _materialConverter.Convert(material); - if (!materialProxyMap.TryGetValue(materialId.ToString()!, out RenderMaterialProxy? renderMaterialProxy)) + if (!materialProxyMap.TryGetValue(materialIdString, out RenderMaterialProxy? renderMaterialProxy)) { renderMaterialProxy = new RenderMaterialProxy() { value = convertedRenderMaterial, - applicationId = materialId.ToString()!, + applicationId = materialId.ToString(), objects = [] }; - materialProxyMap[materialId.ToString()!] = renderMaterialProxy; + materialProxyMap[materialIdString] = renderMaterialProxy; } - renderMaterialProxy.objects.Add(speckleMesh.applicationId!); + renderMaterialProxy.objects.Add(speckleMesh.applicationId); } result.Add(speckleMesh); diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshListConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshListConversionToSpeckle.cs index 5bc863a29..dd886e084 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshListConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/MeshListConversionToSpeckle.cs @@ -1,6 +1,7 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -8,15 +9,15 @@ public class MeshListConversionToSpeckle : ITypedConverter, SOG.Me { private readonly IScalingServiceToSpeckle _toSpeckleScalingService; private readonly IReferencePointConverter _referencePointConverter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public MeshListConversionToSpeckle( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, IReferencePointConverter referencePointConverter, IScalingServiceToSpeckle toSpeckleScalingService ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _toSpeckleScalingService = toSpeckleScalingService; _referencePointConverter = referencePointConverter; } @@ -54,12 +55,18 @@ public SOG.Mesh Convert(List target) } } - SOG.Mesh speckleMesh = new(vertices, faces, units: _contextStack.Current.SpeckleUnits); + SOG.Mesh speckleMesh = + new() + { + vertices = vertices, + faces = faces, + units = _converterSettings.Current.SpeckleUnits + }; return speckleMesh; } - private static (int vertexCount, int) GetVertexAndFaceListSize(List meshes) + private static (int vertexCount, int) GetVertexAndFaceListSize(IReadOnlyList meshes) { int numberOfVertices = 0; int numberOfFaces = 0; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/NurbsSplineToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/NurbsSplineToSpeckleConverter.cs index 1e4cd41d1..0e381f67a 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/NurbsSplineToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/NurbsSplineToSpeckleConverter.cs @@ -1,6 +1,7 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Primitive; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -8,26 +9,26 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class NurbsSplineToSpeckleConverter : ITypedConverter { private readonly IRevitVersionConversionHelper _conversionHelper; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; private readonly ScalingServiceToSpeckle _scalingService; public NurbsSplineToSpeckleConverter( IRevitVersionConversionHelper conversionHelper, - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter, ScalingServiceToSpeckle scalingService ) { _conversionHelper = conversionHelper; - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; _scalingService = scalingService; } public SOG.Curve Convert(DB.NurbSpline target) { - var units = _contextStack.Current.SpeckleUnits; + var units = _converterSettings.Current.SpeckleUnits; var points = new List(); foreach (var p in target.CtrlPoints) diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PlaneToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PlaneToSpeckleConverter.cs index 466e57da1..6b405029d 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PlaneToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PlaneToSpeckleConverter.cs @@ -1,21 +1,22 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; public class PlaneToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; private readonly ITypedConverter _xyzToVectorConverter; public PlaneToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter, ITypedConverter xyzToVectorConverter ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; _xyzToVectorConverter = xyzToVectorConverter; } @@ -33,7 +34,7 @@ public SOG.Plane Convert(DB.Plane target) normal = normal, xdir = xdir, ydir = ydir, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PointCloudToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PointCloudToSpeckleConverter.cs index c07fe462f..a193f6b4a 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PointCloudToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PointCloudToSpeckleConverter.cs @@ -1,21 +1,22 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; public class PointCloudToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; private readonly ITypedConverter _boundingBoxConverter; public PointCloudToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter, ITypedConverter boundingBoxConverter ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; _boundingBoxConverter = boundingBoxConverter; } @@ -37,7 +38,7 @@ public SOG.Pointcloud Convert(DB.PointCloudInstance target) .SelectMany(o => new List() { o.x, o.y, o.z }) .ToList(), colors = points.Select(o => o.Color).ToList(), - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, bbox = _boundingBoxConverter.Convert(boundingBox) }; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PolylineToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PolylineToSpeckleConverter.cs index db4d5372c..3e136db62 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PolylineToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/PolylineToSpeckleConverter.cs @@ -1,25 +1,26 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; public class PolylineToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly ITypedConverter _xyzToPointConverter; public PolylineToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ITypedConverter xyzToPointConverter ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _xyzToPointConverter = xyzToPointConverter; } public SOG.Polyline Convert(DB.PolyLine target) { var coords = target.GetCoordinates().SelectMany(coord => _xyzToPointConverter.Convert(coord).ToList()).ToList(); - return new SOG.Polyline { value = coords, units = _contextStack.Current.SpeckleUnits }; + return new SOG.Polyline { value = coords, units = _converterSettings.Current.SpeckleUnits }; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/VectorToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/VectorToSpeckleConverter.cs index 4170d2f89..c8c0c544c 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/VectorToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/VectorToSpeckleConverter.cs @@ -1,5 +1,7 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -7,14 +9,17 @@ public class VectorToSpeckleConverter : ITypedConverter { private readonly IReferencePointConverter _referencePointConverter; private readonly ScalingServiceToSpeckle _scalingService; + private readonly IConverterSettingsStore _settingsStore; public VectorToSpeckleConverter( IReferencePointConverter referencePointConverter, - ScalingServiceToSpeckle scalingService + ScalingServiceToSpeckle scalingService, + IConverterSettingsStore settingsStore ) { _referencePointConverter = referencePointConverter; _scalingService = scalingService; + _settingsStore = settingsStore; } public SOG.Vector Convert(DB.XYZ target) @@ -25,7 +30,8 @@ public SOG.Vector Convert(DB.XYZ target) var pointToSpeckle = new SOG.Vector( _scalingService.ScaleLength(extPt.X), _scalingService.ScaleLength(extPt.Y), - _scalingService.ScaleLength(extPt.Z) + _scalingService.ScaleLength(extPt.Z), + _settingsStore.Current.SpeckleUnits ); return pointToSpeckle; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/XyzConversionToPoint.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/XyzConversionToPoint.cs index e46105092..a98d9e5e9 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/XyzConversionToPoint.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/Geometry/XyzConversionToPoint.cs @@ -1,6 +1,7 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -8,17 +9,17 @@ public class XyzConversionToPoint : ITypedConverter { private readonly IScalingServiceToSpeckle _toSpeckleScalingService; private readonly IReferencePointConverter _referencePointConverter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public XyzConversionToPoint( IScalingServiceToSpeckle toSpeckleScalingService, IReferencePointConverter referencePointConverter, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _toSpeckleScalingService = toSpeckleScalingService; _referencePointConverter = referencePointConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; } public SOG.Point Convert(DB.XYZ target) @@ -29,7 +30,7 @@ public SOG.Point Convert(DB.XYZ target) _toSpeckleScalingService.ScaleLength(extPt.X), _toSpeckleScalingService.ScaleLength(extPt.Y), _toSpeckleScalingService.ScaleLength(extPt.Z), - _contextStack.Current.SpeckleUnits + _converterSettings.Current.SpeckleUnits ); return pointToSpeckle; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialConversionToSpeckle.cs index 14a9fe330..247e997b0 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialConversionToSpeckle.cs @@ -7,15 +7,10 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class MaterialConversionToSpeckle : ITypedConverter { - private readonly ParameterObjectAssigner _parameterObjectAssigner; private readonly RevitMaterialCacheSingleton _materialCacheSingleton; - public MaterialConversionToSpeckle( - ParameterObjectAssigner parameterObjectAssigner, - RevitMaterialCacheSingleton materialCacheSingleton - ) + public MaterialConversionToSpeckle(RevitMaterialCacheSingleton materialCacheSingleton) { - _parameterObjectAssigner = parameterObjectAssigner; _materialCacheSingleton = materialCacheSingleton; } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialQuantitiesToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialQuantitiesToSpeckle.cs index a8cfe18fd..37c32a36b 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialQuantitiesToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/MaterialQuantitiesToSpeckle.cs @@ -1,6 +1,7 @@ +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.Other; using Speckle.Objects.Other.Revit; @@ -13,15 +14,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class MaterialQuantitiesToSpeckleLite : ITypedConverter>> { private readonly ScalingServiceToSpeckle _scalingService; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public MaterialQuantitiesToSpeckleLite( ScalingServiceToSpeckle scalingService, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _scalingService = scalingService; - _contextStack = contextStack; + _converterSettings = converterSettings; } /// @@ -47,9 +48,9 @@ public List> Convert(DB.Element target) double factor = _scalingService.ScaleLength(1); materialQuantity["area"] = factor * factor * target.GetMaterialArea(matId, false); materialQuantity["volume"] = factor * factor * factor * target.GetMaterialVolume(matId); - materialQuantity["units"] = _contextStack.Current.SpeckleUnits; + materialQuantity["units"] = _converterSettings.Current.SpeckleUnits; - if (_contextStack.Current.Document.GetElement(matId) is DB.Material material) + if (_converterSettings.Current.Document.GetElement(matId) is DB.Material material) { materialQuantity["materialName"] = material.Name; materialQuantity["materialCategory"] = material.MaterialCategory; @@ -71,17 +72,17 @@ public class MaterialQuantitiesToSpeckle : ITypedConverter _materialConverter; private readonly ScalingServiceToSpeckle _scalingService; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public MaterialQuantitiesToSpeckle( ITypedConverter materialConverter, ScalingServiceToSpeckle scalingService, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _materialConverter = materialConverter; _scalingService = scalingService; - _contextStack = contextStack; + _converterSettings = converterSettings; } /// @@ -114,11 +115,11 @@ public List Convert(DB.Element target) double area = factor * factor * target.GetMaterialArea(matId, false); double volume = factor * factor * factor * target.GetMaterialVolume(matId); - if (_contextStack.Current.Document.GetElement(matId) is DB.Material material) + if (_converterSettings.Current.Document.GetElement(matId) is DB.Material material) { (RevitMaterial convertedMaterial, RenderMaterial _) = _materialConverter.Convert(material); // NOTE: the RevitMaterial class is semi useless, and it used to extract parameters out too for each material. Overkill. - quantities.Add(new(convertedMaterial, volume, area, _contextStack.Current.SpeckleUnits)); + quantities.Add(new(convertedMaterial, volume, area, _converterSettings.Current.SpeckleUnits)); } } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrArrayToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrArrayToSpeckleConverter.cs index bf285ecab..251445a8b 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrArrayToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrArrayToSpeckleConverter.cs @@ -4,7 +4,7 @@ namespace Speckle.Converters.RevitShared.Raw; -internal sealed class ModelCurveArrArrayConverterToSpeckle : ITypedConverter +public sealed class ModelCurveArrArrayConverterToSpeckle : ITypedConverter { private readonly ITypedConverter _modelCurveArrayConverter; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrayToSpeckleConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrayToSpeckleConverter.cs index 897bf7707..c5a65439e 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrayToSpeckleConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/Raw/ModelCurveArrayToSpeckleConverter.cs @@ -1,24 +1,24 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; namespace Speckle.Converters.RevitShared.Raw; -internal sealed class ModelCurveArrayToSpeckleConverter : ITypedConverter +public sealed class ModelCurveArrayToSpeckleConverter : ITypedConverter { - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly IScalingServiceToSpeckle _scalingService; private readonly ITypedConverter _curveConverter; public ModelCurveArrayToSpeckleConverter( - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, IScalingServiceToSpeckle scalingService, ITypedConverter curveConverter ) { - _contextStack = contextStack; + _converterSettings = converterSettings; _scalingService = scalingService; _curveConverter = curveConverter; } @@ -37,8 +37,8 @@ public SOG.Polycurve Convert(DB.ModelCurveArray target) SOG.Polycurve polycurve = new() { - units = _contextStack.Current.SpeckleUnits, - closed = start.DistanceTo(end) < RevitConversionContextStack.TOLERANCE, + units = _converterSettings.Current.SpeckleUnits, + closed = start.DistanceTo(end) < _converterSettings.Current.Tolerance, length = _scalingService.ScaleLength(curves.Sum(x => x.Length)), segments = curves.Select(x => _curveConverter.Convert(x)).ToList() }; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/CeilingTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/CeilingTopLevelConverterToSpeckle.cs index c63fcf853..d799caaa4 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/CeilingTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/CeilingTopLevelConverterToSpeckle.cs @@ -2,6 +2,7 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Objects.BuiltElements.Revit; using Speckle.Objects.Geometry; @@ -14,25 +15,22 @@ internal sealed class CeilingTopLevelConverterToSpeckle : BaseTopLevelConverterT private readonly ITypedConverter> _curveArrArrayConverter; private readonly ITypedConverter _levelConverter; private readonly ParameterValueExtractor _parameterValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; private readonly DisplayValueExtractor _displayValueExtractor; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public CeilingTopLevelConverterToSpeckle( ITypedConverter> curveArrArrayConverter, ITypedConverter levelConverter, ParameterValueExtractor parameterValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, DisplayValueExtractor displayValueExtractor, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _curveArrArrayConverter = curveArrArrayConverter; _levelConverter = levelConverter; _parameterValueExtractor = parameterValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; _displayValueExtractor = displayValueExtractor; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override RevitCeiling Convert(Ceiling target) @@ -51,7 +49,7 @@ public override RevitCeiling Convert(Ceiling target) family = elementType.FamilyName, level = speckleLevel, displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; var sketch = (Sketch)target.Document.GetElement(target.SketchId); @@ -66,8 +64,6 @@ public override RevitCeiling Convert(Ceiling target) speckleCeiling.voids = profiles.Skip(1).ToList(); } - _parameterObjectAssigner.AssignParametersToBase(target, speckleCeiling); - return speckleCeiling; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/DirectShapeTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/DirectShapeTopLevelConverterToSpeckle.cs index c812333d3..d7c6e6799 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/DirectShapeTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/DirectShapeTopLevelConverterToSpeckle.cs @@ -1,6 +1,7 @@ using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Extensions; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Sdk.Common; using Speckle.Sdk.Models; @@ -10,18 +11,15 @@ namespace Speckle.Converters.Revit2023.ToSpeckle; [NameAndRankValue(nameof(DB.DirectShape), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class DirectShapeTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { - private readonly IRevitConversionContextStack _contextStack; - private readonly ParameterObjectAssigner _parameterObjectAssigner; + private readonly IConverterSettingsStore _converterSettings; private readonly DisplayValueExtractor _displayValueExtractor; public DirectShapeTopLevelConverterToSpeckle( - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, DisplayValueExtractor displayValueExtractor ) { - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; _displayValueExtractor = displayValueExtractor; } @@ -36,12 +34,10 @@ public override SOBR.DirectShape Convert(DB.DirectShape target) new(target.Name, category, geometries) { displayValue = geometries, - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, elementId = target.Id.ToString().NotNull() }; - _parameterObjectAssigner.AssignParametersToBase(target, result); - result["type"] = target.Name; return result; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ElementTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ElementTopLevelConverterToSpeckle.cs index 65213d8a6..ba70f6c99 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ElementTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ElementTopLevelConverterToSpeckle.cs @@ -1,5 +1,6 @@ using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.BuiltElements.Revit; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -9,18 +10,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class ElementTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public ElementTopLevelConverterToSpeckle( DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override RevitElement Convert(DB.Element target) @@ -40,9 +38,7 @@ public override RevitElement Convert(DB.Element target) displayValue = displayValue }; - speckleElement["units"] = _contextStack.Current.SpeckleUnits; - - _parameterObjectAssigner.AssignParametersToBase(target, speckleElement); + speckleElement["units"] = _converterSettings.Current.SpeckleUnits; return speckleElement; } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ExtrusionRoofToSpeckleTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ExtrusionRoofToSpeckleTopLevelConverter.cs index 94452fd0e..6fe8823a1 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ExtrusionRoofToSpeckleTopLevelConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ExtrusionRoofToSpeckleTopLevelConverter.cs @@ -1,6 +1,7 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.BuiltElements.Revit; using Speckle.Objects.BuiltElements.Revit.RevitRoof; @@ -15,8 +16,7 @@ public class ExtrusionRoofToSpeckleTopLevelConverter private readonly ITypedConverter _pointConverter; private readonly ParameterValueExtractor _parameterValueExtractor; private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public ExtrusionRoofToSpeckleTopLevelConverter( ITypedConverter levelConverter, @@ -24,8 +24,7 @@ public ExtrusionRoofToSpeckleTopLevelConverter( ITypedConverter pointConverter, ParameterValueExtractor parameterValueExtractor, DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _levelConverter = levelConverter; @@ -33,18 +32,12 @@ IRevitConversionContextStack contextStack _pointConverter = pointConverter; _parameterValueExtractor = parameterValueExtractor; _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override RevitExtrusionRoof Convert(DB.ExtrusionRoof target) { - var plane = target.GetProfile().get_Item(0).SketchPlane.GetPlane(); - SOG.Line referenceLine = - new( - _pointConverter.Convert(plane.Origin.Add(plane.XVec.Normalize().Negate())), - _pointConverter.Convert(plane.Origin) - ); + SOG.Line referenceLine = ConvertReferenceLine(target); var level = _parameterValueExtractor.GetValueAsDocumentObject( target, DB.BuiltInParameter.ROOF_CONSTRAINT_LEVEL_PARAM @@ -65,11 +58,22 @@ public override RevitExtrusionRoof Convert(DB.ExtrusionRoof target) referenceLine = referenceLine, level = speckleLevel, displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; - _parameterObjectAssigner.AssignParametersToBase(target, speckleExtrusionRoof); - return speckleExtrusionRoof; } + + private SOG.Line ConvertReferenceLine(DB.ExtrusionRoof target) + { + var plane = target.GetProfile().get_Item(0).SketchPlane.GetPlane(); + SOG.Line referenceLine = + new() + { + start = _pointConverter.Convert(plane.Origin.Add(plane.XVec.Normalize().Negate())), + end = _pointConverter.Convert(plane.Origin), + units = _converterSettings.Current.SpeckleUnits, + }; + return referenceLine; + } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FloorTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FloorTopLevelConverterToSpeckle.cs index d62de162e..89cc0435a 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FloorTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FloorTopLevelConverterToSpeckle.cs @@ -1,5 +1,6 @@ using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Converters.RevitShared.ToSpeckle; using Speckle.Objects; using Speckle.Objects.BuiltElements.Revit; @@ -18,28 +19,25 @@ public class FloorTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle> _curveArrArrayConverter; private readonly ITypedConverter _levelConverter; private readonly ParameterValueExtractor _parameterValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; private readonly DisplayValueExtractor _displayValueExtractor; private readonly ISlopeArrowExtractor _slopeArrowExtractor; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public FloorTopLevelConverterToSpeckle( ITypedConverter> curveArrArrayConverter, ITypedConverter levelConverter, ParameterValueExtractor parameterValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, DisplayValueExtractor displayValueExtractor, ISlopeArrowExtractor slopeArrowExtractor, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _curveArrArrayConverter = curveArrArrayConverter; _levelConverter = levelConverter; _parameterValueExtractor = parameterValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; _displayValueExtractor = displayValueExtractor; _slopeArrowExtractor = slopeArrowExtractor; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override SOBR.RevitFloor Convert(DB.Floor target) @@ -62,7 +60,7 @@ public override SOBR.RevitFloor Convert(DB.Floor target) level = speckleLevel, structural = structural, displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; // POC: Re-evaluate Wall sketch curve extraction, assumption of only one outline is wrong. https://spockle.atlassian.net/browse/CNX-9396 @@ -83,7 +81,6 @@ public override SOBR.RevitFloor Convert(DB.Floor target) slopeParam = slope / 100d; } - _parameterObjectAssigner.AssignParametersToBase(target, speckleFloor); TryAssignSlopeFromSlopeArrow(target, speckleFloor, slopeParam); return speckleFloor; @@ -104,7 +101,13 @@ private void TryAssignSlopeFromSlopeArrow(DB.Floor target, SOBR.RevitFloor speck slopeParam ??= slope; speckleFloor.slope = (double)slopeParam; - speckleFloor.slopeDirection = new SOG.Line(tail, head); + speckleFloor.slopeDirection = new SOG.Line() + { + start = tail, + end = head, + units = _converterSettings.Current.SpeckleUnits + }; + if ( speckleFloor["parameters"] is Base parameters && parameters["FLOOR_HEIGHTABOVELEVEL_PARAM"] is SOBR.Parameter offsetParam diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FootPrintRoofToSpeckleTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FootPrintRoofToSpeckleTopLevelConverter.cs index 5db350cd5..85e8f7dbb 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FootPrintRoofToSpeckleTopLevelConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/FootPrintRoofToSpeckleTopLevelConverter.cs @@ -2,11 +2,14 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Objects.BuiltElements.Revit; using Speckle.Objects.BuiltElements.Revit.RevitRoof; using Speckle.Objects.Geometry; using Speckle.Sdk.Common; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Extensions; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -18,24 +21,24 @@ public class FootPrintRoofToSpeckleTopLevelConverter private readonly ITypedConverter _modelCurveArrArrayConverter; private readonly ParameterValueExtractor _parameterValueExtractor; private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IRootToSpeckleConverter _converter; + private readonly IConverterSettingsStore _converterSettings; public FootPrintRoofToSpeckleTopLevelConverter( ITypedConverter levelConverter, ITypedConverter modelCurveArrArrayConverter, ParameterValueExtractor parameterValueExtractor, DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IRootToSpeckleConverter converter, + IConverterSettingsStore converterSettings ) { _levelConverter = levelConverter; _modelCurveArrArrayConverter = modelCurveArrArrayConverter; _parameterValueExtractor = parameterValueExtractor; _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converter = converter; + _converterSettings = converterSettings; } public override RevitFootprintRoof Convert(FootPrintRoof target) @@ -68,9 +71,29 @@ out var topLevel cutOffLevel = topLevel is not null ? _levelConverter.Convert(topLevel) : null, slope = slope, displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; + // Shockingly, roofs can have curtain grids on them. I guess it makes sense: https://en.wikipedia.org/wiki/Louvre_Pyramid + if (target.CurtainGrids is { } gs) + { + List roofChildren = new(); + foreach (CurtainGrid grid in gs) + { + roofChildren.AddRange(ConvertElements(grid.GetMullionIds())); + roofChildren.AddRange(ConvertElements(grid.GetPanelIds())); + } + + if (speckleFootprintRoof.GetDetachedProp("elements") is List elements) + { + elements.AddRange(roofChildren); + } + else + { + speckleFootprintRoof.SetDetachedProp("elements", roofChildren); + } + } + // POC: CNX-9396 again with the incorrect assumption that the first profile is the floor and subsequent profiles // are voids // POC: CNX-9403 in current connector, we are doing serious gymnastics to get the slope of the floor as defined by @@ -79,10 +102,14 @@ out var topLevel speckleFootprintRoof.outline = profiles.FirstOrDefault().NotNull(); speckleFootprintRoof.voids = profiles.Skip(1).ToList(); - // POC: we are starting to see logic that is happening in all converters. We should definitely consider some - // conversion pipeline behavior. Would probably require adding interfaces into objects kit - _parameterObjectAssigner.AssignParametersToBase(target, speckleFootprintRoof); - return speckleFootprintRoof; } + + private IEnumerable ConvertElements(IEnumerable elementIds) + { + foreach (DB.ElementId elementId in elementIds) + { + yield return _converter.Convert(_converterSettings.Current.Document.GetElement(elementId)); + } + } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/GridTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/GridTopLevelConverterToSpeckle.cs index 7cf6dec50..09c5fb3fa 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/GridTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/GridTopLevelConverterToSpeckle.cs @@ -1,6 +1,6 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -9,15 +9,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public sealed class GridTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { private readonly ITypedConverter _curveConverter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public GridTopLevelConverterToSpeckle( ITypedConverter curveConverter, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _curveConverter = curveConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override SOBE.GridLine Convert(DB.Grid target) => @@ -26,6 +26,6 @@ public override SOBE.GridLine Convert(DB.Grid target) => baseLine = _curveConverter.Convert(target.Curve), label = target.Name, applicationId = target.UniqueId, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/HostedElementConversionToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/HostedElementConversionToSpeckle.cs index c99e8da36..2cead587a 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/HostedElementConversionToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/HostedElementConversionToSpeckle.cs @@ -1,6 +1,6 @@ using Autodesk.Revit.DB; using Speckle.Converters.Common; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk.Models; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -12,19 +12,22 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class HostedElementConversionToSpeckle { private readonly IRootToSpeckleConverter _converter; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; - public HostedElementConversionToSpeckle(IRootToSpeckleConverter converter, IRevitConversionContextStack contextStack) + public HostedElementConversionToSpeckle( + IRootToSpeckleConverter converter, + IConverterSettingsStore converterSettings + ) { _converter = converter; - _contextStack = contextStack; + _converterSettings = converterSettings; } public IEnumerable ConvertHostedElements(IEnumerable hostedElementIds) { foreach (var elemId in hostedElementIds) { - Element element = _contextStack.Current.Document.GetElement(elemId); + Element element = _converterSettings.Current.Document.GetElement(elemId); Base @base; try diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/LevelTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/LevelTopLevelConverterToSpeckle.cs index c79e31540..881d43030 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/LevelTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/LevelTopLevelConverterToSpeckle.cs @@ -1,6 +1,6 @@ using Speckle.Converters.Common; -using Speckle.Converters.RevitShared.Helpers; using Speckle.Converters.RevitShared.Services; +using Speckle.Converters.RevitShared.Settings; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -8,18 +8,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class LevelConversionToSpeckle : BaseTopLevelConverterToSpeckle { private readonly ScalingServiceToSpeckle _scalingService; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public LevelConversionToSpeckle( ScalingServiceToSpeckle scalingService, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _scalingService = scalingService; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override SOBR.RevitLevel Convert(DB.Level target) @@ -30,11 +27,9 @@ public override SOBR.RevitLevel Convert(DB.Level target) elevation = _scalingService.ScaleLength(target.Elevation), name = target.Name, createView = true, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; - _parameterObjectAssigner.AssignParametersToBase(target, level); - return level; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs index c11873832..d54cc81be 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/ModelCurveToSpeckleTopLevelConverter.cs @@ -1,6 +1,6 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Sdk.Common; @@ -12,15 +12,15 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class ModelCurveToSpeckleTopLevelConverter : BaseTopLevelConverterToSpeckle { private readonly ITypedConverter _curveConverter; - private readonly IRevitConversionContextStack _conversionContext; + private readonly IConverterSettingsStore _converterSettings; public ModelCurveToSpeckleTopLevelConverter( ITypedConverter curveConverter, - IRevitConversionContextStack conversionContext + IConverterSettingsStore converterSettings ) { _curveConverter = curveConverter; - _conversionContext = conversionContext; + _converterSettings = converterSettings; } public override SOBR.Curve.ModelCurve Convert(DB.ModelCurve target) @@ -30,7 +30,7 @@ public override SOBR.Curve.ModelCurve Convert(DB.ModelCurve target) baseCurve = _curveConverter.Convert(target.GeometryCurve), lineStyle = target.LineStyle.Name, elementId = target.Id.ToString().NotNull(), - units = _conversionContext.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; // POC: check this is not going to set the display value to anything we cannot actually display - i.e. polycurve diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoofBaseToSpeckleTopLevelTopLevelConverter.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoofBaseToSpeckleTopLevelTopLevelConverter.cs index b36d69f8d..ceb13f677 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoofBaseToSpeckleTopLevelTopLevelConverter.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoofBaseToSpeckleTopLevelTopLevelConverter.cs @@ -1,6 +1,7 @@ using Autodesk.Revit.DB; using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects.BuiltElements.Revit.RevitRoof; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -10,18 +11,15 @@ internal sealed class RoofBaseToSpeckleTopLevelTopLevelConverter : BaseTopLevelConverterToSpeckle { private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public RoofBaseToSpeckleTopLevelTopLevelConverter( DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override RevitRoof Convert(RoofBase target) @@ -35,10 +33,8 @@ public override RevitRoof Convert(RoofBase target) type = elementType.Name, family = elementType.FamilyName, displayValue = displayValue, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; - - _parameterObjectAssigner.AssignParametersToBase(target, revitRoof); return revitRoof; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoomTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoomTopLevelConverterToSpeckle.cs index bbd51b48c..9528b3ac8 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoomTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/RoomTopLevelConverterToSpeckle.cs @@ -1,6 +1,7 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Sdk.Models; @@ -10,30 +11,27 @@ namespace Speckle.Converters.RevitShared.ToSpeckle; public class RoomTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { 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; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public RoomTopLevelConverterToSpeckle( DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, ITypedConverter levelConverter, ParameterValueExtractor parameterValueExtractor, ITypedConverter locationConverter, ITypedConverter, SOG.Polycurve> boundarySegmentConverter, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; _levelConverter = levelConverter; _parameterValueExtractor = parameterValueExtractor; _locationConverter = locationConverter; _boundarySegmentConverter = boundarySegmentConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override SOBE.Room Convert(DBA.Room target) @@ -60,11 +58,9 @@ public override SOBE.Room Convert(DBA.Room target) area = area, outline = outline, voids = voids, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; - _parameterObjectAssigner.AssignParametersToBase(target, speckleRoom); - // POC: Removed dynamic property `phaseCreated` as it seems the info is included in the parameters already return speckleRoom; diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/TopographyTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/TopographyTopLevelConverterToSpeckle.cs index 83d879f2d..196d21068 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/TopographyTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/TopographyTopLevelConverterToSpeckle.cs @@ -1,5 +1,6 @@ using Speckle.Converters.Common; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Sdk.Common; namespace Speckle.Converters.RevitShared.ToSpeckle; @@ -11,32 +12,27 @@ public class TopographyTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle { private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; public TopographyTopLevelConverterToSpeckle( DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, - IRevitConversionContextStack contextStack + IConverterSettingsStore converterSettings ) { _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; - _contextStack = contextStack; + _converterSettings = converterSettings; } public override SOBR.RevitTopography Convert(DBA.TopographySurface target) { var speckleTopo = new SOBR.RevitTopography { - units = _contextStack.Current.SpeckleUnits, + units = _converterSettings.Current.SpeckleUnits, displayValue = _displayValueExtractor.GetDisplayValue(target), - elementId = target.Id.ToString().NotNull() + elementId = target.Id.ToString().NotNull(), + baseGeometry = null! //TODO: this can't be correct, see https://linear.app/speckle/issue/CNX-461/revit-check-why-topographytospeckle-sets-no-basegeometry }; - // POC: shouldn't we just do this in the RevitConverter ? - _parameterObjectAssigner.AssignParametersToBase(target, speckleTopo); - return speckleTopo; } } diff --git a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/WallTopLevelConverterToSpeckle.cs b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/WallTopLevelConverterToSpeckle.cs index 4ad4048ab..f59546a81 100644 --- a/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/WallTopLevelConverterToSpeckle.cs +++ b/Converters/Revit/Speckle.Converters.RevitShared/ToSpeckle/TopLevel/WallTopLevelConverterToSpeckle.cs @@ -1,6 +1,7 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Converters.RevitShared.Helpers; +using Speckle.Converters.RevitShared.Settings; using Speckle.Objects; using Speckle.Objects.BuiltElements.Revit; using Speckle.Sdk.Models; @@ -17,29 +18,26 @@ public class WallTopLevelConverterToSpeckle : BaseTopLevelConverterToSpeckle _levelConverter; private readonly ITypedConverter> _curveArrArrayConverter; private readonly ParameterValueExtractor _parameterValueExtractor; - private readonly IRevitConversionContextStack _contextStack; + private readonly IConverterSettingsStore _converterSettings; private readonly DisplayValueExtractor _displayValueExtractor; - private readonly ParameterObjectAssigner _parameterObjectAssigner; private readonly IRootToSpeckleConverter _converter; public WallTopLevelConverterToSpeckle( ITypedConverter curveConverter, ITypedConverter levelConverter, ITypedConverter> curveArrArrayConverter, - IRevitConversionContextStack contextStack, + IConverterSettingsStore converterSettings, ParameterValueExtractor parameterValueExtractor, DisplayValueExtractor displayValueExtractor, - ParameterObjectAssigner parameterObjectAssigner, IRootToSpeckleConverter converter ) { _curveConverter = curveConverter; _levelConverter = levelConverter; _curveArrArrayConverter = curveArrArrayConverter; - _contextStack = contextStack; + _converterSettings = converterSettings; _parameterValueExtractor = parameterValueExtractor; _displayValueExtractor = displayValueExtractor; - _parameterObjectAssigner = parameterObjectAssigner; _converter = converter; } @@ -50,14 +48,13 @@ public override SOBR.RevitWall Convert(DB.Wall target) { family = target.WallType.FamilyName.ToString(), type = target.WallType.Name, - units = _contextStack.Current.SpeckleUnits + units = _converterSettings.Current.SpeckleUnits }; AssignSpecificParameters(target, speckleWall); AssignVoids(target, speckleWall); AssignHostedElements(speckleWall, GetChildElements(target)); AssignDisplayValue(target, speckleWall); - _parameterObjectAssigner.AssignParametersToBase(target, speckleWall); return speckleWall; } @@ -134,7 +131,7 @@ private IEnumerable ConvertElements(IEnumerable elementIds) { foreach (DB.ElementId elementId in elementIds) { - yield return _converter.Convert(_contextStack.Current.Document.GetElement(elementId)); + yield return _converter.Convert(_converterSettings.Current.Document.GetElement(elementId)); } } diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs b/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs deleted file mode 100644 index 0b2d23df3..000000000 --- a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/RhinoConverterModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Rhino; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common; -using Speckle.Converters.Common.DependencyInjection; -using Speckle.Converters.Rhino; -using Speckle.Converters.Rhino.ToSpeckle.Raw; - -namespace Speckle.Converters.Rhino7.DependencyInjection; - -public class RhinoConverterModule : ISpeckleModule -{ - public void Load(SpeckleContainerBuilder builder) - { - //register types by default - builder.ScanAssemblyOfType(); - // Register single root - builder.AddRootCommon(); - - // register all application converters and context stacks - builder.AddApplicationConverters(); - builder.AddScoped, RhinoConversionContextStack>(); - } -} diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj b/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj deleted file mode 100644 index 8d647638e..000000000 --- a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/Speckle.Converters.Rhino7.DependencyInjection.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net48 - false - Debug;Release;Local - - - - - - - diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json deleted file mode 100644 index ed729045c..000000000 --- a/Converters/Rhino/Speckle.Converters.Rhino7.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.rhino7": { - "type": "Project", - "dependencies": { - "RhinoCommon": "[7.13.21348.13001, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "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.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "RhinoCommon": { - "type": "CentralTransitive", - "requested": "[8.9.24194.18121, )", - "resolved": "7.13.21348.13001", - "contentHash": "JQdaNw61ddBqIe08E9O4N/grwrN1hjDHcYW7tWylwCZyFR7SepoCD4NS+6LN6+oSQhNbhLi9Bf+hQOFYFdRAEA==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs index 86f983a2b..57806f31c 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/ArcToSpeckleConverterTests.cs @@ -1,9 +1,9 @@ using FluentAssertions; using Moq; using NUnit.Framework; -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Rhino; using Speckle.Converters.Rhino.ToSpeckle.Raw; using Speckle.Testing; @@ -19,12 +19,12 @@ public void Convert_ShouldConvertArcCorrectly() var mockPointConverter = Create>(); var mockPlaneConverter = Create>(); var mockBoxConverter = Create>(); - var mockContextStack = Create>(); + var mockContextStack = Create>(); var factory = Create(); - var context = Create>(); - context.Setup(x => x.SpeckleUnits).Returns("units"); - mockContextStack.Setup(cs => cs.Current).Returns(context.Object); + var doc = Create(); + + mockContextStack.Setup(cs => cs.Current).Returns(new RhinoConversionSettings(doc.Object, "units")); var targetArc = Create(); var targetPlane = Create(); diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs index d81f381d4..771a38a9c 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/EllipseToSpeckleConverterTests.cs @@ -1,7 +1,7 @@ using NUnit.Framework; -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Rhino; using Speckle.Converters.Rhino.ToSpeckle.Raw; using Speckle.Testing; @@ -12,10 +12,10 @@ public class EllipseToSpeckleConverterTests : MoqTest [Test] public void Convert_Test() { - var conversionContextStack = Create>(); + var mockContextStack = Create>(); var planeConverter = Create>(); var boxConverter = Create>(); - _ = new EllipseToSpeckleConverter(planeConverter.Object, boxConverter.Object, conversionContextStack.Object); + _ = new EllipseToSpeckleConverter(planeConverter.Object, boxConverter.Object, mockContextStack.Object); } } diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj index 18f7bd447..b2b3653be 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/Speckle.Converters.Rhino7.Tests.csproj @@ -23,6 +23,6 @@ - + diff --git a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json index 70c7c8e3d..146519ee8 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json +++ b/Converters/Rhino/Speckle.Converters.Rhino7.Tests/packages.lock.json @@ -78,9 +78,9 @@ }, "Speckle.Rhino7.Fakes": { "type": "Direct", - "requested": "[0.2.2-preview.2, )", - "resolved": "0.2.2-preview.2", - "contentHash": "l4sP+NW1RPfI7/agOGHkXtcvpq24CLRsnUsK3QJwgDydHnsS4TWAM/OslkyLiytTzA6i4Hdsu7UQXRlizKv48g==", + "requested": "[0.3.0, 1.0.0)", + "resolved": "0.3.0", + "contentHash": "6nDQudPvrsaVgrGWicQ50fb3LzyEp8QMCltJZs6itzyYlHYC8xjmCHK1Z305f3y9QfK9QQa93sBrEtS7xIhcEQ==", "dependencies": { "System.Drawing.Common": "8.0.6" } @@ -156,6 +156,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -216,11 +264,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -251,6 +294,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -287,28 +335,21 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "4.4.0", "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, "speckle.testing": { @@ -318,43 +359,49 @@ "NUnit": "[4.1.0, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj b/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj index f642d7db6..e51ccd2a6 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj +++ b/Converters/Rhino/Speckle.Converters.Rhino7/Speckle.Converters.Rhino7.csproj @@ -6,8 +6,6 @@ $(DefineConstants);RHINO7;RHINO7_OR_GREATER - - @@ -15,4 +13,6 @@ + + diff --git a/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json index 4abbdcb35..a8ac32461 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json +++ b/Converters/Rhino/Speckle.Converters.Rhino7/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,65 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/RhinoConverterModule.cs b/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/RhinoConverterModule.cs deleted file mode 100644 index e3e3a34e9..000000000 --- a/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/RhinoConverterModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Rhino; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common; -using Speckle.Converters.Common.DependencyInjection; -using Speckle.Converters.Rhino; -using Speckle.Converters.Rhino.ToSpeckle.Raw; - -namespace Speckle.Converters.Rhino8.DependencyInjection; - -public class RhinoConverterModule : ISpeckleModule -{ - public void Load(SpeckleContainerBuilder builder) - { - //register types by default - builder.ScanAssemblyOfType(); - // Register single root - builder.AddRootCommon(); - - // register all application converters and context stacks - builder.AddApplicationConverters(); - builder.AddScoped, RhinoConversionContextStack>(); - } -} diff --git a/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/Speckle.Converters.Rhino8.DependencyInjection.csproj b/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/Speckle.Converters.Rhino8.DependencyInjection.csproj deleted file mode 100644 index 6878cb3a8..000000000 --- a/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/Speckle.Converters.Rhino8.DependencyInjection.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net48 - false - Debug;Release;Local - - - - - - - diff --git a/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/packages.lock.json deleted file mode 100644 index 22f63cf92..000000000 --- a/Converters/Rhino/Speckle.Converters.Rhino8.DependencyInjection/packages.lock.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "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, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "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.CSharp": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "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" - } - }, - "Speckle.DoubleNumerics": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, - "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.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "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.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } - }, - "speckle.converters.common.dependencyinjection": { - "type": "Project", - "dependencies": { - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "speckle.converters.rhino8": { - "type": "Project", - "dependencies": { - "RhinoCommon": "[8.9.24194.18121, )", - "Speckle.Converters.Common": "[1.0.0, )" - } - }, - "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.Extensions.Logging.Abstractions": { - "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "RhinoCommon": { - "type": "CentralTransitive", - "requested": "[8.9.24194.18121, )", - "resolved": "8.9.24194.18121", - "contentHash": "XRMnm38sBFeMT5AAtRTJdSaql/YNtT02AGi8TEVP1VZ4fkm8VJ1q2nNioWN3tW/+H8Tdi4nV+DuhB/5uE41MCg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", - "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } - } - } - } -} \ No newline at end of file diff --git a/Converters/Rhino/Speckle.Converters.Rhino8/Speckle.Converters.Rhino8.csproj b/Converters/Rhino/Speckle.Converters.Rhino8/Speckle.Converters.Rhino8.csproj index dfad301f6..9109a4b8a 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino8/Speckle.Converters.Rhino8.csproj +++ b/Converters/Rhino/Speckle.Converters.Rhino8/Speckle.Converters.Rhino8.csproj @@ -4,11 +4,8 @@ net48 Debug;Release;Local $(DefineConstants);RHINO8;RHINO7_OR_GREATER;RHIN08_OR_GREATER - - - @@ -16,4 +13,6 @@ + + diff --git a/Converters/Rhino/Speckle.Converters.Rhino8/packages.lock.json b/Converters/Rhino/Speckle.Converters.Rhino8/packages.lock.json index 570a56b3c..793da53a3 100644 --- a/Converters/Rhino/Speckle.Converters.Rhino8/packages.lock.json +++ b/Converters/Rhino/Speckle.Converters.Rhino8/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -97,6 +89,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.SourceLink.Common": { "type": "Transitive", "resolved": "8.0.0", @@ -130,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -167,17 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -191,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -204,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -239,65 +255,56 @@ "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": { - "Autofac": "[5.2.0, )" - } - }, "speckle.converters.common": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionContextStack.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionContextStack.cs deleted file mode 100644 index 8bc3c2a7f..000000000 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionContextStack.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Rhino; -using Speckle.Converters.Common; - -namespace Speckle.Converters.Rhino; - -// POC: CNX-9268 Suppressed naming warning for now, but we should evaluate if we should follow this or disable it. -[SuppressMessage( - "Naming", - "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 RhinoConversionContextStack(IHostToSpeckleUnitConverter unitConverter) - : base(RhinoDoc.ActiveDoc, RhinoDoc.ActiveDoc.ModelUnitSystem, unitConverter) { } -} diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionSettings.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionSettings.cs new file mode 100644 index 000000000..2b7fd8f10 --- /dev/null +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionSettings.cs @@ -0,0 +1,5 @@ +using Rhino; + +namespace Speckle.Converters.Rhino; + +public record RhinoConversionSettings(RhinoDoc Document, string SpeckleUnits); diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionSettingsFactory.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionSettingsFactory.cs new file mode 100644 index 000000000..ae372fdd1 --- /dev/null +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/RhinoConversionSettingsFactory.cs @@ -0,0 +1,17 @@ +using Rhino; +using Speckle.Converters.Common; +using Speckle.InterfaceGenerator; + +namespace Speckle.Converters.Rhino; + +[GenerateAutoInterface] +public class RhinoConversionSettingsFactory( + IHostToSpeckleUnitConverter unitsConverter, + IConverterSettingsStore settingsStore +) : IRhinoConversionSettingsFactory +{ + public RhinoConversionSettings Current => settingsStore.Current; + + public RhinoConversionSettings Create(RhinoDoc document) => + new(document, unitsConverter.ConvertOrThrow(RhinoDoc.ActiveDoc.ModelUnitSystem)); +} diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ServiceRegistration.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ServiceRegistration.cs new file mode 100644 index 000000000..b717ffb2e --- /dev/null +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ServiceRegistration.cs @@ -0,0 +1,28 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Rhino; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk; + +namespace Speckle.Converters.Rhino; + +public static class ServiceRegistration +{ + public static IServiceCollection AddRhinoConverters(this IServiceCollection serviceCollection) + { + var converterAssembly = Assembly.GetExecutingAssembly(); + //register types by default + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + // Register single root + serviceCollection.AddRootCommon(converterAssembly); + + // register all application converters and context stacks + serviceCollection.AddApplicationConverters(converterAssembly); + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + return serviceCollection; + } +} diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/SpeckleToHostGeometryBaseTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/SpeckleToHostGeometryBaseTopLevelConverter.cs index 45d57f467..a7f4914e7 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/SpeckleToHostGeometryBaseTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/SpeckleToHostGeometryBaseTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Common; using Speckle.Sdk.Models; @@ -10,15 +9,15 @@ public abstract class SpeckleToHostGeometryBaseTopLevelConverter : IT where TIn : Base where TOut : RG.GeometryBase { - protected IConversionContextStack ContextStack { get; private set; } + protected IConverterSettingsStore SettingsStore { get; private set; } private readonly ITypedConverter _geometryBaseConverter; protected SpeckleToHostGeometryBaseTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) { - ContextStack = contextStack; + SettingsStore = settingsStore; _geometryBaseConverter = geometryBaseConverter; } @@ -34,7 +33,7 @@ public object Convert(Base target) */ if (castedBase["units"] is string units) { - var scaleFactor = Units.GetConversionFactor(units, ContextStack.Current.SpeckleUnits); + var scaleFactor = Units.GetConversionFactor(units, SettingsStore.Current.SpeckleUnits); var scale = RG.Transform.Scale(RG.Point3d.Origin, scaleFactor); result.Transform(scale); } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/BrepToHostConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/BrepToHostConverter.cs index 4f8010a8b..2c626977a 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/BrepToHostConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/BrepToHostConverter.cs @@ -1,4 +1,3 @@ -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Objects; @@ -7,21 +6,21 @@ namespace Speckle.Converters.Rhino.ToHost.Raw; public class BrepToHostConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _curveConverter; private readonly ITypedConverter _surfaceConverter; private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _intervalConverter; public BrepToHostConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter curveConverter, ITypedConverter surfaceConverter, ITypedConverter pointConverter, ITypedConverter intervalConverter ) { - _contextStack = contextStack; + _settingsStore = settingsStore; _curveConverter = curveConverter; _surfaceConverter = surfaceConverter; _pointConverter = pointConverter; @@ -42,7 +41,7 @@ public BrepToHostConverter( /// ⚠️ This conversion does NOT perform scaling. public RG.Brep Convert(SOG.Brep target) { - var tolerance = _contextStack.Current.Document.ModelAbsoluteTolerance; + var tolerance = _settingsStore.Current.Document.ModelAbsoluteTolerance; var rhinoBrep = new RG.Brep(); diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/PolyCurveToHostConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/PolyCurveToHostConverter.cs index 0c087579d..0c21f87d2 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/PolyCurveToHostConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/Raw/PolyCurveToHostConverter.cs @@ -1,3 +1,4 @@ +using Microsoft.Extensions.DependencyInjection; using Speckle.Converters.Common.Objects; using Speckle.Objects; using Speckle.Sdk.Common; @@ -6,13 +7,16 @@ namespace Speckle.Converters.Rhino.ToHost.Raw; public class PolyCurveToHostConverter : ITypedConverter { - public ITypedConverter? CurveConverter { get; set; } // POC: CNX-9311 Circular dependency injected by the container using property. - private readonly ITypedConverter _intervalConverter; + private readonly IServiceProvider _serviceProvider; - public PolyCurveToHostConverter(ITypedConverter intervalConverter) + public PolyCurveToHostConverter( + ITypedConverter intervalConverter, + IServiceProvider serviceProvider + ) { _intervalConverter = intervalConverter; + _serviceProvider = serviceProvider; } /// @@ -27,7 +31,7 @@ public RG.PolyCurve Convert(SOG.Polycurve target) foreach (var segment in target.segments) { - RG.Curve childCurve = CurveConverter.NotNull().Convert(segment); + RG.Curve childCurve = _serviceProvider.GetRequiredService>().Convert(segment); if (!childCurve.IsValid) { throw new ConversionException($"Failed to convert segment {segment}"); diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs index 092c4f02a..3ebd21b35 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/ArcToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class ArcToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public ArcToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs index 041250478..a20d9f1c3 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/BrepToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class BrepToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public BrepToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs index 8c478e421..17e60e248 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/CircleToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class CircleToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public CircleToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs index f52007a71..24851e534 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/EllipseToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class EllipseToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public EllipseToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs index a4fca504b..d83f2e1c3 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/FallbackToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Common; using Speckle.Sdk.Models; @@ -15,21 +14,21 @@ public class FallbackToHostTopLevelConverter private readonly ITypedConverter _lineConverter; private readonly ITypedConverter _polylineConverter; private readonly ITypedConverter _meshConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public FallbackToHostTopLevelConverter( ITypedConverter pointConverter, ITypedConverter lineConverter, ITypedConverter polylineConverter, ITypedConverter meshConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _lineConverter = lineConverter; _polylineConverter = polylineConverter; _meshConverter = meshConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public object Convert(Base target) => Convert((DisplayableObject)target); @@ -63,7 +62,7 @@ private RG.Transform GetUnitsTransform(Base speckleObject) */ if (speckleObject["units"] is string units) { - var scaleFactor = Units.GetConversionFactor(units, _contextStack.Current.SpeckleUnits); + var scaleFactor = Units.GetConversionFactor(units, _settingsStore.Current.SpeckleUnits); var scale = RG.Transform.Scale(RG.Point3d.Origin, scaleFactor); return scale; } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs index b0cbdfdf9..315fcd611 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/LineToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class LineToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public LineToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs index 6678a0b49..db768ad0d 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/MeshToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class MeshToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public MeshToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs index 9b407c30d..2c507f6ac 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/NurbsCurveToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class NurbsCurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public NurbsCurveToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs index a9407d50d..99439d9c2 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointCloudToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -9,8 +8,8 @@ public class PointCloudToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PointCloudToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs index 5d6dea970..2211f8227 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PointToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class PointToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PointToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs index 60472a1a4..7a523999d 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolycurveToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -8,8 +7,8 @@ namespace Speckle.Converters.Rhino.ToHost.TopLevel; public class PolycurveToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PolycurveToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs index 3ce37d22b..6323f955a 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToHost/TopLevel/PolylineToHostTopLevelConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToHost.TopLevel; @@ -9,8 +8,8 @@ public class PolylineToHostTopLevelConverter : SpeckleToHostGeometryBaseTopLevelConverter { public PolylineToHostTopLevelConverter( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter geometryBaseConverter ) - : base(contextStack, geometryBaseConverter) { } + : base(settingsStore, geometryBaseConverter) { } } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs index 9a9b46300..41e023457 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcCurveToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Objects; using Speckle.Sdk.Models; @@ -11,19 +10,19 @@ public class ArcCurveToSpeckleConverter : ITypedConverter, private readonly ITypedConverter _circleConverter; private readonly ITypedConverter _arcConverter; private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public ArcCurveToSpeckleConverter( ITypedConverter circleConverter, ITypedConverter arcConverter, ITypedConverter intervalConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _circleConverter = circleConverter; _arcConverter = arcConverter; _intervalConverter = intervalConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -38,7 +37,7 @@ IConversionContextStack contextStack /// public ICurve Convert(RG.ArcCurve target) { - var tolerance = _contextStack.Current.Document.ModelAbsoluteTolerance; + var tolerance = _settingsStore.Current.Document.ModelAbsoluteTolerance; if (target.IsCompleteCircle) { diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs index 96f7b614a..707c67b88 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ArcToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; @@ -9,7 +8,7 @@ public class ArcToSpeckleConverter : ITypedConverter private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _planeConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly IBoxFactory _boxFactory; @@ -17,14 +16,14 @@ public ArcToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter planeConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, IBoxFactory boxFactory ) { _pointConverter = pointConverter; _planeConverter = planeConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; _boxFactory = boxFactory; } @@ -43,7 +42,7 @@ public SOG.Arc Convert(RG.Arc target) => target.StartAngle, target.EndAngle, target.Angle, - _contextStack.Current.SpeckleUnits + _settingsStore.Current.SpeckleUnits ) { startPoint = _pointConverter.Convert(target.StartPoint), diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxToSpeckleConverter.cs index f9bcd9f1c..7b0503bae 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BoxToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; @@ -8,17 +7,17 @@ public class BoxToSpeckleConverter : ITypedConverter { private readonly ITypedConverter _planeConverter; private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public BoxToSpeckleConverter( ITypedConverter planeConverter, ITypedConverter intervalConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _planeConverter = planeConverter; _intervalConverter = intervalConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -33,7 +32,7 @@ public SOG.Box Convert(RG.Box target) => xSize = _intervalConverter.Convert(target.X), ySize = _intervalConverter.Convert(target.Y), zSize = _intervalConverter.Convert(target.Z), - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, area = target.Area, volume = target.Volume, }; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BrepToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BrepToSpeckleConverter.cs index 0e3431ed4..d373e10bb 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BrepToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/BrepToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Objects; using Speckle.Sdk; @@ -15,7 +14,7 @@ public class BrepToSpeckleConverter : ITypedConverter private readonly ITypedConverter _meshConverter; private readonly ITypedConverter _boxConverter; private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public BrepToSpeckleConverter( ITypedConverter pointConverter, @@ -24,7 +23,7 @@ public BrepToSpeckleConverter( ITypedConverter meshConverter, ITypedConverter boxConverter, ITypedConverter intervalConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; @@ -33,7 +32,7 @@ IConversionContextStack contextStack _meshConverter = meshConverter; _boxConverter = boxConverter; _intervalConverter = intervalConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -43,7 +42,7 @@ IConversionContextStack contextStack /// The converted Speckle Brep object. public SOG.Brep Convert(RG.Brep target) { - var tol = _contextStack.Current.Document.ModelAbsoluteTolerance; + var tol = _settingsStore.Current.Document.ModelAbsoluteTolerance; target.Repair(tol); // POC: CNX-9276 This should come as part of the user settings in the context object. @@ -77,7 +76,7 @@ public SOG.Brep Convert(RG.Brep target) surfaces.AddRange(target.Surfaces.Select(srf => _surfaceConverter.Convert(srf.ToNurbsSurface()))); List curves2d = new(target.Curves2D.Count); - using (_contextStack.Push(Units.None)) + using (_settingsStore.Push(x => x with { SpeckleUnits = Units.None })) { // Curves2D are unitless, so we convert them within a new pushed context with None units. curves2d.AddRange(target.Curves2D.Select(curve2d => _curveConverter.Convert(curve2d))); @@ -95,7 +94,7 @@ public SOG.Brep Convert(RG.Brep target) volume = target.IsSolid ? target.GetVolume() : 0, area = target.GetArea(), bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(false))), - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, Edges = new(target.Edges.Count), Loops = new(target.Loops.Count), Trims = new(target.Trims.Count), diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/CircleToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/CircleToSpeckleConverter.cs index bcc115b11..6d617adde 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/CircleToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/CircleToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; @@ -8,15 +7,15 @@ namespace Speckle.Converters.Rhino.ToSpeckle.Raw; public class CircleToSpeckleConverter : ITypedConverter { private readonly ITypedConverter _planeConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public CircleToSpeckleConverter( ITypedConverter planeConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _planeConverter = planeConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } public Base Convert(object target) => Convert((RG.Circle)target); @@ -34,7 +33,7 @@ public SOG.Circle Convert(RG.Circle target) => { plane = _planeConverter.Convert(target.Plane), radius = target.Radius, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, domain = SOP.Interval.UnitInterval, length = 2 * Math.PI * target.Radius, area = Math.PI * Math.Pow(target.Radius, 2), diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs index e3d575d23..647229c7a 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/ControlPointToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; @@ -7,11 +6,11 @@ namespace Speckle.Converters.Rhino.ToSpeckle.Raw; public class ControlPointToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public ControlPointToSpeckleConverter(IConversionContextStack contextStack) + public ControlPointToSpeckleConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -20,7 +19,7 @@ public ControlPointToSpeckleConverter(IConversionContextStackThe ControlPoint object to convert. /// The converted Speckle ControlPoint object. public SOG.ControlPoint Convert(RG.ControlPoint target) => - new(target.Location.X, target.Location.Y, target.Location.Z, target.Weight, _contextStack.Current.SpeckleUnits); + new(target.Location.X, target.Location.Y, target.Location.Z, target.Weight, _settingsStore.Current.SpeckleUnits); public Base Convert(object target) => Convert((RG.ControlPoint)target); } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/EllipseToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/EllipseToSpeckleConverter.cs index ffab7a7c9..3326e0d1b 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/EllipseToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/EllipseToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; @@ -8,17 +7,17 @@ public class EllipseToSpeckleConverter : ITypedConverter _planeConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public EllipseToSpeckleConverter( ITypedConverter planeConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _planeConverter = planeConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -37,7 +36,7 @@ public SOG.Ellipse Convert(RG.Ellipse target) plane = _planeConverter.Convert(target.Plane), firstRadius = target.Radius1, secondRadius = target.Radius2, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, domain = SOP.Interval.UnitInterval, length = nurbsCurve.GetLength(), area = Math.PI * target.Radius1 * target.Radius2, diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/LineToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/LineToSpeckleConverter.cs index 923eb2ea7..5a8352f6e 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/LineToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/LineToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; @@ -8,17 +7,17 @@ public class LineToSpeckleConverter : ITypedConverter, ITyped { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public LineToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -30,9 +29,11 @@ IConversionContextStack contextStack /// ⚠️ 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(RG.Line target) => - new(_pointConverter.Convert(target.From), _pointConverter.Convert(target.To), _contextStack.Current.SpeckleUnits) + new() { - length = target.Length, + start = _pointConverter.Convert(target.From), + end = _pointConverter.Convert(target.To), + units = _settingsStore.Current.SpeckleUnits, domain = new SOP.Interval { start = 0, end = target.Length }, bbox = _boxConverter.Convert(new RG.Box(target.BoundingBox)) }; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs index f47682ab8..97f7622e7 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/MeshToSpeckleConverter.cs @@ -1,4 +1,3 @@ -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -9,17 +8,17 @@ public class MeshToSpeckleConverter : ITypedConverter { private readonly ITypedConverter _pointConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public MeshToSpeckleConverter( ITypedConverter pointConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _pointConverter = pointConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -68,8 +67,13 @@ public SOG.Mesh Convert(RG.Mesh target) double volume = target.IsClosed ? target.Volume() : 0; SOG.Box bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(false))); - return new SOG.Mesh(vertexCoordinates, faces, colors, textureCoordinates, _contextStack.Current.SpeckleUnits) + return new SOG.Mesh { + vertices = vertexCoordinates, + faces = faces, + colors = colors, + textureCoordinates = textureCoordinates, + units = _settingsStore.Current.SpeckleUnits, volume = volume, bbox = bbox }; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsCurveConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsCurveConverter.cs index cb37b12e4..2f0f1ac1d 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsCurveConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsCurveConverter.cs @@ -1,4 +1,3 @@ -using Rhino; using Rhino.Geometry; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -10,19 +9,19 @@ public class NurbsCurveConverter : ITypedConverter private readonly ITypedConverter _polylineConverter; private readonly ITypedConverter _intervalConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public NurbsCurveConverter( ITypedConverter polylineConverter, ITypedConverter intervalConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _polylineConverter = polylineConverter; _intervalConverter = intervalConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -38,7 +37,7 @@ IConversionContextStack contextStack public SOG.Curve Convert(RG.NurbsCurve target) { // tolerance - double tolerance = _contextStack.Current.Document.ModelAbsoluteTolerance; + double tolerance = _settingsStore.Current.Document.ModelAbsoluteTolerance; if (target.ToPolyline(0, 1, 0, 0, 0, tolerance, 0, 0, true) is not PolylineCurve polylineCurve) { @@ -67,7 +66,7 @@ public SOG.Curve Convert(RG.NurbsCurve target) var myCurve = new SOG.Curve { displayValue = displayPoly, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, weights = nurbsCurve.Points.Select(ctp => ctp.Weight).ToList(), points = nurbsCurve.Points.SelectMany(ctp => new[] { ctp.Location.X, ctp.Location.Y, ctp.Location.Z }).ToList(), knots = knots, diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs index 7984a78fc..c42c87e47 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/NurbsSurfaceToSpeckleConverter.cs @@ -1,5 +1,4 @@ -using Rhino; -using Rhino.Geometry.Collections; +using Rhino.Geometry.Collections; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -10,19 +9,19 @@ public class NurbsSurfaceToSpeckleConverter : ITypedConverter _boxConverter; private readonly ITypedConverter _intervalConverter; private readonly ITypedConverter _controlPointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public NurbsSurfaceToSpeckleConverter( ITypedConverter boxConverter, ITypedConverter intervalConverter, ITypedConverter controlPointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _boxConverter = boxConverter; _intervalConverter = intervalConverter; _controlPointConverter = controlPointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -43,7 +42,7 @@ public SOG.Surface Convert(RG.NurbsSurface target) domainV = _intervalConverter.Convert(target.Domain(1)), knotsU = target.KnotsU.ToList(), knotsV = target.KnotsV.ToList(), - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(true))) }; diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PlaneToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PlaneToSpeckleConverter.cs index 35f526bbc..2df9aae05 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PlaneToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PlaneToSpeckleConverter.cs @@ -1,4 +1,3 @@ -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -8,17 +7,17 @@ public class PlaneToSpeckleConverter : ITypedConverter { private readonly ITypedConverter _vectorConverter; private readonly ITypedConverter _pointConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PlaneToSpeckleConverter( ITypedConverter vectorConverter, ITypedConverter pointConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore ) { _vectorConverter = vectorConverter; _pointConverter = pointConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -33,6 +32,6 @@ public SOG.Plane Convert(RG.Plane target) => normal = _vectorConverter.Convert(target.ZAxis), xdir = _vectorConverter.Convert(target.XAxis), ydir = _vectorConverter.Convert(target.YAxis), - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PointToSpeckleConverter.cs index b81de953d..3a4a1747d 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -1,4 +1,3 @@ -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -6,11 +5,11 @@ namespace Speckle.Converters.Rhino.ToSpeckle.Raw; public class PointToSpeckleConverter : ITypedConverter, ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public PointToSpeckleConverter(IConversionContextStack contextStack) + public PointToSpeckleConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -18,7 +17,7 @@ public PointToSpeckleConverter(IConversionContextStack con /// /// The Rhino 3D point to convert. /// The converted Speckle point. - public SOG.Point Convert(RG.Point3d 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, _settingsStore.Current.SpeckleUnits); public SOG.Point Convert(RG.Point target) => Convert(target.Location); } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs index 7b25ddc49..5748383c1 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolyCurveToSpeckleConverter.cs @@ -1,29 +1,33 @@ -using Rhino; +using Microsoft.Extensions.DependencyInjection; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; using Speckle.Objects; -using Speckle.Sdk.Common; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; 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 IServiceProvider _serviceProvider; private readonly ITypedConverter _intervalConverter; private readonly ITypedConverter _boxConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PolyCurveToSpeckleConverter( ITypedConverter intervalConverter, ITypedConverter boxConverter, - IConversionContextStack contextStack + IConverterSettingsStore settingsStore, + IServiceProvider serviceProvider ) { _intervalConverter = intervalConverter; _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; + _serviceProvider = serviceProvider; } + private Lazy> CurveConverter => + new(() => _serviceProvider.GetRequiredService>()); + /// /// Converts a Rhino PolyCurve to a Speckle Polycurve. /// @@ -41,8 +45,8 @@ public SOG.Polycurve Convert(RG.PolyCurve target) domain = _intervalConverter.Convert(target.Domain), length = target.GetLength(), bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(true))), - segments = target.DuplicateSegments().Select(x => CurveConverter.NotNull().Convert(x)).ToList(), - units = _contextStack.Current.SpeckleUnits + segments = target.DuplicateSegments().Select(x => CurveConverter.Value.Convert(x)).ToList(), + units = _settingsStore.Current.SpeckleUnits }; return myPoly; } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolylineToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolylineToSpeckleConverter.cs index a591c3b4a..2e3edc364 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolylineToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/PolylineToSpeckleConverter.cs @@ -1,4 +1,3 @@ -using Rhino; using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; @@ -10,16 +9,16 @@ public class PolylineToSpeckleConverter { private readonly ITypedConverter _boxConverter; private readonly ITypedConverter _intervalConverter; - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; public PolylineToSpeckleConverter( ITypedConverter boxConverter, - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter intervalConverter ) { _boxConverter = boxConverter; - _contextStack = contextStack; + _settingsStore = settingsStore; _intervalConverter = intervalConverter; } @@ -46,7 +45,7 @@ public SOG.Polyline Convert(RG.Polyline target) return new SOG.Polyline { value = points, - units = _contextStack.Current.SpeckleUnits, + units = _settingsStore.Current.SpeckleUnits, bbox = box, length = target.Length, domain = new() { start = 0, end = target.Length }, diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/RawPointCloudToSpeckle.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/RawPointCloudToSpeckle.cs index 1e1d5ad52..f434fef41 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/RawPointCloudToSpeckle.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/RawPointCloudToSpeckle.cs @@ -1,20 +1,19 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; public class RawPointCloudToSpeckle : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _boxConverter; public RawPointCloudToSpeckle( - IConversionContextStack contextStack, + IConverterSettingsStore settingsStore, ITypedConverter boxConverter ) { - _contextStack = contextStack; + _settingsStore = settingsStore; _boxConverter = boxConverter; } @@ -29,6 +28,6 @@ public SOG.Pointcloud Convert(RG.PointCloud target) => points = target.GetPoints().SelectMany(pt => new[] { pt.X, pt.Y, pt.Z }).ToList(), colors = target.GetColors().Select(o => o.ToArgb()).ToList(), bbox = _boxConverter.Convert(new RG.Box(target.GetBoundingBox(true))), - units = _contextStack.Current.SpeckleUnits + units = _settingsStore.Current.SpeckleUnits }; } diff --git a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/VectorToSpeckleConverter.cs b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/VectorToSpeckleConverter.cs index 1cbc7bbe7..c7be40960 100644 --- a/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/VectorToSpeckleConverter.cs +++ b/Converters/Rhino/Speckle.Converters.RhinoShared/ToSpeckle/Raw/VectorToSpeckleConverter.cs @@ -1,16 +1,15 @@ -using Rhino; -using Speckle.Converters.Common; +using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; namespace Speckle.Converters.Rhino.ToSpeckle.Raw; public class VectorToSpeckleConverter : ITypedConverter { - private readonly IConversionContextStack _contextStack; + private readonly IConverterSettingsStore _settingsStore; - public VectorToSpeckleConverter(IConversionContextStack contextStack) + public VectorToSpeckleConverter(IConverterSettingsStore settingsStore) { - _contextStack = contextStack; + _settingsStore = settingsStore; } /// @@ -19,5 +18,5 @@ public VectorToSpeckleConverter(IConversionContextStack co /// The Rhino Vector3d object to convert. /// The converted Speckle Vector object. public SOG.Vector Convert(RG.Vector3d target) => - new(target.X, target.Y, target.Z, _contextStack.Current.SpeckleUnits); + new(target.X, target.Y, target.Z, _settingsStore.Current.SpeckleUnits); } diff --git a/DUI3/Speckle.Connectors.DUI.Tests/Bridge/TopLevelExceptionHandlerTests.cs b/DUI3/Speckle.Connectors.DUI.Tests/Bridge/TopLevelExceptionHandlerTests.cs index de397764c..3ef8a0e15 100644 --- a/DUI3/Speckle.Connectors.DUI.Tests/Bridge/TopLevelExceptionHandlerTests.cs +++ b/DUI3/Speckle.Connectors.DUI.Tests/Bridge/TopLevelExceptionHandlerTests.cs @@ -14,7 +14,7 @@ public class TopLevelExceptionHandlerTests : MoqTest public void CatchUnhandledAction_Happy() { var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); var sut = new TopLevelExceptionHandler(logger.Object, bridge.Object); sut.CatchUnhandled(() => { }); @@ -24,7 +24,7 @@ public void CatchUnhandledAction_Happy() public void CatchUnhandledAction_Exception() { var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); bridge.Setup(x => x.Send(BasicConnectorBindingCommands.SET_GLOBAL_NOTIFICATION, It.IsAny())); @@ -38,7 +38,7 @@ public void CatchUnhandledFunc_Happy() { var val = 2; var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); var sut = new TopLevelExceptionHandler(logger.Object, bridge.Object); var returnVal = sut.CatchUnhandled(() => val); @@ -51,7 +51,7 @@ public void CatchUnhandledFunc_Happy() public void CatchUnhandledFunc_Exception() { var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); bridge.Setup(x => x.Send(BasicConnectorBindingCommands.SET_GLOBAL_NOTIFICATION, It.IsAny())); @@ -67,7 +67,7 @@ public void CatchUnhandledFunc_Exception() public void CatchUnhandledFunc_Exception_Fatal() { var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); var sut = new TopLevelExceptionHandler(logger.Object, bridge.Object); #pragma warning disable CA2201 @@ -83,7 +83,7 @@ public async Task CatchUnhandledFuncAsync_Happy() { var val = 2; var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); var sut = new TopLevelExceptionHandler(logger.Object, bridge.Object); var returnVal = await sut.CatchUnhandled(() => Task.FromResult(val)); @@ -96,7 +96,7 @@ public async Task CatchUnhandledFuncAsync_Happy() public async Task CatchUnhandledFuncAsync_Exception() { var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); bridge.Setup(x => x.Send(BasicConnectorBindingCommands.SET_GLOBAL_NOTIFICATION, It.IsAny())); @@ -112,7 +112,7 @@ public async Task CatchUnhandledFuncAsync_Exception() public void CatchUnhandledFuncAsync_Exception_Fatal() { var logger = Create>(MockBehavior.Loose); - var bridge = Create(); + var bridge = Create(); var sut = new TopLevelExceptionHandler(logger.Object, bridge.Object); #pragma warning disable CA2201 diff --git a/DUI3/Speckle.Connectors.DUI.Tests/packages.lock.json b/DUI3/Speckle.Connectors.DUI.Tests/packages.lock.json index 6b78482d5..50599e569 100644 --- a/DUI3/Speckle.Connectors.DUI.Tests/packages.lock.json +++ b/DUI3/Speckle.Connectors.DUI.Tests/packages.lock.json @@ -149,54 +149,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -253,11 +250,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -288,6 +280,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -316,40 +313,36 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "4.4.0", "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.testing": { "type": "Project", @@ -358,55 +351,58 @@ "NUnit": "[4.1.0, )" } }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" + } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/DUI3/Speckle.Connectors.DUI.WebView/ContainerRegistration.cs b/DUI3/Speckle.Connectors.DUI.WebView/ContainerRegistration.cs index 7b4c29669..c61276112 100644 --- a/DUI3/Speckle.Connectors.DUI.WebView/ContainerRegistration.cs +++ b/DUI3/Speckle.Connectors.DUI.WebView/ContainerRegistration.cs @@ -1,14 +1,22 @@ -using Speckle.Autofac.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.DUI.Bridge; namespace Speckle.Connectors.DUI.WebView; public static class ContainerRegistration { + /* public static void AddDUIView(this SpeckleContainerBuilder speckleContainerBuilder) { // send operation and dependencies speckleContainerBuilder.AddSingleton(); speckleContainerBuilder.AddSingleton(c => c.Resolve()); + }*/ + + public static void AddDUIView(this IServiceCollection serviceCollection) + { + // send operation and dependencies + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(c => c.GetRequiredService()); } } diff --git a/DUI3/Speckle.Connectors.DUI.WebView/DUI3ControlWebView.xaml.cs b/DUI3/Speckle.Connectors.DUI.WebView/DUI3ControlWebView.xaml.cs index 45ed0bf6a..979045d39 100644 --- a/DUI3/Speckle.Connectors.DUI.WebView/DUI3ControlWebView.xaml.cs +++ b/DUI3/Speckle.Connectors.DUI.WebView/DUI3ControlWebView.xaml.cs @@ -1,25 +1,25 @@ using System.Windows.Controls; using System.Windows.Threading; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Web.WebView2.Core; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; namespace Speckle.Connectors.DUI.WebView; -public sealed partial class DUI3ControlWebView : UserControl, IBrowserScriptExecutor +public sealed partial class DUI3ControlWebView : UserControl, IBrowserScriptExecutor, IDisposable { - private readonly IEnumerable> _bindings; + private readonly IServiceProvider _serviceProvider; - public DUI3ControlWebView( - IEnumerable> bindings, - Lazy topLevelExceptionHandler - ) + public DUI3ControlWebView(IServiceProvider serviceProvider) { - _bindings = bindings; + _serviceProvider = serviceProvider; InitializeComponent(); Browser.CoreWebView2InitializationCompleted += (sender, args) => - topLevelExceptionHandler.Value.CatchUnhandled(() => OnInitialized(sender, args)); + _serviceProvider + .GetRequiredService() + .CatchUnhandled(() => OnInitialized(sender, args)); } public bool IsBrowserInitialized => Browser.IsInitialized; @@ -45,9 +45,9 @@ private void OnInitialized(object? sender, CoreWebView2InitializationCompletedEv // We use Lazy here to delay creating the binding until after the Browser is fully initialized. // Otherwise the Browser cannot respond to any requests to ExecuteScriptAsyncMethod - foreach (Lazy lazyBinding in _bindings) + foreach (var binding in _serviceProvider.GetRequiredService>()) { - SetupBinding(lazyBinding.Value); + SetupBinding(binding); } } @@ -58,4 +58,7 @@ private void SetupBinding(IBinding binding) } public void ShowDevTools() => Browser.CoreWebView2.OpenDevToolsWindow(); + + //https://github.com/MicrosoftEdge/WebView2Feedback/issues/2161 + public void Dispose() => Browser.Dispatcher.Invoke(() => Browser.Dispose(), DispatcherPriority.Send); } diff --git a/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json b/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json index 765ebfe0d..d9998e0f7 100644 --- a/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json +++ b/DUI3/Speckle.Connectors.DUI.WebView/packages.lock.json @@ -62,14 +62,6 @@ "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", @@ -99,59 +91,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.SourceLink.Common": { @@ -187,11 +170,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -224,22 +202,22 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Net.WebSockets.Client.Managed": { @@ -253,8 +231,8 @@ }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -266,32 +244,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "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" - } + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -301,88 +255,79 @@ "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": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { @@ -481,54 +426,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -563,11 +505,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -598,6 +535,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Memory": { "type": "Transitive", "resolved": "4.5.3", @@ -608,85 +550,84 @@ "resolved": "5.0.0", "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Text.Json": { + "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, "speckle.connectors.dui": { "type": "Project", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Connectors.Utils": "[1.0.0, )", - "Speckle.Sdk": "[3.0.1-rc.118, )", + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.145, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" + } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/AccountBinding.cs b/DUI3/Speckle.Connectors.DUI/Bindings/AccountBinding.cs index d9ace1b13..2f5ad38f4 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/AccountBinding.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/AccountBinding.cs @@ -6,12 +6,15 @@ namespace Speckle.Connectors.DUI.Bindings; public class AccountBinding : IBinding { public string Name => "accountsBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } - public AccountBinding(IBridge bridge) + private readonly IAccountManager _accountManager; + + public AccountBinding(IBrowserBridge bridge, IAccountManager accountManager) { Parent = bridge; + _accountManager = accountManager; } - public Account[] GetAccounts() => AccountManager.GetAccounts().ToArray(); + public Account[] GetAccounts() => _accountManager.GetAccounts().ToArray(); } diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/ConfigBinding.cs b/DUI3/Speckle.Connectors.DUI/Bindings/ConfigBinding.cs index bc37d1a97..b8d86603a 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/ConfigBinding.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/ConfigBinding.cs @@ -1,6 +1,7 @@ using System.Runtime.Serialization; using Speckle.Connectors.DUI.Bridge; using Speckle.Newtonsoft.Json; +using Speckle.Sdk; using Speckle.Sdk.Transports; namespace Speckle.Connectors.DUI.Bindings; @@ -15,16 +16,20 @@ namespace Speckle.Connectors.DUI.Bindings; public class ConfigBinding : IBinding { public string Name => "configBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } private SQLiteTransport ConfigStorage { get; } - private readonly string _connectorName; + private readonly ISpeckleApplication _speckleApplication; private readonly JsonSerializerSettings _serializerOptions; - public ConfigBinding(IBridge bridge, JsonSerializerSettings serializerOptions, string connectorName) + public ConfigBinding( + ISpeckleApplication speckleApplication, + IBrowserBridge bridge, + JsonSerializerSettings serializerOptions + ) { Parent = bridge; ConfigStorage = new SQLiteTransport(scope: "DUI3Config"); // POC: maybe inject? (if we ever want to use a different storage for configs later down the line) - _connectorName = connectorName; + _speckleApplication = speckleApplication; _serializerOptions = serializerOptions; } @@ -39,9 +44,9 @@ public bool GetIsDevMode() #endif } - public ConnectorConfig GetConfig() + public async Task GetConfig() { - var rawConfig = ConfigStorage.GetObject(_connectorName); + var rawConfig = await ConfigStorage.GetObject(_speckleApplication.HostApplication).ConfigureAwait(false); if (rawConfig is null) { return SeedConfig(); @@ -73,7 +78,7 @@ private ConnectorConfig SeedConfig() public void UpdateConfig(ConnectorConfig config) { var str = JsonConvert.SerializeObject(config, _serializerOptions); - ConfigStorage.UpdateObject(_connectorName, str); + ConfigStorage.UpdateObject(_speckleApplication.HostApplication, str); } } diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs b/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs index 73f76340e..4641720e5 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/IBasicConnectorBinding.cs @@ -47,9 +47,9 @@ public class BasicConnectorBindingCommands private const string SET_MODEL_ERROR_UI_COMMAND_NAME = "setModelError"; public const string SET_GLOBAL_NOTIFICATION = "setGlobalNotification"; - protected IBridge Bridge { get; } + protected IBrowserBridge Bridge { get; } - public BasicConnectorBindingCommands(IBridge bridge) + public BasicConnectorBindingCommands(IBrowserBridge bridge) { Bridge = bridge; } diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/IBinding.cs b/DUI3/Speckle.Connectors.DUI/Bindings/IBinding.cs index bfaacb7c7..54f5e50b8 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/IBinding.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/IBinding.cs @@ -16,8 +16,8 @@ public interface IBinding /// /// Bindings will be wrapped by a browser specific bridge, and they will need - /// to use that bridge to send events to the Frontend, via SendToBrowser(IHostAppEvent). + /// to use that bridge to send events to the Frontend, via SendToBrowser(IHostAppEvent). /// TODO: we'll probably need a factory class of sorts to handle the proper wrapping. Currently, on bridge instantiation the parent is set in the bindings class that has been wrapped around. Not vvv elegant. /// - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } } diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/OperationProgressManager.cs b/DUI3/Speckle.Connectors.DUI/Bindings/OperationProgressManager.cs index a088fa585..bdf790ca9 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/OperationProgressManager.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/OperationProgressManager.cs @@ -18,7 +18,7 @@ public class OperationProgressManager : IOperationProgressManager private const int THROTTLE_INTERVAL_MS = 50; public void SetModelProgress( - IBridge bridge, + IBrowserBridge bridge, string modelCardId, ModelCardProgress progress, CancellationToken cancellationToken @@ -48,6 +48,6 @@ CancellationToken cancellationToken s_lastProgressValues[modelCardId] = (DateTime.Now, progress.Status); } - private void SendProgress(IBridge bridge, string modelCardId, ModelCardProgress progress) => + private void SendProgress(IBrowserBridge bridge, string modelCardId, ModelCardProgress progress) => bridge.Send(SET_MODEL_PROGRESS_UI_COMMAND_NAME, new { modelCardId, progress }); } diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/ReceiveBindingUICommands.cs b/DUI3/Speckle.Connectors.DUI/Bindings/ReceiveBindingUICommands.cs index 62bcc2813..7b9d17497 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/ReceiveBindingUICommands.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/ReceiveBindingUICommands.cs @@ -1,5 +1,5 @@ +using Speckle.Connectors.Common.Conversion; using Speckle.Connectors.DUI.Bridge; -using Speckle.Connectors.Utils.Conversion; namespace Speckle.Connectors.DUI.Bindings; @@ -8,7 +8,7 @@ public class ReceiveBindingUICommands : BasicConnectorBindingCommands // POC: put here events once we needed for receive specific private const string SET_MODEL_RECEIVE_RESULT_UI_COMMAND_NAME = "setModelReceiveResult"; - public ReceiveBindingUICommands(IBridge bridge) + public ReceiveBindingUICommands(IBrowserBridge bridge) : base(bridge) { } public void SetModelReceiveResult( diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/SendBindingUICommands.cs b/DUI3/Speckle.Connectors.DUI/Bindings/SendBindingUICommands.cs index 7652fe9e5..2341b46aa 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/SendBindingUICommands.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/SendBindingUICommands.cs @@ -1,5 +1,5 @@ +using Speckle.Connectors.Common.Conversion; using Speckle.Connectors.DUI.Bridge; -using Speckle.Connectors.Utils.Conversion; namespace Speckle.Connectors.DUI.Bindings; @@ -10,7 +10,7 @@ public class SendBindingUICommands : BasicConnectorBindingCommands private const string SET_MODELS_EXPIRED_UI_COMMAND_NAME = "setModelsExpired"; private const string SET_MODEL_SEND_RESULT_UI_COMMAND_NAME = "setModelSendResult"; - public SendBindingUICommands(IBridge bridge) + public SendBindingUICommands(IBrowserBridge bridge) : base(bridge) { } // POC.. the only reasons this needs the bridge is to send? realtionship to these messages and the bridge is unclear diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/TestBinding.cs b/DUI3/Speckle.Connectors.DUI/Bindings/TestBinding.cs index a8fb0b312..7231b2f2e 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/TestBinding.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/TestBinding.cs @@ -10,9 +10,9 @@ namespace Speckle.Connectors.DUI.Bindings; public class TestBinding : IBinding { public string Name => "testBinding"; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } - public TestBinding(IBridge bridge) + public TestBinding(IBrowserBridge bridge) { Parent = bridge; } diff --git a/DUI3/Speckle.Connectors.DUI/Bindings/TopLevelExceptionHandlerBinding.cs b/DUI3/Speckle.Connectors.DUI/Bindings/TopLevelExceptionHandlerBinding.cs index 9a2116062..617722d69 100644 --- a/DUI3/Speckle.Connectors.DUI/Bindings/TopLevelExceptionHandlerBinding.cs +++ b/DUI3/Speckle.Connectors.DUI/Bindings/TopLevelExceptionHandlerBinding.cs @@ -3,11 +3,11 @@ namespace Speckle.Connectors.DUI.Bindings; /// -/// Simple binding that can be injected into non- services to get access to the +/// Simple binding that can be injected into non- services to get access to the /// /// -public sealed class TopLevelExceptionHandlerBinding(IBridge parent) : IBinding +public sealed class TopLevelExceptionHandlerBinding(IBrowserBridge parent) : IBinding { public string Name => "topLevelExceptionHandlerBinding"; - public IBridge Parent => parent; + public IBrowserBridge Parent => parent; } diff --git a/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs b/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs index 0a488826f..d610e1e01 100644 --- a/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs +++ b/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs @@ -18,7 +18,7 @@ namespace Speckle.Connectors.DUI.Bridge; /// [ClassInterface(ClassInterfaceType.AutoDual)] [ComVisible(true)] -public sealed class BrowserBridge : IBridge +public sealed class BrowserBridge : IBrowserBridge { /// /// The name under which we expect the frontend to hoist this bindings class to the global scope. @@ -80,7 +80,7 @@ IBrowserScriptExecutor browserScriptExecutor _logger = logger; TopLevelExceptionHandler = new TopLevelExceptionHandler(topLogger, this); // Capture the main thread's SynchronizationContext - _mainThreadContext = SynchronizationContext.Current; + _mainThreadContext = SynchronizationContext.Current.NotNull("No UI thread to capture?"); _browserScriptExecutor = browserScriptExecutor; } diff --git a/DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs b/DUI3/Speckle.Connectors.DUI/Bridge/IBrowserBridge.cs similarity index 98% rename from DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs rename to DUI3/Speckle.Connectors.DUI/Bridge/IBrowserBridge.cs index 160aa9571..41075f246 100644 --- a/DUI3/Speckle.Connectors.DUI/Bridge/IBridge.cs +++ b/DUI3/Speckle.Connectors.DUI/Bridge/IBrowserBridge.cs @@ -7,7 +7,7 @@ namespace Speckle.Connectors.DUI.Bridge; /// but if in the future we will have other bridge classes (e.g, ones that wrap around other browsers), /// it just might be useful. /// -public interface IBridge +public interface IBrowserBridge { // POC: documnetation comments string FrontendBoundName { get; } diff --git a/DUI3/Speckle.Connectors.DUI/Bridge/SyncToCurrentThread.cs b/DUI3/Speckle.Connectors.DUI/Bridge/SyncToCurrentThread.cs index 820d49fd0..eaac8b7b3 100644 --- a/DUI3/Speckle.Connectors.DUI/Bridge/SyncToCurrentThread.cs +++ b/DUI3/Speckle.Connectors.DUI/Bridge/SyncToCurrentThread.cs @@ -1,4 +1,4 @@ -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Operations; namespace Speckle.Connectors.DUI.Bridge; diff --git a/DUI3/Speckle.Connectors.DUI/Bridge/SyncToUIThread.cs b/DUI3/Speckle.Connectors.DUI/Bridge/SyncToUIThread.cs index 90a52df57..3ae77f62f 100644 --- a/DUI3/Speckle.Connectors.DUI/Bridge/SyncToUIThread.cs +++ b/DUI3/Speckle.Connectors.DUI/Bridge/SyncToUIThread.cs @@ -1,13 +1,13 @@ using System.Diagnostics.CodeAnalysis; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Operations; namespace Speckle.Connectors.DUI.Bridge; public class SyncToUIThread : ISyncToThread { - private readonly IBridge _bridge; + private readonly IBrowserBridge _bridge; - public SyncToUIThread(IBridge bridge) + public SyncToUIThread(IBrowserBridge bridge) { _bridge = bridge; } diff --git a/DUI3/Speckle.Connectors.DUI/Bridge/TopLevelExceptionHandler.cs b/DUI3/Speckle.Connectors.DUI/Bridge/TopLevelExceptionHandler.cs index 5b995e960..7c3f004ab 100644 --- a/DUI3/Speckle.Connectors.DUI/Bridge/TopLevelExceptionHandler.cs +++ b/DUI3/Speckle.Connectors.DUI/Bridge/TopLevelExceptionHandler.cs @@ -23,12 +23,12 @@ namespace Speckle.Connectors.DUI.Bridge; public sealed class TopLevelExceptionHandler : ITopLevelExceptionHandler { private readonly ILogger _logger; - public IBridge Parent { get; } + public IBrowserBridge Parent { get; } public string Name => nameof(TopLevelExceptionHandler); private const string UNHANDLED_LOGGER_TEMPLATE = "An unhandled Exception occured"; - internal TopLevelExceptionHandler(ILogger logger, IBridge bridge) + internal TopLevelExceptionHandler(ILogger logger, IBrowserBridge bridge) { _logger = logger; Parent = bridge; diff --git a/DUI3/Speckle.Connectors.DUI/ContainerRegistration.cs b/DUI3/Speckle.Connectors.DUI/ContainerRegistration.cs index c9248d698..dc9f56429 100644 --- a/DUI3/Speckle.Connectors.DUI/ContainerRegistration.cs +++ b/DUI3/Speckle.Connectors.DUI/ContainerRegistration.cs @@ -1,26 +1,46 @@ -using Speckle.Autofac.DependencyInjection; +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Connectors.Common.Operations; +using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Utils; -using Speckle.Connectors.Utils.Operations; using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Serialization; +using Speckle.Sdk; using Speckle.Sdk.Transports; namespace Speckle.Connectors.DUI; public static class ContainerRegistration -{ +{ /* public static void AddDUI(this SpeckleContainerBuilder speckleContainerBuilder) { // send operation and dependencies speckleContainerBuilder.AddSingletonInstance(); speckleContainerBuilder.AddSingleton(); - speckleContainerBuilder.AddTransient(); // POC: Each binding should have it's own bridge instance + speckleContainerBuilder.AddTransient(); // POC: Each binding should have it's own bridge instance speckleContainerBuilder.AddSingleton(GetJsonSerializerSettings()); speckleContainerBuilder.ScanAssemblyOfType(); speckleContainerBuilder.ScanAssemblyOfType(); } +*/ + public static void AddDUI(this IServiceCollection serviceCollection) + { + // send operation and dependencies + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + serviceCollection.AddTransient(); // POC: Each binding should have it's own bridge instance + serviceCollection.AddSingleton(GetJsonSerializerSettings()); + + serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetAssembly(typeof(IdleCallManager))); + serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetAssembly(typeof(IServerTransportFactory))); + } + + public static void UseDUI(this IServiceProvider serviceProvider) + { + serviceProvider.GetRequiredService(); + } private static JsonSerializerSettings GetJsonSerializerSettings() { @@ -41,4 +61,15 @@ private static JsonSerializerSettings GetJsonSerializerSettings() }; return settings; } + + public static void RegisterTopLevelExceptionHandler(this IServiceCollection serviceCollection) + { + serviceCollection.AddSingleton(sp => + sp.GetRequiredService() + ); + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(c => + c.GetRequiredService().Parent.TopLevelExceptionHandler + ); + } } diff --git a/DUI3/Speckle.Connectors.DUI/Models/Card/ModelCard.cs b/DUI3/Speckle.Connectors.DUI/Models/Card/ModelCard.cs index 6dbd4753e..0918b22ab 100644 --- a/DUI3/Speckle.Connectors.DUI/Models/Card/ModelCard.cs +++ b/DUI3/Speckle.Connectors.DUI/Models/Card/ModelCard.cs @@ -21,6 +21,11 @@ public class ModelCard : DiscriminatedObject /// public string? ProjectId { get; set; } + /// + /// Workspace id. + /// + public string? WorkspaceId { get; set; } + /// /// Account id that model card created with it initially. /// diff --git a/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiveResult.cs b/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiveResult.cs index c4473e7f3..039270b47 100644 --- a/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiveResult.cs +++ b/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiveResult.cs @@ -1,4 +1,4 @@ -// using Speckle.Connectors.Utils.Builders; +// using Speckle.Connectors.Common.Builders; // // namespace Speckle.Connectors.DUI.Models.Card; // diff --git a/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiverModelCard.cs b/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiverModelCard.cs index 9639ae4fb..0f2addbb6 100644 --- a/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiverModelCard.cs +++ b/DUI3/Speckle.Connectors.DUI/Models/Card/ReceiverModelCard.cs @@ -1,4 +1,4 @@ -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Operations; using Speckle.Sdk.Common; namespace Speckle.Connectors.DUI.Models.Card; diff --git a/DUI3/Speckle.Connectors.DUI/Models/Card/SenderModelCard.cs b/DUI3/Speckle.Connectors.DUI/Models/Card/SenderModelCard.cs index 6999c1aef..60fd712c5 100644 --- a/DUI3/Speckle.Connectors.DUI/Models/Card/SenderModelCard.cs +++ b/DUI3/Speckle.Connectors.DUI/Models/Card/SenderModelCard.cs @@ -1,5 +1,5 @@ +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Models.Card.SendFilter; -using Speckle.Connectors.Utils.Operations; using Speckle.Sdk.Common; namespace Speckle.Connectors.DUI.Models.Card; diff --git a/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj b/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj index 724359117..ef192e83c 100644 --- a/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj +++ b/DUI3/Speckle.Connectors.DUI/Speckle.Connectors.DUI.csproj @@ -16,8 +16,7 @@ - - + diff --git a/DUI3/Speckle.Connectors.DUI/packages.lock.json b/DUI3/Speckle.Connectors.DUI/packages.lock.json index 6f2097d18..05acaaa5f 100644 --- a/DUI3/Speckle.Connectors.DUI/packages.lock.json +++ b/DUI3/Speckle.Connectors.DUI/packages.lock.json @@ -4,9 +4,9 @@ ".NETStandard,Version=v2.0": { "Microsoft.Extensions.Logging.Abstractions": { "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -41,20 +41,20 @@ }, "Speckle.Sdk": { "type": "Direct", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } }, "System.Threading.Tasks.Dataflow": { @@ -94,14 +94,6 @@ "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", @@ -131,59 +123,50 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, "Microsoft.NETCore.Platforms": { @@ -229,11 +212,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -266,28 +244,28 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", + "System.Buffers": "4.4.0", "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -309,8 +287,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Runtime.InteropServices.WindowsRuntime": { "type": "Transitive", @@ -320,29 +298,6 @@ "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" - } - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -351,49 +306,46 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } } } diff --git a/Directory.Build.props b/Directory.Build.props index 858928479..858d82c2e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,6 +10,7 @@ true true false + false diff --git a/Directory.Packages.props b/Directory.Packages.props index 6d5436665..3b0a94aaa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,17 +1,18 @@ - + - - + + + @@ -19,11 +20,19 @@ - - + + + + + + + + - + + + diff --git a/Images/deep-clean.png b/Images/deep-clean.png new file mode 100644 index 000000000..558d93f7a Binary files /dev/null and b/Images/deep-clean.png differ diff --git a/Local.sln b/Local.sln index e11e6ea93..7becde7cc 100644 --- a/Local.sln +++ b/Local.sln @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{85A13E README.md = README.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DUI3", "DUI3", "{FD4D6594-D81E-456F-8F2E-35B09E04A755}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DUI", "DUI", "{FD4D6594-D81E-456F-8F2E-35B09E04A755}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Revit", "Revit", "{D92751C8-1039-4005-90B2-913E55E0B8BD}" EndProject @@ -26,16 +26,10 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.RevitSha EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.RevitShared", "Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.shproj", "{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2023.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2023.DependencyInjection\Speckle.Converters.Revit2023.DependencyInjection.csproj", "{83EAD6F0-3CB3-456A-AD81-072127D0DE0E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2023", "Converters\Revit\Speckle.Converters.Revit2023\Speckle.Converters.Revit2023.csproj", "{26391930-F86F-47E0-A5F6-B89919E38CE1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.DUI", "DUI3\Speckle.Connectors.DUI\Speckle.Connectors.DUI.csproj", "{D81C0B87-F0C1-4297-A147-02F001FB7E1E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Autofac", "Sdk\Speckle.Autofac\Speckle.Autofac.csproj", "{C9D4CA21-182B-4ED2-81BB-280A6FD713F6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Utils", "Sdk\Speckle.Connectors.Utils\Speckle.Connectors.Utils.csproj", "{7291B93C-615D-42DE-B8C1-3F9DF643E0FC}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common", "Sdk\Speckle.Converters.Common\Speckle.Converters.Common.csproj", "{8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Rhino", "Rhino", "{9584AEE5-CD59-46E6-93E6-2DC2B5285B75}" @@ -44,30 +38,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Rhino7", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino7", "Converters\Rhino\Speckle.Converters.Rhino7\Speckle.Converters.Rhino7.csproj", "{65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino7.DependencyInjection", "Converters\Rhino\Speckle.Converters.Rhino7.DependencyInjection\Speckle.Converters.Rhino7.DependencyInjection.csproj", "{9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.ArcGIS3", "Connectors\ArcGIS\Speckle.Connectors.ArcGIS3\Speckle.Connectors.ArcGIS3.csproj", "{A97F7177-86C7-4B38-A6ED-DA51BF762471}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.ArcGIS3", "Converters\ArcGIS\Speckle.Converters.ArcGIS3\Speckle.Converters.ArcGIS3.csproj", "{139F7A79-69E4-4B8A-B2A5-6A30A66C495C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.ArcGIS3.DependencyInjection", "Converters\ArcGIS\Speckle.Converters.ArcGIS3.DependencyInjection\Speckle.Converters.ArcGIS3.DependencyInjection.csproj", "{7DFF1591-237D-499E-A767-EE37B93FB958}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ArcGIS", "ArcGIS", "{CCF48B65-33D1-4E8B-A57B-E03394730B21}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2023", "Connectors\Autocad\Speckle.Connectors.Autocad2023\Speckle.Connectors.Autocad2023.csproj", "{89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.AutocadShared", "Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.shproj", "{41BC679F-887F-44CF-971D-A5502EE87DB0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common.DependencyInjection", "Sdk\Speckle.Converters.Common.DependencyInjection\Speckle.Converters.Common.DependencyInjection.csproj", "{11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Autocad", "Autocad", "{804E065F-914C-414A-AF84-009312C3CFF6}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.AutocadShared", "Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.shproj", "{9ADD1B7A-6401-4202-8613-F668E2FBC0A4}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023", "Converters\Autocad\Speckle.Converters.Autocad2023\Speckle.Converters.Autocad2023.csproj", "{631C295A-7CCF-4B42-8686-7034E31469E7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023.DependencyInjection", "Converters\Autocad\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\Speckle.Connectors.DUI.WebView\Speckle.Connectors.DUI.WebView.csproj", "{7420652C-3046-4F38-BE64-9B9E69D76FA2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build\Build.csproj", "{C50AA3E3-8C31-4131-9DEC-1D8B377D5A89}" @@ -84,12 +70,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2 EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.Civil3dShared", "Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.shproj", "{35175682-DA83-4C0A-A49D-B191F5885D8E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2024.DependencyInjection", "Converters\Civil3d\Speckle.Converters.Civil3d2024.DependencyInjection\Speckle.Converters.Civil3d2024.DependencyInjection.csproj", "{80F965C4-E2A8-4F54-985D-73D06E45F9CE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024", "Converters\Autocad\Speckle.Converters.Autocad2024\Speckle.Converters.Autocad2024.csproj", "{C2DE264A-AA87-4012-B954-17E3F403A237}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024.DependencyInjection", "Converters\Autocad\Speckle.Converters.Autocad2024.DependencyInjection\Speckle.Converters.Autocad2024.DependencyInjection.csproj", "{AF507D61-6766-4C20-9F58-23DC29508219}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2024", "Converters\Civil3d\Speckle.Converters.Civil3d2024\Speckle.Converters.Civil3d2024.csproj", "{25172C49-7AA4-4739-BB07-69785094C379}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.RhinoShared", "Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.shproj", "{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED9}" @@ -100,14 +82,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit202 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Testing", "Sdk\Speckle.Testing\Speckle.Testing.csproj", "{A3869243-B462-4986-914B-94E407D8D20F}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.RevitShared.DependencyInjection", "Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.shproj", "{6067BA60-D279-4156-8AE1-6B44E2D19187}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Revit2024", "Connectors\Revit\Speckle.Connectors.Revit2024\Speckle.Connectors.Revit2024.csproj", "{617BD3C7-87D9-4D28-8AC9-4910945BB9FC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2024", "Converters\Revit\Speckle.Converters.Revit2024\Speckle.Converters.Revit2024.csproj", "{67B888D9-C6C4-49F1-883C-5B964151D889}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2024.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2024.DependencyInjection\Speckle.Converters.Revit2024.DependencyInjection.csproj", "{7F3055BA-70AA-424C-8748-345AF35127E9}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2023", "2023", "{E9DEBA00-50A4-485D-BA65-D8AB3E3467AB}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2024", "2024", "{57F59C0C-5687-4AF9-AE1C-1933B539F0E4}" @@ -126,30 +104,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Revit202 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2025", "Converters\Revit\Speckle.Converters.Revit2025\Speckle.Converters.Revit2025.csproj", "{4D40A101-07E6-4FF2-8934-83434932591D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2025.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2025.DependencyInjection\Speckle.Converters.Revit2025.DependencyInjection.csproj", "{20751904-0DFC-4126-BF2A-834B53841010}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Revit2022", "Connectors\Revit\Speckle.Connectors.Revit2022\Speckle.Connectors.Revit2022.csproj", "{7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2022", "Converters\Revit\Speckle.Converters.Revit2022\Speckle.Converters.Revit2022.csproj", "{19424B55-058C-4E9C-B86F-700AEF9EAEC3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2022.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2022.DependencyInjection\Speckle.Converters.Revit2022.DependencyInjection.csproj", "{881D71A3-D276-4108-98C6-0FFD32129B9C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2022", "2022", "{0AF38BA3-65A0-481B-8CBB-B82E406E1575}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Objects", "..\speckle-sharp-sdk\src\Speckle.Objects\Speckle.Objects.csproj", "{259A84F0-2D1E-49DE-9137-93BE6858A52C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Sdk", "..\speckle-sharp-sdk\src\Speckle.Sdk\Speckle.Sdk.csproj", "{347CECE7-99DC-49A6-A508-7DE9907B887B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Sdk.Logging", "..\speckle-sharp-sdk\src\Speckle.Sdk.Logging\Speckle.Sdk.Logging.csproj", "{B8CE5087-707E-469C-AADE-FFC0E9C26B59}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "7", "7", "{201AF4EA-F049-4332-A746-42D3413DAE08}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "8", "8", "{9714467A-AECB-45B5-82D8-3E7BFF6E37C8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Rhino8", "Connectors\Rhino\Speckle.Connectors.Rhino8\Speckle.Connectors.Rhino8.csproj", "{6F3FD892-6315-4F75-BFBD-843A489F8B94}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino8.DependencyInjection", "Converters\Rhino\Speckle.Converters.Rhino8.DependencyInjection\Speckle.Converters.Rhino8.DependencyInjection.csproj", "{7362053D-AAB3-4340-86EE-801451C9EF90}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino8", "Converters\Rhino\Speckle.Converters.Rhino8\Speckle.Converters.Rhino8.csproj", "{57C1AA51-5BE2-40F3-8CB2-8B7D2AF0FF5C}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.RhinoShared", "Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.shproj", "{B37D4B9A-8D3F-4FA5-B9C8-E6C5F8A0C1E2}" @@ -166,29 +136,29 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{6186EF EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2025", "2025", "{48B7AC68-AA4D-4B36-A5DE-7F19607892A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.Autocad2025", "Connectors\Autocad\Speckle.Connectors.Autocad2025\Speckle.Connectors.Autocad2025.csproj", "{1B1F674C-CFD5-4EAC-ADFD-F29A70B9D229}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2025", "Connectors\Autocad\Speckle.Connectors.Autocad2025\Speckle.Connectors.Autocad2025.csproj", "{1B1F674C-CFD5-4EAC-ADFD-F29A70B9D229}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2025.DependencyInjection", "Converters\Autocad\Speckle.Converters.Autocad2025.DependencyInjection\Speckle.Converters.Autocad2025.DependencyInjection.csproj", "{97E20565-43E0-4EB5-A252-8A130EEC5BB6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2025", "Converters\Autocad\Speckle.Converters.Autocad2025\Speckle.Converters.Autocad2025.csproj", "{2F04E109-2B13-4DFC-961D-B7EEA94299BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2025", "Converters\Autocad\Speckle.Converters.Autocad2025\Speckle.Converters.Autocad2025.csproj", "{2F04E109-2B13-4DFC-961D-B7EEA94299BD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2022", "2022", "{B9CE43B9-31C9-4F02-A92C-658681AD75C6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.Autocad2022", "Connectors\Autocad\Speckle.Connectors.Autocad2022\Speckle.Connectors.Autocad2022.csproj", "{EAAD080D-49AF-49BF-B8BD-A18CEB210734}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2022", "Connectors\Autocad\Speckle.Connectors.Autocad2022\Speckle.Connectors.Autocad2022.csproj", "{EAAD080D-49AF-49BF-B8BD-A18CEB210734}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2022", "Converters\Autocad\Speckle.Converters.Autocad2022\Speckle.Converters.Autocad2022.csproj", "{62F50A22-8BBF-497A-B599-F858DFF1D31C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2022.DependencyInjection", "Converters\Autocad\Speckle.Converters.Autocad2022.DependencyInjection\Speckle.Converters.Autocad2022.DependencyInjection.csproj", "{960A9ED3-8377-4FBB-B781-77A4ECCCBB89}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Tests", "Sdk\Speckle.Connectors.Tests\Speckle.Connectors.Tests.csproj", "{1A2B994C-A36D-4827-8237-0817F56B37E1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Autocad2022", "Converters\Autocad\Speckle.Converters.Autocad2022\Speckle.Converters.Autocad2022.csproj", "{62F50A22-8BBF-497A-B599-F858DFF1D31C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2024", "Connectors\Autocad\Speckle.Connectors.Autocad2024\Speckle.Connectors.Autocad2024.csproj", "{27AFBC57-F493-4B51-BEE0-0C364B6A6A13}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.Tests", "Sdk\Speckle.Connectors.Tests\Speckle.Connectors.Tests.csproj", "{1A2B994C-A36D-4827-8237-0817F56B37E1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.DUI.Tests", "DUI3\Speckle.Connectors.DUI.Tests\Speckle.Connectors.DUI.Tests.csproj", "{5F91F0E5-E7FD-48C1-87C5-0913C55FF094}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.AutocadShared.DependencyInjection", "Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.shproj", "{6E7D959F-8383-4DC2-BFC2-FCEA4ECC60B3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2022.Tests", "Converters\Revit\Speckle.Converters.Revit2022.Tests\Speckle.Converters.Revit2022.Tests.csproj", "{C34D0246-6C16-4E81-AE57-2CE70F81484B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.Autocad2024", "Connectors\Autocad\Speckle.Connectors.Autocad2024\Speckle.Connectors.Autocad2024.csproj", "{27AFBC57-F493-4B51-BEE0-0C364B6A6A13}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Logging", "Sdk\Speckle.Connectors.Logging\Speckle.Connectors.Logging.csproj", "{38497468-6B28-4F8F-A9E0-3167E90DDD89}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.DUI.Tests", "DUI3\Speckle.Connectors.DUI.Tests\Speckle.Connectors.DUI.Tests.csproj", "{5F91F0E5-E7FD-48C1-87C5-0913C55FF094}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.Common", "Sdk\Speckle.Connectors.Common\Speckle.Connectors.Common.csproj", "{3747C01B-343E-4425-A973-4D9D181BE468}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Revit2022.Tests", "Converters\Revit\Speckle.Converters.Revit2022.Tests\Speckle.Converters.Revit2022.Tests.csproj", "{C34D0246-6C16-4E81-AE57-2CE70F81484B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.Common.Tests", "Sdk\Speckle.Converters.Common.Tests\Speckle.Converters.Common.Tests.csproj", "{13225611-10EE-41BB-9198-C88D6E978DA6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -197,50 +167,32 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {01F98733-7352-47AD-A594-537D979DE3DE}.Local|Any CPU.ActiveCfg = Local|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Local|Any CPU.Build.0 = Local|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Local|Any CPU.ActiveCfg = Local|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Local|Any CPU.Build.0 = Local|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Local|Any CPU.ActiveCfg = Local|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Local|Any CPU.Build.0 = Local|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Local|Any CPU.ActiveCfg = Local|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Local|Any CPU.Build.0 = Local|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Local|Any CPU.ActiveCfg = Local|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Local|Any CPU.Build.0 = Local|Any CPU - {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Local|Any CPU.ActiveCfg = Local|Any CPU - {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Local|Any CPU.Build.0 = Local|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Local|Any CPU.ActiveCfg = Local|Any CPU {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}.Local|Any CPU.Build.0 = Local|Any CPU {1E2644A9-6B31-4350-8772-CEAAD6EE0B21}.Local|Any CPU.ActiveCfg = Local|Any CPU {1E2644A9-6B31-4350-8772-CEAAD6EE0B21}.Local|Any CPU.Build.0 = Local|Any CPU {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}.Local|Any CPU.ActiveCfg = Local|Any CPU {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}.Local|Any CPU.Build.0 = Local|Any CPU - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Local|Any CPU.ActiveCfg = Local|Any CPU - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Local|Any CPU.Build.0 = Local|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Local|Any CPU.ActiveCfg = Local|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Local|Any CPU.Build.0 = Local|Any CPU {139F7A79-69E4-4B8A-B2A5-6A30A66C495C}.Local|Any CPU.ActiveCfg = Local|Any CPU {139F7A79-69E4-4B8A-B2A5-6A30A66C495C}.Local|Any CPU.Build.0 = Local|Any CPU - {7DFF1591-237D-499E-A767-EE37B93FB958}.Local|Any CPU.ActiveCfg = Local|Any CPU - {7DFF1591-237D-499E-A767-EE37B93FB958}.Local|Any CPU.Build.0 = Local|Any CPU {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Local|Any CPU.ActiveCfg = Local|Any CPU {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Local|Any CPU.Build.0 = Local|Any CPU - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Local|Any CPU.ActiveCfg = Local|Any CPU - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Local|Any CPU.Build.0 = Local|Any CPU {631C295A-7CCF-4B42-8686-7034E31469E7}.Local|Any CPU.ActiveCfg = Local|Any CPU {631C295A-7CCF-4B42-8686-7034E31469E7}.Local|Any CPU.Build.0 = Local|Any CPU - {D940853C-003A-482C-BDB0-665367F274A0}.Local|Any CPU.ActiveCfg = Local|Any CPU - {D940853C-003A-482C-BDB0-665367F274A0}.Local|Any CPU.Build.0 = Local|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Local|Any CPU.ActiveCfg = Local|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Local|Any CPU.Build.0 = Local|Any CPU {C50AA3E3-8C31-4131-9DEC-1D8B377D5A89}.Local|Any CPU.ActiveCfg = Local|Any CPU {C50AA3E3-8C31-4131-9DEC-1D8B377D5A89}.Local|Any CPU.Build.0 = Local|Any CPU {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1}.Local|Any CPU.ActiveCfg = Local|Any CPU {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1}.Local|Any CPU.Build.0 = Local|Any CPU - {80F965C4-E2A8-4F54-985D-73D06E45F9CE}.Local|Any CPU.ActiveCfg = Local|Any CPU - {80F965C4-E2A8-4F54-985D-73D06E45F9CE}.Local|Any CPU.Build.0 = Local|Any CPU {C2DE264A-AA87-4012-B954-17E3F403A237}.Local|Any CPU.ActiveCfg = Local|Any CPU {C2DE264A-AA87-4012-B954-17E3F403A237}.Local|Any CPU.Build.0 = Local|Any CPU - {AF507D61-6766-4C20-9F58-23DC29508219}.Local|Any CPU.ActiveCfg = Local|Any CPU - {AF507D61-6766-4C20-9F58-23DC29508219}.Local|Any CPU.Build.0 = Local|Any CPU {25172C49-7AA4-4739-BB07-69785094C379}.Local|Any CPU.ActiveCfg = Local|Any CPU {25172C49-7AA4-4739-BB07-69785094C379}.Local|Any CPU.Build.0 = Local|Any CPU {AC2DB416-F05C-4296-9040-56D6AD4FCD27}.Local|Any CPU.ActiveCfg = Local|Any CPU @@ -253,44 +205,30 @@ Global {617BD3C7-87D9-4D28-8AC9-4910945BB9FC}.Local|Any CPU.Build.0 = Local|Any CPU {67B888D9-C6C4-49F1-883C-5B964151D889}.Local|Any CPU.ActiveCfg = Local|Any CPU {67B888D9-C6C4-49F1-883C-5B964151D889}.Local|Any CPU.Build.0 = Local|Any CPU - {7F3055BA-70AA-424C-8748-345AF35127E9}.Local|Any CPU.ActiveCfg = Local|Any CPU - {7F3055BA-70AA-424C-8748-345AF35127E9}.Local|Any CPU.Build.0 = Local|Any CPU {C32274D9-1B66-4D5C-82F9-EB3F10F46752}.Local|Any CPU.ActiveCfg = Local|Any CPU {C32274D9-1B66-4D5C-82F9-EB3F10F46752}.Local|Any CPU.Build.0 = Local|Any CPU {A6DE3DA0-B242-4F49-AEF0-4E26AF92D16C}.Local|Any CPU.ActiveCfg = Local|Any CPU {A6DE3DA0-B242-4F49-AEF0-4E26AF92D16C}.Local|Any CPU.Build.0 = Local|Any CPU {4D40A101-07E6-4FF2-8934-83434932591D}.Local|Any CPU.ActiveCfg = Local|Any CPU {4D40A101-07E6-4FF2-8934-83434932591D}.Local|Any CPU.Build.0 = Local|Any CPU - {20751904-0DFC-4126-BF2A-834B53841010}.Local|Any CPU.ActiveCfg = Local|Any CPU - {20751904-0DFC-4126-BF2A-834B53841010}.Local|Any CPU.Build.0 = Local|Any CPU {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}.Local|Any CPU.ActiveCfg = Local|Any CPU {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}.Local|Any CPU.Build.0 = Local|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Local|Any CPU.ActiveCfg = Local|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Local|Any CPU.Build.0 = Local|Any CPU - {881D71A3-D276-4108-98C6-0FFD32129B9C}.Local|Any CPU.ActiveCfg = Local|Any CPU - {881D71A3-D276-4108-98C6-0FFD32129B9C}.Local|Any CPU.Build.0 = Local|Any CPU {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Local|Any CPU.ActiveCfg = Local|Any CPU {259A84F0-2D1E-49DE-9137-93BE6858A52C}.Local|Any CPU.Build.0 = Local|Any CPU {347CECE7-99DC-49A6-A508-7DE9907B887B}.Local|Any CPU.ActiveCfg = Local|Any CPU {347CECE7-99DC-49A6-A508-7DE9907B887B}.Local|Any CPU.Build.0 = Local|Any CPU - {B8CE5087-707E-469C-AADE-FFC0E9C26B59}.Local|Any CPU.ActiveCfg = Debug|Any CPU - {B8CE5087-707E-469C-AADE-FFC0E9C26B59}.Local|Any CPU.Build.0 = Debug|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Local|Any CPU.ActiveCfg = Local|Any CPU {6F3FD892-6315-4F75-BFBD-843A489F8B94}.Local|Any CPU.Build.0 = Local|Any CPU - {7362053D-AAB3-4340-86EE-801451C9EF90}.Local|Any CPU.ActiveCfg = Local|Any CPU - {7362053D-AAB3-4340-86EE-801451C9EF90}.Local|Any CPU.Build.0 = Local|Any CPU {57C1AA51-5BE2-40F3-8CB2-8B7D2AF0FF5C}.Local|Any CPU.ActiveCfg = Local|Any CPU {57C1AA51-5BE2-40F3-8CB2-8B7D2AF0FF5C}.Local|Any CPU.Build.0 = Local|Any CPU {1B1F674C-CFD5-4EAC-ADFD-F29A70B9D229}.Local|Any CPU.ActiveCfg = Local|Any CPU {1B1F674C-CFD5-4EAC-ADFD-F29A70B9D229}.Local|Any CPU.Build.0 = Local|Any CPU - {97E20565-43E0-4EB5-A252-8A130EEC5BB6}.Local|Any CPU.ActiveCfg = Local|Any CPU - {97E20565-43E0-4EB5-A252-8A130EEC5BB6}.Local|Any CPU.Build.0 = Local|Any CPU {2F04E109-2B13-4DFC-961D-B7EEA94299BD}.Local|Any CPU.ActiveCfg = Local|Any CPU {2F04E109-2B13-4DFC-961D-B7EEA94299BD}.Local|Any CPU.Build.0 = Local|Any CPU {EAAD080D-49AF-49BF-B8BD-A18CEB210734}.Local|Any CPU.ActiveCfg = Local|Any CPU {EAAD080D-49AF-49BF-B8BD-A18CEB210734}.Local|Any CPU.Build.0 = Local|Any CPU - {960A9ED3-8377-4FBB-B781-77A4ECCCBB89}.Local|Any CPU.ActiveCfg = Local|Any CPU - {960A9ED3-8377-4FBB-B781-77A4ECCCBB89}.Local|Any CPU.Build.0 = Local|Any CPU {62F50A22-8BBF-497A-B599-F858DFF1D31C}.Local|Any CPU.ActiveCfg = Local|Any CPU {62F50A22-8BBF-497A-B599-F858DFF1D31C}.Local|Any CPU.Build.0 = Local|Any CPU {1A2B994C-A36D-4827-8237-0817F56B37E1}.Local|Any CPU.ActiveCfg = Debug|Any CPU @@ -301,6 +239,12 @@ Global {5F91F0E5-E7FD-48C1-87C5-0913C55FF094}.Local|Any CPU.Build.0 = Local|Any CPU {C34D0246-6C16-4E81-AE57-2CE70F81484B}.Local|Any CPU.ActiveCfg = Local|Any CPU {C34D0246-6C16-4E81-AE57-2CE70F81484B}.Local|Any CPU.Build.0 = Local|Any CPU + {38497468-6B28-4F8F-A9E0-3167E90DDD89}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {38497468-6B28-4F8F-A9E0-3167E90DDD89}.Local|Any CPU.Build.0 = Debug|Any CPU + {3747C01B-343E-4425-A973-4D9D181BE468}.Local|Any CPU.ActiveCfg = Local|Any CPU + {3747C01B-343E-4425-A973-4D9D181BE468}.Local|Any CPU.Build.0 = Local|Any CPU + {13225611-10EE-41BB-9198-C88D6E978DA6}.Local|Any CPU.ActiveCfg = Local|Any CPU + {13225611-10EE-41BB-9198-C88D6E978DA6}.Local|Any CPU.Build.0 = Local|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -310,43 +254,32 @@ Global {01F98733-7352-47AD-A594-537D979DE3DE} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {DC570FFF-6FE5-47BD-8BC1-B471A6067786} = {FC224610-32D3-454E-9BC1-1219FE8ACD5F} {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6} = {FC224610-32D3-454E-9BC1-1219FE8ACD5F} - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {26391930-F86F-47E0-A5F6-B89919E38CE1} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {D81C0B87-F0C1-4297-A147-02F001FB7E1E} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} - {7291B93C-615D-42DE-B8C1-3F9DF643E0FC} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} {1E2644A9-6B31-4350-8772-CEAAD6EE0B21} = {201AF4EA-F049-4332-A746-42D3413DAE08} {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5} = {201AF4EA-F049-4332-A746-42D3413DAE08} - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D} = {201AF4EA-F049-4332-A746-42D3413DAE08} {A97F7177-86C7-4B38-A6ED-DA51BF762471} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} {139F7A79-69E4-4B8A-B2A5-6A30A66C495C} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} - {7DFF1591-237D-499E-A767-EE37B93FB958} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} {CCF48B65-33D1-4E8B-A57B-E03394730B21} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395} = {B32A4121-C9A1-4098-81CD-D799E1491F54} {41BC679F-887F-44CF-971D-A5502EE87DB0} = {6186EF63-4978-4FA9-9893-7074F9FD0BA4} - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {804E065F-914C-414A-AF84-009312C3CFF6} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} {9ADD1B7A-6401-4202-8613-F668E2FBC0A4} = {6186EF63-4978-4FA9-9893-7074F9FD0BA4} {631C295A-7CCF-4B42-8686-7034E31469E7} = {B32A4121-C9A1-4098-81CD-D799E1491F54} - {D940853C-003A-482C-BDB0-665367F274A0} = {B32A4121-C9A1-4098-81CD-D799E1491F54} {7420652C-3046-4F38-BE64-9B9E69D76FA2} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} {C50AA3E3-8C31-4131-9DEC-1D8B377D5A89} = {59E8E8F3-4E42-4E92-83B3-B1C2AB901D18} {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1} = {333F2603-DE99-4133-A6C1-9CC1DBCFFD21} {35175682-DA83-4C0A-A49D-B191F5885D8E} = {333F2603-DE99-4133-A6C1-9CC1DBCFFD21} - {80F965C4-E2A8-4F54-985D-73D06E45F9CE} = {333F2603-DE99-4133-A6C1-9CC1DBCFFD21} {C2DE264A-AA87-4012-B954-17E3F403A237} = {844572F4-7281-49B4-BD92-722607606C98} - {AF507D61-6766-4C20-9F58-23DC29508219} = {844572F4-7281-49B4-BD92-722607606C98} {25172C49-7AA4-4739-BB07-69785094C379} = {333F2603-DE99-4133-A6C1-9CC1DBCFFD21} {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED9} = {A5D616EA-1D91-48BE-BAB8-3501A29F1C20} {AC2DB416-F05C-4296-9040-56D6AD4FCD27} = {201AF4EA-F049-4332-A746-42D3413DAE08} {68CF9BDF-94AC-4D2D-A7BD-D1C064F97051} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {A3869243-B462-4986-914B-94E407D8D20F} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} - {6067BA60-D279-4156-8AE1-6B44E2D19187} = {FC224610-32D3-454E-9BC1-1219FE8ACD5F} {617BD3C7-87D9-4D28-8AC9-4910945BB9FC} = {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} {67B888D9-C6C4-49F1-883C-5B964151D889} = {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} - {7F3055BA-70AA-424C-8748-345AF35127E9} = {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {FC224610-32D3-454E-9BC1-1219FE8ACD5F} = {D92751C8-1039-4005-90B2-913E55E0B8BD} @@ -356,15 +289,12 @@ Global {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {A6DE3DA0-B242-4F49-AEF0-4E26AF92D16C} = {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} {4D40A101-07E6-4FF2-8934-83434932591D} = {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} - {20751904-0DFC-4126-BF2A-834B53841010} = {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} {19424B55-058C-4E9C-B86F-700AEF9EAEC3} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} - {881D71A3-D276-4108-98C6-0FFD32129B9C} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} {0AF38BA3-65A0-481B-8CBB-B82E406E1575} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {201AF4EA-F049-4332-A746-42D3413DAE08} = {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} {9714467A-AECB-45B5-82D8-3E7BFF6E37C8} = {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} {6F3FD892-6315-4F75-BFBD-843A489F8B94} = {9714467A-AECB-45B5-82D8-3E7BFF6E37C8} - {7362053D-AAB3-4340-86EE-801451C9EF90} = {9714467A-AECB-45B5-82D8-3E7BFF6E37C8} {57C1AA51-5BE2-40F3-8CB2-8B7D2AF0FF5C} = {9714467A-AECB-45B5-82D8-3E7BFF6E37C8} {B37D4B9A-8D3F-4FA5-B9C8-E6C5F8A0C1E2} = {A5D616EA-1D91-48BE-BAB8-3501A29F1C20} {A5D616EA-1D91-48BE-BAB8-3501A29F1C20} = {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} @@ -374,17 +304,17 @@ Global {6186EF63-4978-4FA9-9893-7074F9FD0BA4} = {804E065F-914C-414A-AF84-009312C3CFF6} {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} = {804E065F-914C-414A-AF84-009312C3CFF6} {1B1F674C-CFD5-4EAC-ADFD-F29A70B9D229} = {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} - {97E20565-43E0-4EB5-A252-8A130EEC5BB6} = {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} {2F04E109-2B13-4DFC-961D-B7EEA94299BD} = {48B7AC68-AA4D-4B36-A5DE-7F19607892A6} {B9CE43B9-31C9-4F02-A92C-658681AD75C6} = {804E065F-914C-414A-AF84-009312C3CFF6} {EAAD080D-49AF-49BF-B8BD-A18CEB210734} = {B9CE43B9-31C9-4F02-A92C-658681AD75C6} - {960A9ED3-8377-4FBB-B781-77A4ECCCBB89} = {B9CE43B9-31C9-4F02-A92C-658681AD75C6} {62F50A22-8BBF-497A-B599-F858DFF1D31C} = {B9CE43B9-31C9-4F02-A92C-658681AD75C6} {1A2B994C-A36D-4827-8237-0817F56B37E1} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} - {6E7D959F-8383-4DC2-BFC2-FCEA4ECC60B3} = {6186EF63-4978-4FA9-9893-7074F9FD0BA4} {27AFBC57-F493-4B51-BEE0-0C364B6A6A13} = {844572F4-7281-49B4-BD92-722607606C98} {5F91F0E5-E7FD-48C1-87C5-0913C55FF094} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} {C34D0246-6C16-4E81-AE57-2CE70F81484B} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} + {38497468-6B28-4F8F-A9E0-3167E90DDD89} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} + {3747C01B-343E-4425-A973-4D9D181BE468} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} + {13225611-10EE-41BB-9198-C88D6E978DA6} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} @@ -393,18 +323,21 @@ Global Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{01f98733-7352-47ad-a594-537d979de3de}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{01f98733-7352-47ad-a594-537d979de3de}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{19424b55-058c-4e9c-b86f-700aef9eaec3}*SharedItemsImports = 5 + Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{1b1f674c-cfd5-4eac-adfd-f29a70b9d229}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{1e2644a9-6b31-4350-8772-ceaad6ee0b21}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{20751904-0dfc-4126-bf2a-834b53841010}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{25172c49-7aa4-4739-bb07-69785094c379}*SharedItemsImports = 5 Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{25172c49-7aa4-4739-bb07-69785094c379}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{26391930-f86f-47e0-a5f6-b89919e38ce1}*SharedItemsImports = 5 + Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{27afbc57-f493-4b51-bee0-0c364b6a6a13}*SharedItemsImports = 5 + Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{2f04e109-2b13-4dfc-961d-b7eea94299bd}*SharedItemsImports = 5 Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{35175682-da83-4c0a-a49d-b191f5885d8e}*SharedItemsImports = 13 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{41bc679f-887f-44cf-971d-a5502ee87db0}*SharedItemsImports = 13 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{4d40a101-07e6-4ff2-8934-83434932591d}*SharedItemsImports = 5 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{57c1aa51-5be2-40f3-8cb2-8b7d2af0ff5c}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{6067ba60-d279-4156-8ae1-6b44e2d19187}*SharedItemsImports = 13 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{617bd3c7-87d9-4d28-8ac9-4910945bb9fc}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{617bd3c7-87d9-4d28-8ac9-4910945bb9fc}*SharedItemsImports = 5 + Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{62f50a22-8bbf-497a-b599-f858dff1d31c}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{631c295a-7ccf-4b42-8686-7034e31469e7}*SharedItemsImports = 5 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{65a2f556-f14a-49f3-8a92-7f2e1e7ed3b5}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{67b888d9-c6c4-49f1-883c-5b964151d889}*SharedItemsImports = 5 @@ -416,20 +349,26 @@ Global Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{7f3055ba-70aa-424c-8748-345af35127e9}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{83ead6f0-3cb3-456a-ad81-072127d0de0e}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{881d71a3-d276-4108-98c6-0ffd32129b9c}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{89c4cbc7-1606-40de-b6da-fbe3aac98395}*SharedItemsImports = 5 + Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{960a9ed3-8377-4fbb-b781-77a4ecccbb89}*SharedItemsImports = 5 + Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{97e20565-43e0-4eb5-a252-8a130eec5bb6}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{9add1b7a-6401-4202-8613-f668e2fbc0a4}*SharedItemsImports = 13 + Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{ac2db416-f05c-4296-9040-56d6ad4fcd27}*SharedItemsImports = 5 + Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{af507d61-6766-4c20-9f58-23dc29508219}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{b37d4b9a-8d3f-4fa5-b9c8-e6c5f8a0c1e2}*SharedItemsImports = 13 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{c2de264a-aa87-4012-b954-17e3f403a237}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{c32274d9-1b66-4d5c-82f9-eb3f10f46752}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{c32274d9-1b66-4d5c-82f9-eb3f10f46752}*SharedItemsImports = 5 + Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{c34d0246-6c16-4e81-ae57-2ce70f81484b}*SharedItemsImports = 5 + Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{c34d0246-6c16-4e81-ae57-2ce70f81484b}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{ca8eae01-ab9f-4ec1-b6f3-73721487e9e1}*SharedItemsImports = 5 + Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{d940853c-003a-482c-bdb0-665367f274a0}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{dc570fff-6fe5-47bd-8bc1-b471a6067786}*SharedItemsImports = 13 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{e1c43415-3200-45f4-8bf9-a4dd7d7f2ed6}*SharedItemsImports = 13 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{e1c43415-3200-45f4-8bf9-a4dd7d7f2ed9}*SharedItemsImports = 13 Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{e1c43415-3202-45f4-8bf9-a4dd7d7f2ed6}*SharedItemsImports = 13 + Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{eaad080d-49af-49bf-b8bd-a18ceb210734}*SharedItemsImports = 5 EndGlobalSection EndGlobal diff --git a/README.md b/README.md index f53543932..660bc61fe 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,9 @@ This uses a new Configuration for the solutions and projects which means that `L Run this to delete package.lock.json files when restores go run. ![image](/Images/clean-locks.png) + +### Deep Clean + +Run this to clean out bin and obj directories. Then a restore is run to get things ready for a build. + +![image](/Images/deep-clean.png) diff --git a/Sdk/Speckle.Autofac/ContainerRegistration.cs b/Sdk/Speckle.Autofac/ContainerRegistration.cs deleted file mode 100644 index f99b7c672..000000000 --- a/Sdk/Speckle.Autofac/ContainerRegistration.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Speckle.Autofac.DependencyInjection; - -namespace Speckle.Autofac; - -public static class ContainerRegistration -{ - public static void AddAutofac(this SpeckleContainerBuilder builder) - { - // send operation and dependencies - builder.AddScoped(); - } -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/Factory.cs b/Sdk/Speckle.Autofac/DependencyInjection/Factory.cs deleted file mode 100644 index bfd7593aa..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/Factory.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Autofac.Features.Indexed; -using Speckle.InterfaceGenerator; - -namespace Speckle.Autofac.DependencyInjection; - -[GenerateAutoInterface] -public class Factory : IFactory - where TValue : class -{ - private readonly IIndex _types; - - public Factory(IIndex types) - { - _types = types; - } - - public TValue? ResolveInstance(string strongName) - { - if (_types.TryGetValue(strongName, out TValue value)) - { - return value; - } - return null; - } -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/ISpeckleContainerContext.cs b/Sdk/Speckle.Autofac/DependencyInjection/ISpeckleContainerContext.cs deleted file mode 100644 index a65698422..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/ISpeckleContainerContext.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Speckle.Autofac.DependencyInjection; - -public interface ISpeckleContainerContext -{ - T Resolve() - where T : notnull; -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/ISpeckleModule.cs b/Sdk/Speckle.Autofac/DependencyInjection/ISpeckleModule.cs deleted file mode 100644 index 795caa576..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/ISpeckleModule.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Speckle.Autofac.DependencyInjection; - -public interface ISpeckleModule -{ - void Load(SpeckleContainerBuilder builder); -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainer.cs b/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainer.cs deleted file mode 100644 index 189481d64..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainer.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Autofac; - -namespace Speckle.Autofac.DependencyInjection; - -public class SpeckleContainer -{ - private readonly IContainer _container; - - public SpeckleContainer(IContainer container) - { - _container = container; - } - - public T Resolve() - where T : class - { - return _container.Resolve(); - } -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs b/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs deleted file mode 100644 index c5e4f22dc..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/SpeckleContainerBuilder.cs +++ /dev/null @@ -1,245 +0,0 @@ -using System.Reflection; -using Autofac; -using Speckle.Autofac.Files; -using Module = Autofac.Module; - -namespace Speckle.Autofac.DependencyInjection; - -public class SpeckleContainerBuilder -{ - private readonly struct SpeckleContainerContext : ISpeckleContainerContext - { - private readonly IComponentContext _componentContext; - - public SpeckleContainerContext(IComponentContext componentContext) - { - _componentContext = componentContext; - } - - public T Resolve() - where T : notnull => _componentContext.Resolve(); - } - - private static readonly Type s_moduleType = typeof(ISpeckleModule); - private readonly IStorageInfo _storageInfo; - - private SpeckleContainerBuilder(IStorageInfo storageInfo, ContainerBuilder? containerBuilder) - { - _storageInfo = storageInfo; - ContainerBuilder = containerBuilder ?? new ContainerBuilder(); - } - - public static SpeckleContainerBuilder CreateInstance() => new(new StorageInfo(), null); - - private static SpeckleContainerBuilder CreateInstanceForLoading(ContainerBuilder containerBuilder) => - new(new StorageInfo(), containerBuilder); - - // POC: HOW TO GET TYPES loaded, this feels a bit heavy handed and relies on Autofac where we can probably do something different - public SpeckleContainerBuilder LoadAutofacModules(Assembly pluginAssembly, IEnumerable dependencyPaths) - { - // look for assemblies in these paths that offer autofac modules - foreach (string path in dependencyPaths) - { - // POC: naming conventions - // find assemblies - var assembliesInPath = _storageInfo.GetFilenamesInDirectory(path, "Speckle*.dll"); - var assemblies = assembliesInPath.Select(LoadAssemblyFile).ToList(); - if (assemblies.All(x => x != pluginAssembly)) - { - LoadAssembly(pluginAssembly); - } - } - - return this; - } - - private Assembly? LoadAssemblyFile(string file) - { - try - { - // inspect the assemblies for Autofac.Module - var assembly = Assembly.LoadFrom(file); - LoadAssembly(assembly); - return assembly; - } - // POC: catch only certain exceptions -#pragma warning disable CA1031 - catch (Exception) -#pragma warning restore CA1031 - { - return null; - } - } - - private void LoadAssembly(Assembly assembly) - { - var moduleClasses = assembly.GetTypes().Where(x => x.GetInterfaces().Contains(s_moduleType)).ToList(); - - // create each module - // POC: could look for some attribute here - foreach (var moduleClass in moduleClasses) - { - var module = (ISpeckleModule)Activator.CreateInstance(moduleClass); - ContainerBuilder.RegisterModule(new ModuleAdapter(module)); - } - } - - private readonly Lazy> _types = - new(() => - { - var types = new List(); - foreach ( - var asm in AppDomain - .CurrentDomain.GetAssemblies() - .Where(x => x.GetName().Name.StartsWith("Speckle", StringComparison.OrdinalIgnoreCase)) - ) - { - types.AddRange(asm.GetTypes()); - } - return types; - }); - - public IReadOnlyList SpeckleTypes => _types.Value; - public ContainerBuilder ContainerBuilder { get; } - - private sealed class ModuleAdapter : Module - { - private readonly ISpeckleModule _speckleModule; - - public ModuleAdapter(ISpeckleModule speckleModule) - { - _speckleModule = speckleModule; - } - - protected override void Load(ContainerBuilder builder) => _speckleModule.Load(CreateInstanceForLoading(builder)); - } - - public SpeckleContainerBuilder AddModule(ISpeckleModule module) - { - ContainerBuilder.RegisterModule(new ModuleAdapter(module)); - - return this; - } - - public SpeckleContainerBuilder AddSingleton(T instance) - where T : class - { - ContainerBuilder.RegisterInstance(instance).SingleInstance(); - return this; - } - - public SpeckleContainerBuilder AddSingleton() - where T : class - { - ContainerBuilder.RegisterType().AsSelf().SingleInstance(); - return this; - } - - public SpeckleContainerBuilder AddSingletonInstance() - where T : class - { - ContainerBuilder.RegisterType().AsSelf().SingleInstance().AutoActivate(); - return this; - } - - public SpeckleContainerBuilder AddSingletonInstance() - where T : class, TInterface - where TInterface : notnull - { - ContainerBuilder.RegisterType().As().SingleInstance().AutoActivate(); - return this; - } - - public SpeckleContainerBuilder AddSingleton() - where T : class, TInterface - where TInterface : notnull - { - ContainerBuilder.RegisterType().As().SingleInstance(); - return this; - } - - public SpeckleContainerBuilder AddSingleton(Func action) - where T : notnull - { - ContainerBuilder.Register(c => action(new SpeckleContainerContext(c))).SingleInstance(); - return this; - } - - public SpeckleContainerBuilder AddSingleton(string param, string value) - where T : class, TInterface - where TInterface : notnull - { - ContainerBuilder.RegisterType().As().SingleInstance().WithParameter(param, value); - return this; - } - - public SpeckleContainerBuilder AddScoped() - where T : class, TInterface - where TInterface : notnull - { - ContainerBuilder.RegisterType().As().InstancePerLifetimeScope(); - return this; - } - - public SpeckleContainerBuilder AddScoped(Func action) - where T : notnull - { - ContainerBuilder.Register(c => action(new SpeckleContainerContext(c))).InstancePerLifetimeScope(); - return this; - } - - public SpeckleContainerBuilder AddScoped() - where T : class - { - ContainerBuilder.RegisterType().AsSelf().InstancePerLifetimeScope(); - return this; - } - - public SpeckleContainerBuilder AddTransient() - where T : class, TInterface - where TInterface : notnull - { - ContainerBuilder.RegisterType().As().InstancePerDependency(); - return this; - } - - public SpeckleContainerBuilder AddTransient() - where T : class - { - ContainerBuilder.RegisterType().AsSelf().InstancePerDependency(); - return this; - } - - /// - /// Scans the assembly. - /// Scan matches classes with interfaces that match Iclass and registers them as Transient with the interface. - /// Do this when scoping isn't known but all types should be registered for DI. - /// - public SpeckleContainerBuilder ScanAssembly(Assembly assembly) - { - ContainerBuilder - .RegisterAssemblyTypes(assembly) - .Where(t => t.IsClass) - .As(GetInterfacesWithNameName) - .InstancePerDependency(); - return this; - } - - /// - /// Scans the assembly containing the type T. - /// Scan matches classes with interfaces that match Iclass and registers them as Transient with the interface. - /// Do this when scoping isn't known but all types should be registered for DI. - /// - /// - /// - public SpeckleContainerBuilder ScanAssemblyOfType() => ScanAssembly(typeof(T).Assembly); - - private static IEnumerable GetInterfacesWithNameName(Type type) => - type.GetInterfaces().Where(i => i.Name == "I" + type.Name); - - public SpeckleContainer Build() - { - var container = ContainerBuilder.Build(); - return new SpeckleContainer(container); - } -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/UnitOfWork.cs b/Sdk/Speckle.Autofac/DependencyInjection/UnitOfWork.cs deleted file mode 100644 index 43e69adf3..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/UnitOfWork.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Autofac; -using Speckle.InterfaceGenerator; - -namespace Speckle.Autofac.DependencyInjection; - -public partial interface IUnitOfWork : IDisposable - where TService : class { } - -[GenerateAutoInterface] -public sealed class UnitOfWork : IUnitOfWork - where TService : class -{ - private readonly ILifetimeScope _unitOfWorkScope; - private bool _notDisposed = true; - - public UnitOfWork(ILifetimeScope unitOfWorkScope, TService service) - { - _unitOfWorkScope = unitOfWorkScope; - Service = service; - } - - public TService Service { get; } - - [AutoInterfaceIgnore] - public void Dispose() => Disposing(true); - - private void Disposing(bool fromDispose) - { - if (_notDisposed && fromDispose) - { - _unitOfWorkScope.Dispose(); - _notDisposed = false; - } - } -} diff --git a/Sdk/Speckle.Autofac/DependencyInjection/UnitOfWorkFactory.cs b/Sdk/Speckle.Autofac/DependencyInjection/UnitOfWorkFactory.cs deleted file mode 100644 index 5acb7c0de..000000000 --- a/Sdk/Speckle.Autofac/DependencyInjection/UnitOfWorkFactory.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Autofac; -using Autofac.Core; - -namespace Speckle.Autofac.DependencyInjection; - -public interface IUnitOfWorkFactory -{ - public IUnitOfWork Resolve(Action? action = null) - where TService : class; -} - -public class UnitOfWorkFactory : IUnitOfWorkFactory -{ - private readonly ILifetimeScope _parentScope; - - public UnitOfWorkFactory(ILifetimeScope parentScope) - { - _parentScope = parentScope; - } - - public IUnitOfWork Resolve(Action? action = null) - where TService : class - { - ILifetimeScope? childScope = null; - - try - { - childScope = action != null ? _parentScope.BeginLifetimeScope(action) : _parentScope.BeginLifetimeScope(); - var service = childScope.Resolve(); - - return new UnitOfWork(childScope, service); - } - catch (DependencyResolutionException dre) - { - childScope?.Dispose(); - - // POC: check exception and how to pass this further up - throw new DependencyResolutionException( - $"Dependency error resolving {typeof(TService)} within UnitOfWorkFactory", - dre - ); - } - } -} diff --git a/Sdk/Speckle.Autofac/Files/StorageInfo.cs b/Sdk/Speckle.Autofac/Files/StorageInfo.cs deleted file mode 100644 index a810c1c83..000000000 --- a/Sdk/Speckle.Autofac/Files/StorageInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Speckle.InterfaceGenerator; - -namespace Speckle.Autofac.Files; - -[GenerateAutoInterface] -public class StorageInfo : IStorageInfo -{ - public IEnumerable GetFilenamesInDirectory(string path, string pattern) - { - return Directory.GetFiles(path, pattern); - } -} diff --git a/Sdk/Speckle.Autofac/GlobalSuppressions.cs b/Sdk/Speckle.Autofac/GlobalSuppressions.cs deleted file mode 100644 index 2501a9ef3..000000000 --- a/Sdk/Speckle.Autofac/GlobalSuppressions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage( - "Performance", - "CA1805:Do not initialize unnecessarily", - Justification = "", - Scope = "member", - Target = "~F:Speckle.Autofac.DependencyInjection.ScopedFactory`1._disposed" -)] -[assembly: SuppressMessage( - "Performance", - "CA1848:Use the LoggerMessage delegates", - Justification = "", - Scope = "member", - Target = "~M:Speckle.Autofac.DependencyInjection.AutofacContainer.Build~Speckle.Autofac.DependencyInjection.AutofacContainer" -)] diff --git a/Sdk/Speckle.Autofac/Speckle.Autofac.csproj b/Sdk/Speckle.Autofac/Speckle.Autofac.csproj deleted file mode 100644 index 9f0d8f96a..000000000 --- a/Sdk/Speckle.Autofac/Speckle.Autofac.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - true - netstandard2.0 - Debug;Release;Local - - - - - - - diff --git a/Sdk/Speckle.Autofac/packages.lock.json b/Sdk/Speckle.Autofac/packages.lock.json deleted file mode 100644 index 62ed8d3f6..000000000 --- a/Sdk/Speckle.Autofac/packages.lock.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "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, )", - "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, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "1Am6l4Vpn3/K32daEqZI+FFr96OlZkgwK2LcT3pZ2zWubR5zTPW3/FkO1Rat9kb7oQOa4rxgl9LJHc5tspCWfg==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.2" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "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.SourceLink.Common": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "4.5.2", - "contentHash": "wprSFgext8cwqymChhrBLu62LMg/1u92bU+VOwyfBimSPVFXtsNqEWC92Pf9ofzJFlk4IHmJA75EDJn1b2goAQ==" - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.2", - "contentHash": "BG/TNxDFv0svAzx8OiMXDlsHfGw623BZ8tCXw4YLhDFDvDhNUEV58jKYMGRnkbJNm7c3JNNJDiN7JBMzxRBR2w==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.2" - } - } - } - } -} \ No newline at end of file diff --git a/Sdk/Speckle.Autofac/AssemblyResolver.cs b/Sdk/Speckle.Connectors.Common/AssemblyResolver.cs similarity index 93% rename from Sdk/Speckle.Autofac/AssemblyResolver.cs rename to Sdk/Speckle.Connectors.Common/AssemblyResolver.cs index 8f887f56e..e7574d50e 100644 --- a/Sdk/Speckle.Autofac/AssemblyResolver.cs +++ b/Sdk/Speckle.Connectors.Common/AssemblyResolver.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace Speckle.Autofac; +namespace Speckle.Connectors.Common; public static class AssemblyResolver { diff --git a/Sdk/Speckle.Connectors.Utils/Builders/IHostObjectBuilder.cs b/Sdk/Speckle.Connectors.Common/Builders/IHostObjectBuilder.cs similarity index 93% rename from Sdk/Speckle.Connectors.Utils/Builders/IHostObjectBuilder.cs rename to Sdk/Speckle.Connectors.Common/Builders/IHostObjectBuilder.cs index 7a2e40b7b..9cfa1113b 100644 --- a/Sdk/Speckle.Connectors.Utils/Builders/IHostObjectBuilder.cs +++ b/Sdk/Speckle.Connectors.Common/Builders/IHostObjectBuilder.cs @@ -1,7 +1,7 @@ -using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Common.Conversion; using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Builders; +namespace Speckle.Connectors.Common.Builders; // POC: We might consider to put also IRootObjectBuilder interface here in same folder and create concrete classes from it in per connector. public interface IHostObjectBuilder diff --git a/Sdk/Speckle.Connectors.Utils/Builders/IRootObjectBuilder.cs b/Sdk/Speckle.Connectors.Common/Builders/IRootObjectBuilder.cs similarity index 73% rename from Sdk/Speckle.Connectors.Utils/Builders/IRootObjectBuilder.cs rename to Sdk/Speckle.Connectors.Common/Builders/IRootObjectBuilder.cs index ffef9eefc..f70f6437e 100644 --- a/Sdk/Speckle.Connectors.Utils/Builders/IRootObjectBuilder.cs +++ b/Sdk/Speckle.Connectors.Common/Builders/IRootObjectBuilder.cs @@ -1,8 +1,8 @@ -using Speckle.Connectors.Utils.Conversion; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Operations; using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Builders; +namespace Speckle.Connectors.Common.Builders; public interface IRootObjectBuilder { diff --git a/Sdk/Speckle.Connectors.Utils/Builders/TraversalExtensions.cs b/Sdk/Speckle.Connectors.Common/Builders/TraversalExtensions.cs similarity index 94% rename from Sdk/Speckle.Connectors.Utils/Builders/TraversalExtensions.cs rename to Sdk/Speckle.Connectors.Common/Builders/TraversalExtensions.cs index b5ebb5c9f..68e50e178 100644 --- a/Sdk/Speckle.Connectors.Utils/Builders/TraversalExtensions.cs +++ b/Sdk/Speckle.Connectors.Common/Builders/TraversalExtensions.cs @@ -1,7 +1,7 @@ using Speckle.Sdk.Models; using Speckle.Sdk.Models.GraphTraversal; -namespace Speckle.Connectors.Utils.Builders; +namespace Speckle.Connectors.Common.Builders; public static class TraversalExtensions { diff --git a/Sdk/Speckle.Connectors.Utils/Caching/ISendConversionCache.cs b/Sdk/Speckle.Connectors.Common/Caching/ISendConversionCache.cs similarity index 97% rename from Sdk/Speckle.Connectors.Utils/Caching/ISendConversionCache.cs rename to Sdk/Speckle.Connectors.Common/Caching/ISendConversionCache.cs index bff42e3e8..8854a9427 100644 --- a/Sdk/Speckle.Connectors.Utils/Caching/ISendConversionCache.cs +++ b/Sdk/Speckle.Connectors.Common/Caching/ISendConversionCache.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Caching; +namespace Speckle.Connectors.Common.Caching; /// /// Stores object references resulting from a send operation. These can be retrieved back during a subsequent send operation to bypass conversion if diff --git a/Sdk/Speckle.Connectors.Utils/Caching/NullSendConversionCache.cs b/Sdk/Speckle.Connectors.Common/Caching/NullSendConversionCache.cs similarity index 93% rename from Sdk/Speckle.Connectors.Utils/Caching/NullSendConversionCache.cs rename to Sdk/Speckle.Connectors.Common/Caching/NullSendConversionCache.cs index 65a5149b1..b464c81ee 100644 --- a/Sdk/Speckle.Connectors.Utils/Caching/NullSendConversionCache.cs +++ b/Sdk/Speckle.Connectors.Common/Caching/NullSendConversionCache.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Caching; +namespace Speckle.Connectors.Common.Caching; /// /// A null send conversion cache for future use in connectors that cannot support . It does nothing! diff --git a/Sdk/Speckle.Connectors.Utils/Caching/SendConversionCache.cs b/Sdk/Speckle.Connectors.Common/Caching/SendConversionCache.cs similarity index 96% rename from Sdk/Speckle.Connectors.Utils/Caching/SendConversionCache.cs rename to Sdk/Speckle.Connectors.Common/Caching/SendConversionCache.cs index 7d9b8ece0..c74a3f35f 100644 --- a/Sdk/Speckle.Connectors.Utils/Caching/SendConversionCache.cs +++ b/Sdk/Speckle.Connectors.Common/Caching/SendConversionCache.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Caching; +namespace Speckle.Connectors.Common.Caching; /// public class SendConversionCache : ISendConversionCache diff --git a/Sdk/Speckle.Connectors.Utils/Cancellation/CancellationManager.cs b/Sdk/Speckle.Connectors.Common/Cancellation/CancellationManager.cs similarity index 97% rename from Sdk/Speckle.Connectors.Utils/Cancellation/CancellationManager.cs rename to Sdk/Speckle.Connectors.Common/Cancellation/CancellationManager.cs index e838cf3b9..7e7c85891 100644 --- a/Sdk/Speckle.Connectors.Utils/Cancellation/CancellationManager.cs +++ b/Sdk/Speckle.Connectors.Common/Cancellation/CancellationManager.cs @@ -1,4 +1,4 @@ -namespace Speckle.Connectors.Utils.Cancellation; +namespace Speckle.Connectors.Common.Cancellation; /// /// Util class to manage cancellations. diff --git a/Sdk/Speckle.Connectors.Utils/Cancellation/ICancelable.cs b/Sdk/Speckle.Connectors.Common/Cancellation/ICancelable.cs similarity index 77% rename from Sdk/Speckle.Connectors.Utils/Cancellation/ICancelable.cs rename to Sdk/Speckle.Connectors.Common/Cancellation/ICancelable.cs index 5a9d9f704..c0db8880e 100644 --- a/Sdk/Speckle.Connectors.Utils/Cancellation/ICancelable.cs +++ b/Sdk/Speckle.Connectors.Common/Cancellation/ICancelable.cs @@ -1,4 +1,4 @@ -namespace Speckle.Connectors.Utils.Cancellation; +namespace Speckle.Connectors.Common.Cancellation; /// /// Provides a mechanism for cancelling operations. diff --git a/Sdk/Speckle.Connectors.Common/Common/AssemblyExtensions.cs b/Sdk/Speckle.Connectors.Common/Common/AssemblyExtensions.cs new file mode 100644 index 000000000..830433bd7 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Common/AssemblyExtensions.cs @@ -0,0 +1,28 @@ +using System.Reflection; + +namespace Speckle.Connectors.Common.Common; + +public static class AssemblyExtensions +{ + public static string GetVersion(this Assembly assembly) + { + // MinVer https://github.com/adamralph/minver?tab=readme-ov-file#version-numbers + // together with Microsoft.SourceLink.GitHub https://github.com/dotnet/sourcelink + // fills AssemblyInformationalVersionAttribute by + // {majorVersion}.{minorVersion}.{patchVersion}.{pre-release label}.{pre-release version}.{gitHeight}+{Git SHA of current commit} + // Ex: 1.5.0-alpha.1.40+807f703e1b4d9874a92bd86d9f2d4ebe5b5d52e4 + // The following parts are optional: pre-release label, pre-release version, git height, Git SHA of current commit + // For package version, value of AssemblyInformationalVersionAttribute without commit hash is returned. + + var informationalVersion = assembly + .GetCustomAttribute() + ?.InformationalVersion; + if (informationalVersion is null) + { + return string.Empty; + } + + var indexOfPlusSign = informationalVersion.IndexOf('+'); + return indexOfPlusSign > 0 ? informationalVersion[..indexOfPlusSign] : informationalVersion; + } +} diff --git a/Sdk/Speckle.Connectors.Common/Connector.cs b/Sdk/Speckle.Connectors.Common/Connector.cs new file mode 100644 index 000000000..fbe971ac6 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Connector.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Common; +using Speckle.Connectors.Logging; +using Speckle.Objects.Geometry; +using Speckle.Sdk; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; + +namespace Speckle.Connectors.Common; + +public static class Connector +{ + public static readonly string TabName = "Speckle"; + public static readonly string TabTitle = "Speckle (Beta)"; + + public static IDisposable? Initialize( + this IServiceCollection serviceCollection, + HostApplication application, + HostAppVersion version + ) + { + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); + + var (logging, tracing) = Observability.Initialize( + application.Slug, + HostApplications.GetVersion(version), + Assembly.GetExecutingAssembly().GetVersion(), + new( +#if DEBUG || LOCAL + new SpeckleLogging(Console: true, MinimumLevel: SpeckleLogLevel.Debug), new SpeckleTracing(Console: false) +#else + new SpeckleLogging( + Console: true, + Otel: new( + Endpoint: "https://seq-dev.speckle.systems/ingest/otlp/v1/logs", + Headers: new() { { "X-Seq-ApiKey", "y5YnBp12ZE1Czh4tzZWn" } } + ), + MinimumLevel: SpeckleLogLevel.Warning + ), + new SpeckleTracing( + Console: false, + Otel: new( + Endpoint: "https://seq-dev.speckle.systems/ingest/otlp/v1/traces", + Headers: new() { { "X-Seq-ApiKey", "y5YnBp12ZE1Czh4tzZWn" } } + ) + ) +#endif + ) + ); + + serviceCollection.AddLogging(x => x.AddProvider(new SpeckleLogProvider(logging))); + serviceCollection.AddSpeckleSdk(application, version, Assembly.GetExecutingAssembly().GetVersion()); + serviceCollection.AddSingleton(); + return tracing; + } +} diff --git a/Sdk/Speckle.Connectors.Common/ConnectorActivityFactory.cs b/Sdk/Speckle.Connectors.Common/ConnectorActivityFactory.cs new file mode 100644 index 000000000..ea1955793 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/ConnectorActivityFactory.cs @@ -0,0 +1,44 @@ +using Speckle.Connectors.Logging; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; + +namespace Speckle.Connectors.Common; + +public sealed class ConnectorActivityFactory : ISdkActivityFactory, IDisposable +{ + private readonly LoggingActivityFactory _loggingActivityFactory = new(); + + public void Dispose() => _loggingActivityFactory.Dispose(); + + public ISdkActivity? Start(string? name = default, string source = "") + { + var activity = _loggingActivityFactory?.Start(name, source); + if (activity is null) + { + return null; + } + return new ConnectorActivity(activity.NotNull()); + } + + private readonly struct ConnectorActivity(LoggingActivity activity) : ISdkActivity + { + public void Dispose() => activity.Dispose(); + + public void SetTag(string key, object? value) => activity.SetTag(key, value); + + public void RecordException(Exception e) => activity.RecordException(e); + + public string TraceId => activity.TraceId; + + public void SetStatus(SdkActivityStatusCode code) => + activity.SetStatus( + code switch + { + SdkActivityStatusCode.Error => LoggingActivityStatusCode.Error, + SdkActivityStatusCode.Unset => LoggingActivityStatusCode.Unset, + SdkActivityStatusCode.Ok => LoggingActivityStatusCode.Ok, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + } + ); + } +} diff --git a/Sdk/Speckle.Connectors.Common/ContainerRegistration.cs b/Sdk/Speckle.Connectors.Common/ContainerRegistration.cs new file mode 100644 index 000000000..84ee2251d --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/ContainerRegistration.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; +using Speckle.Connectors.Common.Operations.Receive; +using Speckle.Sdk; + +namespace Speckle.Connectors.Common; + +public static class ContainerRegistration +{ /* + public static void AddConnectorUtils(this SpeckleContainerBuilder builder) + { + // send operation and dependencies + builder.AddSingleton(); + builder.AddScoped(); + builder.AddScoped(); + builder.AddSingleton(); + builder.ScanAssembly(Assembly.GetExecutingAssembly()); + + builder.ContainerBuilder.RegisterGeneric(typeof(Logger<>)).As(typeof(ILogger<>)).SingleInstance(); + } +*/ + public static void AddConnectorUtils(this IServiceCollection serviceCollection) + { + // send operation and dependencies + serviceCollection.AddSingleton(); + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); + serviceCollection.AddSingleton(); + serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetExecutingAssembly()); + + serviceCollection.AddTransient(typeof(ILogger<>), typeof(Logger<>)); + } +} diff --git a/Sdk/Speckle.Connectors.Utils/Conversion/ReportResult.cs b/Sdk/Speckle.Connectors.Common/Conversion/ReportResult.cs similarity index 98% rename from Sdk/Speckle.Connectors.Utils/Conversion/ReportResult.cs rename to Sdk/Speckle.Connectors.Common/Conversion/ReportResult.cs index df1582c64..db481f068 100644 --- a/Sdk/Speckle.Connectors.Utils/Conversion/ReportResult.cs +++ b/Sdk/Speckle.Connectors.Common/Conversion/ReportResult.cs @@ -1,6 +1,6 @@ using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Conversion; +namespace Speckle.Connectors.Common.Conversion; // Removing this for now, this was to faciliate us sending conversion results inside the commit object // We may want this back in future, but need to spark a discussion first diff --git a/Sdk/Speckle.Connectors.Utils/Extensions/RootObjectBuilderExtensions.cs b/Sdk/Speckle.Connectors.Common/Extensions/RootObjectBuilderExtensions.cs similarity index 85% rename from Sdk/Speckle.Connectors.Utils/Extensions/RootObjectBuilderExtensions.cs rename to Sdk/Speckle.Connectors.Common/Extensions/RootObjectBuilderExtensions.cs index 3d79952a9..fa630c4c8 100644 --- a/Sdk/Speckle.Connectors.Utils/Extensions/RootObjectBuilderExtensions.cs +++ b/Sdk/Speckle.Connectors.Common/Extensions/RootObjectBuilderExtensions.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; -using Speckle.Connectors.Utils.Builders; +using Speckle.Connectors.Common.Builders; using Speckle.Sdk; -namespace Speckle.Connectors.Utils.Extensions; +namespace Speckle.Connectors.Common.Extensions; public static class RootObjectBuilderExtensions { diff --git a/Sdk/Speckle.Connectors.Utils/Instances/BakeResult.cs b/Sdk/Speckle.Connectors.Common/Instances/BakeResult.cs similarity index 62% rename from Sdk/Speckle.Connectors.Utils/Instances/BakeResult.cs rename to Sdk/Speckle.Connectors.Common/Instances/BakeResult.cs index 5ecebb8d1..b3866ae7e 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/BakeResult.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/BakeResult.cs @@ -1,6 +1,6 @@ -using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Common.Conversion; -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; public record BakeResult( List CreatedInstanceIds, diff --git a/Sdk/Speckle.Connectors.Utils/Instances/IInstanceBaker.cs b/Sdk/Speckle.Connectors.Common/Instances/IInstanceBaker.cs similarity index 96% rename from Sdk/Speckle.Connectors.Utils/Instances/IInstanceBaker.cs rename to Sdk/Speckle.Connectors.Common/Instances/IInstanceBaker.cs index eb0b28b9b..6fa1dfa5b 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/IInstanceBaker.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/IInstanceBaker.cs @@ -1,7 +1,7 @@ using Speckle.Sdk.Models.Collections; using Speckle.Sdk.Models.Instances; -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; public interface IInstanceBaker { diff --git a/Sdk/Speckle.Connectors.Common/Instances/IInstanceObjectsManager.cs b/Sdk/Speckle.Connectors.Common/Instances/IInstanceObjectsManager.cs new file mode 100644 index 000000000..6e02d9312 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Instances/IInstanceObjectsManager.cs @@ -0,0 +1,24 @@ +using System.Diagnostics.CodeAnalysis; +using Speckle.Sdk.Models.Instances; + +namespace Speckle.Connectors.Common.Instances; + +public interface IInstanceObjectsManager +{ + void AddInstanceProxy(string objectId, InstanceProxy instanceProxy); + void AddDefinitionProxy(string objectId, InstanceDefinitionProxy instanceDefinitionProxy); + void AddAtomicObject(string objectId, THostObjectType obj); + void AddInstanceProxiesByDefinitionId(string definitionId, List instanceProxies); + UnpackResult GetUnpackResult(); + bool TryGetInstanceProxiesFromDefinitionId( + string definitionId, + [NotNullWhen(true)] out List? instanceProxiesWithSameDefinition + ); + bool TryGetInstanceDefinitionProxy( + string definitionId, + [NotNullWhen(true)] out InstanceDefinitionProxy? instanceDefinitionProxy + ); + InstanceProxy GetInstanceProxy(string instanceId); + + void UpdateChildrenMaxDepth(InstanceDefinitionProxy definitionProxy, int depthDifference); +} diff --git a/Sdk/Speckle.Connectors.Utils/Instances/IInstanceUnpacker.cs b/Sdk/Speckle.Connectors.Common/Instances/IInstanceUnpacker.cs similarity index 88% rename from Sdk/Speckle.Connectors.Utils/Instances/IInstanceUnpacker.cs rename to Sdk/Speckle.Connectors.Common/Instances/IInstanceUnpacker.cs index b1b796428..26e0fe011 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/IInstanceUnpacker.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/IInstanceUnpacker.cs @@ -1,4 +1,4 @@ -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; public interface IInstanceUnpacker { diff --git a/Sdk/Speckle.Connectors.Utils/Instances/InstanceObjectsManager.cs b/Sdk/Speckle.Connectors.Common/Instances/InstanceObjectsManager.cs similarity index 89% rename from Sdk/Speckle.Connectors.Utils/Instances/InstanceObjectsManager.cs rename to Sdk/Speckle.Connectors.Common/Instances/InstanceObjectsManager.cs index 29fad2f22..306b69cdf 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/InstanceObjectsManager.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/InstanceObjectsManager.cs @@ -1,9 +1,8 @@ -using Speckle.InterfaceGenerator; +using System.Diagnostics.CodeAnalysis; using Speckle.Sdk.Models.Instances; -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; -[GenerateAutoInterface] public class InstanceObjectsManager : IInstanceObjectsManager { @@ -28,27 +27,30 @@ public UnpackResult GetUnpackResult() => public bool TryGetInstanceProxiesFromDefinitionId( string definitionId, - out List instanceProxiesWithSameDefinition + [NotNullWhen(true)] out List? instanceProxiesWithSameDefinition ) { - instanceProxiesWithSameDefinition = new List(); if (_instanceProxiesByDefinitionId.TryGetValue(definitionId, out List value)) { instanceProxiesWithSameDefinition = value; return true; } + instanceProxiesWithSameDefinition = null; return false; } - public bool TryGetInstanceDefinitionProxy(string definitionId, out InstanceDefinitionProxy instanceDefinitionProxy) + public bool TryGetInstanceDefinitionProxy( + string definitionId, + [NotNullWhen(true)] out InstanceDefinitionProxy? instanceDefinitionProxy + ) { - instanceDefinitionProxy = new InstanceDefinitionProxy(); if (_definitionProxies.TryGetValue(definitionId, out InstanceDefinitionProxy value)) { instanceDefinitionProxy = value; return true; } + instanceDefinitionProxy = null; return false; } diff --git a/Sdk/Speckle.Connectors.Utils/Instances/LocalToGlobalMap.cs b/Sdk/Speckle.Connectors.Common/Instances/LocalToGlobalMap.cs similarity index 81% rename from Sdk/Speckle.Connectors.Utils/Instances/LocalToGlobalMap.cs rename to Sdk/Speckle.Connectors.Common/Instances/LocalToGlobalMap.cs index 561f479fa..dbc88aea2 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/LocalToGlobalMap.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/LocalToGlobalMap.cs @@ -2,6 +2,6 @@ using Speckle.Sdk.Models; using Speckle.Sdk.Models.GraphTraversal; -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; public record LocalToGlobalMap(TraversalContext TraversalContext, Base AtomicObject, List Matrix); diff --git a/Sdk/Speckle.Connectors.Utils/Instances/LocalToGlobalUnpacker.cs b/Sdk/Speckle.Connectors.Common/Instances/LocalToGlobalUnpacker.cs similarity index 98% rename from Sdk/Speckle.Connectors.Utils/Instances/LocalToGlobalUnpacker.cs rename to Sdk/Speckle.Connectors.Common/Instances/LocalToGlobalUnpacker.cs index 730effae1..3a13c6cc7 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/LocalToGlobalUnpacker.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/LocalToGlobalUnpacker.cs @@ -4,7 +4,7 @@ using Speckle.Sdk.Models.GraphTraversal; using Speckle.Sdk.Models.Instances; -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; /// /// Utility for the connectors that doesn't support instancing. diff --git a/Sdk/Speckle.Connectors.Utils/Instances/UnpackResult.cs b/Sdk/Speckle.Connectors.Common/Instances/UnpackResult.cs similarity index 81% rename from Sdk/Speckle.Connectors.Utils/Instances/UnpackResult.cs rename to Sdk/Speckle.Connectors.Common/Instances/UnpackResult.cs index 1959b884d..6d311c785 100644 --- a/Sdk/Speckle.Connectors.Utils/Instances/UnpackResult.cs +++ b/Sdk/Speckle.Connectors.Common/Instances/UnpackResult.cs @@ -1,6 +1,6 @@ using Speckle.Sdk.Models.Instances; -namespace Speckle.Connectors.Utils.Instances; +namespace Speckle.Connectors.Common.Instances; public record UnpackResult( List AtomicObjects, diff --git a/Sdk/Speckle.Connectors.Utils/Operations/AccountService.cs b/Sdk/Speckle.Connectors.Common/Operations/AccountService.cs similarity index 82% rename from Sdk/Speckle.Connectors.Utils/Operations/AccountService.cs rename to Sdk/Speckle.Connectors.Common/Operations/AccountService.cs index 74e317647..665d24c2d 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/AccountService.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/AccountService.cs @@ -1,13 +1,13 @@ using Speckle.Sdk.Credentials; -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; /// /// Service that responsible to get account for DUI3 from account id otherwise from server url if any. /// Note: Be sure it is registered on refactorings. Otherwise, we won't be able to do any send/receive ops. /// This can safely be registered as singleton. /// -public class AccountService +public class AccountService(IAccountManager accountManager) { /// /// Account to retrieve with its id, if not exist try to retrieve from matching serverUrl. @@ -20,11 +20,11 @@ public Account GetAccountWithServerUrlFallback(string accountId, Uri serverUrl) { try { - return AccountManager.GetAccount(accountId); + return accountManager.GetAccount(accountId); } catch (SpeckleAccountManagerException) { - var accounts = AccountManager.GetAccounts(serverUrl); + var accounts = accountManager.GetAccounts(serverUrl); return accounts.First() ?? throw new SpeckleAccountManagerException($"No any account found that matches with server {serverUrl}"); } diff --git a/Sdk/Speckle.Connectors.Utils/Operations/ISyncToThread.cs b/Sdk/Speckle.Connectors.Common/Operations/ISyncToThread.cs similarity index 61% rename from Sdk/Speckle.Connectors.Utils/Operations/ISyncToThread.cs rename to Sdk/Speckle.Connectors.Common/Operations/ISyncToThread.cs index 7e1950a30..795d928d9 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/ISyncToThread.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/ISyncToThread.cs @@ -1,4 +1,4 @@ -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; public interface ISyncToThread { diff --git a/Sdk/Speckle.Connectors.Utils/Operations/ProgressDisplayManager.cs b/Sdk/Speckle.Connectors.Common/Operations/ProgressDisplayManager.cs similarity index 98% rename from Sdk/Speckle.Connectors.Utils/Operations/ProgressDisplayManager.cs rename to Sdk/Speckle.Connectors.Common/Operations/ProgressDisplayManager.cs index 9d9b5c394..9ec443997 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/ProgressDisplayManager.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/ProgressDisplayManager.cs @@ -1,7 +1,7 @@ using Speckle.InterfaceGenerator; using Speckle.Sdk.Transports; -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; [GenerateAutoInterface] public class ProgressDisplayManager(IStopwatchManager stopwatch) : IProgressDisplayManager diff --git a/Sdk/Speckle.Connectors.Common/Operations/ProxyKeys.cs b/Sdk/Speckle.Connectors.Common/Operations/ProxyKeys.cs new file mode 100644 index 000000000..f5ad1b9d3 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Operations/ProxyKeys.cs @@ -0,0 +1,10 @@ +namespace Speckle.Connectors.Common.Operations; + +public static class ProxyKeys +{ + public const string COLOR = "colorProxies"; + public const string RENDER_MATERIAL = "renderMaterialProxies"; + public const string INSTANCE_DEFINITION = "instanceDefinitionProxies"; + public const string GROUP = "groupProxies"; + public const string PARAMETER_DEFINITIONS = "parameterDefinitions"; +} diff --git a/Sdk/Speckle.Connectors.Common/Operations/Receive/RootObjectUnpacker.cs b/Sdk/Speckle.Connectors.Common/Operations/Receive/RootObjectUnpacker.cs new file mode 100644 index 000000000..870d5f392 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Operations/Receive/RootObjectUnpacker.cs @@ -0,0 +1,66 @@ +using Speckle.Objects.Other; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; +using Speckle.Sdk.Models.GraphTraversal; +using Speckle.Sdk.Models.Instances; +using Speckle.Sdk.Models.Proxies; + +namespace Speckle.Connectors.Common.Operations.Receive; + +/// +/// Unpacker root object for receive operation. +/// +public class RootObjectUnpacker +{ + private readonly GraphTraversal _traverseFunction; + + public RootObjectUnpacker(GraphTraversal traverseFunction) + { + _traverseFunction = traverseFunction; + } + + public RootObjectUnpackerResult Unpack(Base root) => + new( + GetObjectsToConvert(root), + TryGetInstanceDefinitionProxies(root), + TryGetGroupProxies(root), + TryGetRenderMaterialProxies(root), + TryGetColorProxies(root) + ); + + public IEnumerable GetObjectsToConvert(Base root) => + _traverseFunction.Traverse(root).Where(obj => obj.Current is not Collection); + + public List? TryGetColorProxies(Base root) => TryGetProxies(root, ProxyKeys.COLOR); + + public List? TryGetRenderMaterialProxies(Base root) => + TryGetProxies(root, ProxyKeys.RENDER_MATERIAL); + + public List? TryGetInstanceDefinitionProxies(Base root) => + TryGetProxies(root, ProxyKeys.INSTANCE_DEFINITION); + + public List? TryGetGroupProxies(Base root) => TryGetProxies(root, ProxyKeys.GROUP); + + public ( + List atomicObjects, + List instanceComponents + ) SplitAtomicObjectsAndInstances(IEnumerable objectsToSplit) + { + List atomicObjects = new(); + List instanceComponents = new(); + foreach (TraversalContext tc in objectsToSplit) + { + if (tc.Current is IInstanceComponent) + { + instanceComponents.Add(tc); + } + else + { + atomicObjects.Add(tc); + } + } + return (atomicObjects, instanceComponents); + } + + private List? TryGetProxies(Base root, string key) => (root[key] as List)?.Cast().ToList(); +} diff --git a/Sdk/Speckle.Connectors.Common/Operations/Receive/RootObjectUnpackerResult.cs b/Sdk/Speckle.Connectors.Common/Operations/Receive/RootObjectUnpackerResult.cs new file mode 100644 index 000000000..283bb2826 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Operations/Receive/RootObjectUnpackerResult.cs @@ -0,0 +1,14 @@ +using Speckle.Objects.Other; +using Speckle.Sdk.Models.GraphTraversal; +using Speckle.Sdk.Models.Instances; +using Speckle.Sdk.Models.Proxies; + +namespace Speckle.Connectors.Common.Operations.Receive; + +public record RootObjectUnpackerResult( + IEnumerable ObjectsToConvert, + List? DefinitionProxies, + List? GroupProxies, + List? RenderMaterialProxies, + List? ColorProxies +); diff --git a/Sdk/Speckle.Connectors.Common/Operations/Receive/TraversalContextUnpacker.cs b/Sdk/Speckle.Connectors.Common/Operations/Receive/TraversalContextUnpacker.cs new file mode 100644 index 000000000..bf8b0b179 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/Operations/Receive/TraversalContextUnpacker.cs @@ -0,0 +1,47 @@ +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; +using Speckle.Sdk.Models.GraphTraversal; +using Speckle.Sdk.Models.Instances; + +namespace Speckle.Connectors.Common.Operations.Receive; + +/// +/// Utility class to unpack layer structure from path of collections or property tree. +/// +public abstract class TraversalContextUnpacker +{ + public List<(Collection[] path, Base current)> GetAtomicObjectsWithPath( + IEnumerable atomicObjects + ) => atomicObjects.Select(o => (GetCollectionPath(o), o.Current)).ToList(); + + public List<(Collection[] path, IInstanceComponent instance)> GetInstanceComponentsWithPath( + IEnumerable instanceComponents + ) => instanceComponents.Select(o => (GetCollectionPath(o), (o.Current as IInstanceComponent)!)).ToList(); + + /// + /// Returns the collection path for the provided traversal context. If data is coming from a dynamic/non-dui3 connector, the collection path will be generated based on the property path. This function enforces that every collection will have a name and an application id. + /// POC: this should be a util living somewhere else, most likely as an extension of the traversal context. + /// + /// + /// + public Collection[] GetCollectionPath(TraversalContext context) + { + Collection[] collectionBasedPath = context.GetAscendantOfType().Reverse().ToArray(); + + if (collectionBasedPath.Length == 0) + { + collectionBasedPath = context + .GetPropertyPath() + .Reverse() + .Select(o => new Collection() { applicationId = Guid.NewGuid().ToString(), name = o }) + .ToArray(); + } + + foreach (var collection in collectionBasedPath) + { + collection.applicationId ??= Guid.NewGuid().ToString(); + } + + return collectionBasedPath; + } +} diff --git a/Sdk/Speckle.Connectors.Utils/Operations/ReceiveInfo.cs b/Sdk/Speckle.Connectors.Common/Operations/ReceiveInfo.cs similarity index 79% rename from Sdk/Speckle.Connectors.Utils/Operations/ReceiveInfo.cs rename to Sdk/Speckle.Connectors.Common/Operations/ReceiveInfo.cs index e2bf305e3..1bc6a2642 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/ReceiveInfo.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/ReceiveInfo.cs @@ -1,4 +1,4 @@ -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; public record ReceiveInfo( string AccountId, diff --git a/Sdk/Speckle.Connectors.Utils/Operations/ReceiveOperation.cs b/Sdk/Speckle.Connectors.Common/Operations/ReceiveOperation.cs similarity index 81% rename from Sdk/Speckle.Connectors.Utils/Operations/ReceiveOperation.cs rename to Sdk/Speckle.Connectors.Common/Operations/ReceiveOperation.cs index 215b5747a..575cd070d 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/ReceiveOperation.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/ReceiveOperation.cs @@ -1,11 +1,11 @@ -using Speckle.Connectors.Utils.Builders; +using Speckle.Connectors.Common.Builders; using Speckle.Sdk.Api; using Speckle.Sdk.Credentials; using Speckle.Sdk.Logging; using Speckle.Sdk.Models; using Speckle.Sdk.Transports; -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; public sealed class ReceiveOperation { @@ -13,18 +13,27 @@ public sealed class ReceiveOperation private readonly AccountService _accountService; private readonly IServerTransportFactory _serverTransportFactory; private readonly IProgressDisplayManager _progressDisplayManager; + private readonly ISdkActivityFactory _activityFactory; + private readonly IOperations _operations; + private readonly IClientFactory _clientFactory; public ReceiveOperation( IHostObjectBuilder hostObjectBuilder, AccountService accountService, IServerTransportFactory serverTransportFactory, - IProgressDisplayManager progressDisplayManager + IProgressDisplayManager progressDisplayManager, + ISdkActivityFactory activityFactory, + IOperations operations, + IClientFactory clientFactory ) { _hostObjectBuilder = hostObjectBuilder; _accountService = accountService; _serverTransportFactory = serverTransportFactory; _progressDisplayManager = progressDisplayManager; + _activityFactory = activityFactory; + _operations = operations; + _clientFactory = clientFactory; } public async Task Execute( @@ -33,15 +42,15 @@ public async Task Execute( Action? onOperationProgressed = null ) { - using var execute = SpeckleActivityFactory.Start(); + using var execute = _activityFactory.Start(); Speckle.Sdk.Api.GraphQL.Models.Version? version; Base? commitObject; HostObjectBuilderResult? res; // 2 - Check account exist Account account = _accountService.GetAccountWithServerUrlFallback(receiveInfo.AccountId, receiveInfo.ServerUrl); - using Client apiClient = new(account); + using Client apiClient = _clientFactory.Create(account); - using (var _ = SpeckleActivityFactory.Start("Receive version")) + using (var _ = _activityFactory.Start("Receive version")) { version = await apiClient .Version.Get(receiveInfo.SelectedVersionId, receiveInfo.ModelId, receiveInfo.ProjectId, cancellationToken) @@ -51,11 +60,11 @@ public async Task Execute( int totalCount = 1; using var transport = _serverTransportFactory.Create(account, receiveInfo.ProjectId); - using (var _ = SpeckleActivityFactory.Start("Receive objects")) + using (var _ = _activityFactory.Start("Receive objects")) { _progressDisplayManager.Begin(); - commitObject = await Speckle - .Sdk.Api.Operations.Receive( + commitObject = await _operations + .Receive( version.referencedObject, transport, onProgressAction: dict => @@ -99,7 +108,7 @@ public async Task Execute( } // 4 - Convert objects - using (var _ = SpeckleActivityFactory.Start("Convert")) + using (var _ = _activityFactory.Start("Convert")) { res = await _hostObjectBuilder .Build(commitObject, receiveInfo.ProjectName, receiveInfo.ModelName, onOperationProgressed, cancellationToken) diff --git a/Sdk/Speckle.Connectors.Utils/Operations/RootObjectSender.cs b/Sdk/Speckle.Connectors.Common/Operations/RootObjectSender.cs similarity index 90% rename from Sdk/Speckle.Connectors.Utils/Operations/RootObjectSender.cs rename to Sdk/Speckle.Connectors.Common/Operations/RootObjectSender.cs index 6ca49aec6..23f6337cc 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/RootObjectSender.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/RootObjectSender.cs @@ -1,4 +1,4 @@ -using Speckle.Connectors.Utils.Caching; +using Speckle.Connectors.Common.Caching; using Speckle.InterfaceGenerator; using Speckle.Sdk.Api; using Speckle.Sdk.Api.GraphQL.Inputs; @@ -6,7 +6,7 @@ using Speckle.Sdk.Models; using Speckle.Sdk.Transports; -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; /// /// Default implementation of the which takes a and sends @@ -22,18 +22,24 @@ public sealed class RootObjectSender : IRootObjectSender private readonly ISendConversionCache _sendConversionCache; private readonly AccountService _accountService; private readonly IProgressDisplayManager _progressDisplayManager; + private readonly IOperations _operations; + private readonly IClientFactory _clientFactory; public RootObjectSender( IServerTransportFactory transportFactory, ISendConversionCache sendConversionCache, AccountService accountService, - IProgressDisplayManager progressDisplayManager + IProgressDisplayManager progressDisplayManager, + IOperations operations, + IClientFactory clientFactory ) { _transportFactory = transportFactory; _sendConversionCache = sendConversionCache; _accountService = accountService; _progressDisplayManager = progressDisplayManager; + _operations = operations; + _clientFactory = clientFactory; } /// @@ -57,8 +63,8 @@ IProgressDisplayManager progressDisplayManager using var transport = _transportFactory.Create(account, sendInfo.ProjectId, 60, null); _progressDisplayManager.Begin(); - var sendResult = await Sdk - .Api.Operations.Send( + var sendResult = await _operations + .Send( commitObject, transport, true, @@ -107,7 +113,7 @@ IProgressDisplayManager progressDisplayManager onOperationProgressed?.Invoke("Linking version to model...", null); // 8 - Create the version (commit) - using var apiClient = new Client(account); + using var apiClient = _clientFactory.Create(account); _ = await apiClient .Version.Create( new CreateVersionInput( diff --git a/Sdk/Speckle.Connectors.Utils/Operations/SendInfo.cs b/Sdk/Speckle.Connectors.Common/Operations/SendInfo.cs similarity index 69% rename from Sdk/Speckle.Connectors.Utils/Operations/SendInfo.cs rename to Sdk/Speckle.Connectors.Common/Operations/SendInfo.cs index 7400bc2cd..7c4833e87 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/SendInfo.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/SendInfo.cs @@ -1,3 +1,3 @@ -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; public record SendInfo(string AccountId, Uri ServerUrl, string ProjectId, string ModelId, string SourceApplication); diff --git a/Sdk/Speckle.Connectors.Utils/Operations/SendOperation.cs b/Sdk/Speckle.Connectors.Common/Operations/SendOperation.cs similarity index 76% rename from Sdk/Speckle.Connectors.Utils/Operations/SendOperation.cs rename to Sdk/Speckle.Connectors.Common/Operations/SendOperation.cs index 4de25e2e8..52b6fa277 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/SendOperation.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/SendOperation.cs @@ -1,19 +1,25 @@ -using Speckle.Connectors.Utils.Builders; -using Speckle.Connectors.Utils.Conversion; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Conversion; using Speckle.Sdk.Logging; using Speckle.Sdk.Models; -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; public sealed class SendOperation { private readonly IRootObjectBuilder _rootObjectBuilder; private readonly IRootObjectSender _baseObjectSender; + private readonly ISdkActivityFactory _activityFactory; - public SendOperation(IRootObjectBuilder rootObjectBuilder, IRootObjectSender baseObjectSender) + public SendOperation( + IRootObjectBuilder rootObjectBuilder, + IRootObjectSender baseObjectSender, + ISdkActivityFactory activityFactory + ) { _rootObjectBuilder = rootObjectBuilder; _baseObjectSender = baseObjectSender; + _activityFactory = activityFactory; } public async Task Execute( @@ -23,7 +29,7 @@ public async Task Execute( CancellationToken ct = default ) { - using var activity = SpeckleActivityFactory.Start("SendOperation"); + using var activity = _activityFactory.Start("SendOperation"); var buildResult = await _rootObjectBuilder .Build(objects, sendInfo, onOperationProgressed, ct) .ConfigureAwait(false); diff --git a/Sdk/Speckle.Connectors.Utils/Operations/StopwatchManager.cs b/Sdk/Speckle.Connectors.Common/Operations/StopwatchManager.cs similarity index 88% rename from Sdk/Speckle.Connectors.Utils/Operations/StopwatchManager.cs rename to Sdk/Speckle.Connectors.Common/Operations/StopwatchManager.cs index 4da5c51bb..59e583da7 100644 --- a/Sdk/Speckle.Connectors.Utils/Operations/StopwatchManager.cs +++ b/Sdk/Speckle.Connectors.Common/Operations/StopwatchManager.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using Speckle.InterfaceGenerator; -namespace Speckle.Connectors.Utils.Operations; +namespace Speckle.Connectors.Common.Operations; [GenerateAutoInterface] public class StopwatchManager : IStopwatchManager diff --git a/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj b/Sdk/Speckle.Connectors.Common/Speckle.Connectors.Common.csproj similarity index 74% rename from Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj rename to Sdk/Speckle.Connectors.Common/Speckle.Connectors.Common.csproj index cf4d1f92f..c59c169e3 100644 --- a/Sdk/Speckle.Connectors.Utils/Speckle.Connectors.Utils.csproj +++ b/Sdk/Speckle.Connectors.Common/Speckle.Connectors.Common.csproj @@ -5,11 +5,8 @@ Debug;Release;Local - - - - - + + diff --git a/Sdk/Speckle.Connectors.Common/SpeckleLogProvider.cs b/Sdk/Speckle.Connectors.Common/SpeckleLogProvider.cs new file mode 100644 index 000000000..1c0848b62 --- /dev/null +++ b/Sdk/Speckle.Connectors.Common/SpeckleLogProvider.cs @@ -0,0 +1,11 @@ +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Logging; + +namespace Speckle.Connectors.Common; + +public sealed class SpeckleLogProvider(Logger speckleLogger) : ILoggerProvider +{ + public void Dispose() { } + + public ILogger CreateLogger(string categoryName) => new SpeckleLogger(speckleLogger); +} diff --git a/Sdk/Speckle.Connectors.Utils/Common/SpeckleLogger.cs b/Sdk/Speckle.Connectors.Common/SpeckleLogger.cs similarity index 91% rename from Sdk/Speckle.Connectors.Utils/Common/SpeckleLogger.cs rename to Sdk/Speckle.Connectors.Common/SpeckleLogger.cs index 44667d52d..13c714c3c 100644 --- a/Sdk/Speckle.Connectors.Utils/Common/SpeckleLogger.cs +++ b/Sdk/Speckle.Connectors.Common/SpeckleLogger.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Logging; -using Speckle.Sdk.Logging; +using Speckle.Connectors.Logging; -namespace Speckle.Connectors.Utils.Common; +namespace Speckle.Connectors.Common; -public class SpeckleLogger(ISpeckleLogger logger) : ILogger +public class SpeckleLogger(Logger logger) : ILogger { public void Log( LogLevel logLevel, diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json b/Sdk/Speckle.Connectors.Common/packages.lock.json similarity index 68% rename from Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json rename to Sdk/Speckle.Connectors.Common/packages.lock.json index 7fefe9760..f8cbfc650 100644 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/packages.lock.json +++ b/Sdk/Speckle.Connectors.Common/packages.lock.json @@ -2,13 +2,13 @@ "version": 2, "dependencies": { ".NETStandard,Version=v2.0": { - "Autofac": { + "Microsoft.Extensions.DependencyInjection": { "type": "Direct", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" } }, "Microsoft.SourceLink.GitHub": { @@ -42,6 +42,33 @@ "resolved": "0.9.6", "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" }, + "Speckle.Objects": { + "type": "Direct", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.145" + } + }, + "Speckle.Sdk": { + "type": "Direct", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Speckle.DoubleNumerics": "4.0.1", + "Speckle.Newtonsoft.Json": "13.0.2" + } + }, "GraphQL.Client": { "type": "Transitive", "resolved": "6.0.0", @@ -73,14 +100,6 @@ "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", @@ -108,6 +127,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.NETCore.Platforms": { "type": "Transitive", "resolved": "1.1.0", @@ -151,11 +218,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -188,23 +250,28 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", + "System.Buffers": "4.4.0", "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -226,8 +293,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Runtime.InteropServices.WindowsRuntime": { "type": "Transitive", @@ -237,29 +304,6 @@ "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" - } - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -268,52 +312,26 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, - "speckle.converters.common": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, - "Microsoft.Extensions.Logging.Abstractions": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" - }, - "Speckle.Objects": { - "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, - "Speckle.Sdk": { + "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" - } + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" } } } diff --git a/Sdk/Speckle.Connectors.Logging/Consts.cs b/Sdk/Speckle.Connectors.Logging/Consts.cs new file mode 100644 index 000000000..1dcb0ae6f --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Consts.cs @@ -0,0 +1,11 @@ +namespace Speckle.Connectors.Logging; + +public static class Consts +{ + public const string SERVICE_NAME = "connector.name"; + public const string SERVICE_SLUG = "connector.slug"; + public const string OS_NAME = "os.name"; + public const string OS_TYPE = "os.type"; + public const string OS_SLUG = "os.slug"; + public const string RUNTIME_NAME = "runtime.name"; +} diff --git a/Sdk/Speckle.Connectors.Logging/Internal/LogBuilder.cs b/Sdk/Speckle.Connectors.Logging/Internal/LogBuilder.cs new file mode 100644 index 000000000..b53ab41b5 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Internal/LogBuilder.cs @@ -0,0 +1,104 @@ +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; +using OpenTelemetry.Resources; +using Serilog; +using Serilog.Exceptions; +using Serilog.Sinks.OpenTelemetry; + +namespace Speckle.Connectors.Logging.Internal; + +internal static class LogBuilder +{ + public static Logger Initialize( + string applicationAndVersion, + string connectorVersion, + SpeckleLogging? speckleLogging, + ResourceBuilder resourceBuilder + ) + { + var fileVersionInfo = GetFileVersionInfo(); + var serilogLogConfiguration = new LoggerConfiguration() + .MinimumLevel.Is(SpeckleLogLevelUtility.GetLevel(speckleLogging?.MinimumLevel ?? SpeckleLogLevel.Warning)) + .Enrich.FromLogContext() + .Enrich.WithProperty("version", fileVersionInfo.FileVersion) + .Enrich.WithProperty("productVersion", connectorVersion) + .Enrich.WithProperty("hostOs", DetermineHostOsSlug()) + .Enrich.WithProperty("hostOsVersion", Environment.OSVersion) + .Enrich.WithProperty("hostOsArchitecture", RuntimeInformation.ProcessArchitecture.ToString()) + .Enrich.WithProperty("runtime", RuntimeInformation.FrameworkDescription) + .Enrich.WithExceptionDetails(); + + if (speckleLogging?.File is not null) + { + // TODO: check if we have write permissions to the file. + var logFilePath = SpecklePathProvider.LogFolderPath(applicationAndVersion); + logFilePath = Path.Combine(logFilePath, speckleLogging.File.Path ?? "SpeckleCoreLog.txt"); + serilogLogConfiguration = serilogLogConfiguration.WriteTo.File( + logFilePath, + rollingInterval: RollingInterval.Day, + retainedFileCountLimit: 10 + ); + } + + if (speckleLogging?.Console ?? false) + { + serilogLogConfiguration = serilogLogConfiguration.WriteTo.Console(); + } + + if (speckleLogging?.Otel is not null) + { + serilogLogConfiguration = InitializeOtelLogging(serilogLogConfiguration, speckleLogging.Otel, resourceBuilder); + } + var logger = serilogLogConfiguration.CreateLogger(); + + logger + .ForContext("hostApplication", applicationAndVersion) + .ForContext("userApplicationDataPath", SpecklePathProvider.UserApplicationDataPath()) + .ForContext("installApplicationDataPath", SpecklePathProvider.InstallApplicationDataPath) + .Information( + "Initialized logger inside {hostApplication}/{productVersion}/{version} for user {id}. Path info {userApplicationDataPath} {installApplicationDataPath}." + ); + + return new Logger(logger); + } + + private static FileVersionInfo GetFileVersionInfo() + { + var assembly = Assembly.GetExecutingAssembly().Location; + return FileVersionInfo.GetVersionInfo(assembly); + } + + private static string DetermineHostOsSlug() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return "Windows"; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + return "MacOS"; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + return "Linux"; + } + + return RuntimeInformation.OSDescription; + } + + private static LoggerConfiguration InitializeOtelLogging( + LoggerConfiguration serilogLogConfiguration, + SpeckleOtelLogging speckleOtelLogging, + ResourceBuilder resourceBuilder + ) => + serilogLogConfiguration.WriteTo.OpenTelemetry(o => + { + o.Protocol = OtlpProtocol.HttpProtobuf; + o.LogsEndpoint = speckleOtelLogging.Endpoint; + o.Headers = speckleOtelLogging.Headers ?? o.Headers; + o.ResourceAttributes = resourceBuilder.Build().Attributes.ToDictionary(x => x.Key, x => x.Value); + }); +} diff --git a/Sdk/Speckle.Connectors.Logging/Internal/ResourceCreator.cs b/Sdk/Speckle.Connectors.Logging/Internal/ResourceCreator.cs new file mode 100644 index 000000000..7de798c48 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Internal/ResourceCreator.cs @@ -0,0 +1,43 @@ +using System.Runtime.InteropServices; +using OpenTelemetry.Resources; + +namespace Speckle.Connectors.Logging.Internal; + +internal static class ResourceCreator +{ + internal static ResourceBuilder Create(string applicationAndVersion, string slug, string connectorVersion) => + ResourceBuilder + .CreateEmpty() + .AddService(serviceName: LoggingActivityFactory.TRACING_SOURCE, serviceVersion: connectorVersion) + .AddAttributes( + new List> + { + new(Consts.SERVICE_NAME, applicationAndVersion), + new(Consts.SERVICE_SLUG, slug), + new(Consts.OS_NAME, Environment.OSVersion.ToString()), + new(Consts.OS_TYPE, RuntimeInformation.ProcessArchitecture.ToString()), + new(Consts.OS_SLUG, DetermineHostOsSlug()), + new(Consts.RUNTIME_NAME, RuntimeInformation.FrameworkDescription) + } + ); + + private static string DetermineHostOsSlug() + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return "Windows"; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + return "MacOS"; + } + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + return "Linux"; + } + + return RuntimeInformation.OSDescription; + } +} diff --git a/Sdk/Speckle.Connectors.Logging/Internal/SpeckleLogLevelUtility.cs b/Sdk/Speckle.Connectors.Logging/Internal/SpeckleLogLevelUtility.cs new file mode 100644 index 000000000..d5eed5f22 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Internal/SpeckleLogLevelUtility.cs @@ -0,0 +1,18 @@ +using Serilog.Events; + +namespace Speckle.Connectors.Logging.Internal; + +internal static class SpeckleLogLevelUtility +{ + internal static LogEventLevel GetLevel(SpeckleLogLevel speckleLogLevel) => + speckleLogLevel switch + { + SpeckleLogLevel.Debug => LogEventLevel.Debug, + SpeckleLogLevel.Verbose => LogEventLevel.Verbose, + SpeckleLogLevel.Information => LogEventLevel.Information, + SpeckleLogLevel.Warning => LogEventLevel.Warning, + SpeckleLogLevel.Error => LogEventLevel.Error, + SpeckleLogLevel.Fatal => LogEventLevel.Fatal, + _ => throw new ArgumentOutOfRangeException(nameof(speckleLogLevel), speckleLogLevel, null) + }; +} diff --git a/Sdk/Speckle.Connectors.Logging/Internal/SpecklePathProvider.cs b/Sdk/Speckle.Connectors.Logging/Internal/SpecklePathProvider.cs new file mode 100644 index 000000000..373958191 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Internal/SpecklePathProvider.cs @@ -0,0 +1,89 @@ +using System.Reflection; + +namespace Speckle.Connectors.Logging.Internal; + +/// +/// Helper class dedicated for Speckle specific Path operations. +/// +internal static class SpecklePathProvider +{ + private const string APPLICATION_NAME = "Speckle"; + + private const string LOG_FOLDER_NAME = "Logs"; + + private static string UserDataPathEnvVar => "SPECKLE_USERDATA_PATH"; + private static string? Path => Environment.GetEnvironmentVariable(UserDataPathEnvVar); + + /// + /// Get the installation path. + /// + public static string InstallApplicationDataPath => + Assembly.GetExecutingAssembly().Location.Contains("ProgramData") + ? Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + : UserApplicationDataPath(); + + /// + /// Get the folder where the user's Speckle data should be stored. + /// + public static string UserSpeckleFolderPath => EnsureFolderExists(UserApplicationDataPath(), APPLICATION_NAME); + + /// + /// Get the platform specific user configuration folder path.
+ /// will be the path e.g.: + /// In cases such as linux servers where the above path is not permissive, we will fall back to + ///
+ /// + /// path usually maps to + ///
    + ///
  • win: %appdata%/
  • + ///
  • MacOS: ~/.config/
  • + ///
  • Linux: ~/.config/
  • + ///
+ ///
+ /// Both and paths are inaccessible + public static string UserApplicationDataPath() + { + // if we have an override, just return that + var pathOverride = Path; + if (pathOverride != null && !string.IsNullOrEmpty(pathOverride)) + { + return pathOverride; + } + + // on desktop linux and macos we use the appdata. + // but we might not have write access to the disk + // so the catch falls back to the user profile + try + { + return Environment.GetFolderPath( + Environment.SpecialFolder.ApplicationData, + // if the folder doesn't exist, we get back an empty string on OSX, + // which in turn, breaks other stuff down the line. + // passing in the Create option ensures that this directory exists, + // which is not a given on all OS-es. + Environment.SpecialFolderOption.Create + ); + } + catch (SystemException ex) when (ex is PlatformNotSupportedException or ArgumentException) + { + //Adding this log just so we confidently know which Exception type to catch here. + // TODO: Must re-add log call when (and if) this get's made as a service + //SpeckleLog.Logger.Warning(ex, "Falling back to user profile path"); + + // on server linux, there might not be a user setup, things can run under root + // in that case, the appdata variable is most probably not set up + // we fall back to the value of the home folder + return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + } + } + + private static string EnsureFolderExists(params string[] folderName) + { + var path = System.IO.Path.Combine(folderName); + Directory.CreateDirectory(path); + return path; + } + + internal static string LogFolderPath(string applicationAndVersion) => + EnsureFolderExists(UserSpeckleFolderPath, LOG_FOLDER_NAME, applicationAndVersion); +} diff --git a/Sdk/Speckle.Connectors.Logging/Internal/TracingBuilder.cs b/Sdk/Speckle.Connectors.Logging/Internal/TracingBuilder.cs new file mode 100644 index 000000000..183d165fa --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Internal/TracingBuilder.cs @@ -0,0 +1,51 @@ +using OpenTelemetry.Exporter; +using OpenTelemetry.Resources; +using OpenTelemetry.Trace; + +namespace Speckle.Connectors.Logging.Internal; + +internal static class TracingBuilder +{ + public static IDisposable? Initialize(SpeckleTracing? logConfiguration, ResourceBuilder resourceBuilder) + { + var consoleEnabled = logConfiguration?.Console ?? false; + var otelEnabled = logConfiguration?.Otel?.Enabled ?? false; + if (!consoleEnabled && !otelEnabled) + { + return null; + } + + var tracerProviderBuilder = OpenTelemetry + .Sdk.CreateTracerProviderBuilder() + .AddSource(LoggingActivityFactory.TRACING_SOURCE); + tracerProviderBuilder = tracerProviderBuilder.AddHttpClientInstrumentation(); + if (otelEnabled) + { + tracerProviderBuilder = tracerProviderBuilder.AddOtlpExporter(x => ProcessOptions(logConfiguration!, x)); + } + + if (consoleEnabled) + { + tracerProviderBuilder = tracerProviderBuilder.AddConsoleExporter(); + } + + tracerProviderBuilder = tracerProviderBuilder.SetResourceBuilder(resourceBuilder).SetSampler(); + + return tracerProviderBuilder.Build(); + } + + private static void ProcessOptions(SpeckleTracing logConfiguration, OtlpExporterOptions options) + { + options.Protocol = OtlpExportProtocol.HttpProtobuf; + var headers = string.Join(",", logConfiguration.Otel?.Headers?.Select(x => x.Key + "=" + x.Value) ?? []); + if (headers.Length != 0) + { + options.Headers = headers; + } + + if (logConfiguration.Otel?.Endpoint is not null) + { + options.Endpoint = new Uri(logConfiguration.Otel.Endpoint); + } + } +} diff --git a/Sdk/Speckle.Connectors.Logging/LoggingActivity.cs b/Sdk/Speckle.Connectors.Logging/LoggingActivity.cs new file mode 100644 index 000000000..7fbe82a2e --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/LoggingActivity.cs @@ -0,0 +1,33 @@ +using System.Diagnostics; +using OpenTelemetry.Trace; + +namespace Speckle.Connectors.Logging; + +public readonly struct LoggingActivity +{ + private readonly Activity _activity; + + internal LoggingActivity(Activity activity) + { + _activity = activity; + } + + public void Dispose() => _activity.Dispose(); + + public void SetTag(string key, object? value) => _activity.SetTag(key, value); + + public void RecordException(Exception e) => _activity.RecordException(e); + + public string TraceId => _activity.TraceId.ToString(); + + public void SetStatus(LoggingActivityStatusCode code) => + _activity.SetStatus( + code switch + { + LoggingActivityStatusCode.Error => ActivityStatusCode.Error, + LoggingActivityStatusCode.Unset => ActivityStatusCode.Unset, + LoggingActivityStatusCode.Ok => ActivityStatusCode.Ok, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + } + ); +} diff --git a/Sdk/Speckle.Connectors.Logging/LoggingActivityFactory.cs b/Sdk/Speckle.Connectors.Logging/LoggingActivityFactory.cs new file mode 100644 index 000000000..dff87de43 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/LoggingActivityFactory.cs @@ -0,0 +1,46 @@ +using System.Diagnostics; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace Speckle.Connectors.Logging; + +public sealed class LoggingActivityFactory : IDisposable +{ + public const string TRACING_SOURCE = "speckle-connectors"; + private readonly ActivitySource? _activitySource = + new(TRACING_SOURCE, GetPackageVersion(Assembly.GetExecutingAssembly())); + + public LoggingActivity? Start(string? name = null, [CallerMemberName] string source = "") + { + var activity = _activitySource?.StartActivity(name ?? source, ActivityKind.Client); + if (activity is null) + { + return null; + } + return new LoggingActivity(activity); + } + + public void Dispose() => _activitySource?.Dispose(); + + private static string GetPackageVersion(Assembly assembly) + { + // MinVer https://github.com/adamralph/minver?tab=readme-ov-file#version-numbers + // together with Microsoft.SourceLink.GitHub https://github.com/dotnet/sourcelink + // fills AssemblyInformationalVersionAttribute by + // {majorVersion}.{minorVersion}.{patchVersion}.{pre-release label}.{pre-release version}.{gitHeight}+{Git SHA of current commit} + // Ex: 1.5.0-alpha.1.40+807f703e1b4d9874a92bd86d9f2d4ebe5b5d52e4 + // The following parts are optional: pre-release label, pre-release version, git height, Git SHA of current commit + // For package version, value of AssemblyInformationalVersionAttribute without commit hash is returned. + + var informationalVersion = assembly + .GetCustomAttribute() + ?.InformationalVersion; + if (informationalVersion is null) + { + return String.Empty; + } + + var indexOfPlusSign = informationalVersion.IndexOf('+'); + return indexOfPlusSign > 0 ? informationalVersion[..indexOfPlusSign] : informationalVersion; + } +} diff --git a/Sdk/Speckle.Connectors.Logging/LoggingActivityStatusCode.cs b/Sdk/Speckle.Connectors.Logging/LoggingActivityStatusCode.cs new file mode 100644 index 000000000..19db4d514 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/LoggingActivityStatusCode.cs @@ -0,0 +1,13 @@ +namespace Speckle.Connectors.Logging; + +public enum LoggingActivityStatusCode +{ + /// Unset status code is the default value indicating the status code is not initialized. + Unset, + + /// Status code indicating the operation has been validated and completed successfully. + Ok, + + /// Status code indicating an error is encountered during the operation. + Error, +} diff --git a/Sdk/Speckle.Connectors.Logging/Observability.cs b/Sdk/Speckle.Connectors.Logging/Observability.cs new file mode 100644 index 000000000..2a1db2c92 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Observability.cs @@ -0,0 +1,24 @@ +using Speckle.Connectors.Logging.Internal; + +namespace Speckle.Connectors.Logging; + +public static class Observability +{ + public static (Logger, IDisposable?) Initialize( + string applicationAndVersion, + string slug, + string connectorVersion, + SpeckleObservability observability + ) + { + var resourceBuilder = ResourceCreator.Create(applicationAndVersion, slug, connectorVersion); + var logging = LogBuilder.Initialize( + applicationAndVersion, + connectorVersion, + observability.Logging, + resourceBuilder + ); + var tracing = TracingBuilder.Initialize(observability.Tracing, resourceBuilder); + return (logging, tracing); + } +} diff --git a/Sdk/Speckle.Connectors.Logging/Speckle.Connectors.Logging.csproj b/Sdk/Speckle.Connectors.Logging/Speckle.Connectors.Logging.csproj new file mode 100644 index 000000000..379d32e88 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/Speckle.Connectors.Logging.csproj @@ -0,0 +1,25 @@ + + + + netstandard2.0 + Debug;Release;Local + + + Debug;Release;Local + true + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/Sdk/Speckle.Connectors.Logging/SpeckleLogLevel.cs b/Sdk/Speckle.Connectors.Logging/SpeckleLogLevel.cs new file mode 100644 index 000000000..769025400 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/SpeckleLogLevel.cs @@ -0,0 +1,39 @@ +namespace Speckle.Connectors.Logging; + +public enum SpeckleLogLevel +{ + /// + /// Anything and everything you might want to know about + /// a running block of code. + /// + Verbose, + + /// + /// Internal system events that aren't necessarily + /// observable from the outside. + /// + Debug, + + /// + /// The lifeblood of operational intelligence - things + /// happen. + /// + Information, + + /// + /// Service is degraded or endangered. + /// + Warning, + + /// + /// Functionality is unavailable, invariants are broken + /// or data is lost. + /// + Error, + + /// + /// If you have a pager, it goes off when one of these + /// occurs. + /// + Fatal +} diff --git a/Sdk/Speckle.Connectors.Logging/SpeckleLogger.cs b/Sdk/Speckle.Connectors.Logging/SpeckleLogger.cs new file mode 100644 index 000000000..5360221e8 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/SpeckleLogger.cs @@ -0,0 +1,58 @@ +using Serilog.Events; + +namespace Speckle.Connectors.Logging; + +public sealed class Logger +{ + private readonly Serilog.ILogger _logger; + + public Logger(Serilog.ILogger logger) + { + _logger = logger; + } + + private static LogEventLevel GetLevel(SpeckleLogLevel speckleLogLevel) => + speckleLogLevel switch + { + SpeckleLogLevel.Debug => LogEventLevel.Debug, + SpeckleLogLevel.Verbose => LogEventLevel.Verbose, + SpeckleLogLevel.Information => LogEventLevel.Information, + SpeckleLogLevel.Warning => LogEventLevel.Warning, + SpeckleLogLevel.Error => LogEventLevel.Error, + SpeckleLogLevel.Fatal => LogEventLevel.Fatal, + _ => throw new ArgumentOutOfRangeException(nameof(speckleLogLevel), speckleLogLevel, null) + }; + + public void Write(SpeckleLogLevel speckleLogLevel, string message, params object?[] arguments) => + _logger.Write(GetLevel(speckleLogLevel), message, arguments); + + public void Write( + SpeckleLogLevel speckleLogLevel, + Exception? exception, + string message, + params object?[] arguments + ) => _logger.Write(GetLevel(speckleLogLevel), exception, message, arguments); + + public void Debug(string message, params object?[] arguments) => _logger.Debug(message, arguments); + + public void Debug(Exception? exception, string message, params object?[] arguments) => + _logger.Debug(exception, message, arguments); + + public void Warning(string message, params object?[] arguments) => _logger.Warning(message, arguments); + + public void Warning(Exception? exception, string message, params object?[] arguments) => + _logger.Warning(exception, message, arguments); + + public void Information(string message, params object?[] arguments) => _logger.Information(message, arguments); + + public void Information(Exception? exception, string message, params object?[] arguments) => + _logger.Information(exception, message, arguments); + + public void LogError(string message, params object?[] arguments) => _logger.Error(message, arguments); + + public void LogError(Exception? exception, string message, params object?[] arguments) => + _logger.Error(exception, message, arguments); + + public void Fatal(Exception? exception, string message, params object?[] arguments) => + _logger.Fatal(exception, message, arguments); +} diff --git a/Sdk/Speckle.Connectors.Logging/SpeckleObservability.cs b/Sdk/Speckle.Connectors.Logging/SpeckleObservability.cs new file mode 100644 index 000000000..9f98f5ebc --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/SpeckleObservability.cs @@ -0,0 +1,26 @@ +namespace Speckle.Connectors.Logging; + +/// +/// Configuration object for the Speckle logging system. +/// + +public record SpeckleObservability(SpeckleLogging? Logging = null, SpeckleTracing? Tracing = null); + +public record SpeckleLogging( + SpeckleLogLevel MinimumLevel = SpeckleLogLevel.Warning, + bool Console = true, + SpeckleFileLogging? File = null, + SpeckleOtelLogging? Otel = null +); + +public record SpeckleFileLogging(string? Path = null, bool Enabled = true); + +public record SpeckleOtelLogging(string Endpoint, bool Enabled = true, Dictionary? Headers = null); + +public record SpeckleTracing(bool Console = false, SpeckleOtelTracing? Otel = null); + +public record SpeckleOtelTracing( + string? Endpoint = null, + bool Enabled = true, + Dictionary? Headers = null +); diff --git a/Sdk/Speckle.Connectors.Logging/packages.lock.json b/Sdk/Speckle.Connectors.Logging/packages.lock.json new file mode 100644 index 000000000..d0fa75701 --- /dev/null +++ b/Sdk/Speckle.Connectors.Logging/packages.lock.json @@ -0,0 +1,447 @@ +{ + "version": 2, + "dependencies": { + ".NETStandard,Version=v2.0": { + "ILRepack.FullAuto": { + "type": "Direct", + "requested": "[1.6.0, )", + "resolved": "1.6.0", + "contentHash": "34qp/HQ0XRIWCjtNGUOslJ6p9eNWqHXZQ+xx1iBCvXy3mj8tEiqIwRG+LubFyKCJITqMh5cpFvFl20/6+Dmy+g==", + "dependencies": { + "ILRepack": "2.0.33" + } + }, + "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, )", + "resolved": "2.0.3", + "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.0" + } + }, + "OpenTelemetry.Exporter.Console": { + "type": "Direct", + "requested": "[1.9.0, )", + "resolved": "1.9.0", + "contentHash": "TbScDLSc6kcji+/wZYIf8/HBV2SnttzN7PNxr3TYczlmGlU4K2ugujp6seSktEO4OaAvKRd7Y3CG3SKNj0C+1Q==", + "dependencies": { + "OpenTelemetry": "1.9.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + } + }, + "OpenTelemetry.Exporter.OpenTelemetryProtocol": { + "type": "Direct", + "requested": "[1.9.0, )", + "resolved": "1.9.0", + "contentHash": "qzFOP3V2eYIVbug3U4BJzzidHe9JhAJ42WZ/H8pUp/45Ry3MQQg/+e/ZieClJcxKnpbkXi7dUq1rpvuNp+yBYA==", + "dependencies": { + "Google.Protobuf": "[3.22.5, 4.0.0)", + "Grpc": "[2.44.0, 3.0.0)", + "Microsoft.Extensions.Configuration.Binder": "8.0.1", + "OpenTelemetry": "1.9.0" + } + }, + "OpenTelemetry.Instrumentation.Http": { + "type": "Direct", + "requested": "[1.9.0, )", + "resolved": "1.9.0", + "contentHash": "+ZXppf8Qxz3OdC803T8fB6i8iSscc8PsxMnM/JizSOYmkz+8vGiScEiaBBBFNZtMh2KpA0q+qxwnSwQUkbvzog==", + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0", + "OpenTelemetry.Api.ProviderBuilderExtensions": "[1.9.0, 2.0.0)" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.14.1, )", + "resolved": "1.14.1", + "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" + }, + "Serilog": { + "type": "Direct", + "requested": "[4.0.1, )", + "resolved": "4.0.1", + "contentHash": "pzeDRXdpSLSsgBHpZcmpIDxqMy845Ab4s+dfnBg0sN9h8q/4Wo3vAoe0QCGPze1Q06EVtEPupS+UvLm8iXQmTQ==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "8.0.1", + "System.Threading.Channels": "8.0.0" + } + }, + "Serilog.Exceptions": { + "type": "Direct", + "requested": "[8.4.0, )", + "resolved": "8.4.0", + "contentHash": "nc/+hUw3lsdo0zCj0KMIybAu7perMx79vu72w0za9Nsi6mWyNkGXxYxakAjWB7nEmYL6zdmhEQRB4oJ2ALUeug==", + "dependencies": { + "Serilog": "2.8.0", + "System.Reflection.TypeExtensions": "4.7.0" + } + }, + "Serilog.Sinks.Console": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "fQGWqVMClCP2yEyTXPIinSr5c+CBGUvBybPxjAGcf7ctDhadFhrQw03Mv8rJ07/wR5PDfFjewf2LimvXCDzpbA==", + "dependencies": { + "Serilog": "4.0.0" + } + }, + "Serilog.Sinks.File": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "lxjg89Y8gJMmFxVkbZ+qDgjl+T4yC5F7WSLTvA+5q0R04tfKVLRL/EHpYoJ/MEQd2EeCKDuylBIVnAYMotmh2A==", + "dependencies": { + "Serilog": "4.0.0" + } + }, + "Serilog.Sinks.OpenTelemetry": { + "type": "Direct", + "requested": "[4.0.0, )", + "resolved": "4.0.0", + "contentHash": "M4WKDojg8a+msY5qhNGg5PYZ9ZVelcqipkP/CrfDAOvGCZ3MYj+cGXgnTanffYyIoC2onabaOtydqW6lqT/P/w==", + "dependencies": { + "Google.Protobuf": "3.26.1", + "Grpc.Net.Client": "2.62.0", + "Serilog": "4.0.0" + } + }, + "Speckle.InterfaceGenerator": { + "type": "Direct", + "requested": "[0.9.6, )", + "resolved": "0.9.6", + "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" + }, + "Google.Protobuf": { + "type": "Transitive", + "resolved": "3.26.1", + "contentHash": "CHZX8zXqhF/fdUtd+AYzew8T2HFkAoe5c7lbGxZY/qryAlQXckDvM5BfOJjXlMS7kyICqQTMszj4w1bX5uBJ/w==", + "dependencies": { + "System.Memory": "4.5.3", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" + } + }, + "Grpc": { + "type": "Transitive", + "resolved": "2.44.0", + "contentHash": "9a6FybBPcVMAxSXMTbwYxBmAe7dG+hMMSTrar4lccIXZxUNQM9zMEMzMqih1QTypdLv6udf1+oVOTf11T4c/sQ==", + "dependencies": { + "Grpc.Core": "2.44.0" + } + }, + "Grpc.Core": { + "type": "Transitive", + "resolved": "2.44.0", + "contentHash": "H2rTNePSYeEqUgBBqiE5KZ/yOX7jEtETjWjv4gGtnYxrlpZ79VAHe+4KtZAnt2KJMiGvqTm7eo1SPk+QpiPfaw==", + "dependencies": { + "Grpc.Core.Api": "2.44.0", + "System.Memory": "4.5.3" + } + }, + "Grpc.Core.Api": { + "type": "Transitive", + "resolved": "2.62.0", + "contentHash": "q4Jj6bRZHNnE4CMLqgjiBUCKLit+tRr0simZsS2W6U++akd7CzXByeKy2tddqT68hFzP2XzceXA2YtBTfWtixA==", + "dependencies": { + "System.Memory": "4.5.3" + } + }, + "Grpc.Net.Client": { + "type": "Transitive", + "resolved": "2.62.0", + "contentHash": "C7HxLt+wWPTpPFORRHkxxtDLL+K/jXSmZBaPLhFM8AEkN0bYjklIfCwnzajn1gcbRcEETBb0WnRgHJdVzpwbCg==", + "dependencies": { + "Grpc.Net.Common": "2.62.0", + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.1" + } + }, + "Grpc.Net.Common": { + "type": "Transitive", + "resolved": "2.62.0", + "contentHash": "eBv5I4RPWfdezGXqooU5hs3+XcfVMLk5XDlA4G/Nd9TMX78ZGrFl/lM1Ad187zgBLmH7WPAgfjKRWLBwaa1Wbw==", + "dependencies": { + "Grpc.Core.Api": "2.62.0" + } + }, + "ILRepack": { + "type": "Transitive", + "resolved": "2.0.33", + "contentHash": "xb2h1CsOepoYwdXEPui9VcQglwABQwNf9cccZbf+acarEzF5PUp8Xx71nFXIhOgEdm6wrxAoF6xAxK4m/XFRUQ==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", + "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.Extensions.Configuration": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "0J/9YNXTMWSZP2p2+nvl8p71zpSwokZXZuJW+VjdErkegAnFdO1XlqtA62SJtgVYHdKu3uPxJHcMR/r35HwFBA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==", + "dependencies": { + "Microsoft.Extensions.Primitives": "8.0.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "8.0.1", + "contentHash": "2UKFJnLiBt7Od6nCnTqP9rTIUNhzmn9Hv1l2FchyKbz8xieB9ULwZTbQZMw+M24Qw3F5dzzH1U9PPleN0LNLOQ==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Extensions.Diagnostics.Abstractions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "JHYCQG7HmugNYUhOl368g+NMxYE/N/AiclCYRNlgCY9eVyiBkOHMwK4x60RYMxv9EL3+rmj1mqHvdCiPpC+D4Q==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0", + "System.Buffers": "4.5.1", + "System.Diagnostics.DiagnosticSource": "8.0.0", + "System.Memory": "4.5.5" + } + }, + "Microsoft.Extensions.Logging.Configuration": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "ixXXV0G/12g6MXK65TLngYN9V5hQQRuV+fZi882WIoVJT7h5JvoYoxTEwCgdqwLjSneqh1O+66gM8sMr9z/rsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "8.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Configuration.Binder": "8.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "Microsoft.Extensions.Logging": "8.0.0", + "Microsoft.Extensions.Logging.Abstractions": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "8.0.0" + } + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "JOVOfqpnqlVLUzINQ2fox8evY2SKLYJ3BV8QDe/Jyp21u1T7r45x/R/5QdteURMR5r01GxeJSBBUOCOyaNXA3g==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0", + "System.ComponentModel.Annotations": "5.0.0" + } + }, + "Microsoft.Extensions.Options.ConfigurationExtensions": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "0f4DMRqEd50zQh+UyJc+/HiBsZ3vhAQALgdkcQEalSH1L2isdC7Yj54M3cyo5e+BeO5fcBQ7Dxly8XiBBcvRgw==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "8.0.0", + "Microsoft.Extensions.Configuration.Binder": "8.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0", + "Microsoft.Extensions.Primitives": "8.0.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "1.1.0", + "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, + "OpenTelemetry": { + "type": "Transitive", + "resolved": "1.9.0", + "contentHash": "7scS6BUhwYeSXEDGhCxMSezmvyCoDU5kFQbmfyW9iVvVTcWhec+1KIN33/LOCdBXRkzt2y7+g03mkdAB0XZ9Fw==", + "dependencies": { + "Microsoft.Extensions.Diagnostics.Abstractions": "8.0.0", + "Microsoft.Extensions.Logging.Configuration": "8.0.0", + "OpenTelemetry.Api.ProviderBuilderExtensions": "1.9.0" + } + }, + "OpenTelemetry.Api": { + "type": "Transitive", + "resolved": "1.9.0", + "contentHash": "Xz8ZvM1Lm0m7BbtGBnw2JlPo++YKyMp08zMK5p0mf+cIi5jeMt2+QsYu9X6YEAbjCxBQYwEak5Z8sY6Ig2WcwQ==", + "dependencies": { + "System.Diagnostics.DiagnosticSource": "8.0.0" + } + }, + "OpenTelemetry.Api.ProviderBuilderExtensions": { + "type": "Transitive", + "resolved": "1.9.0", + "contentHash": "L0D4LBR5JFmwLun5MCWVGapsJLV0ANZ+XXu9NEI3JE/HRKkRuUO+J2MuHD5DBwiU//QMYYM4B22oev1hVLoHDQ==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "OpenTelemetry.Api": "1.9.0" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "dMkqfy2el8A8/I76n2Hi1oBFEbG1SfxD2l5nhwXV3XjlnOmwxJlQbYpJH4W51odnU9sARCSAgv7S3CyAFMkpYg==" + }, + "System.Diagnostics.DiagnosticSource": { + "type": "Transitive", + "resolved": "8.0.1", + "contentHash": "vaoWjvkG1aenR2XdjaVivlCV9fADfgyhW5bZtXT23qaEea0lWiUljdQuze4E31vKM7ZWJaSUsbYIKE3rnzfZUg==", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + } + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + }, + "System.Reflection.TypeExtensions": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "4.7.2", + "contentHash": "iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + } + }, + "System.Text.Json": { + "type": "Transitive", + "resolved": "4.7.2", + "contentHash": "TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.1", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Threading.Channels": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "CMaFr7v+57RW7uZfZkPExsPB6ljwzhjACWW1gfU35Y56rk72B/Wu+sTqxVmGSk4SFUlPc3cjeKND0zktziyjBA==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "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" + } + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "8.0.0", + "contentHash": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "8.0.0", + "contentHash": "tvRkov9tAJ3xP51LCv3FJ2zINmv1P8Hi8lhhtcKGqM+ImiTCC84uOPEI4z8Cdq2C3o9e+Aa0Gw0rmrsJD77W+w==", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "Microsoft.Extensions.DependencyInjection": "8.0.0", + "Microsoft.Extensions.Logging.Abstractions": "8.0.0", + "Microsoft.Extensions.Options": "8.0.0", + "System.Diagnostics.DiagnosticSource": "8.0.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "8.0.0", + "contentHash": "arDBqTgFCyS0EvRV7O3MZturChstm50OJ0y9bDJvAcmEPJm0FFpFyjU/JLYyStNGGey081DvnQYlncNX5SJJGA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5" + } + } + } + } +} \ No newline at end of file diff --git a/Sdk/Speckle.Connectors.Tests/ProgressDisplayManagerTests.cs b/Sdk/Speckle.Connectors.Tests/ProgressDisplayManagerTests.cs index 81ab20987..a76fd3260 100644 --- a/Sdk/Speckle.Connectors.Tests/ProgressDisplayManagerTests.cs +++ b/Sdk/Speckle.Connectors.Tests/ProgressDisplayManagerTests.cs @@ -1,6 +1,6 @@ using FluentAssertions; using NUnit.Framework; -using Speckle.Connectors.Utils.Operations; +using Speckle.Connectors.Common.Operations; using Speckle.Sdk.Transports; using Speckle.Testing; diff --git a/Sdk/Speckle.Connectors.Tests/Speckle.Connectors.Tests.csproj b/Sdk/Speckle.Connectors.Tests/Speckle.Connectors.Tests.csproj index 079f7b88d..31f3fd8cf 100644 --- a/Sdk/Speckle.Connectors.Tests/Speckle.Connectors.Tests.csproj +++ b/Sdk/Speckle.Connectors.Tests/Speckle.Connectors.Tests.csproj @@ -16,7 +16,7 @@
- + diff --git a/Sdk/Speckle.Connectors.Tests/packages.lock.json b/Sdk/Speckle.Connectors.Tests/packages.lock.json index 4c2cef4db..f16451831 100644 --- a/Sdk/Speckle.Connectors.Tests/packages.lock.json +++ b/Sdk/Speckle.Connectors.Tests/packages.lock.json @@ -149,54 +149,51 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==" + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } }, "Microsoft.SourceLink.Common": { "type": "Transitive", @@ -253,11 +250,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -288,6 +280,11 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, "System.Configuration.ConfigurationManager": { "type": "Transitive", "resolved": "4.4.0", @@ -316,30 +313,27 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, "System.Security.Cryptography.ProtectedData": { "type": "Transitive", "resolved": "4.4.0", "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==" - }, - "speckle.autofac": { + "speckle.connectors.common": { "type": "Project", "dependencies": { - "Autofac": "[5.2.0, )" + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )", + "Speckle.Sdk": "[3.1.0-dev.145, )" } }, - "speckle.connectors.utils": { - "type": "Project", - "dependencies": { - "Microsoft.Extensions.Logging": "[3.1.0, )", - "Speckle.Autofac": "[1.0.0, )", - "Speckle.Objects": "[3.0.1-rc.118, )", - "Speckle.Sdk": "[3.0.1-rc.118, )" - } + "speckle.connectors.logging": { + "type": "Project" }, "speckle.testing": { "type": "Project", @@ -348,49 +342,58 @@ "NUnit": "[4.1.0, )" } }, + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" + } + }, "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Sdk/Speckle.Connectors.Utils/Common/AssemblyExtensions.cs b/Sdk/Speckle.Connectors.Utils/Common/AssemblyExtensions.cs deleted file mode 100644 index 831f421af..000000000 --- a/Sdk/Speckle.Connectors.Utils/Common/AssemblyExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Reflection; - -namespace Speckle.Connectors.Utils.Common; - -public static class AssemblyExtensions -{ - public static string GetVersion(this Assembly assembly) - { - try - { - var informationalVersion = - assembly.GetCustomAttribute()?.InformationalVersion ?? "No version"; - if (!string.IsNullOrEmpty(informationalVersion)) - { - return informationalVersion; - } - } -#pragma warning disable CA1031 - catch (Exception) -#pragma warning restore CA1031 - { - // Note: on full .NET FX, checking the AssemblyInformationalVersionAttribute could throw an exception, - // therefore this method uses a try/catch to make sure this method always returns a value - } - - return assembly.GetName().Version?.ToString() ?? "No version"; - } -} diff --git a/Sdk/Speckle.Connectors.Utils/Common/SpeckleLoggerFactory.cs b/Sdk/Speckle.Connectors.Utils/Common/SpeckleLoggerFactory.cs deleted file mode 100644 index f0ea8e28d..000000000 --- a/Sdk/Speckle.Connectors.Utils/Common/SpeckleLoggerFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.Extensions.Logging; -using Speckle.Sdk.Logging; - -namespace Speckle.Connectors.Utils.Common; - -public sealed class SpeckleLoggerFactory : ILoggerFactory -{ - public void Dispose() { } - - public ILogger CreateLogger(string categoryName) => new SpeckleLogger(SpeckleLog.Create(categoryName)); - - public void AddProvider(ILoggerProvider provider) => throw new NotImplementedException(); -} diff --git a/Sdk/Speckle.Connectors.Utils/Connector.cs b/Sdk/Speckle.Connectors.Utils/Connector.cs deleted file mode 100644 index eb68dca53..000000000 --- a/Sdk/Speckle.Connectors.Utils/Connector.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Speckle.Objects.Geometry; -using Speckle.Sdk; -using Speckle.Sdk.Host; -using Speckle.Sdk.Logging; -using Speckle.Sdk.Models; - -namespace Speckle.Connectors.Utils; - -public static class Connector -{ - public static readonly string TabName = "Speckle"; - public static readonly string TabTitle = "Speckle (Beta)"; - - public static HostAppVersion Version { get; private set; } = HostAppVersion.v3; - public static string VersionString { get; private set; } = string.Empty; - public static string Name => HostApp.Name; - public static string Slug => HostApp.Slug; - - public static HostApplication HostApp { get; private set; } - - public static IDisposable? Initialize(HostApplication application, HostAppVersion version) - { - Version = version; - VersionString = HostApplications.GetVersion(version); - HostApp = application; - TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); - -#if DEBUG || LOCAL - var config = new SpeckleConfiguration( - application, - version, - new(MinimumLevel: SpeckleLogLevel.Information, Console: true, File: new(Path: "SpeckleCoreLog.txt")), - new(Console: false, Otel: new()) - ); -#else - var config = new SpeckleConfiguration( - application, - version, - new( - MinimumLevel: SpeckleLogLevel.Information, - Console: false, - File: new(Path: "SpeckleCoreLog.txt"), - Otel: new( - Endpoint: "https://seq-dev.speckle.systems/ingest/otlp/v1/logs", - Headers: new() { { "X-Seq-ApiKey", "y5YnBp12ZE1Czh4tzZWn" } } - ) - ), - new( - Console: false, - Otel: new( - Endpoint: "https://seq-dev.speckle.systems/ingest/otlp/v1/traces", - Headers: new() { { "X-Seq-ApiKey", "y5YnBp12ZE1Czh4tzZWn" } } - ) - ) - ); -#endif - return Setup.Initialize(config); - } -} diff --git a/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs b/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs deleted file mode 100644 index a66cd5c8c..000000000 --- a/Sdk/Speckle.Connectors.Utils/ContainerRegistration.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Reflection; -using Autofac; -using Microsoft.Extensions.Logging; -using Speckle.Autofac.DependencyInjection; -using Speckle.Connectors.Utils.Cancellation; -using Speckle.Connectors.Utils.Common; -using Speckle.Connectors.Utils.Operations; - -namespace Speckle.Connectors.Utils; - -public static class ContainerRegistration -{ - public static void AddConnectorUtils(this SpeckleContainerBuilder builder) - { - // send operation and dependencies - builder.AddSingleton(); - builder.AddScoped(); - builder.AddSingleton(); - builder.ScanAssembly(Assembly.GetExecutingAssembly()); - - builder.AddSingleton(new SpeckleLoggerFactory()); - builder.ContainerBuilder.RegisterGeneric(typeof(Logger<>)).As(typeof(ILogger<>)).SingleInstance(); - } -} diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs b/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs deleted file mode 100644 index 928c1f2f9..000000000 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/ContainerRegistration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common.DependencyInjection.ToHost; -using Speckle.Converters.Common.Objects; - -namespace Speckle.Converters.Common.DependencyInjection; - -public static class ContainerRegistration -{ - public static void AddRootCommon(this SpeckleContainerBuilder builder) - where TRootToSpeckleConverter : class, IRootToSpeckleConverter - { - builder.AddScoped(); - /* - POC: CNX-9267 Moved the Injection of converters into the converter module. Not sure if this is 100% right, as this doesn't just register the conversions within this converter, but any conversions found in any Speckle.*.dll file. - This will require consolidating across other connectors. - */ - builder.AddScoped, Factory>(); - builder.AddScoped< - IConverterResolver, - ConverterResolver - >(); - - builder.AddScoped, Factory>(); - builder.AddScoped, ConverterResolver>(); - - builder.AddScoped(); - builder.AddScoped(); //Register as self, only the `ConverterWithFallback` needs it - - builder.InjectNamedTypes(); - builder.InjectNamedTypes(); - } - - public static void AddApplicationConverters( - this SpeckleContainerBuilder builder - ) - where THostToSpeckleUnitConverter : class, IHostToSpeckleUnitConverter - { - builder.AddScoped, THostToSpeckleUnitConverter>(); - builder.RegisterRawConversions(); - } -} diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs b/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs deleted file mode 100644 index ab546753e..000000000 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/NamedTypeInjector.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System.Reflection; -using Autofac; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common.Objects; - -namespace Speckle.Converters.Common.DependencyInjection; - -public static class ConversionTypesInjector -{ - public static void InjectNamedTypes(this SpeckleContainerBuilder containerBuilder) - where T : notnull - { - var types = containerBuilder.SpeckleTypes.Where(x => x.GetInterfaces().Contains(typeof(T))); - - // we only care about named types - var byName = types - .Where(x => x.GetCustomAttribute() != null) - .Select(x => - { - var nameAndRank = x.GetCustomAttribute(); - - return (name: nameAndRank.Name, rank: nameAndRank.Rank, type: x); - }) - .ToList(); - - // we'll register the types accordingly - 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(); - - // 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(); - - // 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); - // POC: should we explode if no found? - if (secondaryType != null) - { - containerBuilder - .ContainerBuilder.RegisterType(first.type) - .As(secondaryType) - .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies) - .InstancePerLifetimeScope(); - } - - // register subsequent types with rank - namedTypes.RemoveAt(0); - foreach (var other in namedTypes) - { - // POC: is this the right scope? - containerBuilder - .ContainerBuilder.RegisterType(other.type) - .Keyed($"{other.name}|{other.rank}") - .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() - // NOT very DRY - 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(); - } - } - } - } -} diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs b/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs deleted file mode 100644 index 73745af1f..000000000 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/RawConversionRegisterer.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Autofac; -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common.Objects; - -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 RawConversionRegisterer -{ - public static void RegisterRawConversions(this SpeckleContainerBuilder containerBuilder) - { - // POC: hard-coding speckle... :/ - foreach (Type speckleType in containerBuilder.SpeckleTypes) - { - RegisterRawConversionsForType(containerBuilder.ContainerBuilder, speckleType); - } - } - - private static void RegisterRawConversionsForType(ContainerBuilder containerBuilder, Type type) - { - if (!type.IsClass || type.IsAbstract) - { - return; - } - - var rawConversionInterfaces = type.GetInterfaces() - .Where(it => it.IsGenericType && it.GetGenericTypeDefinition() == typeof(ITypedConverter<,>)); - - foreach (var conversionInterface in rawConversionInterfaces) - { - containerBuilder - .RegisterType(type) - .As(conversionInterface) - .PropertiesAutowired(PropertyWiringOptions.AllowCircularDependencies) - .InstancePerLifetimeScope(); - } - } -} diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj b/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj deleted file mode 100644 index 867619548..000000000 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/Speckle.Converters.Common.DependencyInjection.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - netstandard2.0 - Debug;Release;Local - - - - - - - - - - - - diff --git a/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs b/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs new file mode 100644 index 000000000..5b7e9de92 --- /dev/null +++ b/Sdk/Speckle.Converters.Common.Tests/ConverterManagerTests.cs @@ -0,0 +1,59 @@ +using System.Collections.Concurrent; +using FluentAssertions; +using Microsoft.Extensions.DependencyInjection; +using NUnit.Framework; +using Speckle.Converters.Common.Registration; + +namespace Speckle.Converters.Common.Tests; + +public class ConverterManagerTests +{ + private sealed class TestConverter + { + public string TestString { get; set; } + } + + private ConverterManager SetupManager(string testString, Type targetType) + { + var serviceCollection = new ServiceCollection(); + serviceCollection.AddTransient(); + var converterTypes = new ConcurrentDictionary(); + converterTypes.TryAdd(testString, targetType); + + var sut = new ConverterManager(converterTypes, serviceCollection.BuildServiceProvider()); + + return sut; + } + + [Test] + public void Test_Null() + { + var sut = SetupManager("Test", typeof(TestConverter)); + var converter = sut.ResolveConverter(typeof(string), false); + converter.Should().BeNull(); + } + + [Test] + public void Test_NoFallback() + { + var sut = SetupManager("String", typeof(TestConverter)); + var converter = sut.ResolveConverter(typeof(string), false); + converter.Should().NotBeNull(); + } + + [Test] + public void Test_Fallback() + { + var sut = SetupManager("Object", typeof(TestConverter)); + var converter = sut.ResolveConverter(typeof(string), true); + converter.Should().NotBeNull(); + } + + [Test] + public void Test_Fallback_Null() + { + var sut = SetupManager("Object", typeof(TestConverter)); + var converter = sut.ResolveConverter(typeof(string), false); + converter.Should().BeNull(); + } +} diff --git a/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj b/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj new file mode 100644 index 000000000..2ac4829fd --- /dev/null +++ b/Sdk/Speckle.Converters.Common.Tests/Speckle.Converters.Common.Tests.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + false + true + Debug;Release;Local + + + + + + + + + + + + + + + + diff --git a/Sdk/Speckle.Connectors.Utils/packages.lock.json b/Sdk/Speckle.Converters.Common.Tests/packages.lock.json similarity index 54% rename from Sdk/Speckle.Connectors.Utils/packages.lock.json rename to Sdk/Speckle.Converters.Common.Tests/packages.lock.json index 8ea9a69b4..3d9dc7029 100644 --- a/Sdk/Speckle.Connectors.Utils/packages.lock.json +++ b/Sdk/Speckle.Converters.Common.Tests/packages.lock.json @@ -1,26 +1,39 @@ { "version": 2, "dependencies": { - ".NETStandard,Version=v2.0": { - "Autofac": { + "net8.0": { + "altcover": { "type": "Direct", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[8.8.173, )", + "resolved": "8.8.173", + "contentHash": "iejmqWdC9H9ShTtsT7vSLpZ74RG4sDhheW7wllczXWl6WZAaCqGXMFGRRHi8TZGCzV/7Ah5gjXZ4GRlfAef4Eg==" + }, + "FluentAssertions": { + "type": "Direct", + "requested": "[6.12.0, )", + "resolved": "6.12.0", + "contentHash": "ZXhHT2YwP9lajrwSKbLlFqsmCCvFJMoRSK9t7sImfnCyd0OB3MhgxdoMcVqxbq1iyxD6mD2fiackWmBb7ayiXQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "System.Configuration.ConfigurationManager": "4.4.0" } }, - "Microsoft.Extensions.Logging": { + "Microsoft.Extensions.DependencyInjection": { "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.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.TestPlatform.TestHost": "17.10.0" } }, "Microsoft.SourceLink.GitHub": { @@ -33,15 +46,33 @@ "Microsoft.SourceLink.Common": "8.0.0" } }, - "NETStandard.Library": { + "Moq": { "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "requested": "[4.20.70, )", + "resolved": "4.20.70", + "contentHash": "4rNnAwdpXJBuxqrOCzCyICXHSImOTRktCgCWXWykuF1qwoIsVvEnR7PjbMk/eLOxWvhmj5Kwt+kDV3RGUYcNwg==", "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" + "Castle.Core": "5.1.1" } }, + "NUnit": { + "type": "Direct", + "requested": "[4.1.0, )", + "resolved": "4.1.0", + "contentHash": "MT/DpAhjtiytzhTgTqIhBuWx4y26PKfDepYUHUM+5uv4TsryHC2jwFo5e6NhWkApCm/G6kZ80dRjdJFuAxq3rg==" + }, + "NUnit.Analyzers": { + "type": "Direct", + "requested": "[4.2.0, )", + "resolved": "4.2.0", + "contentHash": "4fJojPkzdoa4nB2+p6U+fITvPnVvwWSnsmiJ/Dl30xqiL3oxNbYvfeSLVd91hOmEjoUqSwN3Z7j1aFedjqWbUA==" + }, + "NUnit3TestAdapter": { + "type": "Direct", + "requested": "[4.6.0, )", + "resolved": "4.6.0", + "contentHash": "R7e1+a4vuV/YS+ItfL7f//rG+JBvVeVLX4mHzFEZo4W1qEKl8Zz27AqvQSAqo+BtIzUCo4aAJMYa56VXS4hudw==" + }, "PolySharp": { "type": "Direct", "requested": "[1.14.1, )", @@ -54,31 +85,12 @@ "resolved": "0.9.6", "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" }, - "Speckle.Objects": { - "type": "Direct", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "Castle.Core": { + "type": "Transitive", + "resolved": "5.1.1", + "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" - } - }, - "Speckle.Sdk": { - "type": "Direct", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", - "dependencies": { - "GraphQL.Client": "6.0.0", - "Microsoft.CSharp": "4.7.0", - "Microsoft.Data.Sqlite": "7.0.7", - "Polly": "7.2.3", - "Polly.Contrib.WaitAndRetry": "1.1.1", - "Polly.Extensions.Http": "3.0.0", - "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "System.Diagnostics.EventLog": "6.0.0" } }, "GraphQL.Client": { @@ -112,19 +124,16 @@ "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", @@ -149,75 +158,78 @@ }, "Microsoft.Extensions.Configuration": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" } }, "Microsoft.Extensions.Configuration.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "ESz6bVoDQX7sgWdKHF6G9Pq672T8k+19AFb/txDXwdz7MoqaNQj2/in3agm/3qae9V+WvQZH86LLTNVo0it8vQ==", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", "dependencies": { - "Microsoft.Extensions.Primitives": "3.1.0" + "Microsoft.Extensions.Primitives": "2.2.0" } }, "Microsoft.Extensions.Configuration.Binder": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" + "Microsoft.Extensions.Configuration": "2.2.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "44rDtOf1JXXAFpNT2EXMExaDm/4OJ2RXOL9i9lE4bK427nzC7Exphv+beB6IgluyE2GIoo8zezTStMXI7MQ8WA==" + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "9b6JHY7TAXrSfZ6EEGf+j8XnqKIiMPErfmaNXhJYSCb+BUW2H4RtzkNJvwLJzwgzqBP0wtTjyA6Uw4BPPdmkMw==", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Primitives": "3.1.0", - "System.ComponentModel.Annotations": "4.7.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" } }, "Microsoft.Extensions.Primitives": { "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "LEKAnX7lhUhSoIc2XraCTK3M4IU/LdVUzCe464Sa4+7F4ZJuXHHRzZli2mDbiT4xzAZhgqXbvfnb5+CNDcQFfg==", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", "dependencies": { - "System.Memory": "4.5.2", - "System.Runtime.CompilerServices.Unsafe": "4.7.0" + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" } }, - "Microsoft.NETCore.Platforms": { + "Microsoft.SourceLink.Common": { "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" }, - "Microsoft.NETCore.Targets": { + "Microsoft.TestPlatform.ObjectModel": { "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" + "resolved": "17.10.0", + "contentHash": "KkwhjQevuDj0aBRoPLY6OLAhGqbPUEBuKLbaCs0kUVw29qiOYncdORd4mLVJbn9vGZ7/iFGQ/+AoJl0Tu5Umdg==", + "dependencies": { + "System.Reflection.Metadata": "1.6.0" + } }, - "Microsoft.SourceLink.Common": { + "Microsoft.TestPlatform.TestHost": { "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + "resolved": "17.10.0", + "contentHash": "LWpMdfqhHvcUkeMCvNYJO8QlPLlYz9XPPb+ZbaXIKhdmjAV0wqTSrTiW5FLaf7RRZT50AQADDOYMOe0HxDxNgA==", + "dependencies": { + "Microsoft.TestPlatform.ObjectModel": "17.10.0", + "Newtonsoft.Json": "13.0.1" + } + }, + "Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.1", + "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" }, "Polly": { "type": "Transitive", @@ -247,11 +259,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -282,104 +289,107 @@ "SQLitePCLRaw.core": "2.1.4" } }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, "System.ComponentModel.Annotations": { "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "0YFqjhp/mYkDGpU0Ye1GjE53HMp9UVfGN7seGpAMttAC0C40v5gw598jCgpbBLMmCo0E5YRLBv5Z2doypO49ZQ==" + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, - "System.Memory": { + "System.Configuration.ConfigurationManager": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.4.0", + "contentHash": "gWwQv/Ug1qWJmHCmN17nAbxJYmQBM/E94QxKLksvUiiKB1Ld3Sc/eK1lgmbSjDFxkQhVuayI/cGFZhpBSodLrg==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Security.Cryptography.ProtectedData": "4.4.0" } }, - "System.Numerics.Vectors": { + "System.Diagnostics.EventLog": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "6.0.0", + "contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==" + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" }, "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" - } + "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" }, - "System.Runtime": { + "System.Reflection.Metadata": { "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": "1.6.0", + "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" }, - "System.Runtime.InteropServices.WindowsRuntime": { + "System.Security.Cryptography.ProtectedData": { "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "J4GUi3xZQLUBasNwZnjrffN8i5wpHrBtZoLG+OhRyGo/+YunMRWWtwoMDlUAIdmX0uRfpHIBDSV6zyr3yf00TA==", - "dependencies": { - "System.Runtime": "4.3.0" - } + "resolved": "4.4.0", + "contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog==" }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "5.0.1", - "contentHash": "KmJ+CJXizDofbq6mpqDoRRLcxgOd2z9X3XoFNULSbvbqVRZkFX3istvr+MUjL6Zw1RT+RNdoI4GYidIINtgvqQ==", + "speckle.converters.common": { + "type": "Project", "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.145, )" } }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==", + "speckle.testing": { + "type": "Project", "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" + "Moq": "[4.20.70, )", + "NUnit": "[4.1.0, )" } }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, - "speckle.autofac": { - "type": "Project", + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Autofac": "[5.2.0, )" + "Speckle.Sdk": "3.1.0-dev.145" } }, - "Microsoft.Extensions.Logging.Abstractions": { + "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", + "Polly": "7.2.3", + "Polly.Contrib.WaitAndRetry": "1.1.1", + "Polly.Extensions.Http": "3.0.0", + "Speckle.DoubleNumerics": "4.0.1", + "Speckle.Newtonsoft.Json": "13.0.2" + } } } } diff --git a/Sdk/Speckle.Converters.Common/ContextWrapper.cs b/Sdk/Speckle.Converters.Common/ContextWrapper.cs deleted file mode 100644 index 97d77a338..000000000 --- a/Sdk/Speckle.Converters.Common/ContextWrapper.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Speckle.Converters.Common; - -public class ContextWrapper : IDisposable - where TDocument : class -{ - private IConversionContextStack? _stack; - - public IConversionContext? Context { get; private set; } - - public ContextWrapper(IConversionContextStack stack) - { - _stack = stack; - Context = _stack.Current; - } - - protected virtual void Dispose(bool disposing) - { - if (disposing && _stack != null) - { - // technically we could be popping something not this but throwing in dispose is bad - _stack.Pop(); - _stack = null; - Context = null; - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -} diff --git a/Sdk/Speckle.Converters.Common/ConversionContext.cs b/Sdk/Speckle.Converters.Common/ConversionContext.cs deleted file mode 100644 index 5fafa4046..000000000 --- a/Sdk/Speckle.Converters.Common/ConversionContext.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Speckle.InterfaceGenerator; - -namespace Speckle.Converters.Common; - -// POC: record? -[GenerateAutoInterface] -public class ConversionContext : IConversionContext - where TDocument : class -{ - public ConversionContext(TDocument doc, string speckleUnits) - { - Document = doc; - SpeckleUnits = speckleUnits; - } - - public TDocument Document { get; } - public string SpeckleUnits { get; private set; } -} diff --git a/Sdk/Speckle.Converters.Common/ConversionContextStack.cs b/Sdk/Speckle.Converters.Common/ConversionContextStack.cs deleted file mode 100644 index 8de8e7f49..000000000 --- a/Sdk/Speckle.Converters.Common/ConversionContextStack.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Speckle.InterfaceGenerator; - -namespace Speckle.Converters.Common; - -// POC: Suppressed naming warning for now, but we should evaluate if we should follow this or disable it. -[SuppressMessage( - "Naming", - "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`" -)] -[GenerateAutoInterface] -public abstract class ConversionContextStack : IConversionContextStack - where TDocument : class -{ - private readonly IHostToSpeckleUnitConverter _unitConverter; - private readonly TDocument _document; - - protected ConversionContextStack( - TDocument document, - THostUnit hostUnit, - IHostToSpeckleUnitConverter unitConverter - ) - { - _document = document; - _unitConverter = unitConverter; - - _stack.Push(new ConversionContext(_document, _unitConverter.ConvertOrThrow(hostUnit))); - } - - private readonly Stack> _stack = new(); - - public IConversionContext Current => _stack.Peek(); - - public ContextWrapper Push(string speckleUnit) - { - var context = new ConversionContext(_document, speckleUnit); - _stack.Push(context); - return new ContextWrapper(this); - } - - public ContextWrapper Push(THostUnit hostUnit) - { - return Push(_unitConverter.ConvertOrThrow(hostUnit)); - } - - public void Pop() => _stack.Pop(); -} diff --git a/Sdk/Speckle.Converters.Common/ConverterSettingsStore.cs b/Sdk/Speckle.Converters.Common/ConverterSettingsStore.cs new file mode 100644 index 000000000..979487427 --- /dev/null +++ b/Sdk/Speckle.Converters.Common/ConverterSettingsStore.cs @@ -0,0 +1,31 @@ +namespace Speckle.Converters.Common; + +public sealed class ConverterSettingsStore : IConverterSettingsStore + where T : class +{ + private readonly Stack _stack = new(); + + public T Current => _stack.Peek(); + + public IDisposable Push(Func nextContext) + { + _stack.Push(nextContext(Current)); + return new ContextWrapper(this); + } + + public void Initialize(T context) + { + if (_stack.Count != 0) + { + throw new ArgumentException("Already initialized"); + } + _stack.Push(context); + } + + private sealed class ContextWrapper(ConverterSettingsStore store) : IDisposable + { + public void Dispose() => + // technically we could be popping something not this but throwing in dispose is bad + store._stack.Pop(); + } +} diff --git a/Sdk/Speckle.Converters.Common/IConverterSettingsStore.cs b/Sdk/Speckle.Converters.Common/IConverterSettingsStore.cs new file mode 100644 index 000000000..5b1e96a72 --- /dev/null +++ b/Sdk/Speckle.Converters.Common/IConverterSettingsStore.cs @@ -0,0 +1,9 @@ +namespace Speckle.Converters.Common; + +public interface IConverterSettingsStore + where T : class +{ + T Current { get; } + IDisposable Push(Func nextContext); + void Initialize(T context); +} diff --git a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/LocalToGlobalConverterUtils.cs b/Sdk/Speckle.Converters.Common/LocalToGlobalConverterUtils.cs similarity index 84% rename from Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/LocalToGlobalConverterUtils.cs rename to Sdk/Speckle.Converters.Common/LocalToGlobalConverterUtils.cs index f71f2e708..5eb7044d1 100644 --- a/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/LocalToGlobalConverterUtils.cs +++ b/Sdk/Speckle.Converters.Common/LocalToGlobalConverterUtils.cs @@ -1,14 +1,11 @@ -using Speckle.Converters.Common; -using Speckle.DoubleNumerics; -using Speckle.InterfaceGenerator; +using Speckle.DoubleNumerics; using Speckle.Objects; using Speckle.Sdk.Models; -namespace Speckle.Converters.ArcGIS3.Utils; +namespace Speckle.Converters.Common; // POC: We could pass transformation matrices to converters by default and evaluate there instead as utils. -[GenerateAutoInterface] -public class LocalToGlobalConverterUtils : ILocalToGlobalConverterUtils +public class LocalToGlobalConverterUtils { private Vector3 TransformPt(Vector3 vector, Matrix4x4 matrix) { @@ -28,7 +25,9 @@ public Base TransformObjects(Base atomicObject, List matrix) return atomicObject; } - List transforms = matrix.Select(x => new Objects.Other.Transform(x, "none")).ToList(); + List transforms = matrix + .Select(x => new Speckle.Objects.Other.Transform(x, "none")) + .ToList(); if (atomicObject is ITransformable c) { diff --git a/Sdk/Speckle.Converters.Common/Objects/IToHostTopLevelConverter.cs b/Sdk/Speckle.Converters.Common/Objects/IToHostTopLevelConverter.cs index a801cd92a..41a67f1a9 100644 --- a/Sdk/Speckle.Converters.Common/Objects/IToHostTopLevelConverter.cs +++ b/Sdk/Speckle.Converters.Common/Objects/IToHostTopLevelConverter.cs @@ -2,10 +2,6 @@ namespace Speckle.Converters.Common.Objects; -// POC: NEXT UP -// * begin scope: https://stackoverflow.com/questions/49595198/autofac-resolving-through-factory-methods -// Interceptors? - public interface IToHostTopLevelConverter { object Convert(Base target); diff --git a/Sdk/Speckle.Converters.Common/Objects/IToSpeckleTopLevelConverter.cs b/Sdk/Speckle.Converters.Common/Objects/IToSpeckleTopLevelConverter.cs index b69e04f53..827ae43cd 100644 --- a/Sdk/Speckle.Converters.Common/Objects/IToSpeckleTopLevelConverter.cs +++ b/Sdk/Speckle.Converters.Common/Objects/IToSpeckleTopLevelConverter.cs @@ -2,10 +2,6 @@ namespace Speckle.Converters.Common.Objects; -// POC: NEXT UP -// * begin scope: https://stackoverflow.com/questions/49595198/autofac-resolving-through-factory-methods -// Interceptors? - public interface IToSpeckleTopLevelConverter { Base Convert(object target); diff --git a/Sdk/Speckle.Converters.Common/RecursiveConverterResolver.cs b/Sdk/Speckle.Converters.Common/RecursiveConverterResolver.cs index 0c18169e5..5f282702b 100644 --- a/Sdk/Speckle.Converters.Common/RecursiveConverterResolver.cs +++ b/Sdk/Speckle.Converters.Common/RecursiveConverterResolver.cs @@ -1,27 +1 @@ -using Speckle.Autofac.DependencyInjection; -using Speckle.InterfaceGenerator; - -namespace Speckle.Converters.Common; - -[GenerateAutoInterface] -public sealed class ConverterResolver : IConverterResolver - where TConverter : class -{ - private readonly IFactory _factory; - - public ConverterResolver(IFactory factory) - { - _factory = factory; - } - - public TConverter? GetConversionForType(Type objectType) - { - if (objectType.BaseType == null) - { - //We've reached the top of the inheritance tree - return null; - } - - return _factory.ResolveInstance(objectType.Name) ?? GetConversionForType(objectType.BaseType); - } -} + \ No newline at end of file diff --git a/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs b/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs new file mode 100644 index 000000000..d2afb9beb --- /dev/null +++ b/Sdk/Speckle.Converters.Common/Registration/ConverterManager.cs @@ -0,0 +1,46 @@ +using System.Collections.Concurrent; +using Microsoft.Extensions.DependencyInjection; +using Speckle.InterfaceGenerator; + +namespace Speckle.Converters.Common.Registration; + +[GenerateAutoInterface] +public class ConverterManager(ConcurrentDictionary converterTypes, IServiceProvider serviceProvider) + : IConverterManager +{ + public string Name => typeof(T).Name; + + public T? ResolveConverter(Type type, bool recursive = false) + { + while (true) + { + var typeName = type.Name; + var converter = GetConverterByType(typeName); + if (converter is null && recursive) + { + var baseType = type.BaseType; + if (baseType is not null) + { + type = baseType; + } + else + { + return default; + } + } + else + { + return converter; + } + } + } + + private T? GetConverterByType(string typeName) + { + if (converterTypes.TryGetValue(typeName, out var converter)) + { + return (T)ActivatorUtilities.CreateInstance(serviceProvider, converter); + } + return default; + } +} diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/ToHost/ConverterWithFallback.cs b/Sdk/Speckle.Converters.Common/Registration/ConverterWithFallback.cs similarity index 98% rename from Sdk/Speckle.Converters.Common.DependencyInjection/ToHost/ConverterWithFallback.cs rename to Sdk/Speckle.Converters.Common/Registration/ConverterWithFallback.cs index 235d47584..2e2a9b26a 100644 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/ToHost/ConverterWithFallback.cs +++ b/Sdk/Speckle.Converters.Common/Registration/ConverterWithFallback.cs @@ -5,7 +5,7 @@ using Speckle.Sdk.Models; using Speckle.Sdk.Models.Extensions; -namespace Speckle.Converters.Common.DependencyInjection.ToHost; +namespace Speckle.Converters.Common.Registration; // POC: CNX-9394 Find a better home for this outside `DependencyInjection` project /// diff --git a/Sdk/Speckle.Converters.Common.DependencyInjection/ToHost/ConverterWithoutFallback.cs b/Sdk/Speckle.Converters.Common/Registration/ConverterWithoutFallback.cs similarity index 80% rename from Sdk/Speckle.Converters.Common.DependencyInjection/ToHost/ConverterWithoutFallback.cs rename to Sdk/Speckle.Converters.Common/Registration/ConverterWithoutFallback.cs index 006434499..d53c1fc20 100644 --- a/Sdk/Speckle.Converters.Common.DependencyInjection/ToHost/ConverterWithoutFallback.cs +++ b/Sdk/Speckle.Converters.Common/Registration/ConverterWithoutFallback.cs @@ -4,21 +4,21 @@ using Speckle.Converters.Common.Objects; using Speckle.Sdk.Models; -namespace Speckle.Converters.Common.DependencyInjection.ToHost; +namespace Speckle.Converters.Common.Registration; // POC: CNX-9394 Find a better home for this outside `DependencyInjection` project /// /// Provides an implementation for -/// that resolves a via the injected +/// that resolves a via the injected /// /// public sealed class ConverterWithoutFallback : IRootToHostConverter { - private readonly IConverterResolver _toHost; + private readonly IConverterManager _toHost; private readonly ILogger _logger; public ConverterWithoutFallback( - IConverterResolver converterResolver, + IConverterManager converterResolver, ILogger logger ) { @@ -40,7 +40,7 @@ public object Convert(Base target) internal bool TryGetConverter(Type target, [NotNullWhen(true)] out IToHostTopLevelConverter? result) { // Direct conversion if a converter is found - var objectConverter = _toHost.GetConversionForType(target); + var objectConverter = _toHost.ResolveConverter(target); if (objectConverter != null) { result = objectConverter; diff --git a/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs b/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs new file mode 100644 index 000000000..fb60f29d5 --- /dev/null +++ b/Sdk/Speckle.Converters.Common/Registration/ServiceRegistration.cs @@ -0,0 +1,112 @@ +using System.Collections.Concurrent; +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Common.Objects; + +namespace Speckle.Converters.Common.Registration; + +public static class ServiceRegistration +{ + public static void AddRootCommon( + this IServiceCollection serviceCollection, + Assembly converterAssembly + ) + where TRootToSpeckleConverter : class, IRootToSpeckleConverter + { + serviceCollection.AddScoped(); + /* + POC: CNX-9267 Moved the Injection of converters into the converter module. Not sure if this is 100% right, as this doesn't just register the conversions within this converter, but any conversions found in any Speckle.*.dll file. + This will require consolidating across other connectors. + */ + + + + serviceCollection.AddScoped(); + serviceCollection.AddScoped(); //Register as self, only the `ConverterWithFallback` needs it + + serviceCollection.AddConverters(converterAssembly); + serviceCollection.AddConverters(converterAssembly); + } + + public static IServiceCollection AddApplicationConverters( + this IServiceCollection serviceCollection, + Assembly converterAssembly + ) + where THostToSpeckleUnitConverter : class, IHostToSpeckleUnitConverter + { + serviceCollection.AddScoped, THostToSpeckleUnitConverter>(); + serviceCollection.RegisterRawConversions(converterAssembly); + return serviceCollection; + } + + public static void AddConverters(this IServiceCollection serviceCollection, Assembly converterAssembly) + { + ConcurrentDictionary converterTypes = new(); + var types = converterAssembly.ExportedTypes.Where(x => x.GetInterfaces().Contains(typeof(T))); + + // we only care about named types + var byName = types + .Where(x => x.GetCustomAttribute() != null) + .Select(x => + { + var nameAndRank = x.GetCustomAttribute(); + + return (name: nameAndRank.Name, rank: nameAndRank.Rank, type: x); + }) + .ToList(); + + // we'll register the types accordingly + 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(); + + // first type found + var first = namedTypes[0]; + + // POC: may need to be instance per lifecycle scope + converterTypes.TryAdd(first.name, first.type); + + // 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); + // POC: should we explode if no found? + if (secondaryType != null) + { + converterTypes.TryAdd(first.name, secondaryType); + } + + // register subsequent types with rank + namedTypes.RemoveAt(0); + } + serviceCollection.AddScoped>(sp => new ConverterManager(converterTypes, sp)); + } + + public static void RegisterRawConversions(this IServiceCollection serviceCollection, Assembly conversionAssembly) + { + // POC: hard-coding speckle... :/ + foreach (Type speckleType in conversionAssembly.ExportedTypes) + { + RegisterRawConversionsForType(serviceCollection, speckleType); + } + } + + private static void RegisterRawConversionsForType(IServiceCollection serviceCollection, Type type) + { + if (!type.IsClass || type.IsAbstract) + { + return; + } + + var rawConversionInterfaces = type.GetInterfaces() + .Where(it => it.IsGenericType && it.GetGenericTypeDefinition() == typeof(ITypedConverter<,>)); + + foreach (var conversionInterface in rawConversionInterfaces) + { + serviceCollection.Add(new ServiceDescriptor(conversionInterface, type, ServiceLifetime.Scoped)); + } + } +} diff --git a/Sdk/Speckle.Converters.Common/RootConvertManager.cs b/Sdk/Speckle.Converters.Common/RootConvertManager.cs index 853031c62..e6c83ee98 100644 --- a/Sdk/Speckle.Converters.Common/RootConvertManager.cs +++ b/Sdk/Speckle.Converters.Common/RootConvertManager.cs @@ -1,5 +1,5 @@ -using Speckle.Autofac.DependencyInjection; -using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; using Speckle.InterfaceGenerator; using Speckle.Sdk.Models; @@ -8,9 +8,9 @@ namespace Speckle.Converters.Common; [GenerateAutoInterface] public class RootConvertManager : IRootConvertManager { - private readonly IFactory _toSpeckle; + private readonly IConverterManager _toSpeckle; - public RootConvertManager(IFactory toSpeckle) + public RootConvertManager(IConverterManager toSpeckle) { _toSpeckle = toSpeckle; } @@ -23,7 +23,7 @@ public Base Convert(Type type, object obj) { try { - var objectConverter = _toSpeckle.ResolveInstance(type.Name); //poc: would be nice to have supertypes resolve + var objectConverter = _toSpeckle.ResolveConverter(type); //poc: would be nice to have supertypes resolve if (objectConverter == null) { diff --git a/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs b/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs index 9cb9116f3..90b465161 100644 --- a/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs +++ b/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs @@ -1,5 +1,5 @@ -using Speckle.Autofac.DependencyInjection; using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; using Speckle.InterfaceGenerator; using Speckle.Sdk.Models; @@ -8,9 +8,9 @@ namespace Speckle.Converters.Common; [GenerateAutoInterface] public class RootToSpeckleConverter : IRootToSpeckleConverter { - private readonly IFactory _toSpeckle; + private readonly IConverterManager _toSpeckle; - public RootToSpeckleConverter(IFactory toSpeckle) + public RootToSpeckleConverter(IConverterManager toSpeckle) { _toSpeckle = toSpeckle; } @@ -20,7 +20,7 @@ public Base Convert(object target) Type type = target.GetType(); try { - var objectConverter = _toSpeckle.ResolveInstance(type.Name); //poc: would be nice to have supertypes resolve + var objectConverter = _toSpeckle.ResolveConverter(type); //poc: would be nice to have supertypes resolve if (objectConverter == null) { diff --git a/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj b/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj index 74433bc50..d91cb9c1b 100644 --- a/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj +++ b/Sdk/Speckle.Converters.Common/Speckle.Converters.Common.csproj @@ -7,10 +7,10 @@ - + diff --git a/Sdk/Speckle.Converters.Common/ToHost/ConverterWithFallback.cs b/Sdk/Speckle.Converters.Common/ToHost/ConverterWithFallback.cs new file mode 100644 index 000000000..ba67d9186 --- /dev/null +++ b/Sdk/Speckle.Converters.Common/ToHost/ConverterWithFallback.cs @@ -0,0 +1,81 @@ +using System.Collections; +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common.Extensions; +using Speckle.Converters.Common.Objects; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Extensions; + +namespace Speckle.Converters.Common.ToHost; + +// POC: CNX-9394 Find a better home for this outside `DependencyInjection` project +/// +/// +///
+/// If no suitable converter conversion is found, and the target object has a displayValue property +/// a converter with strong name of is resolved for. +///
+/// +public sealed class ConverterWithFallback : IRootToHostConverter +{ + private readonly ILogger _logger; + private readonly ConverterWithoutFallback _baseConverter; + + public ConverterWithFallback(ConverterWithoutFallback baseConverter, ILogger logger) + { + _logger = logger; + _baseConverter = baseConverter; + } + + /// + /// Converts a instance to a host object. + /// + /// The instance to convert. + /// The converted host object. + /// Fallbacks to display value if a direct conversion is not possible. + /// + /// The conversion is done in the following order of preference: + /// 1. Direct conversion using the . + /// 2. Fallback to display value using the method, if a direct conversion is not possible. + /// + /// If the direct conversion is not available and there is no displayValue, a is thrown. + /// + /// Thrown when no conversion is found for . + public object Convert(Base target) + { + Type type = target.GetType(); + + // Direct conversion if a converter is found + if (_baseConverter.TryGetConverter(type, out IToHostTopLevelConverter? result)) + { + return result.ConvertAndLog(target, _logger); // 1-1 mapping + } + + // Fallback to display value if it exists. + var displayValue = target.TryGetDisplayValue(); + if (displayValue != null) + { + if (displayValue is IList && !displayValue.Any()) + { + throw new NotSupportedException($"No display value found for {type}"); + } + return FallbackToDisplayValue(displayValue); // 1 - many mapping + } + + throw new NotSupportedException($"No conversion found for {type}"); + } + + private object FallbackToDisplayValue(IReadOnlyList displayValue) + { + var tempDisplayableObject = new DisplayableObject(displayValue); + var conversionResult = _baseConverter.Convert(tempDisplayableObject); + + // if the host app returns a list of objects as the result of the fallback conversion, we zip them together with the original base display value objects that generated them. + if (conversionResult is IEnumerable result) + { + return result.Zip(displayValue, (a, b) => (a, b)); + } + + // if not, and the host app "merges" together somehow multiple display values into one entity, we return that. + return conversionResult; + } +} diff --git a/Sdk/Speckle.Converters.Common/ToHost/ConverterWithoutFallback.cs b/Sdk/Speckle.Converters.Common/ToHost/ConverterWithoutFallback.cs new file mode 100644 index 000000000..30cfce795 --- /dev/null +++ b/Sdk/Speckle.Converters.Common/ToHost/ConverterWithoutFallback.cs @@ -0,0 +1,54 @@ +using System.Diagnostics.CodeAnalysis; +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common.Extensions; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk.Models; + +namespace Speckle.Converters.Common.ToHost; + +// POC: CNX-9394 Find a better home for this outside `DependencyInjection` project +/// +/// Provides an implementation for +/// that resolves a via the injected +/// +/// +public sealed class ConverterWithoutFallback : IRootToHostConverter +{ + private readonly IConverterManager _toHost; + private readonly ILogger _logger; + + public ConverterWithoutFallback( + IConverterManager converterResolver, + ILogger logger + ) + { + _toHost = converterResolver; + _logger = logger; + } + + public object Convert(Base target) + { + if (!TryGetConverter(target.GetType(), out IToHostTopLevelConverter? converter)) + { + throw new NotSupportedException($"No conversion found for {target.GetType()}"); + } + + object result = converter.ConvertAndLog(target, _logger); + return result; + } + + internal bool TryGetConverter(Type target, [NotNullWhen(true)] out IToHostTopLevelConverter? result) + { + // Direct conversion if a converter is found + var objectConverter = _toHost.ResolveConverter(target); + if (objectConverter != null) + { + result = objectConverter; + return true; + } + + result = null; + return false; + } +} diff --git a/Sdk/Speckle.Converters.Common/packages.lock.json b/Sdk/Speckle.Converters.Common/packages.lock.json index 43120b924..2cf3d50e4 100644 --- a/Sdk/Speckle.Converters.Common/packages.lock.json +++ b/Sdk/Speckle.Converters.Common/packages.lock.json @@ -4,9 +4,9 @@ ".NETStandard,Version=v2.0": { "Microsoft.Extensions.Logging.Abstractions": { "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "jjo4YXRx6MIpv6DiRxJjSpl+sPP0+5VW0clMEdLyIAz44PPwrDTFrd5PZckIxIXl1kKZ2KK6IL2nkt0+ug2MQg==" + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" }, "Microsoft.SourceLink.GitHub": { "type": "Direct", @@ -41,11 +41,11 @@ }, "Speckle.Objects": { "type": "Direct", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "5VgLOrOMGsdGqZJwZXjyUrLX+kO+wb6qy0nQgDWuHG+aZdPyGmjyLW3YeaCnDQBu/uDJnQu7ddj5LqbIlTif0w==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "gpENXDB2i8SiXJZwrLVfB3BwKF1FHUSpPiw0BQ3Hl0V3821UWZjPYw5XK694oxJlVAeEMRvrMZMGsWOcK+3nMw==", "dependencies": { - "Speckle.Sdk": "3.0.1-rc.118" + "Speckle.Sdk": "3.1.0-dev.145" } }, "GraphQL.Client": { @@ -79,14 +79,6 @@ "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", @@ -114,6 +106,54 @@ "SQLitePCLRaw.core": "2.1.4" } }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, "Microsoft.NETCore.Platforms": { "type": "Transitive", "resolved": "1.1.0", @@ -157,11 +197,6 @@ "resolved": "13.0.2", "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" }, - "Speckle.Sdk.Logging": { - "type": "Transitive", - "resolved": "3.0.1-rc.118", - "contentHash": "rzzJTTlTyeC7O2XOBAGqTrAbd7vk245mXat1v2okqlnEIvoAQj+kiId53v69i+3jv9svoqohkvaWJ2ZD8MkDXA==" - }, "SQLitePCLRaw.bundle_e_sqlite3": { "type": "Transitive", "resolved": "2.1.4", @@ -194,23 +229,28 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", "dependencies": { - "System.Buffers": "4.5.1", + "System.Buffers": "4.4.0", "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Runtime.CompilerServices.Unsafe": "4.5.2" } }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" }, "System.Reactive": { "type": "Transitive", @@ -232,8 +272,8 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" }, "System.Runtime.InteropServices.WindowsRuntime": { "type": "Transitive", @@ -243,29 +283,6 @@ "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" - } - }, "System.Threading.Tasks.Extensions": { "type": "Transitive", "resolved": "4.5.4", @@ -274,37 +291,34 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "speckle.autofac": { - "type": "Project", - "dependencies": { - "Autofac": "[5.2.0, )" - } - }, - "Autofac": { + "Microsoft.Extensions.Logging": { "type": "CentralTransitive", - "requested": "[5.2.0, )", - "resolved": "5.2.0", - "contentHash": "V8dBH0dsv75uDzl7Sw+HkhKDPUw2eXnlMjcSVMH+tLo2s67MpTKGyDj1pDcpR+IF2u4YRs0s3/x7R88YJzIWvg==", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.0.1-rc.118, )", - "resolved": "3.0.1-rc.118", - "contentHash": "cKiVG0LMRmF4vgTWq2L8xOYoTGiAF9n8OyycmWHCdW6l7wLTre6B4AOWtW9j9NA427C3sJmZ4R9dSbNYRLxDRQ==", + "requested": "[3.1.0-dev.145, )", + "resolved": "3.1.0-dev.145", + "contentHash": "YZLtitiVIxl12pNTXaB9gU+paNwFe++WBw6oIN6Rs5hFPialUgeKbpjh16Zq6wcptjBpvg0CHq29+d456QUAJQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", "Microsoft.Data.Sqlite": "7.0.7", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", "Polly": "7.2.3", "Polly.Contrib.WaitAndRetry": "1.1.1", "Polly.Extensions.Http": "3.0.0", "Speckle.DoubleNumerics": "4.0.1", - "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Logging": "3.0.1-rc.118", - "System.Text.Json": "5.0.2" + "Speckle.Newtonsoft.Json": "13.0.2" } } } diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index ff642c611..b08e0767a 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -15,7 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{85A13E README.md = README.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DUI3", "DUI3", "{FD4D6594-D81E-456F-8F2E-35B09E04A755}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DUI", "DUI", "{FD4D6594-D81E-456F-8F2E-35B09E04A755}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Revit", "Revit", "{D92751C8-1039-4005-90B2-913E55E0B8BD}" EndProject @@ -27,15 +27,11 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.RevitSha EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.RevitShared", "Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.shproj", "{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2023.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2023.DependencyInjection\Speckle.Converters.Revit2023.DependencyInjection.csproj", "{83EAD6F0-3CB3-456A-AD81-072127D0DE0E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2023", "Converters\Revit\Speckle.Converters.Revit2023\Speckle.Converters.Revit2023.csproj", "{26391930-F86F-47E0-A5F6-B89919E38CE1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.DUI", "DUI3\Speckle.Connectors.DUI\Speckle.Connectors.DUI.csproj", "{D81C0B87-F0C1-4297-A147-02F001FB7E1E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Autofac", "Sdk\Speckle.Autofac\Speckle.Autofac.csproj", "{C9D4CA21-182B-4ED2-81BB-280A6FD713F6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Utils", "Sdk\Speckle.Connectors.Utils\Speckle.Connectors.Utils.csproj", "{7291B93C-615D-42DE-B8C1-3F9DF643E0FC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Common", "Sdk\Speckle.Connectors.Common\Speckle.Connectors.Common.csproj", "{7291B93C-615D-42DE-B8C1-3F9DF643E0FC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common", "Sdk\Speckle.Converters.Common\Speckle.Converters.Common.csproj", "{8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434}" EndProject @@ -45,30 +41,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Rhino7", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino7", "Converters\Rhino\Speckle.Converters.Rhino7\Speckle.Converters.Rhino7.csproj", "{65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino7.DependencyInjection", "Converters\Rhino\Speckle.Converters.Rhino7.DependencyInjection\Speckle.Converters.Rhino7.DependencyInjection.csproj", "{9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.ArcGIS3", "Connectors\ArcGIS\Speckle.Connectors.ArcGIS3\Speckle.Connectors.ArcGIS3.csproj", "{A97F7177-86C7-4B38-A6ED-DA51BF762471}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.ArcGIS3", "Converters\ArcGIS\Speckle.Converters.ArcGIS3\Speckle.Converters.ArcGIS3.csproj", "{139F7A79-69E4-4B8A-B2A5-6A30A66C495C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.ArcGIS3.DependencyInjection", "Converters\ArcGIS\Speckle.Converters.ArcGIS3.DependencyInjection\Speckle.Converters.ArcGIS3.DependencyInjection.csproj", "{7DFF1591-237D-499E-A767-EE37B93FB958}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ArcGIS", "ArcGIS", "{CCF48B65-33D1-4E8B-A57B-E03394730B21}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2023", "Connectors\Autocad\Speckle.Connectors.Autocad2023\Speckle.Connectors.Autocad2023.csproj", "{89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.AutocadShared", "Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.shproj", "{41BC679F-887F-44CF-971D-A5502EE87DB0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common.DependencyInjection", "Sdk\Speckle.Converters.Common.DependencyInjection\Speckle.Converters.Common.DependencyInjection.csproj", "{11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Autocad", "Autocad", "{804E065F-914C-414A-AF84-009312C3CFF6}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.AutocadShared", "Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.shproj", "{9ADD1B7A-6401-4202-8613-F668E2FBC0A4}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023", "Converters\Autocad\Speckle.Converters.Autocad2023\Speckle.Converters.Autocad2023.csproj", "{631C295A-7CCF-4B42-8686-7034E31469E7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2023.DependencyInjection", "Converters\Autocad\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\Speckle.Connectors.DUI.WebView\Speckle.Connectors.DUI.WebView.csproj", "{7420652C-3046-4F38-BE64-9B9E69D76FA2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build\Build.csproj", "{C50AA3E3-8C31-4131-9DEC-1D8B377D5A89}" @@ -85,22 +73,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Civil3d2 EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.Civil3dShared", "Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.shproj", "{35175682-DA83-4C0A-A49D-B191F5885D8E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2024.DependencyInjection", "Converters\Civil3d\Speckle.Converters.Civil3d2024.DependencyInjection\Speckle.Converters.Civil3d2024.DependencyInjection.csproj", "{80F965C4-E2A8-4F54-985D-73D06E45F9CE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2022", "Connectors\Autocad\Speckle.Connectors.Autocad2022\Speckle.Connectors.Autocad2022.csproj", "{BBF2C19E-221E-4AA0-8521-FE75D8F4A2B0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2022", "Converters\Autocad\Speckle.Converters.Autocad2022\Speckle.Converters.Autocad2022.csproj", "{5505B953-D434-49CE-8EBD-EFD7B3C378F7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2022.DependencyInjection", "Converters\Autocad\Speckle.Converters.Autocad2022.DependencyInjection\Speckle.Converters.Autocad2022.DependencyInjection.csproj", "{0C52E062-9C77-4245-914C-CB617B6D808A}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.AutocadShared.DependencyInjection", "Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.shproj", "{6E7D959F-8383-4DC2-BFC2-FCEA4ECC60B3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2024", "Connectors\Autocad\Speckle.Connectors.Autocad2024\Speckle.Connectors.Autocad2024.csproj", "{9166CC10-12E1-4A0F-916B-61F6F2004F5A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024", "Converters\Autocad\Speckle.Converters.Autocad2024\Speckle.Converters.Autocad2024.csproj", "{C2DE264A-AA87-4012-B954-17E3F403A237}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2024.DependencyInjection", "Converters\Autocad\Speckle.Converters.Autocad2024.DependencyInjection\Speckle.Converters.Autocad2024.DependencyInjection.csproj", "{AF507D61-6766-4C20-9F58-23DC29508219}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2024", "Converters\Civil3d\Speckle.Converters.Civil3d2024\Speckle.Converters.Civil3d2024.csproj", "{25172C49-7AA4-4739-BB07-69785094C379}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.RhinoShared", "Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.shproj", "{E1C43415-3200-45F4-8BF9-A4DD7D7F2ED9}" @@ -111,14 +91,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit202 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Testing", "Sdk\Speckle.Testing\Speckle.Testing.csproj", "{A3869243-B462-4986-914B-94E407D8D20F}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.RevitShared.DependencyInjection", "Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.shproj", "{6067BA60-D279-4156-8AE1-6B44E2D19187}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Revit2024", "Connectors\Revit\Speckle.Connectors.Revit2024\Speckle.Connectors.Revit2024.csproj", "{617BD3C7-87D9-4D28-8AC9-4910945BB9FC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2024", "Converters\Revit\Speckle.Converters.Revit2024\Speckle.Converters.Revit2024.csproj", "{67B888D9-C6C4-49F1-883C-5B964151D889}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2024.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2024.DependencyInjection\Speckle.Converters.Revit2024.DependencyInjection.csproj", "{7F3055BA-70AA-424C-8748-345AF35127E9}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2023", "2023", "{E9DEBA00-50A4-485D-BA65-D8AB3E3467AB}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2024", "2024", "{57F59C0C-5687-4AF9-AE1C-1933B539F0E4}" @@ -137,14 +113,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Revit202 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2025", "Converters\Revit\Speckle.Converters.Revit2025\Speckle.Converters.Revit2025.csproj", "{4D40A101-07E6-4FF2-8934-83434932591D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2025.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2025.DependencyInjection\Speckle.Converters.Revit2025.DependencyInjection.csproj", "{20751904-0DFC-4126-BF2A-834B53841010}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Revit2022", "Connectors\Revit\Speckle.Connectors.Revit2022\Speckle.Connectors.Revit2022.csproj", "{7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2022", "Converters\Revit\Speckle.Converters.Revit2022\Speckle.Converters.Revit2022.csproj", "{19424B55-058C-4E9C-B86F-700AEF9EAEC3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Revit2022.DependencyInjection", "Converters\Revit\Speckle.Converters.Revit2022.DependencyInjection\Speckle.Converters.Revit2022.DependencyInjection.csproj", "{881D71A3-D276-4108-98C6-0FFD32129B9C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2022", "2022", "{0AF38BA3-65A0-481B-8CBB-B82E406E1575}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.DUI.Tests", "DUI3\Speckle.Connectors.DUI.Tests\Speckle.Connectors.DUI.Tests.csproj", "{EB83A3A3-F9B6-4281-8EBF-F7289FB5D885}" @@ -171,20 +143,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Rhino8", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino8", "Converters\Rhino\Speckle.Converters.Rhino8\Speckle.Converters.Rhino8.csproj", "{56A909AE-6E99-4D4D-A22E-38BDC5528B8E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Rhino8.DependencyInjection", "Converters\Rhino\Speckle.Converters.Rhino8.DependencyInjection\Speckle.Converters.Rhino8.DependencyInjection.csproj", "{57DDFD85-D76C-4762-97EE-B2C1ED5C71BB}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2022", "2022", "{52D71CA4-AE77-4DD4-9456-1E1489413607}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2025", "2025", "{B2BF1FAE-D0F4-4961-84CB-A00D3CABD236}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Autocad2025", "Connectors\Autocad\Speckle.Connectors.Autocad2025\Speckle.Connectors.Autocad2025.csproj", "{C70EBB84-BA5B-4F2F-819E-25E0985BA13C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2025.DependencyInjection", "Converters\Autocad\Speckle.Converters.Autocad2025.DependencyInjection\Speckle.Converters.Autocad2025.DependencyInjection.csproj", "{A6FB3066-5BB1-4CFA-B63D-E4B4B6A5C3F4}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Autocad2025", "Converters\Autocad\Speckle.Converters.Autocad2025\Speckle.Converters.Autocad2025.csproj", "{9D66EDE4-AFC2-4F00-B40C-A7E878A2972F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Tests", "Sdk\Speckle.Connectors.Tests\Speckle.Connectors.Tests.csproj", "{5B9A550A-9314-4E91-884E-E54960F589FB}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.Logging", "Sdk\Speckle.Connectors.Logging\Speckle.Connectors.Logging.csproj", "{8098BAFC-DF1C-4AFA-A93E-08121E6D09D4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Common.Tests", "Sdk\Speckle.Converters.Common.Tests\Speckle.Converters.Common.Tests.csproj", "{9EF292C6-1333-4502-AD9C-224D99847185}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -195,10 +167,6 @@ Global {01F98733-7352-47AD-A594-537D979DE3DE}.Debug|Any CPU.Build.0 = Debug|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Release|Any CPU.ActiveCfg = Release|Any CPU {01F98733-7352-47AD-A594-537D979DE3DE}.Release|Any CPU.Build.0 = Release|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E}.Release|Any CPU.Build.0 = Release|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {26391930-F86F-47E0-A5F6-B89919E38CE1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -207,10 +175,6 @@ Global {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU {D81C0B87-F0C1-4297-A147-02F001FB7E1E}.Release|Any CPU.Build.0 = Release|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6}.Release|Any CPU.Build.0 = Release|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Debug|Any CPU.Build.0 = Debug|Any CPU {7291B93C-615D-42DE-B8C1-3F9DF643E0FC}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -227,10 +191,6 @@ Global {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}.Debug|Any CPU.Build.0 = Debug|Any CPU {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}.Release|Any CPU.ActiveCfg = Release|Any CPU {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5}.Release|Any CPU.Build.0 = Release|Any CPU - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D}.Release|Any CPU.Build.0 = Release|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Debug|Any CPU.Build.0 = Debug|Any CPU {A97F7177-86C7-4B38-A6ED-DA51BF762471}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -239,26 +199,14 @@ Global {139F7A79-69E4-4B8A-B2A5-6A30A66C495C}.Debug|Any CPU.Build.0 = Debug|Any CPU {139F7A79-69E4-4B8A-B2A5-6A30A66C495C}.Release|Any CPU.ActiveCfg = Release|Any CPU {139F7A79-69E4-4B8A-B2A5-6A30A66C495C}.Release|Any CPU.Build.0 = Release|Any CPU - {7DFF1591-237D-499E-A767-EE37B93FB958}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7DFF1591-237D-499E-A767-EE37B93FB958}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7DFF1591-237D-499E-A767-EE37B93FB958}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7DFF1591-237D-499E-A767-EE37B93FB958}.Release|Any CPU.Build.0 = Release|Any CPU {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Debug|Any CPU.Build.0 = Debug|Any CPU {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|Any CPU.ActiveCfg = Release|Any CPU {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395}.Release|Any CPU.Build.0 = Release|Any CPU - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B}.Release|Any CPU.Build.0 = Release|Any CPU {631C295A-7CCF-4B42-8686-7034E31469E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {631C295A-7CCF-4B42-8686-7034E31469E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {631C295A-7CCF-4B42-8686-7034E31469E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {631C295A-7CCF-4B42-8686-7034E31469E7}.Release|Any CPU.Build.0 = Release|Any CPU - {D940853C-003A-482C-BDB0-665367F274A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D940853C-003A-482C-BDB0-665367F274A0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D940853C-003A-482C-BDB0-665367F274A0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D940853C-003A-482C-BDB0-665367F274A0}.Release|Any CPU.Build.0 = Release|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU {7420652C-3046-4F38-BE64-9B9E69D76FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -271,10 +219,6 @@ Global {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1}.Release|Any CPU.ActiveCfg = Release|Any CPU {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1}.Release|Any CPU.Build.0 = Release|Any CPU - {80F965C4-E2A8-4F54-985D-73D06E45F9CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {80F965C4-E2A8-4F54-985D-73D06E45F9CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80F965C4-E2A8-4F54-985D-73D06E45F9CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {80F965C4-E2A8-4F54-985D-73D06E45F9CE}.Release|Any CPU.Build.0 = Release|Any CPU {BBF2C19E-221E-4AA0-8521-FE75D8F4A2B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BBF2C19E-221E-4AA0-8521-FE75D8F4A2B0}.Debug|Any CPU.Build.0 = Debug|Any CPU {BBF2C19E-221E-4AA0-8521-FE75D8F4A2B0}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -283,10 +227,6 @@ Global {5505B953-D434-49CE-8EBD-EFD7B3C378F7}.Debug|Any CPU.Build.0 = Debug|Any CPU {5505B953-D434-49CE-8EBD-EFD7B3C378F7}.Release|Any CPU.ActiveCfg = Release|Any CPU {5505B953-D434-49CE-8EBD-EFD7B3C378F7}.Release|Any CPU.Build.0 = Release|Any CPU - {0C52E062-9C77-4245-914C-CB617B6D808A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C52E062-9C77-4245-914C-CB617B6D808A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C52E062-9C77-4245-914C-CB617B6D808A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C52E062-9C77-4245-914C-CB617B6D808A}.Release|Any CPU.Build.0 = Release|Any CPU {9166CC10-12E1-4A0F-916B-61F6F2004F5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9166CC10-12E1-4A0F-916B-61F6F2004F5A}.Debug|Any CPU.Build.0 = Debug|Any CPU {9166CC10-12E1-4A0F-916B-61F6F2004F5A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -295,10 +235,6 @@ Global {C2DE264A-AA87-4012-B954-17E3F403A237}.Debug|Any CPU.Build.0 = Debug|Any CPU {C2DE264A-AA87-4012-B954-17E3F403A237}.Release|Any CPU.ActiveCfg = Release|Any CPU {C2DE264A-AA87-4012-B954-17E3F403A237}.Release|Any CPU.Build.0 = Release|Any CPU - {AF507D61-6766-4C20-9F58-23DC29508219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF507D61-6766-4C20-9F58-23DC29508219}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF507D61-6766-4C20-9F58-23DC29508219}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF507D61-6766-4C20-9F58-23DC29508219}.Release|Any CPU.Build.0 = Release|Any CPU {25172C49-7AA4-4739-BB07-69785094C379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25172C49-7AA4-4739-BB07-69785094C379}.Debug|Any CPU.Build.0 = Debug|Any CPU {25172C49-7AA4-4739-BB07-69785094C379}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -323,10 +259,6 @@ Global {67B888D9-C6C4-49F1-883C-5B964151D889}.Debug|Any CPU.Build.0 = Debug|Any CPU {67B888D9-C6C4-49F1-883C-5B964151D889}.Release|Any CPU.ActiveCfg = Release|Any CPU {67B888D9-C6C4-49F1-883C-5B964151D889}.Release|Any CPU.Build.0 = Release|Any CPU - {7F3055BA-70AA-424C-8748-345AF35127E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F3055BA-70AA-424C-8748-345AF35127E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F3055BA-70AA-424C-8748-345AF35127E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F3055BA-70AA-424C-8748-345AF35127E9}.Release|Any CPU.Build.0 = Release|Any CPU {C32274D9-1B66-4D5C-82F9-EB3F10F46752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C32274D9-1B66-4D5C-82F9-EB3F10F46752}.Debug|Any CPU.Build.0 = Debug|Any CPU {C32274D9-1B66-4D5C-82F9-EB3F10F46752}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -339,10 +271,6 @@ Global {4D40A101-07E6-4FF2-8934-83434932591D}.Debug|Any CPU.Build.0 = Debug|Any CPU {4D40A101-07E6-4FF2-8934-83434932591D}.Release|Any CPU.ActiveCfg = Release|Any CPU {4D40A101-07E6-4FF2-8934-83434932591D}.Release|Any CPU.Build.0 = Release|Any CPU - {20751904-0DFC-4126-BF2A-834B53841010}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20751904-0DFC-4126-BF2A-834B53841010}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20751904-0DFC-4126-BF2A-834B53841010}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20751904-0DFC-4126-BF2A-834B53841010}.Release|Any CPU.Build.0 = Release|Any CPU {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}.Debug|Any CPU.ActiveCfg = Debug|x64 {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}.Debug|Any CPU.Build.0 = Debug|x64 {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -351,10 +279,6 @@ Global {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {19424B55-058C-4E9C-B86F-700AEF9EAEC3}.Release|Any CPU.Build.0 = Release|Any CPU - {881D71A3-D276-4108-98C6-0FFD32129B9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {881D71A3-D276-4108-98C6-0FFD32129B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {881D71A3-D276-4108-98C6-0FFD32129B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {881D71A3-D276-4108-98C6-0FFD32129B9C}.Release|Any CPU.Build.0 = Release|Any CPU {EB83A3A3-F9B6-4281-8EBF-F7289FB5D885}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EB83A3A3-F9B6-4281-8EBF-F7289FB5D885}.Debug|Any CPU.Build.0 = Debug|Any CPU {EB83A3A3-F9B6-4281-8EBF-F7289FB5D885}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -371,18 +295,10 @@ Global {56A909AE-6E99-4D4D-A22E-38BDC5528B8E}.Debug|Any CPU.Build.0 = Debug|Any CPU {56A909AE-6E99-4D4D-A22E-38BDC5528B8E}.Release|Any CPU.ActiveCfg = Release|Any CPU {56A909AE-6E99-4D4D-A22E-38BDC5528B8E}.Release|Any CPU.Build.0 = Release|Any CPU - {57DDFD85-D76C-4762-97EE-B2C1ED5C71BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57DDFD85-D76C-4762-97EE-B2C1ED5C71BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57DDFD85-D76C-4762-97EE-B2C1ED5C71BB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57DDFD85-D76C-4762-97EE-B2C1ED5C71BB}.Release|Any CPU.Build.0 = Release|Any CPU {C70EBB84-BA5B-4F2F-819E-25E0985BA13C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C70EBB84-BA5B-4F2F-819E-25E0985BA13C}.Debug|Any CPU.Build.0 = Debug|Any CPU {C70EBB84-BA5B-4F2F-819E-25E0985BA13C}.Release|Any CPU.ActiveCfg = Release|Any CPU {C70EBB84-BA5B-4F2F-819E-25E0985BA13C}.Release|Any CPU.Build.0 = Release|Any CPU - {A6FB3066-5BB1-4CFA-B63D-E4B4B6A5C3F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6FB3066-5BB1-4CFA-B63D-E4B4B6A5C3F4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6FB3066-5BB1-4CFA-B63D-E4B4B6A5C3F4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6FB3066-5BB1-4CFA-B63D-E4B4B6A5C3F4}.Release|Any CPU.Build.0 = Release|Any CPU {9D66EDE4-AFC2-4F00-B40C-A7E878A2972F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9D66EDE4-AFC2-4F00-B40C-A7E878A2972F}.Debug|Any CPU.Build.0 = Debug|Any CPU {9D66EDE4-AFC2-4F00-B40C-A7E878A2972F}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -391,6 +307,14 @@ Global {5B9A550A-9314-4E91-884E-E54960F589FB}.Debug|Any CPU.Build.0 = Debug|Any CPU {5B9A550A-9314-4E91-884E-E54960F589FB}.Release|Any CPU.ActiveCfg = Release|Any CPU {5B9A550A-9314-4E91-884E-E54960F589FB}.Release|Any CPU.Build.0 = Release|Any CPU + {8098BAFC-DF1C-4AFA-A93E-08121E6D09D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8098BAFC-DF1C-4AFA-A93E-08121E6D09D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8098BAFC-DF1C-4AFA-A93E-08121E6D09D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8098BAFC-DF1C-4AFA-A93E-08121E6D09D4}.Release|Any CPU.Build.0 = Release|Any CPU + {9EF292C6-1333-4502-AD9C-224D99847185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EF292C6-1333-4502-AD9C-224D99847185}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EF292C6-1333-4502-AD9C-224D99847185}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EF292C6-1333-4502-AD9C-224D99847185}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -400,48 +324,36 @@ Global {01F98733-7352-47AD-A594-537D979DE3DE} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {DC570FFF-6FE5-47BD-8BC1-B471A6067786} = {FC224610-32D3-454E-9BC1-1219FE8ACD5F} {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED6} = {FC224610-32D3-454E-9BC1-1219FE8ACD5F} - {83EAD6F0-3CB3-456A-AD81-072127D0DE0E} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {26391930-F86F-47E0-A5F6-B89919E38CE1} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {D81C0B87-F0C1-4297-A147-02F001FB7E1E} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} - {C9D4CA21-182B-4ED2-81BB-280A6FD713F6} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {7291B93C-615D-42DE-B8C1-3F9DF643E0FC} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {8AEF06C0-CA5C-4460-BC2D-ADE5F35D0434} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} {1E2644A9-6B31-4350-8772-CEAAD6EE0B21} = {19006AA9-C099-467C-B07A-C64B3BFDA1F4} {65A2F556-F14A-49F3-8A92-7F2E1E7ED3B5} = {19006AA9-C099-467C-B07A-C64B3BFDA1F4} - {9C1ECA1D-DE98-4FB7-92D0-FC45BB308E5D} = {19006AA9-C099-467C-B07A-C64B3BFDA1F4} {A97F7177-86C7-4B38-A6ED-DA51BF762471} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} {139F7A79-69E4-4B8A-B2A5-6A30A66C495C} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} - {7DFF1591-237D-499E-A767-EE37B93FB958} = {CCF48B65-33D1-4E8B-A57B-E03394730B21} {CCF48B65-33D1-4E8B-A57B-E03394730B21} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} {89C4CBC7-1606-40DE-B6DA-FBE3AAC98395} = {2D5AE63D-85C0-43D1-84BF-04418ED93F63} {41BC679F-887F-44CF-971D-A5502EE87DB0} = {4721AA15-AF6E-4A62-A2C3-65564DC563E6} - {11F7D41B-AFCA-4D29-BC08-285A14BF3A3B} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} {804E065F-914C-414A-AF84-009312C3CFF6} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} {9ADD1B7A-6401-4202-8613-F668E2FBC0A4} = {4721AA15-AF6E-4A62-A2C3-65564DC563E6} {631C295A-7CCF-4B42-8686-7034E31469E7} = {2D5AE63D-85C0-43D1-84BF-04418ED93F63} - {D940853C-003A-482C-BDB0-665367F274A0} = {2D5AE63D-85C0-43D1-84BF-04418ED93F63} {7420652C-3046-4F38-BE64-9B9E69D76FA2} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} {C50AA3E3-8C31-4131-9DEC-1D8B377D5A89} = {59E8E8F3-4E42-4E92-83B3-B1C2AB901D18} {CA8EAE01-AB9F-4EC1-B6F3-73721487E9E1} = {91D70DE1-DC8E-4AE1-B100-0671D6263FC5} {35175682-DA83-4C0A-A49D-B191F5885D8E} = {4721AA15-AF6E-4A62-A2C3-65564DC563E6} - {80F965C4-E2A8-4F54-985D-73D06E45F9CE} = {91D70DE1-DC8E-4AE1-B100-0671D6263FC5} {BBF2C19E-221E-4AA0-8521-FE75D8F4A2B0} = {52D71CA4-AE77-4DD4-9456-1E1489413607} {5505B953-D434-49CE-8EBD-EFD7B3C378F7} = {52D71CA4-AE77-4DD4-9456-1E1489413607} - {0C52E062-9C77-4245-914C-CB617B6D808A} = {52D71CA4-AE77-4DD4-9456-1E1489413607} - {6E7D959F-8383-4DC2-BFC2-FCEA4ECC60B3} = {4721AA15-AF6E-4A62-A2C3-65564DC563E6} {9166CC10-12E1-4A0F-916B-61F6F2004F5A} = {2F45036E-D817-41E9-B82F-DBE013EC95D0} {C2DE264A-AA87-4012-B954-17E3F403A237} = {2F45036E-D817-41E9-B82F-DBE013EC95D0} - {AF507D61-6766-4C20-9F58-23DC29508219} = {2F45036E-D817-41E9-B82F-DBE013EC95D0} {25172C49-7AA4-4739-BB07-69785094C379} = {91D70DE1-DC8E-4AE1-B100-0671D6263FC5} {E1C43415-3200-45F4-8BF9-A4DD7D7F2ED9} = {9039209B-7244-483B-B668-D3CE31B304C1} {AC2DB416-F05C-4296-9040-56D6AD4FCD27} = {19006AA9-C099-467C-B07A-C64B3BFDA1F4} {68CF9BDF-94AC-4D2D-A7BD-D1C064F97051} = {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} {A3869243-B462-4986-914B-94E407D8D20F} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} - {6067BA60-D279-4156-8AE1-6B44E2D19187} = {FC224610-32D3-454E-9BC1-1219FE8ACD5F} {617BD3C7-87D9-4D28-8AC9-4910945BB9FC} = {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} {67B888D9-C6C4-49F1-883C-5B964151D889} = {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} - {7F3055BA-70AA-424C-8748-345AF35127E9} = {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} {E9DEBA00-50A4-485D-BA65-D8AB3E3467AB} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {57F59C0C-5687-4AF9-AE1C-1933B539F0E4} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {FC224610-32D3-454E-9BC1-1219FE8ACD5F} = {D92751C8-1039-4005-90B2-913E55E0B8BD} @@ -451,10 +363,8 @@ Global {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {A6DE3DA0-B242-4F49-AEF0-4E26AF92D16C} = {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} {4D40A101-07E6-4FF2-8934-83434932591D} = {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} - {20751904-0DFC-4126-BF2A-834B53841010} = {8AC2AD6D-6C74-4B24-8DF6-42717FC9B804} {7F1FDCF2-0CE8-4119-B3C1-F2CC6D7E1C36} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} {19424B55-058C-4E9C-B86F-700AEF9EAEC3} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} - {881D71A3-D276-4108-98C6-0FFD32129B9C} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} {0AF38BA3-65A0-481B-8CBB-B82E406E1575} = {D92751C8-1039-4005-90B2-913E55E0B8BD} {EB83A3A3-F9B6-4281-8EBF-F7289FB5D885} = {FD4D6594-D81E-456F-8F2E-35B09E04A755} {D8069A23-AD2E-4C9E-8574-7E8C45296A46} = {0AF38BA3-65A0-481B-8CBB-B82E406E1575} @@ -468,13 +378,13 @@ Global {9039209B-7244-483B-B668-D3CE31B304C1} = {9584AEE5-CD59-46E6-93E6-2DC2B5285B75} {A6E3A82F-4696-4D92-ABA1-38AA80752067} = {5929C9C7-F971-449E-BC5B-4486016BD11F} {56A909AE-6E99-4D4D-A22E-38BDC5528B8E} = {5929C9C7-F971-449E-BC5B-4486016BD11F} - {57DDFD85-D76C-4762-97EE-B2C1ED5C71BB} = {5929C9C7-F971-449E-BC5B-4486016BD11F} {52D71CA4-AE77-4DD4-9456-1E1489413607} = {804E065F-914C-414A-AF84-009312C3CFF6} {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} = {804E065F-914C-414A-AF84-009312C3CFF6} {C70EBB84-BA5B-4F2F-819E-25E0985BA13C} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} - {A6FB3066-5BB1-4CFA-B63D-E4B4B6A5C3F4} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} {9D66EDE4-AFC2-4F00-B40C-A7E878A2972F} = {B2BF1FAE-D0F4-4961-84CB-A00D3CABD236} {5B9A550A-9314-4E91-884E-E54960F589FB} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} + {8098BAFC-DF1C-4AFA-A93E-08121E6D09D4} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} + {9EF292C6-1333-4502-AD9C-224D99847185} = {2E00592E-558D-492D-88F9-3ECEE4C0C7DA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} @@ -482,10 +392,8 @@ Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{01f98733-7352-47ad-a594-537d979de3de}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{01f98733-7352-47ad-a594-537d979de3de}*SharedItemsImports = 5 - Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{0c52e062-9c77-4245-914c-cb617b6d808a}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{19424b55-058c-4e9c-b86f-700aef9eaec3}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{1e2644a9-6b31-4350-8772-ceaad6ee0b21}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{20751904-0dfc-4126-bf2a-834b53841010}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{25172c49-7aa4-4739-bb07-69785094c379}*SharedItemsImports = 5 Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{25172c49-7aa4-4739-bb07-69785094c379}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{26391930-f86f-47e0-a5f6-b89919e38ce1}*SharedItemsImports = 5 @@ -494,7 +402,6 @@ Global Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{4d40a101-07e6-4ff2-8934-83434932591d}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{5505b953-d434-49ce-8ebd-efd7b3c378f7}*SharedItemsImports = 5 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{56a909ae-6e99-4d4d-a22e-38bdc5528b8e}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{6067ba60-d279-4156-8ae1-6b44e2d19187}*SharedItemsImports = 13 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{617bd3c7-87d9-4d28-8ac9-4910945bb9fc}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{617bd3c7-87d9-4d28-8ac9-4910945bb9fc}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{631c295a-7ccf-4b42-8686-7034e31469e7}*SharedItemsImports = 5 @@ -503,12 +410,8 @@ Global Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{68cf9bdf-94ac-4d2d-a7bd-d1c064f97051}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{68cf9bdf-94ac-4d2d-a7bd-d1c064f97051}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{6a40cbe4-ecab-4ced-9917-5c64cbf75da6}*SharedItemsImports = 13 - Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{6e7d959f-8383-4dc2-bfc2-fcea4ecc60b3}*SharedItemsImports = 13 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{7f3055ba-70aa-424c-8748-345af35127e9}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{83ead6f0-3cb3-456a-ad81-072127d0de0e}*SharedItemsImports = 5 - Converters\Revit\Speckle.Converters.RevitShared.DependencyInjection\Speckle.Converters.RevitShared.DependencyInjection.projitems*{881d71a3-d276-4108-98c6-0ffd32129b9c}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{89c4cbc7-1606-40de-b6da-fbe3aac98395}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{9166cc10-12e1-4a0f-916b-61f6f2004f5a}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{9add1b7a-6401-4202-8613-f668e2fbc0a4}*SharedItemsImports = 13 @@ -516,9 +419,7 @@ Global Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{a6e3a82f-4696-4d92-aba1-38aa80752067}*SharedItemsImports = 5 - Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{a6fb3066-5bb1-4cfa-b63d-e4b4b6a5c3f4}*SharedItemsImports = 5 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{ac2db416-f05c-4296-9040-56d6ad4fcd27}*SharedItemsImports = 5 - Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{af507d61-6766-4c20-9f58-23dc29508219}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{b37d4b9a-8d3f-4fa5-b9c8-e6c5f8a0c1e2}*SharedItemsImports = 13 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{bbf2c19e-221e-4aa0-8521-fe75d8f4a2b0}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{c2de264a-aa87-4012-b954-17e3f403a237}*SharedItemsImports = 5 @@ -528,7 +429,6 @@ Global Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{ca8eae01-ab9f-4ec1-b6f3-73721487e9e1}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{d8069a23-ad2e-4c9e-8574-7e8c45296a46}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{d8069a23-ad2e-4c9e-8574-7e8c45296a46}*SharedItemsImports = 5 - Converters\Autocad\Speckle.Converters.AutocadShared.DependencyInjection\Speckle.Converters.AutocadShared.DependencyInjection.projitems*{d940853c-003a-482c-bdb0-665367f274a0}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{dc570fff-6fe5-47bd-8bc1-b471a6067786}*SharedItemsImports = 13 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{e1c43415-3200-45f4-8bf9-a4dd7d7f2ed6}*SharedItemsImports = 13 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{e1c43415-3200-45f4-8bf9-a4dd7d7f2ed9}*SharedItemsImports = 13