diff options
Diffstat (limited to 'UVtools.Core/Operations/OperationSolidify.cs')
-rw-r--r-- | UVtools.Core/Operations/OperationSolidify.cs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/UVtools.Core/Operations/OperationSolidify.cs b/UVtools.Core/Operations/OperationSolidify.cs index ca6577f..e7e8e4d 100644 --- a/UVtools.Core/Operations/OperationSolidify.cs +++ b/UVtools.Core/Operations/OperationSolidify.cs @@ -20,13 +20,18 @@ namespace UVtools.Core.Operations [Serializable] public sealed class OperationSolidify : Operation { + #region Enums public enum AreaCheckTypes { More, Less } + #endregion + + #region Members private uint _minimumArea = 1; private AreaCheckTypes _areaCheckType = AreaCheckTypes.More; + #endregion #region Overrides @@ -70,25 +75,31 @@ namespace UVtools.Core.Operations #endregion + #region Constructor + + public OperationSolidify() { } + + public OperationSolidify(FileFormat slicerFile) : base(slicerFile) { } + + #endregion + #region Methods - public override bool Execute(FileFormat slicerFile, OperationProgress progress = null) + protected override bool ExecuteInternally(OperationProgress progress) { - progress ??= new OperationProgress(); - progress.Reset(ProgressAction, LayerRangeCount); Parallel.For(LayerIndexStart, LayerIndexEnd + 1, layerIndex => { if (progress.Token.IsCancellationRequested) return; - using var mat = slicerFile[layerIndex].LayerMat; + using var mat = SlicerFile[layerIndex].LayerMat; Execute(mat); - slicerFile[layerIndex].LayerMat = mat; + SlicerFile[layerIndex].LayerMat = mat; lock (progress.Mutex) { progress++; } }); - progress.Token.ThrowIfCancellationRequested(); - return true; + + return !progress.Token.IsCancellationRequested; } public override bool Execute(Mat mat, params object[] arguments) |