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;
55 SGGeod pointOffCenterline(double aOffset, double lateralOffset) const;
57 double lengthFt() const
60 double lengthM() const
61 { return _length * SG_FEET_TO_METER; }
63 double widthFt() const
67 { return _width * SG_FEET_TO_METER; }
70 * Runway heading in degrees.
72 double headingDeg() const
76 * Predicate to test if this runway has a hard surface. For the moment, this
77 * means concrete or asphalt
79 bool isHardSurface() const;
82 * Retrieve runway surface code, as define in Robin Peel's data
85 { return _surface_code; }
93 /** surface, as defined by:
94 * http://www.x-plane.org/home/robinp/Apt810.htm#RwySfcCodes
99 // for the moment, taxiways are simply a concrete RunwayBase
100 class FGTaxiway : public FGRunwayBase
103 FGTaxiway(const std::string& aIdent,
105 const double heading, const double length,
107 const int surface_code);
110 #endif // _FG_RUNWAY_BASE_HXX