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

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com

Wumpus.Basic.Kernel.Objects.DrawingPrimitives

Contents

Description

Graphic type - this is largely equivalent to Primitive in Wumpus-Core, but drawing attributes are implicitly supplied by the DrawingContext.

Synopsis

Prim Paths

locPP :: InterpretUnit u => [Vec2 u] -> LocQuery u PrimPathSource

locPP : [next_vector] -> LocQuery PrimPath

Create a path LocQuery - i.e. a functional type from Point to PrimPath.

This is the analogue to vectorPath in Wumpus-Core, but the result is produced within the DrawingContext.

emptyLocPP :: InterpretUnit u => LocQuery u PrimPathSource

emptyLocPP : (Point ~> PrimPath)

Create an empty path LocQuery - i.e. a functional type from Point to PrimPath.

This is the analogue to emptyPath in Wumpus-Core, but the result is produced within the DrawingContext.

vertexPP :: InterpretUnit u => [Point2 u] -> Query PrimPathSource

vertexPP : (Point ~> PrimPath)

Create a PrimPath made of straight line segments joining the supplied points.

This is the analogue to vertexPrimPath in Wumpus-Core, but it is polymorphic on unit.

curvePP :: InterpretUnit u => [Point2 u] -> Query PrimPathSource

curvePP : (Point ~> PrimPath)

Create a path made of curve segments joining the supplied points.

This is the analogue to curvedPrimPath in Wumpus-Core, but it is polymorphic on unit.

openStroke :: PrimPath -> Graphic uSource

openStroke : path -> Graphic

This is the analogue to ostroke in Wumpus-core, but the drawing properties (colour, line width, etc.) are taken from the implicit DrawingContext.

closedStroke :: PrimPath -> Graphic uSource

closedStroke : path -> Graphic

This is the analogue to cstroke in Wumpus-core, but the drawing properties (colour, line width, etc.) are taken from the implicit DrawingContext.

filledPath :: PrimPath -> Graphic uSource

filledPath : path -> Graphic

This is the analogue to fill in Wumpus-core, but the fill colour is taken from the implicit DrawingContext.

borderedPath :: PrimPath -> Graphic uSource

borderedPath : path -> Graphic

This is the analogue to fillStroke in Wumpus-core, but the drawing properties (fill colour, border colour, line width, etc.) are taken from the implicit DrawingContext.

Text

plainTextLine :: InterpretUnit u => String -> LocGraphic uSource

plainTextLine : string -> LocGraphic

Create a text LocGraphic - i.e. a functional type from Point to Graphic.

The implicit point of the LocGraphic is the baseline left.

This is the analogue to textlabel in Wumpus-core, but the text properties (font family, font size, colour) are taken from the implicit DrawingContext.

rplainTextLine :: InterpretUnit u => String -> LocThetaGraphic uSource

rplainTextLine : string -> LocThetaGraphic

Create a text LocThetaGraphic - i.e. a functional type from Point and Angle to Graphic.

The implicit point of the LocGraphic is the baseline left, the implicit angle is rotation factor of the text.

Note - rotated text often does not render well in PostScript or SVG. Rotated text should be used sparingly.

This is the analogue to rtextlabel in Wumpus-core.

escTextLine :: InterpretUnit u => EscapedText -> LocGraphic uSource

escTextline : escaped_text -> LocGraphic

Create a text LocGraphic - i.e. a functional type from Point to Graphic.

The implicit point of the LocGraphic is the baseline left.

This is the analogue to escapedlabel in Wumpus-core, but the text properties (font family, font size, colour) are taken from the implicit DrawingContext.

rescTextLine :: InterpretUnit u => EscapedText -> LocThetaGraphic uSource

rescTextLine : escaped_text -> LocThetaGraphic

Create a text LocThetaGraphic - i.e. a functional type from Point and Angle to Graphic.

The implicit point of the LocGraphic is the baseline left, the implicit angle is rotation factor of the text.

Note - rotated text often does not render well in PostScript or SVG. Rotated text should be used sparingly.

This is the analogue to rescapedlabel in Wumpus-core, but the text properties (font family, font size, colour) are taken from the implicit DrawingContext.

type KernChar u = (u, EscapedChar)Source

Unit parametric version of KerningChar from Wumpus-Core.

hkernLine :: InterpretUnit u => [KernChar u] -> LocGraphic uSource

hkernLine : [kern_char] -> LocGraphic

Create a horizontally kerned text LocGraphic - i.e. a functional type from Point to Graphic.

The implicit point of the LocGraphic is the baseline left.

This is the analogue to hkernlabel in Wumpus-core, but the text properties (font family, font size, colour) are taken from the implicit DrawingContext.

vkernLine :: InterpretUnit u => [KernChar u] -> LocGraphic uSource

vkernLine : [kern_char] -> LocGraphic

Create a vertically kerned text LocGraphic - i.e. a functional type from Point to Graphic.

The implicit point of the LocGraphic is the baseline left.

This is the analogue to vkernlabel in Wumpus-core, but the text properties (font family, font size, colour) are taken from the implicit DrawingContext.

Lines

straightLine :: InterpretUnit u => Point2 u -> Point2 u -> Graphic uSource

straightLine : start_point * end_point -> LocGraphic

Create a straight line Graphic, the start and end point are supplied explicitly.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

locStraightLine :: InterpretUnit u => Vec2 u -> LocGraphic uSource

locStraightLine : vec_to -> LocGraphic

Create a stright line LocGraphic - i.e. a functional type from Point to Graphic.

The implicit point of the LocGraphic is the start point, the end point is calculated by displacing the start point with the supplied vector.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

curvedLine :: InterpretUnit u => Point2 u -> Point2 u -> Point2 u -> Point2 u -> Graphic uSource

curveLine : start_point * control_point1 * control_point2 * end_point -> Graphic

Create a Bezier curve Graphic, all control points are supplied explicitly.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

straightConnector :: InterpretUnit u => ConnectorGraphic uSource

straightConnector : start_point * end_point -> Connector

Create a straight line Graphic, the start and end point are supplied implicitly.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

Circles

strokedCircle :: InterpretUnit u => u -> LocGraphic uSource

strokedCircle : radius -> LocGraphic

Create a stroked circle LocGraphic - the implicit point is center. The circle is drawn with four Bezier curves.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

filledCircle :: InterpretUnit u => u -> LocGraphic uSource

filledCircle : radius -> LocGraphic

Create a filled circle LocGraphic - the implicit point is center. The circle is drawn with four Bezier curves.

The fill colour is taken from the implicit DrawingContext.

borderedCircle :: InterpretUnit u => u -> LocGraphic uSource

borderedCircle : radius -> LocGraphic

Create a bordered circle LocGraphic - the implicit point is center. The circle is drawn with four Bezier curves.

The background fill colour and the outline stroke properties are taken from the implicit DrawingContext.

Ellipses

strokedEllipse :: InterpretUnit u => u -> u -> LocGraphic uSource

strokedEllipse : x_radius * y_radius -> LocGraphic

Create a stroked ellipse LocGraphic - the implicit point is center. The ellipse is drawn with four Bezier curves.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

rstrokedEllipse :: InterpretUnit u => u -> u -> LocThetaGraphic uSource

rstrokedEllipse : x_radius * y_radius -> LocThetaGraphic

Create a stroked ellipse LocThetaGraphic - the implicit point is center and the angle is rotation about the center. The ellipse is drawn with four Bezier curves.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

filledEllipse :: InterpretUnit u => u -> u -> LocGraphic uSource

filledEllipse : x_radius * y_radius -> LocGraphic

Create a filled ellipse LocGraphic - the implicit point is center. The ellipse is drawn with four Bezier curves.

The fill colour is taken from the implicit DrawingContext.

rfilledEllipse :: InterpretUnit u => u -> u -> LocThetaGraphic uSource

rfilledEllipse : x_radius * y_radius -> LocGraphic

Create a filled ellipse LocThetaGraphic - the implicit point is center and the angle is rotation about the center. The ellipse is drawn with four Bezier curves.

The fill colour is taken from the implicit DrawingContext.

borderedEllipse :: InterpretUnit u => u -> u -> LocGraphic uSource

borderedEllipse : x_radius * y_radius -> LocGraphic

Create a bordered ellipse LocGraphic - the implicit point is center. The ellipse is drawn with four Bezier curves.

The background fill colour and the outline stroke properties are taken from the implicit DrawingContext.

rborderedEllipse :: InterpretUnit u => u -> u -> LocThetaGraphic uSource

rborderedEllipse : x_radius * y_radius -> LocGraphic

Create a bordered ellipse LocThetaGraphic - the implicit point is center and the angle is rotation about the center. The ellipse is drawn with four Bezier curves.

The background fill colour and the outline stroke properties are taken from the implicit DrawingContext.

Rectangles

strokedRectangle :: InterpretUnit u => u -> u -> LocGraphic uSource

strokedRectangle : width * height -> LocGraphic

Create a stroked rectangle LocGraphic - the implicit point is bottom-left.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

filledRectangle :: InterpretUnit u => u -> u -> LocGraphic uSource

filledRectangle : width * height -> LocGraphic

Create a filled rectangle LocGraphic - the implicit point is the bottom-left.

The fill colour is taken from the implicit DrawingContext.

borderedRectangle :: InterpretUnit u => u -> u -> LocGraphic uSource

borderedRectangle : width * height -> LocGraphic

Create a bordered rectangle LocGraphic - the implicit point is bottom-left.

The background fill colour and the outline stroke properties are taken from the implicit DrawingContext.

Disks

strokedDisk :: InterpretUnit u => u -> LocGraphic uSource

strokedDisk : radius -> LocGraphic

Create a stroked circle LocGraphic - the implicit point is the center.

This is a efficient representation of circles using PostScript's arc or SVG's circle in the generated output. However, stroked-circles do not draw well after non-uniform scaling - the pen width is scaled as well as the shape.

For stroked circles that can be adequately scaled, use strokedCircle instead.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

filledDisk :: InterpretUnit u => u -> LocGraphic uSource

filledDisk : radius -> LocGraphic

Create a filled circle LocGraphic - the implicit point is the center.

This is a efficient representation of circles using PostScript's arc or SVG's circle in the generated output. As the circle is filled rather than drawn with a "pen" a filledDisk can be scaled.

The fill colour is taken from the implicit DrawingContext.

borderedDisk :: InterpretUnit u => u -> LocGraphic uSource

borderedDisk : radius -> LocGraphic

Create a bordered circle LocGraphic - the implicit point is the center.

This is a efficient representation of circles using PostScript's arc or SVG's circle in the generated output. However, bordereded circles do not draw well after non-uniform scaling - the pen width of the outline is scaled as well as the shape.

For bordered circles that can be adequately scaled, use borderedCircle instead.

The background fill colour and the outline stroke properties are taken from the implicit DrawingContext.

strokedEllipseDisk :: InterpretUnit u => u -> u -> LocGraphic uSource

strokedEllipseDisk : x_radius * y_radius -> LocGraphic

Create a stroked ellipse LocGraphic - the implicit point is the center.

This is a efficient representation of circles using PostScript's arc or SVG's ellipse in the generated output. However, stroked ellipses do not draw well after non-uniform scaling - the pen width is scaled as well as the shape.

For stroked ellipses that can be adequately scaled, use strokedEllipse instead.

The line properties (colour, pen thickness, etc.) are taken from the implicit DrawingContext.

filledEllipseDisk :: InterpretUnit u => u -> u -> LocGraphic uSource

filledEllipseDisk : x_radius * y_radius -> LocGraphic

Create a filled ellipse LocGraphic - the implicit point is the center.

This is a efficient representation of ellipses using PostScript's arc or SVG's ellipse in the generated output. As the ellipse is filled rather than drawn with a "pen" a filledEllipseDisk can be scaled.

The fill colour is taken from the implicit DrawingContext.

borderedEllipseDisk :: InterpretUnit u => u -> u -> LocGraphic uSource

borderedEllipseDisk : x_radius * y_radius -> LocGraphic

Create a bordered ellipse LocGraphic - the implicit point is the center.

This is a efficient representation of ellipses using PostScript's arc or SVG's ellipse in the generated output. However, bordereded ellipses do not draw well after non-uniform scaling - the pen width of the outline is scaled as well as the shape.

For bordered ellipses that can be adequately scaled, use borderedEllipse instead.

The background fill colour and the outline stroke properties are taken from the implicit DrawingContext.