Kinect Body Tracking  1.0
 All Classes Functions
shahqaan.kinect.DrawableSkeleton Class Reference

Inherits shahqaan.kinect.AbstractDrawable.

Public Member Functions

void drawSkeleton (Graphics2D g2d, HashMap< SkeletonJoint, SkeletonJointPosition > skel, Skeletons skeletons)
 
void drawLine (Graphics2D g2d, HashMap< SkeletonJoint, SkeletonJointPosition > skel, SkeletonJoint j1, SkeletonJoint j2, Skeletons skeletons)
 

Detailed Description

Author
Shahqaan Qasim

Definition at line 17 of file DrawableSkeleton.java.

Member Function Documentation

void shahqaan.kinect.DrawableSkeleton.drawLine ( Graphics2D  g2d,
HashMap< SkeletonJoint, SkeletonJointPosition >  skel,
SkeletonJoint  j1,
SkeletonJoint  j2,
Skeletons  skeletons 
)
Parameters
g2d
skel
j1
j2
skeletons

Implements shahqaan.kinect.AbstractDrawable.

Definition at line 47 of file DrawableSkeleton.java.

50  {
51  Point3D p1 = skeletons.getJointPos(skel, j1);
52  Point3D p2 = skeletons.getJointPos(skel, j2);
53  if ((p1 != null) && (p2 != null)) {
54  g2d.drawLine((int) p1.getX(), (int) p1.getY(),
55  (int) p2.getX(), (int) p2.getY());
56  }
57  } // end of drawLine()
void shahqaan.kinect.DrawableSkeleton.drawSkeleton ( Graphics2D  g2d,
HashMap< SkeletonJoint, SkeletonJointPosition >  skel,
Skeletons  skeletons 
)
Parameters
g2d
skel
skeletons

Implements shahqaan.kinect.AbstractDrawable.

Definition at line 20 of file DrawableSkeleton.java.

21  {
22  drawLine(g2d, skel, SkeletonJoint.HEAD, SkeletonJoint.NECK, skeletons);
23 
24  drawLine(g2d, skel, SkeletonJoint.LEFT_SHOULDER, SkeletonJoint.TORSO, skeletons);
25  drawLine(g2d, skel, SkeletonJoint.RIGHT_SHOULDER, SkeletonJoint.TORSO, skeletons);
26 
27  drawLine(g2d, skel, SkeletonJoint.NECK, SkeletonJoint.LEFT_SHOULDER, skeletons);
28  drawLine(g2d, skel, SkeletonJoint.LEFT_SHOULDER, SkeletonJoint.LEFT_ELBOW, skeletons);
29  drawLine(g2d, skel, SkeletonJoint.LEFT_ELBOW, SkeletonJoint.LEFT_HAND, skeletons);
30 
31  drawLine(g2d, skel, SkeletonJoint.NECK, SkeletonJoint.RIGHT_SHOULDER, skeletons);
32  drawLine(g2d, skel, SkeletonJoint.RIGHT_SHOULDER, SkeletonJoint.RIGHT_ELBOW, skeletons);
33  drawLine(g2d, skel, SkeletonJoint.RIGHT_ELBOW, SkeletonJoint.RIGHT_HAND, skeletons);
34 
35  drawLine(g2d, skel, SkeletonJoint.LEFT_HIP, SkeletonJoint.TORSO, skeletons);
36  drawLine(g2d, skel, SkeletonJoint.RIGHT_HIP, SkeletonJoint.TORSO, skeletons);
37  drawLine(g2d, skel, SkeletonJoint.LEFT_HIP, SkeletonJoint.RIGHT_HIP, skeletons);
38 
39  drawLine(g2d, skel, SkeletonJoint.LEFT_HIP, SkeletonJoint.LEFT_KNEE, skeletons);
40  drawLine(g2d, skel, SkeletonJoint.LEFT_KNEE, SkeletonJoint.LEFT_FOOT, skeletons);
41 
42  drawLine(g2d, skel, SkeletonJoint.RIGHT_HIP, SkeletonJoint.RIGHT_KNEE, skeletons);
43  drawLine(g2d, skel, SkeletonJoint.RIGHT_KNEE, SkeletonJoint.RIGHT_FOOT, skeletons);
44  } // end of drawSkeleton()

The documentation for this class was generated from the following file: