Aetheria/Assets/Scripts/NIH/MSAGL/Routing/Rectilinear/OverlapConvexHull.cs
hyperion51 01a956eef6 MSAGL Support
Added new tech tree layout implementation using Microsoft Automatic Graph Layouts
Added some functionality to the database editor tools
2020-04-14 00:42:04 +01:00

42 lines
1.3 KiB
C#

//
// OverlapConvexHull.cs
// MSAGL class for Convex Hulls around overlapping obstacles for Rectilinear Edge Routing.
//
// Copyright Microsoft Corporation.
using System.Collections.Generic;
using System.Linq;
using Microsoft.Msagl.Core.Geometry.Curves;
namespace Microsoft.Msagl.Routing.Rectilinear {
/// <summary>
/// This stores the location and type of a Port.
/// </summary>
internal class OverlapConvexHull {
internal Polyline Polyline { get; private set; }
/// <summary>
/// This is some arbitrary obstacle inside the convex hull so we qualify Select().Where() so we
/// don't get the CH duplicated in the scanline etc. enumerations.
/// </summary>
internal Obstacle PrimaryObstacle { get; private set; }
internal List<Obstacle> Obstacles { get; private set; }
internal OverlapConvexHull(Polyline polyline, IEnumerable<Obstacle> obstacles) {
this.Polyline = polyline;
this.Obstacles = obstacles.ToList();
this.PrimaryObstacle = this.Obstacles[0];
Obstacle.RoundVertices(this.Polyline);
}
/// <summary>
/// </summary>
/// <returns></returns>
public override string ToString() {
return this.Polyline.ToString();
}
}
}