1
0

finished sweepline

This commit is contained in:
2019-05-15 16:28:26 +02:00
parent 57314a0a94
commit 6e1f8bbf63
7 changed files with 91 additions and 71 deletions

View File

@@ -23,7 +23,7 @@ namespace TMI_practicum
}
var parsed = ParseFile(args[0]);
IEnumerable<Intersection> solved;
Stopwatch stopwatch = new Stopwatch();
@@ -35,7 +35,8 @@ namespace TMI_practicum
solved = SimpleAlgorithm.Solve(parsed.Item3);
break;
case 2:
throw new NotImplementedException();
solved = SweepLineAlgorithm.Solve(parsed.Item3);
break;
case 3:
throw new NotImplementedException();
default:
@@ -52,7 +53,7 @@ namespace TMI_practicum
byte algoritm = 0;
int nbCircles = 0;
var circles = new List<Circle>();
Circle[] circles = null;
using (StreamReader file = new StreamReader(path))
{
@@ -60,12 +61,13 @@ namespace TMI_practicum
{
algoritm = byte.Parse(file.ReadLine());
nbCircles = int.Parse(file.ReadLine());
circles = new Circle[nbCircles];
string line;
int i = 0;
while ((line = file.ReadLine()) != null)
{
double[] parts = line.Split(' ').Select(double.Parse).ToArray();
circles.Add(new Circle(parts[0], parts[1], parts[2]));
circles[i++] = new Circle(parts[0], parts[1], parts[2]);
}
}
catch (Exception)