FacialExpressionInterface.h

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 
00048   /** Action types for moving eyes */
00049   typedef enum {
00050     EYES_DEFAULT /**< Reset */,
00051     EYES_UP /**< Up */,
00052     EYES_DOWN /**< Down */,
00053     EYES_LEFT /**< Left */,
00054     EYES_RIGHT /**< Right */,
00055     EYES_COOL /**< Cool */,
00056     EYES_CROSS /**< Cross */,
00057     EYES_HEART /**< Heart */,
00058     EYES_DOLLAR /**< Dollar */
00059   } eyes_t;
00060 
00061   /** Action types for moving jowl */
00062   typedef enum {
00063     JOWL_DEFAULT /**< Reset */,
00064     JOWL_BLUSH /**< Blush */,
00065     JOWL_TEARS /**< Tears */
00066   } jowl_t;
00067 
00068   /** Action types for moving mouth */
00069   typedef enum {
00070     MOUTH_DEFAULT /**< Reset */,
00071     MOUTH_OPEN /**< Open */,
00072     MOUTH_CLOSE /**< Close */,
00073     MOUTH_SMILE /**< Smile */,
00074     MOUTH_SCOWL /**< Scowl */
00075   } mouth_t;
00076
00077  private:
00078   /** Internal data storage, do NOT modify! */
00079   typedef struct {
00080     brows_t brows_action; /**< Type of action of brows */
00081     eyes_t eyes_action; /**< Type of action of eyes */
00082     jowl_t jowl_action; /**< Type of action of jown */
00083     mouth_t mouth_action; /**< Type of action of mouth */
00084   } FacialExpressionInterface_data_t;
00085
00086   FacialExpressionInterface_data_t *data;
00087
00088  public:
00089   /* messages */
00090   class MoveBrowsMessage : public Message
00091   {
00092    private:
00093     /** Internal data storage, do NOT modify! */
00094     typedef struct {
00095       brows_t brows_action; /**< Type of action of brows */
00096     } MoveBrowsMessage_data_t;
00097
00098     MoveBrowsMessage_data_t *data;
00099
00100    public:
00101     MoveBrowsMessage(const brows_t ini_brows_action);
00102     MoveBrowsMessage();
00103     ~MoveBrowsMessage();
00104
00105     MoveBrowsMessage(const MoveBrowsMessage *m);
00106     /* Methods */
00107     brows_t brows_action() const;
00108     void set_brows_action(const brows_t new_brows_action);
00109     size_t maxlenof_brows_action() const;
00110     virtual Message * clone() const;
00111   };
00112
00113   class MoveEyesMessage : public Message
00114   {
00115    private:
00116     /** Internal data storage, do NOT modify! */
00117     typedef struct {
00118       eyes_t eyes_action; /**< Type of action of eyes */
00119     } MoveEyesMessage_data_t;
00120
00121     MoveEyesMessage_data_t *data;
00122
00123    public:
00124     MoveEyesMessage(const eyes_t ini_eyes_action);
00125     MoveEyesMessage();
00126     ~MoveEyesMessage();
00127
00128     MoveEyesMessage(const MoveEyesMessage *m);
00129     /* Methods */
00130     eyes_t eyes_action() const;
00131     void set_eyes_action(const eyes_t new_eyes_action);
00132     size_t maxlenof_eyes_action() const;
00133     virtual Message * clone() const;
00134   };
00135
00136   class MoveJowlMessage : public Message
00137   {
00138    private:
00139     /** Internal data storage, do NOT modify! */
00140     typedef struct {
00141       jowl_t jowl_action; /**< Type of action of jown */
00142     } MoveJowlMessage_data_t;
00143
00144     MoveJowlMessage_data_t *data;
00145
00146    public:
00147     MoveJowlMessage(const jowl_t ini_jowl_action);
00148     MoveJowlMessage();
00149     ~MoveJowlMessage();
00150
00151     MoveJowlMessage(const MoveJowlMessage *m);
00152     /* Methods */
00153     jowl_t jowl_action() const;
00154     void set_jowl_action(const jowl_t new_jowl_action);
00155     size_t maxlenof_jowl_action() const;
00156     virtual Message * clone() const;
00157   };
00158
00159   class MoveMouthMessage : public Message
00160   {
00161    private:
00162     /** Internal data storage, do NOT modify! */
00163     typedef struct {
00164       mouth_t mouth_action; /**< Type of action of mouth */
00165     } MoveMouthMessage_data_t;
00166
00167     MoveMouthMessage_data_t *data;
00168
00169    public:
00170     MoveMouthMessage(const mouth_t ini_mouth_action);
00171     MoveMouthMessage();
00172     ~MoveMouthMessage();
00173
00174     MoveMouthMessage(const MoveMouthMessage *m);
00175     /* Methods */
00176     mouth_t mouth_action() const;
00177     void set_mouth_action(const mouth_t new_mouth_action);
00178     size_t maxlenof_mouth_action() const;
00179     virtual Message * clone() const;
00180   };
00181
00182   virtual bool message_valid(const Message *message) const;
00183  private:
00184   FacialExpressionInterface();
00185   ~FacialExpressionInterface();
00186
00187  public:
00188   /* Methods */
00189   brows_t brows_action() const;
00190   void set_brows_action(const brows_t new_brows_action);
00191   size_t maxlenof_brows_action() const;
00192   eyes_t eyes_action() const;
00193   void set_eyes_action(const eyes_t new_eyes_action);
00194   size_t maxlenof_eyes_action() const;
00195   jowl_t jowl_action() const;
00196   void set_jowl_action(const jowl_t new_jowl_action);
00197   size_t maxlenof_jowl_action() const;
00198   mouth_t mouth_action() const;
00199   void set_mouth_action(const mouth_t new_mouth_action);
00200   size_t maxlenof_mouth_action() const;
00201   virtual Message * create_message(const char *type) const;
00202
00203   virtual void copy_values(const Interface *other);
00204
00205 };
00206
00207 } // end namespace fawkes
00208
00209 #endif