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

PortabilityGHC
Stabilityunstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.CtxPicture

Contents

Description

A Picture-with-implicit-context object.

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

CtxPicture 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 CtxPicture u Source

Instances

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

Composition

over :: (Num u, Ord u) => CtxPicture u -> CtxPicture u -> CtxPicture 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) => CtxPicture u -> CtxPicture u -> CtxPicture uSource

 a `under` b

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

centric :: (Fractional u, Ord u) => CtxPicture u -> CtxPicture u -> CtxPicture 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) => CtxPicture u -> CtxPicture u -> CtxPicture uSource

 a `nextToH` b

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

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

 a `nextToV` b

Vertical composition - move b, placing it below a.

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

Place the picture at the supplied point.

atPoint was previous the at operator.

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

Center the picture at the supplied point.

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

Concatenate the list of drawings.

No pictures are moved.

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

Concatenate the list pictures xs horizontally.

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

Concatenate the list of pictures xs vertically.

hspace :: (Num u, Ord u) => u -> CtxPicture u -> CtxPicture u -> CtxPicture 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 -> CtxPicture u -> CtxPicture u -> CtxPicture 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 -> [CtxPicture u] -> CtxPicture 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 -> [CtxPicture u] -> CtxPicture 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 -> CtxPicture u -> CtxPicture u -> CtxPicture 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 -> CtxPicture u -> CtxPicture u -> CtxPicture 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 -> CtxPicture u -> CtxPicture u -> CtxPicture 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 -> CtxPicture u -> CtxPicture u -> CtxPicture 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 -> [CtxPicture u] -> CtxPicture uSource

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

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

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

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

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

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

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