]> git.mxchange.org Git - flightgear.git/blob - src/Airports/runways.hxx
Stefan C. Müller :
[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 <string>
30 #include <vector>
31
32 class FGRunway
33 {
34 public:
35   FGRunway();
36   
37   FGRunway(const std::string& rwy_no,
38             const double longitude, const double latitude,
39             const double heading, const double length,
40             const double width,
41             const double displ_thresh1, const double displ_thresh2,
42             const double stopway1, const double stopway2,
43             const int surface_code);
44   
45   /**
46    * given a runway identifier (06, 18L, 31R) compute the identifier for the
47    * opposite heading runway (24, 36R, 13L) string.
48    */
49   static std::string reverseIdent(const std::string& aRunayIdent);
50   
51   /**
52    * score this runway according to the specified weights. Used by
53    * FGAirport::findBestRunwayForHeading
54    */
55   double score(double aLengthWt, double aWidthWt, double aSurfaceWt) const;
56
57   bool isTaxiway() const;
58   
59     std::string _rwy_no;
60     std::string _type;                // runway / taxiway
61
62     double _lon;
63     double _lat;
64     double _heading;
65     double _length;
66     double _width;
67     double _displ_thresh1;
68     double _displ_thresh2;
69     double _stopway1;
70     double _stopway2;
71
72     int _surface_code;
73 };
74
75 typedef std::vector<FGRunway> FGRunwayVector;
76
77 #endif // _FG_RUNWAYS_HXX