/// <summary> /// Adds an entry to this index bucket, without making a copy. /// </summary> /// <param name="entry">An index entry</param> public void AddEntry(IndexEntry entry) { entries.Add(entry); }
private bool Covered(IndexEntry entry) { foreach (PruningRegion pruneReg in pruneRegs) { if (pruneReg.Covers(entry.MBR)) return true; } return false; }
private List<PruningRegion> MakePruneRegs(IndexEntry entry) { int dimension = entry.MBR.Dimensions; Orthotope bounds = entry.MBR; List<PruningRegion> pruneRegs = new List<PruningRegion>(); for (int i = 0; i < dimension; i++) { Point pivot = new Point(dimension); for (int j = 0; j < dimension; j++) { if (i == j) { if (pref[j] == PrefSpec.Min) pivot[j] = bounds.Max[j]; else pivot[j] = bounds.Min[j]; } else { if (pref[j] == PrefSpec.Min) pivot[j] = bounds.Min[j]; else pivot[j] = bounds.Max[j]; } } PruningRegion pruneReg = new PruningRegion(pivot, pref); //Check if the new pruning region is covered bool covered = false; foreach (PruningRegion p in this.pruneRegs) { if (p.Covers(pruneReg)) { covered = true; break; } } if(!covered) pruneRegs.Add(pruneReg); } return pruneRegs; }