-class AirportInfoFilter : public FGAirport::AirportFilter
-{
-public:
- AirportInfoFilter() : type(FGPositioned::AIRPORT) {
- minRunwayLengthFt = fgGetDouble("/sim/navdb/min-runway-length-ft", 0.0);
- }
-
- bool fromArg(naRef arg)
- {
- const char *s = naStr_data(arg);
- if(!strcmp(s, "airport")) type = FGPositioned::AIRPORT;
- else if(!strcmp(s, "seaport")) type = FGPositioned::SEAPORT;
- else if(!strcmp(s, "heliport")) type = FGPositioned::HELIPORT;
- else
- return false;
-
- return true;
- }
-
- virtual FGPositioned::Type minType() const {
- return type;
- }
-
- virtual FGPositioned::Type maxType() const {
- return type;
- }
-
- virtual bool pass(FGPositioned* aPos) const
- {
- FGAirport* apt = (FGAirport*) aPos;
- if ((apt->type() == FGPositioned::AIRPORT) &&
- !apt->hasHardRunwayOfLengthFt(minRunwayLengthFt))
- {
- return false;
- }
-
- return true;
- }
-
- FGPositioned::Type type;
- double minRunwayLengthFt;
-};
-