geometry :: QuadTree :: add_to_children
private fun add_to_children(item: Boxed[Numeric])
do
if children.not_empty then
var center = center
assert center != null
if center.x > item.right then
if center.y > item.top then
children[0].add(item)
else if center.y < item.bottom then
children[1].add(item)
else
self.data.add(item)
end
else if center.x < item.left then
if center.y > item.top then
children[3].add(item)
else if center.y < item.bottom then
children[2].add(item)
else
self.data.add(item)
end
else if center.y > item.top then
self.data.add(item)
else if center.y < item.bottom then
self.data.add(item)
else
self.data.add(item)
end
end
end
lib/geometry/quadtree.nit:72,2--101,4