// Finds a list of waypoints which is near the given // Lat/Lon, and are connected to at least one other waypoint. private static List <IndexDistancePair> Find( double Lat, double Lon, bool IsSid, WaypointList wptList, WptSearchOption option) { double searchRange = 0.0; var result = new List <IndexDistancePair>(); while (searchRange <= option.MaxSearchRange && result.Count < option.TargetCount) { result.Clear(); searchRange += option.SearchRangeIncr; var searchResult = wptList.Find(Lat, Lon, searchRange); foreach (var item in searchResult) { int i = item.Index; if ((IsSid && wptList.EdgesFromCount(i) > 0) || (IsSid == false && wptList.EdgesToCount(i) > 0)) { double dctDis = wptList[i].Distance(Lat, Lon); result.Add(new IndexDistancePair(i, dctDis)); } } } return(result); }
public static List <IndexDistancePair> FromAirway( double Lat, double Lon, WaypointList wptList, WptSearchOption option) { return(Find(Lat, Lon, false, wptList, option)); }
public StarAdder( string icao, StarCollection stars, WaypointList wptList, WaypointListEditor editor, AirportManager airportList, WptSearchOption option) { this.icao = icao; this.stars = stars; this.wptList = wptList; this.editor = editor; this.airportList = airportList; this.option = option; }