]> git.mxchange.org Git - flightgear.git/blob - src/Airports/runways.hxx
Remove isReciprocal from FGRunway.
[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 <Airports/runwaybase.hxx>
30
31 // forward decls
32 class FGAirport;
33 class FGNavRecord;
34 class SGPropertyNode;
35
36 namespace flightgear {
37   class SID;
38   class STAR;
39   class Approach;
40 }
41
42 class FGRunway : public FGRunwayBase
43 {
44   PositionedID _airport;
45   PositionedID _reciprocal;
46   double _displ_thresh;
47   double _stopway;
48   PositionedID _ils;
49 public:
50   
51   FGRunway(PositionedID aGuid,
52            PositionedID aAirport, const std::string& rwy_no,
53             const SGGeod& aGeod,
54             const double heading, const double length,
55             const double width,
56             const double displ_thresh,
57             const double stopway,
58             const int surface_code);
59   
60   /**
61    * given a runway identifier (06, 18L, 31R) compute the identifier for the
62    * reciprocal heading runway (24, 36R, 13L) string.
63    */
64   static std::string reverseIdent(const std::string& aRunayIdent);
65     
66   /**
67    * score this runway according to the specified weights. Used by
68    * FGAirport::findBestRunwayForHeading
69    */
70   double score(double aLengthWt, double aWidthWt, double aSurfaceWt) const;
71
72   /**
73    * Get the runway beginning point - this is syntatic sugar, equivalent to
74    * calling pointOnCenterline(0.0);
75    */
76   SGGeod begin() const;
77   
78   /**
79    * Get the (possibly displaced) threshold point.
80    */
81   SGGeod threshold() const;
82   
83   /**
84    * Get the 'far' end - this is equivalent to calling
85    * pointOnCenterline(lengthFt());
86    */
87   SGGeod end() const;
88   
89   double displacedThresholdM() const
90   { return _displ_thresh; }
91   
92   double stopwayM() const
93   { return _stopway; }
94   
95   /**
96    * Airport this runway is located at
97    */
98   FGAirport* airport() const;
99   
100   FGNavRecord* ILS() const;
101   
102   /**
103    * retrieve the associated glideslope transmitter, if one is defined.
104    */
105   FGNavRecord* glideslope() const;
106   
107   void setILS(PositionedID nav) { _ils = nav; }
108   
109   FGRunway* reciprocalRunway() const;
110   
111   void setReciprocalRunway(PositionedID other);
112   
113   /**
114    * Get SIDs (DPs) associated with this runway
115    */
116   std::vector<flightgear::SID*> getSIDs() const;
117   
118   /**
119    * Get STARs associared with this runway
120    */ 
121   std::vector<flightgear::STAR*> getSTARs() const;
122   
123   
124   std::vector<flightgear::Approach*> getApproaches() const;
125   
126 };
127
128 class FGHelipad : public FGRunwayBase
129 {
130 public:
131     FGHelipad(PositionedID aGuid,
132            PositionedID aAirport, const std::string& rwy_no,
133             const SGGeod& aGeod,
134             const double heading, const double length,
135             const double width,
136             const int surface_code);
137 };
138
139
140 #endif // _FG_RUNWAYS_HXX