hgeometry-0.6.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Ipe.Writer

Synopsis

Documentation

writeIpeFile :: IpeWriteText r => FilePath -> IpeFile r -> IO () Source #

Given a prism to convert something of type g into an ipe file, a file path, and a g. Convert the geometry and write it to file.

Write an IpeFiele to file.

writeIpePage :: IpeWriteText r => FilePath -> IpePage r -> IO () Source #

Creates a single page ipe file with the given page

printAsIpeSelection :: IpeWrite t => t -> IO () Source #

Convert the input to ipeXml, and prints it to standard out in such a way that the copied text can be pasted into ipe as a geometry object.

toIpeSelectionXML :: IpeWrite t => t -> Maybe ByteString Source #

Convert input into an ipe selection.

toIpeXML :: IpeWrite t => t -> Maybe ByteString Source #

Convert to Ipe xml

writeIpeFile' :: IpeWrite t => t -> FilePath -> IO () Source #

Convert to ipe XML and write the output to a file.

class IpeWriteText t where Source #

For types that can produce a text value

Minimal complete definition

ipeWriteText

Methods

ipeWriteText :: t -> Maybe Text Source #

Instances

IpeWriteText Double Source # 
IpeWriteText Int Source # 
IpeWriteText Integer Source # 
IpeWriteText () Source # 

Methods

ipeWriteText :: () -> Maybe Text Source #

IpeWriteText Text Source # 
IpeWriteText FillType Source # 
IpeWriteText IpeColor Source # 
IpeWriteText TransformationTypes Source # 
IpeWriteText PinType Source # 
IpeWriteText LayerName Source # 
Integral a => IpeWriteText (Ratio a) Source #

This instance converts the ratio to a Pico, and then displays that.

HasResolution p => IpeWriteText (Fixed p) Source # 
IpeWriteText r => IpeWriteText (IpeArrow r) Source # 
IpeWriteText r => IpeWriteText (IpeDash r) Source # 
IpeWriteText r => IpeWriteText (IpePen r) Source # 
IpeWriteText r => IpeWriteText (IpeSize r) Source # 
IpeWriteText v => IpeWriteText (IpeValue v) Source # 
IpeWriteText r => IpeWriteText (PathSegment r) Source # 
IpeWriteText r => IpeWriteText (Path r) Source # 
IpeWriteText r => IpeWriteText (Operation r) Source # 
IpeWriteText r => IpeWriteText (Point 2 r) Source # 

Methods

ipeWriteText :: Point 2 r -> Maybe Text Source #

IpeWriteText r => IpeWriteText (SimplePolygon () r) Source # 
IpeWriteText (Apply u * f at) => IpeWriteText (Attr u f at) Source # 

Methods

ipeWriteText :: Attr u f at -> Maybe Text Source #

IpeWriteText r => IpeWriteText (Matrix 3 3 r) Source # 

Methods

ipeWriteText :: Matrix 3 3 r -> Maybe Text Source #

IpeWriteText r => IpeWriteText (PolyLine 2 () r) Source # 

Methods

ipeWriteText :: PolyLine 2 () r -> Maybe Text Source #

class IpeWrite t where Source #

Types that correspond to an XML Element. All instances should produce an Element. If the type should produce a Node with the Text constructor, use the IpeWriteText typeclass instead.

Minimal complete definition

ipeWrite

Methods

ipeWrite :: t -> Maybe (Node Text Text) Source #

Instances

IpeWrite () Source # 

Methods

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

IpeWrite LayerName Source # 
IpeWrite View Source # 
IpeWrite IpeStyle Source # 
IpeWrite IpePreamble Source # 
IpeWriteText r => IpeWrite (Image r) Source # 
IpeWriteText r => IpeWrite (IpeSymbol r) Source # 
IpeWriteText r => IpeWrite (MiniPage r) Source # 
IpeWriteText r => IpeWrite (TextLabel r) Source # 
IpeWriteText r => IpeWrite (Path r) Source # 

Methods

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

IpeWriteText r => IpeWrite (IpeObject r) Source # 
IpeWriteText r => IpeWrite (Group r) Source # 
IpeWriteText r => IpeWrite (IpePage r) Source # 
IpeWriteText r => IpeWrite (IpeFile r) Source # 
(AllSatisfy AttributeUniverse IpeAttrName rs, RecAll AttributeUniverse (Attr AttributeUniverse f) rs IpeWriteText, IpeWrite g) => IpeWrite ((:+) g (Attributes AttributeUniverse f rs)) Source # 
IpeWriteText r => IpeWrite (LineSegment 2 p r) Source # 
(IpeWriteText r, IpeWrite p) => IpeWrite (PolyLine 2 p r) Source # 

Methods

ipeWrite :: PolyLine 2 p r -> Maybe (Node Text Text) Source #

ipeWriteAttrs :: (AllSatisfy IpeAttrName rs, RecAll (Attr f) rs IpeWriteText) => Attributes f rs -> [(Text, Text)] Source #

Functon to write all attributes in a Rec

writeAttrValues :: RecAll f rs IpeWriteText => Rec f rs -> Rec (Const (Maybe Text)) rs Source #

Writing the attribute values

addAtts :: Node Text Text -> [(Text, Text)] -> Node Text Text Source #

Add attributes to a node

mAddAtts :: Maybe (Node Text Text) -> [(Text, Text)] -> Maybe (Node Text Text) Source #

Same as addAtts but then for a Maybe node