Gesture
authorPAMPHILE Jonathan <pamphile@efrei.fr>
Fri, 06 Nov 2009 17:50:40 +0100
changeset 189 b37888f59cf2
parent 188 e642ad0c366b
child 190 619ca3ae13c7
Gesture
src/FingersDance.Control.Player/UserControlPlayer.xaml.cs
src/FingersDance.GestureControl/GestureControl.cs
src/FingersDance.GestureControl/GestureVector.cs
src/FingersDance.GestureControl/Resources/Patterns.xml
src/FingersDance.GestureControl/SurfaceGestureVector.cs
src/FingersDance.GestureControl/SurfaceGestureVectorDirection.cs
src/FingersDance/Resources/menu.xml
--- a/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance.Control.Player/UserControlPlayer.xaml.cs	Fri Nov 06 17:50:40 2009 +0100
@@ -121,18 +121,61 @@
             Console.WriteLine("gesture detected: " + e.Gesture);
             switch (e.Gesture)
             {
-                case "UP":
-                    //
-                    usercontrolInfoUser.LabelSession.Content = "UP!";
+                case "TRIGGER":
+                    
+                    usercontrolInfoUser.LabelSession.Content = "TRIGGER!";
+                    break;
+                case "CONTRE POINTS":
+
+                    usercontrolInfoUser.LabelSession.Content = "CONTRE POINTS!";
+                    break;
+                case "CONTRE PESANTEUR":
+
+                    usercontrolInfoUser.LabelSession.Content = "CONTRE PESANTEUR!";
+                    break;
+                case "AVEC PESANTEUR":
+
+                    usercontrolInfoUser.LabelSession.Content = "AVEC PESANTEUR!";
+                    break;
+                case "ALIGNEMENT":
+
+                    usercontrolInfoUser.LabelSession.Content = "ALIGNEMENT!";
+                    break;
+                case "CONTACT VISUEL":
+
+                    usercontrolInfoUser.LabelSession.Content = "CONTACT VISUEL!";
+                    break;
+                case "MOUVEMENT CONTRAINTE":
+
+                    usercontrolInfoUser.LabelSession.Content = "MOUVEMENT CONTRAINTE!";
                     break;
-                case "LEFT":
-                    usercontrolInfoUser.LabelSession.Content = "LEFT!";
+                case "UN DANSEUR":
+
+                    usercontrolInfoUser.LabelSession.Content = "UN DANSEUR!";
+                    break;
+                case "DEUX DANSEURS":
+
+                    usercontrolInfoUser.LabelSession.Content = "DEUX DANSEURS!";
+                    break;
+                case "TROIS DANSEURS":
+
+                    usercontrolInfoUser.LabelSession.Content = "TROIS DANSEURS!";
                     break;
-                case "RIGHT":
-                    usercontrolInfoUser.LabelSession.Content = "RIGHT!";
+                case "QUATRE DANSEURS":
+
+                    usercontrolInfoUser.LabelSession.Content = "QUATRE DANSEURS!";
+                    break;
+                case "TOUS LES DANSEURS":
+
+                    usercontrolInfoUser.LabelSession.Content = "TOUS LES DANSEURS!";
                     break;
-                case "DOWN":
-                    usercontrolInfoUser.LabelSession.Content = "DOWN!";
+                case "CONTACT TABLE/DANSEUR":
+
+                    usercontrolInfoUser.LabelSession.Content = "CONTACT TABLE/DANSEUR!";
+                    break;
+                case "PLAY-PAUSE":
+                    usercontrolInfoUser.LabelSession.Content = "PLAY-PAUSE!";
+                    ButtonPlayPause_ContactDown(null, null);
                     break;
                 default:
                     //this.TxtGesture.Text = e.Gesture;
--- a/src/FingersDance.GestureControl/GestureControl.cs	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance.GestureControl/GestureControl.cs	Fri Nov 06 17:50:40 2009 +0100
@@ -135,7 +135,7 @@
                 StylusPointCollection tmp2 = s.GetBezierStylusPoints();
                 // Generate a list of SurfaceGesturePoint, just X and Y but can be improve
                 List<SurfaceGesturePoint> pointList = new List<SurfaceGesturePoint>();
-                foreach (StylusPoint p in tmp2)
+                foreach (StylusPoint p in s.StylusPoints)
                     pointList.Add(new SurfaceGesturePoint { X = p.X, Y = p.Y });
                 // create the gesture analyser and set the list
                 SurfaceGesture gesture = new SurfaceGesture(pointList, 1);
@@ -168,10 +168,9 @@
         }
 
         #region Pattern
-        /// <ary>
+        /// <summary>
         /// return a String with the recognized pattern, "None" if no pattern
         /// </summary>
-        /// <returns></returns>
         public String GetPattern(List<SurfaceGesture> gestures)
         {            
             int found = 0;
@@ -200,7 +199,6 @@
                         return p.Name;
                 }
             }
-
             return "None";
         }
 
@@ -262,18 +260,21 @@
                                 case "Right":
                                     p.Add(new SurfaceGestureVector() { Direction = SurfaceGestureVectorDirection.RIGHT });
                                     break;
-                                case "DownRight":
+                                case "Downright":
                                     p.Add(new SurfaceGestureVector() { Direction = SurfaceGestureVectorDirection.DOWNRIGHT });
                                     break;
-                                case "DownLeft":
+                                case "Downleft":
                                     p.Add(new SurfaceGestureVector() { Direction = SurfaceGestureVectorDirection.DOWNLEFT });
                                     break;
-                                case "UpRight":
+                                case "Upright":
                                     p.Add(new SurfaceGestureVector() { Direction = SurfaceGestureVectorDirection.UPRIGHT });
                                     break;
-                                case "UpLeft":
+                                case "Upleft":
                                     p.Add(new SurfaceGestureVector() { Direction = SurfaceGestureVectorDirection.UPLEFT });
                                     break;
+                                case "TAP":
+                                    p.Add(new SurfaceGestureVector() { Direction = SurfaceGestureVectorDirection.TAP });
+                                    break;
                                 default:
                                     break;
                             }
--- a/src/FingersDance.GestureControl/GestureVector.cs	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance.GestureControl/GestureVector.cs	Fri Nov 06 17:50:40 2009 +0100
@@ -93,7 +93,7 @@
             /*if (this.GetPattern() != "None")
                 return true;
             else*/
-                return false;
+            return false;
         }
         /// <summary>
         /// Get distance between two points
@@ -125,155 +125,64 @@
         /// <param name="list"></param>
         private void Generate(List<SurfaceGesturePoint> list)
         {
+            this.Clear();
             if (list.Count < 2)
             {
                 this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.TAP, Lenght = 0 });
                 return;
             }
-            SurfaceGestureVectorDirection lastDirection = SurfaceGestureVectorDirection.NONE;
-            int lastPoint = 0;
-            SurfaceGesturePoint LastChange = list[0];
 
-            /////// TEST///////////
-            if (this.GenerateCourb(list, 5) == true)
-                return;
-            this.Clear();
-            ///////////////////////
-
-            for (int i = 0; i < list.Count - 1; i++)
+            List<SurfaceGesturePoint> Points = new List<SurfaceGesturePoint>();
+            List<SurfaceGestureVector> Vectors = new List<SurfaceGestureVector>();
+            
+            for (int index = 1; index <= list.Count; index++)
             {
-                if (GetHorizontal(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.UP && lastDirection != SurfaceGestureVectorDirection.UP)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UP, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.UP;
-                }
-                else if (GetHorizontal(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.DOWN && lastDirection != SurfaceGestureVectorDirection.DOWN)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWN, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.DOWN;
-                }
-                else if (GetHorizontal(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.UPLEFT && lastDirection != SurfaceGestureVectorDirection.UPLEFT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UPLEFT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.UPLEFT;
-                }
-                else if (GetHorizontal(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.UPRIGHT && lastDirection != SurfaceGestureVectorDirection.UPRIGHT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UPRIGHT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.UPRIGHT;
-                }
-                else if (GetHorizontal(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.DOWNLEFT && lastDirection != SurfaceGestureVectorDirection.DOWNLEFT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWNLEFT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.DOWNLEFT;
-                }
-                else if (GetHorizontal(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.DOWNRIGHT && lastDirection != SurfaceGestureVectorDirection.DOWNRIGHT)
+                if (index == list.Count / 2 || index == list.Count)
                 {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWNRIGHT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.DOWNRIGHT;
-                }
-                else if (GetVertical(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.LEFT && lastDirection != SurfaceGestureVectorDirection.LEFT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.LEFT, Lenght = (Math.Abs(LastChange.X - list[i + 1].X)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.LEFT;
-                }
-                else if (GetVertical(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.RIGHT && lastDirection != SurfaceGestureVectorDirection.RIGHT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.RIGHT, Lenght = (Math.Abs(LastChange.X - list[i + 1].X)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.RIGHT;
-                }
-                else if (GetVertical(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.UPLEFT && lastDirection != SurfaceGestureVectorDirection.UPLEFT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UPLEFT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.UPLEFT;
+                    SurfaceGestureVector verctorTemp = AnalysePoints(Points);
+                    if (Vectors.Count == 0 || !Vectors[Vectors.Count - 1].Direction.Equals(verctorTemp.Direction))
+                        Vectors.Add(verctorTemp);
+                    Points.Clear();
                 }
-                else if (GetVertical(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.UPRIGHT && lastDirection != SurfaceGestureVectorDirection.UPRIGHT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UPRIGHT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.UPRIGHT;
-                }
-                else if (GetVertical(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.DOWNLEFT && lastDirection != SurfaceGestureVectorDirection.DOWNLEFT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWNLEFT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.DOWNLEFT;
-                }
-                else if (GetVertical(list[lastPoint], list[i + 1]) == SurfaceGestureVectorDirection.DOWNRIGHT && lastDirection != SurfaceGestureVectorDirection.DOWNRIGHT)
-                {
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWNRIGHT, Lenght = (Math.Abs(LastChange.Y - list[i + 1].Y)) });
-                    LastChange = list[i + 1];
-                    lastDirection = SurfaceGestureVectorDirection.DOWNRIGHT;
-                }
-                ++lastPoint;
+                else
+                    Points.Add(list[index]);
             }
-            Analyse(list);
+            foreach (SurfaceGestureVector elt in Vectors)
+                this.Add(elt);
         }
 
-        private void Analyse(List<SurfaceGesturePoint> list)
+        SurfaceGestureVector AnalysePoints(List<SurfaceGesturePoint> list)
         {
-            //  Analyse de la forme
-
-            double up = 0, down = 0, left = 0, right = 0, upleft = 0, upright = 0, downleft = 0, downright = 0;
-            foreach (SurfaceGestureVector elt in this)
-            {
-                switch (elt.Direction)
-                {
-                    case SurfaceGestureVectorDirection.DOWN:
-                        down += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.DOWNLEFT:
-                        downleft += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.DOWNRIGHT:
-                        downright += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.LEFT:
-                        left += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.RIGHT:
-                        right += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.UP:
-                        up += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.UPLEFT:
-                        upleft += elt.Lenght;
-                        break;
-                    case SurfaceGestureVectorDirection.UPRIGHT:
-                        upright += elt.Lenght;
-                        break;
-                }
-            }
-
             double diffX = Math.Abs(list[0].X - list[list.Count - 1].X);
             double diffY = Math.Abs(list[0].Y - list[list.Count - 1].Y);
 
-            if (diffX < 5)
+            if (diffX < 10 && diffY > 10)
             {
-                this.Clear();
-                if (up > down)
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UP, Lenght = up });
+                if (list[0].Y > list[list.Count - 1].Y)
+                    return (new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UP, Lenght = 0, Origin = list[0] });
                 else
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWN, Lenght = down });
+                    return (new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWN, Lenght = 0, Origin = list[0] });
+            }
+            else if (diffY < 10 && diffX > 10)
+            {
+                if (list[list.Count - 1].X > list[0].X)
+                    return (new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.RIGHT, Lenght = 0, Origin = list[0] });
+                else
+                    return (new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.LEFT, Lenght = 0, Origin = list[0] });
             }
-            else if (diffY < 5)
+            else if (diffX > 10 && diffY > 10)
             {
-                this.Clear();
-                if (left > right)
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.LEFT, Lenght = left });
+                if (list[0].Y > list[list.Count - 1].Y && list[list.Count - 1].X > list[0].X)
+                    return new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UPRIGHT, Lenght = 0, Origin = list[0] };
+                else if (list[0].Y > list[list.Count - 1].Y && list[list.Count - 1].X < list[0].X)
+                    return new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.UPLEFT, Lenght = 0, Origin = list[0] };
+                else if (list[0].Y < list[list.Count - 1].Y && list[list.Count - 1].X > list[0].X)
+                    return new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWNRIGHT, Lenght = 0, Origin = list[0] };
                 else
-                    this.Add(new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.RIGHT, Lenght = right });
+                    return new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.DOWNLEFT, Lenght = 0, Origin = list[0] };
             }
+            else
+                return new SurfaceGestureVector { Direction = SurfaceGestureVectorDirection.TAP, Lenght = 0 };
         }
 
         private SurfaceGestureVectorDirection GetHorizontal(SurfaceGesturePoint p1, SurfaceGesturePoint p2)
@@ -281,41 +190,21 @@
             if (p1.Y < p2.Y)
             {
                 // go up
-                if (Math.Abs(p2.Y - p1.Y) > this.Precision)
+                if (Math.Abs(p2.X - p1.X) < Math.Abs(p2.Y - p1.Y))
+                    return SurfaceGestureVectorDirection.DOWN;
+                else
                 {
-                    if (Math.Abs(p2.X - p1.X) < Math.Abs(p2.Y - p1.Y))
-                        return SurfaceGestureVectorDirection.DOWN;
+                    if (p1.X < p2.X)
+                        return SurfaceGestureVectorDirection.DOWNRIGHT;
                     else
-                    {
-                        if (p1.X < p2.X)
-                            return SurfaceGestureVectorDirection.DOWNRIGHT;
-                        else
-                            return SurfaceGestureVectorDirection.DOWNLEFT;
-                    }
+                        return SurfaceGestureVectorDirection.DOWNLEFT;
                 }
-                    else
-                    {
-                        if (p1.X < p2.X)
-                            return SurfaceGestureVectorDirection.DOWNRIGHT;
-                        else
-                            return SurfaceGestureVectorDirection.DOWNLEFT;
-                    }
             }
             else
             {
                 // go down
-                if (Math.Abs(p1.Y - p2.Y) > this.Precision)
-                {
-                    if (Math.Abs(p1.X - p2.X) < Math.Abs(p1.Y - p2.Y))
-                        return SurfaceGestureVectorDirection.UP;
-                    else
-                    {
-                        if (p1.X < p2.X)
-                            return SurfaceGestureVectorDirection.UPRIGHT;
-                        else
-                            return SurfaceGestureVectorDirection.UPLEFT;
-                    }
-                }
+                if (Math.Abs(p1.X - p2.X) < Math.Abs(p1.Y - p2.Y))
+                    return SurfaceGestureVectorDirection.UP;
                 else
                 {
                     if (p1.X < p2.X)
@@ -324,25 +213,15 @@
                         return SurfaceGestureVectorDirection.UPLEFT;
                 }
             }
-            return SurfaceGestureVectorDirection.NONE;
         }
+
         private SurfaceGestureVectorDirection GetVertical(SurfaceGesturePoint p1, SurfaceGesturePoint p2)
         {
             if (p1.X < p2.X)
             {
                 // go left
-                if (Math.Abs(p2.X - p1.X) > this.Precision)
-                {
-                    if (Math.Abs(p2.Y - p1.Y) < Math.Abs(p2.X - p1.X))
-                        return SurfaceGestureVectorDirection.RIGHT;
-                    else
-                    {
-                        if (p1.Y < p2.Y)
-                            return SurfaceGestureVectorDirection.DOWNRIGHT;
-                        else
-                            return SurfaceGestureVectorDirection.UPRIGHT;
-                    }
-                }
+                if (Math.Abs(p2.Y - p1.Y) < Math.Abs(p2.X - p1.X))
+                    return SurfaceGestureVectorDirection.RIGHT;
                 else
                 {
                     if (p1.Y < p2.Y)
@@ -353,19 +232,9 @@
             }
             else
             {
-                // go right
-                if (Math.Abs(p1.X - p2.X) > this.Precision)
-                {
-                    if (Math.Abs(p1.Y - p2.Y) < Math.Abs(p1.X - p2.X))
-                        return SurfaceGestureVectorDirection.LEFT;
-                    else
-                    {
-                        if (p1.Y < p2.Y)
-                            return SurfaceGestureVectorDirection.DOWNLEFT;
-                        else
-                            return SurfaceGestureVectorDirection.UPLEFT;
-                    }
-                }
+                // go right=
+                if (Math.Abs(p1.Y - p2.Y) < Math.Abs(p1.X - p2.X))
+                    return SurfaceGestureVectorDirection.LEFT;
                 else
                 {
                     if (p1.Y < p2.Y)
@@ -374,8 +243,8 @@
                         return SurfaceGestureVectorDirection.UPLEFT;
                 }
             }
-            return SurfaceGestureVectorDirection.NONE;
         }
+
         #endregion
 
         #region Override
--- a/src/FingersDance.GestureControl/Resources/Patterns.xml	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance.GestureControl/Resources/Patterns.xml	Fri Nov 06 17:50:40 2009 +0100
@@ -1,37 +1,78 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <Patterns>
+  
   <Pattern>
-    <Name>UP</Name>
+    <Name>TRIGGER</Name>
     <Childs>
       <Child>
-        <Name>UP</Name>
+        <Name>RIGHT</Name>
         <Directions>
-          <Direction>Up</Direction>
+          <Direction>Right</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>TAP</Name>
+        <Directions>
+          <Direction>TAP</Direction>
         </Directions>
       </Child>
     </Childs>
   </Pattern>
+  
   <Pattern>
-    <Name>LEFT</Name>
+    <Name>CONTRE POINTS</Name>
     <Childs>
       <Child>
-        <Name>Up</Name>
+        <Name>TAP</Name>
         <Directions>
-          <Direction>Up</Direction>
+          <Direction>TAP</Direction>
         </Directions>
       </Child>
       <Child>
-        <Name>Up</Name>
+        <Name>TAP</Name>
         <Directions>
-          <Direction>Up</Direction>
+          <Direction>TAP</Direction>
         </Directions>
       </Child>
     </Childs>
   </Pattern>
+  
   <Pattern>
-    <Name>RIGHT</Name>
+    <Name>CONTRE PESANTEUR</Name>
+    <Childs>
+      <Child>
+        <Name>UPRIGHT-DOWNRIGHT</Name>
+        <Directions>
+          <Direction>Upright</Direction>
+		  <Direction>Downright</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>AVEC PESANTEUR</Name>
     <Childs>
       <Child>
+        <Name>DOWNRIGHT-UPRIGHT</Name>
+        <Directions>
+		  <Direction>Downright</Direction>
+          <Direction>Upright</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>ALIGNEMENT</Name>
+    <Childs>
+      <Child>
+        <Name>RIGHT</Name>
+        <Directions>
+          <Direction>Right</Direction>
+        </Directions>
+      </Child>
+      <Child>
         <Name>RIGHT</Name>
         <Directions>
           <Direction>Right</Direction>
@@ -39,4 +80,212 @@
       </Child>
     </Childs>
   </Pattern>
+  
+  <Pattern>
+    <Name>CONTACT VISUEL</Name>
+    <Childs>
+      <Child>
+        <Name>DOWNRIGHT-DOWNLEFT</Name>
+        <Directions>
+		  <Direction>Downright</Direction>
+          <Direction>Downleft</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWNLEFT-DOWNRIGHT</Name>
+        <Directions>
+          <Direction>Downleft</Direction>
+		  <Direction>Downright</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>MOUVEMENT CONTRAINTE</Name>
+    <Childs>
+      <Child>
+        <Name>DOWNLEFT-DOWNRIGHT</Name>
+        <Directions>
+          <Direction>Downleft</Direction>
+		  <Direction>Downright</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWNRIGHT-DOWNLEFT</Name>
+        <Directions>
+		  <Direction>Downright</Direction>
+          <Direction>Downleft</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>UN DANSEUR</Name>
+    <Childs>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>DEUX DANSEURS</Name>
+    <Childs>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>TROIS DANSEURS</Name>
+    <Childs>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>QUATRE DANSEURS</Name>
+    <Childs>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>TOUS LES DANSEURS</Name>
+    <Childs>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWN</Name>
+        <Directions>
+          <Direction>Down</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>CONTACT TABLE/DANSEUR</Name>
+    <Childs>
+      <Child>
+        <Name>DOWNRIGHT</Name>
+        <Directions>
+		  <Direction>Downright</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWNLEFT</Name>
+        <Directions>
+          <Direction>Downleft</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  <Pattern>
+    <Name>CONTACT TABLE-DANSEUR</Name>
+    <Childs>
+      <Child>
+        <Name>DOWNLEFT</Name>
+        <Directions>
+          <Direction>Downleft</Direction>
+        </Directions>
+      </Child>
+      <Child>
+        <Name>DOWNRIGHT</Name>
+        <Directions>
+		  <Direction>Downright</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
+  <Pattern>
+    <Name>PLAY-PAUSE</Name>
+    <Childs>
+      <Child>
+        <Name>TAP</Name>
+        <Directions>
+          <Direction>TAP</Direction>
+        </Directions>
+      </Child>
+    </Childs>
+  </Pattern>
+  
 </Patterns>
\ No newline at end of file
--- a/src/FingersDance.GestureControl/SurfaceGestureVector.cs	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance.GestureControl/SurfaceGestureVector.cs	Fri Nov 06 17:50:40 2009 +0100
@@ -12,5 +12,6 @@
     {
         public SurfaceGestureVectorDirection Direction { get; set; }
         public Double Lenght { get; set; }
+        public SurfaceGesturePoint Origin { get; set; }
     }
 }
--- a/src/FingersDance.GestureControl/SurfaceGestureVectorDirection.cs	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance.GestureControl/SurfaceGestureVectorDirection.cs	Fri Nov 06 17:50:40 2009 +0100
@@ -18,7 +18,7 @@
         UPRIGHT,
         DOWNLEFT,
         DOWNRIGHT,
+        TAP,
         NONE,
-        TAP,
     }
 }
--- a/src/FingersDance/Resources/menu.xml	Thu Nov 05 22:40:36 2009 +0100
+++ b/src/FingersDance/Resources/menu.xml	Fri Nov 06 17:50:40 2009 +0100
@@ -153,6 +153,12 @@
                   <Action>ActionStartOrEndAnnotation</Action>
                 </Item>
                 <Item>
+                  <Name>Choutes avec la pesanteur</Name>
+                  <Items/>
+                  <Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+                  <Action>ActionStartOrEndAnnotation</Action>
+                </Item>
+                <Item>
                   <Name>Alignements</Name>
                   <Items/>
                   <Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>