public GestureComponentState(GestureComponent component) { _component = component; Reset(); }
public Gesture ParseGestureComponentsFromXml(XmlReader reader, Gesture gesture) { var firstjoint = reader.GetAttribute("FirstJoint"); var secondjoint = reader.GetAttribute("SecondJoint"); JointType firstjointtype; JointType secondjointtype; GestureComponent component; if (firstjoint != null) { firstjointtype = (JointType)(Enum.Parse(typeof(JointType), firstjoint)); Messages.Add("First Joint: " + firstjoint); } else { return(gesture); } if (secondjoint != null) { secondjointtype = (JointType)(Enum.Parse(typeof(JointType), secondjoint)); Messages.Add("Second Joint: " + secondjoint); } else { return(gesture); } var beginningrelationship = reader.GetAttribute("BeginningRelationship"); var endingrelationship = reader.GetAttribute("EndingRelationship"); var endingrelationshippos = JointRelationship.None; var beginningrelationshippos = JointRelationship.None; if (endingrelationship != null) { endingrelationshippos = (JointRelationship)(Enum.Parse(typeof(JointRelationship), endingrelationship)); Messages.Add("Ending Relationship: " + endingrelationship); } if (beginningrelationship != null) { beginningrelationshippos = (JointRelationship)(Enum.Parse(typeof(JointRelationship), beginningrelationship)); Messages.Add("Beginning Relationship: " + beginningrelationship); } if (beginningrelationshippos != JointRelationship.None) { component = new GestureComponent(firstjointtype, secondjointtype, endingrelationshippos, beginningrelationshippos); } else { component = new GestureComponent(firstjointtype, secondjointtype, endingrelationshippos); } gesture.Components.Add(component); Messages.Add("Component added to gesture:" + gesture.Description); return(gesture); }
public Gesture ParseGestureComponentsFromXml(XmlReader reader, Gesture gesture) { var firstjoint = reader.GetAttribute("FirstJoint"); var secondjoint = reader.GetAttribute("SecondJoint"); JointType firstjointtype; JointType secondjointtype; GestureComponent component; if (firstjoint != null) { firstjointtype = (JointType)(Enum.Parse(typeof(JointType), firstjoint)); Messages.Add("First Joint: " + firstjoint); } else { return gesture; } if (secondjoint != null) { secondjointtype = (JointType)(Enum.Parse(typeof(JointType), secondjoint)); Messages.Add("Second Joint: " + secondjoint); } else { return gesture; } var beginningrelationship = reader.GetAttribute("BeginningRelationship"); var endingrelationship = reader.GetAttribute("EndingRelationship"); var endingrelationshippos = JointRelationship.None; var beginningrelationshippos = JointRelationship.None; if (endingrelationship != null) { endingrelationshippos = (JointRelationship)(Enum.Parse(typeof(JointRelationship), endingrelationship)); Messages.Add("Ending Relationship: " + endingrelationship); } if (beginningrelationship != null) { beginningrelationshippos = (JointRelationship)(Enum.Parse(typeof(JointRelationship), beginningrelationship)); Messages.Add("Beginning Relationship: " + beginningrelationship); } if (beginningrelationshippos != JointRelationship.None) { component = new GestureComponent(firstjointtype, secondjointtype, endingrelationshippos, beginningrelationshippos); } else { component = new GestureComponent(firstjointtype, secondjointtype, endingrelationshippos); } gesture.Components.Add(component); Messages.Add("Component added to gesture:" + gesture.Description); return gesture; }