wavefront-0.1.0.2: Wavefront OBJ loader

Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Codec.Wavefront.Object

Contents

Description

 

Synopsis

Context and elements

data Ctxt Source

The lexer context. The result of lexing a stream of tokens is this exact type.

Constructors

Ctxt 

Fields

ctxtName :: Maybe Text

Name of the object. Nothing means that the object is not user-defined.

ctxtLocations :: DList Location

Locations.

ctxtTexCoords :: DList TexCoord

Texture coordinates.

ctxtNormals :: DList Normal

Normals.

ctxtPoints :: DList (Element Point)

Points.

ctxtLines :: DList (Element Line)

Lines.

ctxtFaces :: DList (Element Face)

Faces.

ctxtCurrentObject :: Maybe Text

Current object.

ctxtCurrentGroups :: [Text]

Current groups.

ctxtCurrentMtl :: Maybe Text

Current material.

ctxtMtlLibs :: DList Text

Material libraries.

emptyCtxt :: Ctxt Source

The empty Ctxt. Such a context exists at the beginning of the token stream and gets altered as we consume tokens.

data Element a Source

An element holds a value along with the user-defined object’s name (if exists), the associated groups and the used material.

Constructors

Element 

Fields

elObject :: Maybe Text
 
elGroups :: [Text]
 
elMtl :: Maybe Text
 
elValue :: a
 

Instances

Eq a => Eq (Element a) Source 
Show a => Show (Element a) Source 

lexer :: TokenStream -> Ctxt Source

The lexer function, consuming tokens and yielding a Ctxt.

Wavefront OBJ

type WavefrontOBJ = Ctxt Source

Wavefront OBJ type.