public void addEntry(Rectangle r, int id) { ids[entryCount] = id; entries[entryCount] = r.copy(); entryCount++; if (mbr == null) { mbr = r.copy(); } else { mbr.add(r); } }
/// <summary> /// Find the the union of this rectangle and the passed rectangle. /// Neither rectangle is altered /// </summary> /// <param name="r">The rectangle to union with this rectangle</param> internal Rectangle union(Rectangle r) { Rectangle union = this.copy(); union.add(r); return(union); }
/// <summary> /// Find the the union of this rectangle and the passed rectangle. /// Neither rectangle is altered /// </summary> /// <param name="r">The rectangle to union with this rectangle</param> public Rectangle union(Rectangle r) { Rectangle union = this.copy(); union.add(r); return(union); }
/// <summary> /// Given a Node<T> object, calculate the Node<T> MBR from it's entries. /// Used in consistency checking /// </summary> private Rectangle calculateMBR(Node <T> n) { Rectangle mbr = new Rectangle(n.entries[0].min, n.entries[0].max); for (int i = 1; i < n.entryCount; i++) { mbr.add(n.entries[i]); } return(mbr); }