hgeometry-ipe
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

Ipe.Path

Description

Defines an Ipe Path.

Synopsis

Documentation

newtype Path r Source #

A path is a non-empty sequence of PathSegments.

Constructors

Path (Seq (PathSegment r)) 

Instances

Instances details
Functor Path Source # 
Instance details

Defined in Ipe.Path

Methods

fmap :: (a -> b) -> Path a -> Path b Source #

(<$) :: a -> Path b -> Path a Source #

Foldable Path Source # 
Instance details

Defined in Ipe.Path

Methods

fold :: Monoid m => Path m -> m Source #

foldMap :: Monoid m => (a -> m) -> Path a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Path a -> m Source #

foldr :: (a -> b -> b) -> b -> Path a -> b Source #

foldr' :: (a -> b -> b) -> b -> Path a -> b Source #

foldl :: (b -> a -> b) -> b -> Path a -> b Source #

foldl' :: (b -> a -> b) -> b -> Path a -> b Source #

foldr1 :: (a -> a -> a) -> Path a -> a Source #

foldl1 :: (a -> a -> a) -> Path a -> a Source #

toList :: Path a -> [a] Source #

null :: Path a -> Bool Source #

length :: Path a -> Int Source #

elem :: Eq a => a -> Path a -> Bool Source #

maximum :: Ord a => Path a -> a Source #

minimum :: Ord a => Path a -> a Source #

sum :: Num a => Path a -> a Source #

product :: Num a => Path a -> a Source #

Traversable Path Source # 
Instance details

Defined in Ipe.Path

Methods

traverse :: Applicative f => (a -> f b) -> Path a -> f (Path b) Source #

sequenceA :: Applicative f => Path (f a) -> f (Path a) Source #

mapM :: Monad m => (a -> m b) -> Path a -> m (Path b) Source #

sequence :: Monad m => Path (m a) -> m (Path a) Source #

ToObject Path Source # 
Instance details

Defined in Ipe.Content

Semigroup (Path r) Source # 
Instance details

Defined in Ipe.Path

Methods

(<>) :: Path r -> Path r -> Path r Source #

sconcat :: NonEmpty (Path r) -> Path r Source #

stimes :: Integral b => b -> Path r -> Path r Source #

Generic (Path r) Source # 
Instance details

Defined in Ipe.Path

Associated Types

type Rep (Path r) 
Instance details

Defined in Ipe.Path

type Rep (Path r) = D1 ('MetaData "Path" "Ipe.Path" "hgeometry-ipe-1.0.0.0-inplace" 'True) (C1 ('MetaCons "Path" 'PrefixI 'True) (S1 ('MetaSel ('Just "_pathSegments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq (PathSegment r)))))

Methods

from :: Path r -> Rep (Path r) x Source #

to :: Rep (Path r) x -> Path r Source #

Show r => Show (Path r) Source # 
Instance details

Defined in Ipe.Path

Methods

showsPrec :: Int -> Path r -> ShowS Source #

show :: Path r -> String Source #

showList :: [Path r] -> ShowS Source #

Eq r => Eq (Path r) Source # 
Instance details

Defined in Ipe.Path

Methods

(==) :: Path r -> Path r -> Bool Source #

(/=) :: Path r -> Path r -> Bool Source #

(Coordinate r, Fractional r, Eq r) => IpeRead (Path r) Source # 
Instance details

Defined in Ipe.Reader

(Coordinate r, Fractional r, Eq r) => IpeReadText (Path r) Source # 
Instance details

Defined in Ipe.Reader

IpeWriteText r => IpeWrite (Path r) Source # 
Instance details

Defined in Ipe.Writer

Methods

ipeWrite :: Path r -> Maybe (Node Text Text) Source #

IpeWriteText r => IpeWriteText (Path r) Source # 
Instance details

Defined in Ipe.Writer

(Fractional r, Eq r) => IsTransformable (Path r) Source # 
Instance details

Defined in Ipe.Path

type Rep (Path r) Source # 
Instance details

Defined in Ipe.Path

type Rep (Path r) = D1 ('MetaData "Path" "Ipe.Path" "hgeometry-ipe-1.0.0.0-inplace" 'True) (C1 ('MetaCons "Path" 'PrefixI 'True) (S1 ('MetaSel ('Just "_pathSegments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq (PathSegment r)))))
type Dimension (Path r) Source # 
Instance details

Defined in Ipe.Path

type Dimension (Path r) = 2
type NumType (Path r) Source # 
Instance details

Defined in Ipe.Path

type NumType (Path r) = 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')) 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:

Instances

Instances details
Functor PathSegment Source # 
Instance details

Defined in Ipe.Path

Methods

fmap :: (a -> b) -> PathSegment a -> PathSegment b Source #

(<$) :: a -> PathSegment b -> PathSegment a Source #

Foldable PathSegment Source # 
Instance details

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 # 
Instance details

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 # 
Instance details

Defined in Ipe.Path

Eq r => Eq (PathSegment r) Source # 
Instance details

Defined in Ipe.Path

(Coordinate r, Fractional r, Eq r) => IpeReadText (NonEmpty (PathSegment r)) Source # 
Instance details

Defined in Ipe.Reader

IpeWriteText r => IpeWriteText (PathSegment r) Source # 
Instance details

Defined in Ipe.Writer

(Fractional r, Eq r) => IsTransformable (PathSegment r) Source # 
Instance details

Defined in Ipe.Path

type Dimension (PathSegment r) Source # 
Instance details

Defined in Ipe.Path

type Dimension (PathSegment r) = 2
type NumType (PathSegment r) Source # 
Instance details

Defined in Ipe.Path

type NumType (PathSegment r) = r

_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.

Constructors

AsIs 
Reversed 

data Operation r 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

Instances details
Functor Operation Source # 
Instance details

Defined in Ipe.Path

Methods

fmap :: (a -> b) -> Operation a -> Operation b Source #

(<$) :: a -> Operation b -> Operation a Source #

Foldable Operation Source # 
Instance details

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 #

sum :: Num a => Operation a -> a Source #

product :: Num a => Operation a -> a Source #

Traversable Operation Source # 
Instance details

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 # 
Instance details

Defined in Ipe.Path

Eq r => Eq (Operation r) Source # 
Instance details

Defined in Ipe.Path

Coordinate r => IpeReadText [Operation r] Source # 
Instance details

Defined in Ipe.Reader

IpeWriteText r => IpeWriteText (Operation r) Source # 
Instance details

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 #