-
- // Constructor
- FGRunwaysUtil();
-
- // Destructor
- ~FGRunwaysUtil();
-
- // load the data
- int load( const string& file );
-
- // save the data in metakit format
- bool dump_mk4( const string& file );
-
- // search for the specified id.
- // Returns true if successful, otherwise returns false.
- // On success, runway data is returned thru "runway" pointer.
- // "runway" is not changed if "id" is not found.
- // bool search( const string& id, FGRunway* runway ) const;
- // FGRunway search( const string& id ) const;
+
+ FGRunway(FGAirport* aAirport, const std::string& rwy_no,
+ const SGGeod& aGeod,
+ const double heading, const double length,
+ const double width,
+ const double displ_thresh,
+ const double stopway,
+ const int surface_code,
+ const bool reciprocal);
+
+ /**
+ * given a runway identifier (06, 18L, 31R) compute the identifier for the
+ * reciprocal heading runway (24, 36R, 13L) string.
+ */
+ static std::string reverseIdent(const std::string& aRunayIdent);
+
+ /**
+ * score this runway according to the specified weights. Used by
+ * FGAirport::findBestRunwayForHeading
+ */
+ double score(double aLengthWt, double aWidthWt, double aSurfaceWt) const;
+
+ /**
+ * Test if this runway is the reciprocal. This allows users who iterate
+ * over runways to avoid counting runways twice, if desired.
+ */
+ bool isReciprocal() const
+ { return _isReciprocal; }
+
+ /**
+ * Get the runway begining point - this is syntatic sugar, equivalent to
+ * calling pointOnCenterline(0.0);
+ */
+ SGGeod begin() const;
+
+ /**
+ * Get the (possibly displaced) threshold point.
+ */
+ SGGeod threshold() const;
+
+ /**
+ * Get the 'far' end - this is equivalent to calling
+ * pointOnCenterline(lengthFt());
+ */
+ SGGeod end() const;
+
+ double displacedThresholdM() const
+ { return _displ_thresh * SG_FEET_TO_METER; }
+
+ double stopwayM() const
+ { return _stopway * SG_FEET_TO_METER; }
+
+ /**
+ * Airport this runway is located at
+ */
+ FGAirport* airport() const
+ { return _airport; }
+
+ // FIXME - should die once airport / runway creation is cleaned up
+ void setAirport(FGAirport* aAirport)
+ { _airport = aAirport; }
+
+ FGNavRecord* ILS() const { return _ils; }
+ void setILS(FGNavRecord* nav) { _ils = nav; }
+
+ FGRunway* reciprocalRunway() const
+ { return _reciprocal; }
+ void setReciprocalRunway(FGRunway* other);
+
+ /**
+ * Helper to process property data loaded from an ICAO.threshold.xml file
+ */
+ void processThreshold(SGPropertyNode* aThreshold);
+
+ /**
+ * Get SIDs (DPs) associated with this runway
+ */
+ std::vector<flightgear::SID*> getSIDs();
+
+ /**
+ * Get STARs associared with this runway
+ */
+ std::vector<flightgear::STAR*> getSTARs();