FlightGear next
runways.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: a simple class to manage airport runway info
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#pragma once
8
9#include <simgear/compiler.h>
10
11#include "runwaybase.hxx"
12#include <Navaids/procedure.hxx>
13
14class FGRunway : public FGRunwayBase
15{
16 PositionedID _reciprocal;
17 double _displ_thresh;
18 double _stopway;
19 PositionedID _ils;
20public:
21 static bool isType(FGPositioned::Type ty)
22 { return (ty == FGPositioned::RUNWAY); }
23
25 PositionedID aAirport, const std::string& rwy_no,
26 const SGGeod& aGeod,
27 const double heading, const double length,
28 const double width,
29 const double displ_thresh,
30 const double stopway,
31 const int surface_code);
32
37 static std::string reverseIdent(const std::string& aRunayIdent);
38
43 double score(double aLengthWt, double aWidthWt, double aSurfaceWt, double aIlsWt) const;
44
49 SGGeod begin() const;
50
54 SGGeod threshold() const;
55
61 SGGeod pointOnCenterlineDisplaced(double aOffset) const;
62
67 SGGeod end() const;
68
69 double displacedThresholdM() const
70 { return _displ_thresh; }
71
72 double stopwayM() const
73 { return _stopway; }
74
75
76 FGNavRecord* ILS() const;
77
81 FGNavRecord* glideslope() const;
82
83 void setILS(PositionedID nav) { _ils = nav; }
84
86
88
93
98
99
101 (
103 ) const;
104
105 void updateThreshold(const SGGeod& newThreshold,
106 double newHeading,
107 double newDisplacedThreshold,
108 double newStopway);
109};
110
112{
113public:
115 { return (ty == FGPositioned::HELIPAD); }
116
118 PositionedID aAirport, const std::string& rwy_no,
119 const SGGeod& aGeod,
120 const double heading, const double length,
121 const double width,
122 const int surface_code);
123};
FGHelipad(PositionedID aGuid, PositionedID aAirport, const std::string &rwy_no, const SGGeod &aGeod, const double heading, const double length, const double width, const int surface_code)
Definition runways.cxx:193
static bool isType(FGPositioned::Type ty)
Definition runways.hxx:114
Type type() const
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)
FGNavRecord * glideslope() const
retrieve the associated glideslope transmitter, if one is defined.
Definition runways.cxx:129
static std::string reverseIdent(const std::string &aRunayIdent)
given a runway identifier (06, 18L, 31R) compute the identifier for the reciprocal heading runway (24...
Definition runways.cxx:41
SGGeod pointOnCenterlineDisplaced(double aOffset) const
Retrieve a position on the extended centerline.
Definition runways.cxx:104
static bool isType(FGPositioned::Type ty)
Definition runways.hxx:21
flightgear::STARList getSTARs() const
Get STARs associared with this runway.
Definition runways.cxx:154
SGGeod end() const
Get the 'far' end - this is equivalent to calling pointOnCenterline(lengthFt());.
Definition runways.cxx:94
SGGeod threshold() const
Get the (possibly displaced) threshold point.
Definition runways.cxx:99
void setReciprocalRunway(PositionedID other)
Definition runways.cxx:109
FGNavRecord * ILS() const
Definition runways.cxx:120
void setILS(PositionedID nav)
Definition runways.hxx:83
double score(double aLengthWt, double aWidthWt, double aSurfaceWt, double aIlsWt) const
score this runway according to the specified weights.
Definition runways.cxx:76
void updateThreshold(const SGGeod &newThreshold, double newHeading, double newDisplacedThreshold, double newStopway)
Definition runways.cxx:183
FGRunway * reciprocalRunway() const
Definition runways.cxx:115
flightgear::SIDList getSIDs() const
Get SIDs (DPs) associated with this runway.
Definition runways.cxx:140
SGGeod begin() const
Get the runway beginning point - this is syntatic sugar, equivalent to calling pointOnCenterline(0....
Definition runways.cxx:89
double stopwayM() const
Definition runways.hxx:72
flightgear::ApproachList getApproaches(flightgear::ProcedureType type=flightgear::PROCEDURE_INVALID) const
Definition runways.cxx:169
double displacedThresholdM() const
Definition runways.hxx:69
FGRunway(PositionedID aGuid, PositionedID aAirport, const std::string &rwy_no, const SGGeod &aGeod, const double heading, const double length, const double width, const double displ_thresh, const double stopway, const int surface_code)
Definition runways.cxx:25
std::vector< Approach * > ApproachList
std::vector< STAR * > STARList
std::vector< flightgear::SID * > SIDList
@ PROCEDURE_INVALID
Definition procedure.hxx:37
int64_t PositionedID