Ejemplo n.º 1
0
 private void CallTransform(Matrix m)
 {
     if (points != null)
     {
         float[] result = new float[points.Length];
         m.Transform(points, 0, result, 0, points.Length / 2);
         this.points = result;
         this.CheckPoints();
     }
 }
Ejemplo n.º 2
0
 public override Shape Transform(Matrix transform)
 {
     float[] result = new float[points.Length];
     transform.Transform(points, 0, result, 0, points.Length / 2);
     return new Point(points[0], points[1]);
 }
Ejemplo n.º 3
0
 public abstract Shape Transform(Matrix transform);
Ejemplo n.º 4
0
 public virtual void SetScale(float sx, float sy)
 {
     if (scaleX != sx || scaleY != sy) {
         Matrix m = new Matrix();
         m.Scale(scaleX = sx, scaleY = sy);
         this.CallTransform(m);
     }
 }
Ejemplo n.º 5
0
        private List<float[]> Transform(List<float[]> pts, Matrix t)
        {
            float[] ins0 = new float[pts.Count * 2];
            float[] xout = new float[pts.Count * 2];

            for (int i = 0; i < pts.Count; i++)
            {
                ins0[i * 2] = ((float[])pts[i])[0];
                ins0[(i * 2) + 1] = ((float[])pts[i])[1];
            }
            t.Transform(ins0, 0, xout, 0, pts.Count);
            List<float[]> outList = new List<float[]>();
            for (int i_0 = 0; i_0 < pts.Count; i_0++)
            {
                outList.Add(new float[] { xout[(i_0 * 2)], xout[(i_0 * 2) + 1] });
            }
            return outList;
        }
Ejemplo n.º 6
0
 public override Shape Transform(Matrix transform)
 {
     Path p = new Path(cx, cy);
     p.localPoints = Transform(localPoints, transform);
     for (int i = 0; i < holes.Count; i++)
     {
         CollectionUtils.Add(p.holes, Transform((List<float[]>)holes[i], transform));
     }
     p.closed = this.closed;
     return p;
 }
Ejemplo n.º 7
0
 public override Shape Transform(Matrix transform)
 {
     float[] temp = new float[4];
     CreatePoints();
     transform.Transform(points, 0, temp, 0, 2);
     return new Line(temp[0], temp[1], temp[2], temp[3]);
 }