示例#1
0
        private void OnFiredUxEventDelegate(PXCMTouchlessController.UXEventData data)
        {
            Dispatcher.BeginInvoke((Action)(() =>
            {
                cursorDisplay.SetPosition(data.position.x, data.position.y, data.position.z,
                                          data.bodySide == PXCMHandData.BodySideType.BODY_SIDE_RIGHT);

                controller.CheckCollision(data.position, SchemaGrid);

                outOfScreenBorder.X = data.position.x - 0.5f;
                outOfScreenBorder.Y = data.position.y - 0.5f;

                if (data.type == PXCMTouchlessController.UXEventData.UXEventType.UXEvent_CursorVisible)
                {
                    cursorDisplay.ChangeCursorState(RealSenseNavigator.CursorDisplay.CursorStates.Normal);
                    cursorDisplay.ChangeCursorState(RealSenseNavigator.CursorDisplay.CursorStates.Visible);
                    outOfScreenBorder.Visibility = Visibility.Visible;
                }
                else if (data.type == PXCMTouchlessController.UXEventData.UXEventType.UXEvent_CursorNotVisible)
                {
                    cursorDisplay.ChangeCursorState(RealSenseNavigator.CursorDisplay.CursorStates.Hidden);
                    outOfScreenBorder.Visibility = Visibility.Collapsed;
                }
                else if (data.type == PXCMTouchlessController.UXEventData.UXEventType.UXEvent_ReadyForAction)
                {
                    cursorDisplay.ChangeCursorState(RealSenseNavigator.CursorDisplay.CursorStates.Scroll);
                    controller.SetHandClosed(true);
                }
                else if (data.type == PXCMTouchlessController.UXEventData.UXEventType.UXEvent_EndScroll)
                {
                    cursorDisplay.ChangeCursorState(RealSenseNavigator.CursorDisplay.CursorStates.Normal);
                    controller.SetHandClosed(false);
                    controller.ResetFormes();
                }
            }));
        }