/// <summary> /// Draws a body /// </summary> /// <param name="joints">joints to draw</param> /// <param name="jointPoints">translated positions of joints to draw</param> /// <param name="drawingContext">drawing context to draw to</param> /// <param name="drawingPen">specifies color to draw a specific body</param> private void DrawBody(IReadOnlyDictionary <JointType, Joint> joints, IDictionary <JointType, Point> jointPoints, DrawingContext drawingContext, Pen drawingPen) { // Draw the bones foreach (var bone in this.bones) { this.DrawBone(joints, jointPoints, bone.Item1, bone.Item2, drawingContext, drawingPen); } // Draw the joints foreach (JointType jointType in joints.Keys) { Brush drawBrush = null; TrackingState trackingState = joints[jointType].TrackingState; if (trackingState == TrackingState.Tracked) { drawBrush = this.trackedJointBrush; } else if (trackingState == TrackingState.Inferred) { drawBrush = this.inferredJointBrush; } if (drawBrush != null) { drawingContext.DrawEllipse(drawBrush, null, jointPoints[jointType], JointThickness, JointThickness); } } //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx // Basically creates joints that need tracking // Every trackable joint that is. CameraSpacePoint Head = joints[JointType.Head].Position; CameraSpacePoint Neck = joints[JointType.Neck].Position; CameraSpacePoint SpineShoulder = joints[JointType.SpineShoulder].Position; CameraSpacePoint SpineMid = joints[JointType.SpineMid].Position; CameraSpacePoint SpineBase = joints[JointType.SpineBase].Position; CameraSpacePoint RightShoulder = joints[JointType.ShoulderRight].Position; CameraSpacePoint LeftShoulder = joints[JointType.ShoulderLeft].Position; CameraSpacePoint RightElbow = joints[JointType.ElbowRight].Position; CameraSpacePoint LeftElbow = joints[JointType.ElbowLeft].Position; CameraSpacePoint RightWrist = joints[JointType.WristRight].Position; CameraSpacePoint LeftWrist = joints[JointType.WristLeft].Position; CameraSpacePoint RightHand = joints[JointType.HandRight].Position; CameraSpacePoint LeftHand = joints[JointType.HandLeft].Position; CameraSpacePoint RightThumb = joints[JointType.ThumbRight].Position; CameraSpacePoint LeftThumb = joints[JointType.ThumbLeft].Position; CameraSpacePoint RightHandTip = joints[JointType.HandTipRight].Position; CameraSpacePoint LeftHandTip = joints[JointType.HandTipLeft].Position; CameraSpacePoint RightHip = joints[JointType.HipRight].Position; CameraSpacePoint LeftHip = joints[JointType.HipLeft].Position; CameraSpacePoint RightKnee = joints[JointType.KneeRight].Position; CameraSpacePoint LeftKnee = joints[JointType.KneeLeft].Position; CameraSpacePoint RightAnkle = joints[JointType.AnkleRight].Position; CameraSpacePoint LeftAnkle = joints[JointType.AnkleLeft].Position; CameraSpacePoint RightFoot = joints[JointType.FootRight].Position; CameraSpacePoint LeftFoot = joints[JointType.FootLeft].Position; // if program session has 'started' then if (started) { if (marking) { dataHandler.AddJointData(DateTime.Now.ToString("hh:mm:ss.ffffzzz"), Head, Neck, SpineShoulder, SpineMid, SpineBase, RightShoulder, LeftShoulder, RightElbow, LeftElbow, RightWrist, LeftWrist, RightHand, LeftHand, RightThumb, LeftThumb, RightHandTip, LeftHandTip, RightHip, LeftHip, RightKnee, LeftKnee, RightAnkle, LeftAnkle, RightFoot, LeftFoot, true); } else { dataHandler.AddJointData(DateTime.Now.ToString("hh:mm:ss.ffffzzz"), Head, Neck, SpineShoulder, SpineMid, SpineBase, RightShoulder, LeftShoulder, RightElbow, LeftElbow, RightWrist, LeftWrist, RightHand, LeftHand, RightThumb, LeftThumb, RightHandTip, LeftHandTip, RightHip, LeftHip, RightKnee, LeftKnee, RightAnkle, LeftAnkle, RightFoot, LeftFoot, false); } } //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx }