FingertipDistanceRelation Class

Definition

Represents a constraint describing the distance between fingers.

public class FingertipDistanceRelation : Microsoft.Gestures.FingersRelation<Microsoft.Gestures.RelativeDistance>
Inheritance

Remarks

The FingertipDistanceRelation constraint can be used to indicate whether certain fingers are Touching or NotTouching each other. For example, to specify a HandPose which will be triggered when the user's thumb is pinching the user's index finger, refer to the following snippet:

var pinchPose = new HandPose("Pinch", new FingertipDistanceRelation(Finger.Index, RelativeDistance.Touching, Finger.Thumb)); // the index and thumb tips are touching

It is possible to omit the OtherContext of the FingertipDistanceRelation constraint (by setting its value to null). Defining a FingertipDistanceRelation constraint this way would imply that the fingers mentioned in Context are required to attain the specified DistanceRelation with respect to themselves. To illustrate this, consider the following code snippet, utilizing the different types of FingersContext:

var allTouchAll = new FingertipDistanceRelation(new AllFingersContext(new[] {Finger.Thumb, Finger.Index, Finger.Middle})); // all possible finger pairs are expected to be touching
var anyTouchAny = new FingerTipDistanceRelation(new AnyFingersContext(new[] {Finger.Thumb, Finger.Index, Finger.Middle})); // at least one of the possible finger pairs is expected to be touching

Note that FingertipDistanceRelation 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

FingertipDistanceRelation()

Creates a blank instance of FingertipDistanceRelation. In order to obtain a meaningful constraint, the values of Context, DistanceRelation and optionally OtherContext would have to be set manually.

FingertipDistanceRelation(Finger, RelativeDistance, Finger)

Creates a new instance of a FingertipDistanceRelation constraint, imposing the distanceRelation relation between finger and otherFinger.

FingertipDistanceRelation(Finger, RelativeDistance, IEnumerable<Finger>)

Creates a new instance of a FingertipDistanceRelation constraint, imposing the distanceRelation relation between finger and each of the otherFingers.

FingertipDistanceRelation(FingersContext, RelativeDistance, FingersContext)

Creates a new instance of a FingertipDistanceRelation constraint, imposing the distanceRelation relation between the fingers indicated by context and the fingers indicated by otherContext.

FingertipDistanceRelation(IEnumerable<Finger>, RelativeDistance, Finger)

Creates a new instance of a FingertipDistanceRelation constraint, imposing the distanceRelation relation between each of the fingers and otherFinger.

FingertipDistanceRelation(IEnumerable<Finger>, RelativeDistance, IEnumerable<Finger>)

Creates a new instance of a FingertipDistanceRelation constraint, imposing the distanceRelation relation between each of the fingers and each of the otherFingers.

Fields

_relation (Inherited from FingersRelation<TRelationEnum>)

Properties

Context

The first set of fingers participating in this FingersRelation<TRelationEnum> constraint.

(Inherited from FingersRelation<TRelationEnum>)
DistanceRelation

Specifies the relation this FingertipDistanceRelation imposes between the fingers indicated by Context and the fingers indicated by OtherContext.

IsFrozen (Inherited from GesturesFrameworkObject)
OtherContext

The second set of fingers participating in this FingersRelation<TRelationEnum> constraint.

(Inherited from FingersRelation<TRelationEnum>)

Methods

CalculateHashCode() (Inherited from FingersRelation<TRelationEnum>)
DeepFreeze() (Inherited from FingersRelation<TRelationEnum>)
Equals(Object) (Inherited from GesturesFrameworkObject)
EqualsInternal(Object) (Inherited from FingersRelation<TRelationEnum>)
Freeze() (Inherited from GesturesFrameworkObject)
GetHashCode() (Inherited from GesturesFrameworkObject)
ToString()

Returns a String representation of this FingersRelation<TRelationEnum> instance.

(Inherited from FingersRelation<TRelationEnum>)
ValidateCore()
VerifyNotFrozen(String) (Inherited from GesturesFrameworkObject)

Explicit Interface Implementations

IValidatable.Validate() (Inherited from GesturesFrameworkObject)

Applies to