wumpus-basic-0.24.0: Basic objects and system code built on Wumpus-Core.

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com
Safe HaskellSafe-Infered

Wumpus.Basic.Kernel.Drawing.Chain

Description

Chaining LocGraphics.

Synopsis

Documentation

data GenChain st u a Source

Instances

type Chain u a = GenChain () u aSource

data ChainScheme u Source

scheme_start is a function from the origin to state.

For instance, we might want to cache the origin - this would not be possible if start was just a pure cst value.

Constructors

forall cst . ChainScheme 

Fields

chain_init :: Point2 u -> cst
 
chain_step :: Point2 u -> cst -> (Point2 u, cst)
 

runGenChain :: InterpretUnit u => ChainScheme u -> st -> GenChain st u a -> LocImage u (a, st)Source

evalGenChain :: InterpretUnit u => ChainScheme u -> st -> GenChain st u a -> LocImage u aSource

Forget the user state LocImage, just return the answer.

execGenChain :: InterpretUnit u => ChainScheme u -> st -> GenChain st u a -> LocImage u stSource

Forget the answer, just return the user state.

stripGenChain :: InterpretUnit u => ChainScheme u -> st -> GenChain st u a -> LocQuery u (a, st)Source

chain1 :: InterpretUnit u => LocImage u a -> GenChain st u aSource

Demand a point on the Chain and draw the LocImage at it.

chainSkip_ :: InterpretUnit u => GenChain st u ()Source

Demand the next position, but draw nothing.

chainMany :: InterpretUnit u => [LocImage u a] -> GenChain st u (UNil u)Source

Chain a list of images, each demanding a succesive start point.

chainReplicate :: InterpretUnit u => Int -> LocImage u a -> GenChain st u (UNil u)Source

Replicate a LocImage n times along a Chain.

chainCount :: GenChain st u IntSource

Return the count of chain steps.

iterationScheme :: (Point2 u -> Point2 u) -> ChainScheme uSource

General scheme - iterate the next point with the supplied function.

sequenceScheme :: Num u => [Vec2 u] -> ChainScheme uSource

General scheme - displace successively by the elements of the list of vectors.

Note - the list is cycled to make the chain infinite.

catTrailScheme :: Num u => CatTrail u -> ChainScheme uSource

Derive a ChainScheme from a CatTrail.

Note - this iterates the control points of curves, it does not iterate points on the curve.

countingScheme :: [(Int, ChainScheme u)] -> ChainScheme u -> ChainScheme uSource

Build an (infinite) ChainScheme for a prefix list of counted schemes and a final scheme that runs out to infinity.

rowwiseTableScheme :: Num u => Int -> (u, u) -> ChainScheme uSource

Generate a tabular scheme going rowwise (left-to-right) and downwards.

TODO - should probably account for the initial position...

columnwiseTableScheme :: Num u => Int -> (u, u) -> ChainScheme uSource

Generate a tabular scheme going columwise (top-to-bottom) and rightwards.

TODO - should probably account for the initial position...

distribRowwiseTable :: (Monoid a, InterpretUnit u) => Int -> (u, u) -> [LocImage u a] -> LocImage u aSource

duplicateRowwiseTable :: (Monoid a, InterpretUnit u) => Int -> Int -> (u, u) -> LocImage u a -> LocImage u aSource

distribColumnwiseTable :: (Monoid a, InterpretUnit u) => Int -> (u, u) -> [LocImage u a] -> LocImage u aSource

radialChainScheme :: Floating u => u -> Radian -> Radian -> ChainScheme uSource

TODO - account for CW CCW or just rely on +ve -ve angles?...