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

PortabilityGHC
Stabilityhighly unstable
Maintainerstephen.tetley@gmail.com
Safe HaskellSafe-Infered

Wumpus.Basic.Kernel.Objects.Orientation

Contents

Description

Graphic objects RectAddress and Orientation to model rectangular positioning.

Synopsis

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

Constructors

CENTER 
ORIGIN 
NN 
SS 
EE 
WW 
NE 
NW 
SE 
SW 
BLL 
BLC 
BLR 

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!

Constructors

Orientation 

Fields

or_x_minor :: !u
 
or_x_major :: !u
 
or_y_minor :: !u
 
or_y_major :: !u
 

Instances

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.

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

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.