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

module Codec.Wavefront.Line where

-- |A line index is a pair of indices. @'LineIndex' vi vti@. @vi@ references the locations and @vti@
-- indexes the texture coordinates. If @vti == 'Nothing'@, then that 'LineIndex' doesn’t have
-- texture coordinates associated with.
data LineIndex = LineIndex {
    LineIndex -> Int
lineLocIndex :: {-# UNPACK #-} !Int
  , LineIndex -> Maybe Int
lineTexCoordIndex :: !(Maybe Int)
  } deriving (LineIndex -> LineIndex -> Bool
(LineIndex -> LineIndex -> Bool)
-> (LineIndex -> LineIndex -> Bool) -> Eq LineIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LineIndex -> LineIndex -> Bool
$c/= :: LineIndex -> LineIndex -> Bool
== :: LineIndex -> LineIndex -> Bool
$c== :: LineIndex -> LineIndex -> Bool
Eq,Int -> LineIndex -> ShowS
[LineIndex] -> ShowS
LineIndex -> String
(Int -> LineIndex -> ShowS)
-> (LineIndex -> String)
-> ([LineIndex] -> ShowS)
-> Show LineIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LineIndex] -> ShowS
$cshowList :: [LineIndex] -> ShowS
show :: LineIndex -> String
$cshow :: LineIndex -> String
showsPrec :: Int -> LineIndex -> ShowS
$cshowsPrec :: Int -> LineIndex -> ShowS
Show)

-- A line gathers two line indices accessible by pattern matching or 'lineIndexA' and 'lineIndexB'.
data Line = Line {
    Line -> LineIndex
lineIndexA :: LineIndex
  , Line -> LineIndex
lineIndexB :: LineIndex
  } deriving (Line -> Line -> Bool
(Line -> Line -> Bool) -> (Line -> Line -> Bool) -> Eq Line
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Line -> Line -> Bool
$c/= :: Line -> Line -> Bool
== :: Line -> Line -> Bool
$c== :: Line -> Line -> Bool
Eq,Int -> Line -> ShowS
[Line] -> ShowS
Line -> String
(Int -> Line -> ShowS)
-> (Line -> String) -> ([Line] -> ShowS) -> Show Line
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Line] -> ShowS
$cshowList :: [Line] -> ShowS
show :: Line -> String
$cshow :: Line -> String
showsPrec :: Int -> Line -> ShowS
$cshowsPrec :: Int -> Line -> ShowS
Show)