/// <summary>
        /// Находит идеальный жест с помощью ключа
        /// </summary>
        /// <returns> Индекс жеста из списка идеальных жестов</returns>
        public int WhatIsItWithKey()
        {
            var    keyUsersGesture = KeyGestureConstruction.GetKeyForGesture(points);
            double minDist         = Int32.MaxValue;
            int    index           = -1;

            for (int i = 0; i < PGC.IdealGestures.Count; i++)
            {
                var temp = Distance.LevenshteinDistance(PGC.IdealGestures[i].Key, keyUsersGesture);
                if (minDist > temp)
                {
                    index   = i;
                    minDist = temp;
                }
            }
            return(index);
        }
        public int WhatIsItWithIdealKey()
        {
            if (points.Count == 0)
            {
                return(-1);
            }
            double minDist         = Int32.MaxValue;
            int    index           = -1;
            var    temp            = new IdentifyCharacteristicsPoints(points, count);
            var    newListPoints   = temp.GetIdentifyCharacteristicsPoints();
            var    keyIdealGesture = KeyGestureConstruction.GetKeyForGestureWithIdentifyPoints(newListPoints);

            for (int i = 0; i < PGC.IdealGestures.Count; i++)
            {
                var tempDist = Distance.LevenshteinDistance(PGC.IdealGestures[i].KeyIdeal, keyIdealGesture);
                if (minDist > tempDist)
                {
                    index   = i;
                    minDist = tempDist;
                }
            }
            return(index);
        }
Пример #3
0
 public void SetKeyIdeal()
 {
     KeyIdeal = KeyGestureConstruction.GetKeyForGestureWithIdentifyPoints(Points);
 }
Пример #4
0
 public IdealGesture(string name, List <Point> points)
 {
     Name   = name;
     Points = points;
     Key    = KeyGestureConstruction.GetKeyForGesture(points);
 }