From aaec57bb56ab77708b248753705e81feead53254 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 25 Jul 2020 20:28:48 +0200 Subject: [PATCH] can you listen? pls --- Datalaag/Datalaag.csproj | 12 ++ Datalaag/JsonReader.cs | 40 +++++ .../Debug/netcoreapp3.1/Datalaag.deps.json | 23 +++ .../obj/Datalaag.csproj.nuget.dgspec.json | 70 ++++++++ Datalaag/obj/Datalaag.csproj.nuget.g.props | 15 ++ Datalaag/obj/Datalaag.csproj.nuget.g.targets | 6 + ...CoreApp,Version=v3.1.AssemblyAttributes.cs | 4 + .../netcoreapp3.1/Datalaag.AssemblyInfo.cs | 23 +++ .../Datalaag.AssemblyInfoInputs.cache | 1 + .../Debug/netcoreapp3.1/Datalaag.assets.cache | Bin 0 -> 1036 bytes .../Datalaag.csproj.FileListAbsolute.txt | 5 + .../Datalaag.csprojAssemblyReference.cache | Bin 0 -> 3045 bytes Datalaag/obj/project.assets.json | 150 ++++++++++++++++ Datalaag/obj/project.nuget.cache | 11 ++ Datalaag/obj/project.packagespec.json | 57 ++++++ Logica/Logica.csproj | 20 +++ ...CoreApp,Version=v3.1.AssemblyAttributes.cs | 4 + .../netcoreapp3.1/Logica.AssemblyInfo.cs | 23 +++ .../Logica.AssemblyInfoInputs.cache | 1 + .../Debug/netcoreapp3.1/Logica.assets.cache | Bin 0 -> 1036 bytes .../Logica.csprojAssemblyReference.cache | Bin 0 -> 424 bytes Logica/obj/Logica.csproj.nuget.dgspec.json | 126 ++++++++++++++ Logica/obj/Logica.csproj.nuget.g.props | 15 ++ Logica/obj/Logica.csproj.nuget.g.targets | 6 + Logica/obj/project.assets.json | 162 ++++++++++++++++++ Logica/obj/project.nuget.cache | 11 ++ Logica/obj/project.packagespec.json | 51 ++++++ Logica/polygonManipulatie.cs | 154 +++++++++++++++++ opdracht2.sln.DotSettings.user | 4 + 29 files changed, 994 insertions(+) create mode 100644 Datalaag/Datalaag.csproj create mode 100644 Datalaag/JsonReader.cs create mode 100644 Datalaag/bin/Debug/netcoreapp3.1/Datalaag.deps.json create mode 100644 Datalaag/obj/Datalaag.csproj.nuget.dgspec.json create mode 100644 Datalaag/obj/Datalaag.csproj.nuget.g.props create mode 100644 Datalaag/obj/Datalaag.csproj.nuget.g.targets create mode 100644 Datalaag/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs create mode 100644 Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfo.cs create mode 100644 Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfoInputs.cache create mode 100644 Datalaag/obj/Debug/netcoreapp3.1/Datalaag.assets.cache create mode 100644 Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csproj.FileListAbsolute.txt create mode 100644 Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csprojAssemblyReference.cache create mode 100644 Datalaag/obj/project.assets.json create mode 100644 Datalaag/obj/project.nuget.cache create mode 100644 Datalaag/obj/project.packagespec.json create mode 100644 Logica/Logica.csproj create mode 100644 Logica/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs create mode 100644 Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfo.cs create mode 100644 Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfoInputs.cache create mode 100644 Logica/obj/Debug/netcoreapp3.1/Logica.assets.cache create mode 100644 Logica/obj/Debug/netcoreapp3.1/Logica.csprojAssemblyReference.cache create mode 100644 Logica/obj/Logica.csproj.nuget.dgspec.json create mode 100644 Logica/obj/Logica.csproj.nuget.g.props create mode 100644 Logica/obj/Logica.csproj.nuget.g.targets create mode 100644 Logica/obj/project.assets.json create mode 100644 Logica/obj/project.nuget.cache create mode 100644 Logica/obj/project.packagespec.json create mode 100644 Logica/polygonManipulatie.cs create mode 100644 opdracht2.sln.DotSettings.user diff --git a/Datalaag/Datalaag.csproj b/Datalaag/Datalaag.csproj new file mode 100644 index 0000000..291f776 --- /dev/null +++ b/Datalaag/Datalaag.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp3.1 + + + + + + + + diff --git a/Datalaag/JsonReader.cs b/Datalaag/JsonReader.cs new file mode 100644 index 0000000..6633890 --- /dev/null +++ b/Datalaag/JsonReader.cs @@ -0,0 +1,40 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Text; +using GeoJSON.Net.Geometry; +using Newtonsoft.Json; + + +namespace Datalaag +{ + public class JsonReader + { + public List _polygons; + public List _multiPolygons; + public JsonReader(string path) + { + _polygons = new List(); + _multiPolygons = new List(); + foreach (JObject feature in JObject.Parse(File.ReadAllText(path))["features"]) + { + switch (feature["geometry"]["type"].ToString()) + { + case "MultiPolygon": + _polygons.Add(new PolygonPunten(JsonConvert.DeserializeObject(feature["geometry"] + .ToString()), feature["properties"]["name"].ToString())); + break; + case "Polygon": + _multiPolygons.Add(new MultiPolygonPunten(JsonConvert.DeserializeObject + (feature["geometry"].ToString()), feature["properties"]["name"].ToString())); + break; + } + } + } + + + + } +} \ No newline at end of file diff --git a/Datalaag/bin/Debug/netcoreapp3.1/Datalaag.deps.json b/Datalaag/bin/Debug/netcoreapp3.1/Datalaag.deps.json new file mode 100644 index 0000000..85029df --- /dev/null +++ b/Datalaag/bin/Debug/netcoreapp3.1/Datalaag.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v3.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v3.1": { + "Datalaag/1.0.0": { + "runtime": { + "Datalaag.dll": {} + } + } + } + }, + "libraries": { + "Datalaag/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Datalaag/obj/Datalaag.csproj.nuget.dgspec.json b/Datalaag/obj/Datalaag.csproj.nuget.dgspec.json new file mode 100644 index 0000000..a4a8754 --- /dev/null +++ b/Datalaag/obj/Datalaag.csproj.nuget.dgspec.json @@ -0,0 +1,70 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": {} + }, + "projects": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "projectName": "Datalaag", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "packagesPath": "C:\\Users\\Beppe\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Beppe\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "GeoJSON.Net": { + "target": "Package", + "version": "[1.2.19, )" + }, + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Datalaag/obj/Datalaag.csproj.nuget.g.props b/Datalaag/obj/Datalaag.csproj.nuget.g.props new file mode 100644 index 0000000..3151d21 --- /dev/null +++ b/Datalaag/obj/Datalaag.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Beppe\.nuget\packages\ + PackageReference + 5.5.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Datalaag/obj/Datalaag.csproj.nuget.g.targets b/Datalaag/obj/Datalaag.csproj.nuget.g.targets new file mode 100644 index 0000000..53cfaa1 --- /dev/null +++ b/Datalaag/obj/Datalaag.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Datalaag/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/Datalaag/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..ad8dfe1 --- /dev/null +++ b/Datalaag/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] diff --git a/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfo.cs b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfo.cs new file mode 100644 index 0000000..ef8890a --- /dev/null +++ b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Datalaag")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("Datalaag")] +[assembly: System.Reflection.AssemblyTitleAttribute("Datalaag")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfoInputs.cache b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfoInputs.cache new file mode 100644 index 0000000..4fd8cab --- /dev/null +++ b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +4eb3636ff46def5b52e701646fabc9893067cd02 diff --git a/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.assets.cache b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.assets.cache new file mode 100644 index 0000000000000000000000000000000000000000..014208ce3da3292b088f4beef6b36a1741bf135e GIT binary patch literal 1036 zcmcIiJx>Bb5Cug(L_ndTF-8-$TRt=<+8D%yfaWBER@)rhis-R-x!sGQwl)3&TeYw- z_I4&#{sRju3p;;;GvSQqK>`hvyxi{FxtX^+uew(%O#6Jk@a5yv^QU#Udiyee^`7=` zA8y=#ET^wC53h?~H|uZT6OiNtF6+fDdL)=7=ngYYMhUlDOj1*Ao~tb;Xp0$V!r+7h znIn0U+oXECL18PT$~D!}fTJa5RB8tbQJ5r}u1`4){P4vllYjsK`5*xK5CC~PL;z42@7o1b{;DrBDd+C*}y(=vB{TLL#{{<}Hj8akRN>ZB@ahsB+>Q_|~)V9%W^eMPew zk8`kaq#y*7^{&Z6md$0m!y-k)?Cu*)RS!tZX31S9WSgrJ)Yt3=3Qu^%r3Tdf0my?5 AdH?_b literal 0 HcmV?d00001 diff --git a/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csproj.FileListAbsolute.txt b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..347c2db --- /dev/null +++ b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csproj.FileListAbsolute.txt @@ -0,0 +1,5 @@ +C:\Users\Beppe\source\repos\opdracht2\Datalaag\bin\Debug\netcoreapp3.1\Datalaag.deps.json +C:\Users\Beppe\source\repos\opdracht2\Datalaag\bin\Debug\netcoreapp3.1\Datalaag.dll +C:\Users\Beppe\source\repos\opdracht2\Datalaag\obj\Debug\netcoreapp3.1\Datalaag.csprojAssemblyReference.cache +C:\Users\Beppe\source\repos\opdracht2\Datalaag\obj\Debug\netcoreapp3.1\Datalaag.AssemblyInfoInputs.cache +C:\Users\Beppe\source\repos\opdracht2\Datalaag\obj\Debug\netcoreapp3.1\Datalaag.AssemblyInfo.cs diff --git a/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csprojAssemblyReference.cache b/Datalaag/obj/Debug/netcoreapp3.1/Datalaag.csprojAssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..f2dca2f632a748ea4b6ee504a6b35b7a9278296d GIT binary patch literal 3045 zcmdT`Z)_Ar6yLqSyKUhLA`}I@Dx$UZ_O90}ZMD?)QVIwM^Z+F+mbu%x>vDU$m)*T$ z4GkDf1Vgln7C%UA{D3G@2?3)h7*dE}BE(37F$NRxUjQ{RA|KS?dwczJoTx?p;%s(y zcIM5zH^2AZZ-!wRhPes_zgS9aP(89pj_aDCB}`vSR#qh6GGe3*Us%&=m3IZz4Ovqg z10i3)=lA)myy2{3W_8-A(yXZyrOLY`8&l-?gS2~@mZEB7%pXjI60;M5fE4nRAaSCy z^6Tq}b{i&5M@?cI_p(r$Nf(eFi9x*yi5>qHz&D)`JVD*=xE)XbM zs1a!{iJO}49@bs88KP62!*!$bW7GkihHC{;veaN0JL7Z~bCZYcSgcF3N|cc~ zmzLHw^?`QY0Sev(<9R1EcvR=Wu0NTFyDaXIlPZ84CI)3#wiGAgj$Cf2#BhVS+yKzU z7MjUW(WhpU)D$x$o+3$Vh$>xY0v713wT7mOfokwdP*mg?44H;WREg*kbc&Ht$ps+k zlN80pfrbvyute9AI!Sxy0^WuwX(r6IbQt2Oqav-#Fa~_hnT)TUCd42{fT%+Yq~kC` zG8yO-ACgr`TW7Suc2G$vVqkfQhX!8+l@nW)qbui!SzZWKqB)lP5ea)*lN|7-Y(#ZP zG-J373=hMpn_X15B~(D#W@8zit14VM+6jJ@e9eYI(=nwxLejMLQIo0|$!Hmi72`S@ zc~v^YS%Fs!|3yWv68v=4Af*0apq^pTdNiKdZJ*UA4+)P$sUp{S{NxFjc%UOP61Vx; zgDZ|Ld1lWhp?Ih^P#>(J{|!m z)9I|0lAKP{5D!#hShpLqlCj%a@D4bMwb{lGp)!t#<=79G8IY{~6S{hPw;Nu%m z!0?McV$TDt=qJZU_&Em+#MuJpHW*IkfpZOS3pw7l;4y^J7%bpz!QyQJcpE_)@Yz!>guUze)9B%!&a*pJ!IJ2u{aOtyK zmRE0G@cC1Y&3F9JyZ2Pxg`T}ECn!`$8g`{EI9>I+ADE8a^k-DXC1?=V{5 z-l;!)Y0AeFPab-A-z$&L>p6MhmmQm4-{z?lxb zXU=Y^J3jri?I3-}JAKW{IekZ;qcb+Ybfjt0%@+?ey)hv$Q2a^o*!OG7llN{fyAaql zaA;h=Te$Pno`c#6&u=TAKK)tf%Z2q@Tf^>e&)@gNtVxXnCocDG(zYMJ(zfKQ?V@z9 z?B&+8Kc()eoY=N!kXBwE0EY^C!6 literal 0 HcmV?d00001 diff --git a/Datalaag/obj/project.assets.json b/Datalaag/obj/project.assets.json new file mode 100644 index 0000000..5e25673 --- /dev/null +++ b/Datalaag/obj/project.assets.json @@ -0,0 +1,150 @@ +{ + "version": 3, + "targets": { + ".NETCoreApp,Version=v3.1": { + "GeoJSON.Net/1.2.19": { + "type": "package", + "dependencies": { + "Newtonsoft.Json": "10.0.2" + }, + "compile": { + "lib/netstandard2.1/GeoJSON.Net.dll": {} + }, + "runtime": { + "lib/netstandard2.1/GeoJSON.Net.dll": {} + } + }, + "Newtonsoft.Json/12.0.3": { + "type": "package", + "compile": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + } + } + } + }, + "libraries": { + "GeoJSON.Net/1.2.19": { + "sha512": "b1sIWezvF7a4dBz6d0nQfbwJEWFeRjJ6Mri+Hm/FJ1OIEksekiY1X+CgPG/7E3NcHKz3+3RnbX3VAhx03GG21w==", + "type": "package", + "path": "geojson.net/1.2.19", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "geojson.net.1.2.19.nupkg.sha512", + "geojson.net.nuspec", + "lib/net35/GeoJSON.Net.dll", + "lib/net40/GeoJSON.Net.dll", + "lib/net45/GeoJSON.Net.dll", + "lib/netstandard1.0/GeoJSON.Net.dll", + "lib/netstandard1.1/GeoJSON.Net.dll", + "lib/netstandard2.0/GeoJSON.Net.dll", + "lib/netstandard2.1/GeoJSON.Net.dll" + ] + }, + "Newtonsoft.Json/12.0.3": { + "sha512": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "type": "package", + "path": "newtonsoft.json/12.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", + "newtonsoft.json.12.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + } + }, + "projectFileDependencyGroups": { + ".NETCoreApp,Version=v3.1": [ + "GeoJSON.Net >= 1.2.19", + "Newtonsoft.Json >= 12.0.3" + ] + }, + "packageFolders": { + "C:\\Users\\Beppe\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "projectName": "Datalaag", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "packagesPath": "C:\\Users\\Beppe\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Beppe\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "GeoJSON.Net": { + "target": "Package", + "version": "[1.2.19, )" + }, + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Datalaag/obj/project.nuget.cache b/Datalaag/obj/project.nuget.cache new file mode 100644 index 0000000..82df3f6 --- /dev/null +++ b/Datalaag/obj/project.nuget.cache @@ -0,0 +1,11 @@ +{ + "version": 2, + "dgSpecHash": "vmw2sWM3we/HBXnNGRXWz0s694rjQwC3pE16toYVSE6mWRTpo3/Dmldhr2pN+hLG/clnqOj9soWfad987by8wg==", + "success": true, + "projectFilePath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "expectedPackageFiles": [ + "C:\\Users\\Beppe\\.nuget\\packages\\geojson.net\\1.2.19\\geojson.net.1.2.19.nupkg.sha512", + "C:\\Users\\Beppe\\.nuget\\packages\\newtonsoft.json\\12.0.3\\newtonsoft.json.12.0.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Datalaag/obj/project.packagespec.json b/Datalaag/obj/project.packagespec.json new file mode 100644 index 0000000..0240a3d --- /dev/null +++ b/Datalaag/obj/project.packagespec.json @@ -0,0 +1,57 @@ +{ + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "projectName": "Datalaag", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\obj\\", + "projectStyle": "PackageReference", + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "GeoJSON.Net": { + "target": "Package", + "version": "[1.2.19, )" + }, + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } +} \ No newline at end of file diff --git a/Logica/Logica.csproj b/Logica/Logica.csproj new file mode 100644 index 0000000..3242ed6 --- /dev/null +++ b/Logica/Logica.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.1 + + + + + d37e2a3e-8545-3a39-9f4f-31827c9124ab + 2 + 4 + tlbimp + + + + + + + + diff --git a/Logica/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs b/Logica/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs new file mode 100644 index 0000000..ad8dfe1 --- /dev/null +++ b/Logica/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] diff --git a/Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfo.cs b/Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfo.cs new file mode 100644 index 0000000..9619f93 --- /dev/null +++ b/Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Logica")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("Logica")] +[assembly: System.Reflection.AssemblyTitleAttribute("Logica")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfoInputs.cache b/Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfoInputs.cache new file mode 100644 index 0000000..e815204 --- /dev/null +++ b/Logica/obj/Debug/netcoreapp3.1/Logica.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +559139bcad75bc699883210d21815f3a7b66c208 diff --git a/Logica/obj/Debug/netcoreapp3.1/Logica.assets.cache b/Logica/obj/Debug/netcoreapp3.1/Logica.assets.cache new file mode 100644 index 0000000000000000000000000000000000000000..567b496bafad008221e551520a15b6a4d1122620 GIT binary patch literal 1036 zcmcIi%}&BV5Jp815m4}MVxq_8#}nKT4FOFhf}A!ng|1jF+orpX@&I1F8&BSh@#X_~ zBhi=e1vL5sCeDN!YaxLPlYHs!x6_$#cfQ(Qxwsez1da>OyVqAw-`&-X`z7V zrh3yn{wjI zwCuI-EfyX2-h!T__x)0<`Wm-$v&ODiX47`op0;`3%rcll#AYYIdsJKJaZ`El$gH?k z8oy4#@%I&_&>Cw`5uCgNxAL&m$f@IiO33A3>W~NrHwKzZsJ*fKyLl3dTbj)aShOR4 zw^FYdQqv6=pnG&e1R{!((a|o)oo!SH`bYEraCW|;9C1hnZxlX`XcMzt$gMwgJZ18v Uo;&*75*&)bV9Y|sn8l3b6YlPIv;Y7A literal 0 HcmV?d00001 diff --git a/Logica/obj/Logica.csproj.nuget.dgspec.json b/Logica/obj/Logica.csproj.nuget.dgspec.json new file mode 100644 index 0000000..f5dd7af --- /dev/null +++ b/Logica/obj/Logica.csproj.nuget.dgspec.json @@ -0,0 +1,126 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj": {} + }, + "projects": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "projectName": "Datalaag", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj", + "packagesPath": "C:\\Users\\Beppe\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Beppe\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "dependencies": { + "GeoJSON.Net": { + "target": "Package", + "version": "[1.2.19, )" + }, + "Newtonsoft.Json": { + "target": "Package", + "version": "[12.0.3, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } + }, + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "projectName": "Logica", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "packagesPath": "C:\\Users\\Beppe\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Beppe\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": { + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Logica/obj/Logica.csproj.nuget.g.props b/Logica/obj/Logica.csproj.nuget.g.props new file mode 100644 index 0000000..3151d21 --- /dev/null +++ b/Logica/obj/Logica.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Beppe\.nuget\packages\ + PackageReference + 5.5.0 + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Logica/obj/Logica.csproj.nuget.g.targets b/Logica/obj/Logica.csproj.nuget.g.targets new file mode 100644 index 0000000..53cfaa1 --- /dev/null +++ b/Logica/obj/Logica.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/Logica/obj/project.assets.json b/Logica/obj/project.assets.json new file mode 100644 index 0000000..a10fc87 --- /dev/null +++ b/Logica/obj/project.assets.json @@ -0,0 +1,162 @@ +{ + "version": 3, + "targets": { + ".NETCoreApp,Version=v3.1": { + "GeoJSON.Net/1.2.19": { + "type": "package", + "dependencies": { + "Newtonsoft.Json": "10.0.2" + }, + "compile": { + "lib/netstandard2.1/GeoJSON.Net.dll": {} + }, + "runtime": { + "lib/netstandard2.1/GeoJSON.Net.dll": {} + } + }, + "Newtonsoft.Json/12.0.3": { + "type": "package", + "compile": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + }, + "runtime": { + "lib/netstandard2.0/Newtonsoft.Json.dll": {} + } + }, + "Datalaag/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v3.1", + "dependencies": { + "GeoJSON.Net": "1.2.19", + "Newtonsoft.Json": "12.0.3" + }, + "compile": { + "bin/placeholder/Datalaag.dll": {} + }, + "runtime": { + "bin/placeholder/Datalaag.dll": {} + } + } + } + }, + "libraries": { + "GeoJSON.Net/1.2.19": { + "sha512": "b1sIWezvF7a4dBz6d0nQfbwJEWFeRjJ6Mri+Hm/FJ1OIEksekiY1X+CgPG/7E3NcHKz3+3RnbX3VAhx03GG21w==", + "type": "package", + "path": "geojson.net/1.2.19", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "geojson.net.1.2.19.nupkg.sha512", + "geojson.net.nuspec", + "lib/net35/GeoJSON.Net.dll", + "lib/net40/GeoJSON.Net.dll", + "lib/net45/GeoJSON.Net.dll", + "lib/netstandard1.0/GeoJSON.Net.dll", + "lib/netstandard1.1/GeoJSON.Net.dll", + "lib/netstandard2.0/GeoJSON.Net.dll", + "lib/netstandard2.1/GeoJSON.Net.dll" + ] + }, + "Newtonsoft.Json/12.0.3": { + "sha512": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg==", + "type": "package", + "path": "newtonsoft.json/12.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/Newtonsoft.Json.xml", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.dll", + "lib/portable-net45+win8+wp8+wpa81/Newtonsoft.Json.xml", + "newtonsoft.json.12.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "Datalaag/1.0.0": { + "type": "project", + "path": "../Datalaag/Datalaag.csproj", + "msbuildProject": "../Datalaag/Datalaag.csproj" + } + }, + "projectFileDependencyGroups": { + ".NETCoreApp,Version=v3.1": [ + "Datalaag >= 1.0.0" + ] + }, + "packageFolders": { + "C:\\Users\\Beppe\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "projectName": "Logica", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "packagesPath": "C:\\Users\\Beppe\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\Beppe\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": { + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Logica/obj/project.nuget.cache b/Logica/obj/project.nuget.cache new file mode 100644 index 0000000..cc31619 --- /dev/null +++ b/Logica/obj/project.nuget.cache @@ -0,0 +1,11 @@ +{ + "version": 2, + "dgSpecHash": "DkYRZH0wz5GvI2ijvz+sgOT16efYptv7grKHSqTr/pe3P5xaJovOtDwwUbm+RZKSgm6Hz7X/vIr5shpuBp7gjA==", + "success": true, + "projectFilePath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "expectedPackageFiles": [ + "C:\\Users\\Beppe\\.nuget\\packages\\geojson.net\\1.2.19\\geojson.net.1.2.19.nupkg.sha512", + "C:\\Users\\Beppe\\.nuget\\packages\\newtonsoft.json\\12.0.3\\newtonsoft.json.12.0.3.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/Logica/obj/project.packagespec.json b/Logica/obj/project.packagespec.json new file mode 100644 index 0000000..f3174d3 --- /dev/null +++ b/Logica/obj/project.packagespec.json @@ -0,0 +1,51 @@ +{ + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "projectName": "Logica", + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj", + "outputPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\obj\\", + "projectStyle": "PackageReference", + "originalTargetFrameworks": [ + "netcoreapp3.1" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "netcoreapp3.1": { + "projectReferences": { + "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": { + "projectPath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "netcoreapp3.1": { + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.302\\RuntimeIdentifierGraph.json" + } + } +} \ No newline at end of file diff --git a/Logica/polygonManipulatie.cs b/Logica/polygonManipulatie.cs new file mode 100644 index 0000000..6108e1f --- /dev/null +++ b/Logica/polygonManipulatie.cs @@ -0,0 +1,154 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using Datalaag; + +namespace Logica +{ + public class PolygonManipulatie + { + public JsonReader JsonReader; + public PolygonManipulatie(JsonReader jsonReader) + { + JsonReader = jsonReader; + } + + public List getPolygons() + { + return JsonReader._polygons; + } + + public List getMultiPolygons() + { + return JsonReader._multiPolygons; + } + + public List getAllPolygons() + { + List lijst = new List(); + lijst.AddRange(getPolygons()); + foreach (MultiPolygonPunten multiPolygonPunten in getMultiPolygons()) + { + lijst.AddRange(multiPolygonPunten.PolygonPunten); + } + return lijst; + } + + public List triangulatePolygon(List punten) + { + List returnWaarde = new List(); + int i = 0; + int BACKUP = 0; + int BACKBACKUP = punten.Count; + while (true) + { + + if (i >= punten.Count) + { + i = 0; + if (punten.Count == BACKBACKUP) + { + BACKUP++; + } + + BACKBACKUP = punten.Count; + } + + int punt1Index = i; + int punt2Index = i + 1; + if (punt2Index >= punten.Count) punt2Index -= punten.Count; + int punt3Index = i + 2; + if (punt3Index >= punten.Count) punt3Index -= punten.Count; + + if (punten.Count < 3) + { + break; + } + double hoek = VindHoek(punten[punt2Index], punten[punt1Index], punten[punt3Index]); + if (hoek < 180) + { + returnWaarde.Add(MaakNieuweDriehoek(punten[punt2Index], punten[punt3Index], + punten[punt1Index])); + punten.RemoveAt(punt2Index); + Debug.WriteLine("added a triangle, polygonLijst count " + punten.Count); + i = punt1Index; + BACKUP = 0; + continue; + + + } + Debug.WriteLine(hoek); + + + + + i++; + if (BACKUP >= punten.Count) + { + Debug.WriteLine("FUCK, couldnt parse " + punten.Count + " points"); + break; + } + } + + return returnWaarde; + } + + private PolygonPunten MaakNieuweDriehoek(Punt punt, Punt punt1, Punt punt2, string naam = "") + { + return new PolygonPunten(new List(){punt, punt1, punt2}, naam); + } + + private double VindHoek(Punt p1, Punt p2, Punt p3) + { + double hoek = (Math.Atan2(p3.Y - p1.Y, p3.X - p1.X) - Math.Atan2(p2.Y - p1.Y, p2.X - p1.X)) * (180 / Math.PI); + if (hoek < 0) + { + hoek += 360; + } + return hoek; + } + + private List peuker(List punten, double epsilon) + { + double dmax = -1; + int index = 0; + int end = punten.Count; + + for (int i = 1; i < end-1; i++) + { + double distance = PerpendicularDistance2(punten[i], punten[0], punten[end-1]); + if (distance > dmax) + { + index = i; + dmax = distance; + } + } + + + List returnWaarde = new List(); + + if (dmax > epsilon) + { + List recResults1 = peuker(punten.GetRange(0, index), epsilon); + List recResults2 = peuker(punten.GetRange(index, end-1-index), epsilon); + + + returnWaarde.AddRange(recResults1); + returnWaarde.AddRange(recResults2); + } + else + { + returnWaarde = new List() { punten[0], punten[punten.Count-1] }; + } + + return returnWaarde; + } + + private double PerpendicularDistance2(Punt point, Punt l1, Punt l2) + { + return Math.Abs((l2.X - l1.X) * (l1.Y - point.Y) - (l1.X - point.X) * (l2.Y - l1.Y)) / + Math.Sqrt(Math.Pow(l2.X - l1.X, 2) + Math.Pow(l2.Y - l1.Y, 2)); + } + } +} diff --git a/opdracht2.sln.DotSettings.user b/opdracht2.sln.DotSettings.user new file mode 100644 index 0000000..c8f4b96 --- /dev/null +++ b/opdracht2.sln.DotSettings.user @@ -0,0 +1,4 @@ + + <AssemblyExplorer> + <Assembly Path="C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\3.1.0\ref\netcoreapp3.1\System.Windows.dll" /> +</AssemblyExplorer> \ No newline at end of file