2 // simple.hxx -- a really simplistic class to manage airport ID,
3 // lat, lon of the center of one of it's runways, and
6 // Written by Curtis Olson, started April 1998.
8 // Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
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.
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.
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.
25 // (Log is kept at end of this file)
33 # error This library requires C++
37 #include <Include/compiler.h>
38 #ifdef FG_HAVE_STD_INCLUDES
49 FG_USING_STD(istream);
54 fgAIRPORT( const string& name = "",
58 : id(name), longitude(lon), latitude(lat), elevation(ele) {}
60 bool operator < ( const fgAIRPORT& a ) const {
72 operator >> ( istream& in, fgAIRPORT& a )
74 return in >> a.id >> a.longitude >> a.latitude >> a.elevation;
79 #ifdef FG_NO_DEFAULT_TEMPLATE_ARGS
80 typedef set< fgAIRPORT, less< fgAIRPORT > > container;
82 typedef set< fgAIRPORT > container;
84 typedef container::iterator iterator;
85 typedef container::const_iterator const_iterator;
99 int load( const string& file );
101 // search for the specified id.
102 // Returns true if successful, otherwise returns false.
103 // On success, airport data is returned thru "airport" pointer.
104 // "airport" is not changed if "id" is not found.
105 bool search( const string& id, fgAIRPORT* airport ) const;
106 fgAIRPORT search( const string& id ) const;
110 #endif /* _AIRPORTS_HXX */
114 // Revision 1.8 1999/03/15 17:58:57 curt
115 // MSVC++ portability tweaks contributed by Bernie Bright.
116 // Added using std::istream declaration.
118 // Revision 1.7 1999/03/02 01:02:33 curt
119 // Tweaks for building with native SGI compilers.
121 // Revision 1.6 1999/02/26 22:08:36 curt
122 // Added initial support for native SGI compilers.
124 // Revision 1.5 1998/11/02 18:25:34 curt
125 // Check for __CYGWIN__ (b20) as well as __CYGWIN32__ (pre b20 compilers)
126 // Other misc. tweaks.
128 // Revision 1.4 1998/09/08 21:38:43 curt
129 // Changes by Bernie Bright.
131 // Revision 1.3 1998/09/01 19:02:54 curt
132 // Changes contributed by Bernie Bright <bbright@c031.aone.net.au>
133 // - The new classes in libmisc.tgz define a stream interface into zlib.
134 // I've put these in a new directory, Lib/Misc. Feel free to rename it
135 // to something more appropriate. However you'll have to change the
136 // include directives in all the other files. Additionally you'll have
137 // add the library to Lib/Makefile.am and Simulator/Main/Makefile.am.
139 // The StopWatch class in Lib/Misc requires a HAVE_GETRUSAGE autoconf
140 // test so I've included the required changes in config.tgz.
142 // There are a fair few changes to Simulator/Objects as I've moved
143 // things around. Loading tiles is quicker but thats not where the delay
144 // is. Tile loading takes a few tenths of a second per file on a P200
145 // but it seems to be the post-processing that leads to a noticeable
146 // blip in framerate. I suppose its time to start profiling to see where
149 // I've included a brief description of each archives contents.
154 // C++ stream interface into zlib.
155 // Taken from zlib-1.1.3/contrib/iostream/.
156 // Minor mods for STL compatibility.
157 // There's no copyright associated with these so I assume they're
158 // covered by zlib's.
162 // FlightGear input stream using gz_ifstream. Tries to open the
163 // given filename. If that fails then filename is examined and a
164 // ".gz" suffix is removed or appended and that file is opened.
167 // A simple timer for benchmarking. Not used in production code.
168 // Taken from the Blitz++ project. Covered by GPL.
172 // Some simple string manipulation routines.
174 // Simulator/Airports/
175 // Load airports database using fgstream.
176 // Changed fgAIRPORTS to use set<> instead of map<>.
177 // Added bool fgAIRPORTS::search() as a neater way doing the lookup.
178 // Returns true if found.
181 // Modified fgStarsInit() to load stars database using fgstream.
183 // Simulator/Objects/
184 // Modified fgObjLoad() to use fgstream.
185 // Modified fgMATERIAL_MGR::load_lib() to use fgstream.
186 // Many changes to fgMATERIAL.
187 // Some changes to fgFRAGMENT but I forget what!
189 // Revision 1.2 1998/08/27 17:01:56 curt
190 // Contributions from Bernie Bright <bbright@c031.aone.net.au>
191 // - use strings for fg_root and airport_id and added methods to return
193 // - inlined all access methods,
194 // - made the parsing functions private methods,
195 // - deleted some unused functions.
196 // - propogated some of these changes out a bit further.
198 // Revision 1.1 1998/08/25 17:19:14 curt
199 // Moved from ../Main/
201 // Revision 1.7 1998/07/24 21:39:09 curt
202 // Debugging output tweaks.
203 // Cast glGetString to (char *) to avoid compiler errors.
204 // Optimizations to fgGluLookAt() by Norman Vine.
206 // Revision 1.6 1998/07/06 21:34:19 curt
207 // Added an enable/disable splash screen option.
208 // Added an enable/disable intro music option.
209 // Added an enable/disable instrument panel option.
210 // Added an enable/disable mouse pointer option.
211 // Added using namespace std for compilers that support this.
213 // Revision 1.5 1998/06/17 21:35:11 curt
214 // Refined conditional audio support compilation.
215 // Moved texture parameter setup calls to ../Scenery/materials.cxx
216 // #include <string.h> before various STL includes.
217 // Make HUD default state be enabled.
219 // Revision 1.4 1998/06/03 00:47:14 curt
220 // Updated to compile in audio support if OSS available.
221 // Updated for new version of Steve's audio library.
222 // STL includes don't use .h
223 // Small view optimizations.
225 // Revision 1.3 1998/06/01 17:54:42 curt
226 // Added Linux audio support.
227 // avoid glClear( COLOR_BUFFER_BIT ) when not using it to set the sky color.
230 // Revision 1.2 1998/05/29 20:37:22 curt
231 // Tweaked material properties & lighting a bit in GLUTmain.cxx.
232 // Read airport list into a "map" STL for dynamic list sizing and fast tree
235 // Revision 1.1 1998/04/25 15:11:11 curt
236 // Added an command line option to set starting position based on airport ID.