Portability | GHC |
---|---|
Stability | highly unstable |
Maintainer | stephen.tetley@gmail.com |
Graphic objects RectAddress and Orientation to model rectangular positioning.
- data RectAddress
- data Orientation u = Orientation {
- or_x_minor :: !u
- or_x_major :: !u
- or_y_minor :: !u
- or_y_major :: !u
- vtoRectAddress :: (Fractional u, Ord u) => Orientation u -> RectAddress -> Vec2 u
- vtoOrigin :: (Fractional u, Ord u) => RectAddress -> Orientation u -> Vec2 u
- orientationBounds :: Num u => Orientation u -> Point2 u -> BoundingBox u
- orientationWidth :: Num u => Orientation u -> u
- orientationHeight :: Num u => Orientation u -> u
- rotateOrientation :: (Real u, Floating u, Ord u) => Radian -> Orientation u -> Orientation u
- extendOrientation :: Num u => u -> u -> u -> u -> Orientation u -> Orientation u
- extendOLeft :: Num u => u -> Orientation u -> Orientation u
- extendORight :: Num u => u -> Orientation u -> Orientation u
- extendODown :: Num u => u -> Orientation u -> Orientation u
- extendOUp :: Num u => u -> Orientation u -> Orientation u
- fillHEven :: (Fractional u, Ord u) => u -> Orientation u -> Orientation u
- fillXMinor :: (Num u, Ord u) => u -> Orientation u -> Orientation u
- fillXMajor :: (Num u, Ord u) => u -> Orientation u -> Orientation u
- fillVEven :: (Fractional u, Ord u) => u -> Orientation u -> Orientation u
- fillYMajor :: (Num u, Ord u) => u -> Orientation u -> Orientation u
- fillYMinor :: (Num u, Ord u) => u -> Orientation u -> Orientation u
- spineRight :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation u
- spineBelow :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation u
- halignBottomO :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation u
- halignCenterO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation u
- halignTopO :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation u
- valignLeftO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation u
- valignCenterO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation u
- valignRightO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation u
- spinemoveH :: Num u => Orientation u -> Orientation u -> Vec2 u
- spinemoveV :: Num u => Orientation u -> Orientation u -> Vec2 u
- binmoveHBottom :: Num u => Orientation u -> Orientation u -> Vec2 u
- binmoveHCenter :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Vec2 u
- binmoveHTop :: Num u => Orientation u -> Orientation u -> Vec2 u
- binmoveVLeft :: Num u => Orientation u -> Orientation u -> Vec2 u
- binmoveVCenter :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Vec2 u
- binmoveVRight :: Num u => Orientation u -> Orientation u -> Vec2 u
Components
data RectAddress Source
Datatype enumerating the addressable positions of a rectangle
that can be derived for a PosObject
.
The positions are the compass points, plus the geometric center, origin and the baseline positions:
BLL - baseline-left
BLC - baseline-center
BLR - baseline-right
data Orientation u Source
Utility datatype representing orientation within a rectangular frame. RectPos is useful for graphics such as text where the start point is not necessarily at the center (or bottom left).
x_minor is the horizontal distance from the left to the start point x_major is the horizontal distance from the start point to the right y_minor is the vertical distance from the bottom to the start point y_major is the vertical distance from the start point to the top
Values should be not be negative!
Orientation | |
|
Functor Orientation | |
Eq u => Eq (Orientation u) | |
Ord u => Ord (Orientation u) | |
Show u => Show (Orientation u) | |
(Fractional u, Ord u) => Monoid (Orientation u) | Concatenation coalesces the origins. |
vtoRectAddress :: (Fractional u, Ord u) => Orientation u -> RectAddress -> Vec2 uSource
The vector from a origin ro a RectAddress
.
vtoOrigin :: (Fractional u, Ord u) => RectAddress -> Orientation u -> Vec2 uSource
orientationBounds :: Num u => Orientation u -> Point2 u -> BoundingBox uSource
Calculate the bounding box formed by locating the Orientation
at the supplied point.
orientationWidth :: Num u => Orientation u -> uSource
Height of the orientation.
orientationHeight :: Num u => Orientation u -> uSource
Height of the orientation.
rotateOrientation :: (Real u, Floating u, Ord u) => Radian -> Orientation u -> Orientation uSource
Rotate an Orientation about its origin (locus).
extendOrientation :: Num u => u -> u -> u -> u -> Orientation u -> Orientation uSource
extendOLeft :: Num u => u -> Orientation u -> Orientation uSource
extendORight :: Num u => u -> Orientation u -> Orientation uSource
extendODown :: Num u => u -> Orientation u -> Orientation uSource
extendOUp :: Num u => u -> Orientation u -> Orientation uSource
fillHEven :: (Fractional u, Ord u) => u -> Orientation u -> Orientation uSource
fillXMinor :: (Num u, Ord u) => u -> Orientation u -> Orientation uSource
fillXMajor :: (Num u, Ord u) => u -> Orientation u -> Orientation uSource
fillVEven :: (Fractional u, Ord u) => u -> Orientation u -> Orientation uSource
fillYMajor :: (Num u, Ord u) => u -> Orientation u -> Orientation uSource
fillYMinor :: (Num u, Ord u) => u -> Orientation u -> Orientation uSource
spineRight :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
Second Orientation is moved to the right of the first along the spine i.e the baseline.
spineBelow :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
Second Orientation is moved below the first along the spine i.e. the vertical point between the left minor and right major (not the same as the horizontal center).
halignBottomO :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
xmin and xmaj same as left.
halignCenterO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
xmin same as left.
halignTopO :: (Num u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
xmin and ymaj same as left.
valignLeftO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
Align second below - xmin and ymaj are same as left.
valignCenterO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
Align second below - ymaj same as left.
valignRightO :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Orientation uSource
Align second below - xmaj and ymaj are same as left.
spinemoveH :: Num u => Orientation u -> Orientation u -> Vec2 uSource
Move second right.
spinemoveV :: Num u => Orientation u -> Orientation u -> Vec2 uSource
Move second below.
binmoveHBottom :: Num u => Orientation u -> Orientation u -> Vec2 uSource
binmoveHCenter :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Vec2 uSource
binmoveHTop :: Num u => Orientation u -> Orientation u -> Vec2 uSource
binmoveVLeft :: Num u => Orientation u -> Orientation u -> Vec2 uSource
binmoveVCenter :: (Fractional u, Ord u) => Orientation u -> Orientation u -> Vec2 uSource
binmoveVRight :: Num u => Orientation u -> Orientation u -> Vec2 uSource