예제 #1
0
        /// <summary>
        /// also sets Colors
        ///
        /// good to override InitAltitudes(...) but seems not possible
        /// </summary>
        internal void InitPoints(Point2[] pixels, bool isGrey)
        {
            ColorsManager colorsManager = null;

            switch (_map.Projection)
            {
            case Projection.Healpix:
            case Projection.Healpix2Equirectangular:     /*mean min, nax will be calculated later  */
                colorsManager = InitAltitudes(ApproxMan.Pixels, isGrey);
                break;

            case Projection.Equirectangular:     /*min and max may not be precalculated*/
                double?min = MinDefault, max = MaxDefault;
                if (min == null || max == null)
                {
                    // slow?
                    var pix = (from pixel in pixels
                               select new HealCoor(Equirectangular.CoorFromXY(pixel, _map.YResolution, HealpixManager))
                               ).ToArray();
                    colorsManager = InitAltitudes(pix, isGrey);
                }
                break;
            }
            colorsManager.SetScales(_map.ColorsAbove, _map.ColorsUnder);
        }