public Region FindFirst(RGNH header) { foreach (var rng in List.Values) { if (header.KeyLo <= rng.Header.KeyHi && rng.Header.KeyLo <= header.KeyHi && header.VelLo <= rng.Header.VelHi && rng.Header.VelLo <= header.VelHi) { return(rng); } } return(null); }
public bool ContainsKey(RGNH header) { foreach (var rng in List.Values) { if (header.KeyLo <= rng.Header.KeyHi && rng.Header.KeyLo <= header.KeyHi && header.VelLo <= rng.Header.VelHi && rng.Header.VelLo <= header.VelHi) { return(true); } } return(false); }
public List <Region> Find(RGNH header) { var ret = new List <Region>(); foreach (var rng in List.Values) { if (header.KeyLo <= rng.Header.KeyHi && rng.Header.KeyLo <= header.KeyHi && header.VelLo <= rng.Header.VelHi && rng.Header.VelLo <= header.VelHi) { ret.Add(rng); } } return(ret); }
public void Remove(RGNH header) { var tmpRegion = new List <Region>(); foreach (var rng in List.Values) { if (header.KeyLo <= rng.Header.KeyHi && rng.Header.KeyLo <= header.KeyHi && header.VelLo <= rng.Header.VelHi && rng.Header.VelLo <= header.VelHi) { } else { tmpRegion.Add(rng); } } List.Clear(); foreach (var rgn in tmpRegion) { List.Add(rgn.Header, rgn); } }