FlightGear next
runwaybase.hxx
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
3 * SPDX_FileComment: represent a runway or taxiway
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#pragma once
8
9#include <simgear/compiler.h>
10
11#include <simgear/math/sg_geodesy.hxx>
12
15
16#include <string>
17
23{
24public:
25 FGRunwayBase(PositionedID aGuid, Type aTy, const std::string& aIdent,
26 const SGGeod& aGeod,
27 const double heading, const double length,
28 const double width,
29 const int surface_code,
30 const PositionedID airportId);
31
37 SGGeod pointOnCenterline(double aOffset) const;
38 SGGeod pointOffCenterline(double aOffset, double lateralOffset) const;
39
40 double lengthFt() const
41 {
42 return _length * SG_METER_TO_FEET; }
43
44 double lengthM() const
45 { return _length; }
46
47 double widthFt() const
48 { return _width * SG_METER_TO_FEET; }
49
50 double widthM() const
51 { return _width; }
52
56 double headingDeg() const
57 { return _heading; }
58
63 bool isHardSurface() const;
64
68 int surface() const
69 { return _surface_code; }
70
74 static const char * surfaceName( int surface_code );
75 const char * surfaceName() { return surfaceName( _surface_code ); }
76
77 FGAirportRef airport() const;
78
79 protected:
80
81 double _heading;
82 double _length;
83 double _width;
84
89
91};
92
93// for the moment, taxiways are simply a concrete RunwayBase
94class FGTaxiway : public FGRunwayBase
95{
96public:
98 const std::string& aIdent,
99 const SGGeod& aGeod,
100 const double heading, const double length,
101 const double width,
102 const int surface_code,
103 const PositionedID airportId);
104};
SGSharedPtr< FGAirport > FGAirportRef
FGPositioned(PositionedID aGuid, Type ty, const std::string &aIdent, const SGGeod &aPos)
double headingDeg() const
Runway heading in degrees.
bool isHardSurface() const
Predicate to test if this runway has a hard surface.
double lengthFt() const
PositionedID mAirport
SGGeod pointOnCenterline(double aOffset) const
Retrieve a position on the extended centerline.
int surface() const
Retrieve runway surface code, as define in Robin Peel's data.
FGRunwayBase(PositionedID aGuid, Type aTy, const std::string &aIdent, const SGGeod &aGeod, const double heading, const double length, const double width, const int surface_code, const PositionedID airportId)
SGGeod pointOffCenterline(double aOffset, double lateralOffset) const
int _surface_code
surface, as defined by: http://www.x-plane.org/home/robinp/Apt810.htm#RwySfcCodes
double widthFt() const
double widthM() const
double lengthM() const
double _heading
FGAirportRef airport() const
const char * surfaceName()
FGTaxiway(PositionedID aGuid, const std::string &aIdent, const SGGeod &aGeod, const double heading, const double length, const double width, const int surface_code, const PositionedID airportId)
int64_t PositionedID