Example #1
0
 /// <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);
 }
Example #2
0
        /// <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);
        }
Example #3
0
 /// <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;
 }
Example #4
0
 /// <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)
 {
 }
Example #5
0
 /// <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)
 {
 }
Example #6
0
 /// <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;
 }
Example #7
0
 /// <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();
 }
Example #8
0
 /// <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();
 }