]> git.mxchange.org Git - flightgear.git/blobdiff - src/Navaids/ils.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / Navaids / ils.hxx
index d9d4c3ae1bdf7b6d516b0e22e05ff239ca14ca32..a9b7da167d1294f3b718468bf2038e070f154046 100644 (file)
 
 #ifdef SG_HAVE_STD_INCLUDES
 #  include <istream>
-#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
-#  include <iostream.h>
-#elif defined( __BORLANDC__ )
+#elif defined( __BORLANDC__ ) || (__APPLE__)
 #  include <iostream>
 #else
 #  include <istream.h>
 #endif
 
-#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 SG_USING_STD(istream);
-#endif
 
 
 #define FG_ILS_DEFAULT_RANGE 18
@@ -83,7 +79,7 @@ class FGILS {
 
 public:
 
-    inline FGILS(void) {}
+    inline FGILS(void);
     inline ~FGILS(void) {}
 
     inline char get_ilstype() const { return ilstype; }
@@ -124,11 +120,52 @@ public:
 };
 
 
+inline
+FGILS::FGILS(void)
+  : ilstype(0),
+    locfreq(0),
+    locheading(0.0),
+    loclat(0.0),
+    loclon(0.0),
+    x(0.0), y(0.0), z(0.0),
+    has_gs(false),
+    gselev(0.0),
+    gsangle(0.0),
+    gslat(0.0),
+    gslon(0.0),
+    gs_x(0.0), gs_y(0.0), gs_z(0.0),
+    has_dme(false),
+    dmelat(0.0),
+    dmelon(0.0),
+    dme_x(0.0), dme_y(0.0), dme_z(0.0),
+    omlat(0.0),
+    omlon(0.0),
+    mmlat(0.0),
+    mmlon(0.0),
+    imlat(0.0),
+    imlon(0.0),
+    trans_ident(""),
+    loc_failed(false),
+    gs_failed(false),
+    dme_failed(false)
+{
+    ilstypename[0] = '\0';
+    aptcode[0] = '\0';
+    rwyno[0] = '\0';
+    locident[0] = '\0';
+}
+
+    
 inline istream&
 operator >> ( istream& in, FGILS& i )
 {
     double f;
-    in >> i.ilstype >> i.ilstypename >> i.aptcode >> i.rwyno 
+    in >> i.ilstype;
+    
+    if ( i.ilstype == '[' )
+          return in;
+
+    in >> i.ilstypename >> i.aptcode >> i.rwyno 
        >> f >> i.locident >> i.locheading >> i.loclat >> i.loclon
        >> i.gselev >> i.gsangle >> i.gslat >> i.gslon
        >> i.dmelat >> i.dmelon
@@ -142,7 +179,9 @@ operator >> ( istream& in, FGILS& i )
     // generate cartesian coordinates
     Point3D geod, cart;
 
-    geod = Point3D( i.loclon * SGD_DEGREES_TO_RADIANS, i.loclat * SGD_DEGREES_TO_RADIANS, i.gselev );
+    geod = Point3D( i.loclon * SGD_DEGREES_TO_RADIANS,
+                    i.loclat * SGD_DEGREES_TO_RADIANS,
+                    i.gselev * SG_FEET_TO_METER );
     cart = sgGeodToCart( geod );
     i.x = cart.x();
     i.y = cart.y();
@@ -153,7 +192,9 @@ operator >> ( istream& in, FGILS& i )
     } else {
        i.has_gs = true;
 
-       geod = Point3D( i.gslon * SGD_DEGREES_TO_RADIANS, i.gslat * SGD_DEGREES_TO_RADIANS, i.gselev );
+       geod = Point3D( i.gslon * SGD_DEGREES_TO_RADIANS,
+                        i.gslat * SGD_DEGREES_TO_RADIANS,
+                        i.gselev * SG_FEET_TO_METER );
        cart = sgGeodToCart( geod );
        i.gs_x = cart.x();
        i.gs_y = cart.y();
@@ -166,7 +207,9 @@ operator >> ( istream& in, FGILS& i )
     } else {
        i.has_dme = true;
 
-       geod = Point3D( i.dmelon * SGD_DEGREES_TO_RADIANS, i.dmelat * SGD_DEGREES_TO_RADIANS, i.gselev);
+       geod = Point3D( i.dmelon * SGD_DEGREES_TO_RADIANS,
+                        i.dmelat * SGD_DEGREES_TO_RADIANS,
+                        i.gselev * SG_FEET_TO_METER );
        cart = sgGeodToCart( geod );
        i.dme_x = cart.x();
        i.dme_y = cart.y();