示例#1
0
        Point FigureOutHookLocationForClusterOtherPort(Polyline poly, ClusterBoundaryPort otherEdgeEndPort, EdgeGeometry edgeGeom)
        {
            var shapes = shortestPathRouter.MakeTransparentShapesOfEdgeGeometry(edgeGeom);
            //SplineRouter.ShowVisGraph(this.VisibilityGraph, this.LooseHierarchy.GetAllLeaves(),
            //    shapes.Select(sh => sh.BoundaryCurve), new[] { new LineSegment(edgeGeom.SourcePort.Location, edgeGeom.TargetPort.Location) });
            var s = new MultipleSourceMultipleTargetsShortestPathOnVisibilityGraph(otherEdgeEndPort.LoosePolyline.Select(p => VisibilityGraph.FindVertex(p)),
                                                                                   poly.Select(p => VisibilityGraph.FindVertex(p)), VisibilityGraph);
            var path = s.GetPath();

            foreach (var sh in shapes)
            {
                sh.IsTransparent = false;
            }
            return(path.Last().Point);
        }