public IQuadTreeNode AddItem(T item) { var bounding = _getBounding(item); if (_topLeft.Rect.Intersects(bounding)) { _topLeft = _topLeft.AddItem(item); } if (_topRight.Rect.Intersects(bounding)) { _topRight = _topRight.AddItem(item); } if (_bottomLeft.Rect.Intersects(bounding)) { _bottomLeft = _bottomLeft.AddItem(item); } if (_bottomRight.Rect.Intersects(bounding)) { _bottomRight = _bottomRight.AddItem(item); } return(this); }
public void AddItem(T item) { _root = _root.AddItem(item); }