Exemple #1
0
        public Unistroke SavePattern(string name, IEnumerable <Vector2> points)
        {
            Unistroke stroke = new Unistroke(name, points);

            /* int index = library.Count;
             * library.Add(stroke);
             *
             * List<int> examples = null;
             * if (_libraryIndex.ContainsKey(stroke.name))
             *  examples = _libraryIndex[stroke.name];
             * if (examples == null)
             * {
             *  examples = new List<int>();
             *  _libraryIndex[stroke.name] = examples;
             * }
             * stroke.ExampleIndex = examples.Count;
             * examples.Add(index); */

            return(stroke);
        }
Exemple #2
0
 public static float distanceAtAngle(Vector2[] points, Unistroke test, float angle)
 {
     Vector2[] rotated = new Vector2[points.Length];
     rotateBy(rotated, angle);
     return(pathDistance(rotated, test.points));
 }
Exemple #3
0
 public Result(Unistroke match, float score, float angle)
 {
     Match = match;
     Score = score;
     Angle = angle;
 }