- data QuadTree e where
- data Quadrant
- empty :: Intersectable e Boundary => QuadTree e
- insert :: (Intersectable e Boundary, HasBoundary e) => e -> QuadTree e -> QuadTree e
- encloses :: (Intersectable e Boundary, HasBoundary e) => QuadTree e -> e -> Bool
- quadrant_bounds :: QuadTree e -> [(Boundary, Quadrant)]
- insert_via_parent :: (Intersectable e Boundary, HasBoundary e) => e -> QuadTree e -> QuadTree e
- insert_child :: (Intersectable e Boundary, HasBoundary e) => (Boundary, Quadrant) -> e -> QuadTree e -> QuadTree e
- map_child :: (Maybe (QuadTree e) -> Maybe (QuadTree e)) -> Quadrant -> (Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e)) -> (Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e))
Documentation
QuadTree :: Intersectable e Boundary => [e] -> Boundary -> (Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e), Maybe (QuadTree e)) -> QuadTree e |
Show (QuadTree Boundary) | |
HasBoundary (QuadTree e) |
Eq Quadrant | |
Show Quadrant | |
Intersectable s Boundary => Intersectable s (Boundary, Quadrant) |
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.
encloses :: (Intersectable e Boundary, HasBoundary e) => QuadTree e -> e -> BoolSource
quadrant_bounds :: QuadTree e -> [(Boundary, Quadrant)]Source
insert_via_parent :: (Intersectable e Boundary, HasBoundary e) => e -> QuadTree e -> QuadTree eSource
insert_child :: (Intersectable e Boundary, HasBoundary e) => (Boundary, Quadrant) -> e -> QuadTree e -> QuadTree eSource