module Data.BoundingBox
(
BoundingBox (..),
R.Range (), B1.BBox1 (),
B2.BBox2 (),
B3.BBox3 (),
B4.BBox4 ()
)
where
import Data.Vector
import qualified Data.BoundingBox.Range as R
import qualified Data.BoundingBox.B1 as B1
import qualified Data.BoundingBox.B2 as B2
import qualified Data.BoundingBox.B3 as B3
import qualified Data.BoundingBox.B4 as B4
class BoundingBox b where
type Point b :: *
bounds :: Point b -> Point b -> b
min_bound :: b -> Point b
max_bound :: b -> Point b
within_bounds :: Point b -> b -> Bool
union :: b -> b -> b
isect :: b -> b -> Maybe b
instance BoundingBox R.Range where
type Point R.Range = Scalar
bounds = R.bounds
min_bound = R.min_bound
max_bound = R.max_bound
within_bounds = R.within_bounds
union = R.union
isect = R.isect
instance BoundingBox B1.BBox1 where
type Point B1.BBox1 = Vector1
bounds = B1.bounds
min_bound = B1.min_bound
max_bound = B1.max_bound
within_bounds = B1.within_bounds
union = B1.union
isect = B1.isect
instance BoundingBox B2.BBox2 where
type Point B2.BBox2 = Vector2
bounds = B2.bounds
min_bound = B2.min_bound
max_bound = B2.max_bound
within_bounds = B2.within_bounds
union = B2.union
isect = B2.isect
instance BoundingBox B3.BBox3 where
type Point B3.BBox3 = Vector3
bounds = B3.bounds
min_bound = B3.min_bound
max_bound = B3.max_bound
within_bounds = B3.within_bounds
union = B3.union
isect = B3.isect
instance BoundingBox B4.BBox4 where
type Point B4.BBox4 = Vector4
bounds = B4.bounds
min_bound = B4.min_bound
max_bound = B4.max_bound
within_bounds = B4.within_bounds
union = B4.union
isect = B4.isect