-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce815aa
commit 3cbed42
Showing
51 changed files
with
1,992 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 3 additions & 51 deletions
54
...rs/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/AutocadConnectorModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,21 @@ | ||
#if AUTOCAD | ||
using Autodesk.AutoCAD.DatabaseServices; | ||
using Speckle.Autofac; | ||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.Filters; | ||
using Speckle.Connectors.Autocad.HostApp; | ||
using Speckle.Connectors.Autocad.Interfaces; | ||
using Speckle.Connectors.Autocad.Operations.Receive; | ||
using Speckle.Connectors.Autocad.Operations.Send; | ||
using Speckle.Connectors.Autocad.Plugin; | ||
using Speckle.Connectors.DUI; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models; | ||
using Speckle.Connectors.DUI.Models.Card.SendFilter; | ||
using Speckle.Connectors.DUI.WebView; | ||
using Speckle.Connectors.Utils; | ||
using Speckle.Connectors.Utils.Builders; | ||
using Speckle.Connectors.Utils.Caching; | ||
using Speckle.Connectors.Utils.Instances; | ||
using Speckle.Connectors.Utils.Operations; | ||
using Speckle.Core.Models.GraphTraversal; | ||
|
||
namespace Speckle.Connectors.Autocad.DependencyInjection; | ||
|
||
public class AutocadConnectorModule : ISpeckleModule | ||
{ | ||
public void Load(SpeckleContainerBuilder builder) | ||
{ | ||
builder.AddAutofac(); | ||
builder.AddConnectorUtils(); | ||
builder.AddDUI(); | ||
builder.AddDUIView(); | ||
|
||
// Register other connector specific types | ||
builder.AddSingleton<IAutocadPlugin, AutocadPlugin>(); | ||
builder.AddTransient<TransactionContext>(); | ||
builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext | ||
builder.AddSingleton<DocumentModelStore, AutocadDocumentStore>(); | ||
builder.AddSingleton<AutocadContext>(); | ||
builder.AddSingleton<AutocadIdleManager>(); | ||
|
||
SharedConnectorModule.LoadShared(builder); | ||
|
||
|
||
builder.AddScoped<AutocadLayerManager>(); | ||
SharedRegistration.Load(builder); | ||
|
||
// Operations | ||
builder.AddScoped<SendOperation<AutocadRootObject>>(); | ||
builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); | ||
|
||
// Object Builders | ||
builder.AddScoped<IHostObjectBuilder, AutocadHostObjectBuilder>(); | ||
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
SharedRegistration.LoadSend(builder); | ||
SharedRegistration.LoadReceive(builder); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, ConfigBinding>("connectorName", "Autocad"); // POC: Easier like this for now, should be cleaned up later | ||
builder.AddSingleton<IBinding, AutocadSendBinding>(); | ||
builder.AddSingleton<IBinding, AutocadReceiveBinding>(); | ||
|
||
// register send filters | ||
builder.AddTransient<ISendFilter, AutocadSelectionFilter>(); | ||
|
||
// register send conversion cache | ||
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
builder.AddScoped<IInstanceObjectsManager<AutocadRootObject, List<Entity>>, AutocadInstanceObjectManager>(); | ||
} | ||
} | ||
#endif |
26 changes: 4 additions & 22 deletions
26
...rs/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/Civil3dConnectorModule.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,19 @@ | ||
#if CIVIL3D | ||
|
||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.Filters; | ||
using Speckle.Connectors.Autocad.Operations.Send; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models.Card.SendFilter; | ||
using Speckle.Connectors.Utils.Builders; | ||
using Speckle.Connectors.Utils.Caching; | ||
using Speckle.Connectors.Utils.Operations; | ||
|
||
namespace Speckle.Connectors.Autocad.DependencyInjection; | ||
|
||
public class Civil3dConnectorModule : ISpeckleModule | ||
{ | ||
public void Load(SpeckleContainerBuilder builder) | ||
{ | ||
SharedConnectorModule.LoadShared(builder); | ||
|
||
// Operations | ||
builder.AddScoped<SendOperation<AutocadRootObject>>(); | ||
|
||
// Object Builders | ||
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
|
||
SharedRegistration.Load(builder); | ||
SharedRegistration.LoadSend(builder); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, ConfigBinding>("connectorName", "Civil3d"); // POC: Easier like this for now, should be cleaned up later | ||
builder.AddSingleton<IBinding, AutocadSendBinding>(); | ||
|
||
// register send filters | ||
builder.AddTransient<ISendFilter, AutocadSelectionFilter>(); | ||
|
||
// register send conversion cache | ||
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
} | ||
} | ||
#endif |
82 changes: 82 additions & 0 deletions
82
...ectors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/SharedRegistration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using Autodesk.AutoCAD.DatabaseServices; | ||
using Speckle.Autofac; | ||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.HostApp; | ||
using Speckle.Connectors.Autocad.Interfaces; | ||
using Speckle.Connectors.Autocad.Plugin; | ||
using Speckle.Connectors.DUI; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models; | ||
using Speckle.Connectors.DUI.WebView; | ||
using Speckle.Connectors.Utils; | ||
using Speckle.Connectors.Autocad.Filters; | ||
using Speckle.Connectors.Autocad.Operations.Send; | ||
using Speckle.Connectors.DUI.Models.Card.SendFilter; | ||
using Speckle.Connectors.Utils.Builders; | ||
using Speckle.Connectors.Utils.Caching; | ||
using Speckle.Connectors.Utils.Operations; | ||
using Speckle.Connectors.Utils.Instances; | ||
using Speckle.Connectors.Autocad.Operations.Receive; | ||
|
||
using Speckle.Core.Models.GraphTraversal; | ||
|
||
namespace Speckle.Connectors.Autocad.DependencyInjection; | ||
|
||
public static class SharedRegistration | ||
{ | ||
public static void Load(SpeckleContainerBuilder builder) | ||
{ | ||
builder.AddAutofac(); | ||
builder.AddConnectorUtils(); | ||
builder.AddDUI(); | ||
builder.AddDUIView(); | ||
|
||
// Register other connector specific types | ||
builder.AddSingleton<IAutocadPlugin, AutocadPlugin>(); | ||
builder.AddTransient<TransactionContext>(); | ||
builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext | ||
builder.AddSingleton<DocumentModelStore, AutocadDocumentStore>(); | ||
builder.AddSingleton<AutocadContext>(); | ||
builder.AddScoped<AutocadLayerManager>(); | ||
builder.AddSingleton<AutocadIdleManager>(); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, TestBinding>(); | ||
builder.AddSingleton<IBinding, AccountBinding>(); | ||
builder.AddSingleton<IBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBasicConnectorBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBinding, AutocadSelectionBinding>(); | ||
} | ||
|
||
public static void LoadSend(SpeckleContainerBuilder builder) | ||
{ | ||
// Operations | ||
builder.AddScoped<SendOperation<AutocadRootObject>>(); | ||
|
||
// Object Builders | ||
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, AutocadSendBinding>(); | ||
|
||
// register send filters | ||
builder.AddTransient<ISendFilter, AutocadSelectionFilter>(); | ||
|
||
// register send conversion cache | ||
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
builder.AddScoped<IInstanceObjectsManager<AutocadRootObject, List<Entity>>, AutocadInstanceObjectManager>(); | ||
} | ||
|
||
public static void LoadReceive(SpeckleContainerBuilder builder) | ||
{ | ||
// traversal | ||
builder.AddSingleton(DefaultTraversal.CreateTraversalFunc()); | ||
|
||
// Object Builders | ||
builder.AddScoped<IHostObjectBuilder, AutocadHostObjectBuilder>(); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, AutocadReceiveBinding>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.