Ejemplo n.º 1
0
            public override bool OnMouseMove(InputStateData state)
            {
                state.IsKeywordDown = false;
                SwitchTo((int)AllInputStates.Idle, state);

                return(base.OnMouseMove(state));
            }
Ejemplo n.º 2
0
            public override void LeaveState(InputStateData inputStateDate)
            {
                var right = inputStateDate.ButtonsStates[GeneralMouseButtons.Right];

                right.PointV2     = inputStateDate.CurrentPosition;
                right.CursorPoint = inputStateDate.CursorCurrentPosition;
                inputStateDate.ButtonsStates[GeneralMouseButtons.Right] = right;
                base.LeaveState(inputStateDate);
            }
Ejemplo n.º 3
0
 public override bool OnMouseDown(InputStateData state)
 {
     switch (state.Buttons)
     {
     case GeneralMouseButtons.Left:
         break;
     }
     return(base.OnMouseDown(state));
 }
Ejemplo n.º 4
0
 public override bool OnMouseUp(InputStateData state)
 {
     if ((state.Buttons & GeneralMouseButtons.Right) != GeneralMouseButtons.Right)
     {
         SwitchTo((int)AllInputStates.Idle, state);
         //   System.Windows.Forms.Cursor.Show();
     }
     return(base.OnMouseUp(state));
 }
Ejemplo n.º 5
0
            public override bool OnMouseUp(InputStateData state)
            {
                if ((state.Buttons & GeneralMouseButtons.Right) != GeneralMouseButtons.Right)
                {
                    SwitchTo((int)AllInputStates.Idle, state);
                }

                return(base.OnMouseUp(state));
            }
Ejemplo n.º 6
0
 void UnCaptureTarget(InputStateData state)
 {
     if (captured)
     {
         captured = false;
         //untarget if it was captured
         Processor.InvokeHandler <ITargetingInputHandler>(x => x.UnTarget(state));
     }
 }
Ejemplo n.º 7
0
 public override void EnterState(InputStateData state)
 {
     switch (state.Buttons)
     {
     case GeneralMouseButtons.Right:
         SwitchTo((int)AllInputStates.Rotate, state);
         break;
     }
 }
Ejemplo n.º 8
0
            public override bool OnMouseUp(InputStateData state)
            {
                if ((state.Buttons & GeneralMouseButtons.Left) != GeneralMouseButtons.Left)
                {
                    Processor.InvokeHandler <ITargetingInputHandler>(x => x.UnTarget(state));
                    SwitchTo((int)AllInputStates.Idle, state);
                }

                return(base.OnMouseUp(state));
            }
Ejemplo n.º 9
0
 public override bool OnMouseDown(InputStateData state)
 {
     switch (state.Buttons)
     {
     case GeneralMouseButtons.Left | GeneralMouseButtons.Right:
         SwitchTo((int)AllInputStates.Pan, state);
         break;
     }
     return(base.OnMouseDown(state));
 }
Ejemplo n.º 10
0
 public override bool OnMouseDoubleDown(InputStateData state)
 {
     switch (state.Buttons)
     {
     case GeneralMouseButtons.Left:
         SwitchTo((int)AllInputStates.ChangeRotateCenter, state);
         break;
     }
     return(base.OnMouseDoubleDown(state));
 }
Ejemplo n.º 11
0
 public override bool OnMouseDown(InputStateData state)
 {
     switch (state.Buttons)
     {
     case GeneralMouseButtons.Left | GeneralMouseButtons.Right:
         SwitchTo((int)AllInputStates.Pan, state);
         //   System.Windows.Forms.Cursor.Show();
         break;
     }
     return(base.OnMouseDown(state));
 }
Ejemplo n.º 12
0
            public override bool OnMouseUp(InputStateData state)
            {
                if ((state.Buttons & GeneralMouseButtons.Left) != GeneralMouseButtons.Left)
                {
                    UnCaptureTarget(state);
                    //select will be pushed always ... to handling should be not here
                    //here just pushing a commands
                    //Processor.InvokeHandler<ITargetingInputHandler>(x => x.SelectTarget(enterState));
                    SwitchTo((int)AllInputStates.Idle, state);
                }

                return(base.OnMouseUp(state));
            }
Ejemplo n.º 13
0
 public override bool OnMouseMove(InputStateData state)
 {
     if (state.Buttons == GeneralMouseButtons.None)
     {
         SwitchTo((int)AllInputStates.Idle, state);
         return(base.OnMouseMove(state));
     }
     //System.Windows.Forms.Cursor.Position = state.ButtonsStates[GeneralMouseButtons.Right].CursorPoint.ToDrawingPoint();
     Processor.InvokeHandler <ICameraInputHandler>(x => x.Rotate(state));
     //return cursore to prev position ... allow to calculate delta from static position to new move
     //static postion is first positoin of rotation
     Cursor.Position = state.ButtonsStates[GeneralMouseButtons.Right].CursorPoint.ToDrawingPoint();
     return(true);
 }
Ejemplo n.º 14
0
            public override bool KeyDown(InputStateData state)
            {
                state.IsKeywordDown = true;
                switch (state.Keyword)
                {
                case GeneralKeywords.W:
                    Processor.InvokeHandler <ICameraInputHandler>(x => x.KeywordMove(state));
                    return(true);

                default:
                    SwitchTo((int)AllInputStates.Idle, state);
                    return(false);
                }
            }
Ejemplo n.º 15
0
        protected override InputState GetIdleState()  //initilization
        {
            var states = new StateDictionary();

            states.Add((int)AllInputStates.Idle, s => new InputIdleState(s));
            states.Add((int)AllInputStates.Rotate, s => new InputRotateStateWithCursorReturning(s));
            states.Add((int)AllInputStates.Zoom, s => new InputZoomState(s));
            states.Add((int)AllInputStates.Pan, s => new InputPanState(s));
            states.Add((int)AllInputStates.ChangeRotateCenter, s => new InputChangeRotateCenterState(s));

            var router = new StateHandleProcessor <ICameraInputHandler>(states, this /*,externalInputHandler*/);

            router.SwitchTo((int)AllInputStates.Idle, InputStateData.Create());
            return(router);
        }
Ejemplo n.º 16
0
            public override void EnterState(InputStateData state)
            {
                Processor.InvokeHandler <ICameraInputHandler>(x => x.Idle());

                switch (state.Buttons)
                {
                case GeneralMouseButtons.Right:
                    SwitchTo((int)AllInputStates.Rotate, state);
                    break;

                default:

                    break;
                }
            }
Ejemplo n.º 17
0
            public override bool OnMouseUp(InputStateData state)
            {
                switch (state.Buttons)
                {
                case GeneralMouseButtons.Right:
                    SwitchTo((int)AllInputStates.Rotate, state);
                    break;

                default:
                    SwitchTo((int)AllInputStates.Idle, state);
                    break;
                }

                return(base.OnMouseUp(state));
            }
Ejemplo n.º 18
0
            public override bool OnMouseDown(InputStateData state)
            {
                switch (state.Buttons)
                {
                case GeneralMouseButtons.Left:
                    captured = true;
                    Processor.InvokeHandler <ITargetingInputHandler>(x => x.TargetCapture(state));
                    break;

                case GeneralMouseButtons.Left | GeneralMouseButtons.Right:
                    UnCaptureTarget(state);
                    //SwitchTo((int)AllInputStates.Idle, state);
                    SwitchTo((int)AllInputStates.Pan, state);
                    break;
                }
                return(base.OnMouseDown(state));
            }
Ejemplo n.º 19
0
        protected override InputState GetIdleState()  //initilization
        {
            var states = new StateDictionary();

            states.Add((int)AllInputStates.Idle, s => new InputIdleState(s));
            states.Add((int)AllInputStates.Rotate, s => new InputRotateState(s));
            states.Add((int)AllInputStates.Zoom, s => new InputZoomState(s));
            states.Add((int)AllInputStates.Pan, s => new InputPanState(s));
            states.Add((int)AllInputStates.Target, s => new InputTargetState(s));
            states.Add((int)AllInputStates.KeywordDown, s => new KeywordMovingState(s));
            states.Add((int)AllInputStates.ChangeFocus, s => new FocusToObjectState(s));

            var router = new StateHandleProcessor <ICameraInputHandler>(states, this);

            router.SwitchTo((int)AllInputStates.Idle, InputStateData.Create());



            return(router);
        }
Ejemplo n.º 20
0
            public override bool OnMouseDown(InputStateData state)
            {
                switch (state.Buttons)
                {
                //camera
                case GeneralMouseButtons.Left | GeneralMouseButtons.Right:
                    SwitchTo((int)AllInputStates.Pan, state);
                    break;

                case GeneralMouseButtons.Right:
                    SwitchTo((int)AllInputStates.Rotate, state);
                    break;

                //case GeneralMouseButtons.Middle:
                //    break;

                //manipulation
                case GeneralMouseButtons.Left:
                    SwitchTo((int)AllInputStates.Target, state);
                    break;
                }
                return(base.OnMouseDown(state));
            }
Ejemplo n.º 21
0
 public void Zoom(InputStateData state)
 {
 }
Ejemplo n.º 22
0
 public bool Rotate(InputStateData state)
 {
     return(true);
 }
Ejemplo n.º 23
0
 public void Pan(InputStateData state)
 {
 }
Ejemplo n.º 24
0
 public void KeywordMove(InputStateData state)
 {
 }
Ejemplo n.º 25
0
 public void HideOrShowObjectUnderCursor(InputStateData state)
 {
 }
Ejemplo n.º 26
0
 public void FocusToObject(InputStateData state)
 {
 }
Ejemplo n.º 27
0
 public void ChangeTransparencyOnObjectUnderCursor(InputStateData state, bool isMmbHolded2sec)
 {
 }
Ejemplo n.º 28
0
 public void ChangeRotateCenter(InputStateData state)
 {
 }
Ejemplo n.º 29
0
 public override bool OnMouseDoubleDown(InputStateData state)
 {
     SwitchTo((int)AllInputStates.ChangeFocus, state);
     return(base.OnMouseDoubleDown(state));
 }
Ejemplo n.º 30
0
 public override bool KeyDown(InputStateData state)
 {
     SwitchTo((int)AllInputStates.KeywordDown, state);
     return(true);
 }