Ejemplo n.º 1
0
        public TekAreaDef FlipHorizontal()
        {
            TekAreaDef result = new TekAreaDef(String.Format("{0} hori flip", Description));

            for (int i = 0; i < Points.Count; i++)
            {
                Point P = Points[i];
                result.AddPoint(new Point(xMax - P.X, P.Y));
            }
            return(result.Normalized());
        }
Ejemplo n.º 2
0
        public TekAreaDef Rotate90()
        {
            TekAreaDef result = new TekAreaDef(String.Format("{0} rot 90", Description), this.Points[0]);

            foreach (Point value in this.Deltas)
            {
                result.Deltas.Add(new Point(-value.Y, value.X));
                Point p = result.Deltas.ElementAt(result.Deltas.Count - 1);
                result.AddPoint(new Point(this.Points[0].X + p.X, this.Points[0].Y + p.Y));
            }
            return(result.Normalized());
        }
Ejemplo n.º 3
0
        public bool Equals(TekAreaDef other)
        {
            TekAreaDef N1 = this.Normalized();
            TekAreaDef N2 = other.Normalized();

            if (N1.Points.Count != N2.Points.Count)
            {
                return(false);
            }
            foreach (Point P1 in N1.Points)
            {
                if (!N2.Points.Contains(P1))
                {
                    return(false);
                }
            }
            return(true);
        }