Portability | GHC |
---|---|

Stability | highly unstable |

Maintainer | Stephen Tetley <stephen.tetley@gmail.com> |

Anchor points on shapes.

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

- class CenterAnchor t where
- class CardinalAnchor t where
- class CardinalAnchor2 t where
- class RadialAnchor t where
- radialAnchor :: DUnit t ~ u => Radian -> t -> Point2 u

- northwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 u
- southwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 u
- eastwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 u
- westwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 u
- northeastwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 u
- southeastwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 u
- southwestwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 u
- northwestwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 u
- radialConnectorPoints :: (Real u, Floating u, CenterAnchor t1, RadialAnchor t1, CenterAnchor t2, RadialAnchor t2, u ~ DUnit t1, DUnit t1 ~ DUnit t2) => t1 -> t2 -> (Point2 u, Point2 u)

# Anchors

class CenterAnchor t whereSource

CenterAnchor (DotAnchor u) | |

(Real u, Floating u) => CenterAnchor (CoordinateAnchor u) | |

(Real u, Floating u) => CenterAnchor (Ellipse u) | |

(Real u, Floating u) => CenterAnchor (Diamond u) | |

(Real u, Floating u) => CenterAnchor (Circle u) | |

(Real u, Floating u) => CenterAnchor (Rectangle u) | |

(Real u, Floating u) => CenterAnchor (PlaintextAnchor u) |

class CardinalAnchor t whereSource

north :: DUnit t ~ u => t -> Point2 uSource

south :: DUnit t ~ u => t -> Point2 uSource

CardinalAnchor (DotAnchor u) | |

(Real u, Floating u) => CardinalAnchor (Ellipse u) | |

(Real u, Floating u) => CardinalAnchor (Diamond u) | |

(Real u, Floating u) => CardinalAnchor (Circle u) | |

(Real u, Floating u) => CardinalAnchor (Rectangle u) | |

(Real u, Floating u) => CardinalAnchor (PlaintextAnchor u) |

class CardinalAnchor2 t whereSource

northeast :: DUnit t ~ u => t -> Point2 uSource

southeast :: DUnit t ~ u => t -> Point2 uSource

CardinalAnchor2 (DotAnchor u) | |

(Real u, Floating u) => CardinalAnchor2 (Ellipse u) | |

(Real u, Floating u, Fractional u) => CardinalAnchor2 (Diamond u) | |

(Real u, Floating u) => CardinalAnchor2 (Circle u) | |

(Real u, Floating u) => CardinalAnchor2 (Rectangle u) | |

(Real u, Floating u) => CardinalAnchor2 (PlaintextAnchor u) |

class RadialAnchor t whereSource

Anchor on a border that can be identified with and angle.

radialAnchor :: DUnit t ~ u => Radian -> t -> Point2 uSource

RadialAnchor (DotAnchor u) | |

(Real u, Floating u) => RadialAnchor (Ellipse u) | |

(Real u, Floating u) => RadialAnchor (Diamond u) | |

(Real u, Floating u) => RadialAnchor (Circle u) | |

(Real u, Floating u) => RadialAnchor (Rectangle u) | |

(Real u, Floating u) => RadialAnchor (PlaintextAnchor u) |

# extended anchor points

northwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 uSource

southwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 uSource

eastwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 uSource

westwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor t, u ~ DUnit t) => u -> t -> Point2 uSource

northeastwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 uSource

southeastwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 uSource

southwestwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 uSource

northwestwards :: (Real u, Floating u, CenterAnchor t, CardinalAnchor2 t, u ~ DUnit t) => u -> t -> Point2 uSource

radialConnectorPoints :: (Real u, Floating u, CenterAnchor t1, RadialAnchor t1, CenterAnchor t2, RadialAnchor t2, u ~ DUnit t1, DUnit t1 ~ DUnit t2) => t1 -> t2 -> (Point2 u, Point2 u)Source