SortSites() static private méthode

static private SortSites ( List sites ) : void
sites List
Résultat void
Exemple #1
0
        internal Rect GetSitesBounds()
        {
            if (_sorted == false)
            {
                Site.SortSites(_sites);
                _currentIndex = 0;
                _sorted       = true;
            }
            float xmin, xmax, ymin, ymax;

            if (_sites.Count == 0)
            {
                return(new Rect(0, 0, 0, 0));
            }
            xmin = float.MaxValue;
            xmax = float.MinValue;
            for (int i = 0; i < _sites.Count; i++)
            {
                Site site = _sites [i];
                if (site.x < xmin)
                {
                    xmin = site.x;
                }
                if (site.x > xmax)
                {
                    xmax = site.x;
                }
            }
            // here's where we assume that the sites have been sorted on y:
            ymin = _sites [0].y;
            ymax = _sites [_sites.Count - 1].y;

            return(new Rect(xmin, ymin, xmax - xmin, ymax - ymin));
        }
Exemple #2
0
        internal RectangleF GetSitesBounds()
        {
            if (_sorted == false)
            {
                Site.SortSites(_sites);
                _currentIndex = 0;
                _sorted       = true;
            }
            float xmin, xmax, ymin, ymax;

            if (_sites.Count == 0)
            {
                return(new RectangleF(0, 0, 0, 0));
            }
            xmin = float.MaxValue;
            xmax = float.MinValue;
            foreach (Site site in _sites)
            {
                if (site.X < xmin)
                {
                    xmin = site.X;
                }
                if (site.X > xmax)
                {
                    xmax = site.X;
                }
            }
            // here's where we assume that the sites have been sorted on y:
            ymin = _sites[0].Y;
            ymax = _sites[_sites.Count - 1].Y;

            return(new RectangleF(xmin, ymin, xmax - xmin, ymax - ymin));
        }
        internal Rect GetSitesBounds()
        {
            if (!_sorted)
            {
                Site.SortSites(_sites);
                _currentIndex = 0;
                _sorted       = true;
            }
            if (_sites.Count == 0)
            {
                return(new Rect(0f, 0f, 0f, 0f));
            }
            float num  = 3.40282347E+38f;
            float num2 = -3.40282347E+38f;

            for (int i = 0; i < _sites.Count; i++)
            {
                Site site = _sites[i];
                if (site.x < num)
                {
                    num = site.x;
                }
                if (site.x > num2)
                {
                    num2 = site.x;
                }
            }
            float y  = _sites[0].y;
            float y2 = _sites[_sites.Count - 1].y;

            return(new Rect(num, y, num2 - num, y2 - y));
        }
Exemple #4
0
 public void SortList()
 {
     Site.SortSites(sites);
     sorted = true;
 }