PrintAs.hs revision fcd50ed0f526645ca50bad2170e3b98b911b7678
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder{- |
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von SchroederModule : $Header$
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerDescription : print the abstract syntax of FreeCAD terms
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von SchroederCopyright : (c) Robert Savu and Uni Bremen 2011
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von SchroederLicense : GPLv2 or higher, see LICENSE.txt
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von SchroederMaintainer : Robert.Savu@dfki.de
c56a356d3fcc5e123efa790aab320781d94df3c7Jonathan von SchroederStability : experimental
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von SchroederPortability : portable
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von SchroederPrinting of the abstract syntax of FreeCAD terms
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder-}
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroedermodule FreeCAD.PrintAs where
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroederimport FreeCAD.As
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroederimport Common.DocUtils
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroederimport Common.Doc
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroederimport Common.Id
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder-- | Pretty printing 'Double'
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroederinstance Pretty Double where
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder pretty = sidDoc . mkSimpleId . show
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroeder
ece3b1a5353a9af3c966a1d5453594ed35334f7bJonathan von Schroederinstance Pretty Vector3 where
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder pretty v = pretty (x v, y v, z v)
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroederinstance Pretty Matrix33 where
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder pretty m = vcat [lparen <> rows, rparen] where
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder rows = vcat [row1, row2, row3]
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder row a b c = sepByCommas $ map pretty [a m, b m, c m]
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder row1 = row a11 a12 a13
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder row2 = row a21 a22 a23
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder row3 = row a31 a32 a33
b35e053c2c5a5ea0f13decfd0303894861d82b4dJonathan von Schroeder