/// <summary> /// Get a list of all items in the quadtree /// </summary> /// <param name="ItemsFound">The list to add found items to (list will not be cleared first)</param> public void GetAllItems(ref List <QuadTreePositionItem <T> > ItemsList) { if (ItemsList != null) { headNode.GetAllItems(ref ItemsList); } }
/// <summary> /// Gets a list of all items within this node /// </summary> /// <param name="ItemsFound">The list to add found items to (list will not be cleared first)</param> /// <remarks>ItemsFound is assumed to be initialized, and will not be cleared</remarks> public void GetAllItems(ref List <QuadTreePositionItem <T> > ItemsFound) { ItemsFound.AddRange(Items); // query all subtrees if (IsPartitioned) { TopLeftNode.GetAllItems(ref ItemsFound); TopRightNode.GetAllItems(ref ItemsFound); BottomLeftNode.GetAllItems(ref ItemsFound); BottomRightNode.GetAllItems(ref ItemsFound); } }