public void EnumerateAnnotationsInBox(FBBoundingBox box, FBQuadTreeNode withNode, AnnotationEnumDelegate enumFunc) { if (!FBUtils.FBBoundingBoxIntersectsBoundingBox(withNode.BoundingBox, box)) { return; } List<IMKAnnotation> tempArray = new List<IMKAnnotation>(withNode.Annotations); foreach (IMKAnnotation annotation in tempArray) { if (FBUtils.FBBoundingBoxContainsCoordinate(box, annotation.Coordinate)) { enumFunc(annotation); } } if (withNode.IsLeaf()) { return; } EnumerateAnnotationsInBox(box, withNode.NorthEast, enumFunc); EnumerateAnnotationsInBox(box, withNode.NorthWest, enumFunc); EnumerateAnnotationsInBox(box, withNode.SouthEast, enumFunc); EnumerateAnnotationsInBox(box, withNode.SouthWest, enumFunc); }
public void EnumerateAnnotations(AnnotationEnumDelegate enumFunc) { EnumerateAnnotationsInBox(FBUtils.FBBoundingBoxForMapRect(new MKMapRect().World), _rootNode, enumFunc); }
public void EnumerateAnnotationsInBox(FBBoundingBox box, AnnotationEnumDelegate enumFunc) { EnumerateAnnotationsInBox(box, _rootNode, enumFunc); }
public void EnumerateAnnotationsInBox(FBBoundingBox box, FBQuadTreeNode withNode, AnnotationEnumDelegate enumFunc) { if (!FBUtils.FBBoundingBoxIntersectsBoundingBox(withNode.BoundingBox, box)) { return; } List <IMKAnnotation> tempArray = new List <IMKAnnotation>(withNode.Annotations); foreach (IMKAnnotation annotation in tempArray) { if (FBUtils.FBBoundingBoxContainsCoordinate(box, annotation.Coordinate)) { enumFunc(annotation); } } if (withNode.IsLeaf()) { return; } EnumerateAnnotationsInBox(box, withNode.NorthEast, enumFunc); EnumerateAnnotationsInBox(box, withNode.NorthWest, enumFunc); EnumerateAnnotationsInBox(box, withNode.SouthEast, enumFunc); EnumerateAnnotationsInBox(box, withNode.SouthWest, enumFunc); }