using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Msagl.Core.DataStructures; using Microsoft.Msagl.Core.Geometry; using Microsoft.Msagl.Core.Geometry.Curves; using Microsoft.Msagl.Core.Layout; namespace Microsoft.Msagl.Routing { //this class contains a set of edge geometries, and set of node boundaries, ICurves, that might obstruct the edge routing internal class PreGraph { internal List edgeGeometries; internal Set nodeBoundaries; internal Rectangle boundingBox; internal PreGraph(EdgeGeometry[] egs, Set nodeBoundaries) { edgeGeometries = new List(egs); this.nodeBoundaries = new Set(nodeBoundaries); boundingBox = Rectangle.CreateAnEmptyBox(); foreach (var curve in nodeBoundaries) boundingBox.Add(curve.BoundingBox); } internal PreGraph() {} internal void AddGraph(PreGraph a) { edgeGeometries.AddRange(a.edgeGeometries); nodeBoundaries += a.nodeBoundaries; boundingBox.Add(a.boundingBox); } internal void AddNodeBoundary(ICurve curve) { nodeBoundaries.Insert(curve); boundingBox.Add(curve.BoundingBox); } } }