private static IEnumerable <IEnumerable <Point> > RestorePathStages(List <WaypointEntry> waypointEntries, VertexEntry lastEntry)
        {
            // Back up to restore the path stages back to each waypoint.
            var paths = new List <IEnumerable <Point> >();

            waypointEntries.Reverse();
            foreach (var waypointEntry in waypointEntries)
            {
                paths.Add(SsstRectilinearPath.RestorePath(ref lastEntry, waypointEntry.waypointVector[0]));
            }

            // Add the first stage.
            paths.Add(SsstRectilinearPath.RestorePath(lastEntry));
            paths.Reverse();
            return(paths);
        }
Example #2
0
        /// <summary>
        /// Get the lowest-cost path from one of one or more sources to one of one or more targets, without waypoints.
        /// </summary>
        /// <param name="sources">One or more source vertices</param>
        /// <param name="targets">One or more target vertices</param>
        /// <returns>A single enumeration of path points.</returns>
        internal IEnumerable <Point> GetPath(IEnumerable <VisibilityVertex> sources, IEnumerable <VisibilityVertex> targets)
        {
            var entry = GetPathStage(null, sources, null, targets);

            return(SsstRectilinearPath.RestorePath(entry));
        }