AxesType.cxx
Go to the documentation of this file.
1 /* -*- mode:c++ -*- */
2 
17 #include "AxesType.h"
18 
19 #include <cassert>
20 
21 namespace hippodraw {
22 
23  namespace Axes {
24 
30  static Type types [] = { X, Y, Z, W, XE, YE, UNKNOWN };
31 
32  Type convert ( const std::string & axis )
33  {
35  if ( axis == "x" || axis == "X" ) type = X;
36  else if ( axis == "y" || axis == "Y" ) type = Y;
37  else if ( axis == "z" || axis == "Z" ) type = Z;
38  else if ( axis == "t" || axis == "T" ) type = T;
39 
40  return type;
41  }
42 
43  Type convert ( unsigned int i )
44  {
45  assert ( i <= UNKNOWN );
46 
47  return types [ i ];
48  }
49 
50  } // end namespace Axes
51 } // end namespace hippodraw
unsigned int i
X error or width.
Definition: AxesType.h:37
Y error or width.
Definition: AxesType.h:38
PyArray_TYPES type(numeric::array arr)
Definition: num_util.cpp:249
static Type types[]
An array to allow conversion of integer to enumeration.
Definition: AxesType.cxx:30
The namespace for axes.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
Definition: AxesType.cxx:32
Type
Axes constants.
Definition: AxesType.h:31

Generated for HippoDraw Class Library by doxygen