wumpus-drawing-0.4.0: High-level drawing objects built on Wumpus-Basic.

PortabilityGHC
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>

Wumpus.Drawing.Paths.Base.PathBuilder

Contents

Description

Build relative paths monadically.

** WARNING ** this module is an experiment, and may change significantly or even be dropped from future revisions.

Synopsis

Documentation

class Monad m => LocTraceM m whereSource

insertl analogue to Writer monad tell.

Methods

insertl :: MonUnit (m ()) ~ u => LocGraphic u -> m ()Source

insertl_ :: MonUnit (m ()) ~ u => LocImage u a -> m ()Source

moveBy :: MonUnit (m ()) ~ u => Vec2 u -> m ()Source

location :: MonUnit (m ()) ~ u => m (Vec2 u)Source

Instances

Num u => LocTraceM (LocTrace u) 
(Floating u, InterpretUnit u) => LocTraceM (PathSpec u) 
(Monad m, Num u) => LocTraceM (LocTraceT u m) 
Num u => LocTraceM (RefTrace u z) 
(Monad m, Floating u, InterpretUnit u) => LocTraceM (PathSpecT u m) 
(Monad m, Num u) => LocTraceM (RefTraceT u z m) 

data PathSpecT u m a Source

Instances

data Vamp u Source

Vamps...

runPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> (a, RelPath u, Vec2 u, LocGraphic u, LocGraphic u)Source

Run a PathSpec - return a five-tuple.

 (ans, path, end_vector, pen_trace, insert_trace) 
 ans - is the monadic answer, usually ().
 path - is the relative path formed by all movements during 
 the build. This includes movement where the pen is _up_.
 end_vector - is the cumulative displacement from the start 
 point.
 pen_trace - is ...
 insert_trace - 

execPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> LocGraphic uSource

Run an PathSpec - return the LocGraphic formed by the pen trace and the insert trace, forget the outline of the path.

Note - the insert trace is printed above the pen trace in the z-order.

evalPathSpec :: (Floating u, InterpretUnit u) => PathSpec u a -> RelPath uSource

Run an PathSpec - return the outline of the path, forget the the pen trace and the insert trace.

runPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (a, RelPath u, Vec2 u, LocGraphic u, LocGraphic u)Source

Transformer version of runPathSpec

execPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (LocGraphic u)Source

Transformer version of execPathSpec

evalPathSpecT :: (Monad m, Floating u, InterpretUnit u) => PathSpecT u m a -> m (RelPath u)Source

Transformer version of evalPathSpec.

execPivot :: (Floating u, InterpretUnit u) => PathSpec u a -> PathSpec u a -> LocGraphic uSource

Form a "pivot path" drawing from two path specifications. The start point of the drawing is the pivot formed by joining the paths.

execPivotT :: (Floating u, InterpretUnit u, Monad m) => PathSpecT u m a -> PathSpecT u m a -> m (LocGraphic u)Source

Transformer version of execPivot.

class Monad m => PathOpM m whereSource

updatePen will draw any in-progress path as an open-stroked line before changing the pen properties.

Methods

line :: u ~ MonUnit (m ()) => Vec2 u -> m ()Source

curve :: u ~ MonUnit (m ()) => Vec2 u -> Vec2 u -> Vec2 u -> m ()Source

updatePen :: DrawingContextF -> m ()Source

cycleSubPath :: DrawStyle -> m ()Source

vamp :: u ~ MonUnit (m ()) => Vamp u -> m ()Source

Instances

Derived operators

lines :: (PathOpM m, u ~ MonUnit (m ())) => [Vec2 u] -> m ()Source

hline :: (PathOpM m, Num u, u ~ MonUnit (m ())) => u -> m ()Source

vline :: (PathOpM m, Num u, u ~ MonUnit (m ())) => u -> m ()Source

aline :: (PathOpM m, Floating u, u ~ MonUnit (m ())) => Radian -> u -> m ()Source