| Copyright | (C) 2014 Fumiaki Kinoshita |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
| Stability | provisional |
| Portability | non-portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.BoundingBox
Description
The type and accessors for bounding boxes
Synopsis
- data Box f a = Box (f a) (f a)
- isInside :: (Applicative f, Foldable f, Ord a) => f a -> Box f a -> Bool
- inflate :: (Functor f, Num a) => a -> Box f a -> Box f a
- isCanonical :: (Applicative f, Foldable f, Ord a) => Box f a -> Bool
- union :: (Applicative f, Ord a) => Box f a -> Box f a -> Box f a
- intersect :: (Applicative f, Ord a) => Box f a -> Box f a -> Box f a
- corners :: (Applicative f, Traversable f) => Box f a -> [f a]
- sizePos :: (Applicative f, Num a) => f a -> Iso' (Box f a) (f a, f a)
- position :: (Applicative f, Num a) => f a -> Lens' (Box f a) (f a)
- size :: (Applicative f, Num a) => f a -> Lens' (Box f a) (f a)
Documentation
The type of bounding box for arbitrary vector f.
The functions for this type assume that f is a "zipping" Applicative.
Constructors
| Box (f a) (f a) |
Instances
| Monad f => Monad (Box f) # | |
| Functor f => Functor (Box f) # | |
| Applicative f => Applicative (Box f) # | |
| Foldable f => Foldable (Box f) # | |
Defined in Data.BoundingBox Methods fold :: Monoid m => Box f m -> m # foldMap :: Monoid m => (a -> m) -> Box f a -> m # foldr :: (a -> b -> b) -> b -> Box f a -> b # foldr' :: (a -> b -> b) -> b -> Box f a -> b # foldl :: (b -> a -> b) -> b -> Box f a -> b # foldl' :: (b -> a -> b) -> b -> Box f a -> b # foldr1 :: (a -> a -> a) -> Box f a -> a # foldl1 :: (a -> a -> a) -> Box f a -> a # elem :: Eq a => a -> Box f a -> Bool # maximum :: Ord a => Box f a -> a # minimum :: Ord a => Box f a -> a # | |
| Traversable f => Traversable (Box f) # | |
| Eq (f a) => Eq (Box f a) # | |
| Ord (f a) => Ord (Box f a) # | |
| Read (f a) => Read (Box f a) # | |
| Show (f a) => Show (Box f a) # | |
isInside :: (Applicative f, Foldable f, Ord a) => f a -> Box f a -> Bool #
check whether the point is in the box.
isCanonical :: (Applicative f, Foldable f, Ord a) => Box f a -> Bool #
Returns True if the bounding box is valid.
union :: (Applicative f, Ord a) => Box f a -> Box f a -> Box f a #
Calculate an union between two boundingboxes.
intersect :: (Applicative f, Ord a) => Box f a -> Box f a -> Box f a #
Calculate an intersect between two boundingboxes.
corners :: (Applicative f, Traversable f) => Box f a -> [f a] #
Enumerate the corners.