1 // ils.hxx -- navaid 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.
28 #include <simgear/compiler.h>
29 #include <simgear/math/fg_geodesy.hxx>
30 #include <simgear/misc/fgstream.hxx>
32 #ifdef FG_HAVE_STD_INCLUDES
34 #elif defined( FG_HAVE_NATIVE_SGI_COMPILERS )
35 # include <iostream.h>
36 #elif defined( __BORLANDC__ )
42 #if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
43 FG_USING_STD(istream);
47 #define FG_ILS_DEFAULT_RANGE 30
77 inline ~FGILS(void) {}
79 inline char get_ilstype() const { return ilstype; }
80 inline char *get_ilstypename() { return ilstypename; }
81 inline char *get_aptcode() { return aptcode; }
82 inline char *get_rwyno() { return rwyno; }
83 inline int get_locfreq() const { return locfreq; }
84 inline char *get_locident() { return locident; }
85 inline double get_locheading() const { return locheading; }
86 inline double get_loclat() const { return loclat; }
87 inline double get_loclon() const { return loclon; }
88 inline double get_gselev() const { return gselev; }
89 inline double get_x() const { return x; }
90 inline double get_y() const { return y; }
91 inline double get_z() const { return z; }
92 inline double get_gsangle() const { return gsangle; }
93 inline double get_gslat() const { return gslat; }
94 inline double get_gslon() const { return gslon; }
95 inline double get_dmelat() const { return dmelat; }
96 inline double get_dmelon() const { return dmelon; }
97 inline double get_omlat() const { return omlat; }
98 inline double get_omlon() const { return omlon; }
99 inline double get_mmlat() const { return mmlat; }
100 inline double get_mmlon() const { return mmlon; }
101 inline double get_imlat() const { return imlat; }
102 inline double get_imlon() const { return imlon; }
104 friend istream& operator>> ( istream&, FGILS& );
109 operator >> ( istream& in, FGILS& i )
112 in >> i.ilstype >> i.ilstypename >> i.aptcode >> i.rwyno
113 >> f >> i.locident >> i.locheading >> i.loclat >> i.loclon
114 >> i.gselev >> i.gsangle >> i.gslat >> i.gslon
115 >> i.dmelat >> i.dmelon
116 >> i.omlat >> i.omlon
117 >> i.mmlat >> i.mmlon
118 >> i.imlat >> i.imlon;
121 i.locfreq = (int)(f*100.0 + 0.5);
123 // generate cartesian coordinates
124 Point3D geod( i.loclon * DEG_TO_RAD, i.loclat * DEG_TO_RAD, i.gselev );
125 Point3D cart = fgGeodToCart( geod );
130 // return in >> skipeol;
135 #endif // _FG_ILS_HXX