OpenGL-3.0.3.0: A binding for the OpenGL graphics system
Copyright(c) Sven Panne 2002-2019
LicenseBSD3
MaintainerSven Panne <svenpanne@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.OpenGL.GLU.Tessellation

Description

This module corresponds to chapter 5 (Polygon Tessellation) of the GLU specs.

Synopsis

Polygon description

data AnnotatedVertex v Source #

The basic building block in tessellation is a 3D vertex with an associated property, e.g. color, texture coordinates, etc.

Constructors

AnnotatedVertex (Vertex3 GLdouble) v 

Instances

Instances details
Eq v => Eq (AnnotatedVertex v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: AnnotatedVertex v -> AnnotatedVertex v -> Bool

(/=) :: AnnotatedVertex v -> AnnotatedVertex v -> Bool

Ord v => Ord (AnnotatedVertex v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Storable v => Storable (AnnotatedVertex v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

sizeOf :: AnnotatedVertex v -> Int

alignment :: AnnotatedVertex v -> Int

peekElemOff :: Ptr (AnnotatedVertex v) -> Int -> IO (AnnotatedVertex v)

pokeElemOff :: Ptr (AnnotatedVertex v) -> Int -> AnnotatedVertex v -> IO ()

peekByteOff :: Ptr b -> Int -> IO (AnnotatedVertex v)

pokeByteOff :: Ptr b -> Int -> AnnotatedVertex v -> IO ()

peek :: Ptr (AnnotatedVertex v) -> IO (AnnotatedVertex v)

poke :: Ptr (AnnotatedVertex v) -> AnnotatedVertex v -> IO ()

newtype ComplexContour v Source #

A complex contour, which can be self-intersecting and/or concave.

Instances

Instances details
Eq v => Eq (ComplexContour v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: ComplexContour v -> ComplexContour v -> Bool

(/=) :: ComplexContour v -> ComplexContour v -> Bool

Ord v => Ord (ComplexContour v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

newtype ComplexPolygon v Source #

A complex (possibly concave) polygon, represented by one or more complex and possibly intersecting contours.

Constructors

ComplexPolygon [ComplexContour v] 

Instances

Instances details
Eq v => Eq (ComplexPolygon v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: ComplexPolygon v -> ComplexPolygon v -> Bool

(/=) :: ComplexPolygon v -> ComplexPolygon v -> Bool

Ord v => Ord (ComplexPolygon v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Combining vertices

data WeightedProperties v Source #

Four vertex properties (cf. AnnotatedVertex) with associated weigths summing up to 1.0.

Constructors

WeightedProperties (GLfloat, v) (GLfloat, v) (GLfloat, v) (GLfloat, v) 

type Combiner v = Vertex3 GLdouble -> WeightedProperties v -> v Source #

A function combining given vertex properties into a property for a newly generated vertex

Tessellation parameters

type Tolerance = GLdouble Source #

The relative tolerance under which two vertices can be combined (see Combiner). Multiplication with the largest coordinate magnitude of all polygon vertices yields the maximum distance between two mergeable vertices.

Note that merging is optional and the tolerance is only a hint.

Tessellator type

type Tessellator p v = TessWinding -> Tolerance -> Normal3 GLdouble -> Combiner v -> ComplexPolygon v -> IO (p v) Source #

A general tessellator type.

Before tessellation of a complex polygon, all its vertices are projected into a plane perpendicular to the given normal. If the given normal is Normal3 0 0 0, a fitting plane of all vertices is used.

Contour extraction

newtype SimpleContour v Source #

A simple, non-self-intersecting contour

Constructors

SimpleContour [AnnotatedVertex v] 

Instances

Instances details
Eq v => Eq (SimpleContour v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: SimpleContour v -> SimpleContour v -> Bool

(/=) :: SimpleContour v -> SimpleContour v -> Bool

Ord v => Ord (SimpleContour v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

newtype PolygonContours v Source #

The contours of a complex polygon, represented by one or more non-intersecting simple contours

Constructors

PolygonContours [SimpleContour v] 

Instances

Instances details
Eq v => Eq (PolygonContours v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: PolygonContours v -> PolygonContours v -> Bool

(/=) :: PolygonContours v -> PolygonContours v -> Bool

Ord v => Ord (PolygonContours v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Triangulation

type TriangleVertex v = AnnotatedVertex (v, EdgeFlag) Source #

A triangle vertex with additional information about the edge it begins

data Triangle v Source #

A triangle, represented by three triangle vertices

Instances

Instances details
Eq v => Eq (Triangle v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: Triangle v -> Triangle v -> Bool

(/=) :: Triangle v -> Triangle v -> Bool

Ord v => Ord (Triangle v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

compare :: Triangle v -> Triangle v -> Ordering

(<) :: Triangle v -> Triangle v -> Bool

(<=) :: Triangle v -> Triangle v -> Bool

(>) :: Triangle v -> Triangle v -> Bool

(>=) :: Triangle v -> Triangle v -> Bool

max :: Triangle v -> Triangle v -> Triangle v

min :: Triangle v -> Triangle v -> Triangle v

newtype Triangulation v Source #

A triangulation of a complex polygon

Constructors

Triangulation [Triangle v] 

Instances

Instances details
Eq v => Eq (Triangulation v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: Triangulation v -> Triangulation v -> Bool

(/=) :: Triangulation v -> Triangulation v -> Bool

Ord v => Ord (Triangulation v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Tessellation into primitives

data Primitive v Source #

Instances

Instances details
Eq v => Eq (Primitive v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: Primitive v -> Primitive v -> Bool

(/=) :: Primitive v -> Primitive v -> Bool

Ord v => Ord (Primitive v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

compare :: Primitive v -> Primitive v -> Ordering

(<) :: Primitive v -> Primitive v -> Bool

(<=) :: Primitive v -> Primitive v -> Bool

(>) :: Primitive v -> Primitive v -> Bool

(>=) :: Primitive v -> Primitive v -> Bool

max :: Primitive v -> Primitive v -> Primitive v

min :: Primitive v -> Primitive v -> Primitive v

newtype SimplePolygon v Source #

Constructors

SimplePolygon [Primitive v] 

Instances

Instances details
Eq v => Eq (SimplePolygon v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation

Methods

(==) :: SimplePolygon v -> SimplePolygon v -> Bool

(/=) :: SimplePolygon v -> SimplePolygon v -> Bool

Ord v => Ord (SimplePolygon v) Source # 
Instance details

Defined in Graphics.Rendering.OpenGL.GLU.Tessellation