Beispiel #1
0
        //Untested
        public void Insert(Rectangle key)
        {
            //
            Rectangle newBoundary = this.Root.Boundary.Add(key);

            Point lowerLeft =
                new  Point(newBoundary.minX, newBoundary.minY);

            Point upperRight =
                new  Point(newBoundary.maxX, newBoundary.maxY);

            this.boundary = new  Primitives.Boundary(lowerLeft, upperRight);
            //

            RTreeNode r = this.Root;

            if (r.NumberOfKeys == 2 * this.MinimumDegree - 1)
            {
                RTreeNode s = new RTreeNode();

                this.Root = s;

                s.IsLeaf = false;

                s.AddPointer(r);

                SplitTheNode(s, 0);

                InsertNonFull(s, key);
            }
            else
            {
                InsertNonFull(r, key);
            }
        }
Beispiel #2
0
        public static int Peano03Comparer(Rectangle first, Rectangle second, Primitives.Boundary boundary)
        {
            Point firstPoint = new  Point(first.CenterX, first.CenterY);

            Point secondPoint = new  Point(second.CenterX, second.CenterY);

            return(IRI.Ket.Spatial.PointSorting.PointOrdering.Peano03Comparer(firstPoint, secondPoint, boundary));
        }