Clear all warnings
This commit is contained in:
+13
-10
@@ -4,14 +4,14 @@ module Picture.Data
|
||||
where
|
||||
import Geometry.Data
|
||||
|
||||
import Data.Monoid
|
||||
import Data.Traversable
|
||||
import qualified Data.Foldable as F
|
||||
import qualified Data.Sequence as Se
|
||||
import qualified Data.DList as DL
|
||||
import qualified Data.Vector as V
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
--import Data.Monoid
|
||||
--import Data.Traversable
|
||||
--import qualified Data.Foldable as F
|
||||
--import qualified Data.Sequence as Se
|
||||
--import qualified Data.DList as DL
|
||||
--import qualified Data.Vector as V
|
||||
--import Control.Lens
|
||||
--import Control.Monad
|
||||
|
||||
data RenderType
|
||||
= RenderPoly [(Point3,Point4)]
|
||||
@@ -58,8 +58,11 @@ instance Functor (RTree a) where
|
||||
fmap f (RBranches i ts) = RBranches i $ fmap (fmap f) ts
|
||||
fmap f (RLeaf x) = RLeaf (f x)
|
||||
|
||||
flat2 (x,y) = [x,y]
|
||||
flat3 (x,y,z) = [x,y,z]
|
||||
flat2 :: (a,a) -> [a]
|
||||
flat2 (x,y) = [x,y]
|
||||
flat3 :: (a,a,a) -> [a]
|
||||
flat3 (x,y,z) = [x,y,z]
|
||||
flat4 :: (a,a,a,a) -> [a]
|
||||
flat4 (x,y,z,w) = [x,y,z,w]
|
||||
{-# INLINE flat2 #-}
|
||||
{-# INLINE flat3 #-}
|
||||
|
||||
+11
-11
@@ -42,7 +42,7 @@ picToLTree mx (LineCol i vs)
|
||||
where (ps,cs) = unzip vs
|
||||
picToLTree mx (Text i s)
|
||||
= filtB mx i $ LLeaf $ RenderText $ stringToList s
|
||||
picToLTree j Blank = LBranches []
|
||||
picToLTree _ Blank = LBranches []
|
||||
picToLTree j (Pictures pics) = LBranches $ map (picToLTree j) pics
|
||||
picToLTree j (OverPic f f' r f'' (OverPic g g' s g'' pic))
|
||||
= picToLTree j $ OverPic (f . g) (f' . g') (r + s) (f'' . g'') pic
|
||||
@@ -64,6 +64,7 @@ doubleLine :: [a] -> [a]
|
||||
doubleLine (x:y:xs) = concat $ zipWith (:) (init (x:y:xs)) $ map (: []) (y:xs)
|
||||
doubleLine _ = []
|
||||
|
||||
white, black :: Color
|
||||
white = (1,1,1,1)
|
||||
black = (0,0,0,1)
|
||||
|
||||
@@ -102,7 +103,7 @@ overCol f (RenderArc (a,b,c)) = RenderArc (a,f b,c)
|
||||
overSca :: (Point2 -> Point2) -> RenderType -> RenderType
|
||||
{-# INLINE overSca #-}
|
||||
overSca f (RenderText vs) = RenderText $ map (scaleT (f (1,1))) vs
|
||||
overSca f p = p
|
||||
overSca _ p = p
|
||||
|
||||
stringToList :: String -> [(Point3,Point4,Point3)]
|
||||
{-# INLINE stringToList #-}
|
||||
@@ -123,12 +124,11 @@ translate3 :: Float -> Float -> Point3 -> Point3
|
||||
{-# INLINE translate3 #-}
|
||||
translate3 a b (x,y,z) = (x+a,y+b,z)
|
||||
{- Scale a 3D vector in the x and y directions. -}
|
||||
scale3 :: Float -> Float -> Point3 -> Point3
|
||||
{-# INLINE scale3 #-}
|
||||
scale3 a b (x,y,z) = (x*a,y*b,z)
|
||||
{- Rotate a 3D vector in the x-y plane. -}
|
||||
rotate3 :: Float -> Point3 -> Point3
|
||||
{-# INLINE rotate3 #-}
|
||||
rotate3 a (x,y,z) = (x',y',z)
|
||||
where (x',y') = rotateV a (x,y)
|
||||
|
||||
--scale3 :: Float -> Float -> Point3 -> Point3
|
||||
--{-# INLINE scale3 #-}
|
||||
--scale3 a b (x,y,z) = (x*a,y*b,z)
|
||||
--{- Rotate a 3D vector in the x-y plane. -}
|
||||
--rotate3 :: Float -> Point3 -> Point3
|
||||
--{-# INLINE rotate3 #-}
|
||||
--rotate3 a (x,y,z) = (x',y',z)
|
||||
-- where (x',y') = rotateV a (x,y)
|
||||
|
||||
Reference in New Issue
Block a user