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

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

Wumpus.Drawing.Shapes.Base

Description

Common core for shapes

Synopsis

Documentation

data Shape u a Source

Shape is a record of three LocTheta functions - functions from Point and Angle to answer.

The shape_path_fun returns a path. When the Shape is drawn, the rendering function (strokedShape, etc.) uses the path for drawing and returns the polymorphic answer a of the shape_ans_fun. Lastly the shape_decoration function can instantiated to add decoration (e.g. text) to the Shape as it is rendered.

The a of the shape_ans_fun represents some concrete shape object (e.g. a Rectangle, Triangle etc.). Crucial for shape objects is that they support Anchors - this allows connectors to address specific locations on the Shape border so "node and link" diagrams can be made easily.

Instances

makeShape :: Num u => LocThetaCF u a -> LocThetaCF u (Path u) -> Shape u aSource

filledShape :: Num u => Shape u a -> LocImage u aSource

roundCornerShapePath :: (Real u, Floating u, FromPtSize u) => [Point2 u] -> CF (Path u)Source

Draw the shape path with round corners.

updatePathAngle :: (Radian -> Radian) -> Shape u a -> Shape u aSource

The path angle can be modified. This allows inverse versions of shapes (e.g. InvTriangle) to be made by wrapping a base Shape but rotating the path prior to drawing it.

Only the Path needs rotating, the decoration takes the original angle. The anchors are typically implemented by rotating the correspoding anchor of the wrapped Shape about its center.

data ShapeCTM u Source

Instances

Eq u => Eq (ShapeCTM u) 
Ord u => Ord (ShapeCTM u) 
Show u => Show (ShapeCTM u) 
Rotate (ShapeCTM u) 
(Real u, Floating u) => RotateAbout (ShapeCTM u) 
Num u => Scale (ShapeCTM u) 
Num u => Translate (ShapeCTM u)