]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.hxx
Merge branch 'ehofman/sky'
[flightgear.git] / src / Airports / simple.hxx
index dc4d7c319a3e60891003b3d16cb20ef542b0b850..93c76fbe1d63a6377083abeb7103fad404cb42b2 100644 (file)
 #include <string>
 #include <vector>
 
-#include "Navaids/positioned.hxx"
+#include <Navaids/positioned.hxx>
 
 // forward decls
 class FGAirportDynamics;
 class FGRunway;
 class FGTaxiway;
+class FGPavement;
+class SGPropertyNode;
 
 typedef SGSharedPtr<FGRunway> FGRunwayPtr;
 typedef SGSharedPtr<FGTaxiway> FGTaxiwayPtr;
+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);
@@ -93,12 +90,16 @@ public:
      * aiport has a hard-surfaced runway of at least the specified length.
      */
     bool hasHardRunwayOfLengthFt(double aLengthFt) const;
-    
+
     unsigned int numTaxiways() const;
     FGTaxiway* getTaxiwayByIndex(unsigned int aIndex) const;
-    
+
+    unsigned int numPavements() const;
+    FGPavement* getPavementByIndex(unsigned int aIndex) const;
+
     void setRunwaysAndTaxiways(std::vector<FGRunwayPtr>& rwys,
-      std::vector<FGTaxiwayPtr>& txwys);
+      std::vector<FGTaxiwayPtr>& txwys,
+      std::vector<FGPavementPtr>& pvts);
     
     class AirportFilter : public Filter
      {
@@ -167,11 +168,40 @@ 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;
+    std::vector<FGPavementPtr> mPavements;
 };
 
 // find basic airport location info from airport database