CEWorkbench.SkeletonDrawer.DrawSkeleton C# (CSharp) Method

DrawSkeleton() public method

public DrawSkeleton ( Microsoft.Kinect.Skeleton skeleton, System.Windows.Media.DrawingContext drawingContext ) : void
skeleton Microsoft.Kinect.Skeleton
drawingContext System.Windows.Media.DrawingContext
return void
        public void DrawSkeleton(Skeleton skeleton, DrawingContext drawingContext)
        {
            if (skeleton == null)
            return;

              // Render Torso
              this.drawBone(skeleton, drawingContext, JointType.Head, JointType.ShoulderCenter);
              this.drawBone(skeleton, drawingContext, JointType.ShoulderCenter, JointType.ShoulderLeft);
              this.drawBone(skeleton, drawingContext, JointType.ShoulderCenter, JointType.ShoulderRight);
              this.drawBone(skeleton, drawingContext, JointType.ShoulderCenter, JointType.Spine);
              this.drawBone(skeleton, drawingContext, JointType.Spine, JointType.HipCenter);
              this.drawBone(skeleton, drawingContext, JointType.HipCenter, JointType.HipLeft);
              this.drawBone(skeleton, drawingContext, JointType.HipCenter, JointType.HipRight);

              // Left Arm
              this.drawBone(skeleton, drawingContext, JointType.ShoulderLeft, JointType.ElbowLeft);
              this.drawBone(skeleton, drawingContext, JointType.ElbowLeft, JointType.WristLeft);
              this.drawBone(skeleton, drawingContext, JointType.WristLeft, JointType.HandLeft);

              // Right Arm
              this.drawBone(skeleton, drawingContext, JointType.ShoulderRight, JointType.ElbowRight);
              this.drawBone(skeleton, drawingContext, JointType.ElbowRight, JointType.WristRight);
              this.drawBone(skeleton, drawingContext, JointType.WristRight, JointType.HandRight);

              // Left Leg
              this.drawBone(skeleton, drawingContext, JointType.HipLeft, JointType.KneeLeft);
              this.drawBone(skeleton, drawingContext, JointType.KneeLeft, JointType.AnkleLeft);
              this.drawBone(skeleton, drawingContext, JointType.AnkleLeft, JointType.FootLeft);

              // Right Leg
              this.drawBone(skeleton, drawingContext, JointType.HipRight, JointType.KneeRight);
              this.drawBone(skeleton, drawingContext, JointType.KneeRight, JointType.AnkleRight);
              this.drawBone(skeleton, drawingContext, JointType.AnkleRight, JointType.FootRight);

              // Render Joints
              foreach (Joint joint in skeleton.Joints)
              {
            Brush drawBrush = null;

            if (joint.TrackingState == JointTrackingState.Tracked)
            {
              drawBrush = this.trackedJointBrush;
            }
            else if (joint.TrackingState == JointTrackingState.Inferred)
            {
              drawBrush = this.inferredJointBrush;
            }

            if (drawBrush != null)
            {
              drawingContext.DrawEllipse(drawBrush, null, this.SkeletonPointToScreen(joint.Position), JOINT_THINCKNESS, JOINT_THINCKNESS);
            }
              }
        }