public AlignmentCriterion(XmlJointType centerJoint, XmlJointType[] joints, float variance) : base(variance) { this.Alignment = Alignment.Point; this.CenterJoint = centerJoint; this.Joints = joints; }
/// <summary> /// Constructor used for testing /// </summary> /// <param name="angle"></param> /// <param name="vertex"></param> /// <param name="otherJoints"></param> public AngleCriterion(float angle, XmlJointType vertex, XmlJointType[] otherJoints, float variance) : base(variance) { this.Angle = angle; this.Vertex = vertex; this.OtherJoints = new XmlJointType[2]; for (int i = 0; i < 2; i++) { this.OtherJoints[i] = otherJoints[i]; } }
/// <summary> /// Will take the first two joints of the "otherJoints" Array /// </summary> /// <param name="angle"></param> /// <param name="vertex"></param> /// <param name="otherJoints"></param> public AngleCriterion(float angle, XmlJointType vertex, XmlJointType[] otherJoints, float variance) : base(variance) { this.Angle = angle; this.Vertex = vertex; this.OtherJoints = new XmlJointType[2]; for (int i = 0; i < 2; i++) { this.OtherJoints[i] = otherJoints[i]; } }
public void Init() { //Load test exercise from XML XmlSerializer serializer = new XmlSerializer(typeof(Exercise)); StreamReader reader = new StreamReader(Directory + "EXELAE.xml"); // deserialize the xml and create an Exercise Exercise = (Exercise)serializer.Deserialize(reader); // create vertical alignment criterion XmlJointType[] RightHipAndAnkle = new XmlJointType[2]; RightHipAndAnkle[0] = new XmlJointType(JointType.HipRight.ToString()); RightHipAndAnkle[1] = new XmlJointType(JointType.AnkleRight.ToString()); VerticalAlignmentCriterion = new AlignmentCriterion(RightHipAndAnkle, Alignment.Vertical, TestVariance); // create horizontal alignment criterion HorizontalAlignmentCriterion = new AlignmentCriterion(RightHipAndAnkle, Alignment.Horizontal, TestVariance); // create three joint alignment criterion XmlJointType RightKnee = new XmlJointType(JointType.KneeRight.ToString()); ThreeJointAlignmentCriterion = new AlignmentCriterion(RightKnee, RightHipAndAnkle, TestVariance); // create angle criterion AngleCriterion = new AngleCriterion(90, RightKnee, RightHipAndAnkle, TestVariance); }
public AlignmentCriterion(XmlJointType[] joints, Alignment alignment, float variance) : base(variance) { this.Alignment = alignment; this.Joints = joints; }