1 // runwaybase.cxx -- a base class for runways and taxiways
3 // Written by James Turner, started December 2008.
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.
28 #include <simgear/compiler.h>
29 #include <simgear/props/props.hxx>
31 #include "runwaybase.hxx"
43 * 7 - concrete helipad
49 FGRunwayBase::FGRunwayBase(PositionedID aGuid, Type aTy, const string& aIdent,
51 const double heading, const double length,
53 const int surface_code) :
54 FGPositioned(aGuid, aTy, aIdent, aGeod)
59 _surface_code = surface_code;
62 SGGeod FGRunwayBase::pointOnCenterline(double aOffset) const
64 SGGeod result = SGGeodesy::direct(mPosition, _heading, aOffset);
65 result.setElevationM(mPosition.getElevationM());
70 SGGeod FGRunwayBase::pointOffCenterline(double aOffset, double lateralOffset) const
76 SGGeodesy::direct(mPosition, _heading,
77 aOffset, temp, dummyAz2);
79 SGGeodesy::direct(temp, SGMiscd::normalizePeriodic(0, 360,_heading+90.0),
87 bool FGRunwayBase::isHardSurface() const
89 return ((_surface_code == 1) || (_surface_code == 2));
92 FGTaxiway::FGTaxiway(PositionedID aGuid,
95 const double heading, const double length,
97 const int surface_code) :
98 FGRunwayBase(aGuid, TAXIWAY, aIdent, aGeod, heading, length, width, surface_code)