internal bool RoutesAreConsistent() { var usedEdges = new Set <SymmetricSegment>(PathRouter.UsedEdges()); var routesDump = new Set <SymmetricSegment>(_edgeTrajectories.Select(p => p.Value).SelectMany(SymSegsOfPointList)); var visEdgeDump = new Set <SymmetricSegment>( PathRouter.VisGraph.Edges.Select(e => new SymmetricSegment(e.SourcePoint, e.TargetPoint))); #if DEBUG && !SHARPKIT foreach (var s in routesDump - visEdgeDump) { Console.WriteLine("{0} is in routes but no in vis graph", s); } foreach (var s in visEdgeDump - routesDump) { Console.WriteLine("{0} is in visgraph but no in routes", s); } var routesOutOfVisGraph = routesDump - visEdgeDump; if (routesOutOfVisGraph.Count > 0) { SplineRouter.ShowVisGraph(PathRouter.VisGraph, null, null, Ttt(routesOutOfVisGraph)); } foreach (var s in usedEdges - routesDump) { Console.WriteLine("{0} is in usedEdges but not in routes", s); } foreach (var s in routesDump - usedEdges) { Console.WriteLine("{0} is in routes but not in usedEdges", s); } #endif return(routesDump == visEdgeDump && usedEdges == routesDump); }
// ReSharper disable UnusedMember.Local void ShowGraphLocal() { // ReSharper restore UnusedMember.Local var l = new List <ICurve>(); l.Clear(); foreach (var e in geometryGraph.Edges) { { l.Add(new Ellipse(2, 2, e.Curve.Start)); l.Add(CurveFactory.CreateDiamond(5, 5, e.Curve.End)); l.Add(e.Curve); } } SplineRouter.ShowVisGraph(VisibilityGraph, LooseHierarchy.GetAllLeaves(), null, l); }
internal bool RoutesAreConsistent() { var usedEdges = new Set <SymmetricSegment>(PathRouter.UsedEdges()); var routesDump = new Set <SymmetricSegment>(_edgeTrajectories.Select(p => p.Value).SelectMany(SymSegsOfPointList)); var visEdgeDump = new Set <SymmetricSegment>( PathRouter.VisGraph.Edges.Select(e => new SymmetricSegment(e.SourcePoint, e.TargetPoint))); #if TEST_MSAGL && !SHARPKIT var routesOutOfVisGraph = routesDump - visEdgeDump; if (routesOutOfVisGraph.Count > 0) { SplineRouter.ShowVisGraph(PathRouter.VisGraph, null, null, Ttt(routesOutOfVisGraph)); } #endif return(routesDump == visEdgeDump && usedEdges == routesDump); }