double FindMaxPaddingForTightPolyline(Polyline polyline) { var dist = double.MaxValue; var polygon = new Polygon(polyline); foreach (var poly in RootOfLooseHierarchy.GetAllLeaves().Where(p => p != polyline)) { dist = Math.Min(dist, Polygon.Distance(polygon, new Polygon(poly))); } // TraverseHierarchy(RootOfLooseHierarchy, delegate(RectangleNode<Polyline> node) { // if (node.UserData != null) // if (node.UserData != polyline) // dist = Math.Min(dist, // Polygon.Distance(polygon, // new Polygon( // node.UserData))); // }); dist = Math.Min(dist, RouterBetweenTwoNodes.DistanceFromPointToPolyline(router.SourcePoint, polyline)); dist = Math.Min(dist, RouterBetweenTwoNodes.DistanceFromPointToPolyline(router.TargetPoint, polyline)); return(dist); }
private void RouteEdge(GeometryEdge geometryEdge) { var router = new RouterBetweenTwoNodes(Graph.GeometryGraph, Graph.Attr.NodeSeparation * tightOffsetForRouting, Graph.Attr.NodeSeparation * looseOffsetForRouting, Graph.Attr.NodeSeparation * offsetForRelaxingInRouting); try { router.RouteEdge(geometryEdge, true); } catch (Exception) { } }
internal ObstacleCalculator(RouterBetweenTwoNodes router) { this.router = router; }