]> git.mxchange.org Git - flightgear.git/blob - src/Airports/runways.hxx
Document that property write-protection is not a security measure
[flightgear.git] / src / Airports / runways.hxx
1 // runways.hxx -- a simple class to manage airport runway info
2 //
3 // Written by Curtis Olson, started August 2000.
4 //
5 // Copyright (C) 2000  Curtis L. Olson  - http://www.flightgear.org/~curt
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22
23
24 #ifndef _FG_RUNWAYS_HXX
25 #define _FG_RUNWAYS_HXX
26
27 #include <simgear/compiler.h>
28
29 #include <Navaids/procedure.hxx>
30 #include "runwaybase.hxx"
31 #include "airports_fwd.hxx"
32
33 class FGRunway : public FGRunwayBase
34 {
35   PositionedID _airport;
36   PositionedID _reciprocal;
37   double _displ_thresh;
38   double _stopway;
39   PositionedID _ils;
40 public:
41   
42   FGRunway(PositionedID aGuid,
43            PositionedID aAirport, const std::string& rwy_no,
44             const SGGeod& aGeod,
45             const double heading, const double length,
46             const double width,
47             const double displ_thresh,
48             const double stopway,
49             const int surface_code);
50   
51   /**
52    * given a runway identifier (06, 18L, 31R) compute the identifier for the
53    * reciprocal heading runway (24, 36R, 13L) string.
54    */
55   static std::string reverseIdent(const std::string& aRunayIdent);
56     
57   /**
58    * score this runway according to the specified weights. Used by
59    * FGAirport::findBestRunwayForHeading
60    */
61   double score(double aLengthWt, double aWidthWt, double aSurfaceWt, double aIlsWt) const;
62
63   /**
64    * Get the runway beginning point - this is syntatic sugar, equivalent to
65    * calling pointOnCenterline(0.0);
66    */
67   SGGeod begin() const;
68   
69   /**
70    * Get the (possibly displaced) threshold point.
71    */
72   SGGeod threshold() const;
73   
74   /**
75    * Get the 'far' end - this is equivalent to calling
76    * pointOnCenterline(lengthFt());
77    */
78   SGGeod end() const;
79   
80   double displacedThresholdM() const
81   { return _displ_thresh; }
82   
83   double stopwayM() const
84   { return _stopway; }
85   
86   /**
87    * Airport this runway is located at
88    */
89   FGAirport* airport() const;
90   
91   FGNavRecord* ILS() const;
92   
93   /**
94    * retrieve the associated glideslope transmitter, if one is defined.
95    */
96   FGNavRecord* glideslope() const;
97   
98   void setILS(PositionedID nav) { _ils = nav; }
99   
100   FGRunway* reciprocalRunway() const;
101   
102   void setReciprocalRunway(PositionedID other);
103   
104   /**
105    * Get SIDs (DPs) associated with this runway
106    */
107   flightgear::SIDList getSIDs() const;
108   
109   /**
110    * Get STARs associared with this runway
111    */ 
112   flightgear::STARList getSTARs() const;
113   
114   
115   flightgear::ApproachList getApproaches
116   (
117     flightgear::ProcedureType type = flightgear::PROCEDURE_INVALID
118   ) const;
119   
120   void updateThreshold(const SGGeod& newThreshold,
121                        double newHeading,
122                        double newDisplacedThreshold,
123                        double newStopway);
124 };
125
126 class FGHelipad : public FGRunwayBase
127 {
128 public:
129     FGHelipad(PositionedID aGuid,
130            PositionedID aAirport, const std::string& rwy_no,
131             const SGGeod& aGeod,
132             const double heading, const double length,
133             const double width,
134             const int surface_code);
135 };
136
137
138 #endif // _FG_RUNWAYS_HXX