From 05724383b849ad12a3eaa79d16df1fdb7ce6a726 Mon Sep 17 00:00:00 2001 From: larsbrubaker Date: Fri, 7 Feb 2014 12:03:32 -0800 Subject: [PATCH] Got the rest of circular beds working. --- PartPreviewWindow/PartPreviewMainWindow.cs | 24 ++++++--------- SliceConfiguration/ActiveSliceSettings.cs | 36 +++++++++++++++++----- SliceConfiguration/SettingsControlBar.cs | 2 +- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/PartPreviewWindow/PartPreviewMainWindow.cs b/PartPreviewWindow/PartPreviewMainWindow.cs index 82388097c..604b86697 100644 --- a/PartPreviewWindow/PartPreviewMainWindow.cs +++ b/PartPreviewWindow/PartPreviewMainWindow.cs @@ -28,22 +28,15 @@ either expressed or implied, of the FreeBSD Project. */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.IO; using System.Diagnostics; - +using System.IO; using MatterHackers.Agg; -using MatterHackers.Agg.Image; using MatterHackers.Agg.UI; -using MatterHackers.Agg.OpenGlGui; -using MatterHackers.PolygonMesh; -using MatterHackers.RenderOpenGl; -using MatterHackers.VectorMath; +using MatterHackers.Agg.Font; +using MatterHackers.Localizations; using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrintQueue; -using MatterHackers.Localizations; +using MatterHackers.VectorMath; namespace MatterHackers.MatterControl.PartPreviewWindow { @@ -116,9 +109,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow #if false if (timingWindow == null) { - timingWindow = new PerformanceFeedbackWindow(); - } - { + string staticDataPath = ApplicationDataStorage.Instance.ApplicationStaticDataPath; + string fontPath = Path.Combine(staticDataPath, "Fonts", "LiberationMono.svg"); + TypeFace boldTypeFace = TypeFace.LoadSVG(fontPath); + timingWindow = new PerformanceFeedbackWindow(new StyledTypeFace(boldTypeFace, 12)); + //} + //{ timingWindow.ShowResults(totalDrawTime.Elapsed.TotalSeconds); } #endif diff --git a/SliceConfiguration/ActiveSliceSettings.cs b/SliceConfiguration/ActiveSliceSettings.cs index 2a9e06b65..93db6b6f4 100644 --- a/SliceConfiguration/ActiveSliceSettings.cs +++ b/SliceConfiguration/ActiveSliceSettings.cs @@ -89,16 +89,36 @@ namespace MatterHackers.MatterControl { Vector2 bedSize = ActiveSliceSettings.Instance.BedSize; Vector2 printCenter = ActiveSliceSettings.Instance.PrintCenter; - switch (index) + + switch (BedShape) { - case 0: - return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8); - case 1: - return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); - case 2: - return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + case MeshVisualizer.MeshViewerWidget.BedShape.Circular: + Vector2 firstPosition = new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8); + switch (index) + { + case 0: + return firstPosition; + case 1: + return Vector2.Rotate(firstPosition, MathHelper.Tau / 3); + case 2: + return Vector2.Rotate(firstPosition, MathHelper.Tau * 2 / 3); + default: + throw new IndexOutOfRangeException(); + } + + case MeshVisualizer.MeshViewerWidget.BedShape.Rectangular: default: - throw new IndexOutOfRangeException(); + switch (index) + { + case 0: + return new Vector2(printCenter.x, printCenter.y + (bedSize.y / 2) * .8); + case 1: + return new Vector2(printCenter.x - (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + case 2: + return new Vector2(printCenter.x + (bedSize.x / 2) * .8, printCenter.y - (bedSize.y / 2) * .8); + default: + throw new IndexOutOfRangeException(); + } } } diff --git a/SliceConfiguration/SettingsControlBar.cs b/SliceConfiguration/SettingsControlBar.cs index f84acf8a1..b197ef7ad 100644 --- a/SliceConfiguration/SettingsControlBar.cs +++ b/SliceConfiguration/SettingsControlBar.cs @@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl settingsStatusLabelContainer.VAnchor |= VAnchor.ParentTop; settingsStatusLabelContainer.Margin = new BorderDouble(0); { - string activeSettingsLabelText = new LocalizedString ("Active Settings:").Translated; + string activeSettingsLabelText = new LocalizedString ("Active Settings").Translated; string activeSettingsLabelTextFull = string.Format ("{0}:", activeSettingsLabelText);