Making Bake and Remove work for array

This commit is contained in:
LarsBrubaker 2018-02-17 08:57:56 -08:00
parent 247bf009f7
commit 4e126ef3a6
3 changed files with 59 additions and 8 deletions

View file

@ -43,22 +43,27 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
}
public override string ActiveEditor => "PublicPropertyEditor";
public int Count { get; set; } = 3;
// make this public when within angle works
private double Angle { get; set; } = 360;
[DisplayName("Rotate About")]
public DirectionAxis Axis { get; set; } = new DirectionAxis() { Origin = Vector3.NegativeInfinity, Normal = Vector3.UnitZ };
public override bool CanBake => true;
public override bool CanRemove => true;
public int Count { get; set; } = 3;
[DisplayName("Rotate Part")]
[Description("Rotate the part to the same angle as the array.")]
public bool RotatePart { get; set; } = true;
// make this public when within angle works
private double Angle { get; set; } = 360;
// make this public when it works
[DisplayName("Keep Within Angle")]
[Description("Keep the entire extents of the part within the angle described.")]
private bool KeepInAngle { get; set; } = false;
[DisplayName("Rotate Part")]
[Description("Rotate the part to the same angle as the array.")]
public bool RotatePart { get; set; } = true;
public void Rebuild()
{
if (Axis.Origin.X == double.NegativeInfinity)
@ -93,5 +98,17 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
});
this.Invalidate();
}
public override void Remove()
{
this.Children.Modify(list =>
{
IObject3D firstChild = list.First();
list.Clear();
list.Add(firstChild);
});
base.Remove();
}
}
}