blob: 0c317d85b5f8ff13225128997d35d1bf9d9e5751 (
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 => BaseOperation as OperationRepairLayers;
public ToolRepairLayersControl()
{
InitializeComponent();
BaseOperation = 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;
}
}
}
}
|