Remove generic and flat instances
This commit is contained in:
+8
-21
@@ -10,7 +10,7 @@ module Shape.Data where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Flat
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import LinearHelp ()
|
||||
import Streaming
|
||||
@@ -23,38 +23,22 @@ shVfromList = id
|
||||
shEfromList = id
|
||||
newtype ShapeType = TopPrism Int
|
||||
deriving newtype (Eq, Ord, Show, Read)
|
||||
deriving stock Generic
|
||||
deriving anyclass Flat
|
||||
--deriving stock Generic
|
||||
--deriving anyclass Flat
|
||||
|
||||
|
||||
data ShapeObj = ShapeObj
|
||||
{ _shType :: ShapeType
|
||||
, _shVs :: [ShapeV]
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
|
||||
instance ToJSON ShapeObj where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON ShapeObj
|
||||
|
||||
|
||||
instance ToJSON ShapeType where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON ShapeType
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
-- edges are given by four consecutive points
|
||||
data ShapeV = ShapeV
|
||||
{ _svPos :: Point3
|
||||
, _svCol :: Point4
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
|
||||
instance ToJSON ShapeV where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON ShapeV
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
pairToSV :: (Point3, Point4) -> ShapeV
|
||||
{-# INLINE pairToSV #-}
|
||||
@@ -66,3 +50,6 @@ type Shape' = Stream (Of ShapeObj) IO ()
|
||||
|
||||
type Shape = [ShapeObj]
|
||||
|
||||
deriveJSON defaultOptions ''ShapeObj
|
||||
deriveJSON defaultOptions ''ShapeType
|
||||
deriveJSON defaultOptions ''ShapeV
|
||||
|
||||
Reference in New Issue
Block a user