CARMA C++
Axis.h
1 #ifndef SZA_UTIL_AXIS_H
2 #define SZA_UTIL_AXIS_H
3 
11 namespace sza {
12  namespace util {
13 
17  class Axis {
18 
19  public:
20 
24  enum Type {
25  NONE = 0x0,
26  AZ = 0x1,// Make these orthogonal bits, so that they can be
27  // OR'd together
28  EL = 0x2,
29  PA = 0x4,
30  BOTH = AZ|EL, // Some telescope don't have a PA axis
31  ALL = AZ|EL|PA
32  } type_;
33 
37  inline Axis(Type type)
38  {
39  type_ = type;
40  };
41 
45  inline bool isValidSingleAxis()
46  {
47  if(type_ == AZ || type_ == EL || type_ == PA)
48  return true;
49  return false;
50  };
51 
55  inline bool isSet(Type type)
56  {
57  return (unsigned) type_ & (unsigned) type;
58  };
59 
60  }; // End class Axis
61 
62  }; // End namespace util
63 }; // End namespace sza
64 
65 #endif // End #ifndef
bool isSet(Type type)
Return true if a requested axis is set in the mask.
Definition: Axis.h:55
The following class just enumerates valid axes.
Definition: Axis.h:17
Type
An enumerator to identify a valid axis.
Definition: Axis.h:24
Axis(Type type)
Constructor.
Definition: Axis.h:37
bool isValidSingleAxis()
Return true if this represents a single telescope axis.
Definition: Axis.h:45