Working on new supports

refactoring tour classes
This commit is contained in:
Lars Brubaker 2018-12-28 16:00:21 -08:00
parent ae2c686c57
commit 83fd3423ec
7 changed files with 192 additions and 33 deletions

View file

@ -34,12 +34,12 @@ using MatterHackers.DataConverters3D;
namespace MatterHackers.MatterControl.PartPreviewWindow
{
public class MakeSupport : IUndoRedoCommand
public class ToggleSupport : IUndoRedoCommand
{
List<PrintOutputTypes> itemsPrintOutputType = new List<PrintOutputTypes>();
List<IObject3D> itemsToChange = new List<IObject3D>();
public MakeSupport(IObject3D selectedItem)
public ToggleSupport(IObject3D selectedItem)
{
if (selectedItem is SelectionGroupObject3D)
{
@ -62,9 +62,16 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
void IUndoRedoCommand.Do()
{
foreach(var item in this.itemsToChange)
for (int i = 0; i < this.itemsToChange.Count; i++)
{
item.OutputType = PrintOutputTypes.Support;
if (itemsPrintOutputType[i] == PrintOutputTypes.Support)
{
itemsToChange[i].OutputType = PrintOutputTypes.Default;
}
else
{
itemsToChange[i].OutputType = PrintOutputTypes.Support;
}
}
}