Пример #1
0
 void panGesture_GestureStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         createTouchUndo();
     }
 }
Пример #2
0
        void rotateGesture_Dragged(EventLayer eventLayer, FingerDragGesture gesture)
        {
            if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Rotate)
            {
                currentGesture = Gesture.Rotate;
                SceneViewWindow sceneView = sceneViewController.ActiveWindow;
                if (sceneView != null)
                {
                    switch (movementMode)
                    {
                    case CameraMovementMode.Rotate:
                        sceneView.CameraMover.rotateFromMotion((int)gesture.DeltaX, (int)gesture.DeltaY);
                        break;

                    case CameraMovementMode.Pan:
                        sceneView.CameraMover.panFromMotion((int)gesture.DeltaX, (int)gesture.DeltaY, eventLayer.Mouse.AreaWidth, eventLayer.Mouse.AreaHeight);
                        break;

                    case CameraMovementMode.Zoom:
                        sceneView.CameraMover.zoomFromMotion((int)gesture.DeltaY);
                        break;
                    }
                }
                travelTracker.traveled((int)gesture.DeltaX, (int)gesture.DeltaY);
                eventLayer.alertEventsHandled();
            }
        }
Пример #3
0
 void panGesture_MomentumEnded(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (currentGesture <= Gesture.Pan)
     {
         commitTouchUndo();
         currentGesture = Gesture.None;
     }
 }
Пример #4
0
 void rotateGesture_GestureStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Rotate)
     {
         createTouchUndo();
         travelTracker.reset();
     }
 }
Пример #5
0
        static PoseController()
        {
            PickAnatomy = new ButtonEvent(EventLayers.Posing);
            PickAnatomy.addButton(MouseButtonCode.MB_BUTTON0);
            DefaultEvents.registerDefaultEvent(PickAnatomy);

            moveAnatomyGesture = new FingerDragGesture(EventLayers.Posing, 1, 0.000001f, float.MaxValue, 1);
            DefaultEvents.registerDefaultEvent(moveAnatomyGesture);
        }
Пример #6
0
 void moveAnatomyGesture_Dragged(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         travelTracker.traveled((int)gesture.DeltaX, (int)gesture.DeltaY);
         Ray3 cameraRay = getCameraRay(gesture.AbsoluteX, gesture.AbsoluteY);
         moveDragTarget(cameraRay);
         eventLayer.alertEventsHandled();
     }
 }
Пример #7
0
 void moveAnatomyGesture_MomentumEnded(EventLayer eventLayer, FingerDragGesture gesture)
 {
     allowMousePosing                  = true;
     moveAnatomyGesture.Dragged       -= moveAnatomyGesture_Dragged;
     moveAnatomyGesture.MomentumEnded -= moveAnatomyGesture_MomentumEnded;
     clearDragTarget();
     if (eventLayer.EventProcessingAllowed && travelTracker.TraveledOverLimit)
     {
         eventLayer.alertEventsHandled();
     }
 }
Пример #8
0
 void panGesture_Dragged(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed && currentGesture <= Gesture.Pan)
     {
         currentGesture = Gesture.Pan;
         SceneViewWindow sceneView = sceneViewController.ActiveWindow;
         if (sceneView != null)
         {
             sceneView.CameraMover.panFromMotion((int)gesture.DeltaX, (int)gesture.DeltaY, eventLayer.Mouse.AreaWidth, eventLayer.Mouse.AreaHeight);
         }
         eventLayer.alertEventsHandled();
     }
 }
Пример #9
0
 void panGesture_MomentumStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         if (currentGesture <= Gesture.Pan)
         {
             eventLayer.alertEventsHandled();
         }
     }
     else
     {
         gesture.cancelMomentum();
     }
 }
Пример #10
0
 void rotateGesture_MomentumStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     if (eventLayer.EventProcessingAllowed)
     {
         if (currentGesture <= Gesture.Rotate && travelTracker.TraveledOverLimit)
         {
             eventLayer.alertEventsHandled();
         }
     }
     else
     {
         gesture.cancelMomentum();
     }
 }
Пример #11
0
 void moveAnatomyGesture_GestureStarted(EventLayer eventLayer, FingerDragGesture gesture)
 {
     allowMousePosing = false;
     travelTracker.reset();
     if (eventLayer.EventProcessingAllowed)
     {
         Ray3 cameraRay = getCameraRay(gesture.AbsoluteX, gesture.AbsoluteY);
         if (findDragTarget(cameraRay))
         {
             moveAnatomyGesture.Dragged       += moveAnatomyGesture_Dragged;
             moveAnatomyGesture.MomentumEnded += moveAnatomyGesture_MomentumEnded;
             eventLayer.alertEventsHandled();
         }
     }
 }
Пример #12
0
        static CameraInputController()
        {
            MoveCamera = new ButtonEvent(GuiFrameworkCamerasInterface.MoveCameraEventLayer);
            MoveCamera.addButton(currentMouseButton);
            DefaultEvents.registerDefaultEvent(MoveCamera);

            ZoomInCamera = new ButtonEvent(GuiFrameworkCamerasInterface.MoveCameraEventLayer);
            ZoomInCamera.MouseWheelDirection = MouseWheelDirection.Up;
            DefaultEvents.registerDefaultEvent(ZoomInCamera);

            ZoomOutCamera = new ButtonEvent(GuiFrameworkCamerasInterface.MoveCameraEventLayer);
            ZoomOutCamera.MouseWheelDirection = MouseWheelDirection.Down;
            DefaultEvents.registerDefaultEvent(ZoomOutCamera);

            LockX = new ButtonEvent(GuiFrameworkCamerasInterface.MoveCameraEventLayer);
            LockX.addButton(KeyboardButtonCode.KC_C);
            DefaultEvents.registerDefaultEvent(LockX);

            LockY = new ButtonEvent(GuiFrameworkCamerasInterface.MoveCameraEventLayer);
            LockY.addButton(KeyboardButtonCode.KC_X);
            DefaultEvents.registerDefaultEvent(LockY);

            TogglePanMode = new ButtonEvent(GuiFrameworkCamerasInterface.ShortcutEventLayer);
            TogglePanMode.addButton(GuiFrameworkCamerasInterface.PanKey);
            DefaultEvents.registerDefaultEvent(TogglePanMode);

            ToggleZoomMode = new ButtonEvent(GuiFrameworkCamerasInterface.ShortcutEventLayer);
            ToggleZoomMode.addButton(KeyboardButtonCode.KC_LMENU);
            DefaultEvents.registerDefaultEvent(ToggleZoomMode);

            switch (GuiFrameworkCamerasInterface.TouchType)
            {
            case TouchType.Screen:
                zoomGesture = new TwoFingerZoom(GuiFrameworkCamerasInterface.MoveCameraEventLayer, 0.001f, 2f);
                DefaultEvents.registerDefaultEvent(zoomGesture);

                rotateGesture = new FingerDragGesture(GuiFrameworkCamerasInterface.MoveCameraEventLayer, 1, 0.001f, 2f, 5);
                DefaultEvents.registerDefaultEvent(rotateGesture);

                panGesture = new FingerDragGesture(GuiFrameworkCamerasInterface.MoveCameraEventLayer, 2, 0.001f, 2f, 5);
                DefaultEvents.registerDefaultEvent(panGesture);
                break;
            }
        }