diff --git a/MatterControlLib/DesignTools/Operations/DecimateObject3D.cs b/MatterControl.MeshOperations/DecimateObject3D.cs similarity index 98% rename from MatterControlLib/DesignTools/Operations/DecimateObject3D.cs rename to MatterControl.MeshOperations/DecimateObject3D.cs index 9aa4f199c..7c82de6c3 100644 --- a/MatterControlLib/DesignTools/Operations/DecimateObject3D.cs +++ b/MatterControl.MeshOperations/DecimateObject3D.cs @@ -37,7 +37,6 @@ using MatterHackers.DataConverters3D; using MatterHackers.Localizations; using MatterHackers.MatterControl.DesignTools.Operations; using MatterHackers.PolygonMesh; -using MatterHackers.VectorMath; namespace MatterHackers.MatterControl.DesignTools { @@ -139,9 +138,8 @@ namespace MatterHackers.MatterControl.DesignTools TargetCount = (int)(SourcePolygonCount * TargetPercent / 100); } - return ApplicationController.Instance.Tasks.Execute( + return TaskBuilder( "Reduce".Localize(), - null, (reporter, cancellationToken) => { SourceContainer.Visible = true; diff --git a/MatterControlLib/DesignTools/Operations/HollowOutObject3D.cs b/MatterControl.MeshOperations/HollowOutObject3D.cs similarity index 97% rename from MatterControlLib/DesignTools/Operations/HollowOutObject3D.cs rename to MatterControl.MeshOperations/HollowOutObject3D.cs index 965beab80..881322096 100644 --- a/MatterControlLib/DesignTools/Operations/HollowOutObject3D.cs +++ b/MatterControl.MeshOperations/HollowOutObject3D.cs @@ -28,7 +28,6 @@ either expressed or implied, of the FreeBSD Project. */ using System; -using System.ComponentModel; using System.Threading.Tasks; using g3; using MatterHackers.DataConverters3D; @@ -89,9 +88,8 @@ namespace MatterHackers.MatterControl.DesignTools var valuesChanged = false; - return ApplicationController.Instance.Tasks.Execute( - "Reduce".Localize(), - null, + return TaskBuilder( + "Hollow".Localize(), (reporter, cancellationToken) => { SourceContainer.Visible = true; diff --git a/MatterControlLib/DesignTools/Interfaces/IPropertyGridModifier.cs b/MatterControl.MeshOperations/IPropertyGridModifier.cs similarity index 100% rename from MatterControlLib/DesignTools/Interfaces/IPropertyGridModifier.cs rename to MatterControl.MeshOperations/IPropertyGridModifier.cs diff --git a/MatterControl.MeshOperations/MatterControl.MeshOperations.csproj b/MatterControl.MeshOperations/MatterControl.MeshOperations.csproj new file mode 100644 index 000000000..a82a21336 --- /dev/null +++ b/MatterControl.MeshOperations/MatterControl.MeshOperations.csproj @@ -0,0 +1,23 @@ + + + + netstandard2.0 + MatterHackers Inc. + true + + + + + {2af30557-fc50-4de3-ad1c-7eb57131a9c5} + MatterControl.Common + + + + + + + + + + + diff --git a/MatterControlLib/DesignTools/EditableTypes/MeshExtensions.cs b/MatterControl.MeshOperations/MeshExtensions.cs similarity index 100% rename from MatterControlLib/DesignTools/EditableTypes/MeshExtensions.cs rename to MatterControl.MeshOperations/MeshExtensions.cs diff --git a/MatterControlLib/DesignTools/Operations/OperationSourceObject3D.cs b/MatterControl.MeshOperations/OperationSourceContainerObject3D.cs similarity index 96% rename from MatterControlLib/DesignTools/Operations/OperationSourceObject3D.cs rename to MatterControl.MeshOperations/OperationSourceContainerObject3D.cs index f95913ea8..67ce56f05 100644 --- a/MatterControlLib/DesignTools/Operations/OperationSourceObject3D.cs +++ b/MatterControl.MeshOperations/OperationSourceContainerObject3D.cs @@ -27,19 +27,25 @@ of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ +using System; using System.Collections.Generic; using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.DataConverters3D; using MatterHackers.DataConverters3D.UndoCommands; using MatterHackers.Localizations; -using MatterHackers.MatterControl.PartPreviewWindow; using Newtonsoft.Json; namespace MatterHackers.MatterControl.DesignTools.Operations { public class OperationSourceContainerObject3D : Object3D { + public static Func, CancellationToken, Task>, Task> TaskBuilder { get; set; } = + (name, func) => Task.Run(() => func(null, CancellationToken.None)); + public override bool CanFlatten => true; [JsonIgnore] diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 84915d17d..0764337f7 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -692,6 +692,8 @@ namespace MatterHackers.MatterControl private void BuildSceneOperations() { + OperationSourceContainerObject3D.TaskBuilder = (name, func) => ApplicationController.Instance.Tasks.Execute(name, null, func); + registeredSceneOperations = new List() { new SceneSelectionOperation() diff --git a/MatterControlLib/MatterControlLib.csproj b/MatterControlLib/MatterControlLib.csproj index 5051ac0b5..9d3f50deb 100644 --- a/MatterControlLib/MatterControlLib.csproj +++ b/MatterControlLib/MatterControlLib.csproj @@ -62,6 +62,7 @@ + diff --git a/MatterControlLib/PartPreviewWindow/View3D/SceneActions.cs b/MatterControlLib/PartPreviewWindow/View3D/SceneActions.cs index f9a56e1b5..df5c5d2bf 100644 --- a/MatterControlLib/PartPreviewWindow/View3D/SceneActions.cs +++ b/MatterControlLib/PartPreviewWindow/View3D/SceneActions.cs @@ -49,24 +49,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public static class SceneActions { private static int pasteObjectXOffset = 5; - public static List GetSelectedItems(this InteractiveScene scene) - { - var selectedItem = scene.SelectedItem; - var selectedItems = new List(); - if (selectedItem != null) - { - if (selectedItem is SelectionGroupObject3D) - { - selectedItems = selectedItem.Children.ToList(); - } - else - { - selectedItems = new List { selectedItem }; - } - } - - return selectedItems; - } public static async void UngroupSelection(this InteractiveScene scene) { diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index b09679f21..d779ceb2c 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit b09679f215b4d91c0aa06df1396f9cfd80ae7f04 +Subproject commit d779ceb2c4f7a93b23014c7bbc117daa30579a6d diff --git a/Tests/MatterControl.Tests/MatterControl.Tests.csproj b/Tests/MatterControl.Tests/MatterControl.Tests.csproj index 558b0ea5d..2e9fe9e4e 100644 --- a/Tests/MatterControl.Tests/MatterControl.Tests.csproj +++ b/Tests/MatterControl.Tests/MatterControl.Tests.csproj @@ -90,6 +90,10 @@ {b2b001ee-a142-4e20-acf8-ae4a9cb984f8} MatterControl + + {3ec506a5-3c23-4663-a5f3-600119361a35} + MatterControl.MeshOperations + {97d5ade3-c1b4-4b46-8a3e-718a4f7f079f} MatterControl.Printing