Working on new 2D primitives and operations

This commit is contained in:
LarsBrubaker 2021-07-07 21:07:30 -07:00
parent 2bb944ba6f
commit 818a7fb8d7
13 changed files with 576 additions and 52 deletions

View file

@ -40,6 +40,7 @@ using MatterHackers.Agg.Transform;
using MatterHackers.Agg.UI;
using MatterHackers.Agg.VertexSource;
using MatterHackers.DataConverters3D;
using MatterHackers.DataConverters3D.UndoCommands;
using MatterHackers.Localizations;
using MatterHackers.MarchingSquares;
using MatterHackers.MatterControl.DesignTools.Operations;
@ -148,7 +149,8 @@ namespace MatterHackers.MatterControl.DesignTools
private void UpdateHistogramDisplay()
{
if (_histogramRawCache != null)
if (_histogramRawCache != null
&& _histogramDisplayCache != null)
{
var graphics2D = _histogramDisplayCache.NewGraphics2D();
graphics2D.Clear(Color.Transparent);
@ -206,6 +208,13 @@ namespace MatterHackers.MatterControl.DesignTools
this.DrawPath();
}
public override bool CanFlatten => true;
public override void Flatten(UndoBuffer undoBuffer)
{
this.FlattenToPathObject(undoBuffer);
}
public void GenerateMarchingSquaresAndLines(Action<double, string> progressReporter, ImageBuffer image, IThresholdFunction thresholdFunction)
{
if (image != null)