mirror of
https://github.com/bvanroll/cs-map-project.git
synced 2025-09-02 22:02:42 +00:00
dit zou normaal gezien correcter moeten scalen, maar nu moet ik mijn scale methode nog fixen
This commit is contained in:
@@ -2,22 +2,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Globals;
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
@@ -118,6 +106,19 @@ namespace opdracht2
|
||||
//als een land geselecteerd wordt in lijst runned deze functie
|
||||
|
||||
|
||||
|
||||
//voorbereiding van scale waarden.
|
||||
|
||||
double scaleX = (c.ActualHeight > c.ActualWidth) ? c.ActualWidth : c.ActualHeight;
|
||||
double scaleY = (c.ActualHeight > c.ActualWidth) ? c.ActualWidth : c.ActualHeight;
|
||||
scaleX /= 2;
|
||||
scaleY /= 2;
|
||||
double offsetX = scaleX; //vroeger c.ActualWidth/2
|
||||
double offsetY = scaleY;
|
||||
//dit zorgt voor evenredige scaling zonder stretching. als men wel stretching wilt gebruiken:
|
||||
// scaleX = c.ActualWidth;
|
||||
// scaleY = c.ActualHeight;
|
||||
|
||||
//is er meer dan 1 land geselecteerd
|
||||
if (lb.SelectedItems.Count >1)
|
||||
{
|
||||
@@ -135,7 +136,7 @@ namespace opdracht2
|
||||
}
|
||||
|
||||
//scale de polygon als de checkbox aan staat
|
||||
if (scale.IsChecked == true) mpps = pm.ScaleMultiPolygons(mpps, c.ActualWidth/2, c.ActualHeight/2, 0, 0);
|
||||
if (scale.IsChecked == true) mpps = pm.ScaleMultiPolygons(mpps, scaleX, scaleY, offsetX, offsetY);
|
||||
|
||||
foreach(MultiPolygonPunten mp in mpps)
|
||||
{
|
||||
@@ -170,7 +171,7 @@ namespace opdracht2
|
||||
Debug.WriteLine(lb.SelectedItem.GetType().Name); // voor debug redenen schrijf naam naar console
|
||||
c.Children.Clear(); // delete alle vorige afbeeldingen
|
||||
MultiPolygonPunten mp = (MultiPolygonPunten)lb.SelectedItem; //haal multipolygon uit lijst
|
||||
if (scale.IsChecked == true) mp = pm.ScaleMultiPolygon(mp, c.ActualWidth / 2, c.ActualHeight / 2, 0, 0); //schaal multipolygon
|
||||
if (scale.IsChecked == true) mp = pm.ScaleMultiPolygon(mp, scaleX, scaleY, offsetX, offsetY); //schaal multipolygon
|
||||
if (peuker.IsChecked == true) mp = pm.Peuker(mp, peukerPercent.Value/1000); // als peuker (puntvermindering) moet gebeuren, doe dit hier
|
||||
foreach (PolygonPunten pp in mp.PolygonPunten) //loop doorheen polygons in multipolygon
|
||||
{
|
||||
@@ -192,7 +193,8 @@ namespace opdracht2
|
||||
Debug.WriteLine(lb.SelectedItem.GetType().Name);
|
||||
c.Children.Clear(); //delete alle vorige afbeeldingen
|
||||
PolygonPunten p = (PolygonPunten)lb.SelectedItem; // haal land uit lijst
|
||||
if (scale.IsChecked == true) p = pm.ScalePolygon(p, c.ActualWidth/2, c.ActualHeight/2, 0, 0); // schaal polygon
|
||||
|
||||
if (scale.IsChecked == true) p = pm.ScalePolygon(p, scaleX, scaleY, offsetX, offsetY); // schaal polygon
|
||||
if (peuker.IsChecked == true) p = pm.Peuker(p, peukerPercent.Value / 1000); // peuker (puntvermindering)
|
||||
if (triangulate.IsChecked == true) //triangulation check
|
||||
{
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@
|
||||
},
|
||||
"projects": {
|
||||
"C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Datalaag\\Datalaag.csproj",
|
||||
"projectName": "Datalaag",
|
||||
@@ -24,6 +25,7 @@
|
||||
}
|
||||
},
|
||||
"C:\\Users\\Beppe\\source\\repos\\opdracht2\\Globals\\Globals.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Globals\\Globals.csproj",
|
||||
"projectName": "Globals",
|
||||
@@ -34,6 +36,7 @@
|
||||
}
|
||||
},
|
||||
"C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\Logica\\Logica.csproj",
|
||||
"projectName": "Logica",
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Beppe\.nuget\packages\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.6.0</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.5.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "Zy6jypDVLiSwLfNswZHvoD7ul/+NOG2AgIE/eLzWMMgAaQ+TzAjn3Or2nqa6RpIYT9zQrkp/4+yCHo1D0FoSMQ==",
|
||||
"dgSpecHash": "p426YNxR+un7rXUpsV3S3g0htKyuFPUxB5pYHNl1fsHxje10LlIJDBLjupJb2IZCMEZ+Cv3TXWBEUMbbMYO5hA==",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\Beppe\\source\\repos\\opdracht2\\opdracht2\\opdracht2.csproj",
|
||||
"expectedPackageFiles": [
|
||||
|
Reference in New Issue
Block a user