mirror of
https://github.com/bvanroll/cs-map-project.git
synced 2025-08-29 20:02:43 +00:00
ok, refactor gedaan, fout wss gevonden
This commit is contained in:
@@ -100,6 +100,7 @@ namespace opdracht2
|
||||
polygonLijst[punt3Index]));
|
||||
break;
|
||||
}
|
||||
// TODO HIER MOET DE FOUT ZITTEN, KAN NIE ANDERS!!!!
|
||||
double hoek = GetAngle(polygonLijst[punt1Index], polygonLijst[punt2Index], polygonLijst[punt3Index]);
|
||||
if (hoek < 180)
|
||||
{
|
||||
@@ -192,8 +193,6 @@ namespace opdracht2
|
||||
}*/
|
||||
}
|
||||
|
||||
maximumXWaarde -= minimumXWaarde;
|
||||
maximumYWaarde -= minimumYWaarde;
|
||||
return polygonAlsPuntenLijst;
|
||||
}
|
||||
|
||||
@@ -253,8 +252,9 @@ namespace opdracht2
|
||||
{
|
||||
if (i >= normalizedPoly.Count) i -= normalizedPoly.Count;
|
||||
returnWaarde.Add(normalizedPoly[i]);
|
||||
|
||||
i++;
|
||||
} while (i != check);
|
||||
} while (normalizedPoly.Count != returnWaarde.Count);
|
||||
|
||||
return returnWaarde;
|
||||
}
|
||||
@@ -262,6 +262,8 @@ namespace opdracht2
|
||||
//TODO refactor dit zodat het alle polygons normalized aan het einde van de formule.
|
||||
private static List<System.Windows.Shapes.Polygon> NormalizePolygon(List<System.Windows.Shapes.Polygon> polygons)
|
||||
{
|
||||
maximumXWaarde -= minimumXWaarde;
|
||||
maximumYWaarde -= minimumYWaarde;
|
||||
//mss deze fn hermaken zodat deze ook ramer douglas peucker
|
||||
List<System.Windows.Shapes.Polygon> returnWaarde = new List<System.Windows.Shapes.Polygon>();
|
||||
foreach (System.Windows.Shapes.Polygon p in polygons)
|
||||
@@ -271,15 +273,13 @@ namespace opdracht2
|
||||
{
|
||||
double x = (punt.X - minimumXWaarde);
|
||||
x = (x / maximumXWaarde);
|
||||
x = (x * 200);
|
||||
x = (x * schaalXWaarde);
|
||||
double y = (punt.Y - minimumYWaarde);
|
||||
y = (y / maximumYWaarde);
|
||||
y = (y * 200);
|
||||
y = (y * schaalYWaarde);
|
||||
puntCollectie.Add(new Point(x, y));
|
||||
}
|
||||
Polygon pol = new Polygon();
|
||||
pol.Points = puntCollectie;
|
||||
returnWaarde.Add(pol);
|
||||
returnWaarde.Add(CreateNewPolygon(puntCollectie[0], puntCollectie[1], puntCollectie[2]));
|
||||
}
|
||||
//List<Point> iets = DP(returnWaarde);
|
||||
return returnWaarde;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<Grid>
|
||||
<Button HorizontalAlignment="Left" Margin="52,34,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.215,0.64" Click="Button_Click" Height="25" Width="55">
|
||||
</Button>
|
||||
<Canvas x:Name="someCanvas" Margin="165,61,119,60"/>
|
||||
<Canvas x:Name="someCanvas" Height="1080" Width="1920"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@@ -43,7 +43,7 @@ namespace opdracht2
|
||||
{
|
||||
//TODO remove
|
||||
//Tuple<List<Polygon>, List<Ellipse>> t = GeoJsonParser.TriangulateJsonData(File.ReadAllText(openFileDialog.FileName), c.Width, c.Height);
|
||||
f = GeoJsonParser.TriangulateJsonData(File.ReadAllText(openFileDialog.FileName), c.Width, c.Height);
|
||||
f = GeoJsonParser.TriangulateJsonData(File.ReadAllText(openFileDialog.FileName), 800, 800);
|
||||
el = new List<Ellipse>();
|
||||
}
|
||||
var st = new ScaleTransform();
|
||||
@@ -54,11 +54,7 @@ namespace opdracht2
|
||||
}
|
||||
c.MouseWheel += (sender, e) =>
|
||||
{
|
||||
if (f.Count > 0)
|
||||
{
|
||||
buffer.Add(f[0]);
|
||||
f.RemoveAt(0);
|
||||
}
|
||||
|
||||
if (e.Delta > 0)
|
||||
{
|
||||
st.ScaleX *= 2;
|
||||
@@ -78,9 +74,13 @@ namespace opdracht2
|
||||
{
|
||||
if (f.Count > 0)
|
||||
{
|
||||
Debug.WriteLine("--- ADDING NEW POLYGON FROM LIST (COUNT: " + f.Count + ")");
|
||||
Debug.WriteLine(f[0].ToString());
|
||||
c.Children.Add(f[0]);
|
||||
Debug.WriteLine(("ADDED POLYGON"));
|
||||
f.RemoveAt(0);
|
||||
Thread.Sleep(50);
|
||||
Debug.WriteLine(("REMOVED POLYGON"));
|
||||
Thread.Sleep(80);
|
||||
}
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "3A443E7ED9F57FEF7727DBB7F494EFF32BD95ECA"
|
||||
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "6DEC4786911BE0BC61F1D6B9699E8EC0FFFE5DFE"
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,11 +10,11 @@ none
|
||||
false
|
||||
TRACE;DEBUG;NETCOREAPP;NETCOREAPP3_1
|
||||
C:\Users\Beppe\source\repos\opdracht2\opdracht2\App.xaml
|
||||
1-1315075995
|
||||
1-673581283
|
||||
|
||||
41252897694
|
||||
195-1941964533
|
||||
4543106357
|
||||
195-2120402724
|
||||
MainWindow.xaml;
|
||||
|
||||
True
|
||||
False
|
||||
|
||||
|
Reference in New Issue
Block a user