예제 #1
0
 protected SuperSector(SuperSector <T> superSector,
                       double minLat, double maxLat, double minLon, double maxLon,
                       int latDivisions, int lonDivisions)
     : this(minLat, maxLat, minLon, maxLon, latDivisions, lonDivisions)
 {
     SuperSector = superSector;
 }
예제 #2
0
        protected void DivideSubSector(AbstractSector <T> sector, int latDivisions, int lonDivisions)
        {
            List <T> all = sector.GetAllItems();

            int latIndex, lonIndex;
            int w = sectors.GetLength(0);
            int h = sectors.GetLength(1);
            int x = 0;
            int y = 0;

            for (; x < w; x++)
            {
                for (; y < h; y++)
                {
                    if (sectors[x, y] == sector)
                    {
                        latIndex = y;
                        lonIndex = x;
                        break;
                    }
                }
            }
            if (x == w)
            {
                throw new SectorNotFoundException();
            }

            double latRange = MaxLat - MinLat;
            double lonRange = MaxLon - MinLon;
            double minLat   = this.MinLat + latRange / this.LatDivisions * y;
            double maxLat   = this.MinLat + latRange / this.LatDivisions * (y + 1);
            double minLon   = this.MinLon + lonRange / this.LonDivisions * x;
            double maxLon   = this.MinLon + lonRange / this.LonDivisions * (x + 1);

            sectors[x, y] = new SuperSector <T>(this, minLat, maxLat, minLon, maxLon,
                                                latDivisions, lonDivisions);
        }
예제 #3
0
 public virtual Globe <T> GetGlobe()
 {
     return(SuperSector.GetGlobe());
 }
예제 #4
0
 public Sector(SuperSector <T> superSector, double minLat, double maxLat, double minLon, double maxLon)
     : base(minLat, maxLat, minLon, maxLon)
 {
     SuperSector = superSector;
 }