blob: 843c096e10977bad043301b7ef3130575fdefd35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;
using UVtools.WPF.Windows;
namespace UVtools.WPF.Controls.Tools
{
public class ToolRepairLayersControl : ToolControl
{
public OperationRepairLayers Operation { get; }
public ToolRepairLayersControl()
{
InitializeComponent();
BaseOperation = Operation = new OperationRepairLayers
{
RepairIslands = UserSettings.Instance.LayerRepair.RepairIslands,
RepairResinTraps = UserSettings.Instance.LayerRepair.RepairResinTraps,
RemoveEmptyLayers = UserSettings.Instance.LayerRepair.RemoveEmptyLayers,
RemoveIslandsBelowEqualPixelCount = UserSettings.Instance.LayerRepair.RemoveIslandsBelowEqualPixels,
RemoveIslandsRecursiveIterations = UserSettings.Instance.LayerRepair.RemoveIslandsRecursiveIterations,
GapClosingIterations = UserSettings.Instance.LayerRepair.ClosingIterations,
NoiseRemovalIterations = UserSettings.Instance.LayerRepair.OpeningIterations,
};
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public override void Callback(ToolWindow.Callbacks callback)
{
switch (callback)
{
case ToolWindow.Callbacks.Init:
ParentWindow.LayerRangeVisible = false;
ParentWindow.IsCheckBox1Visible = true;
break;
case ToolWindow.Callbacks.Checkbox1:
ParentWindow.LayerRangeVisible = ParentWindow.IsCheckBox1Checked;
if (!ParentWindow.IsCheckBox1Checked)
{
ParentWindow.SelectAllLayers();
}
break;
}
}
}
}
|