Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * FacialExpressionInterface.h - Fawkes BlackBoard Interface - FacialExpressionInterface 00004 * 00005 * Templated created: Thu Oct 12 10:49:19 2006 00006 * Copyright 2009 Bahram Maleki-Fard 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #ifndef __INTERFACES_FACIALEXPRESSIONINTERFACE_H_ 00025 #define __INTERFACES_FACIALEXPRESSIONINTERFACE_H_ 00026 00027 #include <interface/interface.h> 00028 #include <interface/message.h> 00029 #include <interface/field_iterator.h> 00030 00031 namespace fawkes { 00032 00033 class FacialExpressionInterface : public Interface 00034 { 00035 /// @cond INTERNALS 00036 INTERFACE_MGMT_FRIENDS(FacialExpressionInterface) 00037 /// @endcond 00038 public: 00039 /* constants */ 00040 00041 /** Action types for moving brows */ 00042 typedef enum { 00043 BROWS_DEFAULT /**< Reset */, 00044 BROWS_FROWN /**< Frown */, 00045 BROWS_LIFT /**< Lift */ 00046 } brows_t; 00047 const char * tostring_brows_t(brows_t value) const; 00048 00049 /** Action types for moving eyes */ 00050 typedef enum { 00051 EYES_DEFAULT /**< Reset */, 00052 EYES_UP /**< Up */, 00053 EYES_DOWN /**< Down */, 00054 EYES_LEFT /**< Left */, 00055 EYES_RIGHT /**< Right */, 00056 EYES_COOL /**< Cool */, 00057 EYES_CROSS /**< Cross */, 00058 EYES_HEART /**< Heart */, 00059 EYES_DOLLAR /**< Dollar */ 00060 } eyes_t; 00061 const char * tostring_eyes_t(eyes_t value) const; 00062 00063 /** Action types for moving jowl */ 00064 typedef enum { 00065 JOWL_DEFAULT /**< Reset */, 00066 JOWL_BLUSH /**< Blush */, 00067 JOWL_TEARS /**< Tears */ 00068 } jowl_t; 00069 const char * tostring_jowl_t(jowl_t value) const; 00070 00071 /** Action types for moving mouth */ 00072 typedef enum { 00073 MOUTH_DEFAULT /**< Reset */, 00074 MOUTH_OPEN /**< Open */, 00075 MOUTH_CLOSE /**< Close */, 00076 MOUTH_SMILE /**< Smile */, 00077 MOUTH_SCOWL /**< Scowl */ 00078 } mouth_t; 00079 const char * tostring_mouth_t(mouth_t value) const; 00080 00081 private: 00082 #pragma pack(push,4) 00083 /** Internal data storage, do NOT modify! */ 00084 typedef struct { 00085 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */ 00086 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */ 00087 int32_t brows_action; /**< Type of action of brows */ 00088 int32_t eyes_action; /**< Type of action of eyes */ 00089 int32_t jowl_action; /**< Type of action of jown */ 00090 int32_t mouth_action; /**< Type of action of mouth */ 00091 } FacialExpressionInterface_data_t; 00092 #pragma pack(pop) 00093 00094 FacialExpressionInterface_data_t *data; 00095 00096 public: 00097 /* messages */ 00098 class MoveBrowsMessage : public Message 00099 { 00100 private: 00101 #pragma pack(push,4) 00102 /** Internal data storage, do NOT modify! */ 00103 typedef struct { 00104 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */ 00105 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */ 00106 int32_t brows_action; /**< Type of action of brows */ 00107 } MoveBrowsMessage_data_t; 00108 #pragma pack(pop) 00109 00110 MoveBrowsMessage_data_t *data; 00111 00112 public: 00113 MoveBrowsMessage(const brows_t ini_brows_action); 00114 MoveBrowsMessage(); 00115 ~MoveBrowsMessage(); 00116 00117 MoveBrowsMessage(const MoveBrowsMessage *m); 00118 /* Methods */ 00119 brows_t brows_action() const; 00120 void set_brows_action(const brows_t new_brows_action); 00121 size_t maxlenof_brows_action() const; 00122 virtual Message * clone() const; 00123 }; 00124 00125 class MoveEyesMessage : public Message 00126 { 00127 private: 00128 #pragma pack(push,4) 00129 /** Internal data storage, do NOT modify! */ 00130 typedef struct { 00131 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */ 00132 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */ 00133 int32_t eyes_action; /**< Type of action of eyes */ 00134 } MoveEyesMessage_data_t; 00135 #pragma pack(pop) 00136 00137 MoveEyesMessage_data_t *data; 00138 00139 public: 00140 MoveEyesMessage(const eyes_t ini_eyes_action); 00141 MoveEyesMessage(); 00142 ~MoveEyesMessage(); 00143 00144 MoveEyesMessage(const MoveEyesMessage *m); 00145 /* Methods */ 00146 eyes_t eyes_action() const; 00147 void set_eyes_action(const eyes_t new_eyes_action); 00148 size_t maxlenof_eyes_action() const; 00149 virtual Message * clone() const; 00150 }; 00151 00152 class MoveJowlMessage : public Message 00153 { 00154 private: 00155 #pragma pack(push,4) 00156 /** Internal data storage, do NOT modify! */ 00157 typedef struct { 00158 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */ 00159 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */ 00160 int32_t jowl_action; /**< Type of action of jown */ 00161 } MoveJowlMessage_data_t; 00162 #pragma pack(pop) 00163 00164 MoveJowlMessage_data_t *data; 00165 00166 public: 00167 MoveJowlMessage(const jowl_t ini_jowl_action); 00168 MoveJowlMessage(); 00169 ~MoveJowlMessage(); 00170 00171 MoveJowlMessage(const MoveJowlMessage *m); 00172 /* Methods */ 00173 jowl_t jowl_action() const; 00174 void set_jowl_action(const jowl_t new_jowl_action); 00175 size_t maxlenof_jowl_action() const; 00176 virtual Message * clone() const; 00177 }; 00178 00179 class MoveMouthMessage : public Message 00180 { 00181 private: 00182 #pragma pack(push,4) 00183 /** Internal data storage, do NOT modify! */ 00184 typedef struct { 00185 int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */ 00186 int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */ 00187 int32_t mouth_action; /**< Type of action of mouth */ 00188 } MoveMouthMessage_data_t; 00189 #pragma pack(pop) 00190 00191 MoveMouthMessage_data_t *data; 00192 00193 public: 00194 MoveMouthMessage(const mouth_t ini_mouth_action); 00195 MoveMouthMessage(); 00196 ~MoveMouthMessage(); 00197 00198 MoveMouthMessage(const MoveMouthMessage *m); 00199 /* Methods */ 00200 mouth_t mouth_action() const; 00201 void set_mouth_action(const mouth_t new_mouth_action); 00202 size_t maxlenof_mouth_action() const; 00203 virtual Message * clone() const; 00204 }; 00205 00206 virtual bool message_valid(const Message *message) const; 00207 private: 00208 FacialExpressionInterface(); 00209 ~FacialExpressionInterface(); 00210 00211 public: 00212 /* Methods */ 00213 brows_t brows_action() const; 00214 void set_brows_action(const brows_t new_brows_action); 00215 size_t maxlenof_brows_action() const; 00216 eyes_t eyes_action() const; 00217 void set_eyes_action(const eyes_t new_eyes_action); 00218 size_t maxlenof_eyes_action() const; 00219 jowl_t jowl_action() const; 00220 void set_jowl_action(const jowl_t new_jowl_action); 00221 size_t maxlenof_jowl_action() const; 00222 mouth_t mouth_action() const; 00223 void set_mouth_action(const mouth_t new_mouth_action); 00224 size_t maxlenof_mouth_action() const; 00225 virtual Message * create_message(const char *type) const; 00226 00227 virtual void copy_values(const Interface *other); 00228 virtual const char * enum_tostring(const char *enumtype, int val) const; 00229 00230 }; 00231 00232 } // end namespace fawkes 00233 00234 #endif