/// <summary> /// Occurs when the manipulation is started. /// </summary> /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param> protected override void Started(ManipulationEventArgs e) { base.Started(e); this.position = e.CurrentPosition; var selectedModels = this.Viewport.FindHits(this.position).Select(hit => hit.Model).ToList(); this.OnModelsSelected(new ModelsSelectedByPointEventArgs(selectedModels, this.position)); }
/// <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.Controller.CameraLookDirection); if (this.LastPoint3D == null || thisPoint3D == null) { return; } Vector3D delta3D = this.LastPoint3D.Value - thisPoint3D.Value; this.Pan(delta3D); this.LastPoint = e.CurrentPosition; this.LastPoint3D = this.UnProject(e.CurrentPosition, this.panPoint3D, this.Controller.CameraLookDirection); }
/// <summary> /// The customized complete operation when the manipulation is completed. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected override void Completed(ManipulationEventArgs e) { this.HideRectangle(); var selectedModels = this.Viewport.FindHits(this.selectionRect, this.SelectionHitMode).Select(hit => hit.Model).ToList(); // We do not handle the point selection, unless no models are selected. If no models are selected, we clear the // existing selection. if (this.selectionRect.Size.Equals(default(Size)) && selectedModels.Any()) { return; } this.OnModelsSelected(new ModelsSelectedByRectangleEventArgs(selectedModels, this.selectionRect)); }
/// <summary> /// The customized complete operation when the manipulation is completed. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected override void Completed(ManipulationEventArgs e) { this.HideRectangle(); var res = this.Viewport.FindHits(this.selectionRect, this.SelectionHitMode); var selectedModels = res.Select(hit => hit.Model).ToList(); // We do not handle the point selection, unless no models are selected. If no models are selected, we clear the // existing selection. if (this.selectionRect.Size.Equals(default(Size)) && selectedModels.Any()) { return; } this.OnModelsSelected(new ModelsSelectedByRectangleEventArgs(selectedModels, this.selectionRect)); var selectedVisuals = res.Select(hit => hit.Visual).ToList(); this.OnVisualsSelected(new VisualsSelectedByRectangleEventArgs(selectedVisuals, this.selectionRect)); }
/// <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.Controller.ActualHeight / this.Controller.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.Controller.UpdateRectangle(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> protected override void Delta(ManipulationEventArgs e) { base.Delta(e); this.selectionRect = new Rect(this.MouseDownPoint, e.CurrentPosition); this.UpdateRectangle(); }
/// <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) { deltaMoved = e.CurrentPosition - this.LastPoint; this.LastPoint = e.CurrentPosition; this.Zoom(deltaMoved.Y * 0.01, this.zoomPoint3D); }
/// <summary> /// Occurs when the manipulation is started. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected virtual void Started(ManipulationEventArgs e) { this.MouseDownPoint = e.CurrentPosition; }
/// <summary> /// Occurs when the manipulation is completed. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected virtual void Completed(ManipulationEventArgs e) { }
/// <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; }
/// <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.Controller.Viewport.ActualWidth / 2, this.Controller.Viewport.ActualHeight / 2); this.rotationPoint3D = this.Controller.CameraTarget; switch (this.Controller.CameraMode) { case CameraMode.WalkAround: this.rotationPoint = this.MouseDownPoint; this.rotationPoint3D = this.Controller.CameraPosition; break; default: if (this.changeLookAt && this.MouseDownNearestPoint3D != null) { this.LookAt(this.MouseDownNearestPoint3D.Value, 0); this.rotationPoint3D = this.Controller.CameraTarget; } else if (this.Controller.RotateAroundMouseDownPoint && this.MouseDownNearestPoint3D != null) { this.rotationPoint = this.MouseDownPoint; this.rotationPoint3D = this.MouseDownNearestPoint3D.Value; } break; } if (this.Controller.CameraMode == CameraMode.Inspect) { this.Controller.ShowTargetAdorner(this.rotationPoint); } switch (this.Controller.CameraRotationMode) { case CameraRotationMode.Trackball: break; case CameraRotationMode.Turntable: break; case CameraRotationMode.Turnball: this.InitTurnballRotationAxes(e.CurrentPosition); break; } this.Controller.StopSpin(); }
/// <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; /// DELETED BY SJT FOR .NET 3.5 //this.ManipulationWatch.Restart(); }
/// <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.Controller.SpinReleaseTime) { this.OnInertiaStarting((int)this.ManipulationWatch.ElapsedMilliseconds); } }
/// <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) { var delta = e.CurrentPosition - this.LastPoint; this.LastPoint = e.CurrentPosition; this.Zoom(delta.Y * 0.01, this.zoomPoint3D); }
/// <summary> /// The customized complete operation when the manipulation is completed. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected override void Completed(ManipulationEventArgs e) { // do not raise event here }
/// <summary> /// Occurs when the manipulation is started. /// </summary> /// <param name="e">The <see cref="ManipulationEventArgs"/> instance containing the event data.</param> protected override void Started(ManipulationEventArgs e) { base.Started(e); this.selectionRect = new Rect(this.MouseDownPoint, this.MouseDownPoint); this.ShowRectangle(); }
/// <summary> /// The customized complete operation when the manipulation is completed. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected override void Completed(ManipulationEventArgs e) { this.HideRectangle(); base.Completed(e); }
/// <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.Controller.Viewport.ActualWidth / 2, this.Controller.Viewport.ActualHeight / 2); this.rotationPoint3D = this.Controller.CameraTarget; switch (this.Controller.CameraMode) { case CameraMode.WalkAround: this.rotationPoint = this.MouseDownPoint; this.rotationPoint3D = this.Controller.CameraPosition; break; default: if (this.Controller.FixedRotationPointEnabled) { this.rotationPoint = this.Viewport.Point3DtoPoint2D(this.Controller.FixedRotationPoint); this.rotationPoint3D = this.Controller.FixedRotationPoint; } else if (this.changeLookAt && this.MouseDownNearestPoint3D != null) { this.LookAt(this.MouseDownNearestPoint3D.Value, 0); this.rotationPoint3D = this.Controller.CameraTarget; } else if (this.Controller.RotateAroundMouseDownPoint && this.MouseDownNearestPoint3D != null) { this.rotationPoint = this.MouseDownPoint; this.rotationPoint3D = this.MouseDownNearestPoint3D.Value; } break; } if (this.Controller.CameraMode == CameraMode.Inspect) { if (this.Controller.ZoomAroundMouseDownPoint) { this.Controller.ShowTargetAdorner(this.MouseDownNearestPoint2D); } else { this.Controller.ShowTargetAdorner(this.MouseDownPoint); } } switch (this.Controller.CameraRotationMode) { case CameraRotationMode.Trackball: break; case CameraRotationMode.Turntable: break; case CameraRotationMode.Turnball: this.InitTurnballRotationAxes(e.CurrentPosition); break; } this.Controller.StopSpin(); }
/// <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.zoomPoint = new Point( this.Controller.Viewport.ActualWidth / 2, this.Controller.Viewport.ActualHeight / 2); this.zoomPoint3D = this.Controller.CameraTarget; if (this.Controller.ZoomAroundMouseDownPoint && this.MouseDownNearestPoint3D != null) { this.zoomPoint = this.MouseDownPoint; this.zoomPoint3D = this.MouseDownNearestPoint3D.Value; } if (!this.changeFieldOfView) { this.Controller.ShowTargetAdorner(this.zoomPoint); } }
/// <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.Controller.HideRectangle(); this.ZoomRectangle(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> protected virtual void Delta(ManipulationEventArgs e) { }
/// <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.Controller.ShowRectangle(this.zoomRectangle, Colors.LightGray, Colors.Black); }
/// <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) { }
/// <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.Controller.HideTargetAdorner(); }
/// <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.Controller.CameraTarget; if (this.MouseDownNearestPoint3D != null) { this.panPoint3D = this.MouseDownNearestPoint3D.Value; } this.LastPoint3D = this.UnProject(this.MouseDownPoint, this.panPoint3D, this.Controller.CameraLookDirection); }
/// <summary> /// Occurs when the manipulation is completed. /// </summary> /// <param name="e"> /// The <see cref="ManipulationEventArgs"/> instance containing the event data. /// </param> protected virtual void Completed(ManipulationEventArgs e) { var handler = this.ModelsSelected; if (handler != null) { handler(this.Viewport, this.PrepareModelsSelectedEventArgs()); } }