data-spacepart-20090126.0: Space partition data structures. Currently only a QuadTree.




data QuadTree e whereSource


QuadTree :: Intersectable e Boundary => [e] -> Boundary -> (Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e)) -> QuadTree e 

empty :: Intersectable e Boundary => QuadTree eSource

Returns an empty QuadTree. Which is centered around (0,0) with a size of 2

insert :: (Intersectable e Boundary, HasBoundary e) => e -> QuadTree e -> QuadTree eSource

Inserts the given element into the quadtree. - If all boundary points of an element are not contained within the QuadTree's boundary then a - insert_as_parent is performed. - If only a single quadrant intersects the element then a insert_as_child is performed. - Otherwise the element is inserted into the current node's element reference list.