diff --git a/ApplicationView/LogoSpinner.cs b/ApplicationView/LogoSpinner.cs index e4a8c227d..8cc9dcfe3 100644 --- a/ApplicationView/LogoSpinner.cs +++ b/ApplicationView/LogoSpinner.cs @@ -69,18 +69,11 @@ namespace MatterHackers.MatterControl logoMesh.Transform(Matrix4X4.CreateScale(scale / aabb.XSize)); - var loadTime = Stopwatch.StartNew(); var anglePerDraw = 1 / MathHelper.Tau * spinSpeed; var angle = 0.0; widget.BeforeDraw += (s, e) => { - if (this.SpinLogo) - { - var thisAngle = Math.Min(anglePerDraw, loadTime.Elapsed.TotalSeconds * MathHelper.Tau); - angle += thisAngle; - loadTime.Restart(); - } var screenSpaceBounds = widget.TransformToScreenSpace(widget.LocalBounds); WorldView world = new WorldView(screenSpaceBounds.Width, screenSpaceBounds.Height); world.Translate(new Vector3(0, yOffset, 0)); @@ -91,7 +84,14 @@ namespace MatterHackers.MatterControl GLHelper.UnsetGlContext(); }; - UiThread.SetInterval(widget.Invalidate, .05, () => !widget.HasBeenClosed); + Animation spinAnimation = new Animation(widget, (time) => + { + if (this.SpinLogo) + { + angle += anglePerDraw; + } + }, + .05); } } } \ No newline at end of file diff --git a/ConfigurationPage/CalibrationSettings/CalibrationControls.cs b/ConfigurationPage/CalibrationSettings/CalibrationControls.cs index 87440f98c..98abe23fb 100644 --- a/ConfigurationPage/CalibrationSettings/CalibrationControls.cs +++ b/ConfigurationPage/CalibrationSettings/CalibrationControls.cs @@ -1,4 +1,33 @@ -using System; +/* +Copyright (c) 2018, Lars Brubaker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using System; using MatterHackers.Agg; using MatterHackers.Agg.Platform; using MatterHackers.Agg.UI; diff --git a/ConfigurationPage/PrintLeveling/InstructionsPage.cs b/ConfigurationPage/PrintLeveling/InstructionsPage.cs index 2ac877b16..1db6f885e 100644 --- a/ConfigurationPage/PrintLeveling/InstructionsPage.cs +++ b/ConfigurationPage/PrintLeveling/InstructionsPage.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/LevelWizard13PointRadial.cs b/ConfigurationPage/PrintLeveling/LevelWizard13PointRadial.cs index 60c1b6503..53c999fc6 100644 --- a/ConfigurationPage/PrintLeveling/LevelWizard13PointRadial.cs +++ b/ConfigurationPage/PrintLeveling/LevelWizard13PointRadial.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/LevelWizard3x3Mesh.cs b/ConfigurationPage/PrintLeveling/LevelWizard3x3Mesh.cs index 48e168e03..c70bd8fb8 100644 --- a/ConfigurationPage/PrintLeveling/LevelWizard3x3Mesh.cs +++ b/ConfigurationPage/PrintLeveling/LevelWizard3x3Mesh.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/LevelWizardBase.cs b/ConfigurationPage/PrintLeveling/LevelWizardBase.cs index de55fd7bb..95ff07bdf 100644 --- a/ConfigurationPage/PrintLeveling/LevelWizardBase.cs +++ b/ConfigurationPage/PrintLeveling/LevelWizardBase.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/ProbeCalibrationWizard.cs b/ConfigurationPage/PrintLeveling/ProbeCalibrationWizard.cs index 25e04fe13..42d7f3da3 100644 --- a/ConfigurationPage/PrintLeveling/ProbeCalibrationWizard.cs +++ b/ConfigurationPage/PrintLeveling/ProbeCalibrationWizard.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without @@ -45,11 +45,9 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { protected PrinterConfig printer; ThemeConfig theme; - LevelWizardBase levelWizard; public ProbeWizardControl(PrinterConfig printer, ThemeConfig theme) { - this.levelWizard = levelWizard; this.theme = theme; this.printer = printer; } diff --git a/ConfigurationPage/PrintLeveling/WizardPages/AutoProbeFeedback.cs b/ConfigurationPage/PrintLeveling/WizardPages/AutoProbeFeedback.cs index 5312a71d9..8e576fb47 100644 --- a/ConfigurationPage/PrintLeveling/WizardPages/AutoProbeFeedback.cs +++ b/ConfigurationPage/PrintLeveling/WizardPages/AutoProbeFeedback.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs b/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs index e82764088..4cb544dc6 100644 --- a/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs +++ b/ConfigurationPage/PrintLeveling/WizardPages/FindBedHeight.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/WizardPages/FirstPageInstructions.cs b/ConfigurationPage/PrintLeveling/WizardPages/FirstPageInstructions.cs index cfa250468..63e82622d 100644 --- a/ConfigurationPage/PrintLeveling/WizardPages/FirstPageInstructions.cs +++ b/ConfigurationPage/PrintLeveling/WizardPages/FirstPageInstructions.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/WizardPages/GetCoarseBedHeight.cs b/ConfigurationPage/PrintLeveling/WizardPages/GetCoarseBedHeight.cs index eb3eae265..62f0a7714 100644 --- a/ConfigurationPage/PrintLeveling/WizardPages/GetCoarseBedHeight.cs +++ b/ConfigurationPage/PrintLeveling/WizardPages/GetCoarseBedHeight.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ConfigurationPage/PrintLeveling/WizardPages/GetUltraFineBedHeight.cs b/ConfigurationPage/PrintLeveling/WizardPages/GetUltraFineBedHeight.cs index e67931035..cb5a56255 100644 --- a/ConfigurationPage/PrintLeveling/WizardPages/GetUltraFineBedHeight.cs +++ b/ConfigurationPage/PrintLeveling/WizardPages/GetUltraFineBedHeight.cs @@ -1,5 +1,5 @@ /* -Copyright (c) 2014, Lars Brubaker +Copyright (c) 2018, Lars Brubaker All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/CustomWidgets/DockingTabControl.cs b/CustomWidgets/DockingTabControl.cs index e6a1a1426..b5065fcad 100644 --- a/CustomWidgets/DockingTabControl.cs +++ b/CustomWidgets/DockingTabControl.cs @@ -333,7 +333,7 @@ namespace MatterHackers.MatterControl.CustomWidgets }); buttonView.AfterDraw += (s, e) => { - e.graphics2D.Render(rotatedLabel, ActiveTheme.Instance.PrimaryTextColor); + e.Graphics2D.Render(rotatedLabel, ActiveTheme.Instance.PrimaryTextColor); }; } diff --git a/CustomWidgets/WizardControl.cs b/CustomWidgets/WizardControl.cs index ffeef92c2..900977322 100644 --- a/CustomWidgets/WizardControl.cs +++ b/CustomWidgets/WizardControl.cs @@ -1,4 +1,33 @@ -using MatterHackers.Agg; +/* +Copyright (c) 2018, Lars Brubaker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of the FreeBSD Project. +*/ + +using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.Localizations; using MatterHackers.MatterControl.CustomWidgets; diff --git a/PartPreviewWindow/Tabs.cs b/PartPreviewWindow/Tabs.cs index b2739664c..0b465a09e 100644 --- a/PartPreviewWindow/Tabs.cs +++ b/PartPreviewWindow/Tabs.cs @@ -192,7 +192,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow leadingTabAdornment.AfterDraw += (s, e) => { var firstItem = this.AllTabs.OfType().FirstOrDefault(); - ChromeTab.DrawTabLowerRight(e.graphics2D, leadingTabAdornment.LocalBounds, (firstItem == this.ActiveTab) ? theme.ActiveTabColor : theme.InactiveTabColor); + ChromeTab.DrawTabLowerRight(e.Graphics2D, leadingTabAdornment.LocalBounds, (firstItem == this.ActiveTab) ? theme.ActiveTabColor : theme.InactiveTabColor); }; this.TabBar.ActionArea.AddChild(leadingTabAdornment); diff --git a/PartPreviewWindow/View3D/DragDropLoadProgress.cs b/PartPreviewWindow/View3D/DragDropLoadProgress.cs index f81006221..5cc60803d 100644 --- a/PartPreviewWindow/View3D/DragDropLoadProgress.cs +++ b/PartPreviewWindow/View3D/DragDropLoadProgress.cs @@ -65,19 +65,19 @@ namespace MatterHackers.MatterControl.PartPreviewWindow Vector3 renderPosition = bounds.GetBottomCorner(2); Vector2 cornerScreenSpace = view3DWidget.InteractionLayer.World.GetScreenPosition(renderPosition) - new Vector2(20, 0); - e.graphics2D.PushTransform(); - Affine currentGraphics2DTransform = e.graphics2D.GetTransform(); + e.Graphics2D.PushTransform(); + Affine currentGraphics2DTransform = e.Graphics2D.GetTransform(); Affine accumulatedTransform = currentGraphics2DTransform * Affine.NewTranslation(cornerScreenSpace.X, cornerScreenSpace.Y); - e.graphics2D.SetTransform(accumulatedTransform); + e.Graphics2D.SetTransform(accumulatedTransform); - progressBar.OnDraw(e.graphics2D); + progressBar.OnDraw(e.Graphics2D); if (!string.IsNullOrEmpty(this.State)) { - e.graphics2D.DrawString(this.State, 0, -20, 11); + e.Graphics2D.DrawString(this.State, 0, -20, 11); } - e.graphics2D.PopTransform(); + e.Graphics2D.PopTransform(); } } diff --git a/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs b/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs index 64cf8fa7c..6617a8a56 100644 --- a/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs +++ b/PartPreviewWindow/View3D/Gui3D/MoveInZControl.cs @@ -298,12 +298,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow for (int i = 0; i < lines.Count; i += 2) { // draw the measure line - drawEvent.graphics2D.Line(lines[i], lines[i + 1], Color.Black); + drawEvent.Graphics2D.Line(lines[i], lines[i + 1], Color.Black); } for (int i = 0; i < lines.Count; i += 4) { - DrawMeasureLine(drawEvent.graphics2D, (lines[i] + lines[i + 1]) / 2, (lines[i + 2] + lines[i + 3]) / 2, Color.Black, LineArrows.Both); + DrawMeasureLine(drawEvent.Graphics2D, (lines[i] + lines[i + 1]) / 2, (lines[i + 2] + lines[i + 3]) / 2, Color.Black, LineArrows.Both); } AxisAlignedBoundingBox selectedBounds = selectedItem.GetAxisAlignedBoundingBox(Matrix4X4.Identity); diff --git a/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs b/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs index da9a35d43..6773d989d 100644 --- a/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs +++ b/PartPreviewWindow/View3D/Gui3D/SnapingIndicator.cs @@ -123,8 +123,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (drawEvent != null) { // draw the line that is on the ground - drawEvent.graphics2D.Line(lines[0], lines[1], Color.Red); - drawEvent.graphics2D.Line(lines[2], lines[3], Color.Red); + drawEvent.Graphics2D.Line(lines[0], lines[1], Color.Red); + drawEvent.Graphics2D.Line(lines[2], lines[3], Color.Red); } } } diff --git a/PartPreviewWindow/View3D/InteractionLayer.cs b/PartPreviewWindow/View3D/InteractionLayer.cs index 50dc07ac3..57d4fbaef 100644 --- a/PartPreviewWindow/View3D/InteractionLayer.cs +++ b/PartPreviewWindow/View3D/InteractionLayer.cs @@ -131,9 +131,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow Vector3 topEndPosition = Vector3.Transform(x.Bvh.GetAxisAlignedBoundingBox().GetTopCorner((i + 1) % 4), x.TransformToWorld); var topEndScreenPos = World.GetScreenPosition(topEndPosition); - e.graphics2D.Line(bottomStartScreenPos, bottomEndScreenPos, Color.Black); - e.graphics2D.Line(topStartScreenPos, topEndScreenPos, Color.Black); - e.graphics2D.Line(topStartScreenPos, bottomStartScreenPos, Color.Black); + e.Graphics2D.Line(bottomStartScreenPos, bottomEndScreenPos, Color.Black); + e.Graphics2D.Line(topStartScreenPos, topEndScreenPos, Color.Black); + e.Graphics2D.Line(topStartScreenPos, bottomStartScreenPos, Color.Black); } TriangleShape tri = x.Bvh as TriangleShape; @@ -145,7 +145,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var screenCenter = Vector3.Transform(vertexPos, x.TransformToWorld); var screenPos = World.GetScreenPosition(screenCenter); - e.graphics2D.Circle(screenPos, 3, Color.Red); + e.Graphics2D.Circle(screenPos, 3, Color.Red); } } else @@ -153,8 +153,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow var center = x.Bvh.GetCenter(); var worldCenter = Vector3.Transform(center, x.TransformToWorld); var screenPos2 = World.GetScreenPosition(worldCenter); - e.graphics2D.Circle(screenPos2, 3, Color.Yellow); - e.graphics2D.DrawString($"{x.Depth},", screenPos2.X + 12 * x.Depth, screenPos2.Y); + e.Graphics2D.Circle(screenPos2, 3, Color.Yellow); + e.Graphics2D.DrawString($"{x.Depth},", screenPos2.X + 12 * x.Depth, screenPos2.Y); } } } diff --git a/PartPreviewWindow/View3D/MeshViewerWidget.cs b/PartPreviewWindow/View3D/MeshViewerWidget.cs index c53e034d9..2ccb5dedc 100644 --- a/PartPreviewWindow/View3D/MeshViewerWidget.cs +++ b/PartPreviewWindow/View3D/MeshViewerWidget.cs @@ -55,7 +55,7 @@ namespace MatterHackers.MeshVisualizer public bool ZBuffered { get; } public DrawGlContentEventArgs(bool zBuffered, DrawEventArgs e) - : base(e.graphics2D) + : base(e.Graphics2D) { ZBuffered = zBuffered; } @@ -223,8 +223,8 @@ namespace MatterHackers.MeshVisualizer { foreach (var child in scene.Children) { - this.World.RenderDebugAABB(e.graphics2D, child.TraceData().GetAxisAlignedBoundingBox()); - this.World.RenderDebugAABB(e.graphics2D, child.GetAxisAlignedBoundingBox(Matrix4X4.Identity)); + this.World.RenderDebugAABB(e.Graphics2D, child.TraceData().GetAxisAlignedBoundingBox()); + this.World.RenderDebugAABB(e.Graphics2D, child.GetAxisAlignedBoundingBox(Matrix4X4.Identity)); } }; } diff --git a/PartPreviewWindow/View3D/View3DWidget.cs b/PartPreviewWindow/View3D/View3DWidget.cs index b4bc17ce2..bc2a06a9c 100644 --- a/PartPreviewWindow/View3D/View3DWidget.cs +++ b/PartPreviewWindow/View3D/View3DWidget.cs @@ -643,7 +643,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow if (DragSelectionInProgress) { var selectionRectangle = new RectangleDouble(DragSelectionStartPosition, DragSelectionEndPosition); - e.graphics2D.Rectangle(selectionRectangle, Color.Red); + e.Graphics2D.Rectangle(selectionRectangle, Color.Red); } } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 6e1cea81b..fa422c60d 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 6e1cea81b37d3e30ce31a7f0e62fc13740b8ae17 +Subproject commit fa422c60d59bd77009a30303b58ecb5ebc07ee8e