1 // navlist.hxx -- navaids management class
3 // Written by Curtis Olson, started April 2000.
5 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _FG_NAVLIST_HXX
25 #define _FG_NAVLIST_HXX
28 #include <simgear/compiler.h>
29 #include <simgear/misc/sg_path.hxx>
44 typedef vector < FGNav* > nav_list_type;
45 typedef nav_list_type::iterator nav_list_iterator;
46 typedef nav_list_type::const_iterator nav_list_const_iterator;
48 typedef map < int, nav_list_type > nav_map_type;
49 typedef nav_map_type::iterator nav_map_iterator;
50 typedef nav_map_type::const_iterator nav_map_const_iterator;
52 typedef map < string, nav_list_type > nav_ident_map_type;
55 nav_ident_map_type ident_navaids;
57 // internal helper to pick a Nav item from a nav_list based on
58 // distance from the aircraft point
59 bool findNavFromList(const Point3D &aircraft,
60 nav_list_iterator current,
61 nav_list_iterator last,
69 // load the navaids and build the map
70 bool init( SGPath path );
72 // query the database for the specified frequency, lon and lat are
73 // in degrees, elev is in meters
74 bool query( double lon, double lat, double elev, double freq, FGNav *n );
76 // locate closest item in the DB matching the requested ident
77 bool findByIdent(const char* ident, double lon, double lat, FGNav *nav);
81 extern FGNavList *current_navlist;
84 #endif // _FG_NAVLIST_HXX