diff --git a/.vs/opdracht2/v16/.suo b/.vs/opdracht2/v16/.suo index ed3d4ba..270b26e 100644 Binary files a/.vs/opdracht2/v16/.suo and b/.vs/opdracht2/v16/.suo differ diff --git a/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache index d52ca85..a3ab5aa 100644 Binary files a/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Globals/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Logica/PolygonManipulatie.cs b/Logica/PolygonManipulatie.cs index 24f2ad3..375d6a3 100644 --- a/Logica/PolygonManipulatie.cs +++ b/Logica/PolygonManipulatie.cs @@ -283,6 +283,29 @@ namespace Logica return hoek; } + public PolygonPunten Peuker(PolygonPunten polygon, double epsilon) + { + double nX = Math.Abs(Math.Abs(polygon.MaximumX) - Math.Abs(polygon.MinimumX)); + double nY = Math.Abs(Math.Abs(polygon.MaximumY) - Math.Abs(polygon.MinimumY)); + epsilon = ((nX + nY) / 2) * epsilon; + polygon.Punten = Peuker(polygon.Punten, epsilon); + return polygon; + + } + + public MultiPolygonPunten Peuker(MultiPolygonPunten polygons, double epsilon) + { + double nX = Math.Abs(Math.Abs(polygons.MaximumX) - Math.Abs(polygons.MinimumX)); + double nY = Math.Abs(Math.Abs(polygons.MaximumY) - Math.Abs(polygons.MinimumY)); + epsilon = ((nX + nY) / 2) * epsilon; + foreach (PolygonPunten polygon in polygons.PolygonPunten) + { + + polygon.Punten = Peuker(polygon.Punten, epsilon); + } + return polygons; + + } private List Peuker(List punten, double epsilon) { double dmax = -1; diff --git a/Logica/bin/Debug/Logica.dll b/Logica/bin/Debug/Logica.dll index 9e4ad53..8eff22f 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 baf17b2..a0e69d4 100644 Binary files a/Logica/bin/Debug/Logica.pdb and b/Logica/bin/Debug/Logica.pdb differ diff --git a/Logica/obj/Debug/Logica.dll b/Logica/obj/Debug/Logica.dll index 9e4ad53..8eff22f 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 baf17b2..a0e69d4 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 dbb9a28..4479299 100644 --- a/opdracht2/MainWindow.xaml +++ b/opdracht2/MainWindow.xaml @@ -19,10 +19,11 @@