FingertipDistanceRelationListExtension.Add Method

Definition

Overloads

Add(ICollection<PoseConstraint>, Finger, RelativeDistance, Finger)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between finger and otherFinger.

Add(ICollection<PoseConstraint>, Finger, RelativeDistance, IEnumerable<Finger>)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between finger and each of the otherFingers.

Add(ICollection<PoseConstraint>, FingersContext, RelativeDistance, FingersContext)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between the fingers in context and the fingers in otherContext.

Add(ICollection<PoseConstraint>, IEnumerable<Finger>, RelativeDistance, Finger)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between each finger in fingers and otherFinger.

Add(ICollection<PoseConstraint>, IEnumerable<Finger>, RelativeDistance, IEnumerable<Finger>)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between each finger in fingers and each finger in otherFingers.

Add(ICollection<PoseConstraint>, Finger, RelativeDistance, Finger)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between finger and otherFinger.

public static void Add (this System.Collections.Generic.ICollection<Microsoft.Gestures.PoseConstraint> poseConstraints, Microsoft.Gestures.Finger finger, Microsoft.Gestures.RelativeDistance distanceRelation, Microsoft.Gestures.Finger otherFinger);

Parameters

poseConstraints
System.Collections.Generic.ICollection<PoseConstraint>

An existing collection of PoseConstraint objects, this will often be the PoseConstraints property.

finger
Finger

The first Finger participating in the FingertipDistanceRelation constraint.

distanceRelation
RelativeDistance

The relation that the new FingertipDistanceRelation constraint will impose between finger and otherFinger.

otherFinger
Finger

The second Finger participating in the FingertipDistanceRelation constraint.

Remarks

This extension method is a handy way to augment an existing HandPose with a new FingertipDistanceRelation constraint:

var handPose = new HandPose("MyPose");
// will be satisfied whenever the index fingertip is not touching the middle fingertip
handPose.PoseConstraints.Add(Finger.Index, RelativeDistance.NotTouching, Finger.Middle);

Applies to

Add(ICollection<PoseConstraint>, Finger, RelativeDistance, IEnumerable<Finger>)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between finger and each of the otherFingers.

public static void Add (this System.Collections.Generic.ICollection<Microsoft.Gestures.PoseConstraint> poseConstraints, Microsoft.Gestures.Finger finger, Microsoft.Gestures.RelativeDistance distanceRelation, System.Collections.Generic.IEnumerable<Microsoft.Gestures.Finger> otherFingers);

Parameters

poseConstraints
System.Collections.Generic.ICollection<PoseConstraint>

An existing collection of PoseConstraint objects, this will often be the PoseConstraints property.

finger
Finger

A Finger participating in this constraint.

distanceRelation
RelativeDistance

The relation that the new FingertipDistanceRelation constraint will impose between finger and each of otherFingers.

otherFingers
System.Collections.Generic.IEnumerable<Finger>

All fingers enumerated here will be required to comply to the distanceRelation with respect to finger.

Remarks

This extension method is a handy way to augment an existing HandPose with a new FingertipDistanceRelation constraint:

var handPose = new HandPose("MyPose");
// will be satisfied when the thumb is not touching both ring and pinky fingers
handPose.PoseConstraints.Add(Finger.Thumb, RelativeDistance.NotTouching, new[] {Finger.Ring, Finger.Pinky});

Applies to

Add(ICollection<PoseConstraint>, FingersContext, RelativeDistance, FingersContext)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between the fingers in context and the fingers in otherContext.

public static void Add (this System.Collections.Generic.ICollection<Microsoft.Gestures.PoseConstraint> poseConstraints, Microsoft.Gestures.FingersContext context, Microsoft.Gestures.RelativeDistance distanceRelation, Microsoft.Gestures.FingersContext otherContext = null);

Parameters

poseConstraints
System.Collections.Generic.ICollection<PoseConstraint>

An existing collection of PoseConstraint objects, this will often be the PoseConstraints property.

context
FingersContext

The first FingersContext participating in the FingertipDistanceRelation constraint.

distanceRelation
RelativeDistance

The relation that the new FingertipDistanceRelation constraint will impose between context and otherContext.

otherContext
FingersContext

The second FingersContext participating in the FingertipDistanceRelation new constraint. If this parameter is null, context will be used in its place and distanceRelation will be applied between the fingers of context and themselves (for more information on finger context types, refer to documentation).

Remarks

This extension method is a handy way to augment an existing HandPose with a new FingertipDistanceRelation constraint:

var handPose = new HandPose("MyPose");
// will be satisfied when either of the non-thumb fingers touches the thumb
handPose.PoseConstraints.Add(new AnyFingersContext(), RelativeDistance.Touching, new SingleFingerContext(thumb));

Applies to

Add(ICollection<PoseConstraint>, IEnumerable<Finger>, RelativeDistance, Finger)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between each finger in fingers and otherFinger.

public static void Add (this System.Collections.Generic.ICollection<Microsoft.Gestures.PoseConstraint> poseConstraints, System.Collections.Generic.IEnumerable<Microsoft.Gestures.Finger> fingers, Microsoft.Gestures.RelativeDistance distanceRelation, Microsoft.Gestures.Finger otherFinger);

Parameters

poseConstraints
System.Collections.Generic.ICollection<PoseConstraint>

An existing collection of PoseConstraint objects, this will often be the PoseConstraints property.

fingers
System.Collections.Generic.IEnumerable<Finger>

>All fingers enumerated here will be required to comply to the distanceRelation with respect to otherFinger.

distanceRelation
RelativeDistance

The relation that the new FingertipDistanceRelation constraint will impose between each of fingers and otherFinger.

otherFinger
Finger

A Finger participating in this constraint.

Remarks

This extension method is a handy way to augment an existing HandPose with a new FingertipDistanceRelation constraint:

var handPose = new HandPose("MyPose");
// will be satisfied when the thumb is not touching both ring and pinky fingers
handPose.PoseConstraints.Add(new[] {Finger.Ring, Finger.Pinky}, RelativeDistance.NotTouching, Finger.Thumb);

Applies to

Add(ICollection<PoseConstraint>, IEnumerable<Finger>, RelativeDistance, IEnumerable<Finger>)

Creates and adds to the poseConstraints collection a new FingertipDistanceRelation constraint, imposing distanceRelation between each finger in fingers and each finger in otherFingers.

public static void Add (this System.Collections.Generic.ICollection<Microsoft.Gestures.PoseConstraint> poseConstraints, System.Collections.Generic.IEnumerable<Microsoft.Gestures.Finger> fingers, Microsoft.Gestures.RelativeDistance distanceRelation, System.Collections.Generic.IEnumerable<Microsoft.Gestures.Finger> otherFingers = null);

Parameters

poseConstraints
System.Collections.Generic.ICollection<PoseConstraint>

An existing collection of PoseConstraint objects, this will often be the PoseConstraints property.

fingers
System.Collections.Generic.IEnumerable<Finger>

The first set of fingers participating in the FingertipDistanceRelation constraint.

distanceRelation
RelativeDistance

The relation that the new FingertipDistanceRelation constraint will impose between each finger in fingers and each finger in otherFingers.

otherFingers
System.Collections.Generic.IEnumerable<Finger>

The second set of fingers participating in the FingertipDistanceRelation constraint. If this parameter is null, distanceRelation relation will be imposed on all pairs of fingers from within the fingers collection.

Remarks

This extension method is a handy way to augment an existing HandPose with a new FingertipDistanceRelation constraint:

var handPose = new HandPose("MyPose");
// will be satisfied when neither thumb nor index fingers are touching any of the middle, ring and pinky fingers
handPose.PoseConstraints.Add(new[] {Finger.Thumb, Finger.Index}, RelativeDistance.NotTouching, new[] {Finger.Middle, Finger.Ring, Finger.Pinky}); 

Applies to