本文整理汇总了C#中GestureType类的典型用法代码示例。如果您正苦于以下问题:C# GestureType类的具体用法?C# GestureType怎么用?C# GestureType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GestureType类属于命名空间,在下文中一共展示了GestureType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisableGestureRecognition
/// <summary>
/// Disable the recognition of a specific gesture
/// </summary>
/// <param name="gestureType">The type of gesture to disable</param>
public override void DisableGestureRecognition(GestureType gestureType)
{
switch (gestureType)
{
case GestureType.SwipeLeft:
if (!m_IsSwipeRightEnabled)
m_Controller.EnableGesture(Gesture.GestureType.TYPESWIPE, false);
m_IsSwipeLeftEnabled = false;
break;
case GestureType.SwipeRight:
if (!m_IsSwipeLeftEnabled)
m_Controller.EnableGesture(Gesture.GestureType.TYPESWIPE, false);
m_IsSwipeRightEnabled = false;
break;
case GestureType.Tap:
m_Controller.EnableGesture(Gesture.GestureType.TYPEKEYTAP, false);
break;
case GestureType.Push:
m_Controller.EnableGesture(Gesture.GestureType.TYPESCREENTAP, false);
break;
case GestureType.Circle:
m_Controller.EnableGesture(Gesture.GestureType.TYPECIRCLE, false);
break;
case GestureType.None:
throw new LeapException("None gesture is not implemented in the Leap Gesture API");
}
}
示例2: Gesture
public Gesture(GestureType type, IGestureSegment[] segments)
{
_type = type;
_segments = segments;
_name = type.ToString();
}
示例3: AddGesture
/// <summary>
/// Adds the gesture.
/// </summary>
/// <param name="type">The gesture type.</param>
/// <param name="gestureDefinition">The gesture definition.</param>
public void AddGesture(GestureType type, IRelativeGestureSegment gestureDefinition)
{
Gesture gesture = new Gesture(type, gestureDefinition);
//gesture.GestureRecognized += new EventHandler<GestureEventArgs>(this.Gesture_GestureRecognized);
gesture.GestureRecognized += OnGestureRecognized;
this.gestures.Add(gesture);
}
示例4: OnGesture
public void OnGesture(GestureType gestureType)
{
if (gestureType == GestureType.ExplodeIn)
ExplodeIn(() => { });
if (gestureType == GestureType.ExplodeOut)
ExplodeOut(() => { });
}
示例5: VideoWindow
public VideoWindow(GestureDirection direction, GestureType type)
{
InitializeComponent();
this.Title = type + " " + direction;
vlc = new AxVLCPlugin2();
formHost.Child = vlc;
vlc.CreateControl();
var videoPath = CreateUriTo(type, direction);
MoveScreen(true);
GestureParser.Pause(true);
vlc.playlist.add(videoPath);
vlc.playlist.play();
EventHandler handler = null;
handler = (sender, e) => {
vlc.MediaPlayerEndReached -= handler;
GestureParser.Pause(false);
MoveScreen(false);
canvasWindow.Activate();
vlc.playlist.play();
vlc.MediaPlayerEndReached += (senderI, eI) => {
vlc.playlist.play();
};
};
vlc.MediaPlayerEndReached += handler;
}
示例6: AddGesture
/// <summary>
/// Adds the specified gesture for recognition.
/// </summary>
/// <param name="type">The predefined <see cref="GestureType" />.</param>
public void AddGesture(GestureType type)
{
IGestureSegment[] segments = null;
// DEVELOPERS: If you add a new predefined gesture with a new GestureType,
// simply add the proper segments to the switch statement here.
switch (type)
{
case GestureType.SwipeRight:
segments = new IGestureSegment[3];
segments[0] = new SwipeRightSegment1();
segments[1] = new SwipeRightSegment2();
segments[2] = new SwipeRightSegment3();
break;
case GestureType.All:
case GestureType.None:
default:
break;
}
if (type != GestureType.None)
{
Gesture gesture = new Gesture(type, segments);
gesture.GestureRecognized += OnGestureRecognized;
_gestures.Add(gesture);
}
}
示例7: CommandScene
internal CommandScene( Vector2 location, GestureType gestureType, string backgroundResourcePath )
: this(location, gestureType, backgroundResourcePath,
null,
null,
false)
{
}
示例8: GestureDetectedEventArgs
public GestureDetectedEventArgs(GestureType type, float speed, Vector direction, long timestamp)
{
m_type = type;
m_speed = speed;
m_direction = direction;
m_timestamp = timestamp;
}
示例9: EnableGestureRecognition
/// <summary>
/// Enable the recognition of a specific gesture
/// </summary>
/// <param name="gestureType">The type of gesture to enable</param>
public override void EnableGestureRecognition(GestureType gestureType)
{
switch (gestureType)
{
// we subscribe to the corresponding events from the scheduler (the one which prepare data and send them to the detection algorithm)
case GestureType.SwipeLeft:
m_Scheduler.EnableGestureRecognition(GestureType.SwipeLeft);
m_Scheduler.SwipeLeftGestureDetected += OnSwipeLeftDetected;
break;
case GestureType.SwipeRight:
m_Scheduler.EnableGestureRecognition(GestureType.SwipeRight);
m_Scheduler.SwipeRightGestureDetected += OnSwipeRightDetected;
break;
case GestureType.Tap:
m_Scheduler.EnableGestureRecognition(GestureType.Tap);
m_Scheduler.TapGestureDetected += OnTapGestureDetected;
break;
case GestureType.Push:
m_Scheduler.EnableGestureRecognition(GestureType.Push);
m_Scheduler.PushGestureDetected += OnPushGestureDetected;
break;
case GestureType.None:
m_Scheduler.EnableGestureRecognition(GestureType.None);
m_Scheduler.NoGestureDetected += OnNoGestureDetected;
break;
case GestureType.Circle:
throw new LeapException("The Circle gesture detection is not available in the IntuiLab gesture API");
}
}
示例10: DisableGestureRecognition
/// <summary>
/// Disable the recognition of a specific gesture
/// </summary>
/// <param name="gestureType">The type of gesture to disable</param>
public override void DisableGestureRecognition(GestureType gestureType)
{
switch (gestureType)
{
// we unsubscribe to the corresponding events
case GestureType.SwipeLeft:
m_Scheduler.DisableGestureRecognition(GestureType.SwipeLeft);
m_Scheduler.SwipeLeftGestureDetected -= OnSwipeLeftDetected;
break;
case GestureType.SwipeRight:
m_Scheduler.DisableGestureRecognition(GestureType.SwipeRight);
m_Scheduler.SwipeRightGestureDetected -= OnSwipeRightDetected;
break;
case GestureType.Tap:
m_Scheduler.DisableGestureRecognition(GestureType.Tap);
m_Scheduler.TapGestureDetected -= OnTapGestureDetected;
break;
case GestureType.Push:
m_Scheduler.DisableGestureRecognition(GestureType.Push);
m_Scheduler.PushGestureDetected -= OnPushGestureDetected;
break;
case GestureType.None:
m_Scheduler.DisableGestureRecognition(GestureType.None);
m_Scheduler.NoGestureDetected -= OnNoGestureDetected;
break;
}
}
示例11: HandGestureDetect
/// <summary>
/// 手掌姿勢偵測【第一場景】
/// </summary>
void HandGestureDetect()
{
//右手部分判定
if (skeletonInformation.HandRightPos.x > skeletonInformation.ShoulderCenterPos.x)
{
if (skeletonInformation.HandRightPos.y > skeletonInformation.ShoulderCenterPos.y + offset)
RightHandGestureType = GestureType.Up;
if (skeletonInformation.HandRightPos.y > skeletonInformation.ShoulderCenterPos.y - offset*2 && skeletonInformation.HandRightPos.y < skeletonInformation.ShoulderCenterPos.y + offset)
RightHandGestureType = GestureType.Mid;
if (skeletonInformation.HandRightPos.y < skeletonInformation.ShoulderCenterPos.y - offset*2)
RightHandGestureType = GestureType.Dowm;
}
//左手部分判定
if (skeletonInformation.HandLeftPos.x < skeletonInformation.ShoulderCenterPos.x)
{
if (skeletonInformation.HandLeftPos.y > skeletonInformation.ShoulderCenterPos.y + offset)
LeftHandGestureType = GestureType.Up;
if (skeletonInformation.HandLeftPos.y > skeletonInformation.ShoulderCenterPos.y - offset*2 && skeletonInformation.HandLeftPos.y < skeletonInformation.ShoulderCenterPos.y + offset)
LeftHandGestureType = GestureType.Mid;
if (skeletonInformation.HandLeftPos.y < skeletonInformation.ShoulderCenterPos.y - offset*2)
LeftHandGestureType = GestureType.Dowm;
}
LeftHand_LeftShouder_Offset = skeletonInformation.HandLeftPos.y - skeletonInformation.ShoulderLeftPos.y;
RightHand_RightShouder_Offset = skeletonInformation.HandRightPos.y - skeletonInformation.ShoulderRightPos.y;
//備用
if (LeftHandGestureType == GestureType.Dowm && RightHandGestureType == GestureType.Up)
GestureTypeOne = true;
}
示例12: GestureSample
//sample = new GestureSample(gesture, rightHanded, duration, angles, interpretedPoints, velocities, inverseVelocities);
public GestureSample(GestureType gType, bool rightHanded, float duration, List<float> angles, List<Vector2> interpretedPoints, List<Vector2> strokePoints, List<Vector2> velocities, List<Vector2> inverseVelocities)
{
Gesture = gType;
Duration = duration;
RightHanded = rightHanded;
SpeakerAngles = new List<float>();
SpeakerAngles.AddRange(angles);
InterpretedPoints = new List<Vector2>();
InterpretedPoints.AddRange(interpretedPoints);
StrokePoints = new List<Vector2>();
StrokePoints.AddRange(strokePoints);
Velocities = new List<Vector2>();
Velocities.AddRange(velocities);
InverseVelocities = new List<Vector2>();
InverseVelocities.AddRange(inverseVelocities);
InversePoints = new List<Vector2>();
foreach (Vector2 velocity_pair in InverseVelocities)
{
Vector2 P = new Vector2();
P.X = (float)(velocity_pair.X * Math.Sin(SpeakerAngles[0] * Math.PI / 180.0));
P.Y = (float)(velocity_pair.X * Math.Cos(SpeakerAngles[0] * Math.PI / 180.0));
P.X += (float)(velocity_pair.Y * Math.Sin(SpeakerAngles[1] * Math.PI / 180.0));
P.Y += (float)(velocity_pair.Y * Math.Cos(SpeakerAngles[1] * Math.PI / 180.0));
InversePoints.Add(P);
}
}
示例13: Add
/// <summary>
/// Add new gesture input
/// </summary>
/// <param name="theGesture"></param>
/// <param name="theTouchArea"></param>
public void Add(GestureType theGesture, Rectangle theTouchArea)
{
// add new gesture as an enabled gesture
TouchPanel.EnabledGestures = theGesture | TouchPanel.EnabledGestures;
gestureInputs.Add(gestureInputs.Count, new GestureDefinition(theGesture, theTouchArea));
if (theGesture == GestureType.Pinch)
PinchGestureAvailable = true;
}
示例14: GestureDefinition
public GestureDefinition(GestureType theGestureType, Rectangle theGestureArea)
{
Gesture = new GestureSample(theGestureType, new TimeSpan(0),
Vector2.Zero, Vector2.Zero,
Vector2.Zero, Vector2.Zero);
Type = theGestureType;
CollisionArea = theGestureArea;
}
示例15: Gesture
public Gesture(InputEventSystem inputEventSystem, GestureType type, String[] touchIDs)
{
this.inputEventSystem = inputEventSystem;
this.id = GestureIDAssigner;
GestureIDAssigner++;
this.type = type;
this.touchIDs = touchIDs;
}