diff --git a/DesignTools/Operations/ArrayAdvancedObject3D.cs b/DesignTools/Operations/ArrayAdvancedObject3D.cs index b8b617de1..852460b39 100644 --- a/DesignTools/Operations/ArrayAdvancedObject3D.cs +++ b/DesignTools/Operations/ArrayAdvancedObject3D.cs @@ -42,11 +42,19 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } public override string ActiveEditor => "PublicPropertyEditor"; + public override bool CanBake => true; + public override bool CanRemove => true; + public int Count { get; set; } = 3; + public Vector3 Offset { get; set; } = new Vector3(30, 0, 0); + public double Rotate { get; set; } = 0; - public double Scale { get; set; } = 1; + public bool RotatePart { get; set; } = true; + + public double Scale { get; set; } = 1; + public bool ScaleOffset { get; set; } = true; public void Rebuild() @@ -80,6 +88,18 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } }); } + + public override void Remove() + { + this.Children.Modify(list => + { + IObject3D firstChild = list.First(); + list.Clear(); + list.Add(firstChild); + }); + + base.Remove(); + } } public class DirectionAxis diff --git a/DesignTools/Operations/ArrayLinearObject3D.cs b/DesignTools/Operations/ArrayLinearObject3D.cs index 059f261a5..0cb434622 100644 --- a/DesignTools/Operations/ArrayLinearObject3D.cs +++ b/DesignTools/Operations/ArrayLinearObject3D.cs @@ -42,6 +42,8 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } public override string ActiveEditor => "PublicPropertyEditor"; + public override bool CanBake => true; + public override bool CanRemove => true; public int Count { get; set; } = 3; public DirectionVector Direction { get; set; } = new DirectionVector { Normal = new Vector3(1, 0, 0) }; public double Distance { get; set; } = 30; @@ -63,5 +65,17 @@ namespace MatterHackers.MatterControl.DesignTools.Operations } }); } + + public override void Remove() + { + this.Children.Modify(list => + { + IObject3D firstChild = list.First(); + list.Clear(); + list.Add(firstChild); + }); + + base.Remove(); + } } } \ No newline at end of file diff --git a/DesignTools/Operations/ArrayRadialObject3D.cs b/DesignTools/Operations/ArrayRadialObject3D.cs index 0ba892031..827604236 100644 --- a/DesignTools/Operations/ArrayRadialObject3D.cs +++ b/DesignTools/Operations/ArrayRadialObject3D.cs @@ -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(); + } } } \ No newline at end of file