1
0
Fork 0
flightgear/Tools/Lib/Polygon/names.cxx

119 lines
3.4 KiB
C++
Raw Normal View History

1999-02-25 21:30:24 +00:00
// names.cxx -- process shapefiles names
//
// Written by Curtis Olson, started February 1999.
//
// Copyright (C) 1999 Curtis L. Olson - curt@flightgear.org
//
// 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$
#include <Include/compiler.h>
#include STL_STRING
#include "names.hxx"
// return area type from text name
AreaType get_area_type( string area ) {
1999-05-13 02:37:56 +00:00
if ( area == "SomeSort" ) {
return SomeSortOfArea;
} else if ( area == "AirportKeep" ) {
1999-02-25 21:30:24 +00:00
return AirportKeepArea;
} else if ( area == "AirportIgnore" ) {
return AirportIgnoreArea;
} else if ( (area == "Swamp or Marsh")
|| (area == "Marsh") ) {
1999-02-25 21:30:24 +00:00
return MarshArea;
1999-03-02 01:03:58 +00:00
} else if ( (area == "Bay Estuary or Ocean")
|| (area == "Ocean") ) {
1999-02-25 21:30:24 +00:00
return OceanArea;
} else if ( area == "Lake" ) {
return LakeArea;
} else if ( (area == "Lake Dry")
|| (area == "DryLake") ) {
1999-02-25 21:30:24 +00:00
return DryLakeArea;
} else if ( (area == "Lake Intermittent")
|| (area == "IntermittentLake") ) {
1999-02-25 21:30:24 +00:00
return IntLakeArea;
} else if ( area == "Reservoir" ) {
return ReservoirArea;
} else if ( (area == "Reservoir Intermittent")
|| (area == "IntermittentReservoir") ) {
1999-02-25 21:30:24 +00:00
return IntReservoirArea;
} else if ( area == "Stream" ) {
return StreamArea;
} else if ( area == "Canal" ) {
return CanalArea;
} else if ( area == "Glacier" ) {
return GlacierArea;
1999-05-13 02:37:56 +00:00
} else if ( area == "Default" ) {
return DefaultArea;
1999-02-25 21:30:24 +00:00
} else if ( area == "Void Area" ) {
return VoidArea;
} else if ( area == "Null" ) {
return NullArea;
} else {
cout << "unknown area = '" << area << "'" << endl;
// cout << "area = " << area << endl;
// for ( int i = 0; i < area.length(); i++ ) {
// cout << i << ") " << (int)area[i] << endl;
// }
1999-02-25 21:30:24 +00:00
return UnknownArea;
}
}
// return text from of area name
1999-02-25 21:30:24 +00:00
string get_area_name( AreaType area ) {
if ( area == DefaultArea ) {
return "Default";
} else if ( area == AirportKeepArea ) {
1999-02-25 21:30:24 +00:00
return "AirportKeep";
} else if ( area == AirportIgnoreArea ) {
return "AirportIgnore";
} else if ( area == MarshArea ) {
return "Marsh";
} else if ( area == OceanArea ) {
return "Ocean";
} else if ( area == LakeArea ) {
return "Lake";
} else if ( area == DryLakeArea ) {
return "DryLake";
} else if ( area == IntLakeArea ) {
return "IntermittentLake";
} else if ( area == ReservoirArea ) {
return "Reservoir";
} else if ( area == IntReservoirArea ) {
return "IntermittentReservoir";
} else if ( area == StreamArea ) {
return "Stream";
} else if ( area == CanalArea ) {
return "Canal";
} else if ( area == GlacierArea ) {
return "Glacier";
} else if ( area == VoidArea ) {
return "VoidArea";
} else if ( area == NullArea ) {
return "Null";
} else {
cout << "unknown area code = " << (int)area << endl;
return "Unknown";
}
}