/// <summary> /// Adds all the data in the given node and inside the given bounding box to the given data list. /// </summary> /// <param name="data"></param> /// <param name="node"></param> /// <param name="box"></param> public void AddInsideAtNode(IList <TDataType> data, QuadTreeNode node, BoxF2D box) { if (box.Overlaps(_bounds)) { // ok there is an overlap. if (_depth > 0) { if (_minMin != null) { _minMin.AddInsideAtNode(data, node, box); } if (_minMax != null) { _minMax.AddInsideAtNode(data, node, box); } if (_maxMin != null) { _maxMin.AddInsideAtNode(data, node, box); } if (_maxMax != null) { _maxMax.AddInsideAtNode(data, node, box); } } else { foreach (KeyValuePair <TPointType, TDataType> data_pair in _data) { if (box.IsInside(data_pair.Key)) { data.Add(data_pair.Value); } } } } }