Skip to content

Commit

Permalink
v0.6.3.1
Browse files Browse the repository at this point in the history
* (Add) Preview: Allow import images from disk and replace preview image
* (Add) Issue and Pixel Editor ListView can now reorder columns
* (Add) Pixel Editor: Button "Clear" remove all the modifications
* (Add) Pixel Editor: Button "Apply All" to apply the modifications
* (Add) Pixel Editor: Double click items will track and position over the draw
* (Fix) Pixel Editor: Label "Operations" was not reset to 0 after apply the modifications
* (Fix) Pixel Editor: Button "Remove" tooltip
* (Fix) Pixel Editor: Drawing - Bursh Area - px to px²
  • Loading branch information
sn4k3 committed Jul 20, 2020
1 parent 97f0e38 commit 78e3520
Show file tree
Hide file tree
Showing 26 changed files with 3,231 additions and 432 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 20/07/2020 - v0.6.3.1

* (Add) Preview: Allow import images from disk and replace preview image
* (Add) Issue and Pixel Editor ListView can now reorder columns
* (Add) Pixel Editor: Button "Clear" remove all the modifications
* (Add) Pixel Editor: Button "Apply All" to apply the modifications
* (Add) Pixel Editor: Double click items will track and position over the draw
* (Fix) Pixel Editor: Label "Operations" was not reset to 0 after apply the modifications
* (Fix) Pixel Editor: Button "Remove" tooltip
* (Fix) Pixel Editor: Drawing - Bursh Area - px to px²

## 19/07/2020 - v0.6.3.0

* (Add) Layer remove button
Expand Down
10 changes: 10 additions & 0 deletions UVtools.Core/FileFormats/FileFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Text;
using System.Threading.Tasks;
using Emgu.CV;
using Emgu.CV.CvEnum;
using UVtools.Core.Extensions;
using UVtools.Core.Operations;

Expand Down Expand Up @@ -462,6 +463,15 @@ public void SetThumbnails(Mat image)
}
}

public void SetThumbnail(int index, string filePath)
{
Thumbnails[index] = CvInvoke.Imread(filePath, ImreadModes.AnyColor);
if (Thumbnails[index].Size != ThumbnailsOriginalSize[index])
{
CvInvoke.Resize(Thumbnails[index], Thumbnails[index], ThumbnailsOriginalSize[index]);
}
}

public virtual void Encode(string fileFullPath, OperationProgress progress = null)
{
FileFullPath = fileFullPath;
Expand Down
9 changes: 9 additions & 0 deletions UVtools.Core/FileFormats/IFileFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public interface IFileFormat
/// </summary>
Mat[] Thumbnails { get; set; }



/// <summary>
/// Gets the cached layers into compressed bytes
/// </summary>
Expand Down Expand Up @@ -230,6 +232,13 @@ public interface IFileFormat
/// <param name="images">Image to set</param>
void SetThumbnails(Mat images);

/// <summary>
/// Sets a thumbnail from a disk file
/// </summary>
/// <param name="index">Thumbnail index</param>
/// <param name="filePath"></param>
void SetThumbnail(int index, string filePath);

/// <summary>
/// Encode to an output file
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions UVtools.Core/PixelEditor/PixelDrainHole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class PixelDrainHole : PixelOperation
public PixelDrainHole(uint layerIndex, Point location, byte diameter) : base(PixelOperationType.DrainHole, layerIndex, location)
{
Diameter = diameter;
Size = new Size(diameter, diameter);
}
}
}
1 change: 1 addition & 0 deletions UVtools.Core/PixelEditor/PixelDrawing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public PixelDrawing(uint layerIndex, Point location, BrushShapeType brushShape,

int shiftPos = brushSize / 2;
Rectangle = new Rectangle(Math.Max(0, location.X - shiftPos), Math.Max(0, location.Y - shiftPos), brushSize-1, brushSize-1);
Size = new Size(BrushSize, BrushSize);
}
}
}
2 changes: 2 additions & 0 deletions UVtools.Core/PixelEditor/PixelOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public enum PixelOperationType : byte

public Point Location { get; }

public Size Size { get; private protected set; } = Size.Empty;


public PixelOperation(PixelOperationType operationType, uint layerIndex, Point location)
{
Expand Down
1 change: 1 addition & 0 deletions UVtools.Core/PixelEditor/PixelSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public PixelSupport(uint layerIndex, Point location, byte tipDiameter, byte pill
TipDiameter = tipDiameter;
PillarDiameter = pillarDiameter;
BaseDiameter = baseDiameter;
Size = new Size(TipDiameter, TipDiameter);
}
}
}
2 changes: 1 addition & 1 deletion UVtools.Core/UVtools.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/sn4k3/UVtools</RepositoryUrl>
<PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl>
<Description>MSLA/DLP, file analysis, repair, conversion and manipulation</Description>
<Version>0.6.3.0</Version>
<Version>0.6.3.1</Version>
<Copyright>Copyright © 2020 PTRTECH</Copyright>
<PackageIcon>UVtools.png</PackageIcon>
<Platforms>AnyCPU;x64</Platforms>
Expand Down
3 changes: 3 additions & 0 deletions UVtools.GUI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@
<setting name="FileExtractDefaultDirectory" serializeAs="String">
<value />
</setting>
<setting name="AutoZoomIssues" serializeAs="String">
<value>True</value>
</setting>
</UVtools.GUI.Properties.Settings>
</userSettings>
</configuration>
587 changes: 300 additions & 287 deletions UVtools.GUI/Forms/FrmSettings.Designer.cs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions UVtools.GUI/Forms/FrmSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public void Init()
cbLayerAutoRotateBestView.Checked = Settings.Default.LayerAutoRotateBestView;
cbLayerZoomToFit.Checked = Settings.Default.LayerZoomToFit;
cbZoomToFitPrintVolumeBounds.Checked = Settings.Default.ZoomToFitPrintVolumeBounds;
cbAutoZoomIssues.Checked = Settings.Default.AutoZoomIssues;
cbLayerDifferenceDefault.Checked = Settings.Default.LayerDifferenceDefault;
cbComputeIssuesOnLoad.Checked = Settings.Default.ComputeIssuesOnLoad;
cbComputeIslands.Checked = Settings.Default.ComputeIslands;
Expand Down Expand Up @@ -204,6 +205,7 @@ private void EventClick(object sender, EventArgs e)
Settings.Default.LayerAutoRotateBestView = cbLayerAutoRotateBestView.Checked;
Settings.Default.LayerZoomToFit = cbLayerZoomToFit.Checked;
Settings.Default.ZoomToFitPrintVolumeBounds = cbZoomToFitPrintVolumeBounds.Checked;
Settings.Default.AutoZoomIssues = cbAutoZoomIssues.Checked;
Settings.Default.LayerDifferenceDefault = cbLayerDifferenceDefault.Checked;
Settings.Default.ComputeIssuesOnLoad = cbComputeIssuesOnLoad.Checked;
Settings.Default.ComputeIslands = cbComputeIslands.Checked;
Expand Down
147 changes: 147 additions & 0 deletions UVtools.GUI/Forms/FrmToolLayerReHeight.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 106 additions & 0 deletions UVtools.GUI/Forms/FrmToolLayerReHeight.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/

using System;
using System.Globalization;
using System.Windows.Forms;


namespace UVtools.GUI.Forms
{
public partial class FrmToolLayerReHeight : Form
{
private uint LayerCount { get; }
private decimal LayerHeight { get; }

#region Constructors
public FrmToolLayerReHeight(uint layerCount, float layerHeight)
{
InitializeComponent();
DialogResult = DialogResult.Cancel;

LayerCount = layerCount;
LayerHeight = (decimal) layerHeight;

lbCurrent.Text = $"Current layers: {LayerCount} at {layerHeight}mm";

for (byte i = 2; i < 255; i++)
{
var countStr = (LayerCount / (decimal)i).ToString();
if (countStr.IndexOf(".") >= 0) continue; // Cant multiply layers
countStr = (LayerHeight / i).ToString();
int decimalCount = countStr.Substring(countStr.IndexOf(".")).Length;
if (decimalCount > 2) continue; // Cant multiply height

cbMultiplier.Items.Add($"/ {i}");
}

for (byte i = 2; i < 255; i++)
{
var countStr = (LayerCount / (decimal)i).ToString(CultureInfo.InvariantCulture);
if (countStr.IndexOf(".", StringComparison.Ordinal) >= 0) continue; // Cant multiply layers
if(LayerHeight * i > 0.2m) break;

countStr = (LayerHeight * i).ToString(CultureInfo.InvariantCulture);
int decimalCount = countStr.Substring(countStr.IndexOf(".", StringComparison.Ordinal)).Length;
if (decimalCount > 2) continue; // Cant multiply height

cbMultiplier.Items.Add($"x {i}");
}
}
#endregion

#region Overrides
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
if (e.KeyCode == Keys.Enter)
{
btnOk.PerformClick();
e.Handled = true;
return;
}
}

#endregion

#region Events
private void EventClick(object sender, EventArgs e)
{
if (ReferenceEquals(sender, btnOk))
{
if (!btnOk.Enabled) return;


if (MessageBox.Show($"Are you sure you want change layer height?", Text, MessageBoxButtons.YesNo,
MessageBoxIcon.Question) == DialogResult.Yes)
{
DialogResult = DialogResult.OK;
Close();
}

return;
}

if (ReferenceEquals(sender, btnCancel))
{
DialogResult = DialogResult.Cancel;
return;
}
}

#endregion

#region Methods


#endregion


}
}
Loading

0 comments on commit 78e3520

Please sign in to comment.