renaming
This commit is contained in:
parent
b664670a42
commit
2144ed477f
32 changed files with 81 additions and 81 deletions
|
|
@ -1504,7 +1504,7 @@ namespace MatterHackers.MatterControl
|
||||||
{
|
{
|
||||||
return selectedItem is GroupObject3D
|
return selectedItem is GroupObject3D
|
||||||
|| selectedItem.GetType() == typeof(Object3D)
|
|| selectedItem.GetType() == typeof(Object3D)
|
||||||
|| selectedItem.CanFlatten;
|
|| selectedItem.CanApply;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public char Letter { get; set; } = 'a';
|
public char Letter { get; set; } = 'a';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
|
|
||||||
//public override bool Persistable { get => PermissionCheckRequest.UserAuthorized(permissionKey); }
|
//public override bool Persistable { get => PermissionCheckRequest.UserAuthorized(permissionKey); }
|
||||||
|
|
||||||
public override bool CanFlatten => Persistable;
|
public override bool CanApply => Persistable;
|
||||||
|
|
||||||
public override bool CanEdit => Persistable;
|
public override bool CanEdit => Persistable;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
Name = "Fit to Bounds".Localize();
|
Name = "Fit to Bounds".Localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -124,7 +124,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
Parent?.Invalidate(new InvalidateArgs(this, InvalidateType.Children));
|
Parent?.Invalidate(new InvalidateArgs(this, InvalidateType.Children));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
[Slider(-20, 20, useSnappingGrid: true)]
|
[Slider(-20, 20, useSnappingGrid: true)]
|
||||||
public DoubleOrExpression ZOffset { get; set; } = 0;
|
public DoubleOrExpression ZOffset { get; set; } = 0;
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
private List<Aabb> CurrentChildrenBounds
|
private List<Aabb> CurrentChildrenBounds
|
||||||
{
|
{
|
||||||
|
|
@ -391,14 +391,14 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
// put everything back to where it was before the arrange started
|
// put everything back to where it was before the arrange started
|
||||||
ResetPositions();
|
ResetPositions();
|
||||||
|
|
||||||
base.Remove(undoBuffer);
|
base.Cancel(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
Invalidate(InvalidateType.Children);
|
Invalidate(InvalidateType.Children);
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
Name = "Advanced Array".Localize();
|
Name = "Advanced Array".Localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override IntOrExpression Count { get; set; } = 3;
|
public override IntOrExpression Count { get; set; } = 3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
Name = "Linear Array".Localize();
|
Name = "Linear Array".Localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
[Slider(2, 10, Easing.EaseType.Quadratic, snapDistance: 1)]
|
[Slider(2, 10, Easing.EaseType.Quadratic, snapDistance: 1)]
|
||||||
public override IntOrExpression Count { get; set; } = 3;
|
public override IntOrExpression Count { get; set; } = 3;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
{
|
{
|
||||||
public abstract IntOrExpression Count { get; set; }
|
public abstract IntOrExpression Count { get; set; }
|
||||||
|
|
||||||
public override void Flatten(Agg.UI.UndoBuffer undoBuffer)
|
public override void Apply(Agg.UI.UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
// convert [index] expressions to their constant values
|
// convert [index] expressions to their constant values
|
||||||
foreach (var item in this.Descendants((item) => !(item is ArrayObject3D)))
|
foreach (var item in this.Descendants((item) => !(item is ArrayObject3D)))
|
||||||
|
|
@ -47,8 +47,8 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// then call base flatten
|
// then call base apply
|
||||||
base.Flatten(undoBuffer);
|
base.Apply(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void ProcessIndexExpressions()
|
internal void ProcessIndexExpressions()
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
[DisplayName("Rotate About")]
|
[DisplayName("Rotate About")]
|
||||||
public DirectionAxis Axis { get; set; } = new DirectionAxis() { Origin = Vector3.NegativeInfinity, Normal = Vector3.UnitZ };
|
public DirectionAxis Axis { get; set; } = new DirectionAxis() { Origin = Vector3.NegativeInfinity, Normal = Vector3.UnitZ };
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override IntOrExpression Count { get; set; } = 3;
|
public override IntOrExpression Count { get; set; } = 3;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,14 +80,14 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
return (mesh, slice);
|
return (mesh, slice);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
var newPathObject = new PathObject3D()
|
var newPathObject = new PathObject3D()
|
||||||
{
|
{
|
||||||
VertexSource = new VertexStorage(this.VertexSource)
|
VertexSource = new VertexStorage(this.VertexSource)
|
||||||
};
|
};
|
||||||
|
|
||||||
base.Flatten(undoBuffer, new IObject3D[] { newPathObject });
|
base.Apply(undoBuffer, new IObject3D[] { newPathObject });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveFacesAboveCut(Mesh mesh)
|
private void RemoveFacesAboveCut(Mesh mesh)
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
{
|
{
|
||||||
public class GroupObject3D : Object3D
|
public class GroupObject3D : Object3D
|
||||||
{
|
{
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public GroupObject3D()
|
public GroupObject3D()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -214,9 +214,9 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
this.DrawPath();
|
this.DrawPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
this.FlattenToPathObject(undoBuffer);
|
this.FlattenToPathObject(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,12 +185,12 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
this.DrawPath();
|
this.DrawPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
[HideFromEditor]
|
[HideFromEditor]
|
||||||
public int NumLineLoops { get; set; }
|
public int NumLineLoops { get; set; }
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
this.FlattenToPathObject(undoBuffer);
|
this.FlattenToPathObject(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
public IntOrExpression BevelSteps { get; set; } = 1;
|
public IntOrExpression BevelSteps { get; set; } = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
private IVertexSource VertexSource
|
private IVertexSource VertexSource
|
||||||
|
|
@ -90,11 +90,11 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
if (Mesh == null)
|
if (Mesh == null)
|
||||||
{
|
{
|
||||||
Remove(undoBuffer);
|
Cancel(undoBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,9 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
this.DrawPath();
|
this.DrawPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
this.FlattenToPathObject(undoBuffer);
|
this.FlattenToPathObject(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
[Slider(3, 360, Easing.EaseType.Quadratic, snapDistance: 1)]
|
[Slider(3, 360, Easing.EaseType.Quadratic, snapDistance: 1)]
|
||||||
public IntOrExpression Sides { get; set; } = 30;
|
public IntOrExpression Sides { get; set; } = 30;
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
private IVertexSource VertexSource
|
private IVertexSource VertexSource
|
||||||
|
|
@ -80,11 +80,11 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
if (Mesh == null)
|
if (Mesh == null)
|
||||||
{
|
{
|
||||||
Remove(undoBuffer);
|
Cancel(undoBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
Name = "Transform Wrapper".Localize();
|
Name = "Transform Wrapper".Localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public AscendableSafeList<IObject3D> UntransformedChildren
|
public AscendableSafeList<IObject3D> UntransformedChildren
|
||||||
|
|
@ -77,7 +77,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
Invalidate(InvalidateType.Children);
|
Invalidate(InvalidateType.Children);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
Name = "Base".Localize();
|
Name = "Base".Localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
[EnumDisplay(Mode = EnumDisplayAttribute.PresentationMode.Tabs)]
|
[EnumDisplay(Mode = EnumDisplayAttribute.PresentationMode.Tabs)]
|
||||||
public BaseTypes BaseType { get; set; } = BaseTypes.Circle;
|
public BaseTypes BaseType { get; set; } = BaseTypes.Circle;
|
||||||
|
|
@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
[EnumDisplay(Mode = EnumDisplayAttribute.PresentationMode.Buttons)]
|
[EnumDisplay(Mode = EnumDisplayAttribute.PresentationMode.Buttons)]
|
||||||
public CenteringTypes Centering { get; set; } = CenteringTypes.Weighted;
|
public CenteringTypes Centering { get; set; } = CenteringTypes.Weighted;
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -127,7 +127,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Remove(undoBuffer);
|
base.Cancel(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private (IVertexSource vertexSource, double height) meshVertexCache;
|
private (IVertexSource vertexSource, double height) meshVertexCache;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => !Finalized || Persistable;
|
public override bool CanApply => !Finalized || Persistable;
|
||||||
|
|
||||||
public override bool Persistable => ApplicationController.Instance.UserHasPermission(this);
|
public override bool Persistable => ApplicationController.Instance.UserHasPermission(this);
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
[Description("MatterHackers Internal Use")]
|
[Description("MatterHackers Internal Use")]
|
||||||
public bool ProOnly { get; set; }
|
public bool ProOnly { get; set; }
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
// we want to end up with just a group of all the visible mesh objects
|
// we want to end up with just a group of all the visible mesh objects
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
|
|
@ -132,7 +132,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
Invalidate(InvalidateType.Children);
|
Invalidate(InvalidateType.Children);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
// Custom remove for ImageConverter
|
// Custom remove for ImageConverter
|
||||||
if (this.ComponentID == ImageConverterComponentID)
|
if (this.ComponentID == ImageConverterComponentID)
|
||||||
|
|
@ -190,7 +190,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// remove the component and leave the inside parts
|
// remove the component and leave the inside parts
|
||||||
base.Remove(undoBuffer);
|
base.Cancel(undoBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,14 +183,14 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
if (markdownWidget != null)
|
if (markdownWidget != null)
|
||||||
{
|
{
|
||||||
markdownWidget.Close();
|
markdownWidget.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Remove(undoBuffer);
|
base.Cancel(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async void OnInvalidate(InvalidateArgs invalidateArgs)
|
public override async void OnInvalidate(InvalidateArgs invalidateArgs)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
Name = "Image".Localize();
|
Name = "Image".Localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => false;
|
public override bool CanApply => false;
|
||||||
|
|
||||||
[GoogleSearch]
|
[GoogleSearch]
|
||||||
public string ImageSearch { get; set; } = "";
|
public string ImageSearch { get; set; } = "";
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
set => base.Mesh = value;
|
set => base.Mesh = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override bool Persistable
|
public override bool Persistable
|
||||||
{
|
{
|
||||||
|
|
@ -114,12 +114,12 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
Flatten(undoBuffer, null);
|
Apply(undoBuffer, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Flatten(UndoBuffer undoBuffer, IEnumerable<IObject3D> extraItems)
|
protected void Apply(UndoBuffer undoBuffer, IEnumerable<IObject3D> extraItems)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -159,7 +159,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
|
|
||||||
// add flatten to the name to show what happened
|
// add flatten to the name to show what happened
|
||||||
newChildren[0].Name = this.Name + " - " + "Flattened".Localize();
|
newChildren[0].Name = this.Name;
|
||||||
|
|
||||||
// and replace us with the children
|
// and replace us with the children
|
||||||
var replaceCommand = new ReplaceCommand(new[] { this }, newChildren);
|
var replaceCommand = new ReplaceCommand(new[] { this }, newChildren);
|
||||||
|
|
@ -211,7 +211,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -304,7 +304,7 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||||
|
|
||||||
public class OperationSourceObject3D : Object3D
|
public class OperationSourceObject3D : Object3D
|
||||||
{
|
{
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public OperationSourceObject3D()
|
public OperationSourceObject3D()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
{
|
{
|
||||||
private static Mesh shape = null;
|
private static Mesh shape = null;
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public TemperatureTowerObject3D()
|
public TemperatureTowerObject3D()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -80,9 +80,9 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public NamedTypeFace Font { get; set; } = NamedTypeFace.Nunito_Bold;
|
public NamedTypeFace Font { get; set; } = NamedTypeFace.Nunito_Bold;
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
// change this from a text object to a group
|
// change this from a text object to a group
|
||||||
var newContainer = new GroupObject3D();
|
var newContainer = new GroupObject3D();
|
||||||
|
|
@ -96,7 +96,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
}
|
}
|
||||||
|
|
||||||
undoBuffer.AddAndDo(new ReplaceCommand(new[] { this }, new[] { newContainer }));
|
undoBuffer.AddAndDo(new ReplaceCommand(new[] { this }, new[] { newContainer }));
|
||||||
newContainer.Name = this.Name + " - " + "Flattened".Localize();
|
newContainer.Name = this.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async void OnInvalidate(InvalidateArgs invalidateArgs)
|
public override async void OnInvalidate(InvalidateArgs invalidateArgs)
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,11 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public NamedTypeFace Font { get; set; } = new NamedTypeFace();
|
public NamedTypeFace Font { get; set; } = new NamedTypeFace();
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public IVertexSource VertexSource { get; set; } = new VertexStorage();
|
public IVertexSource VertexSource { get; set; } = new VertexStorage();
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
// change this from a text object to a group
|
// change this from a text object to a group
|
||||||
var newContainer = new GroupObject3D();
|
var newContainer = new GroupObject3D();
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
[DisplayName("Material")]
|
[DisplayName("Material")]
|
||||||
public int CalibrationMaterialIndex { get; set; } = 1;
|
public int CalibrationMaterialIndex { get; set; } = 1;
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public double ChangingHeight { get; set; } = .4;
|
public double ChangingHeight { get; set; } = .4;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl.DesignTools
|
||||||
[DisplayName("Material")]
|
[DisplayName("Material")]
|
||||||
public int CalibrationMaterialIndex { get; set; } = 1;
|
public int CalibrationMaterialIndex { get; set; } = 1;
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public double ChangeHeight { get; set; } = .4;
|
public double ChangeHeight { get; set; } = .4;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,20 +88,20 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
|
|
||||||
// put in a make permanent button
|
// put in a make permanent button
|
||||||
var icon = StaticData.Instance.LoadIcon("apply.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply();
|
var icon = StaticData.Instance.LoadIcon("apply.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply();
|
||||||
flattenButton = new IconButton(icon, theme)
|
applyButton = new IconButton(icon, theme)
|
||||||
{
|
{
|
||||||
Margin = theme.ButtonSpacing,
|
Margin = theme.ButtonSpacing,
|
||||||
ToolTipText = "Apply".Localize(),
|
ToolTipText = "Apply".Localize(),
|
||||||
Enabled = true
|
Enabled = true
|
||||||
};
|
};
|
||||||
flattenButton.Click += (s, e) =>
|
applyButton.Click += (s, e) =>
|
||||||
{
|
{
|
||||||
if (this.item.CanFlatten)
|
if (this.item.CanApply)
|
||||||
{
|
{
|
||||||
var item = this.item;
|
var item = this.item;
|
||||||
using (new SelectionMaintainer(view3DWidget.Scene))
|
using (new SelectionMaintainer(view3DWidget.Scene))
|
||||||
{
|
{
|
||||||
item.Flatten(view3DWidget.Scene.UndoBuffer);
|
item.Apply(view3DWidget.Scene.UndoBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -110,24 +110,24 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
sceneContext.Scene.UngroupSelection();
|
sceneContext.Scene.UngroupSelection();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
toolbar.AddChild(flattenButton);
|
toolbar.AddChild(applyButton);
|
||||||
|
|
||||||
// put in a remove button
|
// put in a remove button
|
||||||
removeButton = new IconButton(StaticData.Instance.LoadIcon("cancel.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply(), theme)
|
cancelButton = new IconButton(StaticData.Instance.LoadIcon("cancel.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply(), theme)
|
||||||
{
|
{
|
||||||
Margin = theme.ButtonSpacing,
|
Margin = theme.ButtonSpacing,
|
||||||
ToolTipText = "Cancel".Localize(),
|
ToolTipText = "Cancel".Localize(),
|
||||||
Enabled = scene.SelectedItem != null
|
Enabled = scene.SelectedItem != null
|
||||||
};
|
};
|
||||||
removeButton.Click += (s, e) =>
|
cancelButton.Click += (s, e) =>
|
||||||
{
|
{
|
||||||
var item = this.item;
|
var item = this.item;
|
||||||
using (new SelectionMaintainer(view3DWidget.Scene))
|
using (new SelectionMaintainer(view3DWidget.Scene))
|
||||||
{
|
{
|
||||||
item.Remove(view3DWidget.Scene.UndoBuffer);
|
item.Cancel(view3DWidget.Scene.UndoBuffer);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
toolbar.AddChild(removeButton);
|
toolbar.AddChild(cancelButton);
|
||||||
|
|
||||||
overflowButton = new OverflowBar.OverflowMenuButton(theme)
|
overflowButton = new OverflowBar.OverflowMenuButton(theme)
|
||||||
{
|
{
|
||||||
|
|
@ -171,8 +171,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
public GuiWidget ContentPanel { get; set; }
|
public GuiWidget ContentPanel { get; set; }
|
||||||
|
|
||||||
private readonly JsonPathContext pathGetter = new JsonPathContext();
|
private readonly JsonPathContext pathGetter = new JsonPathContext();
|
||||||
private readonly IconButton flattenButton;
|
private readonly IconButton applyButton;
|
||||||
private readonly IconButton removeButton;
|
private readonly IconButton cancelButton;
|
||||||
private readonly OverflowBar.OverflowMenuButton overflowButton;
|
private readonly OverflowBar.OverflowMenuButton overflowButton;
|
||||||
private readonly InteractiveScene scene;
|
private readonly InteractiveScene scene;
|
||||||
private readonly FlowLayoutWidget primaryActionsPanel;
|
private readonly FlowLayoutWidget primaryActionsPanel;
|
||||||
|
|
@ -472,11 +472,11 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
|
|
||||||
var selectedItem = scene.SelectedItem;
|
var selectedItem = scene.SelectedItem;
|
||||||
|
|
||||||
flattenButton.Enabled = selectedItem != null
|
applyButton.Enabled = selectedItem != null
|
||||||
&& (selectedItem is GroupObject3D
|
&& (selectedItem is GroupObject3D
|
||||||
|| (selectedItem.GetType() == typeof(Object3D) && selectedItem.Children.Any())
|
|| (selectedItem.GetType() == typeof(Object3D) && selectedItem.Children.Any())
|
||||||
|| selectedItem.CanFlatten);
|
|| selectedItem.CanApply);
|
||||||
removeButton.Enabled = selectedItem != null;
|
cancelButton.Enabled = selectedItem != null;
|
||||||
overflowButton.Enabled = selectedItem != null;
|
overflowButton.Enabled = selectedItem != null;
|
||||||
if (selectedItem == null)
|
if (selectedItem == null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -160,7 +160,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
||||||
.Select((mw) => (mw.Children.First(), mw));
|
.Select((mw) => (mw.Children.First(), mw));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Remove(UndoBuffer undoBuffer)
|
public override void Cancel(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
using (RebuildLock())
|
using (RebuildLock())
|
||||||
{
|
{
|
||||||
|
|
@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
||||||
var meshWrappers = thisClone.Descendants().Where(o => o.OwnerID == thisClone.ID).ToArray();
|
var meshWrappers = thisClone.Descendants().Where(o => o.OwnerID == thisClone.ID).ToArray();
|
||||||
foreach (var meshWrapper in meshWrappers)
|
foreach (var meshWrapper in meshWrappers)
|
||||||
{
|
{
|
||||||
meshWrapper.Remove(null);
|
meshWrapper.Cancel(null);
|
||||||
}
|
}
|
||||||
foreach (var child in thisClone.Children)
|
foreach (var child in thisClone.Children)
|
||||||
{
|
{
|
||||||
|
|
@ -218,7 +218,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
||||||
while (remove is ModifiedMeshObject3D)
|
while (remove is ModifiedMeshObject3D)
|
||||||
{
|
{
|
||||||
var hold = remove;
|
var hold = remove;
|
||||||
remove.Remove(null);
|
remove.Cancel(null);
|
||||||
remove = hold.Parent;
|
remove = hold.Parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.View3D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanFlatten => true;
|
public override bool CanApply => true;
|
||||||
|
|
||||||
public override void Flatten(UndoBuffer undoBuffer)
|
public override void Apply(UndoBuffer undoBuffer)
|
||||||
{
|
{
|
||||||
this.FlattenToPathObject(undoBuffer);
|
this.FlattenToPathObject(undoBuffer);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
||||||
var selectedItem = scene.SelectedItem;
|
var selectedItem = scene.SelectedItem;
|
||||||
if (selectedItem != null)
|
if (selectedItem != null)
|
||||||
{
|
{
|
||||||
if (selectedItem.CanFlatten)
|
if (selectedItem.CanApply)
|
||||||
{
|
{
|
||||||
selectedItem.Flatten(scene.UndoBuffer);
|
selectedItem.Apply(scene.UndoBuffer);
|
||||||
scene.SelectedItem = null;
|
scene.SelectedItem = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit a9861d4a5c96a88232a3c266cefbd217c43ed9fc
|
Subproject commit 0c7af4c7815c45b357f9a065188bf1a1befdf712
|
||||||
Loading…
Add table
Add a link
Reference in a new issue