Panda3D
distanceUnit.h
1 // Filename: distanceUnit.h
2 // Created by: drose (17Apr01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef DISTANCEUNIT_H
16 #define DISTANCEUNIT_H
17 
18 #include "pandatoolbase.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Enum : DistanceUnit
22 // Description : This enumerated type lists all the kinds of units
23 // we're likely to come across in model conversion
24 // programs.
25 ////////////////////////////////////////////////////////////////////
26 enum DistanceUnit {
27  DU_millimeters,
28  DU_centimeters,
29  DU_meters,
30  DU_kilometers,
31  DU_yards,
32  DU_feet,
33  DU_inches,
34  DU_nautical_miles,
35  DU_statute_miles,
36  DU_invalid
37 };
38 
39 string format_abbrev_unit(DistanceUnit unit);
40 string format_long_unit(DistanceUnit unit);
41 
42 ostream &operator << (ostream &out, DistanceUnit unit);
43 istream &operator >> (istream &in, DistanceUnit &unit);
44 DistanceUnit string_distance_unit(const string &str);
45 
46 double convert_units(DistanceUnit from, DistanceUnit to);
47 
48 #endif