Esempio n. 1
0
        /// <summary>
        /// Occurs when the position is changed during a manipulation.
        /// </summary>
        /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
        public override void Delta(ManipulationEventArgs e)
        {
            base.Delta(e);
            var thisPoint3D = this.UnProject(e.CurrentPosition, this.panPoint3D, this.Camera.LookDirection);

            if (this.LastPoint3D == null || thisPoint3D == null)
            {
                return;
            }

            var delta3D = this.LastPoint3D.Value - thisPoint3D.Value;
            this.Pan(delta3D);

            this.LastPoint = e.CurrentPosition;
            this.LastPoint3D = this.UnProject(e.CurrentPosition, this.panPoint3D, this.Camera.LookDirection);
        }
Esempio n. 2
0
        /// <summary>
        /// Occurs when the position is changed during a manipulation.
        /// </summary>
        /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
        public override void Delta(ManipulationEventArgs e)
        {
            base.Delta(e);

            double ar    = this.Viewport.ActualHeight / this.Viewport.ActualWidth;
            var    delta = this.MouseDownPoint - e.CurrentPosition;

            if (Math.Abs(delta.Y / delta.X) < ar)
            {
                delta.Y = Math.Sign(delta.Y) * Math.Abs(delta.X * ar);
            }
            else
            {
                delta.X = Math.Sign(delta.X) * Math.Abs(delta.Y / ar);
            }

            this.zoomRectangle = new Rect(this.MouseDownPoint, this.MouseDownPoint - delta);

            this.Viewport.ShowZoomRectangle(this.zoomRectangle);
        }
        /// <summary>
        /// Occurs when the position is changed during a manipulation.
        /// </summary>
        /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
        public override void Delta(ManipulationEventArgs e)
        {
            base.Delta(e);

            double ar = this.Viewport.ActualHeight / this.Viewport.ActualWidth;
            var delta = this.MouseDownPoint - e.CurrentPosition;

            if (Math.Abs(delta.Y / delta.X) < ar)
            {
                delta.Y = Math.Sign(delta.Y) * Math.Abs(delta.X * ar);
            }
            else
            {
                delta.X = Math.Sign(delta.X) * Math.Abs(delta.Y / ar);
            }

            this.zoomRectangle = new Rect(this.MouseDownPoint, this.MouseDownPoint - delta);

            this.Viewport.ShowZoomRectangle(this.zoomRectangle);
        }
Esempio n. 4
0
 /// <summary>
 /// Occurs when the manipulation is completed.
 /// </summary>
 /// <param name="e">
 /// The <see cref="ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Completed(ManipulationEventArgs e)
 {
     var elapsed = this.ManipulationWatch.ElapsedMilliseconds;
     if (elapsed > 0 && elapsed < this.Viewport.SpinReleaseTime)
     {
         this.OnInertiaStarting((int)this.ManipulationWatch.ElapsedMilliseconds);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Occurs when the manipulation is started.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Started(ManipulationEventArgs e)
 {
     base.Started(e);
     this.zoomRectangle = new Rect(this.MouseDownPoint, this.MouseDownPoint);
     this.Viewport.ShowZoomRectangle(this.zoomRectangle);
 }
Esempio n. 6
0
 /// <summary>
 /// Occurs when the manipulation is completed.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Completed(ManipulationEventArgs e)
 {
     base.Completed(e);
     this.Viewport.HideZoomRectangle();
     this.ZoomRectangle(this.zoomRectangle);
 }
Esempio n. 7
0
        /// <summary>
        /// Occurs when the manipulation is started.
        /// </summary>
        /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
        public override void Started(ManipulationEventArgs e)
        {
            base.Started(e);
            this.panPoint3D = this.Camera.Target;
            if (this.MouseDownNearestPoint3D != null)
            {
                this.panPoint3D = this.MouseDownNearestPoint3D.Value;
            }

            this.LastPoint3D = this.UnProject(this.MouseDownPoint, this.panPoint3D, this.Camera.LookDirection);
        }
Esempio n. 8
0
        /// <summary>
        /// Occurs when the manipulation is started.
        /// </summary>
        /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
        public override void Started(ManipulationEventArgs e)
        {
            base.Started(e);

            this.rotationPoint = new Point(
                this.Viewport.ActualWidth / 2, this.Viewport.ActualHeight / 2);
            this.rotationPoint3D = this.Camera.Target;

            switch (this.CameraMode)
            {
                case CameraMode.WalkAround:
                    this.rotationPoint = this.MouseDownPoint;
                    this.rotationPoint3D = this.Camera.Position;
                    break;
                default:
                    if (this.changeLookAt && this.MouseDownNearestPoint3D != null)
                    {
                        this.LookAt(this.MouseDownNearestPoint3D.Value, 0);
                        this.rotationPoint3D = this.Camera.Target;
                    }
                    else if (this.Viewport.RotateAroundMouseDownPoint && this.MouseDownNearestPoint3D != null)
                    {
                        this.rotationPoint = this.MouseDownPoint;
                        this.rotationPoint3D = this.MouseDownNearestPoint3D.Value;
                    }

                    break;
            }

            if (this.CameraMode == CameraMode.Inspect)
            {
                this.Viewport.ShowTargetAdorner(this.rotationPoint);
            }

            switch (this.CameraRotationMode)
            {
                case CameraRotationMode.Trackball:
                    break;
                case CameraRotationMode.Turntable:
                    break;
                case CameraRotationMode.Turnball:
                    this.InitTurnballRotationAxes(e.CurrentPosition);
                    break;
            }

            this.Viewport.StopSpin();
        }
Esempio n. 9
0
 /// <summary>
 /// Occurs when the position is changed during a manipulation.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Delta(ManipulationEventArgs e)
 {
     base.Delta(e);
     this.Rotate(this.LastPoint, e.CurrentPosition, this.rotationPoint3D);
     this.LastPoint = e.CurrentPosition;
 }
Esempio n. 10
0
 /// <summary>
 /// Occurs when the manipulation is completed.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Completed(ManipulationEventArgs e)
 {
     base.Completed(e);
     this.Viewport.HideZoomRectangle();
     this.ZoomRectangle(this.zoomRectangle);
 }
Esempio n. 11
0
 /// <summary>
 /// Occurs when the manipulation is completed.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Completed(ManipulationEventArgs e)
 {
     base.Completed(e);
     this.Viewport.HideTargetAdorner();
 }
Esempio n. 12
0
 /// <summary>
 /// Occurs when the position is changed during a manipulation.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Delta(ManipulationEventArgs e)
 {
     base.Delta(e);
     this.Rotate(this.LastPoint, e.CurrentPosition, this.rotationPoint3D);
     this.LastPoint = e.CurrentPosition;
 }
Esempio n. 13
0
 /// <summary>
 /// Occurs when the manipulation is completed.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Completed(ManipulationEventArgs e)
 {
     base.Completed(e);
     this.Viewport.HideTargetAdorner();
 }
Esempio n. 14
0
 /// <summary>
 /// Occurs when the position is changed during a manipulation.
 /// </summary>
 /// <param name="e">
 /// The <see cref="ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Delta(ManipulationEventArgs e)
 {
 }
Esempio n. 15
0
 /// <summary>
 /// Occurs when the manipulation is started.
 /// </summary>
 /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param>
 public override void Started(ManipulationEventArgs e)
 {
     base.Started(e);
     this.zoomRectangle = new Rect(this.MouseDownPoint, this.MouseDownPoint);
     this.Viewport.ShowZoomRectangle(this.zoomRectangle);
 }
Esempio n. 16
0
 /// <summary>
 /// Occurs when the manipulation is started.
 /// </summary>
 /// <param name="e">
 /// The <see cref="ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Started(ManipulationEventArgs e)
 {
     this.SetMouseDownPoint(e.CurrentPosition);
     this.LastPoint = this.MouseDownPoint;
     this.LastPoint3D = this.MouseDownPoint3D;
     this.ManipulationWatch.Restart();
 }
Esempio n. 17
0
 /// <summary>
 /// Occurs when the position is changed during a manipulation.
 /// </summary>
 /// <param name="e">
 /// The <see cref="ManipulationEventArgs"/> instance containing the event data.
 /// </param>
 public virtual void Delta(ManipulationEventArgs e)
 {
 }