kga vanavond mss nog verder schrijven maar main methode is nu volledig gedocumenteerd

This commit is contained in:
BuildTools
2020-08-01 17:06:05 +02:00
parent ee06557675
commit 86e1c5dbc7
4 changed files with 75 additions and 122 deletions

View File

@@ -13,7 +13,7 @@ namespace Logica
public JsonReader JsonReader;
public PolygonManipulatie(JsonReader jsonReader)
{
JsonReader = jsonReader;
JsonReader = jsonReader; //haal datalaag binnen
}
public List<PolygonPunten> GetPolygons()
@@ -31,17 +31,7 @@ namespace Logica
return JsonReader._polygons.Find(punten => punten.Naam == naam);
}
public List<PolygonPunten> GetTrianglesPolygon(PolygonPunten polygon, double scaleX
= 1, double scaleY = 1, double epsilonPercet = 0)
{
double grootsteAfstandX = Math.Abs(polygon.MaximumX - polygon.MinimumX);
double grootsteAfstandY = Math.Abs(polygon.MaximumY - polygon.MinimumY);
double epsilon = ((grootsteAfstandX + grootsteAfstandY) / 2) * epsilonPercet;
polygon.Punten = Peuker(polygon.Punten, epsilon);
polygon = ScalePolygon(polygon, scaleX, scaleY);
return TriangulatePolygon(polygon);
}
//oude schaalmethodes
public PolygonPunten ScalePolygon(PolygonPunten polygon, double scaleX, double scaleY, double offsetX = 180, double offsetY = 180)
{
double maxX = polygon.MaximumX - polygon.MinimumX;