wumpus-basic-0.14.0: Common drawing utilities built on wumpus-core.

PortabilityGHC
Stabilityunstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.Drawing

Contents

Description

A Drawing object.

This is the corresponding type to Picture in the Wumpus-Core.

Drawing is a function from the DrawingContext to a Picture. Internally the result is actually a (Maybe Picture) and not a Picture, this is a trick to promote the extraction from possibly empty drawings (created by TraceDrawing) to the top-level of the type hierarchy where client code can deal with empty drawings explicitly (empty Pictures cannot be rendered by Wumpus-Core).

Synopsis

Documentation

data Drawing u Source

Instances

(Real u, Floating u) => Rotate (Drawing u) 
(Real u, Floating u) => RotateAbout (Drawing u) 
(Num u, Ord u) => Scale (Drawing u) 
(Num u, Ord u) => Translate (Drawing u) 

clipDrawing :: (Num u, Ord u) => PrimPath u -> Drawing u -> Drawing uSource

Composition

over :: (Num u, Ord u) => Drawing u -> Drawing u -> Drawing uSource

 a `over` b

Place 'drawing' a over b. The idea of over here is in terms z-ordering, nither picture a or b are actually moved.

under :: (Num u, Ord u) => Drawing u -> Drawing u -> Drawing uSource

 a `under` b

Similarly under draws the first drawing behind the second but move neither.

centric :: (Fractional u, Ord u) => Drawing u -> Drawing u -> Drawing uSource

Draw a, move b so its center is at the same center as a, b is drawn over underneath in the zorder.

 a `centeric` b 

nextToH :: (Num u, Ord u) => Drawing u -> Drawing u -> Drawing uSource

 a `nextToH` b

Horizontal composition - move b, placing it to the right of a.

nextToV :: (Num u, Ord u) => Drawing u -> Drawing u -> Drawing uSource

 a `nextToV` b

Vertical composition - move b, placing it below a.

atPoint :: (Num u, Ord u) => Drawing u -> Point2 u -> Drawing uSource

Place the picture at the supplied point.

atPoint was previous the at operator.

centeredAt :: (Fractional u, Ord u) => Drawing u -> Point2 u -> Drawing uSource

Center the picture at the supplied point.

zconcat :: (Real u, Floating u, FromPtSize u) => [Drawing u] -> Drawing uSource

Concatenate the list of drawings.

No pictures are moved.

hcat :: (Real u, Floating u, FromPtSize u) => [Drawing u] -> Drawing uSource

Concatenate the list pictures xs horizontally.

vcat :: (Real u, Floating u, FromPtSize u) => [Drawing u] -> Drawing uSource

Concatenate the list of pictures xs vertically.

hspace :: (Num u, Ord u) => u -> Drawing u -> Drawing u -> Drawing uSource

 hspace n a b

Horizontal composition - move b, placing it to the right of a with a horizontal gap of n separating the pictures.

vspace :: (Num u, Ord u) => u -> Drawing u -> Drawing u -> Drawing uSource

 vspace n a b

Vertical composition - move b, placing it below a with a vertical gap of n separating the pictures.

hsep :: (Real u, Floating u, FromPtSize u) => u -> [Drawing u] -> Drawing uSource

 hsep n xs

Concatenate the list of pictures xs horizontally with hspace starting at x. The pictures are interspersed with spaces of n units.

vsep :: (Real u, Floating u, FromPtSize u) => u -> [Drawing u] -> Drawing uSource

 vsep n xs

Concatenate the list of pictures xs vertically with vspace starting at x. The pictures are interspersed with spaces of n units.

Compose with alignment

alignH :: (Fractional u, Ord u) => HAlign -> Drawing u -> Drawing u -> Drawing uSource

 alignH align a b

Horizontal composition - move b, placing it to the right of a and align it with the top, center or bottom of a.

alignV :: (Fractional u, Ord u) => VAlign -> Drawing u -> Drawing u -> Drawing uSource

 alignV align a b

Vertical composition - move b, placing it below a and align it with the left, center or right of a.

alignHSep :: (Fractional u, Ord u) => HAlign -> u -> Drawing u -> Drawing u -> Drawing uSource

 alignHSep align sep a b

Spacing version of alignH - move b to the right of a separated by sep units, align b according to align.

alignVSep :: (Fractional u, Ord u) => VAlign -> u -> Drawing u -> Drawing u -> Drawing uSource

 alignVSep align sep a b

Spacing version of alignV - move b below a separated by sep units, align b according to align.

hcatA :: (Real u, Floating u, FromPtSize u) => HAlign -> [Drawing u] -> Drawing uSource

Variant of hcat that aligns the pictures as well as concatenating them.

vcatA :: (Real u, Floating u, FromPtSize u) => VAlign -> [Drawing u] -> Drawing uSource

Variant of vcat that aligns the pictures as well as concatenating them.

hsepA :: (Real u, Floating u, FromPtSize u) => HAlign -> u -> [Drawing u] -> Drawing uSource

Variant of hsep that aligns the pictures as well as concatenating and spacing them.

vsepA :: (Real u, Floating u, FromPtSize u) => VAlign -> u -> [Drawing u] -> Drawing uSource

Variant of vsep that aligns the pictures as well as concatenating and spacing them.