diff --git a/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 b/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 index a7b6fb3..8fd5a52 100644 Binary files a/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 and b/.vs/opdracht2/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/opdracht2/v16/.suo b/.vs/opdracht2/v16/.suo index 625e69d..672b7b6 100644 Binary files a/.vs/opdracht2/v16/.suo and b/.vs/opdracht2/v16/.suo differ diff --git a/Datalaag/bin/Debug/Globals.dll b/Datalaag/bin/Debug/Globals.dll index 5fe1b25..e3f3923 100644 Binary files a/Datalaag/bin/Debug/Globals.dll and b/Datalaag/bin/Debug/Globals.dll differ diff --git a/Datalaag/bin/Debug/Globals.pdb b/Datalaag/bin/Debug/Globals.pdb index 7965f15..04d3fad 100644 Binary files a/Datalaag/bin/Debug/Globals.pdb and b/Datalaag/bin/Debug/Globals.pdb differ diff --git a/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache b/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache index bf892e1..0425d5b 100644 Binary files a/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache and b/Datalaag/obj/Debug/Datalaag.csprojAssemblyReference.cache differ diff --git a/Globals/MultiPolygonPunten.cs b/Globals/MultiPolygonPunten.cs index 1981d3b..6e0455b 100644 --- a/Globals/MultiPolygonPunten.cs +++ b/Globals/MultiPolygonPunten.cs @@ -27,6 +27,12 @@ namespace Globals PolygonPunten.Add(new PolygonPunten(polygon, naam)); } VindMaximumEnMinimum(PolygonPunten); + bool sw = false; + foreach (PolygonPunten p in PolygonPunten) + { + if (sw) p.Punten.Reverse(); + sw = !sw; + } } private void VindMaximumEnMinimum(List polygonPunten) @@ -35,6 +41,7 @@ namespace Globals MaximumY = polygonPunten.Max(p => p.MaximumY); MinimumX = polygonPunten.Max(p => p.MinimumX); MinimumY = polygonPunten.Max(p => p.MinimumY); + } diff --git a/Globals/PolygonPunten.cs b/Globals/PolygonPunten.cs index c68ff8a..8e2d938 100644 --- a/Globals/PolygonPunten.cs +++ b/Globals/PolygonPunten.cs @@ -42,6 +42,7 @@ namespace Globals Punten.Add(new Punt(pos.Longitude, pos.Latitude, naam)); } } + Punten.Reverse(); } public override string ToString() diff --git a/Globals/bin/Debug/Globals.dll b/Globals/bin/Debug/Globals.dll index 5fe1b25..e3f3923 100644 Binary files a/Globals/bin/Debug/Globals.dll and b/Globals/bin/Debug/Globals.dll differ diff --git a/Globals/bin/Debug/Globals.pdb b/Globals/bin/Debug/Globals.pdb index 7965f15..04d3fad 100644 Binary files a/Globals/bin/Debug/Globals.pdb and b/Globals/bin/Debug/Globals.pdb differ diff --git a/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache index a8ec8df..d52ca85 100644 Binary files a/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Globals/obj/Debug/Globals.csprojAssemblyReference.cache b/Globals/obj/Debug/Globals.csprojAssemblyReference.cache index 51ce47b..aaff102 100644 Binary files a/Globals/obj/Debug/Globals.csprojAssemblyReference.cache and b/Globals/obj/Debug/Globals.csprojAssemblyReference.cache differ diff --git a/Globals/obj/Debug/Globals.dll b/Globals/obj/Debug/Globals.dll index 5fe1b25..e3f3923 100644 Binary files a/Globals/obj/Debug/Globals.dll and b/Globals/obj/Debug/Globals.dll differ diff --git a/Globals/obj/Debug/Globals.pdb b/Globals/obj/Debug/Globals.pdb index 7965f15..04d3fad 100644 Binary files a/Globals/obj/Debug/Globals.pdb and b/Globals/obj/Debug/Globals.pdb differ diff --git a/Logica/PolygonManipulatie.cs b/Logica/PolygonManipulatie.cs index 0f9d322..5f35751 100644 --- a/Logica/PolygonManipulatie.cs +++ b/Logica/PolygonManipulatie.cs @@ -43,7 +43,7 @@ namespace Logica return TriangulatePolygon(polygon); } - public PolygonPunten ScalePolygon(PolygonPunten polygon, double scaleX, double scaleY) + public PolygonPunten ScalePolygon(PolygonPunten polygon, double scaleX, double scaleY, double offsetX = 0, double offsetY = 0) { double maxX = polygon.MaximumX; double maxY = polygon.MaximumY; @@ -57,16 +57,18 @@ namespace Logica double x = punt.X - minX; x /= maxX; x *= scaleX; + x += offsetX; double y = punt.Y - minY; y /= maxY; y *= scaleY; + y += offsetY; returnWaarde.Add(new Punt(x, y, punt.Naam)); } return new PolygonPunten(returnWaarde, polygon.Naam); } - public MultiPolygonPunten ScaleMultiPolygon(MultiPolygonPunten multiPolygon, double scaleX, double scaleY) + public MultiPolygonPunten ScaleMultiPolygon(MultiPolygonPunten multiPolygon, double scaleX, double scaleY, double offsetX = 0, double offsetY = 0) { double maxX = multiPolygon.MaximumX; double maxY = multiPolygon.MaximumY; @@ -83,9 +85,11 @@ namespace Logica double x = punt.X - minX; x /= maxX; x *= scaleX; + x += offsetX; double y = punt.Y - minY; y /= maxY; y *= scaleY; + y += offsetY; returnWaarde.Add(new Punt(x, y, punt.Naam)); } @@ -95,7 +99,8 @@ namespace Logica return new MultiPolygonPunten(pp, multiPolygon.Naam); } - public List ScaleMultiPolygons(List multiPolygons, double scaleX, double scaleY) + //todo (offset var voor center op canvas, vree ambetant) + public List ScaleMultiPolygons(List multiPolygons, double scaleX, double scaleY, double offsetX = 0, double offsetY = 0) { double maxX = multiPolygons.Max(m => m.MaximumX); double maxY = multiPolygons.Max(m => m.MaximumY); @@ -114,9 +119,11 @@ namespace Logica double x = punt.X - minX; x /= maxX; x *= scaleX; + x += offsetX; double y = punt.Y - minY; y /= maxY; y *= scaleY; + y += offsetY; punten.Add(new Punt(x, y, punt.Naam)); } pp.Add(new PolygonPunten(punten, poly.Naam)); diff --git a/Logica/bin/Debug/Globals.dll b/Logica/bin/Debug/Globals.dll index 5fe1b25..e3f3923 100644 Binary files a/Logica/bin/Debug/Globals.dll and b/Logica/bin/Debug/Globals.dll differ diff --git a/Logica/bin/Debug/Globals.pdb b/Logica/bin/Debug/Globals.pdb index 7965f15..04d3fad 100644 Binary files a/Logica/bin/Debug/Globals.pdb and b/Logica/bin/Debug/Globals.pdb differ diff --git a/Logica/bin/Debug/Logica.dll b/Logica/bin/Debug/Logica.dll index 904f54f..4233c0a 100644 Binary files a/Logica/bin/Debug/Logica.dll and b/Logica/bin/Debug/Logica.dll differ diff --git a/Logica/bin/Debug/Logica.pdb b/Logica/bin/Debug/Logica.pdb index 1a8c06d..7ef1175 100644 Binary files a/Logica/bin/Debug/Logica.pdb and b/Logica/bin/Debug/Logica.pdb differ diff --git a/Logica/obj/Debug/Logica.csprojAssemblyReference.cache b/Logica/obj/Debug/Logica.csprojAssemblyReference.cache index cea5f66..4dbd928 100644 Binary files a/Logica/obj/Debug/Logica.csprojAssemblyReference.cache and b/Logica/obj/Debug/Logica.csprojAssemblyReference.cache differ diff --git a/Logica/obj/Debug/Logica.dll b/Logica/obj/Debug/Logica.dll index 904f54f..4233c0a 100644 Binary files a/Logica/obj/Debug/Logica.dll and b/Logica/obj/Debug/Logica.dll differ diff --git a/Logica/obj/Debug/Logica.pdb b/Logica/obj/Debug/Logica.pdb index 1a8c06d..7ef1175 100644 Binary files a/Logica/obj/Debug/Logica.pdb and b/Logica/obj/Debug/Logica.pdb differ diff --git a/opdracht2/MainWindow.xaml b/opdracht2/MainWindow.xaml index 21c5c38..dbb9a28 100644 --- a/opdracht2/MainWindow.xaml +++ b/opdracht2/MainWindow.xaml @@ -9,7 +9,7 @@ - + @@ -17,11 +17,12 @@ - +