diff --git a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs index 4427ee544..94e0d2a80 100644 --- a/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs +++ b/Connectors/Autocad/Speckle.Connectors.AutocadShared/Operations/Receive/AutocadHostObjectBuilder.cs @@ -132,16 +132,11 @@ CancellationToken cancellationToken // 7 - Create groups if (unpackedRoot.GroupProxies != null) { -<<<<<<< HEAD - List groupResults = groupBaker.CreateGroups(unpackedRoot.GroupProxies, applicationIdMap); - results.AddRange(groupResults); -======= - IReadOnlyCollection groupResults = _groupBaker.CreateGroups( + IReadOnlyCollection groupResults = groupBaker.CreateGroups( unpackedRoot.GroupProxies, applicationIdMap ); results.UnionWith(groupResults); ->>>>>>> dev } return new HostObjectBuilderResult(bakedObjectIds, results); @@ -156,13 +151,8 @@ private void PreReceiveDeepClean(string baseLayerPrefix) private IReadOnlyCollection ConvertObject(Base obj, Collection[] layerPath, string baseLayerNamePrefix) { -<<<<<<< HEAD string layerName = layerBaker.CreateLayerForReceive(layerPath, baseLayerNamePrefix); - var convertedEntities = new List(); -======= - string layerName = _layerBaker.CreateLayerForReceive(layerPath, baseLayerNamePrefix); var convertedEntities = new HashSet(); ->>>>>>> dev using var tr = Application.DocumentManager.CurrentDocument.Database.TransactionManager.StartTransaction(); @@ -187,13 +177,8 @@ private IReadOnlyCollection ConvertObject(Base obj, Collection[] layerPa private Entity BakeObject(Entity entity, Base originalObject, string layerName, Base? parentObject = null) { -<<<<<<< HEAD - var objId = originalObject.applicationId ?? originalObject.id; - if (colorBaker.ObjectColorsIdMap.TryGetValue(objId, out AutocadColor? color)) -======= var objId = originalObject.applicationId ?? originalObject.id.NotNull(); - if (_colorBaker.ObjectColorsIdMap.TryGetValue(objId, out AutocadColor? color)) ->>>>>>> dev + if (colorBaker.ObjectColorsIdMap.TryGetValue(objId, out AutocadColor? color)) { entity.Color = color; } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs index a5cb5c58c..88c64afd2 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs @@ -42,11 +42,10 @@ ICSiApplicationService csiApplicationService _csiApplicationService = csiApplicationService; } - public async Task Build( + public RootObjectBuilderResult Build( IReadOnlyList csiObjects, SendInfo sendInfo, - IProgress onOperationProgressed, - CancellationToken cancellationToken = default + IProgress onOperationProgressed ) { using var activity = _activityFactory.Start("Build"); @@ -63,7 +62,6 @@ public async Task Build( foreach (ICSiWrapper csiObject in csiObjects) { using var _2 = _activityFactory.Start("Convert"); - cancellationToken.ThrowIfCancellationRequested(); var result = ConvertCSiObject(csiObject, rootObjectCollection, sendInfo.ProjectId); results.Add(result); @@ -78,7 +76,6 @@ public async Task Build( throw new SpeckleException("Failed to convert all objects."); } - await Task.Yield(); return new RootObjectBuilderResult(rootObjectCollection, results); } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs index 810371abc..ea906c9e9 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs @@ -1,11 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.Common; -<<<<<<< HEAD -using Speckle.Connectors.Common.Threading; -======= using Speckle.Connectors.Common.Builders; using Speckle.Connectors.Common.Operations; ->>>>>>> dev +using Speckle.Connectors.Common.Threading; using Speckle.Connectors.CSiShared.Bindings; using Speckle.Connectors.CSiShared.Builders; using Speckle.Connectors.CSiShared.Filters; @@ -13,7 +10,6 @@ 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.Converters.CSiShared; @@ -28,15 +24,9 @@ public static IServiceCollection AddCSi(this IServiceCollection services) services.AddSingleton(); services.AddConnectorUtils(); -<<<<<<< HEAD - services.AddDUI(); -======= - services.AddDUI(); ->>>>>>> dev + services.AddDUI(); services.AddDUIView(); - services.AddSingleton(); - services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs index ac1ead967..f44c230d0 100644 --- a/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs +++ b/Connectors/Revit/Speckle.Connectors.RevitShared/Operations/Receive/RevitHostObjectBuilder.cs @@ -34,69 +34,13 @@ public sealed class RevitHostObjectBuilder( RootObjectUnpacker rootObjectUnpacker, ILogger logger, RevitToHostCacheSingleton revitToHostCacheSingleton, - ITypedConverter<(Base atomicObject, List matrix), DirectShape> localToGlobalDirectShapeConverter + ITypedConverter< + (Base atomicObject, IReadOnlyCollection matrix), + DirectShape + > localToGlobalDirectShapeConverter ) : IHostObjectBuilder, IDisposable { -<<<<<<< HEAD public HostObjectBuilderResult Build( -======= - private readonly IRootToHostConverter _converter; - private readonly IConverterSettingsStore _converterSettings; - private readonly RevitToHostCacheSingleton _revitToHostCacheSingleton; - private readonly ITransactionManager _transactionManager; - private readonly ILocalToGlobalUnpacker _localToGlobalUnpacker; - private readonly RevitGroupBaker _groupBaker; - private readonly RevitMaterialBaker _materialBaker; - private readonly ILogger _logger; - private readonly ITypedConverter< - (Base atomicObject, IReadOnlyCollection matrix), - DirectShape - > _localToGlobalDirectShapeConverter; - - private readonly RootObjectUnpacker _rootObjectUnpacker; - private readonly ISdkActivityFactory _activityFactory; - - public RevitHostObjectBuilder( - IRootToHostConverter converter, - IConverterSettingsStore converterSettings, - ITransactionManager transactionManager, - ISdkActivityFactory activityFactory, - ILocalToGlobalUnpacker localToGlobalUnpacker, - RevitGroupBaker groupManager, - RevitMaterialBaker materialBaker, - RootObjectUnpacker rootObjectUnpacker, - ILogger logger, - RevitToHostCacheSingleton revitToHostCacheSingleton, - ITypedConverter< - (Base atomicObject, IReadOnlyCollection matrix), - DirectShape - > localToGlobalDirectShapeConverter - ) - { - _converter = converter; - _converterSettings = converterSettings; - _transactionManager = transactionManager; - _localToGlobalUnpacker = localToGlobalUnpacker; - _groupBaker = groupManager; - _materialBaker = materialBaker; - _rootObjectUnpacker = rootObjectUnpacker; - _logger = logger; - _revitToHostCacheSingleton = revitToHostCacheSingleton; - _localToGlobalDirectShapeConverter = localToGlobalDirectShapeConverter; - _activityFactory = activityFactory; - } - - public Task Build( - Base rootObject, - string projectName, - string modelName, - IProgress onOperationProgressed, - CancellationToken cancellationToken - ) => - RevitTask.RunAsync(() => BuildSync(rootObject, projectName, modelName, onOperationProgressed, cancellationToken)); - - private HostObjectBuilderResult BuildSync( ->>>>>>> dev Base rootObject, string projectName, string modelName,