internal void addEntry(Rectangle r, int id) { ids[entryCount] = id; entries[entryCount] = r.copy(); entryCount++; if (mbr == null) { mbr = r.copy(); } else { mbr.add(r); } }
/** * Find the the union of this rectangle and the passed rectangle. * Neither rectangle is altered * * @param r The rectangle to union with this rectangle */ internal Rectangle union(Rectangle r) { Rectangle union = this.copy(); union.add(r); return(union); }
/** * Given a Node<T> object, calculate the Node<T> MBR from it's entries. * Used in consistency checking */ 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); }