当前位置: 首页>>代码示例>>C#>>正文


C# GestureType类代码示例

本文整理汇总了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");
     }
 }
开发者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


注:本文中的GestureType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。