/// <summary> /// The started. /// </summary> /// <param name="e"> /// The e. /// </param> public override void Started(ManipulationEventArgs e) { base.Started(e); DataPoint current = this.InverseTransform(e.CurrentPosition.X, e.CurrentPosition.Y); double scale = this.Step; if (this.FineControl) { scale *= 3; } scale = 1 + scale; // make sure the zoom factor is not negative if (scale < 0.1) { scale = 0.1; } if (this.XAxis != null) { this.PlotControl.ZoomAt(this.XAxis, scale, current.X); } if (this.YAxis != null) { this.PlotControl.ZoomAt(this.YAxis, scale, current.Y); } this.PlotControl.InvalidatePlot(); }
/// <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 a manipulation is complete. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public override void Completed(ManipulationEventArgs e) { base.Completed(e); if (this.currentSeries == null) { return; } this.currentSeries = null; this.PlotControl.HideTracker(); }
/// <summary> /// Occurs when an input device begins a manipulation on the plot. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public override void Started(ManipulationEventArgs e) { base.Started(e); if (this.XAxis != null) { this.PlotControl.Reset(this.XAxis); } if (this.YAxis != null) { this.PlotControl.Reset(this.YAxis); } this.PlotControl.InvalidatePlot(); }
/// <summary> /// Occurs when the input device changes position during a manipulation. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public override void Delta(ManipulationEventArgs e) { base.Delta(e); if (this.XAxis != null) { this.PlotControl.Pan(this.XAxis, this.PreviousPosition, e.CurrentPosition); } if (this.YAxis != null) { this.PlotControl.Pan(this.YAxis, this.PreviousPosition, e.CurrentPosition); } this.PlotControl.RefreshPlot(false); this.PreviousPosition = e.CurrentPosition; }
/// <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); }
/// <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> /// Occurs when the input device changes position during a manipulation. /// </summary> /// <param name="e">The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data.</param> public override void Delta(ManipulationEventArgs e) { base.Delta(e); DataPoint current = this.InverseTransform(e.CurrentPosition.X, e.CurrentPosition.Y); if (this.XAxis != null) { this.PlotControl.ZoomAt(this.XAxis, e.ScaleX, current.X); } if (this.YAxis != null) { this.PlotControl.ZoomAt(this.YAxis, e.ScaleY, current.Y); } this.PlotControl.InvalidatePlot(); }
/// <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 input device changes position during a manipulation. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public override void Delta(ManipulationEventArgs e) { base.Delta(e); if (this.currentSeries == null) { return; } if (!this.PlotControl.ActualModel.PlotArea.Contains(e.CurrentPosition.X, e.CurrentPosition.Y)) { return; } TrackerHitResult result = GetNearestHit(this.currentSeries, e.CurrentPosition, this.Snap, this.PointsOnly); if (result != null) { result.PlotModel = this.PlotControl.ActualModel; this.PlotControl.ShowTracker(result); } }
/// <summary> /// Starts manipulation of the object /// </summary> public void StartManipulation(Vector3 downPos) { if (!IsManipulationEnabled) { return; } if (isManipulating || isHolding) { return; } isManipulating = true; this.startHandPos = downPos; this.lerpedHandPos = this.startHandPos; var ea = new ManipulationEventArgs( currentInputSource, currentInputSourceId, Vector3.zero); RaiseManipulationStartedEvent(ea); }
private void ManipulationChangedEventHandler(object sender, ManipulationEventArgs e) { HandleRotation(e.TotalRotation); HandleScale(e.ScaleDelta); }
/// <summary> /// Occurs when an input device begins a manipulation on the plot. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public override void Started(ManipulationEventArgs e) { base.Started(e); this.currentSeries = this.PlotControl.GetSeriesFromPoint(e.CurrentPosition); this.Delta(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.zoomPoint = new Point(this.Viewport.ActualWidth / 2, this.Viewport.ActualHeight / 2); this.zoomPoint3D = this.Camera.Target; if (this.Viewport.ZoomAroundMouseDownPoint && this.MouseDownNearestPoint3D != null) { this.zoomPoint = this.MouseDownPoint; this.zoomPoint3D = this.MouseDownNearestPoint3D.Value; } if (!this.changeFieldOfView) { this.Viewport.ShowTargetAdorner(this.zoomPoint); } }
/// <summary> /// Occurs when the input device changes position during a manipulation. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public virtual void Delta(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.zoomRectangle = new Rect(this.MouseDownPoint, this.MouseDownPoint); this.Controller.ShowRectangle(this.zoomRectangle, Colors.LightGray, Colors.Black); }
/// <summary> /// Occurs when a manipulation is complete. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public virtual void Completed(ManipulationEventArgs e) { this.PlotControl.SetCursorType(CursorType.Default); }
/// <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 an input device begins a manipulation on the plot. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public override void Started(ManipulationEventArgs e) { base.Started(e); this.PreviousPosition = e.CurrentPosition; }
/// <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 an input device begins a manipulation on the plot. /// </summary> /// <param name="e"> /// The <see cref="OxyPlot.ManipulationEventArgs"/> instance containing the event data. /// </param> public virtual void Started(ManipulationEventArgs e) { Axis xaxis; Axis yaxis; this.PlotControl.GetAxesFromPoint(e.CurrentPosition, out xaxis, out yaxis); this.StartPosition = e.CurrentPosition; this.XAxis = xaxis; this.YAxis = yaxis; this.PlotControl.SetCursorType(this.GetCursorType()); }
/// <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> /// 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> /// 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> /// 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 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 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> 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> protected virtual void Started(ManipulationEventArgs e) { this.MouseDownPoint = 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.panPoint3D = this.Camera.Target; if (this.MouseDownNearestPoint3D != null) { this.panPoint3D = this.MouseDownNearestPoint3D.Value; } this.LastPoint3D = this.UnProject(this.MouseDownPoint, this.panPoint3D, this.Camera.LookDirection); }