diff options
Diffstat (limited to 'src/Wavefront/Types.hs')
-rw-r--r-- | src/Wavefront/Types.hs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Wavefront/Types.hs b/src/Wavefront/Types.hs index 99bbb15..2ab48ba 100644 --- a/src/Wavefront/Types.hs +++ b/src/Wavefront/Types.hs | |||
@@ -18,9 +18,12 @@ data OBJ v = OBJ { | |||
18 | objLocations :: v Location | 18 | objLocations :: v Location |
19 | , objTexCoords :: v TexCoord | 19 | , objTexCoords :: v TexCoord |
20 | , objNormals :: v Normal | 20 | , objNormals :: v Normal |
21 | , objEmbeddedCurves :: v EmbeddedCurve | ||
21 | , objPoints :: v (Element Point) | 22 | , objPoints :: v (Element Point) |
22 | , objLines :: v (Element Line) | 23 | , objLines :: v (Element Line) |
23 | , objFaces :: v (Element Face) | 24 | , objFaces :: v (Element Face) |
25 | , objCurves :: v (Element Curve) | ||
26 | , objSurfaces :: v (Element Surface) | ||
24 | , objMtlLibs :: v Text | 27 | , objMtlLibs :: v Text |
25 | } | 28 | } |
26 | 29 | ||
@@ -28,18 +31,24 @@ type ForThisOBJ (c :: * -> Constraint) v = | |||
28 | ( c (v Location) | 31 | ( c (v Location) |
29 | , c (v TexCoord) | 32 | , c (v TexCoord) |
30 | , c (v Normal) | 33 | , c (v Normal) |
34 | , c (v EmbeddedCurve) | ||
31 | , c (v (Element Point)) | 35 | , c (v (Element Point)) |
32 | , c (v (Element Line)) | 36 | , c (v (Element Line)) |
33 | , c (v (Element Face)) | 37 | , c (v (Element Face)) |
38 | , c (v (Element Curve)) | ||
39 | , c (v (Element Surface)) | ||
34 | , c (v Text) ) | 40 | , c (v Text) ) |
35 | 41 | ||
36 | type ForAllOBJ (c :: * -> Constraint) = | 42 | type ForAllOBJ (c :: * -> Constraint) = |
37 | ( c Location | 43 | ( c Location |
38 | , c TexCoord | 44 | , c TexCoord |
39 | , c Normal | 45 | , c Normal |
46 | , c EmbeddedCurve | ||
40 | , c (Element Point) | 47 | , c (Element Point) |
41 | , c (Element Line) | 48 | , c (Element Line) |
42 | , c (Element Face) | 49 | , c (Element Face) |
50 | , c (Element Curve) | ||
51 | , c (Element Surface) | ||
43 | , c Text | 52 | , c Text |
44 | ) | 53 | ) |
45 | 54 | ||
@@ -51,9 +60,12 @@ instance Rank2.Functor OBJ where | |||
51 | { objLocations = f (objLocations obj) | 60 | { objLocations = f (objLocations obj) |
52 | , objTexCoords = f (objTexCoords obj) | 61 | , objTexCoords = f (objTexCoords obj) |
53 | , objNormals = f (objNormals obj) | 62 | , objNormals = f (objNormals obj) |
63 | , objEmbeddedCurves = f (objEmbeddedCurves obj) | ||
54 | , objPoints = f (objPoints obj) | 64 | , objPoints = f (objPoints obj) |
55 | , objLines = f (objLines obj) | 65 | , objLines = f (objLines obj) |
56 | , objFaces = f (objFaces obj) | 66 | , objFaces = f (objFaces obj) |
67 | , objCurves = f (objCurves obj) | ||
68 | , objSurfaces = f (objSurfaces obj) | ||
57 | , objMtlLibs = f (objMtlLibs obj) | 69 | , objMtlLibs = f (objMtlLibs obj) |
58 | } | 70 | } |
59 | 71 | ||
@@ -65,9 +77,12 @@ instance ForAllOBJ c => Payload c OBJ where | |||
65 | { objLocations = f (objLocations obj) | 77 | { objLocations = f (objLocations obj) |
66 | , objTexCoords = f (objTexCoords obj) | 78 | , objTexCoords = f (objTexCoords obj) |
67 | , objNormals = f (objNormals obj) | 79 | , objNormals = f (objNormals obj) |
80 | , objEmbeddedCurves = f (objEmbeddedCurves obj) | ||
68 | , objPoints = f (objPoints obj) | 81 | , objPoints = f (objPoints obj) |
69 | , objLines = f (objLines obj) | 82 | , objLines = f (objLines obj) |
70 | , objFaces = f (objFaces obj) | 83 | , objFaces = f (objFaces obj) |
84 | , objCurves = f (objCurves obj) | ||
85 | , objSurfaces = f (objSurfaces obj) | ||
71 | , objMtlLibs = f (objMtlLibs obj) | 86 | , objMtlLibs = f (objMtlLibs obj) |
72 | } | 87 | } |
73 | 88 | ||
@@ -111,6 +126,15 @@ data Normal = Normal { | |||
111 | , norZ :: {-# UNPACK #-} !Float | 126 | , norZ :: {-# UNPACK #-} !Float |
112 | } deriving (Eq,Ord,Show) | 127 | } deriving (Eq,Ord,Show) |
113 | 128 | ||
129 | data EmbeddedCurve = EmbeddedCurve | ||
130 | deriving (Eq,Ord,Show) | ||
131 | |||
132 | data Curve = Curve | ||
133 | deriving (Eq,Ord,Show) | ||
134 | |||
135 | data Surface = Surface | ||
136 | deriving (Eq,Ord,Show) | ||
137 | |||
114 | -- | A point is a single index that references the locations. It’s a canonical | 138 | -- | A point is a single index that references the locations. It’s a canonical |
115 | -- type that truly represents a polygonal point. | 139 | -- type that truly represents a polygonal point. |
116 | data Point = Point { | 140 | data Point = Point { |