]> git.mxchange.org Git - flightgear.git/blobdiff - src/Airports/simple.cxx
testair.cxx is a 21 lines long, obsolete test application. After removing
[flightgear.git] / src / Airports / simple.cxx
index 0907030fbd0a304bdbf0f4ec5984e743425f33c5..6a1334cc10f40f53c30f4e31f01655f436a4446c 100644 (file)
@@ -92,6 +92,9 @@ FGAirportDynamics * FGAirport::getDynamics()
         FGRunwayPreference rwyPrefs(this);
         XMLLoader::load(&rwyPrefs);
         _dynamics->setRwyUse(rwyPrefs);
+
+        //FGSidStar SIDs(this);
+        XMLLoader::load(_dynamics->getSIDs());
    }
     return _dynamics;
 }
@@ -192,21 +195,22 @@ unsigned int FGAirport::numTaxiways() const
   return mTaxiways.size();
 }
 
-FGRunway* FGAirport::getTaxiwayByIndex(unsigned int aIndex) const
+FGTaxiway* FGAirport::getTaxiwayByIndex(unsigned int aIndex) const
 {
   assert(aIndex >= 0 && aIndex < mTaxiways.size());
   return mTaxiways[aIndex];
 }
 
-void FGAirport::addRunway(FGRunway* aRunway)
+void FGAirport::setRunwaysAndTaxiways(vector<FGRunwayPtr>& rwys,
+       vector<FGTaxiwayPtr>& txwys)
 {
-  aRunway->setAirport(this);
-  
-  if (aRunway->isTaxiway()) {
-    mTaxiways.push_back(aRunway);
-  } else {
-    mRunways.push_back(aRunway);
+  mRunways.swap(rwys);
+  Runway_iterator it = mRunways.begin();
+  for (; it != mRunways.end(); ++it) {
+    (*it)->setAirport(this);
   }
+  
+  mTaxiways.swap(txwys);
 }
 
 FGRunway* FGAirport::getActiveRunwayForUsage() const
@@ -248,13 +252,9 @@ FGAirport::HardSurfaceFilter::HardSurfaceFilter(double minLengthFt) :
 {
 }
       
-bool FGAirport::HardSurfaceFilter::pass(FGPositioned* aPos) const
+bool FGAirport::HardSurfaceFilter::passAirport(FGAirport* aApt) const
 {
-  if (aPos->type() != AIRPORT) {
-    return false; // exclude seaports and heliports as well, we need a runways
-  }
-   
-  return static_cast<FGAirport*>(aPos)->hasHardRunwayOfLengthFt(mMinLengthFt);
+  return aApt->hasHardRunwayOfLengthFt(mMinLengthFt);
 }
 
 FGAirport* FGAirport::findByIdent(const std::string& aIdent)
@@ -313,7 +313,7 @@ double fgGetAirportElev( const string& id )
 
 
 // get airport position
-Point3D fgGetAirportPos( const string& id )
+SGGeod fgGetAirportPos( const string& id )
 {
     SG_LOG( SG_ATC, SG_BULK,
             "Finding position for airport: " << id );
@@ -321,8 +321,8 @@ Point3D fgGetAirportPos( const string& id )
     const FGAirport *a = fgFindAirportID( id);
 
     if (a) {
-        return Point3D(a->getLongitude(), a->getLatitude(), a->getElevation());
+        return SGGeod::fromDegM(a->getLongitude(), a->getLatitude(), a->getElevation());
     } else {
-        return Point3D(0.0, 0.0, -9999.0);
+        return SGGeod::fromDegM(0.0, 0.0, -9999.0);
     }
 }