00001
00002
00014 #ifndef _AxesType_H_
00015 #define _AxesType_H_
00016
00017 #include <string>
00018
00019 #include <cassert>
00020
00021 namespace hippodraw {
00022
00026 namespace Axes {
00027
00033 enum Type
00034 {
00035 X = 0,
00036 Y = 1,
00037 Z = 2,
00038 W = 3,
00039 XE = 4,
00040 YE = 5,
00041 T = 10,
00042 UNKNOWN = 1000
00043 };
00044
00051 inline hippodraw::Axes::Type convert ( const std:: string & axis )
00052 {
00053 hippodraw::Axes::Type type = UNKNOWN;
00054 if ( axis == "x" || axis == "X" ) type = X;
00055 else if ( axis == "y" || axis == "Y" ) type = Y;
00056 else if ( axis == "z" || axis == "Z" ) type = Z;
00057 else if ( axis == "t" || axis == "T" ) type = T;
00058
00059 return type;
00060 }
00061
00065 inline hippodraw::Axes::Type convert ( unsigned int i )
00066 {
00067 assert ( i <= UNKNOWN );
00068 static Axes::Type types [] = { X, Y, Z, W, XE, YE, UNKNOWN };
00069
00070 return types [ i ];
00071 }
00072 }
00073 }
00074
00075 #endif // _AxesType_H_