Go to the documentation of this file.00001
00030 #ifndef ENUM_TYPES_H
00031 #define ENUM_TYPES_H
00032 #include <boost/assign/list_of.hpp>
00033 #include <map>
00034
00035 namespace constrained_ik
00036 {
00037 namespace constraint_types
00038 {
00040 enum ConstraintTypes
00041 {
00042 Primary,
00043 Auxiliary,
00044 Inactive,
00045 };
00046
00051 struct ConstraintType
00052 {
00057 ConstraintType(ConstraintTypes constraint_type):type_(constraint_type) {}
00058 ConstraintType() {}
00059
00064 inline std::string toString() const { return names_[type_]; }
00065
00070 inline ConstraintTypes getType() const { return type_; }
00071
00076 inline void setType(ConstraintTypes constraint_type) { type_ = constraint_type; }
00077
00082 inline void setType(std::string constraint_type_name) { type_ = stringToEnum(constraint_type_name); }
00083
00089 inline static std::string enumToString(ConstraintTypes constraint_type) { return names_[constraint_type]; }
00090
00096 static ConstraintTypes stringToEnum(std::string constraint_type_name);
00097
00098 protected:
00099 ConstraintTypes type_;
00100 static const std::string names_[];
00101 static const std::map<std::string, ConstraintTypes> name_to_enum_map_;
00102 };
00103 }
00104
00105 namespace initialization_state
00106 {
00108 enum InitializationState
00109 {
00110 PrimaryOnly,
00111 AuxiliaryOnly,
00112 PrimaryAndAuxiliary,
00113 NothingInitialized,
00114 };
00115 }
00116
00117 typedef constraint_types::ConstraintTypes ConstraintTypes;
00118 typedef initialization_state::InitializationState InitializationState;
00119 }
00120 #endif // ENUM_TYPES_H