]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/airport.hxx
Interim windows build fix
[flightgear.git] / src / Airports / airport.hxx
index a35354075fda71c412e81cbd4c9c0bd064b98302..d5ad1a0e367dfb75768865cae1873f990777c902 100644 (file)
@@ -63,6 +63,14 @@ class FGAirport : public FGPositioned
     bool   isSeaport()    const;
     bool   isHeliport()   const;
 
+    /// is the airport closed (disused)?
+    /// note at rpesent we look for an [x] in the name, ideally the database
+    /// would explicitly include this
+    bool isClosed() const
+    {
+        return mIsClosed;
+    }
+
     static bool isAirportType(FGPositioned* pos);
     
     virtual const std::string& name() const
@@ -70,10 +78,10 @@ class FGAirport : public FGPositioned
 
     /**
      * reload the ILS data from XML if required.
-     * @result true if the data was refreshed, false if no data was loaded
-     * or previously cached data is still correct.
      */
-    bool validateILSData();
+    void validateILSData();
+
+    bool hasTower() const;
 
     SGGeod getTowerLocation() const;
 
@@ -81,7 +89,7 @@ class FGAirport : public FGPositioned
 
     FGRunwayRef getActiveRunwayForUsage() const;
 
-    FGAirportDynamics *getDynamics();
+    FGAirportDynamicsRef getDynamics() const;
     
     unsigned int numRunways() const;
     unsigned int numHelipads() const;
@@ -94,7 +102,22 @@ class FGAirport : public FGPositioned
     bool hasHelipadWithIdent(const std::string& aIdent) const;
     FGRunwayRef getRunwayByIdent(const std::string& aIdent) const;
     FGHelipadRef getHelipadByIdent(const std::string& aIdent) const;
-    FGRunwayRef findBestRunwayForHeading(double aHeading) const;
+
+    struct FindBestRunwayForHeadingParams {
+      FindBestRunwayForHeadingParams() {
+        lengthWeight =  0.01;
+        widthWeight =  0.01;
+        surfaceWeight =  10;
+        deviationWeight =  1;
+        ilsWeight = 0;
+      }
+      double lengthWeight;
+      double widthWeight;
+      double surfaceWeight;
+      double deviationWeight;
+      double ilsWeight;
+    };
+    FGRunwayRef findBestRunwayForHeading(double aHeading, struct FindBestRunwayForHeadingParams * parms = NULL ) const;
     
     /**
      * return the most likely target runway based on a position.
@@ -117,6 +140,11 @@ class FGAirport : public FGPositioned
      * an airport *once*, not *twice* - eg mapping and nav-display code.
      */
     FGRunwayList getRunwaysWithoutReciprocals() const;
+
+    /**
+     * Retrieve all runways at the airport
+     */
+    FGRunwayList getRunways() const;
     
      /**
      * Useful predicate for FMS/GPS/NAV displays and similar - check if this
@@ -124,6 +152,8 @@ class FGAirport : public FGPositioned
      */
     bool hasHardRunwayOfLengthFt(double aLengthFt) const;
 
+    FGRunwayRef longestRunway() const;
+
     unsigned int numTaxiways() const;
     FGTaxiwayRef getTaxiwayByIndex(unsigned int aIndex) const;
     FGTaxiwayList getTaxiways() const;
@@ -288,10 +318,11 @@ private:
      * Helper to parse property data loaded from an ICAO.twr.xml file
      */
     void readTowerData(SGPropertyNode* aRoot);
-    
+  
+    PositionedIDVec itemsOfType(FGPositioned::Type ty) const;
+  
     std::string _name;
     bool _has_metar;
-    FGAirportDynamics *_dynamics;
 
     void loadRunways() const;
     void loadHelipads() const;
@@ -299,13 +330,19 @@ private:
     void loadProcedures() const;
     
     mutable bool mTowerDataLoaded;
+    mutable bool mHasTower;
+    mutable SGGeod mTowerPosition;
+  
     mutable bool mRunwaysLoaded;
     mutable bool mHelipadsLoaded;
     mutable bool mTaxiwaysLoaded;
     mutable bool mProceduresLoaded;
+    bool mIsClosed;
+    mutable bool mThresholdDataLoaded;
     bool mILSDataLoaded;
+
+    mutable std::vector<FGRunwayRef> mRunways;
   
-    mutable PositionedIDVec mRunways;
     mutable PositionedIDVec mHelipads;
     mutable PositionedIDVec mTaxiways;
     PositionedIDVec mPavements;