Beispiel #1
0
        /// <summary>
        /// Handler for the "Set Scale to Default" context menu item.  Sets the scale ranging to
        /// full auto mode for all axes.
        /// </summary>
        /// <remarks>
        /// This method differs from the <see cref="ZoomOutAll" /> method in that it sets the scales
        /// to full auto mode.  The <see cref="ZoomOutAll" /> method sets the scales to their initial
        /// setting prior to any user actions (which may or may not be full auto mode).
        /// </remarks>
        /// <param name="primaryPane">The <see cref="GraphPane" /> object which is to have the
        /// scale restored</param>
        public void RestoreScale(PaneBase primaryPane)
        {
            if (primaryPane == null || !(primaryPane is GraphPane))
            {
                return;
            }

            var pane = (GraphPane)primaryPane;

            //Go ahead and save the old zoomstates, which provides an "undo"-like capability
            //ZoomState oldState = primaryPane.ZoomStack.Push( primaryPane, ZoomState.StateType.Zoom );
            var oldState = new ZoomState(pane, ZoomState.StateType.Zoom);

            using (var g = CreateGraphics())
            {
                if (_isSynchronizeXAxes || _isSynchronizeYAxes)
                {
                    foreach (var paneBase in _masterPane.PaneList)
                    {
                        var p = (GraphPane)paneBase;
                        p.ZoomStack.Push(p, ZoomState.StateType.Zoom);
                        RestoreAutoScale(p, g);
                    }
                }
                else
                {
                    pane.ZoomStack.Push(pane, ZoomState.StateType.Zoom);
                    RestoreAutoScale(pane, g);
                }

                // Provide Callback to notify the user of zoom events
                ZoomEvent?.Invoke(this, oldState, new ZoomState(pane, ZoomState.StateType.Zoom));
            }
            Refresh();
        }
Beispiel #2
0
        /// <summary>
        /// Handler for the "Undo All Zoom/Pan" context menu item.  Restores the scale ranges to the values
        /// before all zoom and pan operations
        /// </summary>
        /// <remarks>
        /// This method differs from the <see cref="RestoreScale" /> method in that it sets the scales
        /// to their initial setting prior to any user actions.  The <see cref="RestoreScale" /> method
        /// sets the scales to full auto mode (regardless of what the initial setting may have been).
        /// </remarks>
        /// <param name="primaryPane">The <see cref="GraphPane" /> object which is to be zoomed out</param>
        public void ZoomOutAll(GraphPane primaryPane)
        {
            if (primaryPane == null || primaryPane.ZoomStack.IsEmpty)
            {
                return;
            }

            var type = primaryPane.ZoomStack.Top.Type;

            var oldState = new ZoomState(primaryPane, type);
            //ZoomState newState = pane.ZoomStack.PopAll( pane );
            ZoomState newState = null;

            if (_isSynchronizeXAxes || _isSynchronizeYAxes)
            {
                foreach (var pane in _masterPane.PaneList.Where(p => p is GraphPane).Cast <GraphPane>())
                {
                    ZoomState state = pane.ZoomStack.PopAll(pane);
                    if (pane == primaryPane)
                    {
                        newState = state;
                    }
                }
            }
            else
            {
                newState = primaryPane.ZoomStack.PopAll(primaryPane);
            }

            // Provide Callback to notify the user of zoom events
            ZoomEvent?.Invoke(this, oldState, newState);

            Refresh();
        }
        ///------------------------------------------------------------------------
        /// <summary>
        /// Zooms the curve.
        /// </summary>
        /// <param name="graphPane">The graph pane.</param>
        /// <param name="lineItem">The line item.</param>
        /// <returns></returns>
        ///------------------------------------------------------------------------
        public bool ZoomCurve(GraphPane graphPane, CurveItem lineItem,
                              double filterMinX = double.MinValue, double filterMaxX = double.MaxValue)
        {
            if (lineItem.Points.Count == 0)
            {
                return(false);
            }
            if (!ZoomCurveOnLegendClick)
            {
                Invalidate();
                return(false);
            }

            // Add the zoom to the zoom stack
            var oldState = new ZoomState(graphPane, ZoomState.StateType.Zoom);

            graphPane.ZoomStack.Push(graphPane, ZoomState.StateType.Zoom);
            ZoomEvent?.Invoke(this, oldState, new ZoomState(graphPane, ZoomState.StateType.Zoom));

            if (!SetZoomScale(graphPane, lineItem, filterMinX, filterMaxX))
            {
                return(false);
            }

            // Update the pane
            graphPane.AxisChange();
            Invalidate();
            return(true);
        }
Beispiel #4
0
 private void ButtonZoomMinus_Click(object sender, RoutedEventArgs e)
 {
     if (_graphicMap != null)
     {
         ZoomEvent?.Invoke(_zoomStepper.NextScale(_graphicMap.Scale));
     }
 }
        public static ZoomEvent ToZoomEvent(this ZoomEventDto zoomEventDto)
        {
            var zoomEvent = new ZoomEvent
            {
                Delta        = zoomEventDto.delta,
                Camera       = zoomEventDto.camera.ToCamera(),
                CanvasWidth  = zoomEventDto.canvasWidth,
                CanvasHeight = zoomEventDto.canvasHeight
            };

            return(zoomEvent);
        }
Beispiel #6
0
    //private void OnRotate(Crowd.Event e)
    //{
    //    RotateEvent re = (RotateEvent)e;
    //    deltaPos += Vector2.Scale(re.delta * 0.01f, new Vector2(isHorizontal ? 1.0f : 0.0f, isVertical ? 1.0f : 0.0f));
    //    deltaPos = new Vector2(
    //        Mathf.Clamp(deltaPos.x, -1, 1),
    //        Mathf.Clamp(deltaPos.y, -1, 1)
    //        );
    //}

    private void OnZoom(Crowd.Event e)
    {
        if (willZoomWithCamera)
        {
            ZoomEvent ze = (ZoomEvent)e;
            if (ze.delta > 0)
            {
                Services.dotweenEvents.ScaleTo(gameObject.name + " " + zoomScale.ToString() + " " + zoomScale.ToString() + " " + zoomScale.ToString() + " 1");
            }
            else
            if (ze.delta < 0)
            {
                Services.dotweenEvents.ScaleTo(gameObject.name + " 1, 1, 1, 1");
            }
        }
    }
Beispiel #7
0
        public void Attach([NotNull] Canvas canvas)
        {
            canvas.MouseLeftButtonDown += (sender, args) => {
                if (!_leftMouseDown)
                {
                    _lastPoint     = args.GetPosition(canvas);
                    MouseDownStart = _lastPoint.X;
                    _leftMouseDown = true;
                }
            };
            canvas.MouseMove += (sender, args) => {
                var now = DateTime.Now.Millisecond;
                if (now - _lastTime <= 100)
                {
                    return;
                }
                var point = args.GetPosition(canvas);
                FollowTraceEvent?.Invoke(_lastPoint, point, _leftMouseDown);
                _lastPoint = point;
            };
            canvas.MouseLeftButtonUp += (sender, args) => {
                if (!_leftMouseDown)
                {
                    return;
                }
                var zoomEnd = args.GetPosition(canvas).X;
                if (zoomEnd < MouseDownStart)
                {
                    var t = zoomEnd;
                    zoomEnd        = MouseDownStart;
                    MouseDownStart = t;
                }

                ZoomEvent?.Invoke(MouseDownStart, zoomEnd, !(zoomEnd - MouseDownStart <= 12));

                _leftMouseDown = false;
            };
            canvas.MouseRightButtonDown += (sender, args) => { UndoEvent?.Invoke(); };
            canvas.MouseDown            += (sender, args) => {
                if (args.ChangedButton == MouseButton.Middle)
                {
                    AdjustYAxisEvent?.Invoke();
                }
            };
        }
Beispiel #8
0
 private void SynchronizeZoom(ZoomEvent ze)
 {
     if (ze.ViewModelID != this.ViewModelID)
     {
         if (ze.ZoomReset)
         {
             Scale = 1;
             return;
         }
         if ((Scale > 8 && ze.ScaleDelta > 1) || (Scale < _zoomStep - 1 && ze.ScaleDelta < 1))
         {
             return;
         }
         this.Scale *= ze.ScaleDelta;
         int left = (int)(ze.MouseX - (ze.MouseX - ImagePosition.Left) * ze.ScaleDelta);
         int top  = (int)(ze.MouseY - (ze.MouseY - ImagePosition.Top) * ze.ScaleDelta);
         ImagePosition = new Thickness(left, top, -left, -top);
     }
 }
Beispiel #9
0
        /// <summary>
        /// Increments the current zoom value.
        /// </summary>
        /// <param name="delta">The amount to adjust the zoom by.</param>
        /// <remarks>
        /// Triggers a <see cref="ZoomEvent"/>.
        /// </remarks>
        private void AdjustZoom(int delta)
        {
            const float SpeedModifier = 1250.0f;

            float oldVal, newVal;

            newVal = zoom + (delta / SpeedModifier);
            if (newVal < MinimumZoom)
            {
                newVal = MinimumZoom;
            }
            else if (newVal > MaximumZoom)
            {
                newVal = MaximumZoom;
            }

            oldVal = Zoom;
            Zoom   = newVal;
            ZoomEvent?.Invoke(this, new ZoomEventArgs(oldVal, newVal));
        }
Beispiel #10
0
        internal bool CheckEvent(ZoomEvent zoomEvent)
        {
            bool flag1 = !this.IsOnHold;

label_1:
            int num1 = 1028763422;
            bool isOnHold1;

            while (true)
            {
                int  num2 = 155680092;
                uint num3;
                bool flag2;
                bool flag3;
                bool isOnHold2;
                List <ZoomWindow> list1;
                List <ZoomWindow> list2;
                int num4;
                int num5;
                int num6;
                switch ((num3 = (uint)(num1 ^ num2)) % 33U)
                {
                case 0:
                    if (this.Engine.ActiveMeetingWindow != null)
                    {
                        num1 = (int)num3 * -859681923 ^ 446878712;
                        continue;
                    }
                    goto label_31;

                case 1:
                    num5 = HoldDetector.\u200D‭‮‌‌​​‏‪‭‎‏‮‍‍‍‭‪‌‫‭‬​‌‭‌‮(zoomEvent.WindowClass, \u003CModule\u003E.\u200E‏‍‬‌‌‌‫‎‮‎‌‍‌‮‬‎‎‌‎‌‫‬‮‮ <string>(2801244503U)) ? 1 : 0;
                    break;

                case 2:
                    num1 = 1745914111;
                    continue;

                case 3:
                    num1 = (int)num3 * -1907434036 ^ 1388623791;
                    continue;

                case 4:
                    int num7 = zoomEvent.EventType != ZoomEventType.Hide ? 1316570192 : (num7 = 48718970);
                    int num8 = (int)num3 * 346480996;
                    num1 = num7 ^ num8;
                    continue;

                case 5:
                    int num9  = !flag2 ? -2146688424 : (num9 = -1262443827);
                    int num10 = (int)num3 * -1618154879;
                    num1 = num9 ^ num10;
                    continue;

                case 6:
                    ((CompositePresentationEvent <ZoomMeeting>) this._eventAggregator.GetEvent <MeetingRemovedFromHold>()).Publish(Engine.Instance.ActiveMeeting);
                    num1 = (int)num3 * 1075261844 ^ 1499877329;
                    continue;

                case 7:
                    goto label_1;

                case 8:
                    num6 = HoldDetector.\u200D‭‮‌‌​​‏‪‭‎‏‮‍‍‍‭‪‌‫‭‬​‌‭‌‮(zoomEvent.WindowClass, \u003CModule\u003E.\u202A​‬‫‪‫‪‮‪‫‎‭‪‏‮‎‭‍‌‎‫‍​‎‎‮ <string>(118217023U)) ? 1 : 0;
                    goto label_43;

                case 9:
                    if (zoomEvent.EventType == ZoomEventType.Show)
                    {
                        num1 = 2130013859;
                        continue;
                    }
                    num5 = 0;
                    break;

                case 10:
                    isOnHold1 = this.IsOnHold;
                    num1      = 693816777;
                    continue;

                case 11:
                    num1 = (int)num3 * 990239155 ^ 1566178599;
                    continue;

                case 12:
                    ((CompositePresentationEvent <ZoomMeeting>) this._eventAggregator.GetEvent <MeetingPlacedOnHold>()).Publish(Engine.Instance.ActiveMeeting);
                    num1 = (int)num3 * -661187690 ^ -561297066;
                    continue;

                case 13:
                    num4 = this.Engine.ActiveMeetingWindow.IsVisible ? 1 : 0;
                    goto label_32;

                case 14:
                    num1 = 757310030;
                    continue;

                case 15:
                    num1 = (int)num3 * -30517977 ^ 784804791;
                    continue;

                case 16:
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    list1 = ((IEnumerable <ZoomWindow>)Enumerable.Where <ZoomWindow>((IEnumerable <M0>)list2, (Func <M0, bool>)(HoldDetector.\u003C\u003Ec.\u003C\u003E9__14_1 ?? (HoldDetector.\u003C\u003Ec.\u003C\u003E9__14_1 = new Func <ZoomWindow, bool>((object)HoldDetector.\u003C\u003Ec.\u003C\u003E9, __methodptr(\u003CCheckEvent\u003Eb__14_1)))))).ToList <ZoomWindow>();
                    num1  = 1164652866;
                    continue;

                case 17:
                    if (!HoldDetector.\u200D‭‮‌‌​​‏‪‭‎‏‮‍‍‍‭‪‌‫‭‬​‌‭‌‮(zoomEvent.WindowClass, \u003CModule\u003E.\u206B‎‏‎‮‌​‪‏‭‭‍‍‬‬‫‌‎‮‮‪‌‪‮ <string>(422517909U)))
                    {
                        num1 = (int)num3 * -2032484016 ^ -98562088;
                        continue;
                    }
                    num6 = 1;
                    goto label_43;

                case 18:
                    int num11 = !flag3 ? 1481919254 : (num11 = 148521951);
                    int num12 = (int)num3 * 1931693250;
                    num1 = num11 ^ num12;
                    continue;

                case 19:
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    list2 = ((IEnumerable <ZoomWindow>)Enumerable.Where <ZoomWindow>((IEnumerable <M0>) this.Engine.ActiveWindows, (Func <M0, bool>)(HoldDetector.\u003C\u003Ec.\u003C\u003E9__14_0 ?? (HoldDetector.\u003C\u003Ec.\u003C\u003E9__14_0 = new Func <ZoomWindow, bool>((object)HoldDetector.\u003C\u003Ec.\u003C\u003E9, __methodptr(\u003CCheckEvent\u003Eb__14_0)))))).ToList <ZoomWindow>();
                    num1  = 1033907094;
                    continue;

                case 20:
                    num1 = (int)num3 * -99598336 ^ -56611356;
                    continue;

                case 21:
                    this.IsOnHold = false;
                    num1          = (int)num3 * -1001444294 ^ 1797507501;
                    continue;

                case 22:
                    if (list2.Count > 0)
                    {
                        num1 = (int)num3 * -300247385 ^ 1879350869;
                        continue;
                    }
                    goto label_31;

                case 23:
                    num1 = (int)num3 * -904134314 ^ -307186767;
                    continue;

                case 24:
                    num1 = (int)num3 * -1784784803 ^ -1290725405;
                    continue;

                case 25:
                    int num13 = isOnHold2 ? -1987341316 : (num13 = -1219386652);
                    int num14 = (int)num3 * -1471307357;
                    num1 = num13 ^ num14;
                    continue;

                case 26:
                    if (list1.Count == 0)
                    {
                        num1 = (int)num3 * 680160310 ^ -1317242076;
                        continue;
                    }
                    goto label_31;

                case 28:
                    num1 = 844564615;
                    continue;

                case 29:
                    isOnHold2 = this.IsOnHold;
                    num1      = 1192265628;
                    continue;

                case 30:
                    num1 = (int)num3 * -239102751 ^ -286279292;
                    continue;

                case 31:
                    this.IsOnHold = true;
                    num1          = (int)num3 * -1816081388 ^ -721728151;
                    continue;

                case 32:
                    int num15 = !flag1 ? 515354109 : (num15 = 1032815869);
                    int num16 = (int)num3 * 2056930124;
                    num1 = num15 ^ num16;
                    continue;

                default:
                    goto label_45;
                }
                flag2 = num5 != 0;
                num1  = 645817735;
                continue;
label_31:
                num4 = 0;
label_32:
                int num17;
                num1 = num17 = num4 == 0 ? 1544639692 : (num17 = 1558806085);
                continue;
label_43:
                flag3 = num6 != 0;
                num1  = 1023385968;
            }
label_45:
            return(isOnHold1);
        }
 private void OnZoom(ZoomEvent data)
 {
     _targetPos += transform.forward * data.Speed * ZoomSensitivity;
 }
 public PinchHoldZoom(HandModel handModel, ZoomEvent zoomEvent)
     : base(handModel)
 {
     _zoomEvent = zoomEvent;
     _pinch     = new PinchCondition(handModel, false);
 }
Beispiel #13
0
 public bool OnZoom(ZoomEvent p0)
 {
     AppSharedData.MapZoomLevel = p0.ZoomLevel;
     return(true);
 }
Beispiel #14
0
 private void OnZoom()
 {
     //Debug.Log("OnZoom" + rawInpVec);
     ZoomEvent?.Invoke();
 }
Beispiel #15
0
 public void ZoomUpdate(float zoomAmount)
 {
     ZoomEvent?.Invoke(zoomAmount);
 }
 public void ZoomView(ZoomType zoomType)
 {
     ZoomEvent?.Invoke(this, new ZoomEventsArg(zoomType));
 }
Beispiel #17
0
 private void Zoom() => ZoomEvent?.Invoke(GetTouchPosition(0), GetTouchPosition(1));