Bladeren bron

removed old code

Martin Edlund 5 jaren geleden
bovenliggende
commit
96bf4a13a4
32 gewijzigde bestanden met toevoegingen van 0 en 3901 verwijderingen
  1. 0 20
      SketchAssistant/SketchAssistant.Tests/Properties/AssemblyInfo.cs
  2. 0 74
      SketchAssistant/SketchAssistant.Tests/SketchAssistant.Tests.csproj
  3. 0 275
      SketchAssistant/SketchAssistant.Tests/UnitTest1.cs
  4. 0 11
      SketchAssistant/SketchAssistant.Tests/app.config
  5. 0 6
      SketchAssistant/SketchAssistant.Tests/packages.config
  6. 0 107
      SketchAssistant/SketchAssistant/ActionHistory.cs
  7. 0 14
      SketchAssistant/SketchAssistant/App.config
  8. 0 144
      SketchAssistant/SketchAssistant/FileImporter.cs
  9. 0 26
      SketchAssistant/SketchAssistant/FileImporterException.cs
  10. 0 294
      SketchAssistant/SketchAssistant/Form1.Designer.cs
  11. 0 323
      SketchAssistant/SketchAssistant/Form1.cs
  12. 0 217
      SketchAssistant/SketchAssistant/Form1.resx
  13. 0 204
      SketchAssistant/SketchAssistant/GeometryCalculator.cs
  14. 0 152
      SketchAssistant/SketchAssistant/Line.cs
  15. 0 568
      SketchAssistant/SketchAssistant/MVP_Model.cs
  16. 0 310
      SketchAssistant/SketchAssistant/MVP_Presenter.cs
  17. 0 71
      SketchAssistant/SketchAssistant/MVP_View.cs
  18. 0 22
      SketchAssistant/SketchAssistant/Program.cs
  19. 0 36
      SketchAssistant/SketchAssistant/Properties/AssemblyInfo.cs
  20. 0 71
      SketchAssistant/SketchAssistant/Properties/Resources.Designer.cs
  21. 0 117
      SketchAssistant/SketchAssistant/Properties/Resources.resx
  22. 0 30
      SketchAssistant/SketchAssistant/Properties/Settings.Designer.cs
  23. 0 7
      SketchAssistant/SketchAssistant/Properties/Settings.settings
  24. 0 251
      SketchAssistant/SketchAssistant/RedrawAssistant.cs
  25. 0 98
      SketchAssistant/SketchAssistant/SketchAction.cs
  26. 0 131
      SketchAssistant/SketchAssistant/SketchAssistant.csproj
  27. 0 6
      SketchAssistant/SketchAssistant/packages.config
  28. 0 23
      SketchAssistant/SketchAssistantWPF.Tests/SketchAssistantWPF.Tests.csproj
  29. 0 287
      SketchAssistant/SketchAssistantWPF.Tests/UnitTest1.cs
  30. 0 1
      SketchAssistant/SketchAssistantWPF/SketchAssistantWPF.csproj
  31. 0 4
      SketchAssistant/SketchAssistantWPF/packages.config
  32. 0 1
      SketchAssistant/WhiteTests/packages.config

+ 0 - 20
SketchAssistant/SketchAssistant.Tests/Properties/AssemblyInfo.cs

@@ -1,20 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("SketchAssistant.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SketchAssistant.Tests")]
-[assembly: AssemblyCopyright("Copyright ©  2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("7dcdc31a-8291-4b05-93d6-dcc5de27a4a0")]
-
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 0 - 74
SketchAssistant/SketchAssistant.Tests/SketchAssistant.Tests.csproj

@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props')" />
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{7DCDC31A-8291-4B05-93D6-DCC5DE27A4A0}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>SketchAssistant.Tests</RootNamespace>
-    <AssemblyName>SketchAssistant.Tests</AssemblyName>
-    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
-    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
-    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
-    <IsCodedUITest>False</IsCodedUITest>
-    <TestProjectType>UnitTest</TestProjectType>
-    <NuGetPackageImportStamp>
-    </NuGetPackageImportStamp>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
-    </Reference>
-    <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Windows.Forms" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="UnitTest1.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="app.config" />
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props'))" />
-    <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets'))" />
-  </Target>
-  <Import Project="..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets')" />
-</Project>

+ 0 - 275
SketchAssistant/SketchAssistant.Tests/UnitTest1.cs

@@ -1,275 +0,0 @@
-using System;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.Drawing;
-using System.Collections.Generic;
-using SketchAssistant;
-using System.Windows.Forms;
-
-namespace Tests
-{
-    [TestClass]
-    public class LineTests
-    {
-        //========================//
-        //= Bresenham Line Tests =//
-        //========================//
-
-        [TestMethod]
-        public void BresenhamLineTest1()
-        {
-            //Test point
-            List<Point> expectedResult = new List<Point>();
-            expectedResult.Add(new Point(1, 2));
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(1, 2), new Point(1, 2));
-            Assert.AreEqual(1, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [TestMethod]
-        public void BresenhamLineTest2()
-        {
-            //Test line going from left to right
-            List<Point> expectedResult = new List<Point>();
-            for (int i = 1; i <= 6; i++) { expectedResult.Add(new Point(i, 2)); }
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(1, 2), new Point(6, 2));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [TestMethod]
-        public void BresenhamLineTest3()
-        {
-            //Test line going from right to left
-            List<Point> expectedResult = new List<Point>();
-            for (int i = 6; i >= 1; i--) { expectedResult.Add(new Point(i, 2)); }
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(6, 2), new Point(1, 2));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [TestMethod]
-        public void BresenhamLineTest4()
-        {
-            //Test line going from top to bottom
-            List<Point> expectedResult = new List<Point>();
-            for (int i = 5; i <= 25; i++) { expectedResult.Add(new Point(7, i)); }
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(7, 5), new Point(7, 25));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [TestMethod]
-        public void BresenhamLineTest5()
-        {
-            //Test line going from bottom to top
-            List<Point> expectedResult = new List<Point>();
-            for (int i = 25; i >= 5; i--) { expectedResult.Add(new Point(7, i)); }
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(7, 25), new Point(7, 5));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [TestMethod]
-        public void BresenhamLineTest6()
-        {
-            //Test exactly diagonal line from top left to bottom right
-            List<Point> expectedResult = new List<Point>();
-            for (int i = 5; i <= 25; i++) { expectedResult.Add(new Point(i + 2, i)); }
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(7, 5), new Point(27, 25));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [TestMethod]
-        public void BresenhamLineTest7()
-        {
-            //Test exactly diagonal line from bottom right to top left
-            List<Point> expectedResult = new List<Point>();
-            for (int i = 25; i >= 5; i--) { expectedResult.Add(new Point(i + 2, i)); }
-            List<Point> actualResult = SketchAssistant.GeometryCalculator.BresenhamLineAlgorithm(new Point(27, 25), new Point(7, 5));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        //===========================//
-        //= Matrix Population Tests =//
-        //===========================//
-
-        [TestMethod]
-        public void MatrixTest1()
-        {
-            //Populate Matrix for temporary Line
-            List<Point> thePoints = new List<Point>();
-            thePoints.Add(new Point(1, 1));
-            thePoints.Add(new Point(1, 2));
-            bool[,] testBoolMatrix = new bool[5, 5];
-            List<int>[,] testLineMatrix = new List<int>[5, 5];
-            bool[,] resultBoolMatrix = new bool[5, 5];
-            HashSet<int>[,] resultLineMatrix = new HashSet<int>[5, 5];
-            Line testLine = new Line(thePoints);
-            testLine.PopulateMatrixes(resultBoolMatrix, resultLineMatrix);
-            for (int i = 0; i < 5; i++)
-            {
-                for (int j = 0; j < 5; j++)
-                {
-                    Assert.AreEqual(testBoolMatrix[i, j], resultBoolMatrix[i, j]);
-                    Assert.AreEqual(testLineMatrix[i, j], resultLineMatrix[i, j]);
-                }
-            }
-        }
-
-        [TestMethod]
-        public void MatrixTest2()
-        {
-            //Populate Matrix for non-temporary Line
-            List<Point> thePoints = new List<Point>();
-            thePoints.Add(new Point(1, 1));
-            thePoints.Add(new Point(3, 3));
-            bool[,] testBoolMatrix = new bool[5, 5];
-            HashSet<int>[,] testLineMatrix = new HashSet<int>[5, 5];
-            for (int i = 1; i <= 3; i++)
-            {
-                testBoolMatrix[i, i] = true;
-                HashSet<int> temp = new HashSet<int>();
-                temp.Add(5);
-                testLineMatrix[i, i] = temp;
-            }
-            bool[,] resultBoolMatrix = new bool[5, 5];
-            HashSet<int>[,] resultLineMatrix = new HashSet<int>[5, 5];
-            Line testLine = new Line(thePoints, 5);
-            testLine.PopulateMatrixes(resultBoolMatrix, resultLineMatrix);
-            for (int i = 0; i < 5; i++)
-            {
-                for (int j = 0; j < 5; j++)
-                {
-                    Assert.AreEqual(testBoolMatrix[i, j], resultBoolMatrix[i, j]);
-                    if (testLineMatrix[i, j] != null && resultLineMatrix[i, j] != null)
-                    {
-                        for (int k = 0; k < resultLineMatrix[i, j].Count; k++)
-                        {
-                            Assert.AreEqual(true, testLineMatrix[i, j].SetEquals(resultLineMatrix[i, j]));
-                        }
-                    }
-                }
-            }
-        }
-
-        //=========================//
-        //= Line Constructor Test =//
-        //=========================//
-
-        [TestMethod]
-        public void ConstructorTest()
-        {
-            //Create non-temporary Line and check points
-            //reference Points
-            List<Point> comparisonPoints = new List<Point> {new Point(2,2), new Point(3, 1), new Point(4, 1), new Point(5, 1), new Point(6, 2),
-                new Point(7, 3), new Point(8, 4), new Point(9, 5), new Point(10, 6), new Point(11, 5), new Point(11, 4), new Point(11, 3),
-                new Point(10, 2), new Point(9, 1), new Point(8, 2), new Point(7, 3), new Point(6, 4), new Point(5, 5), new Point(4, 5),
-                new Point(3, 5), new Point(2, 5), new Point(1, 4)};
-            //test Points, with intermediate points missing & duplicate points
-            List<Point> testPoints = new List<Point> {new Point(2,2), new Point(3, 1), new Point(5, 1), new Point(5, 1), new Point(5, 1),
-                new Point(8, 4), new Point(10, 6), new Point(11, 5), new Point(11, 3), new Point(9, 1), new Point(9, 1), new Point(9, 1),
-                new Point(5, 5), new Point(2, 5), new Point(2, 5), new Point(1, 4) };
-            Line testLine = new Line(testPoints, 0);
-            List<Point> returnedPoints = testLine.GetPoints();
-            Assert.AreEqual(comparisonPoints.Count, returnedPoints.Count);
-            for (int i = 0; i < returnedPoints.Count; i++)
-            {
-                Assert.AreEqual(comparisonPoints[i], returnedPoints[i]);
-            }
-        }
-    }
-
-    [TestClass]
-    public class ActionHistoryTests
-    {
-
-        private ActionHistory GetActionHistory()
-        {
-            return new ActionHistory();
-        }
-
-        [DataTestMethod]
-        [DataRow(SketchAction.ActionType.Start, 5, -1, "A new canvas was created.")]
-        [DataRow(SketchAction.ActionType.Draw, 5, 5, "Line number 5 was drawn.")]
-        [DataRow(SketchAction.ActionType.Delete, 10, 10, "Line number 10 was deleted.")]
-        public void ScetchActionTest1(SketchAction.ActionType type, int id, int exit, String response)
-        {
-            HashSet<int> actualResult = new HashSet<int>();
-            if (!type.Equals(SketchAction.ActionType.Start)) { actualResult.Add(id); }
-            SketchAction testAction = new SketchAction(type, id);
-            Assert.AreEqual(type, testAction.GetActionType());
-            Assert.AreEqual(true, actualResult.SetEquals(testAction.GetLineIDs()));
-            Assert.AreEqual(response, testAction.GetActionInformation());
-        }
-
-        [DataTestMethod]
-        [DataRow(SketchAction.ActionType.Start, 1, 2, 3, "A new canvas was created.")]
-        [DataRow(SketchAction.ActionType.Draw, 3, 3, 3, "Line number 3 was drawn.")]
-        [DataRow(SketchAction.ActionType.Delete, 20, 30, 40, "Several Lines were deleted.")]
-        public void ScetchActionTest2(SketchAction.ActionType type, int id1, int id2, int id3, String response)
-        {
-            HashSet<int> actualResult = new HashSet<int>();
-            if (!type.Equals(SketchAction.ActionType.Start))
-            {
-                actualResult.Add(id1);
-                actualResult.Add(id2);
-                actualResult.Add(id3);
-            }
-            SketchAction testAction = new SketchAction(type, actualResult);
-            Assert.AreEqual(type, testAction.GetActionType());
-            Assert.AreEqual(true, actualResult.SetEquals(testAction.GetLineIDs()));
-            Assert.AreEqual(response, testAction.GetActionInformation());
-        }
-
-        [DataTestMethod]
-        [DataRow(SketchAction.ActionType.Start, SketchAction.ActionType.Start, true)]
-        [DataRow(SketchAction.ActionType.Draw, SketchAction.ActionType.Delete, false)]
-        public void ActionHistoryTest1(SketchAction.ActionType action1, SketchAction.ActionType action2, bool isEmpty)
-        {
-            ActionHistory testHistory = GetActionHistory();
-            if (!action1.Equals(SketchAction.ActionType.Start)) { testHistory.AddNewAction(new SketchAction(action1, 5)); }
-            if (!action2.Equals(SketchAction.ActionType.Start)) { testHistory.AddNewAction(new SketchAction(action2, 5)); }
-            Assert.AreEqual(isEmpty, testHistory.IsEmpty());
-        }
-
-        [DataTestMethod]
-        [DataRow(SketchAction.ActionType.Draw, "Last Action: Line number 0 was drawn.")]
-        [DataRow(SketchAction.ActionType.Delete, "Last Action: Line number 0 was deleted.")]
-        public void ActionHistoryUndoRedoTest(SketchAction.ActionType actionType, String message)
-        {
-            ActionHistory testHistory = GetActionHistory();
-            SketchAction testAction = new SketchAction(actionType, 0);
-            testHistory.AddNewAction(testAction);
-            Assert.AreEqual(true, testHistory.CanUndo());
-            testHistory.MoveAction(true);
-            Assert.AreEqual(true, testHistory.CanRedo());
-            var lastActionLabel = testHistory.MoveAction(false);
-            Assert.AreEqual(actionType, testHistory.GetCurrentAction().GetActionType());
-            Assert.AreEqual(message, lastActionLabel);
-        }
-    }
-    
-}

+ 0 - 11
SketchAssistant/SketchAssistant.Tests/app.config

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <runtime>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-      <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
-      </dependentAssembly>
-    </assemblyBinding>
-  </runtime>
-</configuration>

+ 0 - 6
SketchAssistant/SketchAssistant.Tests/packages.config

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="MSTest.TestAdapter" version="1.4.0" targetFramework="net461" />
-  <package id="MSTest.TestFramework" version="1.4.0" targetFramework="net461" />
-  <package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
-</packages>

+ 0 - 107
SketchAssistant/SketchAssistant/ActionHistory.cs

@@ -1,107 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace SketchAssistant
-{
-    public class ActionHistory
-    {
-        //History of Actions taken
-        List<SketchAction> actionHistory;
-        //The current position in the actionHistory
-        Tuple<int, SketchAction> currentAction;
-
-        public ActionHistory()
-        {
-            actionHistory = new List<SketchAction>();
-            currentAction = new Tuple<int, SketchAction>(-1, null);
-            AddNewAction(new SketchAction(SketchAction.ActionType.Start, -1));
-        }
-
-        /// <summary>
-        /// Adds a new action to the action history.
-        /// </summary>
-        /// <param name="newAction">The newly added action.</param>
-        /// <returns>The message to be displayed</returns>
-        public String AddNewAction(SketchAction newAction)
-        {
-            //The current Action is before the last action taken, delete everything after the current action.
-            if (currentAction.Item1 < actionHistory.Count - 1)
-            {
-                actionHistory.RemoveRange(currentAction.Item1 + 1, actionHistory.Count - (currentAction.Item1 + 1));
-            }
-            actionHistory.Add(newAction);
-            currentAction = new Tuple<int, SketchAction>(actionHistory.Count - 1, newAction);
-            return UpdateStatusLabel();
-        }
-
-        /// <summary>
-        /// Changes the currentAction.
-        /// </summary>
-        /// <param name="moveBack">If True, moves the current action back one slot, if False, moves it forward.</param>
-        /// <returns>The message to be displayed</returns>
-        public String MoveAction(bool moveBack)
-        {
-            if(moveBack && CanUndo())
-            {
-                currentAction = new Tuple<int, SketchAction>(currentAction.Item1 - 1, actionHistory[currentAction.Item1 - 1]);
-            }
-            if(!moveBack && CanRedo())
-            {
-                currentAction = new Tuple<int, SketchAction>(currentAction.Item1 + 1, actionHistory[currentAction.Item1 + 1]);
-            }
-            return UpdateStatusLabel();
-        }
-
-        /// <summary>
-        /// Returns the current action.
-        /// </summary>
-        /// <returns>The current action.</returns>
-        public SketchAction GetCurrentAction()
-        {
-            return currentAction.Item2;
-        }
-
-        /// <summary>
-        /// Return whether or not an action can be undone.
-        /// </summary>
-        /// <returns>True if an action can be undone.</returns>
-        public bool CanUndo()
-        {
-            if (currentAction.Item1 > 0) { return true; }
-            else { return false; }
-        }
-
-        /// <summary>
-        /// Return whether or not an action can be redone.
-        /// </summary>
-        /// <returns>True if an action can be redone.</returns>
-        public bool CanRedo()
-        {
-            if (currentAction.Item1 < actionHistory.Count - 1) { return true; }
-            else { return false; }
-        }
-
-        /// <summary>
-        /// Returns whether or not the history is empty.
-        /// </summary>
-        /// <returns>true if the history is empty, otherwise false</returns>
-        public bool IsEmpty()
-        {
-            if (actionHistory.Count == 1) { return true; }
-            else { return false; }
-        }
-
-        /// <summary>
-        /// Updates the status label if there is one given.
-        /// </summary>
-        /// <returns>The message to be displayed</returns>
-        private String UpdateStatusLabel()
-        {
-            return "Last Action: " + currentAction.Item2.GetActionInformation();
-        }
-    }
-}

+ 0 - 14
SketchAssistant/SketchAssistant/App.config

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-    <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
-    </startup>
-  <runtime>
-    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
-      <dependentAssembly>
-        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
-      </dependentAssembly>
-    </assemblyBinding>
-  </runtime>
-</configuration>

+ 0 - 144
SketchAssistant/SketchAssistant/FileImporter.cs

@@ -1,144 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-
-namespace SketchAssistant
-{
-    public class FileImporter
-    {
-        /// <summary>
-        /// parses a drawing consisting of line objects, given as a file in the application specific .isad format
-        /// </summary>
-        /// <param name="fileName">the path of the input file</param>
-        /// <returns>the width and height of the left canvas and the parsed picture as a list of lines</returns>
-        public (int, int, List<Line>) ParseISADInputFile(String fileName)
-        {
-            return ParseISADInput(System.IO.File.ReadAllLines(fileName));
-        }
-
-        /// <summary>
-        /// parses a drawing consisting of line objects, given as the content of a .isad file, seperated into lines
-        /// </summary>
-        /// <param name="allLines">an array holding all lines of the input file</param>
-        /// <returns>the width and height of the left canvas and the parsed picture as a list of lines</returns>
-        private (int, int, List<Line>) ParseISADInput(String[] allLines)
-        {
-
-            if (allLines.Length == 0)
-            {
-                throw new FileImporterException("file is empty", "", -1);
-            }
-            if (!"drawing".Equals(allLines[0]))
-            {
-                throw new FileImporterException("file is not an interactive sketch assistant drawing", ".isad files have to start with the 'drawing' token", 1);
-            }
-            if (!"enddrawing".Equals(allLines[allLines.Length - 1]))
-            {
-                throw new FileImporterException("unterminated drawing definition", ".isad files have to end with the 'enddrawing' token", allLines.Length);
-            }
-
-            (int, int) dimensions = ParseISADHeader(allLines);
-            List<Line> picture = ParseISADBody(allLines, dimensions.Item1, dimensions.Item2);
-
-            return (dimensions.Item1, dimensions.Item2, picture);
-        }
-
-
-
-        /// <summary>
-        /// parses the first two lines of an input file in .isad format
-        /// </summary>
-        /// <param name="allLines">the input file as an array of lines</param>
-        /// <returns>the width and height of the left canvas</returns>
-        private (int, int) ParseISADHeader(String[] allLines)
-        {
-            int width;
-            int height;
-            if (!(allLines.Length > 1) || !Regex.Match(allLines[1], @"^\d+x?\d+$", RegexOptions.None).Success)
-            {
-                throw new FileImporterException("invalid or missing canvas size definition", "format: [width]x[heigth]", 2);
-            }
-            String[] size = allLines[1].Split('x');
-            width = Convert.ToInt32(size[0]);
-            height = Convert.ToInt32(size[1]);
-            return (width, height);
-        }
-
-        /// <summary>
-        /// parses all line entries of an input file in .isad format
-        /// </summary>
-        /// <param name="allLines">the input file as an array of lines</param>
-        /// <returns>the parsed picture as a list of lines</returns>
-        private List<Line> ParseISADBody(String[] allLines, int width, int height)
-        {
-
-            String lineStartString = "line";
-            String lineEndString = "endline";
-
-            List<Line> drawing = new List<Line>();
-
-            //number of the line currently being parsed, enumeration starting at 0, body starts at the third line, therefore lin number 2
-            int i = 2;
-            //parse 'line' token and complete line definition
-            int lineStartPointer = i;
-            //holds the line number of the next expected beginning of a line definition, or of the enddrawing token
-            while (lineStartString.Equals(allLines[i]))
-            {
-                //start parsing next line
-                i++;
-                List<Point> newLine = new List<Point>();
-                while (!lineEndString.Equals(allLines[i]))
-                {
-                    if (i == allLines.Length)
-                    {
-                        throw new FileImporterException("unterminated line definition", null, (i + 1));
-                    }
-                    //parse single point definition
-                    if (!Regex.Match(allLines[i], @"^\d+;\d+$", RegexOptions.None).Success)
-                    {
-                        throw new FileImporterException("invalid Point definition: wrong format", "format: [xCoordinate];[yCoordinate]", (i + 1) );
-                    }
-                    String[] coordinates = allLines[i].Split(';');
-                    //no errors possible, convertability to int already checked above
-                    int xCoordinate = Convert.ToInt32(coordinates[0]);
-                    int yCoordinate = Convert.ToInt32(coordinates[1]);
-                    if (xCoordinate < 0 || yCoordinate < 0 || xCoordinate > width - 1 || yCoordinate > height - 1)
-                    {
-                        throw new FileImporterException("invalid Point definition: point out of bounds", null, (i + 1) );
-                    }
-                    newLine.Add(new Point(xCoordinate, yCoordinate));
-                    //start parsing next line
-                    i++;
-                }
-                //"parse" 'endline' token, syntax already checked at the beginning,  and start parsing next line
-                i++;
-                //add line to drawing
-                drawing.Add(new Line(newLine));
-                //update lineStartPointer to the presumable start of the next line
-                lineStartPointer = i;
-            }
-            //check if end of body is reached after there are no more line definitions
-            if(i != allLines.Length - 1)
-            {
-                throw new FileImporterException("missing or invalid line definition token", "line definitions start with the 'line' token", (i + 1));
-            }
-            //return parsed picture
-            return drawing;
-        }
-
-        /// <summary>
-        /// connection point for testing use only: calls ParseISADInput(String[] allLines) and directly passes the given argument (effectively bypassing the File Input functionality)
-        /// </summary>
-        /// <param name="allLines">an array holding all lines of the input file</param>
-        /// <returns>the width and height of the left canvas and the parsed picture as a list of lines</returns>
-        public (int, int, List<Line>) ParseISADInputForTesting(String[] allLines)
-        {
-            return ParseISADInput(allLines);
-        }
-
-    }
-}

+ 0 - 26
SketchAssistant/SketchAssistant/FileImporterException.cs

@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace SketchAssistant
-{
-    public class FileImporterException : Exception
-    {
-        /// <summary>
-        /// the clean and formatted message to show to the user
-        /// </summary>
-        String showMessage;
-
-        public FileImporterException(String message, String hint, int lineNumber) : base (message)
-        {
-            showMessage = "Could not import file:\n\n" + message + (hint == null ? "" : "\n(Hint: " + hint + ")") + (lineNumber == -1 ? "" : "\n\n-line: " + lineNumber );
-        }
-
-        public override string ToString()
-        {
-            return showMessage;
-        }
-    }
-}

+ 0 - 294
SketchAssistant/SketchAssistant/Form1.Designer.cs

@@ -1,294 +0,0 @@
-namespace SketchAssistant
-{
-    partial class Form1
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.components = new System.ComponentModel.Container();
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
-            this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
-            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
-            this.pictureBoxRight = new System.Windows.Forms.PictureBox();
-            this.pictureBoxLeft = new System.Windows.Forms.PictureBox();
-            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
-            this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.examplePictureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
-            this.canvasButton = new System.Windows.Forms.ToolStripButton();
-            this.drawButton = new System.Windows.Forms.ToolStripButton();
-            this.deleteButton = new System.Windows.Forms.ToolStripButton();
-            this.undoButton = new System.Windows.Forms.ToolStripButton();
-            this.redoButton = new System.Windows.Forms.ToolStripButton();
-            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
-            this.toolStripLoadStatus = new System.Windows.Forms.ToolStripStatusLabel();
-            this.lastActionTakenLabel = new System.Windows.Forms.ToolStripStatusLabel();
-            this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
-            this.mouseTimer = new System.Windows.Forms.Timer(this.components);
-            this.tableLayoutPanel1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxRight)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxLeft)).BeginInit();
-            this.menuStrip1.SuspendLayout();
-            this.toolStrip1.SuspendLayout();
-            this.statusStrip1.SuspendLayout();
-            this.SuspendLayout();
-            // 
-            // tableLayoutPanel1
-            // 
-            this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.tableLayoutPanel1.BackColor = System.Drawing.SystemColors.InactiveCaption;
-            this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.OutsetDouble;
-            this.tableLayoutPanel1.ColumnCount = 2;
-            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanel1.Controls.Add(this.pictureBoxRight, 1, 0);
-            this.tableLayoutPanel1.Controls.Add(this.pictureBoxLeft, 0, 0);
-            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 52);
-            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 1;
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(696, 440);
-            this.tableLayoutPanel1.TabIndex = 1;
-            // 
-            // pictureBoxRight
-            // 
-            this.pictureBoxRight.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.pictureBoxRight.Location = new System.Drawing.Point(349, 3);
-            this.pictureBoxRight.Margin = new System.Windows.Forms.Padding(0);
-            this.pictureBoxRight.Name = "pictureBoxRight";
-            this.pictureBoxRight.Size = new System.Drawing.Size(344, 434);
-            this.pictureBoxRight.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
-            this.pictureBoxRight.TabIndex = 6;
-            this.pictureBoxRight.TabStop = false;
-            this.pictureBoxRight.Click += new System.EventHandler(this.pictureBoxRight_Click);
-            this.pictureBoxRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBoxRight_MouseDown);
-            this.pictureBoxRight.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBoxRight_MouseMove);
-            this.pictureBoxRight.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBoxRight_MouseUp);
-            // 
-            // pictureBoxLeft
-            // 
-            this.pictureBoxLeft.BackColor = System.Drawing.SystemColors.InactiveCaption;
-            this.pictureBoxLeft.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.pictureBoxLeft.Location = new System.Drawing.Point(3, 3);
-            this.pictureBoxLeft.Margin = new System.Windows.Forms.Padding(0);
-            this.pictureBoxLeft.Name = "pictureBoxLeft";
-            this.pictureBoxLeft.Size = new System.Drawing.Size(343, 434);
-            this.pictureBoxLeft.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
-            this.pictureBoxLeft.TabIndex = 5;
-            this.pictureBoxLeft.TabStop = false;
-            // 
-            // menuStrip1
-            // 
-            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.fileToolStripMenuItem});
-            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
-            this.menuStrip1.MaximumSize = new System.Drawing.Size(1000, 0);
-            this.menuStrip1.Name = "menuStrip1";
-            this.menuStrip1.Size = new System.Drawing.Size(696, 24);
-            this.menuStrip1.TabIndex = 2;
-            this.menuStrip1.Text = "menuStrip1";
-            // 
-            // fileToolStripMenuItem
-            // 
-            this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.importToolStripMenuItem});
-            this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
-            this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
-            this.fileToolStripMenuItem.Text = "File";
-            // 
-            // importToolStripMenuItem
-            // 
-            this.importToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.examplePictureToolStripMenuItem});
-            this.importToolStripMenuItem.Name = "importToolStripMenuItem";
-            this.importToolStripMenuItem.Size = new System.Drawing.Size(119, 22);
-            this.importToolStripMenuItem.Text = "Import...";
-            // 
-            // examplePictureToolStripMenuItem
-            // 
-            this.examplePictureToolStripMenuItem.Name = "examplePictureToolStripMenuItem";
-            this.examplePictureToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
-            this.examplePictureToolStripMenuItem.Text = "Example picture";
-            this.examplePictureToolStripMenuItem.Click += new System.EventHandler(this.examplePictureToolStripMenuItem_Click);
-            // 
-            // toolStrip1
-            // 
-            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.canvasButton,
-            this.drawButton,
-            this.deleteButton,
-            this.undoButton,
-            this.redoButton});
-            this.toolStrip1.Location = new System.Drawing.Point(0, 24);
-            this.toolStrip1.Name = "toolStrip1";
-            this.toolStrip1.Size = new System.Drawing.Size(696, 25);
-            this.toolStrip1.TabIndex = 3;
-            this.toolStrip1.Text = "toolStrip1";
-            // 
-            // canvasButton
-            // 
-            this.canvasButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-            this.canvasButton.Image = ((System.Drawing.Image)(resources.GetObject("canvasButton.Image")));
-            this.canvasButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.canvasButton.Name = "canvasButton";
-            this.canvasButton.Size = new System.Drawing.Size(76, 22);
-            this.canvasButton.Text = "New Canvas";
-            this.canvasButton.Click += new System.EventHandler(this.canvasButton_Click);
-            // 
-            // drawButton
-            // 
-            this.drawButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-            this.drawButton.Enabled = false;
-            this.drawButton.Image = ((System.Drawing.Image)(resources.GetObject("drawButton.Image")));
-            this.drawButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.drawButton.Name = "drawButton";
-            this.drawButton.Size = new System.Drawing.Size(38, 22);
-            this.drawButton.Text = "Draw";
-            this.drawButton.Click += new System.EventHandler(this.drawButton_Click);
-            // 
-            // deleteButton
-            // 
-            this.deleteButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-            this.deleteButton.Enabled = false;
-            this.deleteButton.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton.Image")));
-            this.deleteButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.deleteButton.Name = "deleteButton";
-            this.deleteButton.Size = new System.Drawing.Size(44, 22);
-            this.deleteButton.Text = "Delete";
-            this.deleteButton.Click += new System.EventHandler(this.deleteButton_Click);
-            // 
-            // undoButton
-            // 
-            this.undoButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-            this.undoButton.Enabled = false;
-            this.undoButton.Image = ((System.Drawing.Image)(resources.GetObject("undoButton.Image")));
-            this.undoButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.undoButton.Name = "undoButton";
-            this.undoButton.Size = new System.Drawing.Size(40, 22);
-            this.undoButton.Text = "Undo";
-            this.undoButton.Click += new System.EventHandler(this.undoButton_Click);
-            // 
-            // redoButton
-            // 
-            this.redoButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-            this.redoButton.Enabled = false;
-            this.redoButton.Image = ((System.Drawing.Image)(resources.GetObject("redoButton.Image")));
-            this.redoButton.ImageTransparentColor = System.Drawing.Color.Magenta;
-            this.redoButton.Name = "redoButton";
-            this.redoButton.Size = new System.Drawing.Size(38, 22);
-            this.redoButton.Text = "Redo";
-            this.redoButton.Click += new System.EventHandler(this.redoButton_Click);
-            // 
-            // statusStrip1
-            // 
-            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripLoadStatus,
-            this.lastActionTakenLabel});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 491);
-            this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Size = new System.Drawing.Size(696, 24);
-            this.statusStrip1.TabIndex = 4;
-            this.statusStrip1.Text = "statusStrip1";
-            // 
-            // toolStripLoadStatus
-            // 
-            this.toolStripLoadStatus.Name = "toolStripLoadStatus";
-            this.toolStripLoadStatus.Size = new System.Drawing.Size(40, 19);
-            this.toolStripLoadStatus.Text = "no file";
-            // 
-            // lastActionTakenLabel
-            // 
-            this.lastActionTakenLabel.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left;
-            this.lastActionTakenLabel.Name = "lastActionTakenLabel";
-            this.lastActionTakenLabel.Size = new System.Drawing.Size(38, 19);
-            this.lastActionTakenLabel.Text = "none";
-            this.lastActionTakenLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            // 
-            // mouseTimer
-            // 
-            this.mouseTimer.Interval = 1;
-            this.mouseTimer.Tick += new System.EventHandler(this.mouseTimer_Tick);
-            // 
-            // Form1
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.BackColor = System.Drawing.SystemColors.MenuBar;
-            this.ClientSize = new System.Drawing.Size(696, 515);
-            this.Controls.Add(this.statusStrip1);
-            this.Controls.Add(this.toolStrip1);
-            this.Controls.Add(this.tableLayoutPanel1);
-            this.Controls.Add(this.menuStrip1);
-            this.KeyPreview = true;
-            this.MainMenuStrip = this.menuStrip1;
-            this.Margin = new System.Windows.Forms.Padding(2);
-            this.Name = "Form1";
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "Sketch Assistant";
-            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
-            this.Load += new System.EventHandler(this.Form1_Load);
-            this.SizeChanged += new System.EventHandler(this.Form1_Resize);
-            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
-            this.tableLayoutPanel1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxRight)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBoxLeft)).EndInit();
-            this.menuStrip1.ResumeLayout(false);
-            this.menuStrip1.PerformLayout();
-            this.toolStrip1.ResumeLayout(false);
-            this.toolStrip1.PerformLayout();
-            this.statusStrip1.ResumeLayout(false);
-            this.statusStrip1.PerformLayout();
-            this.ResumeLayout(false);
-            this.PerformLayout();
-
-        }
-
-        #endregion
-        private System.ComponentModel.BackgroundWorker backgroundWorker1;
-        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
-        private System.Windows.Forms.MenuStrip menuStrip1;
-        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
-        private System.Windows.Forms.ToolStrip toolStrip1;
-        private System.Windows.Forms.StatusStrip statusStrip1;
-        private System.Windows.Forms.ToolStripStatusLabel toolStripLoadStatus;
-        private System.ComponentModel.BackgroundWorker backgroundWorker2;
-        private System.Windows.Forms.PictureBox pictureBoxRight;
-        private System.Windows.Forms.PictureBox pictureBoxLeft;
-        private System.Windows.Forms.Timer mouseTimer;
-        private System.Windows.Forms.ToolStripButton canvasButton;
-        private System.Windows.Forms.ToolStripButton drawButton;
-        private System.Windows.Forms.ToolStripButton deleteButton;
-        private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem examplePictureToolStripMenuItem;
-        private System.Windows.Forms.ToolStripStatusLabel lastActionTakenLabel;
-        private System.Windows.Forms.ToolStripButton undoButton;
-        private System.Windows.Forms.ToolStripButton redoButton;
-    }
-}
-

+ 0 - 323
SketchAssistant/SketchAssistant/Form1.cs

@@ -1,323 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Text.RegularExpressions;
-
-// This is the code for your desktop app.
-// Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
-
-namespace SketchAssistant
-{
-    public partial class Form1 : Form, MVP_View
-    {
-        public Form1()
-        {
-            InitializeComponent();
-            ProgramPresenter = new MVP_Presenter(this);
-        }
-
-        /**********************************/
-        /*** CLASS VARIABLES START HERE ***/
-        /**********************************/
-
-        //important: add new variables only at the end of the list to keep the order of definition consistent with the order in which they are returned by GetAllVariables()
-
-        public enum ButtonState
-        {
-            Enabled,
-            Disabled,
-            Active
-        }
-
-        /// <summary>
-        /// Different Program States
-        /// </summary>
-        public enum ProgramState
-        {
-            Idle,
-            Draw,
-            Delete
-        }
-        /// <summary>
-        /// Dialog to select a file.
-        /// </summary>
-        OpenFileDialog openFileDialog = new OpenFileDialog();
-        /// <summary>
-        /// All Lines in the current session
-        /// </summary>
-        List<Tuple<bool,Line>> rightLineList = new List<Tuple<bool, Line>>();
-        /// <summary>
-        /// Queue for the cursorPositions
-        /// </summary>
-        Queue<Point> cursorPositions = new Queue<Point>();
-        /// <summary>
-        /// The Presenter Component of the MVP-Model
-        /// </summary>
-        MVP_Presenter ProgramPresenter;
-
-        /******************************************/
-        /*** FORM SPECIFIC FUNCTIONS START HERE ***/
-        /******************************************/
-
-        private void Form1_Load(object sender, EventArgs e)
-        {
-            this.DoubleBuffered = true;
-        }
-
-        /// <summary>
-        /// Resize Function connected to the form resize event, will refresh the form when it is resized
-        /// </summary>
-        private void Form1_Resize(object sender, System.EventArgs e)
-        {
-            ProgramPresenter.Resize(new Tuple<int, int>(pictureBoxLeft.Width, pictureBoxLeft.Height), 
-                new Tuple<int, int>(pictureBoxRight.Width, pictureBoxRight.Height));
-            this.Refresh();
-        }
-
-        /// <summary>
-        /// Import button, will open an OpenFileDialog
-        /// </summary>
-        private void examplePictureToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.ExamplePictureToolStripMenuItemClick();
-        }
-
-        /// <summary>
-        /// Changes the state of the program to drawing
-        /// </summary>
-        private void drawButton_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.ChangeState(true);
-        }
-
-        /// <summary>
-        /// Changes the state of the program to deletion
-        /// </summary>
-        private void deleteButton_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.ChangeState(false);
-        }
-
-        /// <summary>
-        /// Undo an Action.
-        /// </summary>
-        private void undoButton_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.Undo();
-        }
-
-        /// <summary>
-        /// Redo an Action.
-        /// </summary>
-        private void redoButton_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.Redo();
-        }
-
-        /// <summary>
-        /// Detect Keyboard Shortcuts.
-        /// </summary>
-        private void Form1_KeyDown(object sender, KeyEventArgs e)
-        {
-            if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Z)
-            {
-                ProgramPresenter.Undo();
-            }
-            if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Y)
-            {
-                ProgramPresenter.Redo();
-            }
-        }
-
-        /// <summary>
-        /// The Picture box is clicked.
-        /// </summary>
-        private void pictureBoxRight_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Click);
-        }
-
-        /// <summary>
-        /// Get current Mouse positon within the right picture box.
-        /// </summary>
-        private void pictureBoxRight_MouseMove(object sender, MouseEventArgs e)
-        {
-            ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Move, e);
-        }
-        
-        /// <summary>
-        /// Hold left mouse button to start drawing.
-        /// </summary>
-        private void pictureBoxRight_MouseDown(object sender, MouseEventArgs e)
-        {
-            ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Down);
-        }
-        
-        /// <summary>
-        /// Lift left mouse button to stop drawing and add a new Line.
-        /// </summary>
-        private void pictureBoxRight_MouseUp(object sender, MouseEventArgs e)
-        {
-            ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up);
-        }
-        
-        /// <summary>
-        /// Button to create a new Canvas. Will create an empty image 
-        /// which is the size of the left image, if there is one.
-        /// If there is no image loaded the canvas will be the size of the right picture box
-        /// </summary>
-        private void canvasButton_Click(object sender, EventArgs e)
-        {
-            ProgramPresenter.NewCanvas();
-        }
-
-        /// <summary>
-        /// Add a Point on every tick to the Drawpath.
-        /// Or detect lines for deletion on every tick
-        /// </summary>
-        private void mouseTimer_Tick(object sender, EventArgs e)
-        {
-            ProgramPresenter.Tick();
-        }
-
-        /*************************/
-        /*** PRESENTER -> VIEW ***/
-        /*************************/
-
-        /// <summary>
-        /// Enables the timer of the View, which will tick the Presenter.
-        /// </summary>
-        public void EnableTimer()
-        {
-            mouseTimer.Enabled = true;
-        }
-
-        /// <summary>
-        /// A function that opens a file dialog and returns the filename.
-        /// </summary>
-        /// <param name="Filter">The filter that should be applied to the new Dialog.</param>
-        /// <returns>Returns the FileName and the SafeFileName if the user correctly selects a file, 
-        /// else returns a tuple with empty strigns</returns>
-        public Tuple<String, String> openNewDialog(String Filter)
-        {
-            openFileDialog.Filter = Filter;
-            if (openFileDialog.ShowDialog() == DialogResult.OK)
-            {
-                return new Tuple<string, string>(openFileDialog.FileName, openFileDialog.SafeFileName);
-            }
-            else
-            {
-                return new Tuple<string, string>("", "");
-            }
-        }
-
-        /// <summary>
-        /// Sets the contents of the load status indicator label.
-        /// </summary>
-        /// <param name="message">The new contents</param>
-        public void SetToolStripLoadStatus(String message)
-        {
-            toolStripLoadStatus.Text = message;
-        }
-
-        /// <summary>
-        /// Sets the contents of the last action taken indicator label.
-        /// </summary>
-        /// <param name="message">The new contents</param>
-        public void SetLastActionTakenText(String message)
-        {
-            lastActionTakenLabel.Text = message;
-        }
-
-        /// <summary>
-        /// Changes the states of a tool strip button.
-        /// </summary>
-        /// <param name="buttonName">The name of the button.</param>
-        /// <param name="state">The new state of the button.</param>
-        public void SetToolStripButtonStatus(String buttonName, ButtonState state)
-        {
-            ToolStripButton buttonToChange;
-            switch (buttonName)
-            {
-                case "canvasButton":
-                    buttonToChange = canvasButton;
-                    break;
-                case "drawButton":
-                    buttonToChange = drawButton;
-                    break;
-                case "deleteButton":
-                    buttonToChange = deleteButton;
-                    break;
-                case "undoButton":
-                    buttonToChange = undoButton;
-                    break;
-                case "redoButton":
-                    buttonToChange = redoButton;
-                    break;
-                default:
-                    Console.WriteLine("Invalid Button was given to SetToolStripButton. \nMaybe you forgot to add a case?");
-                    return;
-            }
-            switch (state)
-            {
-                case ButtonState.Active:
-                    buttonToChange.Checked = true;
-                    break;
-                case ButtonState.Disabled:
-                    buttonToChange.Checked = false;
-                    buttonToChange.Enabled = false;
-                    break;
-                case ButtonState.Enabled:
-                    buttonToChange.Checked = false;
-                    buttonToChange.Enabled = true;
-                    break;
-            }
-        }
-
-        /// <summary>
-        /// Displays an image in the left Picture box.
-        /// </summary>
-        /// <param name="img">The new image.</param>
-        public void DisplayInLeftPictureBox(Image img)
-        {
-            pictureBoxLeft.Image = img;
-            pictureBoxLeft.Refresh();
-        }
-
-        /// <summary>
-        /// Displays an image in the right Picture box.
-        /// </summary>
-        /// <param name="img">The new image.</param>
-        public void DisplayInRightPictureBox(Image img)
-        {
-            pictureBoxRight.Image = img;
-            pictureBoxRight.Refresh();
-        }
-
-        /// <summary>
-        /// shows the given info message in a popup and asks the user to aknowledge it
-        /// </summary>
-        /// <param name="message">the message to show</param>
-        public void ShowInfoMessage(String message)
-        {
-            MessageBox.Show(message);
-        }
-
-        /// <summary>
-        /// Shows a warning box with the given message (Yes/No Buttons)and returns true if the user aknowledges it.
-        /// </summary>
-        /// <param name="message">The message of the warning.</param>
-        /// <returns>True if the user confirms (Yes), negative if he doesn't (No)</returns>
-        public bool ShowWarning(String message)
-        {
-            return (MessageBox.Show(message, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes);
-        }
-
-    }
-}

+ 0 - 217
SketchAssistant/SketchAssistant/Form1.resx

@@ -1,217 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>122, 17</value>
-  </metadata>
-  <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>286, 17</value>
-  </metadata>
-  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>401, 17</value>
-  </metadata>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="canvasButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
-        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
-        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
-        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
-        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
-        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
-        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
-        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
-        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
-        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="drawButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
-        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
-        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
-        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
-        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
-        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
-        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
-        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
-        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
-        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="deleteButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
-        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
-        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
-        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
-        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
-        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
-        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
-        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
-        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
-        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="undoButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
-        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
-        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
-        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
-        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
-        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
-        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
-        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
-        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
-        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="redoButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
-        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
-        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
-        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
-        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
-        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
-        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
-        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
-        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
-        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>506, 17</value>
-  </metadata>
-  <metadata name="backgroundWorker2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>622, 17</value>
-  </metadata>
-  <metadata name="mouseTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>786, 17</value>
-  </metadata>
-  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>47</value>
-  </metadata>
-</root>

+ 0 - 204
SketchAssistant/SketchAssistant/GeometryCalculator.cs

@@ -1,204 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-
-namespace SketchAssistant
-{
-    /// <summary>
-    /// A class that contains all algorithms related to geometry.
-    /// </summary>
-    public static class GeometryCalculator
-    {
-        /// <summary>
-        /// An implementation of the Bresenham Line Algorithm,
-        /// which calculates the points of a circle in a radius around a center point.
-        /// Implemented with the help of code examples on Wikipedia.
-        /// </summary>
-        /// <param name="center">The center of the circle.</param>
-        /// <param name="radius">The radius of the circle, 
-        /// when it is zero or less, only the midpoint is returned</param>
-        /// <returns>The HashSet containing all Points on the circle.</returns>
-        public static HashSet<Point> BresenhamCircleAlgorithm(Point center, int radius)
-        {
-            if(radius <= 0) { return new HashSet<Point> { center }; }
-
-            int x = radius - 1;
-            int y = 0;
-            int dx = 1;
-            int dy = 1;
-            int err = dx - (radius * 2);
-            HashSet<Point> returnSet = new HashSet<Point>();
-            
-            while (x >= y)
-            {
-                returnSet.Add(new Point(center.X + x, center.Y + y));
-                returnSet.Add(new Point(center.X + y, center.Y + x));
-                returnSet.Add(new Point(center.X - y, center.Y + x));
-                returnSet.Add(new Point(center.X - x, center.Y + y));
-                returnSet.Add(new Point(center.X - x, center.Y - y));
-                returnSet.Add(new Point(center.X - y, center.Y - x));
-                returnSet.Add(new Point(center.X + y, center.Y - x));
-                returnSet.Add(new Point(center.X + x, center.Y - y));
-
-                if (err <= 0)
-                {
-                    y++;
-                    err += dy;
-                    dy += 2;
-                }
-
-                if (err > 0)
-                {
-                    x--;
-                    dx += 2;
-                    err += dx - (radius * 2);
-                }
-            }
-            return returnSet;
-        }
-
-        /// <summary>
-        /// A simple algorithm that returns a filled circle with a radius and a center point.
-        /// </summary>
-        /// <param name="center">The center point of the alorithm </param>
-        /// <param name="radius">The radius of the circle, if its less or equal to 1 
-        /// only the center point is returned. </param>
-        /// <returns>All the points in or on the circle.</returns>
-        public static HashSet<Point> FilledCircleAlgorithm(Point center, int radius)
-        {
-            HashSet<Point> returnSet = new HashSet<Point> { center };
-            //Fill the circle
-            for (int x = 0; x < radius; x++)
-            {
-                for (int y = 0; y < radius; y++)
-                {
-                    //Check if point is on or in the circle
-                    if((x*x + y*y - radius * radius) <= 0)
-                    {
-                        returnSet.Add(new Point(center.X + x, center.Y + y));
-                        returnSet.Add(new Point(center.X - x, center.Y + y));
-                        returnSet.Add(new Point(center.X + x, center.Y - y));
-                        returnSet.Add(new Point(center.X - x, center.Y - y));
-                    }
-                }
-            }
-            return returnSet;
-        }
-
-        /// <summary>
-        /// An implementation of the Bresenham Line Algorithm, 
-        /// which calculates all points between two points in a straight line.
-        /// Implemented using the pseudocode on Wikipedia.
-        /// </summary>
-        /// <param name="p0">The start point</param>
-        /// <param name="p1">The end point</param>
-        /// <returns>All points between p0 and p1 (including p0 and p1)</returns>
-        public static List<Point> BresenhamLineAlgorithm(Point p0, Point p1)
-        {
-            int deltaX = p1.X - p0.X;
-            int deltaY = p1.Y - p0.Y;
-            List<Point> returnList;
-
-            if (Math.Abs(deltaY) < Math.Abs(deltaX))
-            {
-                if (p0.X > p1.X)
-                {
-                    returnList = GetLineLow(p1.X, p1.Y, p0.X, p0.Y);
-                    returnList.Reverse();
-                }
-                else
-                {
-                    returnList = GetLineLow(p0.X, p0.Y, p1.X, p1.Y);
-                }
-            }
-            else
-            {
-                if (p0.Y > p1.Y)
-                {
-                    returnList = GetLineHigh(p1.X, p1.Y, p0.X, p0.Y);
-                    returnList.Reverse();
-                }
-                else
-                {
-                    returnList = GetLineHigh(p0.X, p0.Y, p1.X, p1.Y);
-                }
-            }
-            return returnList;
-        }
-
-        /// <summary>
-        /// Helping function of the Bresenham Line algorithm,
-        /// under the assumption that abs(deltaY) is smaller than abs(deltX)
-        /// and x0 is smaller than x1
-        /// </summary>
-        /// <param name="x0">x value of point 0</param>
-        /// <param name="y0">y value of point 0</param>
-        /// <param name="x1">x value of point 1</param>
-        /// <param name="y1">y value of point 1</param>
-        /// <returns>All points on the line between the two points</returns>
-        private static List<Point> GetLineLow(int x0, int y0, int x1, int y1)
-        {
-            List<Point> returnList = new List<Point>();
-            int dx = x1 - x0;
-            int dy = y1 - y0;
-            int yi = 1;
-            if (dy < 0)
-            {
-                yi = -1;
-                dy = -dy;
-            }
-            int D = 2 * dy - dx;
-            int y = y0;
-            for (int x = x0; x <= x1; x++)
-            {
-                returnList.Add(new Point(x, y));
-                if (D > 0)
-                {
-                    y = y + yi;
-                    D = D - 2 * dx;
-                }
-                D = D + 2 * dy;
-            }
-            return returnList;
-        }
-
-        /// <summary>
-        /// Helping function of the Bresenham Line algorithm,
-        /// under the assumption that abs(deltaY) is larger or equal than abs(deltX)
-        /// and y0 is smaller than y1
-        /// </summary>
-        /// <param name="x0">x value of point 0</param>
-        /// <param name="y0">y value of point 0</param>
-        /// <param name="x1">x value of point 1</param>
-        /// <param name="y1">y value of point 1</param>
-        /// <returns>All points on the line between the two points</returns>
-        private static List<Point> GetLineHigh(int x0, int y0, int x1, int y1)
-        {
-            List<Point> returnList = new List<Point>();
-            int dx = x1 - x0;
-            int dy = y1 - y0;
-            int xi = 1;
-            if (dx < 0)
-            {
-                xi = -1;
-                dx = -dx;
-            }
-            int D = 2 * dx - dy;
-            int x = x0;
-            for (int y = y0; y <= y1; y++)
-            {
-                returnList.Add(new Point(x, y));
-                if (D > 0)
-                {
-                    x = x + xi;
-                    D = D - 2 * dy;
-                }
-                D = D + 2 * dx;
-            }
-            return returnList;
-        }
-    }
-}

+ 0 - 152
SketchAssistant/SketchAssistant/Line.cs

@@ -1,152 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-
-namespace SketchAssistant
-{
-    public class Line
-    {
-        /// <summary>
-        /// list saving all the points of the line in the order of the path from start to end point
-        /// </summary>
-        private List<Point> linePoints;
-        /// <summary>
-        /// unique identifier of this Line object
-        /// </summary>
-        private int identifier;
-        /// <summary>
-        /// flag showing if this is only a temporary line
-        /// </summary>
-        private bool isTemporary;
-
-        /// <summary>
-        /// The constructor for lines which are only temporary.
-        /// If you want nice lines use the other constructor.
-        /// </summary>
-        /// <param name="points">The points of the line</param>
-        public Line(List<Point> points)
-        {
-            linePoints = new List<Point>(points);
-            isTemporary = true;
-        }
-
-        /// <summary>
-        /// The constructor for lines, which will be more resource efficient 
-        /// and have the ability to populate deletion matrixes.
-        /// </summary>
-        /// <param name="points">The points of the line</param>
-        /// <param name="id">The identifier of the line</param>
-        public Line(List<Point> points, int id)
-        {
-            linePoints = new List<Point>(points);
-            identifier = id;
-            CleanPoints();
-            isTemporary = false;
-        }
-
-        public Point GetStartPoint()
-        {
-            return linePoints.First();
-        }
-
-        public Point GetEndPoint()
-        {
-            return linePoints.Last();
-        }
-
-        public List<Point> GetPoints()
-        {
-            return linePoints;
-        }
-
-        public int GetID()
-        {
-            return identifier;
-        }
-
-        /// <summary>
-        /// A function that takes a Graphics element and returns it with
-        /// the line drawn on it.
-        /// </summary>
-        /// <param name="canvas">The Graphics element on which the line shall be drawn</param>
-        /// <returns>The given Graphics element with the additional line</returns>
-        public Graphics DrawLine(Graphics canvas)
-        {
-            for(int i = 0; i < linePoints.Count - 1 ; i++)
-            {
-                canvas.DrawLine(Pens.Black, linePoints[i], linePoints[i + 1]);
-            }
-            //If there is only one point
-            if(linePoints.Count == 1){ canvas.FillRectangle(Brushes.Black, linePoints[0].X, linePoints[0].Y, 1, 1); }
-            return canvas;
-        }
-
-        /// <summary>
-        /// A function that will take to matrixes and populate the with the line data of this line object
-        /// </summary>
-        /// <param name="boolMatrix">The Matrix of booleans, in which is saved wether there is a line at this position.</param>
-        /// <param name="listMatrix">The Matrix of Lists of integers, in which is saved which lines are at this position</param>
-        public void PopulateMatrixes(bool[,] boolMatrix, HashSet<int>[,] listMatrix)
-        {
-            if(!isTemporary)
-            {
-                foreach (Point currPoint in linePoints)
-                {
-                    if (currPoint.X >= 0 && currPoint.Y >= 0 && 
-                        currPoint.X < boolMatrix.GetLength(0) && currPoint.Y < boolMatrix.GetLength(1))
-                    {
-                        boolMatrix[currPoint.X, currPoint.Y] = true;
-                        if (listMatrix[currPoint.X, currPoint.Y] == null)
-                        {
-                            listMatrix[currPoint.X, currPoint.Y] = new HashSet<int>();
-                        }
-                        listMatrix[currPoint.X, currPoint.Y].Add(identifier);
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Removes duplicate points from the line object
-        /// </summary>
-        private void CleanPoints()
-        {
-            if (linePoints.Count > 1)
-            {
-                List<Point> newList = new List<Point>();
-                List<Point> tempList = new List<Point>();
-                //Since Point is non-nullable, we must ensure the nullPoints, 
-                //which we remove can not possibly be points of the original given line.
-                int nullValue = linePoints[0].X + 1;
-                //Fill the gaps between points
-                for (int i = 0; i < linePoints.Count - 1; i++)
-                {
-                    nullValue += linePoints[i + 1].X;
-                    List<Point> partialList = GeometryCalculator.BresenhamLineAlgorithm(linePoints[i], linePoints[i + 1]);
-                    tempList.AddRange(partialList);
-                }
-                Point nullPoint = new Point(nullValue, 0);
-                //Set duplicate points to the null point
-                for (int i = 1; i < tempList.Count; i++)
-                {
-                    if ((tempList[i].X == tempList[i - 1].X) && (tempList[i].Y == tempList[i - 1].Y))
-                    {
-                        tempList[i - 1] = nullPoint;
-                    }
-                }
-                //remove the null points
-                foreach (Point tempPoint in tempList)
-                {
-                    if (tempPoint.X != nullValue)
-                    {
-                        newList.Add(tempPoint);
-                    }
-                }
-                linePoints = new List<Point>(newList);
-            }
-        }
-    }
-}

+ 0 - 568
SketchAssistant/SketchAssistant/MVP_Model.cs

@@ -1,568 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-
-namespace SketchAssistant
-{
-    public class MVP_Model
-    {
-        /// <summary>
-        /// The Presenter of the MVP-Model.
-        /// </summary>
-        MVP_Presenter programPresenter;
-        /// <summary>
-        /// History of Actions
-        /// </summary>
-        ActionHistory historyOfActions;
-        /// <summary>
-        /// The assistant responsible for the redraw mode
-        /// </summary>
-        RedrawAssistant redrawAss;
-
-        /*******************/
-        /*** ENUMERATORS ***/
-        /*******************/
-
-        /***********************/
-        /*** CLASS VARIABLES ***/
-        /***********************/
-
-        /// <summary>
-        /// If the program is in drawing mode.
-        /// </summary>
-        bool inDrawingMode;
-        /// <summary>
-        /// If the mouse is currently pressed or not.
-        /// </summary>
-        bool mousePressed;
-        /// <summary>
-        /// Size of deletion area
-        /// </summary>
-        int deletionRadius = 5;
-        /// <summary>
-        /// Size of areas marking endpoints of lines in the redraw mode.
-        /// </summary>
-        int markerRadius = 10;
-        /// <summary>
-        /// The Position of the Cursor in the right picture box
-        /// </summary>
-        Point currentCursorPosition;
-        /// <summary>
-        /// The Previous Cursor Position in the right picture box
-        /// </summary>
-        Point previousCursorPosition;
-        /// <summary>
-        /// Queue for the cursorPositions
-        /// </summary>
-        Queue<Point> cursorPositions = new Queue<Point>();
-        /// <summary>
-        /// Lookup Matrix for checking postions of lines in the image
-        /// </summary>
-        bool[,] isFilledMatrix;
-        /// <summary>
-        /// Lookup Matrix for getting line ids at a certain postions of the image
-        /// </summary>
-        HashSet<int>[,] linesMatrix;
-        /// <summary>
-        /// List of items which will be overlayed over the right canvas.
-        /// </summary>
-        List<Tuple<bool, HashSet<Point>>> overlayItems;
-        /// <summary>
-        /// Width of the LeftImageBox.
-        /// </summary>
-        public int leftImageBoxWidth;
-        /// <summary>
-        /// Height of the LeftImageBox.
-        /// </summary>
-        public int leftImageBoxHeight;
-        /// <summary>
-        /// Width of the RightImageBox.
-        /// </summary>
-        public int rightImageBoxWidth;
-        /// <summary>
-        /// Height of the RightImageBox.
-        /// </summary>
-        public int rightImageBoxHeight;
-
-        //Images
-        Image leftImage;
-
-        List<Line> leftLineList;
-
-        Image rightImageWithoutOverlay;
-
-        Image rightImageWithOverlay;
-
-        List<Tuple<bool, Line>> rightLineList;
-
-        List<Point> currentLine;
-
-
-
-        public MVP_Model(MVP_Presenter presenter)
-        {
-            programPresenter = presenter;
-            historyOfActions = new ActionHistory();
-            redrawAss = new RedrawAssistant();
-            rightLineList = new List<Tuple<bool, Line>>();
-            overlayItems = new List<Tuple<bool, HashSet<Point>>>();
-        }
-
-        /**************************/
-        /*** INTERNAL FUNCTIONS ***/
-        /**************************/
-
-        /// <summary>
-        /// A function that returns a white canvas for a given width and height.
-        /// </summary>
-        /// <param name="width">The width of the canvas in pixels</param>
-        /// <param name="height">The height of the canvas in pixels</param>
-        /// <returns>The new canvas</returns>
-        private Image GetEmptyCanvas(int width, int height)
-        {
-            Image image;
-            try
-            {
-                image = new Bitmap(width, height);
-            }
-            catch (ArgumentException e)
-            {
-                programPresenter.PassMessageToView("The requested canvas size caused an error: \n" 
-                    + e.ToString() + "\n The Canvas will be set to match your window.");
-                image = new Bitmap(leftImageBoxWidth, leftImageBoxHeight);
-            }
-            Graphics graph = Graphics.FromImage(image);
-            graph.FillRectangle(Brushes.White, 0, 0, width + 10, height + 10);
-            return image;
-        }
-        
-
-        /// <summary>
-        /// Creates an empty Canvas on the left
-        /// </summary>
-        /// <param name="width"> width of the new canvas in pixels </param>
-        /// <param name="height"> height of the new canvas in pixels </param>
-        private void DrawEmptyCanvasLeft(int width, int height)
-        {
-            if (width == 0)
-            {
-                leftImage = GetEmptyCanvas(leftImageBoxWidth, leftImageBoxHeight);
-            }
-            else
-            {
-                leftImage = GetEmptyCanvas(width, height);
-            }
-            programPresenter.UpdateLeftImage(leftImage);
-        }
-
-        /// <summary>
-        /// Redraws all lines in rightLineList, for which their associated boolean value equals true and calls RedrawRightOverlay.
-        /// </summary>
-        private void RedrawRightImage()
-        {
-            var workingCanvas = GetEmptyCanvas(rightImageWithoutOverlay.Width, rightImageWithoutOverlay.Height);
-            var workingGraph = Graphics.FromImage(workingCanvas);
-            //Lines
-            foreach (Tuple<bool, Line> lineBoolTuple in rightLineList)
-            {
-                if (lineBoolTuple.Item1)
-                {
-                    lineBoolTuple.Item2.DrawLine(workingGraph);
-                }
-            }
-            //The Line being currently drawn
-            if (currentLine != null && currentLine.Count > 0 && inDrawingMode && mousePressed)
-            {
-                var currLine = new Line(currentLine);
-                currLine.DrawLine(workingGraph);
-            }
-            rightImageWithoutOverlay = workingCanvas;
-            //Redraw the Overlay if needed
-            if (leftImage != null)
-            {
-                RedrawRightOverlay();
-            }
-            else
-            {
-                programPresenter.UpdateRightImage(rightImageWithoutOverlay);
-            }
-        }
-
-        /// <summary>
-        /// Redraws all elements in the overlay items for which the respective boolean value is true.
-        /// </summary>
-        private void RedrawRightOverlay()
-        {
-            var workingCanvas = rightImageWithoutOverlay;
-            var workingGraph = Graphics.FromImage(workingCanvas);
-            foreach (Tuple<bool, HashSet<Point>> tup in overlayItems)
-            {
-                if (tup.Item1)
-                {
-                    foreach (Point p in tup.Item2)
-                    {
-                        workingGraph.FillRectangle(Brushes.Green, p.X, p.Y, 1, 1);
-                    }
-                }
-            }
-            rightImageWithOverlay = workingCanvas;
-            programPresenter.UpdateRightImage(rightImageWithOverlay);
-        }
-        
-        /// <summary>
-        /// Change the status of whether or not the lines are shown.
-        /// </summary>
-        /// <param name="lines">The HashSet containing the affected Line IDs.</param>
-        /// <param name="shown">True if the lines should be shown, false if they should be hidden.</param>
-        private void ChangeLines(HashSet<int> lines, bool shown)
-        {
-            var changed = false;
-            foreach (int lineId in lines)
-            {
-                if (lineId <= rightLineList.Count - 1 && lineId >= 0)
-                {
-                    rightLineList[lineId] = new Tuple<bool, Line>(shown, rightLineList[lineId].Item2);
-                    changed = true;
-                }
-            }
-            if (changed) { RedrawRightImage(); }
-        }
-        
-        /// <summary>
-        /// A function that populates the matrixes needed for deletion detection with line data.
-        /// </summary>
-        private void RepopulateDeletionMatrixes()
-        {
-            if (rightImageWithoutOverlay != null)
-            {
-                isFilledMatrix = new bool[rightImageWithoutOverlay.Width, rightImageWithoutOverlay.Height];
-                linesMatrix = new HashSet<int>[rightImageWithoutOverlay.Width, rightImageWithoutOverlay.Height];
-                foreach (Tuple<bool, Line> lineTuple in rightLineList)
-                {
-                    if (lineTuple.Item1)
-                    {
-                        lineTuple.Item2.PopulateMatrixes(isFilledMatrix, linesMatrix);
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// A function that checks the deletion matrixes at a certain point 
-        /// and returns all Line ids at that point and in a square around it in a certain range.
-        /// </summary>
-        /// <param name="p">The point around which to check.</param>
-        /// <param name="range">The range around the point. If range is 0, only the point is checked.</param>
-        /// <returns>A List of all lines.</returns>
-        private HashSet<int> CheckDeletionMatrixesAroundPoint(Point p, int range)
-        {
-            HashSet<int> returnSet = new HashSet<int>();
-
-            foreach (Point pnt in GeometryCalculator.FilledCircleAlgorithm(p, (int)range))
-            {
-                if (pnt.X >= 0 && pnt.Y >= 0 && pnt.X < rightImageWithoutOverlay.Width && pnt.Y < rightImageWithoutOverlay.Height)
-                {
-                    if (isFilledMatrix[pnt.X, pnt.Y])
-                    {
-                        returnSet.UnionWith(linesMatrix[pnt.X, pnt.Y]);
-                    }
-                }
-            }
-            return returnSet;
-        }
-
-        /*
-        /// <summary>
-        /// Will calculate the start and endpoints of the given line on the right canvas.
-        /// </summary>
-        /// <param name="line">The line.</param>
-        /// <param name="size">The size of the circle with which the endpoints of the line are marked.</param>
-        private Tuple<HashSet<Point>, HashSet<Point>> CalculateStartAndEnd(Line line, int size)
-        {
-            var circle0 = GeometryCalculator.FilledCircleAlgorithm(line.GetStartPoint(), size);
-            var circle1 = GeometryCalculator.FilledCircleAlgorithm(line.GetEndPoint(), size);
-            var currentLineEndings = new Tuple<HashSet<Point>, HashSet<Point>>(circle0, circle1);
-            return currentLineEndings;
-        }
-        */
-
-
-
-        /// <summary>
-        /// Tells the Presenter to Update the UI
-        /// </summary>
-        private void UpdateUI()
-        {
-            programPresenter.UpdateUIState(inDrawingMode, historyOfActions.CanUndo(), historyOfActions.CanRedo(), (rightImageWithoutOverlay != null));
-        }
-
-
-        /********************************************/
-        /*** FUNCTIONS TO INTERACT WITH PRESENTER ***/
-        /********************************************/
-
-        /// <summary>
-        /// Creates an empty Canvas
-        /// </summary>
-        public void DrawEmptyCanvasRight()
-        {
-            if (leftImage == null)
-            {
-                rightImageWithoutOverlay = GetEmptyCanvas(leftImageBoxWidth, leftImageBoxHeight);
-            }
-            else
-            {
-                rightImageWithoutOverlay = GetEmptyCanvas(leftImage.Width, leftImage.Height);
-            }
-            RepopulateDeletionMatrixes();
-            rightImageWithOverlay = rightImageWithoutOverlay;
-            programPresenter.UpdateRightImage(rightImageWithOverlay);
-        }
-
-        /// <summary>
-        /// The function to set the left image.
-        /// </summary>
-        /// <param name="width">The width of the left image.</param>
-        /// <param name="height">The height of the left image.</param>
-        /// <param name="listOfLines">The List of Lines to be displayed in the left image.</param>
-        public void SetLeftLineList(int width, int height, List<Line> listOfLines)
-        {
-            var workingCanvas = GetEmptyCanvas(width,height);
-            var workingGraph = Graphics.FromImage(workingCanvas);
-            leftLineList = listOfLines;
-            redrawAss = new RedrawAssistant(leftLineList);
-            overlayItems = redrawAss.Initialize(markerRadius);
-            //Lines
-            foreach (Line line in leftLineList)
-            {
-                line.DrawLine(workingGraph);
-            }
-            leftImage = workingCanvas;
-            programPresenter.UpdateLeftImage(leftImage);
-            //Set right image to same size as left image and delete linelist
-            DrawEmptyCanvasRight();
-            rightLineList = new List<Tuple<bool, Line>>();
-        }
-
-        /// <summary>
-        /// Will undo the last action taken, if the action history allows it.
-        /// </summary>
-        public void Undo()
-        {
-            if (historyOfActions.CanUndo())
-            {
-                HashSet<int> affectedLines = historyOfActions.GetCurrentAction().GetLineIDs();
-                SketchAction.ActionType undoAction = historyOfActions.GetCurrentAction().GetActionType();
-                switch (undoAction)
-                {
-                    case SketchAction.ActionType.Delete:
-                        //Deleted Lines need to be shown
-                        ChangeLines(affectedLines, true);
-                        break;
-                    case SketchAction.ActionType.Draw:
-                        //Drawn lines need to be hidden
-                        ChangeLines(affectedLines, false);
-                        break;
-                    default:
-                        break;
-                }
-                if(leftImage != null)
-                {
-                    //overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
-                }
-                RedrawRightImage();
-            }
-            RepopulateDeletionMatrixes();
-            programPresenter.PassLastActionTaken(historyOfActions.MoveAction(true));
-            UpdateUI();
-        }
-
-        /// <summary>
-        /// Will redo the last action undone, if the action history allows it.
-        /// </summary>
-        public void Redo()
-        {
-            if (historyOfActions.CanRedo())
-            {
-                programPresenter.PassLastActionTaken(historyOfActions.MoveAction(false));
-                HashSet<int> affectedLines = historyOfActions.GetCurrentAction().GetLineIDs();
-                SketchAction.ActionType redoAction = historyOfActions.GetCurrentAction().GetActionType();
-                switch (redoAction)
-                {
-                    case SketchAction.ActionType.Delete:
-                        //Deleted Lines need to be redeleted
-                        ChangeLines(affectedLines, false);
-                        break;
-                    case SketchAction.ActionType.Draw:
-                        //Drawn lines need to be redrawn
-                        ChangeLines(affectedLines, true);
-                        break;
-                    default:
-                        break;
-                }
-                if (leftImage != null)
-                {
-                    //overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
-                }
-                RedrawRightImage();
-                RepopulateDeletionMatrixes();
-            }
-            UpdateUI();
-        }
-
-        /// <summary>
-        /// The function called by the Presenter to change the drawing state of the program.
-        /// </summary>
-        /// <param name="nowDrawing">The new drawingstate of the program</param>
-        public void ChangeState(bool nowDrawing)
-        {
-            inDrawingMode = nowDrawing;
-            UpdateUI();
-        }
-
-        /// <summary>
-        /// A method to get the dimensions of the right image.
-        /// </summary>
-        /// <returns>A tuple containing the width and height of the right image.</returns>
-        public Tuple<int, int> GetRightImageDimensions()
-        {
-            if (rightImageWithoutOverlay != null)
-            {
-                return new Tuple<int, int>(rightImageWithoutOverlay.Width, rightImageWithoutOverlay.Height);
-            }
-            else
-            {
-                return new Tuple<int, int>(0, 0);
-            }
-        }
-
-        /// <summary>
-        /// Updates the current cursor position of the model.
-        /// </summary>
-        /// <param name="p">The new cursor position</param>
-        public void SetCurrentCursorPosition(Point p)
-        {
-            currentCursorPosition = p;
-        }
-
-        /// <summary>
-        /// Start a new Line, when the Mouse is pressed down.
-        /// </summary>
-        public void MouseDown()
-        {
-            mousePressed = true;
-            if (inDrawingMode)
-            {
-                currentLine = new List<Point>();
-            }
-        }
-
-        /// <summary>
-        /// Finish the current Line, when the pressed Mouse is released.
-        /// </summary>
-        public void MouseUp()
-        {
-            mousePressed = false;
-            if (inDrawingMode && currentLine.Count > 0)
-            {
-                Line newLine = new Line(currentLine, rightLineList.Count);
-                rightLineList.Add(new Tuple<bool, Line>(true, newLine));
-                newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
-                programPresenter.PassLastActionTaken(historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID())));
-                if(leftImage != null)
-                {
-                    //Execute a RedrawAssistant tick with the currently finished Line
-                    //overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, newLine.GetID(), true);
-                }
-                RedrawRightImage();
-            }
-            UpdateUI();
-        }
-
-        /// <summary>
-        /// Method to be called every tick. Updates the current Line, or checks for Lines to delete, depending on the drawing mode.
-        /// </summary>
-        public void Tick()
-        {
-            if (cursorPositions.Count > 0) { previousCursorPosition = cursorPositions.Dequeue(); }
-            else { previousCursorPosition = currentCursorPosition; }
-            cursorPositions.Enqueue(currentCursorPosition);
-            //Drawing
-            if (inDrawingMode && mousePressed)
-            {
-                var rightGraph = Graphics.FromImage(rightImageWithoutOverlay);
-                currentLine.Add(currentCursorPosition);
-                Line drawline = new Line(currentLine);
-                drawline.DrawLine(rightGraph);
-                RedrawRightOverlay();
-            }
-            //Deleting
-            if (!inDrawingMode && mousePressed)
-            {
-                List<Point> uncheckedPoints = GeometryCalculator.BresenhamLineAlgorithm(previousCursorPosition, currentCursorPosition);
-                foreach (Point currPoint in uncheckedPoints)
-                {
-                    HashSet<int> linesToDelete = CheckDeletionMatrixesAroundPoint(currPoint, deletionRadius);
-                    if (linesToDelete.Count > 0)
-                    {
-                        programPresenter.PassLastActionTaken(historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Delete, linesToDelete)));
-                        foreach (int lineID in linesToDelete)
-                        {
-                            rightLineList[lineID] = new Tuple<bool, Line>(false, rightLineList[lineID].Item2);
-                        }
-                        RepopulateDeletionMatrixes();
-                        if(leftImage != null)
-                        {
-                            //Redraw overlay gets ticked
-                            //overlayItems = redrawAss.Tick(currentCursorPosition, rightLineList, -1, false);
-                        }
-                        RedrawRightImage();
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// A helper Function that updates the markerRadius & deletionRadius, considering the size of the canvas.
-        /// </summary>
-        public void UpdateSizes()
-        {
-            if (rightImageWithoutOverlay != null)
-            {
-                int widthImage = rightImageWithoutOverlay.Width;
-                int heightImage = rightImageWithoutOverlay.Height;
-                int widthBox = rightImageBoxWidth;
-                int heightBox = rightImageBoxHeight;
-
-                float imageRatio = (float)widthImage / (float)heightImage;
-                float containerRatio = (float)widthBox / (float)heightBox;
-                float zoomFactor = 0;
-                if (imageRatio >= containerRatio)
-                {
-                    //Image is wider than it is high
-                    zoomFactor = (float)widthImage / (float)widthBox;
-                }
-                else
-                {
-                    //Image is higher than it is wide
-                    zoomFactor = (float)heightImage / (float)heightBox;
-                }
-                markerRadius = (int)(10 * zoomFactor);
-                redrawAss.SetMarkerRadius(markerRadius);
-                deletionRadius = (int)(5 * zoomFactor);
-            }
-        }
-
-        /// <summary>
-        /// If there is unsaved progress.
-        /// </summary>
-        /// <returns>True if there is progress that has not been saved.</returns>
-        public bool HasUnsavedProgress()
-        {
-            return !historyOfActions.IsEmpty();
-        }
-    }
-}

+ 0 - 310
SketchAssistant/SketchAssistant/MVP_Presenter.cs

@@ -1,310 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Drawing;
-
-namespace SketchAssistant
-{
-    public class MVP_Presenter
-    {
-        /// <summary>
-        /// The View of the MVP-Model, in this case Form1.
-        /// </summary>
-        MVP_View programView;
-        /// <summary>
-        /// The Model of the MVP-Model.
-        /// </summary>
-        MVP_Model programModel;
-
-        /*******************/
-        /*** ENUMERATORS ***/
-        /*******************/
-
-        public enum MouseAction
-        {
-            Click,
-            Down,
-            Up,
-            Move
-        }
-
-        /***********************/
-        /*** CLASS VARIABLES ***/
-        /***********************/
-
-        /// <summary>
-        /// Instance of FileImporter to handle drawing imports.
-        /// </summary>
-        private FileImporter fileImporter;
-
-
-        public MVP_Presenter(MVP_View form)
-        {
-            programView = form;
-            programModel = new MVP_Model(this);
-            //Initialize Class Variables
-            fileImporter = new FileImporter();
-        }
-
-        /***********************************/
-        /*** FUNCTIONS VIEW -> PRESENTER ***/
-        /***********************************/
-
-        /// <summary>
-        /// Pass-trough function to update the appropriate information of the model, when the window is resized.
-        /// </summary>
-        /// <param name="leftPBS">The new size of the left picture box.</param>
-        /// <param name="rightPBS">The new size of the left picture box.</param>
-        public void Resize(Tuple<int, int> leftPBS,Tuple<int, int> rightPBS)
-        {
-            programModel.leftImageBoxWidth = leftPBS.Item1;
-            programModel.leftImageBoxHeight = leftPBS.Item2;
-            programModel.rightImageBoxWidth = rightPBS.Item1;
-            programModel.rightImageBoxHeight = rightPBS.Item2;
-            programModel.UpdateSizes();
-        }
-
-        /// <summary>
-        /// Display a new FileDialog to load a collection of lines.
-        /// </summary>
-        public void ExamplePictureToolStripMenuItemClick()
-        {
-            var okToContinue = true;
-            if (programModel.HasUnsavedProgress())
-            {
-                okToContinue = programView.ShowWarning("You have unsaved progress. Continue?");
-            }
-            if (okToContinue)
-            {
-                var fileNameTup = programView.openNewDialog("Interactive Sketch-Assistant Drawing|*.isad");
-                if (!fileNameTup.Item1.Equals("") && !fileNameTup.Item2.Equals(""))
-                {
-                    programView.SetToolStripLoadStatus(fileNameTup.Item2);
-                    (int, int, List<Line>) values = fileImporter.ParseISADInputFile(fileNameTup.Item1);
-                    programModel.SetLeftLineList(values.Item1, values.Item2, values.Item3);
-                    programModel.ChangeState(true);
-                    programView.EnableTimer();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Pass-trough function to change the drawing state of the model.
-        /// </summary>
-        /// <param name="NowDrawing">Indicates if the program is in drawing (true) or deletion (false) mode.</param>
-        public void ChangeState(bool NowDrawing)
-        {
-            programModel.ChangeState(NowDrawing);
-        }
-
-        /// <summary>
-        /// Pass-trough function to undo an action.
-        /// </summary>
-        public void Undo()
-        {
-            programModel.Undo();
-        }
-
-        /// <summary>
-        /// Pass-trough function to redo an action.
-        /// </summary>
-        public void Redo()
-        {
-            programModel.Redo();
-        }
-
-        /// <summary>
-        /// Checks if there is unsaved progress, and promts the model to generate a new canvas if not.
-        /// </summary>
-        public void NewCanvas()
-        {
-            var okToContinue = true;
-            if (programModel.HasUnsavedProgress())
-            {
-                okToContinue = programView.ShowWarning("You have unsaved progress. Continue?");
-            }
-            if (okToContinue)
-            {
-                programModel.DrawEmptyCanvasRight();
-                programModel.ChangeState(true);
-                programView.EnableTimer();
-            }
-        }
-
-        /// <summary>
-        /// Pass-trough function for ticking the model.
-        /// </summary>
-        public void Tick()
-        {
-            programModel.Tick();
-        }
-
-        /// <summary>
-        /// Pass-trough when the mouse is moved.
-        /// </summary>
-        /// <param name="mouseAction">The action which is sent by the View.</param>
-        /// <param name="e">The Mouse event arguments.</param>
-        public void MouseEvent(MouseAction mouseAction, MouseEventArgs e)
-        {
-            switch (mouseAction)
-            {
-                case MouseAction.Move:
-                    programModel.SetCurrentCursorPosition(ConvertCoordinates(new Point(e.X, e.Y)));
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        /// <summary>
-        /// Pass-trough function that calls the correct Mouse event of the model, when the mouse is clicked.
-        /// </summary>
-        /// <param name="mouseAction">The action which is sent by the View.</param>
-        /// <param name="e">The Mouse event arguments.</param>
-        public void MouseEvent(MouseAction mouseAction)
-        {
-            switch (mouseAction)
-            {
-                case MouseAction.Click:
-                    programModel.MouseDown();
-                    programModel.Tick();
-                    programModel.MouseUp();
-                    break;
-                case MouseAction.Down:
-                    programModel.MouseDown();
-                    break;
-                case MouseAction.Up:
-                    programModel.MouseUp();
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        /************************************/
-        /*** FUNCTIONS MODEL -> PRESENTER ***/
-        /************************************/
-
-        /// <summary>
-        /// Called by the model when the state of the Program changes. 
-        /// Changes the look of the UI according to the current state of the model.
-        /// </summary>
-        /// <param name="inDrawingMode">If the model is in Drawing Mode</param>
-        /// <param name="canUndo">If actions in the model can be undone</param>
-        /// <param name="canRedo">If actions in the model can be redone</param>
-        /// <param name="imageLoaded">If an image is loaded in the model</param>
-        public void UpdateUIState(bool inDrawingMode, bool canUndo, bool canRedo, bool imageLoaded)
-        {
-            Dictionary<String, Form1.ButtonState> dict = new Dictionary<String, Form1.ButtonState> {
-                {"canvasButton", Form1.ButtonState.Enabled }, {"drawButton", Form1.ButtonState.Disabled}, {"deleteButton",Form1.ButtonState.Disabled },
-                {"undoButton", Form1.ButtonState.Disabled },{"redoButton",  Form1.ButtonState.Disabled}};
-
-            if (imageLoaded)
-            {
-                if (inDrawingMode)
-                {
-                    dict["drawButton"] = Form1.ButtonState.Active;
-                    dict["deleteButton"] = Form1.ButtonState.Enabled;
-                }
-                else
-                {
-                    dict["drawButton"] = Form1.ButtonState.Enabled;
-                    dict["deleteButton"] = Form1.ButtonState.Active;
-                }
-                if (canUndo){dict["undoButton"] = Form1.ButtonState.Enabled;}
-                if (canRedo){dict["redoButton"] = Form1.ButtonState.Enabled;}
-            }
-            foreach(KeyValuePair<String, Form1.ButtonState> entry in dict)
-            {
-                programView.SetToolStripButtonStatus(entry.Key, entry.Value);
-            }
-        }
-
-        /// <summary>
-        /// Is called by the model when the left image is changed.
-        /// </summary>
-        /// <param name="img">The new image.</param>
-        public void UpdateLeftImage(Image img)
-        {
-            programView.DisplayInLeftPictureBox(img);
-        }
-
-        /// <summary>
-        /// Is called by the model when the right image is changed.
-        /// </summary>
-        /// <param name="img">The new image.</param>
-        public void UpdateRightImage(Image img)
-        {
-            programView.DisplayInRightPictureBox(img);
-        }
-
-        /// <summary>
-        /// Pass-trough function to display an info message in the view.
-        /// </summary>
-        /// <param name="msg">The message.</param>
-        public void PassMessageToView(String msg)
-        {
-            programView.ShowInfoMessage(msg);
-        }
-
-        /// <summary>
-        /// Pass-trough function to update the display of the last action taken.
-        /// </summary>
-        /// <param name="msg">The new last action taken.</param>
-        public void PassLastActionTaken(String msg)
-        {
-            programView.SetLastActionTakenText(msg);
-        }
-
-        /*************************/
-        /*** HELPING FUNCTIONS ***/
-        /*************************/
-
-        /// <summary>
-        /// A function that calculates the coordinates of a point on a zoomed in image.
-        /// </summary>
-        /// <param name="">The position of the mouse cursor</param>
-        /// <returns>The real coordinates of the mouse cursor on the image</returns>
-        private Point ConvertCoordinates(Point cursorPosition)
-        {
-            var rightImageDimensions = programModel.GetRightImageDimensions();
-            Point realCoordinates = new Point(0, 0);
-
-            int widthImage = rightImageDimensions.Item1;
-            int heightImage = rightImageDimensions.Item2;
-            int widthBox = programModel.rightImageBoxWidth;
-            int heightBox = programModel.rightImageBoxHeight;
-
-            if (heightImage == 0 && widthImage == 0)
-            {
-                return cursorPosition;
-            }
-
-            float imageRatio = (float)widthImage / (float)heightImage;
-            float containerRatio = (float)widthBox / (float)heightBox;
-
-            if (imageRatio >= containerRatio)
-            {
-                //Image is wider than it is high
-                float zoomFactor = (float)widthImage / (float)widthBox;
-                float scaledHeight = heightImage / zoomFactor;
-                float filler = (heightBox - scaledHeight) / 2;
-                realCoordinates.X = (int)(cursorPosition.X * zoomFactor);
-                realCoordinates.Y = (int)((cursorPosition.Y - filler) * zoomFactor);
-            }
-            else
-            {
-                //Image is higher than it is wide
-                float zoomFactor = (float)heightImage / (float)heightBox;
-                float scaledWidth = widthImage / zoomFactor;
-                float filler = (widthBox - scaledWidth) / 2;
-                realCoordinates.X = (int)((cursorPosition.X - filler) * zoomFactor);
-                realCoordinates.Y = (int)(cursorPosition.Y * zoomFactor);
-            }
-            return realCoordinates;
-        }
-    }
-}

+ 0 - 71
SketchAssistant/SketchAssistant/MVP_View.cs

@@ -1,71 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-
-
-namespace SketchAssistant
-{
-    public interface MVP_View
-    {
-
-        /// <summary>
-        /// Enables the timer of the View, which will tick the Presenter.
-        /// </summary>
-        void EnableTimer();
-
-        /// <summary>
-        /// A function that opens a file dialog and returns the filename.
-        /// </summary>
-        /// <param name="Filter">The filter that should be applied to the new Dialog.</param>
-        /// <returns>Returns the FileName and the SafeFileName if the user correctly selects a file, 
-        /// else returns a tuple with empty strigns</returns>
-        Tuple<String, String> openNewDialog(String Filter);
-
-        /// <summary>
-        /// Sets the contents of the load status indicator label.
-        /// </summary>
-        /// <param name="message">The new contents</param>
-        void SetToolStripLoadStatus(String message);
-
-        /// <summary>
-        /// Sets the contents of the last action taken indicator label.
-        /// </summary>
-        /// <param name="message">The new contents</param>
-        void SetLastActionTakenText(String message);
-
-        /// <summary>
-        /// Changes the states of a tool strip button.
-        /// </summary>
-        /// <param name="buttonName">The name of the button.</param>
-        /// <param name="state">The new state of the button.</param>
-        void SetToolStripButtonStatus(String buttonName, Form1.ButtonState state);
-
-        /// <summary>
-        /// Displays an image in the left Picture box.
-        /// </summary>
-        /// <param name="img">The new image.</param>
-        void DisplayInLeftPictureBox(Image img);
-
-        /// <summary>
-        /// Displays an image in the right Picture box.
-        /// </summary>
-        /// <param name="img">The new image.</param>
-        void DisplayInRightPictureBox(Image img);
-
-        /// <summary>
-        /// shows the given info message in a popup and asks the user to aknowledge it
-        /// </summary>
-        /// <param name="message">the message to show</param>
-        void ShowInfoMessage(String message);
-
-        /// <summary>
-        /// Shows a warning box with the given message (Yes/No Buttons)and returns true if the user aknowledges it.
-        /// </summary>
-        /// <param name="message">The message of the warning.</param>
-        /// <returns>True if the user confirms (Yes), negative if he doesn't (No)</returns>
-        bool ShowWarning(String message);
-    }
-}

+ 0 - 22
SketchAssistant/SketchAssistant/Program.cs

@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace SketchAssistant
-{
-    static class Program
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        [STAThread]
-        static void Main()
-        {
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
-            Application.Run(new Form1());
-        }
-    }
-}

+ 0 - 36
SketchAssistant/SketchAssistant/Properties/AssemblyInfo.cs

@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SketchAssistant")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SketchAssistant")]
-[assembly: AssemblyCopyright("Copyright ©  2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components.  If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("0336f628-a2f7-4170-8b2e-9277c23118d4")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 0 - 71
SketchAssistant/SketchAssistant/Properties/Resources.Designer.cs

@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SketchAssistant.Properties
-{
-
-
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // This class was auto-generated by the StronglyTypedResourceBuilder
-    // class via a tool like ResGen or Visual Studio.
-    // To add or remove a member, edit your .ResX file then rerun ResGen
-    // with the /str option, or rebuild your VS project.
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
-        private static global::System.Resources.ResourceManager resourceMan;
-
-        private static global::System.Globalization.CultureInfo resourceCulture;
-
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
-        }
-
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SketchAssistant.Properties.Resources", typeof(Resources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
-                return resourceCulture;
-            }
-            set
-            {
-                resourceCulture = value;
-            }
-        }
-    }
-}

+ 0 - 117
SketchAssistant/SketchAssistant/Properties/Resources.resx

@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>

+ 0 - 30
SketchAssistant/SketchAssistant/Properties/Settings.Designer.cs

@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace SketchAssistant.Properties
-{
-
-
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
-        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
-                return defaultInstance;
-            }
-        }
-    }
-}

+ 0 - 7
SketchAssistant/SketchAssistant/Properties/Settings.settings

@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>

+ 0 - 251
SketchAssistant/SketchAssistant/RedrawAssistant.cs

@@ -1,251 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Drawing;
-
-namespace SketchAssistant
-{
-    public class RedrawAssistant
-    {
-        /// <summary>
-        /// The lines of the left image, with a boolean indicating if they have been redrawn
-        /// and an integer that is the same as the line id of the respective line in the right image.
-        /// </summary>
-        List<Tuple<Line, bool, int>> linesToRedraw;
-        /// <summary>
-        /// The Start and End points of all lines in linesToRedraw in the same order.
-        /// </summary>
-        List<Tuple<HashSet<Point>, HashSet<Point>>> startAndEndPoints;
-        /// <summary>
-        /// A Hashtable for quick lookup for a line id and its respective tuple in linesToRedraw
-        /// </summary>
-        Hashtable redrawnLineLookupTable;
-        /// <summary>
-        /// The position of the line currently being redrawn in the startAndEndPoints 
-        /// & linesToRedraw lists. -1 if no line is being redrawn.
-        /// </summary>
-        int lineBeingRedrawn;
-        /// <summary>
-        /// The id of the line being drawn on the right side. -1 if no line is being drawn.
-        /// </summary>
-        int currentLineID;
-        /// <summary>
-        /// Whether or not the user is currently redrawing a line.
-        /// </summary>
-        bool currentlyRedrawing;
-        /// <summary>
-        /// Whether or not the RedrawAssistant is active.
-        /// </summary>
-        bool isActive;
-        /// <summary>
-        /// The radius of the markers for redrawing.
-        /// </summary>
-        int markerRadius = 5;
-
-        /// <summary>
-        /// The Constructor for an inactive RedrawAssistant.
-        /// </summary>
-        public RedrawAssistant()
-        {
-            isActive = false;
-        }
-
-        /// <summary>
-        /// The constructor for an active RedrawAssistant
-        /// </summary>
-        /// <param name="redrawItem">The lines that shall be redrawn</param>
-        public RedrawAssistant(List<Line> redrawItem)
-        {
-            linesToRedraw = new List<Tuple<Line, bool, int>>();
-            startAndEndPoints = new List<Tuple<HashSet<Point>, HashSet<Point>>>();
-            isActive = true;
-            currentlyRedrawing = false;
-            lineBeingRedrawn = -1;
-            redrawnLineLookupTable = new Hashtable();
-            foreach (Line line in redrawItem)
-            {
-                linesToRedraw.Add(new Tuple<Line, bool, int>(line, false, -1));
-            }
-            SetMarkerRadius(5);
-        }
-
-        /// <summary>
-        /// Initialization function that returns the initial list of overlay points.
-        /// </summary>
-        /// <param name="mRad">The radius of the points.</param>
-        /// <returns>The list of overlay points.</returns>
-        public List<Tuple<bool, HashSet<Point>>> Initialize(int mRad)
-        {
-            if (isActive)
-            {
-                List<Tuple<bool, HashSet<Point>>> retList = new List<Tuple<bool, HashSet<Point>>>();
-                SetMarkerRadius(mRad);
-                foreach(Tuple<HashSet<Point>, HashSet<Point>> tup in startAndEndPoints)
-                {
-                    retList.Add(new Tuple<bool, HashSet<Point>>(false, tup.Item1));
-                    retList.Add(new Tuple<bool, HashSet<Point>>(false, tup.Item2));
-                }
-                return retList;
-            }
-            return null;
-        }
-
-        /// <summary>
-        /// The main functionality of the RedrawAssistant, which updates the Assistant according to the inputs given.
-        /// </summary>
-        /// <param name="currentPoint">The current position of the cursor, as a point</param>
-        /// <param name="rightLines">The lines on the right canvas</param>
-        /// <param name="currLineID">The id of the line currently being drawn.</param>
-        /// <param name="lineFinished">A boolean to indicate that the line is finished</param>
-        /// <param name="overlayItems">A list containing the overlay items and if they should be drawn.</param>
-        /// <returns>The updated List of overlay items, or the same list if no changes need to be done, 
-        /// along with a boolean indicating if something was changed</returns>
-        public Tuple<bool, List<Tuple<bool, HashSet<Point>>>> Tick(Point currentPoint, List<Tuple<bool, Line>> rightLines, int currLineID, bool lineFinished, 
-            List<Tuple<bool, HashSet<Point>>> overlayItems)
-        {
-            if (!isActive) { return new Tuple<bool, List<Tuple<bool, HashSet<Point>>>>(false, overlayItems); }
-
-            if (!currentlyRedrawing)
-            {
-
-            }
-            /*
-            Tuple<Line, bool, int> newLineTuple = null;
-            var returnAllStartPoints = true;
-            CheckForUndrawnLines(rightLines);
-            
-            // Checking if a startpoint is intersected
-            if (!currentlyRedrawing)
-            {
-                for (int i = 0; i < linesToRedraw.Count; i++)
-                {
-                    Tuple<Line, bool, int> tup = linesToRedraw[i];
-                    if (!tup.Item2)
-                    {
-                        if (startAndEndPoints[i].Item1.Contains(currentPoint))
-                        {
-                            currentlyRedrawing = true;
-                            lineBeingRedrawn = i;
-                            currentLineID = currLineID;
-                            returnList.Add(startAndEndPoints[i].Item1);
-                            returnList.Add(startAndEndPoints[i].Item2);
-                            returnAllStartPoints = false;
-                        }
-                    }
-                }
-            }
-            //Currently redrawing a line, but a line hasn't been finished drawing.
-            else if (!lineFinished)
-            {
-                returnList.Add(startAndEndPoints[lineBeingRedrawn].Item1);
-                returnList.Add(startAndEndPoints[lineBeingRedrawn].Item2);
-                returnAllStartPoints = false;
-            }
-            //Line is finished, check if it is in the correct endpoint
-            else if (currLineID == currentLineID && startAndEndPoints[lineBeingRedrawn].Item2.Contains(currentPoint))
-            {
-                newLineTuple = new Tuple<Line, bool, int>(linesToRedraw[lineBeingRedrawn].Item1, true, currLineID);
-                currentlyRedrawing = false;
-                lineBeingRedrawn = -1;
-                currentLineID = -1;
-            }
-            //Line is finished, but not in the correct endpoint
-            else
-            {
-                currentlyRedrawing = false;
-                lineBeingRedrawn = -1;
-                currentLineID = -1;
-            }
-
-            //Replace the changed line tuple in linesToRedraw
-            if(newLineTuple != null)
-            {
-                var newLine = newLineTuple.Item1;
-                for (int i = 0; i < linesToRedraw.Count; i++)
-                {
-                    var redrawLine = linesToRedraw[i].Item1;
-                    if (redrawLine.GetID() == newLine.GetID() 
-                        && redrawLine.GetStartPoint().Equals(newLine.GetStartPoint())
-                        && redrawLine.GetEndPoint().Equals(newLine.GetEndPoint()))
-                    {
-                        redrawnLineLookupTable.Add(currLineID, i);
-                        linesToRedraw[i] = newLineTuple;
-                    }
-                }
-            }
-
-            //Add all the startpoints to the list being returned
-            if (returnAllStartPoints)
-            {
-                for (int i = 0; i < linesToRedraw.Count; i++)
-                {
-                    if (!linesToRedraw[i].Item2)
-                    {
-                        returnList.Add(startAndEndPoints[i].Item1);
-                    }
-                }
-            }
-            return returnList;
-            */
-            return new Tuple<bool, List<Tuple<bool, HashSet<Point>>>>(false, overlayItems);
-        }
-
-        /// <summary>
-        /// A helping function which checks for lines where previously redrawn, but were removed from the image again.
-        /// </summary>
-        /// <param name="rightLines">The lines in the right image.</param>
-        private void CheckForUndrawnLines(List<Tuple<bool, Line>> rightLines)
-        {
-            for (int i = 0; i < rightLines.Count; i++)
-            {
-                if (redrawnLineLookupTable.ContainsKey(rightLines[i].Item2.GetID()))
-                {
-                    if (!rightLines[i].Item1)
-                    {
-                        int listPos = (int)redrawnLineLookupTable[rightLines[i].Item2.GetID()];
-                        var oldTup = linesToRedraw[listPos];
-                        linesToRedraw[listPos] = new Tuple<Line, bool, int>(oldTup.Item1, false, -1);
-                    }
-                    else
-                    {
-                        int listPos = (int)redrawnLineLookupTable[rightLines[i].Item2.GetID()];
-                        var oldTup = linesToRedraw[listPos];
-                        linesToRedraw[listPos] = new Tuple<Line, bool, int>(oldTup.Item1, true, rightLines[i].Item2.GetID());
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// A function to set the marker radius for the markers returned by the RedrawAssistant
-        /// </summary>
-        /// <param name="markerRad">The Radius of the markers.</param>
-        public void SetMarkerRadius(int markerRad)
-        {
-            markerRadius = markerRad;
-            if (isActive)
-            {
-                startAndEndPoints = new List<Tuple<HashSet<Point>, HashSet<Point>>>();
-                foreach (Tuple<Line, bool, int> tup in linesToRedraw)
-                {
-                    startAndEndPoints.Add(CalculateStartAndEnd(tup.Item1));
-                }
-            }
-        }
-
-        /// <summary>
-        /// Will calculate the start and endpoints of the given line.
-        /// </summary>
-        /// <param name="line">The given line.</param>
-        private Tuple<HashSet<Point>, HashSet<Point>> CalculateStartAndEnd(Line line)
-        {
-            var circle0 = GeometryCalculator.FilledCircleAlgorithm(line.GetStartPoint(), markerRadius);
-            var circle1 = GeometryCalculator.FilledCircleAlgorithm(line.GetEndPoint(), markerRadius);
-            var currentLineEndings = new Tuple<HashSet<Point>, HashSet<Point>>(circle0, circle1);
-            return currentLineEndings;
-        }
-    }
-}

+ 0 - 98
SketchAssistant/SketchAssistant/SketchAction.cs

@@ -1,98 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace SketchAssistant
-{
-    public class SketchAction
-    {
-        //Types of possible actions
-        public enum ActionType
-        {
-            Draw,
-            Delete,
-            Start
-        }
-        //Type of this action
-        private ActionType thisAction;
-        //ID of the Line affected
-        private HashSet<int> lineIDs;
-
-        /// <summary>
-        /// Constructor for a new action with multiple lines affected.
-        /// </summary>
-        /// <param name="theAction">The type of action, if it is ActionType.Start the affectedIDs will be ignored.</param>
-        /// <param name="affectedID">The IDs of the lines affected.</param>
-        public SketchAction(ActionType theAction, HashSet<int> affectedIDs)
-        {
-            thisAction = theAction;
-            if (theAction.Equals(ActionType.Start)) { lineIDs = new HashSet<int>(); }
-            else { lineIDs = new HashSet<int>(affectedIDs); }
-        }
-
-        /// <summary>
-        /// Constructor for a new action with one line affected.
-        /// </summary>
-        /// <param name="theAction">The type of action, if it is ActionType.Start the affectedID will be ignored.</param>
-        /// <param name="affectedID">The ID of the affected line.</param>
-        public SketchAction(ActionType theAction, int affectedID)
-        {
-            thisAction = theAction;
-            if (theAction.Equals(ActionType.Start)) { lineIDs = new HashSet<int>(); }
-            else
-            {
-                lineIDs = new HashSet<int>();
-                lineIDs.Add(affectedID);
-            }
-        }
-
-        /// <summary>
-        /// Fetches the type of this action.
-        /// </summary>
-        /// <returns>The type of this action.</returns>
-        public ActionType GetActionType()
-        {
-            return thisAction;
-        }
-
-        /// <summary>
-        /// Fetches the IDs of the lines affected by this action.
-        /// </summary>
-        /// <returns>The IDs of the lines affected by this action. An empty set if there is no line affected.</returns>
-        public HashSet<int> GetLineIDs()
-        {
-            return lineIDs;
-        }
-
-        /// <summary>
-        /// Get the information about this action.
-        /// </summary>
-        /// <returns>A String describing what happend at this action.</returns>
-        public String GetActionInformation()
-        {
-            String returnString;
-            switch (thisAction)
-            {
-                case ActionType.Start:
-                    returnString = "A new canvas was created.";
-                    break;
-                case ActionType.Draw:
-                    returnString = "Line number " + lineIDs.First().ToString() + " was drawn.";
-                    break;
-                case ActionType.Delete:
-                    if (lineIDs.Count == 1) { returnString = "Line number " + lineIDs.First().ToString() + " was deleted."; }
-                    else
-                    {
-                        returnString = "Several Lines were deleted.";
-                    }
-                    break;
-                default:
-                    returnString = "There is no information available for this action.";
-                    break;
-            }
-            return returnString;
-        }
-    }
-}

+ 0 - 131
SketchAssistant/SketchAssistant/SketchAssistant.csproj

@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{0336F628-A2F7-4170-8B2E-9277C23118D4}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <RootNamespace>SketchAssistant</RootNamespace>
-    <AssemblyName>SketchAssistant</AssemblyName>
-    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
-    <PublishUrl>publish\</PublishUrl>
-    <Install>true</Install>
-    <InstallFrom>Disk</InstallFrom>
-    <UpdateEnabled>false</UpdateEnabled>
-    <UpdateMode>Foreground</UpdateMode>
-    <UpdateInterval>7</UpdateInterval>
-    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
-    <UpdatePeriodically>false</UpdatePeriodically>
-    <UpdateRequired>false</UpdateRequired>
-    <MapFileExtensions>true</MapFileExtensions>
-    <ApplicationRevision>0</ApplicationRevision>
-    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
-    <IsWebBootstrapper>false</IsWebBootstrapper>
-    <UseApplicationTrust>false</UseApplicationTrust>
-    <BootstrapperEnabled>true</BootstrapperEnabled>
-    <NuGetPackageImportStamp>
-    </NuGetPackageImportStamp>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Configuration" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
-      <HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.1\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Deployment" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Net.Http" />
-    <Reference Include="System.Windows.Forms" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="MVP_View.cs" />
-    <Compile Include="MVP_Presenter.cs" />
-    <Compile Include="MVP_Model.cs" />
-    <Compile Include="RedrawAssistant.cs" />
-    <Compile Include="FileImporter.cs" />
-    <Compile Include="FileImporterException.cs" />
-    <Compile Include="GeometryCalculator.cs" />
-    <Compile Include="SketchAction.cs" />
-    <Compile Include="ActionHistory.cs" />
-    <Compile Include="Line.cs" />
-    <Compile Include="Form1.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="Form1.Designer.cs">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <EmbeddedResource Include="Form1.resx">
-      <DependentUpon>Form1.cs</DependentUpon>
-    </EmbeddedResource>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-      <SubType>Designer</SubType>
-    </EmbeddedResource>
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
-    <None Include="packages.config" />
-    <None Include="Properties\Settings.settings">
-      <Generator>SettingsSingleFileGenerator</Generator>
-      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
-    </None>
-    <Compile Include="Properties\Settings.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DependentUpon>Settings.settings</DependentUpon>
-      <DesignTimeSharedInput>True</DesignTimeSharedInput>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="App.config">
-      <SubType>Designer</SubType>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
-      <Visible>False</Visible>
-      <ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
-      <Install>true</Install>
-    </BootstrapperPackage>
-    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
-      <Visible>False</Visible>
-      <ProductName>.NET Framework 3.5 SP1</ProductName>
-      <Install>false</Install>
-    </BootstrapperPackage>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-</Project>

+ 0 - 6
SketchAssistant/SketchAssistant/packages.config

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="OpenCover" version="4.6.519" targetFramework="net461" />
-  <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net461" />
-  <package id="System.Threading.Tasks.Extensions" version="4.5.1" targetFramework="net461" />
-</packages>

+ 0 - 23
SketchAssistant/SketchAssistantWPF.Tests/SketchAssistantWPF.Tests.csproj

@@ -1,23 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>net461</TargetFramework>
-
-    <IsPackable>false</IsPackable>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <ProjectReference Include="..\SketchAssistantWPF\SketchAssistantWPF.csproj" />
-  </ItemGroup>
-
-  <ItemGroup>
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="PresentationCore" />
-    <Reference Include="PresentationFramework" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="System.Net.Http" />
-    <Reference Include="System.Windows" />
-    <Reference Include="System.Xaml" />
-  </ItemGroup>
-
-</Project>

+ 0 - 287
SketchAssistant/SketchAssistantWPF.Tests/UnitTest1.cs

@@ -1,287 +0,0 @@
-using NUnit.Framework;
-using System.Collections.Generic;
-using SketchAssistantWPF;
-using System;
-using System.Windows;
-
-namespace Tests
-{
-    public class Tests
-    {
-        [SetUp]
-        public void Setup()
-        {
-        }
-
-        [Test]
-        public void Test1()
-        {
-            Assert.AreEqual(true, true);
-        }
-    }
-
-    /*
-    public class LineTests
-    {
-        //========================//
-        //= Bresenham Line Tests =//
-        //========================//
-
-        [Test]
-        public void BresenhamLineTest1()
-        {
-            AvalonTestRunner.RunInSTA(
-                delegate
-                {
-                    //Test point
-                    List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-                    expectedResult.Add(new System.Windows.Point(1, 2));
-                    List<System.Windows.Point> actualResult = GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(1, 2), new System.Windows.Point(1, 2));
-                    Assert.AreEqual(1, actualResult.Count);
-                    for (int i = 0; i < actualResult.Count; i++)
-                    {
-                        Assert.AreEqual(expectedResult[i], actualResult[i]);
-                    }
-                });
-        }
-
-        [Test]
-        public void BresenhamLineTest2()
-        {
-            //Test line going from left to right
-            List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-            for (int i = 1; i <= 6; i++) { expectedResult.Add(new System.Windows.Point(i, 2)); }
-            List<System.Windows.Point> actualResult = SketchAssistantWPF.GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(1, 2), new System.Windows.Point(6, 2));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [Test]
-        public void BresenhamLineTest3()
-        {
-            //Test line going from right to left
-            List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-            for (int i = 6; i >= 1; i--) { expectedResult.Add(new System.Windows.Point(i, 2)); }
-            List<System.Windows.Point> actualResult = SketchAssistantWPF.GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(6, 2), new System.Windows.Point(1, 2));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [Test]
-        public void BresenhamLineTest4()
-        {
-            //Test line going from top to bottom
-            List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-            for (int i = 5; i <= 25; i++) { expectedResult.Add(new System.Windows.Point(7, i)); }
-            List<System.Windows.Point> actualResult = SketchAssistantWPF.GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(7, 5), new System.Windows.Point(7, 25));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [Test]
-        public void BresenhamLineTest5()
-        {
-            //Test line going from bottom to top
-            List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-            for (int i = 25; i >= 5; i--) { expectedResult.Add(new System.Windows.Point(7, i)); }
-            List<System.Windows.Point> actualResult = SketchAssistantWPF.GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(7, 25), new System.Windows.Point(7, 5));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [Test]
-        public void BresenhamLineTest6()
-        {
-            //Test exactly diagonal line from top left to bottom right
-            List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-            for (int i = 5; i <= 25; i++) { expectedResult.Add(new System.Windows.Point(i + 2, i)); }
-            List<System.Windows.Point> actualResult = SketchAssistantWPF.GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(7, 5), new System.Windows.Point(27, 25));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        [Test]
-        public void BresenhamLineTest7()
-        {
-            //Test exactly diagonal line from bottom right to top left
-            List<System.Windows.Point> expectedResult = new List<System.Windows.Point>();
-            for (int i = 25; i >= 5; i--) { expectedResult.Add(new System.Windows.Point(i + 2, i)); }
-            List<System.Windows.Point> actualResult = SketchAssistantWPF.GeometryCalculator.BresenhamLineAlgorithm(new System.Windows.Point(27, 25), new System.Windows.Point(7, 5));
-            Assert.AreEqual(expectedResult.Count, actualResult.Count);
-            for (int i = 0; i < actualResult.Count; i++)
-            {
-                Assert.AreEqual(expectedResult[i], actualResult[i]);
-            }
-        }
-
-        //===========================//
-        //= Matrix Population Tests =//
-        //===========================//
-
-        [Test]
-        public void MatrixTest1()
-        {
-            //Populate Matrix for temporary Line
-            List<System.Windows.Point> thePoints = new List<System.Windows.Point>();
-            thePoints.Add(new System.Windows.Point(1, 1));
-            thePoints.Add(new System.Windows.Point(1, 2));
-            bool[,] testBoolMatrix = new bool[5, 5];
-            List<int>[,] testLineMatrix = new List<int>[5, 5];
-            bool[,] resultBoolMatrix = new bool[5, 5];
-            HashSet<int>[,] resultLineMatrix = new HashSet<int>[5, 5];
-            InternalLine testLine = new InternalLine(thePoints);
-            testLine.PopulateMatrixes(resultBoolMatrix, resultLineMatrix);
-            for (int i = 0; i < 5; i++)
-            {
-                for (int j = 0; j < 5; j++)
-                {
-                    Assert.AreEqual(testBoolMatrix[i, j], resultBoolMatrix[i, j]);
-                    Assert.AreEqual(testLineMatrix[i, j], resultLineMatrix[i, j]);
-                }
-            }
-        }
-
-        [Test]
-        public void MatrixTest2()
-        {
-            //Populate Matrix for non-temporary InternalLine
-            List<System.Windows.Point> thePoints = new List<System.Windows.Point>();
-            thePoints.Add(new System.Windows.Point(1, 1));
-            thePoints.Add(new System.Windows.Point(3, 3));
-            bool[,] testBoolMatrix = new bool[5, 5];
-            HashSet<int>[,] testLineMatrix = new HashSet<int>[5, 5];
-            for (int i = 1; i <= 3; i++)
-            {
-                testBoolMatrix[i, i] = true;
-                HashSet<int> temp = new HashSet<int>();
-                temp.Add(5);
-                testLineMatrix[i, i] = temp;
-            }
-            bool[,] resultBoolMatrix = new bool[5, 5];
-            HashSet<int>[,] resultLineMatrix = new HashSet<int>[5, 5];
-            InternalLine testLine = new InternalLine(thePoints, 5);
-            testLine.PopulateMatrixes(resultBoolMatrix, resultLineMatrix);
-            for (int i = 0; i < 5; i++)
-            {
-                for (int j = 0; j < 5; j++)
-                {
-                    Assert.AreEqual(testBoolMatrix[i, j], resultBoolMatrix[i, j]);
-                    if (testLineMatrix[i, j] != null && resultLineMatrix[i, j] != null)
-                    {
-                        for (int k = 0; k < resultLineMatrix[i, j].Count; k++)
-                        {
-                            Assert.AreEqual(true, testLineMatrix[i, j].SetEquals(resultLineMatrix[i, j]));
-                        }
-                    }
-                }
-            }
-        }
-
-        //=========================//
-        //= Line Constructor Test =//
-        //=========================//
-
-        [Test]
-        public void ConstructorTest()
-        {
-            //Create non-temporary Line and check points
-            //reference Points
-            List<System.Windows.Point> comparisonPoints = new List<System.Windows.Point> {new System.Windows.Point(2,2), new System.Windows.Point(3, 1), new System.Windows.Point(4, 1), new System.Windows.Point(5, 1), new System.Windows.Point(6, 2),
-                new System.Windows.Point(7, 3), new System.Windows.Point(8, 4), new System.Windows.Point(9, 5), new System.Windows.Point(10, 6), new System.Windows.Point(11, 5), new System.Windows.Point(11, 4), new System.Windows.Point(11, 3),
-                new System.Windows.Point(10, 2), new System.Windows.Point(9, 1), new System.Windows.Point(8, 2), new System.Windows.Point(7, 3), new System.Windows.Point(6, 4), new System.Windows.Point(5, 5), new System.Windows.Point(4, 5),
-                new System.Windows.Point(3, 5), new System.Windows.Point(2, 5), new System.Windows.Point(1, 4)};
-            //test Points, with intermediate points missing & duplicate points
-            List<System.Windows.Point> testPoints = new List<System.Windows.Point> {new System.Windows.Point(2,2), new System.Windows.Point(3, 1), new System.Windows.Point(5, 1), new System.Windows.Point(5, 1), new System.Windows.Point(5, 1),
-                new System.Windows.Point(8, 4), new System.Windows.Point(10, 6), new System.Windows.Point(11, 5), new System.Windows.Point(11, 3), new System.Windows.Point(9, 1), new System.Windows.Point(9, 1), new System.Windows.Point(9, 1),
-                new System.Windows.Point(5, 5), new System.Windows.Point(2, 5), new System.Windows.Point(2, 5), new System.Windows.Point(1, 4) };
-            InternalLine testLine = new InternalLine(testPoints, 0);
-            List<System.Windows.Point> returnedPoints = testLine.GetPoints();
-            Assert.AreEqual(comparisonPoints.Count, returnedPoints.Count);
-            for (int i = 0; i < returnedPoints.Count; i++)
-            {
-                Assert.AreEqual(comparisonPoints[i], returnedPoints[i]);
-            }
-        }
-    }
-    */
-
-    public class ActionHistoryTests
-    {
-
-        private ActionHistory GetActionHistory()
-        {
-            return new ActionHistory();
-        }
-
-        [TestCase(SketchAction.ActionType.Start, 5, -1, "A new canvas was created.")]
-        [TestCase(SketchAction.ActionType.Draw, 5, 5, "Line number 5 was drawn.")]
-        [TestCase(SketchAction.ActionType.Delete, 10, 10, "Line number 10 was deleted.")]
-        public void ScetchActionTest1(SketchAction.ActionType type, int id, int exit, String response)
-        {
-            HashSet<int> actualResult = new HashSet<int>();
-            if (!type.Equals(SketchAction.ActionType.Start)) { actualResult.Add(id); }
-            SketchAction testAction = new SketchAction(type, id);
-            Assert.AreEqual(type, testAction.GetActionType());
-            Assert.AreEqual(true, actualResult.SetEquals(testAction.GetLineIDs()));
-            Assert.AreEqual(response, testAction.GetActionInformation());
-        }
-
-        [TestCase(SketchAction.ActionType.Start, 1, 2, 3, "A new canvas was created.")]
-        [TestCase(SketchAction.ActionType.Draw, 3, 3, 3, "Line number 3 was drawn.")]
-        [TestCase(SketchAction.ActionType.Delete, 20, 30, 40, "Several Lines were deleted.")]
-        public void ScetchActionTest2(SketchAction.ActionType type, int id1, int id2, int id3, String response)
-        {
-            HashSet<int> actualResult = new HashSet<int>();
-            if (!type.Equals(SketchAction.ActionType.Start))
-            {
-                actualResult.Add(id1);
-                actualResult.Add(id2);
-                actualResult.Add(id3);
-            }
-            SketchAction testAction = new SketchAction(type, actualResult);
-            Assert.AreEqual(type, testAction.GetActionType());
-            Assert.AreEqual(true, actualResult.SetEquals(testAction.GetLineIDs()));
-            Assert.AreEqual(response, testAction.GetActionInformation());
-        }
-
-        [TestCase(SketchAction.ActionType.Start, SketchAction.ActionType.Start, true)]
-        [TestCase(SketchAction.ActionType.Draw, SketchAction.ActionType.Delete, false)]
-        public void ActionHistoryTest1(SketchAction.ActionType action1, SketchAction.ActionType action2, bool isEmpty)
-        {
-            ActionHistory testHistory = GetActionHistory();
-            if (!action1.Equals(SketchAction.ActionType.Start)) { testHistory.AddNewAction(new SketchAction(action1, 5)); }
-            if (!action2.Equals(SketchAction.ActionType.Start)) { testHistory.AddNewAction(new SketchAction(action2, 5)); }
-            Assert.AreEqual(isEmpty, testHistory.IsEmpty());
-        }
-
-        [TestCase(SketchAction.ActionType.Draw, "Last Action: Line number 0 was drawn.")]
-        [TestCase(SketchAction.ActionType.Delete, "Last Action: Line number 0 was deleted.")]
-        public void ActionHistoryUndoRedoTest(SketchAction.ActionType actionType, String message)
-        {
-            ActionHistory testHistory = GetActionHistory();
-            SketchAction testAction = new SketchAction(actionType, 0);
-            testHistory.AddNewAction(testAction);
-            Assert.AreEqual(true, testHistory.CanUndo());
-            testHistory.MoveAction(true);
-            Assert.AreEqual(true, testHistory.CanRedo());
-            var lastActionLabel = testHistory.MoveAction(false);
-            Assert.AreEqual(actionType, testHistory.GetCurrentAction().GetActionType());
-            Assert.AreEqual(message, lastActionLabel);
-        }
-    }
-}

+ 0 - 1
SketchAssistant/SketchAssistantWPF/SketchAssistantWPF.csproj

@@ -115,7 +115,6 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
-    <None Include="packages.config" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

+ 0 - 4
SketchAssistant/SketchAssistantWPF/packages.config

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
-  <package id="OpenCover" version="4.6.519" targetFramework="net461" />
-</packages>

+ 0 - 1
SketchAssistant/WhiteTests/packages.config

@@ -3,6 +3,5 @@
   <package id="Castle.Core" version="4.3.1" targetFramework="net461" />
   <package id="MSTest.TestAdapter" version="1.4.0" targetFramework="net461" />
   <package id="MSTest.TestFramework" version="1.4.0" targetFramework="net461" />
-  <package id="OpenCover" version="4.6.519" targetFramework="net461" />
   <package id="TestStack.White" version="0.13.3" targetFramework="net461" />
 </packages>