-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Fancy type system stuff for AC-Vector
--
-- Adds various type system tricks to AC-Vector. (Requires several
-- language extensions, including type families.) Now includes
-- points_bounds method.
@package AC-Vector-Fancy
@version 2.1.2
-- | Bounding boxes of various numbers of dimensions, plus a class for
-- generically handling them.
module Data.BoundingBox
-- | Class for dealing with bounding boxes.
class BoundingBox b where { type family Point b :: *; }
bounds :: (BoundingBox b) => Point b -> Point b -> b
points_bounds :: (BoundingBox b) => [Point b] -> b
min_bound :: (BoundingBox b) => b -> Point b
max_bound :: (BoundingBox b) => b -> Point b
within_bounds :: (BoundingBox b) => Point b -> b -> Bool
union :: (BoundingBox b) => b -> b -> b
isect :: (BoundingBox b) => b -> b -> Maybe b
-- | Class representing things that possess a bounding box.
class HasBBox x where { type family BBox x :: *; }
get_bbox :: (HasBBox x) => x -> BBox x
-- | A Range represents a continuous interval between two
-- Scalar endpoints.
data Range :: *
-- | The BBox1 type is basically a Range, but all the
-- operations over it work with Vector1 (which is really
-- Scalar). While it's called a bounding box, a
-- 1-dimensional box is in truth a simple line interval, just like
-- Range.
data BBox1 :: *
-- | A BBox2 is a 2D bounding box (aligned to the coordinate axies).
data BBox2 :: *
-- | A BBox3 is a 3D bounding box (aligned to the coordinate axies).
data BBox3 :: *
-- | A BBox4 is a 4D bounding box (aligned to the coordinate axies).
data BBox4 :: *
instance BoundingBox BBox4
instance BoundingBox BBox3
instance BoundingBox BBox2
instance BoundingBox BBox1
instance BoundingBox Range
-- | Types denoting coordinate axies.
module Data.Vector.Axis
data AxisX
AxisX :: AxisX
data AxisY
AxisY :: AxisY
data AxisZ
AxisZ :: AxisZ
data AxisW
AxisW :: AxisW
instance Show AxisW
instance Show AxisZ
instance Show AxisY
instance Show AxisX
-- | Various facilities for dealing with vectors generically.
module Data.Vector.Fancy
-- | Class for generically reading/writing vector coordinates.
class VectorAxis vector axis
get_coord :: (VectorAxis vector axis) => axis -> vector -> Scalar
set_coord :: (VectorAxis vector axis) => axis -> Scalar -> vector -> vector
-- | This class relates two vector types having consecutive sizes.
class Project lo hi
orthographic_down :: (Project lo hi) => hi -> (lo, Scalar)
orthographic_up :: (Project lo hi) => (lo, Scalar) -> hi
perspective_down :: (Project lo hi) => hi -> (lo, Scalar)
perspective_up :: (Project lo hi) => (lo, Scalar) -> hi
instance Project Vector3 Vector4
instance Project Vector2 Vector3
instance Project Vector1 Vector2
instance VectorAxis Vector4 AxisW
instance VectorAxis Vector4 AxisZ
instance VectorAxis Vector3 AxisZ
instance VectorAxis Vector4 AxisY
instance VectorAxis Vector3 AxisY
instance VectorAxis Vector2 AxisY
instance VectorAxis Vector4 AxisX
instance VectorAxis Vector3 AxisX
instance VectorAxis Vector2 AxisX
instance VectorAxis Vector1 AxisX
-- | Generically handle transforms, and things that are transformable.
module Data.Vector.Transform.Fancy
-- | Class for transforms.
class Transform t where { type family Point t :: *; }
transformP :: (Transform t) => t -> Point t -> Point t
translateT :: (Transform t) => Point t -> t
scaleT :: (Transform t) => Point t -> t
scaleT_ :: (Transform t) => Scalar -> t
-- | Class for performing rotationes. (The rotations that exist vary with
-- the number of spatial dimensions available.)
class (Transform t) => Rotate t axis1 axis2
rotateT :: (Rotate t axis1 axis2, Angle a) => axis1 -> axis2 -> a Scalar -> t
-- | Class for things that can be transformed (by a specific type of
-- transform).
class (Transform t) => Transformable t x
transform :: (Transformable t x) => t -> x -> x
instance Rotate Transform4 AxisZ AxisW
instance Rotate Transform4 AxisY AxisW
instance Rotate Transform4 AxisY AxisZ
instance Rotate Transform4 AxisX AxisW
instance Rotate Transform4 AxisX AxisZ
instance Rotate Transform4 AxisX AxisY
instance Rotate Transform3 AxisY AxisZ
instance Rotate Transform3 AxisX AxisZ
instance Rotate Transform3 AxisX AxisY
instance Rotate Transform2 AxisX AxisY
instance Transformable Transform4 Vector4
instance Transformable Transform3 Vector3
instance Transformable Transform2 Vector2
instance Transformable Transform1 Vector1
instance Transform Transform4
instance Transform Transform3
instance Transform Transform2
instance Transform Transform1