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

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

Wumpus.Basic.Paths.Base

Description

Extended path type - more amenable for complex drawings than the type in Wumpus-Core.

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

Synopsis

Documentation

data Path u Source

Instances

Eq u => Eq (Path u) 
Ord u => Ord (Path u) 
Show u => Show (Path u) 
Floating u => Monoid (Path u) 

length :: Num u => Path u -> uSource

line :: Floating u => Point2 u -> Point2 u -> Path uSource

curve :: (Floating u, Ord u) => Point2 u -> Point2 u -> Point2 u -> Point2 u -> Path uSource

toPrimPath :: Path u -> Maybe (PrimPath u)Source

Turn a Path into an ordinary PrimPath.

An empty path returns Nothing - the path representation in Wumpus-Core does not allow empty paths - a path must always have at least start point.

Assumes path is properly formed - i.e. end point of one segment is the same point as the start point of the next segment.

shortenBoth :: (Real u, Floating u) => u -> Path u -> Path uSource

Shorten both ends...

shortenL :: (Real u, Floating u) => u -> Path u -> Path uSource

shortenR :: (Real u, Floating u) => u -> Path u -> Path uSource

directionL :: (Real u, Floating u) => Path u -> RadianSource

Direction of empty path is considered to be 0.

directionR :: (Real u, Floating u) => Path u -> RadianSource

Direction of empty path is considered to be 0.

data PathViewL u Source

Constructors

EmptyPathL 
(PathSegment u) :<< (Path u) 

Instances

Eq u => Eq (PathViewL u) 
Ord u => Ord (PathViewL u) 
Show u => Show (PathViewL u) 

data PathViewR u Source

Constructors

EmptyPathR 
(Path u) :>> (PathSegment u) 

Instances

Eq u => Eq (PathViewR u) 
Ord u => Ord (PathViewR u) 
Show u => Show (PathViewR u) 

data PathSegment u Source

Constructors

Line1 (Point2 u) (Point2 u) 
Curve1 (Point2 u) (Point2 u) (Point2 u) (Point2 u) 

Instances

Eq u => Eq (PathSegment u) 
Ord u => Ord (PathSegment u) 
Show u => Show (PathSegment u)