Skip to content

Commit

Permalink
update core reference and fix to not use interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jun 27, 2024
1 parent 33b2614 commit 88cb939
Show file tree
Hide file tree
Showing 26 changed files with 644 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Connectors.Utils": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )",
"Speckle.Core": "[3.0.1-alpha.14, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -399,7 +399,7 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )"
"Speckle.Core": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.arcgis3": {
Expand All @@ -421,7 +421,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Objects": "[3.0.1-alpha.11, )"
"Speckle.Objects": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -455,9 +455,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -479,11 +479,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==",
"dependencies": {
"Speckle.Core": "3.0.1-alpha.11"
"Speckle.Core": "3.0.1-alpha.14"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Connectors.Utils": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )",
"Speckle.Core": "[3.0.1-alpha.14, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -452,7 +452,7 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )"
"Speckle.Core": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.autocad2023": {
Expand All @@ -474,7 +474,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Objects": "[3.0.1-alpha.11, )"
"Speckle.Objects": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -511,9 +511,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -535,11 +535,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==",
"dependencies": {
"Speckle.Core": "3.0.1-alpha.11"
"Speckle.Core": "3.0.1-alpha.14"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Connectors.Utils": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )",
"Speckle.Core": "[3.0.1-alpha.14, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -455,7 +455,7 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )"
"Speckle.Core": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.autocad2024": {
Expand All @@ -477,7 +477,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Objects": "[3.0.1-alpha.11, )"
"Speckle.Objects": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -520,9 +520,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -544,11 +544,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==",
"dependencies": {
"Speckle.Core": "3.0.1-alpha.11"
"Speckle.Core": "3.0.1-alpha.14"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Connectors.Utils": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )",
"Speckle.Core": "[3.0.1-alpha.14, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -463,14 +463,14 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Core": "[3.0.1-alpha.11, )"
"Speckle.Core": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.common": {
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Objects": "[3.0.1-alpha.11, )"
"Speckle.Objects": "[3.0.1-alpha.14, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -517,9 +517,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "Zt2dBJLlfziEACYCHThbhKypSjhoA01rTw9BzNI72c/BDyftXIz70Tetq/8ZMEqQnKqfmRyYADsAdWKxpdV0Hg==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "RzQPVIGFFkKvG56YLr8ACtiwdWJE6IJ9vCQ4qHa0PIsUEpfzAIAi59jnzqtByOFC0FiFrFPow9bkfzylaZorAA==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -541,11 +541,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.1-alpha.11, )",
"resolved": "3.0.1-alpha.11",
"contentHash": "YR7sei3OQBAi8R/kIu8bEmg5ELDIJK6l5fhOgdnqA9ZvD/fvmRb+09z8lIUTDsgdAdvYU/A/x9VxH9OGPbp9Kw==",
"requested": "[3.0.1-alpha.14, )",
"resolved": "3.0.1-alpha.14",
"contentHash": "z38LGryMvh7iU1uBW+4uo5DwsB3CwRgLt2uFexWFx3mPSid+A0l5XcJzOgLwgFhNl6B42Ryz4ezBsddTp1Uc/g==",
"dependencies": {
"Speckle.Core": "3.0.1-alpha.11"
"Speckle.Core": "3.0.1-alpha.14"
}
},
"Speckle.Revit.API": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
using Speckle.Connectors.Rhino7.Extensions;
using Speckle.Connectors.Utils.Conversion;
using Speckle.Connectors.Utils.Instances;
using Speckle.Converters.Common;
using Speckle.Core.Kits;
using Speckle.Core.Logging;
using Speckle.Core.Models;
using Speckle.Core.Models.Instances;
using Speckle.Rhino7.Interfaces;

namespace Speckle.Connectors.Rhino7.HostApp;

Expand All @@ -20,19 +18,14 @@ namespace Speckle.Connectors.Rhino7.HostApp;
/// </summary>
public class RhinoInstanceObjectsManager : IInstanceObjectsManager<RhinoObject, List<string>>
{
private readonly IConversionContextStack<IRhinoDoc, RhinoUnitSystem> _contextStack;
private readonly Dictionary<string, InstanceProxy> _instanceProxies = new();
private readonly Dictionary<string, List<InstanceProxy>> _instanceProxiesByDefinitionId = new();
private readonly Dictionary<string, InstanceDefinitionProxy> _definitionProxies = new();
private readonly Dictionary<string, RhinoObject> _flatAtomicObjects = new();
private readonly RhinoLayerManager _layerManager;

public RhinoInstanceObjectsManager(
IConversionContextStack<IRhinoDoc, RhinoUnitSystem> contextStack,
RhinoLayerManager layerManager
)
public RhinoInstanceObjectsManager(RhinoLayerManager layerManager)
{
_contextStack = contextStack;
_layerManager = layerManager;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Diagnostics.Contracts;
using Rhino;
using Rhino.DocObjects;
using Speckle.Converters.Common;
using Speckle.Core.Models;
using Speckle.Core.Models.GraphTraversal;
using Speckle.Rhino7.Interfaces;

namespace Speckle.Connectors.Rhino7.HostApp;

Expand All @@ -13,16 +11,8 @@ namespace Speckle.Connectors.Rhino7.HostApp;
/// </summary>
public class RhinoLayerManager
{
private readonly IConversionContextStack<IRhinoDoc, RhinoUnitSystem> _contextStack;
private readonly Dictionary<string, int> _hostLayerCache;
private readonly Dictionary<int, Collection> _layerCollectionCache;

public RhinoLayerManager(IConversionContextStack<IRhinoDoc, RhinoUnitSystem> contextStack)
{
_contextStack = contextStack;
_hostLayerCache = new();
_layerCollectionCache = new();
}
private readonly Dictionary<string, int> _hostLayerCache = new();
private readonly Dictionary<int, Collection> _layerCollectionCache = new();

/// <summary>
/// Creates the base layer and adds it to the cache.
Expand Down Expand Up @@ -79,7 +69,7 @@ public int GetAndCreateLayerFromPath(string[] path, string baseLayerName)
/// <param name="layer">The layer you want the equivalent collection for.</param>
/// <param name="rootObjectCollection">The root object that will be sent to Speckle, and will host all collections.</param>
/// <returns></returns>
public Collection GetHostObjectCollection(IRhinoLayer layer, Collection rootObjectCollection)
public Collection GetHostObjectCollection(Layer layer, Collection rootObjectCollection)
{
if (_layerCollectionCache.TryGetValue(layer.Index, out Collection value))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Rhino;
using Rhino.DocObjects;
using Rhino.Geometry;
using Speckle.Connectors.Rhino7.HostApp;
using Speckle.Connectors.Utils.Builders;
using Speckle.Connectors.Utils.Conversion;
Expand All @@ -8,7 +10,6 @@
using Speckle.Core.Models;
using Speckle.Core.Models.GraphTraversal;
using Speckle.Core.Models.Instances;
using Speckle.Rhino7.Interfaces;

namespace Speckle.Connectors.Rhino7.Operations.Receive;

Expand All @@ -23,23 +24,20 @@ public class RhinoHostObjectBuilder : IHostObjectBuilder

private readonly IInstanceObjectsManager<RhinoObject, List<string>> _instanceObjectsManager;
private readonly RhinoLayerManager _layerManager;
private readonly IRhinoDocFactory _rhinoDocFactory;

public RhinoHostObjectBuilder(
IRootToHostConverter converter,
IConversionContextStack<IRhinoDoc, RhinoUnitSystem> contextStack,
IConversionContextStack<RhinoDoc, UnitSystem> contextStack,
GraphTraversal traverseFunction,
RhinoLayerManager layerManager,
IInstanceObjectsManager<RhinoObject, List<string>> instanceObjectsManager,
IRhinoDocFactory rhinoDocFactory
IInstanceObjectsManager<RhinoObject, List<string>> instanceObjectsManager
)
{
_converter = converter;
_contextStack = contextStack;
_traverseFunction = traverseFunction;
_layerManager = layerManager;
_instanceObjectsManager = instanceObjectsManager;
_rhinoDocFactory = rhinoDocFactory;
}

public HostObjectBuilderResult Build(
Expand Down Expand Up @@ -168,7 +166,7 @@ private void PreReceiveDeepClean(string baseLayerName, int rootLayerIndex)

var doc = _contextStack.Current.Document;
// Cleans up any previously received objects
if (rootLayerIndex != _rhinoDocFactory.UnsetIntIndex)
if (rootLayerIndex != RhinoMath.UnsetIntIndex)
{
var documentLayer = doc.Layers[rootLayerIndex];
var childLayers = documentLayer.GetChildren();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using Rhino;
using Rhino.DocObjects;
using Speckle.Core.Models;
using Speckle.Autofac.DependencyInjection;
Expand All @@ -11,7 +12,6 @@
using Speckle.Connectors.Utils.Instances;
using Speckle.Connectors.Utils.Operations;
using Speckle.Core.Logging;
using Speckle.Rhino7.Interfaces;

namespace Speckle.Connectors.Rhino7.Operations.Send;

Expand All @@ -23,13 +23,13 @@ public class RhinoRootObjectBuilder : IRootObjectBuilder<RhinoObject>
private readonly IUnitOfWorkFactory _unitOfWorkFactory;
private readonly ISendConversionCache _sendConversionCache;
private readonly IInstanceObjectsManager<RhinoObject, List<string>> _instanceObjectsManager;
private readonly IConversionContextStack<IRhinoDoc, RhinoUnitSystem> _contextStack;
private readonly IConversionContextStack<RhinoDoc, UnitSystem> _contextStack;
private readonly RhinoLayerManager _layerManager;

public RhinoRootObjectBuilder(
IUnitOfWorkFactory unitOfWorkFactory,
ISendConversionCache sendConversionCache,
IConversionContextStack<IRhinoDoc, RhinoUnitSystem> contextStack,
IConversionContextStack<RhinoDoc, UnitSystem> contextStack,
RhinoLayerManager layerManager,
IInstanceObjectsManager<RhinoObject, List<string>> instanceObjectsManager
)
Expand Down
Loading

0 comments on commit 88cb939

Please sign in to comment.