public HitTestPointData NewFromAdditionalTransformation(MatrixD2D additionalTransformation) { var result = new HitTestPointData(this); result.Transformation.PrependTransform(additionalTransformation); return(result); }
public HitTestPointData NewFromTranslationRotationScaleShear(double x, double y, double rotation, double scaleX, double scaleY, double shear) { var result = new HitTestPointData(this); result.Transformation.TranslatePrepend(x, y); if (0 != rotation) { result.Transformation.RotatePrepend(rotation); } if (1 != scaleX || 1 != scaleY) { result.Transformation.ScalePrepend(scaleX, scaleY); } if (0 != shear) { result.Transformation.ShearPrepend(shear, 0); } return(result); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">Another HitTestData object to copy from.</param> public HitTestPointData(HitTestPointData from) { _hittedPointInPageCoord = from._hittedPointInPageCoord; this._pageScale = from._pageScale; this._transformation = new MatrixD2D(from._transformation); }
public HitTestPointData NewFromAdditionalTransformation(MatrixD2D additionalTransformation) { var result = new HitTestPointData(this); result.Transformation.PrependTransform(additionalTransformation); return result; }
public HitTestPointData NewFromTranslationRotationScaleShear(double x, double y, double rotation, double scaleX, double scaleY, double shear) { var result = new HitTestPointData(this); result.Transformation.TranslatePrepend(x, y); if (0 != rotation) result.Transformation.RotatePrepend(rotation); if (1 != scaleX || 1 != scaleY) result.Transformation.ScalePrepend(scaleX, scaleY); if (0 != shear) result.Transformation.ShearPrepend(shear, 0); return result; }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">Another HitTestData object to copy from.</param> public HitTestPointData(HitTestPointData from) { _hittedPointInPageCoord = from._hittedPointInPageCoord; _pageScale = from._pageScale; _transformation = new MatrixD2D(from._transformation); }
/// <summary> /// Looks for a graph object at pixel position <paramref name="pixelPos"/> and returns true if one is found. /// </summary> /// <param name="pixelPos">The pixel coordinates (graph panel coordinates)</param> /// <param name="plotItemsOnly">If true, only the plot items where hit tested.</param> /// <param name="foundObject">Found object if there is one found, else null</param> /// <param name="foundInLayerNumber">The layer the found object belongs to, otherwise 0</param> /// <returns>True if a object was found at the pixel coordinates <paramref name="pixelPos"/>, else false.</returns> public bool FindGraphObjectAtPixelPosition(PointF pixelPos, bool plotItemsOnly, out IHitTestObject foundObject, out int foundInLayerNumber) { var mousePT = PixelToPrintableAreaCoordinates(pixelPos); var hitData = new HitTestPointData(mousePT, this.ZoomFactor); for (int nLayer = 0; nLayer < Layers.Count; nLayer++) { XYPlotLayer layer = Layers[nLayer]; foundObject = layer.HitTest(hitData, plotItemsOnly); if (null != foundObject) { foundInLayerNumber = nLayer; return true; } } foundObject = null; foundInLayerNumber = 0; return false; }
/// <summary> /// Looks for a graph object at pixel position <paramref name="pixelPos"/> and returns true if one is found. /// </summary> /// <param name="pixelPos">The pixel coordinates (graph panel coordinates)</param> /// <param name="plotItemsOnly">If true, only the plot items where hit tested.</param> /// <param name="foundObject">Found object if there is one found, else null</param> /// <param name="foundInLayerNumber">The layer the found object belongs to, otherwise 0</param> /// <returns>True if a object was found at the pixel coordinates <paramref name="pixelPos"/>, else false.</returns> public bool FindGraphObjectAtPixelPosition(PointD2D pixelPos, bool plotItemsOnly, out IHitTestObject foundObject, out int[] foundInLayerNumber) { var mousePT = ConvertMouseToRootLayerCoordinates(pixelPos); var hitData = new HitTestPointData(mousePT, this.ZoomFactor); foundObject = RootLayer.HitTest(hitData, plotItemsOnly); if (null != foundObject && null != foundObject.ParentLayer) { foundInLayerNumber = foundObject.ParentLayer.IndexOf().ToArray(); return true; } foundObject = null; foundInLayerNumber = null; return false; }