diff options
Diffstat (limited to 'UVtools.Core/Operations/OperationRotate.cs')
-rw-r--r-- | UVtools.Core/Operations/OperationRotate.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/UVtools.Core/Operations/OperationRotate.cs b/UVtools.Core/Operations/OperationRotate.cs index f9a864e..c428b6c 100644 --- a/UVtools.Core/Operations/OperationRotate.cs +++ b/UVtools.Core/Operations/OperationRotate.cs @@ -42,6 +42,14 @@ namespace UVtools.Core.Operations } #endregion + #region Constructor + + public OperationRotate() { } + + public OperationRotate(FileFormat slicerFile) : base(slicerFile) { } + + #endregion + #region Properties public decimal AngleDegrees { @@ -74,24 +82,21 @@ namespace UVtools.Core.Operations #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) |