Adding reduce and hollow to a new

This commit is contained in:
Lars Brubaker 2020-02-27 08:56:39 -08:00
parent 1520c913ad
commit dffe0b33d8
11 changed files with 41 additions and 27 deletions

View file

@ -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;

View file

@ -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;

View file

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Company>MatterHackers Inc.</Company>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MatterControl.Common\MatterControl.Common.csproj">
<Project>{2af30557-fc50-4de3-ad1c-7eb57131a9c5}</Project>
<Name>MatterControl.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Submodules\agg-sharp\agg\Agg.csproj">
</ProjectReference>
<ProjectReference Include="..\Submodules\agg-sharp\DataConverters3D\DataConverters3D.csproj" />
<ProjectReference Include="..\Submodules\agg-sharp\Localizations\Localizations.csproj" />
<ProjectReference Include="..\Submodules\agg-sharp\VectorMath\VectorMath.csproj">
</ProjectReference>
<ProjectReference Include="..\Submodules\geometry3Sharp\geometry3Sharp.csproj" />
</ItemGroup>
</Project>

View file

@ -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<string, Func<IProgress<ProgressStatus>, CancellationToken, Task>, Task> TaskBuilder { get; set; } =
(name, func) => Task.Run(() => func(null, CancellationToken.None));
public override bool CanFlatten => true;
[JsonIgnore]

View file

@ -692,6 +692,8 @@ namespace MatterHackers.MatterControl
private void BuildSceneOperations()
{
OperationSourceContainerObject3D.TaskBuilder = (name, func) => ApplicationController.Instance.Tasks.Execute(name, null, func);
registeredSceneOperations = new List<SceneSelectionOperation>()
{
new SceneSelectionOperation()

View file

@ -62,6 +62,7 @@
<ItemGroup>
<ProjectReference Include="..\MatterControl.Common\MatterControl.Common.csproj" />
<ProjectReference Include="..\MatterControl.MeshOperations\MatterControl.MeshOperations.csproj" />
<ProjectReference Include="..\MatterControl.OpenGL\MatterControl.OpenGL.csproj" />
<ProjectReference Include="..\MatterControl.Printing\MatterControl.Printing.csproj" />
<ProjectReference Include="..\Submodules\agg-sharp\clipper_library\clipper_library.csproj" />

View file

@ -49,24 +49,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public static class SceneActions
{
private static int pasteObjectXOffset = 5;
public static List<IObject3D> GetSelectedItems(this InteractiveScene scene)
{
var selectedItem = scene.SelectedItem;
var selectedItems = new List<IObject3D>();
if (selectedItem != null)
{
if (selectedItem is SelectionGroupObject3D)
{
selectedItems = selectedItem.Children.ToList();
}
else
{
selectedItems = new List<IObject3D> { selectedItem };
}
}
return selectedItems;
}
public static async void UngroupSelection(this InteractiveScene scene)
{

@ -1 +1 @@
Subproject commit b09679f215b4d91c0aa06df1396f9cfd80ae7f04
Subproject commit d779ceb2c4f7a93b23014c7bbc117daa30579a6d

View file

@ -90,6 +90,10 @@
<Project>{b2b001ee-a142-4e20-acf8-ae4a9cb984f8}</Project>
<Name>MatterControl</Name>
</ProjectReference>
<ProjectReference Include="..\..\MatterControl.MeshOperations\MatterControl.MeshOperations.csproj">
<Project>{3ec506a5-3c23-4663-a5f3-600119361a35}</Project>
<Name>MatterControl.MeshOperations</Name>
</ProjectReference>
<ProjectReference Include="..\..\MatterControl.Printing\MatterControl.Printing.csproj">
<Project>{97d5ade3-c1b4-4b46-8a3e-718a4f7f079f}</Project>
<Name>MatterControl.Printing</Name>