1998-04-25 15:11:10 +00:00
|
|
|
//
|
|
|
|
// airports.hxx -- a really simplistic class to manage airport ID,
|
|
|
|
// lat, lon of the center of one of it's runways, and
|
|
|
|
// elevation in feet.
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started April 1998.
|
|
|
|
//
|
|
|
|
// Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
// (Log is kept at end of this file)
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _AIRPORTS_HXX
|
|
|
|
#define _AIRPORTS_HXX
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
# error This library requires C++
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1998-05-29 20:37:19 +00:00
|
|
|
#include <map.h> // STL associative "array"
|
|
|
|
|
|
|
|
#if defined(__CYGWIN32__)
|
|
|
|
# include <string> // Standard C++ string library
|
|
|
|
#elif defined(WIN32)
|
|
|
|
# include <string.h> // Standard C++ string library
|
|
|
|
#else
|
|
|
|
# include <std/string.h> // Standard C++ string library
|
|
|
|
#endif
|
1998-04-25 15:11:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
1998-05-29 20:37:19 +00:00
|
|
|
// char id[5];
|
1998-04-25 15:11:10 +00:00
|
|
|
double longitude, latitude, elevation;
|
|
|
|
} fgAIRPORT;
|
|
|
|
|
|
|
|
|
|
|
|
class fgAIRPORTS {
|
1998-05-29 20:37:19 +00:00
|
|
|
map < string, fgAIRPORT, less<string> > airports;
|
1998-04-25 15:11:10 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
fgAIRPORTS( void );
|
|
|
|
|
|
|
|
// load the data
|
|
|
|
int load( char *file );
|
|
|
|
|
|
|
|
// search for the specified id
|
|
|
|
fgAIRPORT search( char *id );
|
|
|
|
|
|
|
|
// Destructor
|
|
|
|
~fgAIRPORTS( void );
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _AIRPORTS_HXX */
|
|
|
|
|
|
|
|
|
|
|
|
// $Log$
|
1998-05-29 20:37:19 +00:00
|
|
|
// Revision 1.2 1998/05/29 20:37:22 curt
|
|
|
|
// Tweaked material properties & lighting a bit in GLUTmain.cxx.
|
|
|
|
// Read airport list into a "map" STL for dynamic list sizing and fast tree
|
|
|
|
// based lookups.
|
|
|
|
//
|
1998-04-25 15:11:10 +00:00
|
|
|
// Revision 1.1 1998/04/25 15:11:11 curt
|
|
|
|
// Added an command line option to set starting position based on airport ID.
|
|
|
|
//
|
|
|
|
//
|