-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Painless 3D graphics, no affiliation with gloss -- -- This package began as a fork of Greg Horn's not-gloss package. The -- dependencies have been changed so that it builds with recent ghc -- versions. @package Vis @version 1.0.0 module Vis.Camera data Camera0 Camera0 :: GLdouble -> GLdouble -> GLdouble -> Camera0 [phi0] :: Camera0 -> GLdouble [theta0] :: Camera0 -> GLdouble [rho0] :: Camera0 -> GLdouble data Camera Camera :: GLdouble -> GLdouble -> GLdouble -> V3 GLdouble -> GLint -> GLint -> GLint -> GLint -> GLint -> Camera [phi] :: Camera -> GLdouble [theta] :: Camera -> GLdouble [rho] :: Camera -> GLdouble [pos] :: Camera -> V3 GLdouble [ballX] :: Camera -> GLint [ballY] :: Camera -> GLint [leftButton] :: Camera -> GLint [rightButton] :: Camera -> GLint [middleButton] :: Camera -> GLint makeCamera :: Camera0 -> Camera setCamera :: Camera -> IO () cameraMotion :: Camera -> Position -> Camera cameraKeyboardMouse :: Camera -> Key -> KeyState -> Camera instance GHC.Show.Show Vis.Camera.Camera0 -- | Predefined and custom colors. module Vis.GlossColor -- | An abstract color value. We keep the type abstract so we can be sure -- that the components are in the required range. To make a custom color -- use makeColor. data Color -- | Make a custom color. All components are clamped to the range [0..1]. makeColor :: Float -> Float -> Float -> Float -> Color -- | Make a custom color. You promise that all components are clamped to -- the range [0..1] makeColor' :: Float -> Float -> Float -> Float -> Color -- | Make a custom color. All components are clamped to the range [0..255]. makeColor8 :: Int -> Int -> Int -> Int -> Color -- | Make a custom color. Components should be in the range [0..1] but this -- is not checked. rawColor :: Float -> Float -> Float -> Float -> Color -- | Take the RGBA components of a color. rgbaOfColor :: Color -> (Float, Float, Float, Float) -- | Mix two colors with the given ratios. mixColors :: Float -> Float -> Color -> Color -> Color -- | Add RGB components of a color component-wise, then normalise them to -- the highest resulting one. The alpha components are averaged. addColors :: Color -> Color -> Color -- | Make a dimmer version of a color, scaling towards black. dim :: Color -> Color -- | Make a brighter version of a color, scaling towards white. bright :: Color -> Color -- | Lighten a color, adding white. light :: Color -> Color -- | Darken a color, adding black. dark :: Color -> Color -- | A greyness of a given magnitude. greyN :: Float -> Color black :: Color white :: Color red :: Color green :: Color blue :: Color yellow :: Color cyan :: Color magenta :: Color rose :: Color violet :: Color azure :: Color aquamarine :: Color chartreuse :: Color orange :: Color instance GHC.Classes.Eq Vis.GlossColor.Color instance GHC.Show.Show Vis.GlossColor.Color instance GHC.Num.Num Vis.GlossColor.Color module Vis.VisObject data VisObject a VisObjects :: [VisObject a] -> VisObject a Trans :: V3 a -> VisObject a -> VisObject a RotQuat :: Quaternion a -> VisObject a -> VisObject a RotDcm :: M33 a -> VisObject a -> VisObject a RotEulerRad :: Euler a -> VisObject a -> VisObject a RotEulerDeg :: Euler a -> VisObject a -> VisObject a Scale :: (a, a, a) -> VisObject a -> VisObject a Cylinder :: (a, a) -> Color -> VisObject a Box :: (a, a, a) -> Flavour -> Color -> VisObject a Cube :: a -> Flavour -> Color -> VisObject a Sphere :: a -> Flavour -> Color -> VisObject a Ellipsoid :: (a, a, a) -> Flavour -> Color -> VisObject a Line :: Maybe a -> [V3 a] -> Color -> VisObject a Line' :: Maybe a -> [(V3 a, Color)] -> VisObject a Arrow :: (a, a) -> V3 a -> Color -> VisObject a Axes :: (a, a) -> VisObject a Plane :: V3 a -> Color -> Color -> VisObject a Triangle :: V3 a -> V3 a -> V3 a -> Color -> VisObject a Quad :: V3 a -> V3 a -> V3 a -> V3 a -> Color -> VisObject a Text3d :: String -> V3 a -> BitmapFont -> Color -> VisObject a Text2d :: String -> (a, a) -> BitmapFont -> Color -> VisObject a Points :: [V3 a] -> Maybe GLfloat -> Color -> VisObject a ObjModel :: LoadedObjModel -> Color -> VisObject a drawObjects :: VisObject GLdouble -> IO () data LoadedObjModel LoadedObjModel :: Vector Double -> Vector Double -> Int -> LoadedObjModel -- | turn a list of vertexnormal tuples into vertexnormal arrays loadObjModel :: Foldable f => f (V3 Double, V3 Double) -> LoadedObjModel setPerspectiveMode :: IO () -- | 3-2-1 Euler angle rotation sequence data Euler a Euler :: a -> a -> a -> Euler a [eYaw] :: Euler a -> a [ePitch] :: Euler a -> a [eRoll] :: Euler a -> a instance GHC.Generics.Generic (Vis.VisObject.Euler a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Vis.VisObject.Euler a) instance GHC.Base.Functor Vis.VisObject.Euler instance GHC.Show.Show a => GHC.Show.Show (Vis.VisObject.Euler a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Vis.VisObject.Euler a) instance GHC.Generics.Generic Vis.VisObject.LoadedObjModel instance GHC.Base.Functor Vis.VisObject.VisObject instance GHC.Generics.Generic (Vis.VisObject.VisObject a) instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Vis.VisObject.VisObject a) instance Data.Binary.Class.Binary Vis.VisObject.LoadedObjModel instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (Vis.VisObject.Euler a) instance Data.Binary.Class.Binary Graphics.UI.GLUT.Objects.Flavour instance Data.Binary.Class.Binary Graphics.UI.GLUT.Raw.Fonts.BitmapFont instance Data.Binary.Class.Binary Vis.GlossColor.Color module Vis.Vis data Options Options :: Maybe Color -> Maybe (Int, Int) -> Maybe (Int, Int) -> String -> Maybe Camera0 -> Antialiasing -> Options -- | optional background color [optBackgroundColor] :: Options -> Maybe Color -- | optional (x,y) window size in pixels [optWindowSize] :: Options -> Maybe (Int, Int) -- | optional (x,y) window origin in pixels [optWindowPosition] :: Options -> Maybe (Int, Int) -- | window name [optWindowName] :: Options -> String -- | initial camera position [optInitialCamera] :: Options -> Maybe Camera0 -- | which antialiasing strategy to use [optAntialiasing] :: Options -> Antialiasing data Antialiasing Aliased :: Antialiasing Smoothed :: Antialiasing Multisampled :: Int -> Antialiasing vis :: Real b => Options -> Double -> a -> (FullState a -> IO a) -> (FullState a -> IO (VisObject b, Maybe Cursor)) -> (a -> IO ()) -> Maybe (a -> Key -> KeyState -> Modifiers -> Position -> a) -> Maybe (a -> Position -> a) -> Maybe (a -> Position -> a) -> IO () -- | Make a series of images, one from each VisObject. When -- visMovie is executed a window pops up and loops the animation -- until you are happy with the camera angle. Hit spacebar and the images -- will be created and saved to disk. visMovie :: forall b. Real b => Options -> (Int -> FilePath) -> Double -> [VisObject b] -> Maybe Cursor -> IO () -- | Make a series of images, one from each VisObject. When -- visMovieImmediately is executed a window is opened and without -- waiting the images are created and saved to disk. visMovieImmediately :: forall b. Real b => Options -> (Int -> FilePath) -> Double -> [VisObject b] -> Maybe Cursor -> IO () -- | user state and internal states type FullState a = (a, Float) instance GHC.Classes.Ord Vis.Vis.Antialiasing instance GHC.Show.Show Vis.Vis.Antialiasing instance GHC.Classes.Eq Vis.Vis.Antialiasing instance GHC.Show.Show Vis.Vis.Options module Vis.Interface -- | draw a static image display :: Real b => Options -> VisObject b -> IO () animate :: Real b => Options -> (Float -> VisObject b) -> IO () -- | display an animation impurely animateIO :: Real b => Options -> (Float -> IO (VisObject b)) -> IO () -- | run a simulation simulate :: Real b => Options -> Double -> world -> (world -> VisObject b) -> (Float -> world -> world) -> IO () -- | run a simulation impurely simulateIO :: Real b => Options -> Double -> world -> (world -> IO (VisObject b)) -> (Float -> world -> IO world) -> IO () play :: Real b => Options -> Double -> world -> (world -> (VisObject b, Maybe Cursor)) -> (Float -> world -> world) -> (world -> IO ()) -> Maybe (world -> Key -> KeyState -> Modifiers -> Position -> world) -> Maybe (world -> Position -> world) -> Maybe (world -> Position -> world) -> IO () playIO :: Real b => Options -> Double -> world -> (world -> IO (VisObject b, Maybe Cursor)) -> (Float -> world -> IO world) -> (world -> IO ()) -> Maybe (world -> Key -> KeyState -> Modifiers -> Position -> world) -> Maybe (world -> Position -> world) -> Maybe (world -> Position -> world) -> IO () module Vis data Options Options :: Maybe Color -> Maybe (Int, Int) -> Maybe (Int, Int) -> String -> Maybe Camera0 -> Antialiasing -> Options -- | optional background color [optBackgroundColor] :: Options -> Maybe Color -- | optional (x,y) window size in pixels [optWindowSize] :: Options -> Maybe (Int, Int) -- | optional (x,y) window origin in pixels [optWindowPosition] :: Options -> Maybe (Int, Int) -- | window name [optWindowName] :: Options -> String -- | initial camera position [optInitialCamera] :: Options -> Maybe Camera0 -- | which antialiasing strategy to use [optAntialiasing] :: Options -> Antialiasing data Antialiasing Aliased :: Antialiasing Smoothed :: Antialiasing Multisampled :: Int -> Antialiasing data Camera0 Camera0 :: GLdouble -> GLdouble -> GLdouble -> Camera0 [phi0] :: Camera0 -> GLdouble [theta0] :: Camera0 -> GLdouble [rho0] :: Camera0 -> GLdouble -- | Some reasonable default options. Consider changing the window name -- with something like: -- --
-- myOptions = defaultOpts {optWindowName = "my rad program"}
--
defaultOpts :: Options
-- | draw a static image
display :: Real b => Options -> VisObject b -> IO ()
animate :: Real b => Options -> (Float -> VisObject b) -> IO ()
-- | run a simulation
simulate :: Real b => Options -> Double -> world -> (world -> VisObject b) -> (Float -> world -> world) -> IO ()
play :: Real b => Options -> Double -> world -> (world -> (VisObject b, Maybe Cursor)) -> (Float -> world -> world) -> (world -> IO ()) -> Maybe (world -> Key -> KeyState -> Modifiers -> Position -> world) -> Maybe (world -> Position -> world) -> Maybe (world -> Position -> world) -> IO ()
-- | display an animation impurely
animateIO :: Real b => Options -> (Float -> IO (VisObject b)) -> IO ()
-- | run a simulation impurely
simulateIO :: Real b => Options -> Double -> world -> (world -> IO (VisObject b)) -> (Float -> world -> IO world) -> IO ()
playIO :: Real b => Options -> Double -> world -> (world -> IO (VisObject b, Maybe Cursor)) -> (Float -> world -> IO world) -> (world -> IO ()) -> Maybe (world -> Key -> KeyState -> Modifiers -> Position -> world) -> Maybe (world -> Position -> world) -> Maybe (world -> Position -> world) -> IO ()
-- | Make a series of images, one from each VisObject. When
-- visMovie is executed a window pops up and loops the animation
-- until you are happy with the camera angle. Hit spacebar and the images
-- will be created and saved to disk.
visMovie :: forall b. Real b => Options -> (Int -> FilePath) -> Double -> [VisObject b] -> Maybe Cursor -> IO ()
data VisObject a
VisObjects :: [VisObject a] -> VisObject a
Trans :: V3 a -> VisObject a -> VisObject a
RotQuat :: Quaternion a -> VisObject a -> VisObject a
RotDcm :: M33 a -> VisObject a -> VisObject a
RotEulerRad :: Euler a -> VisObject a -> VisObject a
RotEulerDeg :: Euler a -> VisObject a -> VisObject a
Scale :: (a, a, a) -> VisObject a -> VisObject a
Cylinder :: (a, a) -> Color -> VisObject a
Box :: (a, a, a) -> Flavour -> Color -> VisObject a
Cube :: a -> Flavour -> Color -> VisObject a
Sphere :: a -> Flavour -> Color -> VisObject a
Ellipsoid :: (a, a, a) -> Flavour -> Color -> VisObject a
Line :: Maybe a -> [V3 a] -> Color -> VisObject a
Line' :: Maybe a -> [(V3 a, Color)] -> VisObject a
Arrow :: (a, a) -> V3 a -> Color -> VisObject a
Axes :: (a, a) -> VisObject a
Plane :: V3 a -> Color -> Color -> VisObject a
Triangle :: V3 a -> V3 a -> V3 a -> Color -> VisObject a
Quad :: V3 a -> V3 a -> V3 a -> V3 a -> Color -> VisObject a
Text3d :: String -> V3 a -> BitmapFont -> Color -> VisObject a
Text2d :: String -> (a, a) -> BitmapFont -> Color -> VisObject a
Points :: [V3 a] -> Maybe GLfloat -> Color -> VisObject a
ObjModel :: LoadedObjModel -> Color -> VisObject a
-- | Special keys
data () => SpecialKey
KeyF1 :: SpecialKey
KeyF2 :: SpecialKey
KeyF3 :: SpecialKey
KeyF4 :: SpecialKey
KeyF5 :: SpecialKey
KeyF6 :: SpecialKey
KeyF7 :: SpecialKey
KeyF8 :: SpecialKey
KeyF9 :: SpecialKey
KeyF10 :: SpecialKey
KeyF11 :: SpecialKey
KeyF12 :: SpecialKey
KeyLeft :: SpecialKey
KeyUp :: SpecialKey
KeyRight :: SpecialKey
KeyDown :: SpecialKey
KeyPageUp :: SpecialKey
KeyPageDown :: SpecialKey
KeyHome :: SpecialKey
KeyEnd :: SpecialKey
KeyInsert :: SpecialKey
KeyNumLock :: SpecialKey
KeyBegin :: SpecialKey
KeyDelete :: SpecialKey
KeyShiftL :: SpecialKey
KeyShiftR :: SpecialKey
KeyCtrlL :: SpecialKey
KeyCtrlR :: SpecialKey
KeyAltL :: SpecialKey
KeyAltR :: SpecialKey
-- | You should actually never encounter this value, it is just here as a
-- safeguard against future changes in the native GLUT library.
KeyUnknown :: Int -> SpecialKey
-- | The bitmap fonts available in GLUT. The exact bitmap to be used is
-- defined by the standard X glyph bitmaps for the X font with the given
-- name.
data () => BitmapFont
-- | A fixed width font with every character fitting in an 8 by 13 pixel
-- rectangle.
-- (-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1)
Fixed8By13 :: BitmapFont
-- | A fixed width font with every character fitting in an 9 by 15 pixel
-- rectangle.
-- (-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1)
Fixed9By15 :: BitmapFont
-- | A 10-point proportional spaced Times Roman font.
-- (-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1)
TimesRoman10 :: BitmapFont
-- | A 24-point proportional spaced Times Roman font.
-- (-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1)
TimesRoman24 :: BitmapFont
-- | A 10-point proportional spaced Helvetica font.
-- (-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1)
Helvetica10 :: BitmapFont
-- | A 12-point proportional spaced Helvetica font.
-- (-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1)
Helvetica12 :: BitmapFont
-- | A 18-point proportional spaced Helvetica font.
-- (-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1)
Helvetica18 :: BitmapFont
-- | Flavour of object rendering
data () => Flavour
-- | Object is rendered as a solid with shading and surface normals.
Solid :: Flavour
-- | Object is rendered as a wireframe without surface normals.
Wireframe :: Flavour
-- | 3-2-1 Euler angle rotation sequence
data Euler a
Euler :: a -> a -> a -> Euler a
[eYaw] :: Euler a -> a
[ePitch] :: Euler a -> a
[eRoll] :: Euler a -> a
data LoadedObjModel
-- | turn a list of vertexnormal tuples into vertexnormal arrays
loadObjModel :: Foldable f => f (V3 Double, V3 Double) -> LoadedObjModel