Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FacialExpressionInterface.h
1 
2 /***************************************************************************
3  * FacialExpressionInterface.h - Fawkes BlackBoard Interface - FacialExpressionInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2009 Bahram Maleki-Fard
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __INTERFACES_FACIALEXPRESSIONINTERFACE_H_
25 #define __INTERFACES_FACIALEXPRESSIONINTERFACE_H_
26 
27 #include <interface/interface.h>
28 #include <interface/message.h>
29 #include <interface/field_iterator.h>
30 
31 namespace fawkes {
32 
34 {
35  /// @cond INTERNALS
36  INTERFACE_MGMT_FRIENDS(FacialExpressionInterface)
37  /// @endcond
38  public:
39  /* constants */
40 
41  /** Action types for moving brows */
42  typedef enum {
43  BROWS_DEFAULT /**< Reset */,
44  BROWS_FROWN /**< Frown */,
45  BROWS_LIFT /**< Lift */
46  } brows_t;
47  const char * tostring_brows_t(brows_t value) const;
48 
49  /** Action types for moving eyes */
50  typedef enum {
51  EYES_DEFAULT /**< Reset */,
52  EYES_UP /**< Up */,
53  EYES_DOWN /**< Down */,
54  EYES_LEFT /**< Left */,
55  EYES_RIGHT /**< Right */,
56  EYES_COOL /**< Cool */,
57  EYES_CROSS /**< Cross */,
58  EYES_HEART /**< Heart */,
59  EYES_DOLLAR /**< Dollar */
60  } eyes_t;
61  const char * tostring_eyes_t(eyes_t value) const;
62 
63  /** Action types for moving jowl */
64  typedef enum {
65  JOWL_DEFAULT /**< Reset */,
66  JOWL_BLUSH /**< Blush */,
67  JOWL_TEARS /**< Tears */
68  } jowl_t;
69  const char * tostring_jowl_t(jowl_t value) const;
70 
71  /** Action types for moving mouth */
72  typedef enum {
73  MOUTH_DEFAULT /**< Reset */,
74  MOUTH_OPEN /**< Open */,
75  MOUTH_CLOSE /**< Close */,
76  MOUTH_SMILE /**< Smile */,
77  MOUTH_SCOWL /**< Scowl */
78  } mouth_t;
79  const char * tostring_mouth_t(mouth_t value) const;
80 
81  private:
82 #pragma pack(push,4)
83  /** Internal data storage, do NOT modify! */
84  typedef struct {
85  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
86  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
87  int32_t brows_action; /**< Type of action of brows */
88  int32_t eyes_action; /**< Type of action of eyes */
89  int32_t jowl_action; /**< Type of action of jown */
90  int32_t mouth_action; /**< Type of action of mouth */
91  } FacialExpressionInterface_data_t;
92 #pragma pack(pop)
93 
94  FacialExpressionInterface_data_t *data;
95 
96  public:
97  /* messages */
98  class MoveBrowsMessage : public Message
99  {
100  private:
101 #pragma pack(push,4)
102  /** Internal data storage, do NOT modify! */
103  typedef struct {
104  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
105  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
106  int32_t brows_action; /**< Type of action of brows */
107  } MoveBrowsMessage_data_t;
108 #pragma pack(pop)
109 
110  MoveBrowsMessage_data_t *data;
111 
112  public:
113  MoveBrowsMessage(const brows_t ini_brows_action);
116 
118  /* Methods */
119  brows_t brows_action() const;
120  void set_brows_action(const brows_t new_brows_action);
121  size_t maxlenof_brows_action() const;
122  virtual Message * clone() const;
123  };
124 
125  class MoveEyesMessage : public Message
126  {
127  private:
128 #pragma pack(push,4)
129  /** Internal data storage, do NOT modify! */
130  typedef struct {
131  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
132  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
133  int32_t eyes_action; /**< Type of action of eyes */
134  } MoveEyesMessage_data_t;
135 #pragma pack(pop)
136 
137  MoveEyesMessage_data_t *data;
138 
139  public:
140  MoveEyesMessage(const eyes_t ini_eyes_action);
141  MoveEyesMessage();
143 
145  /* Methods */
146  eyes_t eyes_action() const;
147  void set_eyes_action(const eyes_t new_eyes_action);
148  size_t maxlenof_eyes_action() const;
149  virtual Message * clone() const;
150  };
151 
152  class MoveJowlMessage : public Message
153  {
154  private:
155 #pragma pack(push,4)
156  /** Internal data storage, do NOT modify! */
157  typedef struct {
158  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
159  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
160  int32_t jowl_action; /**< Type of action of jown */
161  } MoveJowlMessage_data_t;
162 #pragma pack(pop)
163 
164  MoveJowlMessage_data_t *data;
165 
166  public:
167  MoveJowlMessage(const jowl_t ini_jowl_action);
168  MoveJowlMessage();
170 
172  /* Methods */
173  jowl_t jowl_action() const;
174  void set_jowl_action(const jowl_t new_jowl_action);
175  size_t maxlenof_jowl_action() const;
176  virtual Message * clone() const;
177  };
178 
179  class MoveMouthMessage : public Message
180  {
181  private:
182 #pragma pack(push,4)
183  /** Internal data storage, do NOT modify! */
184  typedef struct {
185  int64_t timestamp_sec; /**< Interface Unix timestamp, seconds */
186  int64_t timestamp_usec; /**< Interface Unix timestamp, micro-seconds */
187  int32_t mouth_action; /**< Type of action of mouth */
188  } MoveMouthMessage_data_t;
189 #pragma pack(pop)
190 
191  MoveMouthMessage_data_t *data;
192 
193  public:
194  MoveMouthMessage(const mouth_t ini_mouth_action);
197 
199  /* Methods */
200  mouth_t mouth_action() const;
201  void set_mouth_action(const mouth_t new_mouth_action);
202  size_t maxlenof_mouth_action() const;
203  virtual Message * clone() const;
204  };
205 
206  virtual bool message_valid(const Message *message) const;
207  private:
210 
211  public:
212  /* Methods */
213  brows_t brows_action() const;
214  void set_brows_action(const brows_t new_brows_action);
215  size_t maxlenof_brows_action() const;
216  eyes_t eyes_action() const;
217  void set_eyes_action(const eyes_t new_eyes_action);
218  size_t maxlenof_eyes_action() const;
219  jowl_t jowl_action() const;
220  void set_jowl_action(const jowl_t new_jowl_action);
221  size_t maxlenof_jowl_action() const;
222  mouth_t mouth_action() const;
223  void set_mouth_action(const mouth_t new_mouth_action);
224  size_t maxlenof_mouth_action() const;
225  virtual Message * create_message(const char *type) const;
226 
227  virtual void copy_values(const Interface *other);
228  virtual const char * enum_tostring(const char *enumtype, int val) const;
229 
230 };
231 
232 } // end namespace fawkes
233 
234 #endif