]> git.mxchange.org Git - flightgear.git/blob - src/Navaids/mkrbeacons.hxx
Changes to keep the various autopilot properties from stepping on each
[flightgear.git] / src / Navaids / mkrbeacons.hxx
1 // mkrbeacons.hxx -- marker beacon management class
2 //
3 // Written by Curtis Olson, started March 2001.
4 //
5 // Copyright (C) 2001  Curtis L. Olson - curt@flightgear.org
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22
23
24 #ifndef _FG_MKRBEACON_HXX
25 #define _FG_MKRBEACON_HXX
26
27
28 #ifdef HAVE_CONFIG_H
29 #  include <config.h>
30 #endif
31
32 #include <simgear/compiler.h>
33 #include <simgear/misc/sg_path.hxx>
34
35 #include <map>
36 #include <vector>
37
38 #include "nav.hxx"
39
40 SG_USING_STD(map);
41 SG_USING_STD(vector);
42
43
44 class FGMkrBeacon {
45
46 public:
47
48     enum fgMkrBeacType {
49         NOBEACON = 0,
50         INNER,
51         MIDDLE,
52         OUTER   
53     };
54
55 private:
56
57     double lon;
58     double lat;
59     double elev;
60     fgMkrBeacType type;
61
62     double x, y, z;
63
64 public:
65
66     FGMkrBeacon();
67     FGMkrBeacon( double _lon, double _lat, double _elev, fgMkrBeacType _type );
68     ~FGMkrBeacon();
69
70     inline double get_elev() const { return elev; }
71     inline fgMkrBeacType get_type() const { return type; }
72     inline double get_x() const { return x; }
73     inline double get_y() const { return y; }
74     inline double get_z() const { return z; }
75    
76 };
77
78
79 class FGMarkerBeacons {
80
81     // convenience types
82     typedef vector < FGMkrBeacon > beacon_list_type;
83     typedef beacon_list_type::iterator beacon_list_iterator;
84     typedef beacon_list_type::const_iterator beacon_list_const_iterator;
85
86     typedef map < int, beacon_list_type > beacon_map_type;
87     typedef beacon_map_type::iterator beacon_map_iterator;
88     typedef beacon_map_type::const_iterator beacon_map_const_iterator;
89
90     beacon_map_type beacon_map;
91
92     // real add a marker beacon
93     bool FGMarkerBeacons::real_add( const int master_index,
94                                     const FGMkrBeacon& b );
95
96 public:
97
98     FGMarkerBeacons();
99     ~FGMarkerBeacons();
100
101     // initialize the structures
102     bool init();
103
104     // add a marker beacon
105     bool add( double lon, double lat, double elev,
106               FGMkrBeacon::fgMkrBeacType type );
107
108     // returns marker beacon type if we are over a marker beacon, NOBEACON
109     // otherwise
110     FGMkrBeacon::fgMkrBeacType query( double lon, double lat, double elev );
111 };
112
113
114 extern FGMarkerBeacons *current_beacons;
115
116
117 #endif // _FG_MKRBEACON_HXX