Example #1
0
        /// <summary>
        /// Takes "bukalemun" values, converts them to "pixelated" values and saves for next drawing.
        /// </summary>
        /// <param name="dataPoints">An IEnumerable set of bukalemun type data points</param>
        public void SetPoints(IEnumerable <DataPoint> dataPoints)
        {
            // Convert bukalemunDataPoints into pixelatedDataPoints and add them to Ellipses & Polyliner classes //hypothetical == bukalemun?
            Ellipses.Reset();
            Polyliner.Reset();
            DataPoint temp_PixelatedDataPoint;

            foreach (DataPoint bukalemunDataPoint in dataPoints)
            {
                // Linear mapping from imagined "bukalemun 2D plane" to real "pixelated 2D plane"
                temp_PixelatedDataPoint   = bukalemunDataPoint;
                temp_PixelatedDataPoint.X = AxesWithOrigin.Origin.Item1 + temp_PixelatedDataPoint.X * AxesWithOrigin.XScalingFactor;
                temp_PixelatedDataPoint.Y = AxesWithOrigin.Origin.Item2 + temp_PixelatedDataPoint.Y * AxesWithOrigin.YScalingFactor;

                // Add the result of transformation as both a circle to the Ellipses and point to the Polyliner
                Ellipses.AddPoint(bukalemunDataPoint, temp_PixelatedDataPoint);
                Polyliner.AddPoint(temp_PixelatedDataPoint);
            }
        }