khaat dees

This commit is contained in:
BuildTools
2020-08-01 16:33:08 +02:00
parent ee06557675
commit e6de36e7bb
14 changed files with 22 additions and 22 deletions

Binary file not shown.

View File

@@ -51,19 +51,19 @@ namespace Logica
List<Punt> returnWaarde = new List<Punt>();
foreach (Punt punt in polygon.Punten)
{
//Punt x = ScalePoint(scaleX, scaleY, punt, maxX, maxY, offsetX, offsetY);
Punt x = ScalePoint(scaleX, scaleY, punt, maxX, maxY, offsetX, offsetY);
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));
//x.Naam = punt.Naam;
//returnWaarde.Add(x);
//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));
x.Naam = punt.Naam;
returnWaarde.Add(x);
}
return new PolygonPunten(returnWaarde, polygon.Naam);
}
@@ -72,14 +72,14 @@ namespace Logica
private static Punt ScalePoint(double scaleX, double scaleY, Punt punt, double maxX = 360, double maxY = 360, double offsetX = 180, double
offsetY = 180)
{
double x = punt.X;
x /= maxX;
x *= scaleX;
x += offsetX;
double x = punt.X + 1;
//x /= maxX;
x *= (scaleX / 2);
//x += offsetX;
double y = punt.Y;
y /= maxY;
y *= scaleY;
y += offsetY;
//y /= maxY;
y *= (scaleY / 2);
//y += offsetY;
return new Punt(x, y);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -174,7 +174,7 @@ namespace opdracht2
}
}
//peuker implementatie moet ook nog gebeuren, code is er al, maar wanneer moet deze aangeroepen worden
if (scale.IsChecked == true) mpps = pm.ScaleMultiPolygons(mpps, c.Width/2, c.Height/2, c.Width/2, c.Height/2);
if (scale.IsChecked == true) mpps = pm.ScaleMultiPolygons(mpps, c.ActualWidth / 2, c.ActualHeight / 2, c.ActualWidth / 2, c.ActualHeight / 2);
foreach(MultiPolygonPunten mp in mpps)
{
@@ -208,7 +208,7 @@ namespace opdracht2
Debug.WriteLine(lb.SelectedItem.GetType().Name);
c.Children.Clear();
MultiPolygonPunten mp = (MultiPolygonPunten)lb.SelectedItem;
if (scale.IsChecked == true) mp = pm.ScaleMultiPolygon(mp, 100, 100, 0, 0);
if (scale.IsChecked == true) mp = pm.ScaleMultiPolygon(mp, c.ActualWidth / 2, c.ActualHeight / 2, c.ActualWidth / 2, c.Height / 2);
if (peuker.IsChecked == true) mp = pm.Peuker(mp, peukerPercent.Value/1000);
//hier ervoor zorgen dat scaling, triangulation etc gebeurt door gebruik van logica layer functies te callen
foreach (PolygonPunten pp in mp.PolygonPunten)
@@ -231,7 +231,7 @@ namespace opdracht2
Debug.WriteLine(lb.SelectedItem.GetType().Name);
c.Children.Clear();
PolygonPunten p = (PolygonPunten)lb.SelectedItem;
if (scale.IsChecked == true) p = pm.ScalePolygon(p, 10000, 10000, 0, 0);
if (scale.IsChecked == true) p = pm.ScalePolygon(p, c.ActualWidth / 2 * 100, c.ActualHeight / 2 * 100, c.ActualWidth / 2 * 100, c.ActualHeight / 2 * 100);
if (peuker.IsChecked == true) p = pm.Peuker(p, peukerPercent.Value / 1000);
if (triangulate.IsChecked == true)
{