本文整理汇总了C#中GestureType类的典型用法代码示例。如果您正苦于以下问题:C# GestureType类的具体用法?C# GestureType怎么用?C# GestureType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GestureType类属于命名空间,在下文中一共展示了GestureType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
}
开发者ID:intuilab,项目名称:LeapIA,代码行数:31,代码来源:LeapGestureAPI.cs
示例2: Gesture
public Gesture(GestureType type, IGestureSegment[] segments)
{
_type = type;
_segments = segments;
_name = type.ToString();
}
开发者ID:etrigger,项目名称:Vitruvius,代码行数:7,代码来源:Gesture.cs
示例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);
}
开发者ID:k19862217,项目名称:DioramaExhibitionSupportSystem,代码行数:12,代码来源:GestureController.cs
示例4: OnGesture
public void OnGesture(GestureType gestureType)
{
if (gestureType == GestureType.ExplodeIn)
ExplodeIn(() => { });
if (gestureType == GestureType.ExplodeOut)
ExplodeOut(() => { });
}
开发者ID:techx,项目名称:old-techfair-kinect-booth,代码行数:7,代码来源:ParticleComponent.cs
示例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;
}
开发者ID:ericvruder,项目名称:SW9_Project,代码行数:31,代码来源:VideoWindow.xaml.cs
示例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);
}
}
开发者ID:Milpoder,项目名称:NPI,代码行数:34,代码来源:GestureController.cs
示例7: CommandScene
internal CommandScene( Vector2 location, GestureType gestureType, string backgroundResourcePath )
: this(location, gestureType, backgroundResourcePath,
null,
null,
false)
{
}
开发者ID:Otto404,项目名称:wp-xna,代码行数:7,代码来源:CommandScene.cs
示例8: GestureDetectedEventArgs
public GestureDetectedEventArgs(GestureType type, float speed, Vector direction, long timestamp)
{
m_type = type;
m_speed = speed;
m_direction = direction;
m_timestamp = timestamp;
}
开发者ID:intuilab,项目名称:LeapIA,代码行数:7,代码来源:GestureDetectedEventArgs.cs
示例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");
}
}
开发者ID:intuilab,项目名称:LeapIA,代码行数:33,代码来源:IntuiLabGestureAPI.cs
示例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;
}
}
开发者ID:intuilab,项目名称:LeapIA,代码行数:31,代码来源:IntuiLabGestureAPI.cs
示例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;
}
开发者ID:joeytsao,项目名称:KCCI_JIC,代码行数:34,代码来源:KinectDetectOutput.cs
示例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);
}
}
开发者ID:ISUE,项目名称:Multiwave,代码行数:33,代码来源:GestureSample.cs
示例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;
}
开发者ID:Vintharas,项目名称:WP7projects,代码行数:13,代码来源:GestureInput.cs
示例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;
}
开发者ID:Vintharas,项目名称:War-of-the-Orbs,代码行数:8,代码来源:GestureDefinition.cs
示例15: Gesture
public Gesture(InputEventSystem inputEventSystem, GestureType type, String[] touchIDs)
{
this.inputEventSystem = inputEventSystem;
this.id = GestureIDAssigner;
GestureIDAssigner++;
this.type = type;
this.touchIDs = touchIDs;
}
开发者ID:dreamsxin,项目名称:engine-1,代码行数:8,代码来源:Gesture.cs
示例16: Scene
protected Scene( Vector2 location, GestureType gestureType )
: this(location, gestureType,
null,
null,
false,
true)
{
}
开发者ID:Otto404,项目名称:wp-xna,代码行数:8,代码来源:Scene.cs
示例17: CCGesture
/// <summary>
/// Initializes a new <see cref="GestureSample"/>.
/// </summary>
/// <param name="gestureType"><see cref="GestureType"/></param>
/// <param name="timestamp"></param>
/// <param name="position"></param>
/// <param name="position2"></param>
/// <param name="delta"></param>
/// <param name="delta2"></param>
public CCGesture(GestureType gestureType, TimeSpan timestamp, CCPoint position, CCPoint position2, CCPoint delta, CCPoint delta2)
{
this._gestureType = gestureType;
this._timestamp = timestamp;
this._position = position;
this._position2 = position2;
this._delta = delta;
this._delta2 = delta2;
}
开发者ID:liwq-net,项目名称:UIFactory,代码行数:18,代码来源:CCInputState.cs
示例18: GestureSample
public GestureSample(GestureType gestureType, TimeSpan timestamp, Vector2 position, Vector2 position2, Vector2 delta, Vector2 delta2)
{
this._gestureType = gestureType;
this._timestamp = timestamp;
this._position = position;
this._position2 = position2;
this._delta = delta;
this._delta2 = delta2;
}
开发者ID:tanis2000,项目名称:FEZ,代码行数:9,代码来源:GestureSample.cs
示例19: AddTechniqueData
public static SpssCase AddTechniqueData(SpssCase gestureAttempt, GestureType type, Attempt attempt)
{
gestureAttempt[$"{type}Efficiency"] = attempt.Time.TotalSeconds;
gestureAttempt[$"{type}Effectiveness"] = attempt.Hit;
gestureAttempt[$"{type}Accuracy"] = MathHelper.GetDistance(attempt);
gestureAttempt[$"{type}TargetSize"] = attempt.Size;
gestureAttempt[$"{type}Direction"] = attempt.Direction;
return gestureAttempt;
}
开发者ID:ericvruder,项目名称:SW9_Project,代码行数:10,代码来源:DataGenerator.cs
示例20: ReceiveGesture
/// <summary>
/// Used by the Gesture capturing script.
/// </summary>
/// <param name="sentGesture"></param>
public void ReceiveGesture(GestureType sentGesture)
{
_receivedGesture = sentGesture;
if (_receivedGesture == GestureType.None)
CursorManager.instance.ChangeCursorStatus(CursorManager.CursorGestureStatus.Normal);
else
ProcessReceivedGesture();
_listening = false;
}
开发者ID:KingpinBen,项目名称:Last-Faun,代码行数:15,代码来源:GestureObject.cs
注:本文中的GestureType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论