private Collection <ulong> GetPossibleNodes(ulong location) { Collection <ulong> possibleNodes = new Collection <ulong>(); foreach (ulong key in qtree.Keys) { if (QTreeHelper.HasPart(location, key)) { possibleNodes.Add(key); } } return(possibleNodes); }
private Collection <QuadTreeNode> GetIntersectedCells(RectangleShape boundingBox, int level) { Collection <QuadTreeNode> result = new Collection <QuadTreeNode>(); ulong queriedBboxLocation = QTreeHelper.GetLocation(maxExtent, boundingBox, level); lock (sync) { foreach (ulong key in qtree.Keys) { //QuadCell cell = QTreeHelper.GetCellByLocation(maxExtent, key); if (QTreeHelper.HasPart(queriedBboxLocation, key) && boundingBox.Intersects(QTreeHelper.GetCellByLocation(maxExtent, key).BoundingBox)) { result.Add(qtree[key]); } } } return(result); }