############################################################
# GDL - Gaze Description Language
#
# Este arquivo possui a descrio do prottipo da sintaxe 
# da linguagem.
#
# Rossana Baptista Queiroz
#
# Projeto iniciado em 14/03/2007
# Alteraes em 28/03/2007
# Formatada para Lua em 29 e 30/03/2007
############################################################

1) Sets of values available to put on parameters:

* SpecifYing Left/Right parameters
LR = {"l","r","lr"}

* Gaze Directions
GDIR = {"up", "down", "left", "right", "lup", "ldown", "rup", "rdown"}

* Angle Value: real number in degrees 
ANGLE in [0,...,360]

* Time Value: integer, in frames
TIME in [0,...]

* Intensity of Movement: real, percentual
INTENSITY in [0,1]

* Eyebrows movements (or "behaviors")
EBMOV = {"up", "central", "down"}

* Eyelids movements (or "behaviors")
ELMOV = {"default", "raised", "lowered", "opened", "closed"}
OBS.: default, opened and closed aren't affected by intensity values.

* Blink behavior
BB = {"default", "quick", "slow"}

* Humidity intensities
HI = {"dry", "wet", "tears"}

* Pupil dilatation intensities
PI = {"default", "dilated", "narrow"}

* Head directions (or "behaviors")
HDIR = {"forward", "up", "down", "left", "right", "backward"}

* Eye Behaviors
BEH = { "random", "static", "mutualGaze", "gazeAway", "visualConstruct",
        "visualRecall", "audioConstruct", "audioRecall", "kinesthetic",
        "internalDialogue", "discomfort", "concentration", "irony", "distress" }

* Behavior's parameters:
BP = {TIME | INTENSITY}


2) Parameters of each behavior:

   * TIME: random, static, mutualGaze, gazeAway, visualConstruct,
        visualRecall, audioConstruct, audioRecall, kinesthetic,
        internalDialogue

   * INTENSITY: discomfort, concentration, irony, distress 


3) Syntax (it is a Lua script):

-- Comment (--)

-- To load gdl files and generate animation for determined time:
StoryBoard = {
   { EMOTION_NAME1, TIME1 },
   ...,
   { EMOTION_NAME2, TIME2},
}

-- To save new animations (gdl files) in Gaze Behavioral Database:
NewAnimations = {

-- Animation 1
   {
      -- General info
      class = "emotion",
      name  = EMOTION_NAME,

     -- Eyebrows Info
      eyebrows = {
         inner = {
            { LR, EBMOV, INTENSITY },
            { LR, EBMOV, INTENSITY },
         },
         medial = { LR, EBMOV, INTENSITY },
         outer = { LR, EBMOV, INTENSITY },
      },

      -- Eyelids Info
      eyelids = {
         upper = { LR, ELMOV, INTENSITY },
         lower = { LR, ELMOV, INTENSITY },
         blink = BB,
      },

      -- Eyeballs Info
      eyeballs = {
         humidity = HI,
         pupil = PI,

         -- Look to an specified point
         movement = {
            direction = GDIR,
            magnitude = ANGLE,
         },

         -- Our mainly contribution: gaze behaviors!
         behavior = {BEH, BP },
      },

      -- Head Info
      head = {
         behavior = { HDIR },
      },
   },

-- ...
   
-- Animation n
   {
      ...
   },
}

** Sample of GDL-Script:

-- To load gdl files and generate animation for determined time:
StoryBoard = {
   {"sad", 200},
   {"happy", 50},
}

-- To save new animations (gdl files) in Gaze Behavioral Database:
NewAnimations = {

-- Animation 1
   {
      -- General info
      class = "emotion",
      name  = "happy",

      -- Eyebrows Info
      eyebrows = {
         inner = {
            { "l", "up", 0.0 },
            { "r", "down", 0.0 },
         },
         medial = { "lr", "up", 0.5 },
         outer = { "lr", "up", 0.5 },
      },

      -- Eyelids Info
      eyelids = {
         upper = { "lr", "raised", 0.2 },
         lower = { "lr", "raised", 0.3 },
         blink = "default",
      },

      -- Eyeballs Info
      eyeballs = {
         humidity = "wet",
         pupil = "default",

         -- Look to an specified point
         movement = {
            direction = "up",
            magnitude = "12.0",
         },

         -- Our mainly contribution: behavior!
         behavior = {"random", 100 },
      },
   },
}