private IEnumerable <SegmentProxyNeighborhood> GetNeighborhoods( BoxTree <SegmentProxy> neighborBoxTree, double searchDistance, IBox commonBox) { return(_boxTree.EnumerateNeighborhoods(neighborBoxTree, searchDistance, commonBox) .Select(boxPairs => new SegmentProxyNeighborhood { SegmentProxy = boxPairs.Entry.Value, Neighbours = GetSegments(boxPairs.Neighbours) })); }
private IEnumerable <SegmentProxyNeighborhood> GetNeighborhoods( BoxTree <SegmentProxy> neighborBoxTree, double searchDistance, IBox commonBox) { foreach (BoxTree <SegmentProxy> .Neighborhood <SegmentProxy> boxPairs in _boxTree.EnumerateNeighborhoods(neighborBoxTree, searchDistance, commonBox)) { SegmentProxyNeighborhood neighborhood = new SegmentProxyNeighborhood { SegmentProxy = boxPairs.Entry.Value, Neighbours = GetSegments(boxPairs.Neighbours) }; yield return(neighborhood); } }