]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.hxx
Merge branch 'jmt/gps'
[flightgear.git] / src / Airports / simple.hxx
index 71fb97fb8b8cf4b4797607c1ff0e2ce2c7054dc4..521c48c9abedb77afbe9435b675b6b04a17a966d 100644 (file)
@@ -39,6 +39,7 @@ class FGAirportDynamics;
 class FGRunway;
 class FGTaxiway;
 class FGPavement;
+class SGPropertyNode;
 
 typedef SGSharedPtr<FGRunway> FGRunwayPtr;
 typedef SGSharedPtr<FGTaxiway> FGTaxiwayPtr;
@@ -49,12 +50,6 @@ typedef SGSharedPtr<FGPavement> FGPavementPtr;
  **************************************************************************************/
 class FGAirport : public FGPositioned
 {
-private:
-    SGGeod _tower_location;
-    std::string _name;
-    bool _has_metar;
-    FGAirportDynamics *_dynamics;
-
 public:
     FGAirport(const std::string& id, const SGGeod& location, const SGGeod& tower, 
             const std::string& name, bool has_metar, Type aType);
@@ -118,7 +113,7 @@ public:
        }
        
        virtual Type maxType() const {
-         return SEAPORT;
+         return AIRPORT;
        }
        
        virtual bool passAirport(FGAirport* aApt) const {
@@ -126,6 +121,17 @@ public:
        }
      };
      
+     /**
+      * Filter which passes heliports and seaports in addition to airports
+      */
+     class PortsFilter : public AirportFilter
+     {
+     public:
+       virtual Type maxType() const {
+         return SEAPORT;
+       }
+     };
+     
      class HardSurfaceFilter : public AirportFilter
      {
      public:
@@ -133,9 +139,6 @@ public:
        
        virtual bool passAirport(FGAirport* aApt) const;
        
-       virtual Type maxType() const {
-         return AIRPORT;
-       }
      private:
        double mMinLengthFt;
      };
@@ -143,7 +146,7 @@ public:
      /**
       * Syntactic wrapper around FGPositioned::findClosest - find the closest
       * match for filter, and return it cast to FGAirport. The default filter
-      * passes all airports, including seaports and heliports.
+      * passes airports, but not seaports or heliports
       */
      static FGAirport* findClosest(const SGGeod& aPos, double aCuttofNm, Filter* filter = NULL);
      
@@ -173,8 +176,36 @@ private:
      */
     Runway_iterator getIteratorForRunwayIdent(const std::string& aIdent) const;
 
+    // disable these
     FGAirport operator=(FGAirport &other);
     FGAirport(const FGAirport&);
+  
+    /**
+     * helper to read airport data from the scenery XML files.
+     */
+    void loadSceneryDefintions() const;
+    
+    /**
+     * Helpers to process property data loaded from an ICAO.threshold.xml file
+     */
+    void readThresholdData(SGPropertyNode* aRoot);
+    void processThreshold(SGPropertyNode* aThreshold);
+    
+    /**
+     * Helper to parse property data loaded from an ICAO.twr.xml filke
+     */
+    void readTowerData(SGPropertyNode* aRoot);
+    
+    SGGeod _tower_location;
+    std::string _name;
+    bool _has_metar;
+    FGAirportDynamics *_dynamics;
+
+    void loadRunways() const;
+    void loadTaxiways() const;
+    
+    mutable bool mRunwaysLoaded;
+    mutable bool mTaxiwaysLoaded;
     
     std::vector<FGRunwayPtr> mRunways;
     std::vector<FGTaxiwayPtr> mTaxiways;