-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DUI3-326: Add civil3d 2024 converter #3548
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
603a700
adds converter project with pipe conversion
clairekuang b573055
updates with TODO comment to resolve multiple converter registration
clairekuang 5b76a24
Update Speckle.Connectors.Civil3d2024.csproj
clairekuang c79d434
changes container registration
clairekuang 2a1c601
fixed bugs with raw conversion registration
clairekuang d2eef5e
adds missing autocad converters
clairekuang 535ad8e
Merge branch 'dui3/alpha' into DUI3-326-Add-Civil3d-2023-Converter
clairekuang c0387fb
fixes merge issue with package version and autocad proj structure
clairekuang ca38444
more project reference fixing :/
clairekuang caf64bd
restore locks
adamhathcock bf8ebec
csprojs now reference correctly
adamhathcock 72ac20f
fixes send registration for civil - was broken by blocks pr
clairekuang a158046
Merge branch 'dui3/alpha' into DUI3-326-Add-Civil3d-2023-Converter
clairekuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
40 changes: 0 additions & 40 deletions
40
...ors/Autocad/Speckle.Connectors.AutocadShared/DependencyInjection/SharedConnectorModule.cs
This file was deleted.
Oops, something went wrong.
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this class need to be static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
registration is usually static and local to the module