Add mechanism to override default IAVolumes per type

- Change .InteractionVolumes from List to IEnumerable
- Add mappings of type -> IAVolument overrides
- Conditionally returned mapped IAVolume overrides
- Force IAVolume registration through .RegisterIAVolume()
This commit is contained in:
John Lewin 2019-02-02 19:43:50 -08:00
parent d8c8be922d
commit 1a33e8d074
3 changed files with 38 additions and 10 deletions

View file

@ -346,15 +346,15 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
viewOptionsBar.AddChild(gridSnapButton);
var interactionVolumes = this.InteractionLayer.InteractionVolumes;
interactionVolumes.Add(new MoveInZControl(this.InteractionLayer));
interactionVolumes.Add(new SelectionShadow(this.InteractionLayer));
interactionVolumes.Add(new SnappingIndicators(this.InteractionLayer, this.CurrentSelectInfo));
this.InteractionLayer.RegisterIAVolume(new MoveInZControl(this.InteractionLayer));
this.InteractionLayer.RegisterIAVolume(new SelectionShadow(this.InteractionLayer));
this.InteractionLayer.RegisterIAVolume(new SnappingIndicators(this.InteractionLayer, this.CurrentSelectInfo));
// Add IAVolumeProviderPlugins
foreach (var ivProvider in ApplicationController.Instance.Extensions.IAVolumeProviders)
{
interactionVolumes.AddRange(ivProvider.Create(this.InteractionLayer));
this.InteractionLayer.RegisterIAVolume(plugin.CreateInteractionVolume(this.InteractionLayer));
}
this.InteractionLayer.AfterDraw += AfterDraw3DContent;