Skip to content

Commit

Permalink
Bumping proxy API and using source gen ProxyMap
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jun 13, 2024
1 parent ba55c8b commit fc2745f
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 151 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Speckle.Connectors.Revit.HostApp;
using Speckle.Connectors.Revit.Operations.Send;
using Speckle.Connectors.Revit.Plugin;
using Speckle.Connectors.Revit2023.Converters;
using Speckle.Connectors.RevitShared.Helpers;
using Speckle.Connectors.Utils;
using Speckle.Connectors.Utils.Builders;
Expand Down Expand Up @@ -73,6 +72,5 @@ public void Load(SpeckleContainerBuilder builder)

// register send conversion cache
builder.AddSingleton<ISendConversionCache, SendConversionCache>();
builder.AddSingleton<IProxyMap, ProxyMap>();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ArcGISConverterModule : ISpeckleModule
public void Load(SpeckleContainerBuilder builder)
{
//don't need a host specific RootToSpeckleConverter
builder.AddConverterCommon<RootToSpeckleConverter, ArcGISToSpeckleUnitConverter, Unit>();
builder.AddConverterCommon<IRootToSpeckleConverter, ArcGISToSpeckleUnitConverter, Unit>();
// most things should be InstancePerLifetimeScope so we get one per operation
builder.AddScoped<IFeatureClassUtils, FeatureClassUtils>();
builder.AddScoped<IArcGISFieldUtils, ArcGISFieldUtils>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class RevitConverterModule : ISpeckleModule
{
public void Load(SpeckleContainerBuilder builder)
{
builder.AddConverterCommon<RootToSpeckleConverter, RevitToSpeckleUnitConverter, IRevitForgeTypeId>();
builder.AddConverterCommon<IRootToSpeckleConverter, RevitToSpeckleUnitConverter, IRevitForgeTypeId>();

// POC: do we need ToSpeckleScalingService as is, do we need to interface it out?
builder.AddScoped<IScalingServiceToSpeckle, ScalingServiceToSpeckle>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Speckle.Revit2023.Api" Version="0.1.1-preview.0.20" />
<PackageReference Include="Speckle.Revit2023.Api" Version="0.1.1-preview.0.21" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Sdk\Speckle.Converters.Common.DependencyInjection\Speckle.Converters.Common.DependencyInjection.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0"/>
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
<PackageReference Include="Speckle.Revit2023.Interfaces" Version="0.1.1-preview.0.20" />
<PackageReference Include="Speckle.Revit2023.Interfaces" Version="0.1.1-preview.0.21" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
},
"Speckle.Revit2023.Interfaces": {
"type": "Direct",
"requested": "[0.1.1-preview.0.20, )",
"resolved": "0.1.1-preview.0.20",
"contentHash": "L/8btGlDejt6OCe8Lee05N3ztKV+pz24WAU9fwXRHEeWMgSe+bqq477Jmk641QFcKmcWK25XJlprlHiCh4pAdQ=="
"requested": "[0.1.1-preview.0.21, )",
"resolved": "0.1.1-preview.0.21",
"contentHash": "CF7GTUKWOmieFz++8yMg9fleCk3RXzWXnYfjtuxN2QRRP9ulXfRoXhQjl3/RX7Mut0bGbeEsqyqhc6xkxluSGg=="
},
"Castle.Core": {
"type": "Transitive",
Expand Down Expand Up @@ -498,8 +498,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[2.0.999-local, )",
"Speckle.Objects": "[2.0.999-local, )",
"Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.20, )"
"Speckle.Objects": "[2.0.999-local, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand All @@ -513,7 +512,7 @@
"type": "Project",
"dependencies": {
"Speckle.Converters.Common": "[2.0.999-local, )",
"Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.20, )"
"Speckle.Revit2023.Interfaces": "[0.1.1-preview.0.21, )"
}
},
"Speckle.Core": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Import Project="..\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems" Label="Shared" />

<ItemGroup>
<PackageReference Include="Speckle.Revit2023.Interfaces" Version="0.1.1-preview.0.20" />
<PackageReference Include="Speckle.Revit2023.Interfaces" Version="0.1.1-preview.0.21" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public class ReferencePointConverter : IReferencePointConverter
private readonly IRevitTransformUtils _transformUtils;
private readonly IRevitFilterFactory _revitFilterFactory;
private readonly IRevitXYZUtils _revitXyzUtils;
private readonly IProxyMap _proxyMap;

private readonly Dictionary<string, IRevitTransform> _docTransforms = new();

Expand All @@ -41,16 +40,14 @@ public ReferencePointConverter(
IRevitConversionSettings revitSettings,
IRevitFilterFactory revitFilterFactory,
IRevitTransformUtils transformUtils,
IRevitXYZUtils revitXyzUtils,
IProxyMap proxyMap
IRevitXYZUtils revitXyzUtils
)
{
_contextStack = contextStack;
_revitSettings = revitSettings;
_revitFilterFactory = revitFilterFactory;
_transformUtils = transformUtils;
_revitXyzUtils = revitXyzUtils;
_proxyMap = proxyMap;
}

// POC: the original allowed for the document to be passed in
Expand Down Expand Up @@ -92,7 +89,7 @@ public IRevitTransform GetReferencePointTransform(string referencePointSetting)
// POC: bogus disposal below
var points = _revitFilterFactory
.CreateFilteredElementCollector(_contextStack.Current.Document)
.OfClass<IRevitBasePoint>(_proxyMap)
.OfClass<IRevitBasePoint>()
.ToList();

var projectPoint = NotNullExtensions.NotNull(points.FirstOrDefault(o => o.IsShared == false), "No projectPoint");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class RhinoConverterModule : ISpeckleModule
{
public void Load(SpeckleContainerBuilder builder)
{
builder.AddConverterCommon<RootToSpeckleConverter, RhinoToSpeckleUnitConverter, UnitSystem>();
builder.AddConverterCommon<IRootToSpeckleConverter, RhinoToSpeckleUnitConverter, UnitSystem>();
// single stack per conversion
builder.AddScoped<IConversionContextStack<RhinoDoc, UnitSystem>, RhinoConversionContextStack>();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


namespace Speckle.Converters.Common;
public interface IRootToSpeckleConverter
{
Speckle.Core.Models.Base Convert(object target);
}
48 changes: 0 additions & 48 deletions DUI3-DX/Sdk/Speckle.Converters.Common/RootToSpeckleConverter.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.Revit2023.Interfaces" Version="0.1.1-preview.0.20" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Sdk\Speckle.Autofac\Speckle.Autofac.csproj"/>
<ProjectReference Include="..\..\..\Objects\Objects\Objects.csproj" />
Expand Down

0 comments on commit fc2745f

Please sign in to comment.