-----------------------------------------------------------------------------
-- |
-- Copyright   : (C) 2015 Dimitri Sabadie
-- License     : BSD3
--
-- Maintainer  : Dimitri Sabadie <dimitri.sabadie@gmail.com>
-- Stability   : experimental
-- Portability : portable
--
-----------------------------------------------------------------------------

module Codec.Wavefront.Element (
    -- * Element
    Element(..)
  ) where

import Data.Text ( Text )
import Numeric.Natural ( Natural )

-- |An element holds a value along with the user-defined object’s name (if any), the associated
-- groups, the used material and the smoothing group the element belongs to (if any). Those values
-- can be used to sort the data per object or per group and to lookup materials.
data Element a = Element {
    Element a -> Maybe Text
elObject :: Maybe Text
  , Element a -> [Text]
elGroups :: [Text]
  , Element a -> Maybe Text
elMtl :: Maybe Text
  , Element a -> Natural
elSmoothingGroup :: Natural
  , Element a -> a
elValue :: a
  } deriving (Element a -> Element a -> Bool
(Element a -> Element a -> Bool)
-> (Element a -> Element a -> Bool) -> Eq (Element a)
forall a. Eq a => Element a -> Element a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Element a -> Element a -> Bool
$c/= :: forall a. Eq a => Element a -> Element a -> Bool
== :: Element a -> Element a -> Bool
$c== :: forall a. Eq a => Element a -> Element a -> Bool
Eq,Int -> Element a -> ShowS
[Element a] -> ShowS
Element a -> String
(Int -> Element a -> ShowS)
-> (Element a -> String)
-> ([Element a] -> ShowS)
-> Show (Element a)
forall a. Show a => Int -> Element a -> ShowS
forall a. Show a => [Element a] -> ShowS
forall a. Show a => Element a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Element a] -> ShowS
$cshowList :: forall a. Show a => [Element a] -> ShowS
show :: Element a -> String
$cshow :: forall a. Show a => Element a -> String
showsPrec :: Int -> Element a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Element a -> ShowS
Show)