public void AddGestureRule(AngleGestureRule gestureRule) { if (!gestureRules.Contains(gestureRule)) { gestureRules.Add(gestureRule); } }
public void AddChildJointAngleRule(Joint thisJoint, Joint otherJoint, ConnectedJoint otherConnectedJoint, double tolerance) { double angle = GetJointPairAngle(thisJoint, otherJoint); double[] rule = new double[] { angle - tolerance, angle + tolerance }; AngleGestureRule gestureRule = new AngleGestureRule(rule); AddChildJointRule(gestureRule, otherConnectedJoint); }
public void AddChildJointRule(AngleGestureRule gestureRule, ConnectedJoint connectedJoint) { ChildGestureRules childGestureRules = childGestureRulesCollection.Find(gr => gr.ChildID == connectedJoint.ID); if (childGestureRules != null) { childGestureRules.AddGestureRule(gestureRule); } else { childGestureRules = new ChildGestureRules(connectedJoint.ID, gestureRule); childGestureRulesCollection.Add(childGestureRules); } }
public bool RemoveGestureRule(AngleGestureRule gestureRule) { return(gestureRules.Remove(gestureRule)); }
public ChildGestureRules(int childID, AngleGestureRule gestureRule) { this.childID = childID; this.gestureRules = new List <AngleGestureRule>(); this.gestureRules.Add(gestureRule); }