1 // runwaybase.hxx -- represent a runway or taxiway
3 // Written by James Turner, started December 2000.
5 // Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef _FG_RUNWAY_BASE_HXX
25 #define _FG_RUNWAY_BASE_HXX
27 #include <simgear/compiler.h>
29 #include <simgear/math/sg_geodesy.hxx>
31 #include <Navaids/positioned.hxx>
36 * @class The base class for runways and taxiways. At present, FGTaxiway is
37 * a direct instantiation of this class.
39 class FGRunwayBase : public FGPositioned
42 FGRunwayBase(Type aTy, const std::string& aIdent,
44 const double heading, const double length,
46 const int surface_code,
50 * Retrieve a position on the extended centerline. Positive values
51 * are in the direction of the runway heading, negative values are in the
52 * opposited direction. 0.0 corresponds to the (non-displaced) threshold
54 SGGeod pointOnCenterline(double aOffset) const;
56 double lengthFt() const
59 double lengthM() const
60 { return _length * SG_FEET_TO_METER; }
62 double widthFt() const
66 { return _width * SG_FEET_TO_METER; }
69 * Runway heading in degrees.
71 double headingDeg() const
75 * Predicate to test if this runway has a hard surface. For the moment, this
76 * means concrete or asphalt
78 bool isHardSurface() const;
81 * Retrieve runway surface code, as define in Robin Peel's data
84 { return _surface_code; }
91 /** surface, as defined by:
92 * http://www.x-plane.org/home/robinp/Apt810.htm#RwySfcCodes
97 // for the moment, taxiways are simply a concrete RunwayBase
98 class FGTaxiway : public FGRunwayBase
101 FGTaxiway(const std::string& aIdent,
103 const double heading, const double length,
105 const int surface_code);
108 #endif // _FG_RUNWAY_BASE_HXX