class FGPavement;
class SGPropertyNode;
-typedef SGSharedPtr<FGRunway> FGRunwayPtr;
-typedef SGSharedPtr<FGTaxiway> FGTaxiwayPtr;
-typedef SGSharedPtr<FGPavement> FGPavementPtr;
-
namespace flightgear {
class SID;
class STAR;
class Approach;
class Waypt;
-
+ class CommStation;
typedef SGSharedPtr<Waypt> WayptRef;
typedef std::vector<WayptRef> WayptVec;
+
+ typedef std::vector<CommStation*> CommStationList;
}
class FGAirport : public FGPositioned
{
public:
- FGAirport(const std::string& id, const SGGeod& location, const SGGeod& tower,
+ FGAirport(PositionedID aGuid, const std::string& id, const SGGeod& location,
const std::string& name, bool has_metar, Type aType);
~FGAirport();
bool isSeaport() const;
bool isHeliport() const;
+ static bool isAirportType(FGPositioned* pos);
+
virtual const std::string& name() const
{ return _name; }
- const SGGeod& getTowerLocation() const { return _tower_location; }
+ /**
+ * 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();
+
+ SGGeod getTowerLocation() const;
void setMetar(bool value) { _has_metar = value; }
unsigned int numPavements() const;
FGPavement* getPavementByIndex(unsigned int aIndex) const;
-
- void setRunwaysAndTaxiways(std::vector<FGRunwayPtr>& rwys,
- std::vector<FGTaxiwayPtr>& txwys,
- std::vector<FGPavementPtr>& pvts);
class AirportFilter : public Filter
{
class HardSurfaceFilter : public AirportFilter
{
public:
- HardSurfaceFilter(double minLengthFt);
+ HardSurfaceFilter(double minLengthFt = -1);
virtual bool passAirport(FGAirport* aApt) const;
unsigned int numApproaches() const;
flightgear::Approach* getApproachByIndex(unsigned int aIndex) const;
-
+ flightgear::Approach* findApproachWithIdent(const std::string& aIdent) const;
+
/**
* Syntactic wrapper around FGPositioned::findClosest - find the closest
* match for filter, and return it cast to FGAirport. The default filter
* matches in a format suitable for use by a puaList.
*/
static char** searchNamesAndIdents(const std::string& aFilter);
-
- bool buildApproach(flightgear::Waypt* aEnroute, flightgear::STAR* aSTAR,
- FGRunway* aRwy, flightgear::WayptVec& aRoute);
-
- /**
- * Given a destiation point, select the best SID and transition waypt from
- * this airport. Returns (NULL,NULL) is no SIDs are defined, otherwise the
- * best SID/transition is that which is closest to the destination point.
- */
- std::pair<flightgear::SID*, flightgear::WayptRef> selectSID(const SGGeod& aDest, FGRunway* aRwy);
-
- /**
- * Select a STAR and enroute transition waypt, given an origin (departure) position.
- * returns (NULL, NULL) is no suitable STAR is exists
- */
- std::pair<flightgear::STAR*, flightgear::WayptRef> selectSTAR(const SGGeod& aOrigin, FGRunway* aRwy);
+
+ flightgear::CommStationList commStationsOfType(FGPositioned::Type aTy) const;
+ flightgear::CommStationList commStations() const;
private:
- typedef std::vector<FGRunwayPtr>::const_iterator Runway_iterator;
- /**
- * Helper to locate a runway by ident
- */
- 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;
+ void loadSceneryDefinitions() const;
/**
* Helpers to process property data loaded from an ICAO.threshold.xml file
*/
void readThresholdData(SGPropertyNode* aRoot);
void processThreshold(SGPropertyNode* aThreshold);
+
+ void readILSData(SGPropertyNode* aRoot);
+
+ void validateTowerData() const;
/**
* 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 loadTaxiways() const;
void loadProcedures() const;
+ mutable bool mTowerDataLoaded;
mutable bool mRunwaysLoaded;
mutable bool mTaxiwaysLoaded;
mutable bool mProceduresLoaded;
-
- std::vector<FGRunwayPtr> mRunways;
- std::vector<FGTaxiwayPtr> mTaxiways;
- std::vector<FGPavementPtr> mPavements;
+ bool mILSDataLoaded;
+
+ mutable PositionedIDVec mRunways;
+ mutable PositionedIDVec mTaxiways;
+ PositionedIDVec mPavements;
std::vector<flightgear::SID*> mSIDs;
std::vector<flightgear::STAR*> mSTARs;
std::vector<flightgear::Approach*> mApproaches;
-};
+ };
// find basic airport location info from airport database
const FGAirport *fgFindAirportID( const std::string& id);