Panda3D
|
00001 // Filename: distanceUnit.h 00002 // Created by: drose (17Apr01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef DISTANCEUNIT_H 00016 #define DISTANCEUNIT_H 00017 00018 #include "pandatoolbase.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Enum : DistanceUnit 00022 // Description : This enumerated type lists all the kinds of units 00023 // we're likely to come across in model conversion 00024 // programs. 00025 //////////////////////////////////////////////////////////////////// 00026 enum DistanceUnit { 00027 DU_millimeters, 00028 DU_centimeters, 00029 DU_meters, 00030 DU_kilometers, 00031 DU_yards, 00032 DU_feet, 00033 DU_inches, 00034 DU_nautical_miles, 00035 DU_statute_miles, 00036 DU_invalid 00037 }; 00038 00039 string format_abbrev_unit(DistanceUnit unit); 00040 string format_long_unit(DistanceUnit unit); 00041 00042 ostream &operator << (ostream &out, DistanceUnit unit); 00043 istream &operator >> (istream &in, DistanceUnit &unit); 00044 DistanceUnit string_distance_unit(const string &str); 00045 00046 double convert_units(DistanceUnit from, DistanceUnit to); 00047 00048 #endif