00001
00002
00017 #include "AxesType.h"
00018
00019 #include <cassert>
00020
00021 namespace hippodraw {
00022
00023 namespace Axes {
00024
00030 static Type types [] = { X, Y, Z, W, XE, YE, UNKNOWN };
00031
00032 Type convert ( const std::string & axis )
00033 {
00034 hippodraw::Axes::Type type = UNKNOWN;
00035 if ( axis == "x" || axis == "X" ) type = X;
00036 else if ( axis == "y" || axis == "Y" ) type = Y;
00037 else if ( axis == "z" || axis == "Z" ) type = Z;
00038 else if ( axis == "t" || axis == "T" ) type = T;
00039
00040 return type;
00041 }
00042
00043 Type convert ( unsigned int i )
00044 {
00045 assert ( i <= UNKNOWN );
00046
00047 return types [ i ];
00048 }
00049
00050 }
00051 }