Skip to content

Commit 5f34747

Browse files
committed
C# refactored Path64, Paths64, PathD & PathsD to derived List classes
Updated framework to .NET5.0
1 parent a616cb5 commit 5f34747

23 files changed

Lines changed: 99 additions & 131 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
RandomPolygons.txt
1+
.*

CSharp/Clipper2Lib.Benchmark/Benchmarks.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66

77
namespace Clipper2Lib.Benchmark
88
{
9-
using Path64 = List<Point64>;
10-
using Paths64 = List<List<Point64>>;
11-
129
public class FastConfig : ManualConfig
1310
{
1411
public FastConfig()
1512
{
1613
Add(DefaultConfig.Instance);
1714
AddJob(Job.Default
1815
.WithLaunchCount(1)
19-
.WithWarmupCount(1)
16+
.WithWarmupCount(1)
2017
.WithIterationCount(1)
2118
);
2219
}

CSharp/Clipper2Lib.Benchmark/Clipper2Lib.Benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.1</TargetFramework>
3+
<TargetFramework>net5.0</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66
<PropertyGroup>

CSharp/Clipper2Lib.Examples/ConsoleDemo/ConsoleDemo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<EnableNETAnalyzers>false</EnableNETAnalyzers>
77
<ApplicationIcon>Clipper2.ico</ApplicationIcon>
88
</PropertyGroup>

CSharp/Clipper2Lib.Examples/ConsoleDemo/Main.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/*******************************************************************************
2-
* *
32
* Author : Angus Johnson *
43
* Date : 17 July 2022 *
54
* Website : http://www.angusj.com *
@@ -14,10 +13,6 @@
1413

1514
namespace ClipperDemo1
1615
{
17-
18-
using Path64 = List<Point64>;
19-
using Paths64 = List<List<Point64>>;
20-
2116
public class Application
2217
{
2318

@@ -71,7 +66,6 @@ public static void ClipTestPolys()
7166
ClipperFileIO.OpenFileWithDefaultApp("..\\..\\..\\clipperD.svg");
7267
}
7368

74-
7569
public static Paths64 LoadPathsFromResource(string resourceName)
7670
{
7771
using Stream stream = Assembly.GetExecutingAssembly().

CSharp/Clipper2Lib.Examples/InflateDemo/InflateDemo.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<EnableNETAnalyzers>false</EnableNETAnalyzers>
77
<ApplicationIcon>Clipper2.ico</ApplicationIcon>
88
</PropertyGroup>

CSharp/Clipper2Lib.Examples/InflateDemo/Main.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*******************************************************************************
2-
* *
32
* Author : Angus Johnson *
4-
* Date : 16 May 2022 *
3+
* Date : 16 September 2022 *
54
* Website : http://www.angusj.com *
65
* Copyright : Angus Johnson 2010-2022 *
76
* License : http://www.boost.org/LICENSE_1_0.txt *
@@ -15,10 +14,6 @@
1514
namespace ClipperDemo1
1615
{
1716

18-
using Paths64 = List<List<Point64>>;
19-
using PathD = List<PointD>;
20-
using PathsD = List<List<PointD>>;
21-
2217
public class Application
2318
{
2419

CSharp/Clipper2Lib.Tests/Tests1/Tests/TestLines.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using Microsoft.VisualStudio.TestTools.UnitTesting;
2-
using System;
3-
using System.Collections.Generic;
42

53
namespace Clipper2Lib.UnitTests
64
{
7-
using Paths64 = List<List<Point64>>;
85

96
[TestClass]
107
public class TestLines

CSharp/Clipper2Lib.Tests/Tests1/Tests/TestPolygons.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using Microsoft.VisualStudio.TestTools.UnitTesting;
2-
using System;
3-
using System.Collections.Generic;
42

53
namespace Clipper2Lib.UnitTests
64
{
7-
using Paths64 = List<List<Point64>>;
85

96
[TestClass]
107
public class TestPolygons
@@ -43,9 +40,9 @@ public void TestClosedPaths()
4340
}
4441

4542
if (count > 0 && Math.Abs(solution.Count - count) > 2 &&
46-
(double)Math.Abs(solution.Count - count)/count > 0.02)
43+
(double)Math.Abs(solution.Count - count)/count > 0.03)
4744
{
48-
Assert.IsTrue(Math.Abs(solution.Count - count) < 4,
45+
Assert.IsTrue(Math.Abs(solution.Count - count) <= 4,
4946
string.Format("Incorrect count in test {0}", i));
5047
}
5148

CSharp/Clipper2Lib.Tests/Tests1/Tests/TestPolytree.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
using Microsoft.VisualStudio.TestTools.UnitTesting;
2-
using System;
3-
using System.Collections.Generic;
42

53
namespace Clipper2Lib.UnitTests
64
{
7-
using Path64 = List<Point64>;
8-
using Paths64 = List<List<Point64>>;
95

106
[TestClass]
117
public class TestPolytree

0 commit comments

Comments
 (0)