| Safe Haskell | Safe |
|---|---|
| Language | Haskell98 |
Data.Octree
- data Octree a
- data Vector3 :: * = Vector3 {}
- dist :: Vector3 -> Vector3 -> Double
- fromList :: [(Vector3, a)] -> Octree a
- toList :: Octree t -> [(Vector3, t)]
- lookup :: Octree a -> Vector3 -> Maybe (Vector3, a)
- insert :: (Vector3, a) -> Octree a -> Octree a
- delete :: Eq a => (Vector3, a) -> Octree a -> Octree a
- deleteBy :: ((Vector3, a) -> (Vector3, a) -> Bool) -> (Vector3, a) -> Octree a -> Octree a
- nearest :: Octree a -> Vector3 -> Maybe (Vector3, a)
- depth :: Octree a -> Int
- size :: Octree a -> Int
- withinRange :: Octree a -> Scalar -> Vector3 -> [(Vector3, a)]
Documentation
Datatype for nodes within Octree.
toList :: Octree t -> [(Vector3, t)] #
Creates an Octree from list, trying to keep split points near centers | of mass for each subtree.
insert :: (Vector3, a) -> Octree a -> Octree a #
Inserts a point into an Octree. | NOTE: insert accepts duplicate points, but lookup would not find them - use withinRange in such case.
delete :: Eq a => (Vector3, a) -> Octree a -> Octree a #
Deletes a point from an Octree. | NOTE: If there are duplicate points, it only deletes one of them.