//Loads gestures into GestureSet public static void loadGestures(ref GestureSet<double> gestures) { gestures = new GestureSet<double>(); XmlDocument doc = new XmlDocument(); doc.Load("gestures.xml"); XmlNodeList nl = doc.GetElementsByTagName("gesture"); foreach(XmlNode n in nl){ XmlAttributeCollection collection = n.Attributes; Gesture<double> g = new Gesture<double>(collection[0].InnerText); gestures.gestures.Add(g); Unistroke<double> u = new Unistroke<double>(); foreach(XmlNode k in n.ChildNodes){ XmlAttributeCollection points = k.Attributes; u.trace.Add(new Unistroke<double>.Point3<double>(Double.Parse(points[0].InnerText), Double.Parse(points[1].InnerText), Double.Parse(points[2].InnerText))); } g.unistrokes.Add(u); } }
void Awake() { views = new string[2]{"Gesture Template", "Vectorized Resample"}; view = 0; Set=(GestureSet)target; SetColors(); LoadTextures(); BuildStyles(); SetupDisplayOptions(); }
public static void Init(GestureSet Set) { Ready = false; ResampleSize = Set.ResampleSize; ScaleSize = Set.ScaleSize; RejectionWindow = Set.RejectionWindow; UseDymanicTimeWarp = Set.UseDymanicTimeWarp; rotationInvariant = Set.rotationInvariant; InputPath = new List<Vector2>(); Templates = Set.Templates; ResampledTemplates = new List<Gesture>(); foreach(Gesture gesture in Templates) { //Debug.Log("HyperGlyph: Normalizing and Adding " + gesture.Name); Gesture tempResampledGest = new Gesture(); tempResampledGest.Name = gesture.Name; tempResampledGest.Points = Normalize(gesture.Points); ResampledTemplates.Add(tempResampledGest); } //Debug.Log("HyperGlyph: Finished initialization."); Ready = true; }