]> git.mxchange.org Git - flightgear.git/blob - Airports/simple.hxx
Contributions from Bernie Bright <bbright@c031.aone.net.au>
[flightgear.git] / Airports / simple.hxx
1 //
2 // airports.hxx -- a really simplistic class to manage airport ID,
3 //                 lat, lon of the center of one of it's runways, and 
4 //                 elevation in feet.
5 //
6 // Written by Curtis Olson, started April 1998.
7 //
8 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
9 //
10 // This program is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU General Public License as
12 // published by the Free Software Foundation; either version 2 of the
13 // License, or (at your option) any later version.
14 //
15 // This program is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 // General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the Free Software
22 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 //
24 // $Id$
25 // (Log is kept at end of this file)
26
27
28 #ifndef _AIRPORTS_HXX
29 #define _AIRPORTS_HXX
30
31
32 #ifndef __cplusplus                                                          
33 # error This library requires C++
34 #endif                                   
35
36
37 #include <string>        // Standard C++ string library
38 #include <map>           // STL associative "array"
39
40 #ifdef NEEDNAMESPACESTD
41 using namespace std;
42 #endif
43
44
45 typedef struct {
46     // char id[5];
47     double longitude;
48     double latitude;
49     double elevation;
50 } fgAIRPORT;
51
52
53 class fgAIRPORTS {
54     map < string, fgAIRPORT, less<string> > airports;
55
56 public:
57
58     // Constructor
59     fgAIRPORTS( void );
60
61     // load the data
62     int load( const string& file );
63
64     // search for the specified id
65     fgAIRPORT search( char *id );
66
67     // Destructor
68     ~fgAIRPORTS( void );
69
70 };
71
72
73 #endif /* _AIRPORTS_HXX */
74
75
76 // $Log$
77 // Revision 1.2  1998/08/27 17:01:56  curt
78 // Contributions from Bernie Bright <bbright@c031.aone.net.au>
79 // - use strings for fg_root and airport_id and added methods to return
80 //   them as strings,
81 // - inlined all access methods,
82 // - made the parsing functions private methods,
83 // - deleted some unused functions.
84 // - propogated some of these changes out a bit further.
85 //
86 // Revision 1.1  1998/08/25 17:19:14  curt
87 // Moved from ../Main/
88 //
89 // Revision 1.7  1998/07/24 21:39:09  curt
90 // Debugging output tweaks.
91 // Cast glGetString to (char *) to avoid compiler errors.
92 // Optimizations to fgGluLookAt() by Norman Vine.
93 //
94 // Revision 1.6  1998/07/06 21:34:19  curt
95 // Added an enable/disable splash screen option.
96 // Added an enable/disable intro music option.
97 // Added an enable/disable instrument panel option.
98 // Added an enable/disable mouse pointer option.
99 // Added using namespace std for compilers that support this.
100 //
101 // Revision 1.5  1998/06/17 21:35:11  curt
102 // Refined conditional audio support compilation.
103 // Moved texture parameter setup calls to ../Scenery/materials.cxx
104 // #include <string.h> before various STL includes.
105 // Make HUD default state be enabled.
106 //
107 // Revision 1.4  1998/06/03 00:47:14  curt
108 // Updated to compile in audio support if OSS available.
109 // Updated for new version of Steve's audio library.
110 // STL includes don't use .h
111 // Small view optimizations.
112 //
113 // Revision 1.3  1998/06/01 17:54:42  curt
114 // Added Linux audio support.
115 // avoid glClear( COLOR_BUFFER_BIT ) when not using it to set the sky color.
116 // map stl tweaks.
117 //
118 // Revision 1.2  1998/05/29 20:37:22  curt
119 // Tweaked material properties & lighting a bit in GLUTmain.cxx.
120 // Read airport list into a "map" STL for dynamic list sizing and fast tree
121 // based lookups.
122 //
123 // Revision 1.1  1998/04/25 15:11:11  curt
124 // Added an command line option to set starting position based on airport ID.
125 //
126 //