internal static void Sweep(IEnumerable<Polyline> obstacles,
                            Point direction, double coneAngle, VisibilityGraph visibilityGraph,
                            IEnumerable<Point> portLocations) {
     var cs = new LineSweeperForPortLocations(obstacles, direction, direction.Rotate(-coneAngle/2),
                                              direction.Rotate(coneAngle/2), visibilityGraph, portLocations);
     cs.Calculate();
 }
Exemplo n.º 2
0
        internal static void Sweep(IEnumerable <Polyline> obstacles,
                                   Point direction, double coneAngle, VisibilityGraph visibilityGraph,
                                   IEnumerable <Point> portLocations)
        {
            var cs = new LineSweeperForPortLocations(obstacles, direction, direction.Rotate(-coneAngle / 2),
                                                     direction.Rotate(coneAngle / 2), visibilityGraph, portLocations);

            cs.Calculate();
        }
        void AddDirection(Point direction)
        {
            var visibilityGraph = new VisibilityGraph();

            LineSweeperForPortLocations.Sweep(obstacles, direction, coneAngle, visibilityGraph,
                                              PortLocations);
            foreach (var edge in visibilityGraph.Edges)
            {
                VisibilityGraph.AddEdge(edge.SourcePoint, edge.TargetPoint,
                                        ((a, b) => new TollFreeVisibilityEdge(a, b)));
            }
        }