Ejemplo n.º 1
0
        /// <summary>
        /// Transforms list of points from data coordinates to screen coordinates.
        /// </summary>
        /// <param name="dataPoints">Points in data coordinates</param>
        /// <param name="transform">CoordinateTransform used to perform transformation</param>
        /// <returns>Points in screen coordinates</returns>
        public static List <Point> DataToScreen(this IEnumerable <Point> dataPoints, CoordinateTransform transform)
        {
            ICollection <Point> iCollection = dataPoints as ICollection <Point>;
            List <Point>        res;

            if (iCollection != null)
            {
                res = new List <Point>(iCollection.Count);
            }
            else
            {
                res = new List <Point>();
            }

            foreach (var point in dataPoints)
            {
                res.Add(transform.DataToScreen(point));
            }

            return(res);
        }
Ejemplo n.º 2
0
        internal static CoordinateTransform CreateDefault()
        {
            CoordinateTransform transform = new CoordinateTransform(new Rect(0, 0, 1, 1), new Rect(0, 0, 1, 1));

            return(transform);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Transforms point in data coordinates to viewport coordinates.
 /// </summary>
 /// <param name="dataPoint">Point in data coordinates</param>
 /// <param name="transform">CoordinateTransform used to perform transformation</param>
 /// <returns>Point in viewport coordinates</returns>
 public static Point DataToViewport(this Point dataPoint, CoordinateTransform transform)
 {
     return(transform.DataTransform.DataToViewport(dataPoint));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Transforms point in viewport coordinates to data coordinates.
 /// </summary>
 /// <param name="viewportPoint">Point in viewport coordinates</param>
 /// <param name="transform">CoordinateTransform used to perform transformation</param>
 /// <returns>Point in data coordinates</returns>
 public static Point ViewportToData(this Point viewportPoint, CoordinateTransform transform)
 {
     return(transform.DataTransform.ViewportToData(viewportPoint));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Transforms point in screen coordinates to viewport coordinates.
 /// </summary>
 /// <param name="screenPoint">Point in screen coordinates</param>
 /// <param name="transform">CoordinateTransform used to perform transformation</param>
 /// <returns>Point in viewport coordinates</returns>
 public static Point ScreenToViewport(this Point screenPoint, CoordinateTransform transform)
 {
     return(transform.ScreenToViewport(screenPoint));
 }
Ejemplo n.º 6
0
 public static List <Point> DataToScreen(this CoordinateTransform transform, IEnumerable <Point> dataPoints)
 {
     return(dataPoints.DataToScreen(transform));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Transforms point in data coordinates to screen coordinates.
 /// </summary>
 /// <param name="dataPoint">Point in data coordinates</param>
 /// <param name="transform">CoordinateTransform used to perform transformation</param>
 /// <returns>Point in screen coordinates</returns>
 public static Point DataToScreen(this Point dataPoint, CoordinateTransform transform)
 {
     return(transform.DataToScreen(dataPoint));
 }