FingerPose Class

Definition

Represents a constraint describing the flexion and pointing direction of a subset of fingers.

public class FingerPose : Microsoft.Gestures.HandPartPose<Microsoft.Gestures.FingersContext>
Inheritance

Remarks

A FingerPose constraint refers to a set of fingers, defined by the Context property, it specifies the direction of these fingers, as defined by the Direction property, and their flexion state (the degree to which a fingers is open or folded), as defined by the Flexion property. Note that when the Direction value is set to Undefined, the constraint implies no restriction of the direction for fingers mentioned in Context.

The following code defines a HandPose with a single FingerPose constraint that is actualized when both the index and thumb fingers are open and pointing forward:

var myPose = new HandPose("MyPose", new FingerPose(new[] {Finger.Index, Finger.Thumb}, FingerFlexion.Open, PoseDirection.Forward));

The FingerPose constraint in the example above restricts the pose of only the index and thumb fingers. As soon as the camera sees a hand whose index and thumb fingers are open and pointing forward, the encompassing Gesture object's state-machine can advance to myPose, regardless of the state of the other fingers. To generalize, all the fingers which are not participating in the Context of a FingerPose are free to assume any state of flexion and point in any direction (unless constrained by a different FingerPose instance).

Note that specifying a FingerPose constraint with a Flexion value of Folded (or FoldedTucked) and in parallel a Direction value other than Undefined is ill-advised. This is because a folded finger cannot be meaningfully said to point in any particular direction. In addition, the tips of folded fingers are very likely to be hidden from the camera, making the estimated values of their directions unreliable.

Note that FingerPose instances are mutable until the containing Gesture object is registered with the gestures runtime, at which point it becomes frozen and cannot be modified any longer.

Constructors

FingerPose()

Creates a blank FingerPose constraint. In order to obtain a meaningful constraint, the values of Context, Direction and\or Flexion would have to be set manually.

FingerPose(Finger, FingerFlexion, PoseDirection)

Creates a new FingerPose constraint which requires finger to attain the specified flexion state and to be aligned with direction.

FingerPose(Finger, PoseDirection)

Creates a new FingerPose constraint which requires finger to be aligned with direction.

FingerPose(FingersContext, FingerFlexion, PoseDirection)

Creates a new FingerPose constraint which requires the fingers indicated by fingersContext to attain the specified flexion state and to be aligned with the given direction. When an AnyFingerContext is passed for the fingersContext argument, the resulting constraint will require least one finger mentioned in fingersContext to comply with flexion and direction.

FingerPose(FingersContext, PoseDirection)

Creates a new FingerPose constraint which requires the fingers indicated by fingersContext to be aligned with direction. When an AnyFingerContext is passed for the fingersContext argument, the resulting constraint will require at least one finger mentioned in fingersContext to be aligned with direction.

FingerPose(IEnumerable<Finger>, FingerFlexion, PoseDirection)

Creates a new FingerPose constraint which requires each of the given fingers to attain the specified flexion state and to be aligned with the given direction.

FingerPose(IEnumerable<Finger>, PoseDirection)

Creates a new FingerPose constraint which requires each of the given fingers to be aligned with direction.

Fields

DefaultPoseDirection (Inherited from HandPartPose<ContextType>)

Properties

Context

Indicates which parts of the hand this constraint refers to: either SingleHandContext, AnyHandContext or AllHandsContext in case for a PalmPose constraint and either SingleFingerContext, AnyFingerContext or AllFingersContext for a FingerPose constraint.

(Inherited from HandPartPose<ContextType>)
Direction

The direction of this hand part: Either the palm normal in case of a PalmPose or the direction at which the fingers are pointing in case of a FingerPose.

(Inherited from HandPartPose<ContextType>)
Flexion

Specifies the FingerFlexion state (the degree to which a finger is open or folded) which will be associated with the fingers indicated by Context.

IsFrozen (Inherited from GesturesFrameworkObject)

Methods

CalculateHashCode()
DeepFreeze() (Inherited from HandPartPose<ContextType>)
Equals(Object) (Inherited from GesturesFrameworkObject)
EqualsInternal(Object)
Freeze() (Inherited from GesturesFrameworkObject)
GetHashCode() (Inherited from GesturesFrameworkObject)
ToString()

Returns a String representation of this FingerPose constraint.

ValidateCore()
VerifyNotFrozen(String) (Inherited from GesturesFrameworkObject)

Explicit Interface Implementations

IValidatable.Validate() (Inherited from GesturesFrameworkObject)

Applies to