/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(FigurePoint other) { return(other.X == X && other.Y == Y && other.Id == Id && other.FigureId == FigureId); }
/// <summary> /// Scales the figure with specified scale factors for /// x-direction (horizontal) and y-direction (vertical). /// </summary> public virtual void Scale(float scaleX, float scaleY) { for (int i = 0; i < Corners.Count; i++) { FigurePoint pt = Corners[i]; pt.X = (int)(pt.X * scaleX + 0.5f); pt.Y = (int)(pt.Y * scaleY + 0.5f); Corners[i] = pt; } Matrix mat = new Matrix(); mat.Scale(scaleX, scaleY); path.Transform(mat); }
/// <summary> /// Initializes a new instance of the <see cref="FigurePointTriple"/> class. /// </summary> /// <param name="p1">The first point of the triple.</param> /// <param name="p2">The second point of the triple.</param> /// <param name="p3">The third point of the triple.</param> public FigurePointTriple(FigurePoint p1, FigurePoint p2, FigurePoint p3) { P1 = p1; P2 = p2; P3 = p3; }
/// <summary> /// Initializes a new instance of the <see cref="FigurePoint"/> struct. /// </summary> /// <param name="parent">The parent <see cref="FigurePoint"/>.</param> /// <param name="id"> /// The unique id of the <see cref="FigurePoint"/>.</param> /// <param name="figureId"> /// The Id of corresponding <see cref="Figure"/>.</param> /// <param name="keyPointId">The key point id.</param> public FigurePoint( FigurePoint parent, int id, int figureId, int keyPointId = -1) : this(parent.X, parent.Y, id, figureId, parent.Id, parent.FigureId, keyPointId) { }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(FigurePoint other) { return other.X == X && other.Y == Y && other.Id == Id && other.FigureId == FigureId; }
/// <summary> /// Adds the specified point as corner of the figure. /// </summary> /// <param name="pt">The point to add.</param> public void AddCorner(FigurePoint pt) { Corners.Add(pt); RefillPathWithCorners(); }