Esempio n. 1
0
        public static PPoint2D operator /(PPoint2D a, ITransformation2D b)
        {
            var allPoints = new List <PPoint2D> {
                a
            };
            INvertibleTransformation2D transformation2D = b as INvertibleTransformation2D;

            if (transformation2D == null)
            {
                throw new InvalidCastException("Transformation not invertible!");
            }
            transformation2D.Invert(ref a, allPoints);
            return(a);
        }
Esempio n. 2
0
        public static Plot2D operator /(Plot2D a, ITransformation2D b)
        {
            var l = a._points.ConvertAll(el => new PPoint2D(el.X, el.Y, el.Color, el.Visible));

            Parallel.For(0, a._points.Count, i =>
            {
                PPoint2D point = a._points[i];
                INvertibleTransformation2D transformation2D = b as INvertibleTransformation2D;
                if (transformation2D == null)
                {
                    throw new InvalidCastException("Transformation not invertible!");
                }
                transformation2D.Invert(ref point, l);
                a._points[i] = point;
            });
            return(a);
        }