]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.hxx
testair.cxx is a 21 lines long, obsolete test application. After removing
[flightgear.git] / src / Airports / simple.hxx
index 6d95bcf87626a1fadbca11c60873fc3145580e00..dc4d7c319a3e60891003b3d16cb20ef542b0b850 100644 (file)
 // forward decls
 class FGAirportDynamics;
 class FGRunway;
+class FGTaxiway;
 
 typedef SGSharedPtr<FGRunway> FGRunwayPtr;
+typedef SGSharedPtr<FGTaxiway> FGTaxiwayPtr;
 
 /***************************************************************************************
  *
@@ -93,25 +95,41 @@ public:
     bool hasHardRunwayOfLengthFt(double aLengthFt) const;
     
     unsigned int numTaxiways() const;
-    FGRunway* getTaxiwayByIndex(unsigned int aIndex) const;
+    FGTaxiway* getTaxiwayByIndex(unsigned int aIndex) const;
     
-    void addRunway(FGRunway* aRunway);
+    void setRunwaysAndTaxiways(std::vector<FGRunwayPtr>& rwys,
+      std::vector<FGTaxiwayPtr>& txwys);
     
     class AirportFilter : public Filter
      {
      public:
        virtual bool pass(FGPositioned* aPos) const { 
-         Type ty(aPos->type());
-         return (ty >= AIRPORT) && (ty <= SEAPORT);
+         return passAirport(static_cast<FGAirport*>(aPos));
+       }
+       
+       virtual Type minType() const {
+         return AIRPORT;
+       }
+       
+       virtual Type maxType() const {
+         return SEAPORT;
+       }
+       
+       virtual bool passAirport(FGAirport* aApt) const {
+         return true;
        }
      };
      
-     class HardSurfaceFilter : public Filter
+     class HardSurfaceFilter : public AirportFilter
      {
      public:
        HardSurfaceFilter(double minLengthFt);
        
-       virtual bool pass(FGPositioned* aPos) const;
+       virtual bool passAirport(FGAirport* aApt) const;
+       
+       virtual Type maxType() const {
+         return AIRPORT;
+       }
      private:
        double mMinLengthFt;
      };
@@ -153,41 +171,7 @@ private:
     FGAirport(const FGAirport&);
     
     std::vector<FGRunwayPtr> mRunways;
-    std::vector<FGRunwayPtr> mTaxiways;
-};
-
-typedef std::vector < FGAirport * > airport_list;
-typedef airport_list::iterator airport_list_iterator;
-typedef airport_list::const_iterator const_airport_list_iterator;
-
-
-
-class FGAirportList {
-private:
-
-    airport_list airports_array;
-
-public:
-    // Constructor (new)
-    FGAirportList();
-
-    // Destructor
-    ~FGAirportList();
-
-    // add an entry to the list
-    FGAirport* add( const std::string& id, const SGGeod& location, const SGGeod& tower,
-              const std::string& name, bool has_metar, FGPositioned::Type aType);
-
-    /**
-     * Return the number of airports in the list.
-     */
-    int size() const;
-
-    /**
-     * Return a specific airport, by position.
-     */
-    const FGAirport *getAirport( unsigned int index ) const;
-
+    std::vector<FGTaxiwayPtr> mTaxiways;
 };
 
 // find basic airport location info from airport database