| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
Ipe.Path
Description
Defines an Ipe Path.
Synopsis
- newtype Path r = Path (Seq (PathSegment r))
- pathSegments :: forall r r' p f. (Profunctor p, Functor f) => p (Seq (PathSegment r)) (f (Seq (PathSegment r'))) -> p (Path r) (f (Path r'))
- data PathSegment r
- = PolyLineSegment (PolyLine (Point 2 r))
- | PolygonPath !Orientation (SimplePolygon (Point 2 r))
- | CubicBezierSegment (CubicBezier (Point 2 r))
- | QuadraticBezierSegment (QuadraticBezier (Point 2 r))
- | EllipseSegment (Ellipse r)
- | ArcSegment
- | SplineSegment
- | ClosedSplineSegment
- _PolyLineSegment :: forall r p f. (Choice p, Applicative f) => p (PolyLine (Point 2 r)) (f (PolyLine (Point 2 r))) -> p (PathSegment r) (f (PathSegment r))
- _PolygonPath :: forall r p f. (Choice p, Applicative f) => p (Orientation, SimplePolygon (Point 2 r)) (f (Orientation, SimplePolygon (Point 2 r))) -> p (PathSegment r) (f (PathSegment r))
- _CubicBezierSegment :: forall r p f. (Choice p, Applicative f) => p (CubicBezier (Point 2 r)) (f (CubicBezier (Point 2 r))) -> p (PathSegment r) (f (PathSegment r))
- _QuadraticBezierSegment :: forall r p f. (Choice p, Applicative f) => p (QuadraticBezier (Point 2 r)) (f (QuadraticBezier (Point 2 r))) -> p (PathSegment r) (f (PathSegment r))
- _EllipseSegment :: forall r p f. (Choice p, Applicative f) => p (Ellipse r) (f (Ellipse r)) -> p (PathSegment r) (f (PathSegment r))
- _ArcSegment :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (PathSegment r) (f (PathSegment r))
- _SplineSegment :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (PathSegment r) (f (PathSegment r))
- _ClosedSplineSegment :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (PathSegment r) (f (PathSegment r))
- data Orientation
- data Operation r
- _MoveTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r) (f (Point 2 r)) -> p (Operation r) (f (Operation r))
- _LineTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r) (f (Point 2 r)) -> p (Operation r) (f (Operation r))
- _CurveTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r, Point 2 r, Point 2 r) (f (Point 2 r, Point 2 r, Point 2 r)) -> p (Operation r) (f (Operation r))
- _QCurveTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r, Point 2 r) (f (Point 2 r, Point 2 r)) -> p (Operation r) (f (Operation r))
- _Ellipse :: forall r p f. (Choice p, Applicative f) => p (Matrix 3 3 r) (f (Matrix 3 3 r)) -> p (Operation r) (f (Operation r))
- _ArcTo :: forall r p f. (Choice p, Applicative f) => p (Matrix 3 3 r, Point 2 r) (f (Matrix 3 3 r, Point 2 r)) -> p (Operation r) (f (Operation r))
- _Spline :: forall r p f. (Choice p, Applicative f) => p [Point 2 r] (f [Point 2 r]) -> p (Operation r) (f (Operation r))
- _ClosedSpline :: forall r p f. (Choice p, Applicative f) => p [Point 2 r] (f [Point 2 r]) -> p (Operation r) (f (Operation r))
- _ClosePath :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (Operation r) (f (Operation r))
Documentation
A path is a non-empty sequence of PathSegments.
Constructors
| Path (Seq (PathSegment r)) |
Instances
pathSegments :: forall r r' p f. (Profunctor p, Functor f) => p (Seq (PathSegment r)) (f (Seq (PathSegment r'))) -> p (Path r) (f (Path r')) Source #
Lens/Iso to access the sequcne of segments of the path
data PathSegment r Source #
Paths consist of Path Segments. PathSegments come in the following forms:
Constructors
| PolyLineSegment (PolyLine (Point 2 r)) | |
| PolygonPath !Orientation (SimplePolygon (Point 2 r)) | |
| CubicBezierSegment (CubicBezier (Point 2 r)) | |
| QuadraticBezierSegment (QuadraticBezier (Point 2 r)) | |
| EllipseSegment (Ellipse r) | |
| ArcSegment | |
| SplineSegment | |
| ClosedSplineSegment |
Instances
| Functor PathSegment Source # | |
Defined in Ipe.Path Methods fmap :: (a -> b) -> PathSegment a -> PathSegment b Source # (<$) :: a -> PathSegment b -> PathSegment a Source # | |
| Foldable PathSegment Source # | |
Defined in Ipe.Path Methods fold :: Monoid m => PathSegment m -> m Source # foldMap :: Monoid m => (a -> m) -> PathSegment a -> m Source # foldMap' :: Monoid m => (a -> m) -> PathSegment a -> m Source # foldr :: (a -> b -> b) -> b -> PathSegment a -> b Source # foldr' :: (a -> b -> b) -> b -> PathSegment a -> b Source # foldl :: (b -> a -> b) -> b -> PathSegment a -> b Source # foldl' :: (b -> a -> b) -> b -> PathSegment a -> b Source # foldr1 :: (a -> a -> a) -> PathSegment a -> a Source # foldl1 :: (a -> a -> a) -> PathSegment a -> a Source # toList :: PathSegment a -> [a] Source # null :: PathSegment a -> Bool Source # length :: PathSegment a -> Int Source # elem :: Eq a => a -> PathSegment a -> Bool Source # maximum :: Ord a => PathSegment a -> a Source # minimum :: Ord a => PathSegment a -> a Source # sum :: Num a => PathSegment a -> a Source # product :: Num a => PathSegment a -> a Source # | |
| Traversable PathSegment Source # | |
Defined in Ipe.Path Methods traverse :: Applicative f => (a -> f b) -> PathSegment a -> f (PathSegment b) Source # sequenceA :: Applicative f => PathSegment (f a) -> f (PathSegment a) Source # mapM :: Monad m => (a -> m b) -> PathSegment a -> m (PathSegment b) Source # sequence :: Monad m => PathSegment (m a) -> m (PathSegment a) Source # | |
| Show r => Show (PathSegment r) Source # | |
| Eq r => Eq (PathSegment r) Source # | |
Defined in Ipe.Path Methods (==) :: PathSegment r -> PathSegment r -> Bool Source # (/=) :: PathSegment r -> PathSegment r -> Bool Source # | |
| (Coordinate r, Fractional r, Eq r) => IpeReadText (NonEmpty (PathSegment r)) Source # | |
Defined in Ipe.Reader Methods ipeReadText :: Text -> Either ConversionError (NonEmpty (PathSegment r)) Source # | |
| IpeWriteText r => IpeWriteText (PathSegment r) Source # | |
Defined in Ipe.Writer Methods ipeWriteText :: PathSegment r -> Maybe Text Source # | |
| (Fractional r, Eq r) => IsTransformable (PathSegment r) Source # | |
Defined in Ipe.Path Methods transformBy :: Transformation (Dimension (PathSegment r)) (NumType (PathSegment r)) -> PathSegment r -> PathSegment r Source # | |
| type Dimension (PathSegment r) Source # | |
Defined in Ipe.Path | |
| type NumType (PathSegment r) Source # | |
Defined in Ipe.Path | |
_PolyLineSegment :: forall r p f. (Choice p, Applicative f) => p (PolyLine (Point 2 r)) (f (PolyLine (Point 2 r))) -> p (PathSegment r) (f (PathSegment r)) Source #
_PolygonPath :: forall r p f. (Choice p, Applicative f) => p (Orientation, SimplePolygon (Point 2 r)) (f (Orientation, SimplePolygon (Point 2 r))) -> p (PathSegment r) (f (PathSegment r)) Source #
_CubicBezierSegment :: forall r p f. (Choice p, Applicative f) => p (CubicBezier (Point 2 r)) (f (CubicBezier (Point 2 r))) -> p (PathSegment r) (f (PathSegment r)) Source #
_QuadraticBezierSegment :: forall r p f. (Choice p, Applicative f) => p (QuadraticBezier (Point 2 r)) (f (QuadraticBezier (Point 2 r))) -> p (PathSegment r) (f (PathSegment r)) Source #
_EllipseSegment :: forall r p f. (Choice p, Applicative f) => p (Ellipse r) (f (Ellipse r)) -> p (PathSegment r) (f (PathSegment r)) Source #
_ArcSegment :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (PathSegment r) (f (PathSegment r)) Source #
_SplineSegment :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (PathSegment r) (f (PathSegment r)) Source #
_ClosedSplineSegment :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (PathSegment r) (f (PathSegment r)) Source #
data Orientation Source #
Paths
Polygons in ipe may be given in CCW order, or in CW order. Since simple polygon normalizes the order, we actually store the original orientation.
Instances
| Show Orientation Source # | |
| Eq Orientation Source # | |
Defined in Ipe.Path Methods (==) :: Orientation -> Orientation -> Bool Source # (/=) :: Orientation -> Orientation -> Bool Source # | |
| Ord Orientation Source # | |
Defined in Ipe.Path Methods compare :: Orientation -> Orientation -> Ordering Source # (<) :: Orientation -> Orientation -> Bool Source # (<=) :: Orientation -> Orientation -> Bool Source # (>) :: Orientation -> Orientation -> Bool Source # (>=) :: Orientation -> Orientation -> Bool Source # max :: Orientation -> Orientation -> Orientation Source # min :: Orientation -> Orientation -> Orientation Source # | |
type that represents a path in ipe.
Constructors
| MoveTo (Point 2 r) | |
| LineTo (Point 2 r) | |
| Ellipse (Matrix 3 3 r) | |
| ArcTo (Matrix 3 3 r) (Point 2 r) | |
| Spline [Point 2 r] | |
| ClosedSpline [Point 2 r] | |
| ClosePath | |
| CurveTo (Point 2 r) (Point 2 r) (Point 2 r) | |
| QCurveTo (Point 2 r) (Point 2 r) |
Instances
| Functor Operation Source # | |
| Foldable Operation Source # | |
Defined in Ipe.Path Methods fold :: Monoid m => Operation m -> m Source # foldMap :: Monoid m => (a -> m) -> Operation a -> m Source # foldMap' :: Monoid m => (a -> m) -> Operation a -> m Source # foldr :: (a -> b -> b) -> b -> Operation a -> b Source # foldr' :: (a -> b -> b) -> b -> Operation a -> b Source # foldl :: (b -> a -> b) -> b -> Operation a -> b Source # foldl' :: (b -> a -> b) -> b -> Operation a -> b Source # foldr1 :: (a -> a -> a) -> Operation a -> a Source # foldl1 :: (a -> a -> a) -> Operation a -> a Source # toList :: Operation a -> [a] Source # null :: Operation a -> Bool Source # length :: Operation a -> Int Source # elem :: Eq a => a -> Operation a -> Bool Source # maximum :: Ord a => Operation a -> a Source # minimum :: Ord a => Operation a -> a Source # | |
| Traversable Operation Source # | |
Defined in Ipe.Path Methods traverse :: Applicative f => (a -> f b) -> Operation a -> f (Operation b) Source # sequenceA :: Applicative f => Operation (f a) -> f (Operation a) Source # mapM :: Monad m => (a -> m b) -> Operation a -> m (Operation b) Source # sequence :: Monad m => Operation (m a) -> m (Operation a) Source # | |
| Show r => Show (Operation r) Source # | |
| Eq r => Eq (Operation r) Source # | |
| Coordinate r => IpeReadText [Operation r] Source # | |
Defined in Ipe.Reader Methods ipeReadText :: Text -> Either ConversionError [Operation r] Source # | |
| IpeWriteText r => IpeWriteText (Operation r) Source # | |
Defined in Ipe.Writer | |
_MoveTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r) (f (Point 2 r)) -> p (Operation r) (f (Operation r)) Source #
_LineTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r) (f (Point 2 r)) -> p (Operation r) (f (Operation r)) Source #
_CurveTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r, Point 2 r, Point 2 r) (f (Point 2 r, Point 2 r, Point 2 r)) -> p (Operation r) (f (Operation r)) Source #
_QCurveTo :: forall r p f. (Choice p, Applicative f) => p (Point 2 r, Point 2 r) (f (Point 2 r, Point 2 r)) -> p (Operation r) (f (Operation r)) Source #
_Ellipse :: forall r p f. (Choice p, Applicative f) => p (Matrix 3 3 r) (f (Matrix 3 3 r)) -> p (Operation r) (f (Operation r)) Source #
_ArcTo :: forall r p f. (Choice p, Applicative f) => p (Matrix 3 3 r, Point 2 r) (f (Matrix 3 3 r, Point 2 r)) -> p (Operation r) (f (Operation r)) Source #
_Spline :: forall r p f. (Choice p, Applicative f) => p [Point 2 r] (f [Point 2 r]) -> p (Operation r) (f (Operation r)) Source #
_ClosedSpline :: forall r p f. (Choice p, Applicative f) => p [Point 2 r] (f [Point 2 r]) -> p (Operation r) (f (Operation r)) Source #
_ClosePath :: forall r p f. (Choice p, Applicative f) => p () (f ()) -> p (Operation r) (f (Operation r)) Source #