fr.inria.insitu.glite.managers
Class TesselationManager

java.lang.Object
  extended by javax.media.opengl.glu.GLUtessellatorCallbackAdapter
      extended by fr.inria.insitu.glite.managers.TesselationManager
All Implemented Interfaces:
LiteManager, javax.media.opengl.glu.GLUtessellatorCallback

public class TesselationManager
extends javax.media.opengl.glu.GLUtessellatorCallbackAdapter
implements LiteManager

Wrapper on the GLU Tess Functions, used to tesselate arbitary flattened paths.


Field Summary
static Object KEY
          Key for access in PaintConext.
 
Fields inherited from interface fr.inria.insitu.glite.managers.LiteManager
KEY_CLIP, KEY_FONT, KEY_STENCIL, KEY_TESSELATOR, KEY_TRANSFORM, KEY_VERTEX_ARRAY
 
Constructor Summary
TesselationManager(javax.media.opengl.glu.GLU glu)
          Create a new TesselationManager object.
 
Method Summary
 void begin(int mode)
          
 void combine(double[] coords, Object[] data, float[] weight, Object[] dataOut)
          
static void defaultCombine(double[] coords, Object[] data, float[] weight, Object[] dataOut)
          Default implementation of the TesselatorVisitor combine method usable in any implementations.
static void defaultError(int errorCode)
          Default implementation of the TesselatorVisitor error method usable in any implementations.
 void dispose()
          Frees the OpenGL TessObj associated with this tesselator.
 void end()
          
 void error(int errorCode)
          
 void fill(javax.media.opengl.GL gl, Shape shape)
          Fills a specified shape.
 void fill(javax.media.opengl.GL gl, Shape shape, AffineTransform at)
          Fills a specified shape.
 void fill(javax.media.opengl.GL gl, Shape shape, AffineTransform at, float flatness)
          Fills a specified shape.
 void fill(javax.media.opengl.GL gl, VertexArray vertexArray, Shape shape, AffineTransform at, float flatness)
          Fills a specified shape.
 VertexArrayList fill(VertexArrayList list, Shape shape, AffineTransform at, float flatness)
          Fills a specified shape.
static TesselationManager get(LitePaintContext ctx)
          Returns a TesselationManager from a LitePaintContext, creating it if needed.
 void reset()
          Resets the manager.
 void tesselate(int[] xPts, int[] yPts, int nPts, fr.inria.insitu.glite.managers.TesselatorVisitor visitor)
          Tesselates the interior of a polygon defined by a list of points.
 void tesselate(PathIterator path, fr.inria.insitu.glite.managers.TesselatorVisitor visitor)
          Tesselates the interior of a polygon defined by a path.
 void vertex(Object data)
          
 
Methods inherited from class javax.media.opengl.glu.GLUtessellatorCallbackAdapter
beginData, combineData, edgeFlag, edgeFlagData, endData, errorData, vertexData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final Object KEY
Key for access in PaintConext.

Constructor Detail

TesselationManager

public TesselationManager(javax.media.opengl.glu.GLU glu)
Create a new TesselationManager object.

Parameters:
glu - a GLU object
Method Detail

get

public static TesselationManager get(LitePaintContext ctx)
Returns a TesselationManager from a LitePaintContext, creating it if needed.

Parameters:
ctx - the LitePaintContext
Returns:
a TesselationManager

reset

public void reset()
Resets the manager.

Specified by:
reset in interface LiteManager

tesselate

public void tesselate(PathIterator path,
                      fr.inria.insitu.glite.managers.TesselatorVisitor visitor)
Tesselates the interior of a polygon defined by a path. The path must be a flattened path.

Parameters:
path - a flattened PathIterator
visitor - a TesselatorVisitor

tesselate

public void tesselate(int[] xPts,
                      int[] yPts,
                      int nPts,
                      fr.inria.insitu.glite.managers.TesselatorVisitor visitor)
Tesselates the interior of a polygon defined by a list of points.

Parameters:
xPts - a table of x coordinates
yPts - a table of y coordinates
nPts - the number of points to consider
visitor - the TesselatorVisitor

dispose

public void dispose()
Frees the OpenGL TessObj associated with this tesselator.

Specified by:
dispose in interface LiteManager

begin

public void begin(int mode)

Specified by:
begin in interface javax.media.opengl.glu.GLUtessellatorCallback
Overrides:
begin in class javax.media.opengl.glu.GLUtessellatorCallbackAdapter

vertex

public void vertex(Object data)

Specified by:
vertex in interface javax.media.opengl.glu.GLUtessellatorCallback
Overrides:
vertex in class javax.media.opengl.glu.GLUtessellatorCallbackAdapter

end

public void end()

Specified by:
end in interface javax.media.opengl.glu.GLUtessellatorCallback
Overrides:
end in class javax.media.opengl.glu.GLUtessellatorCallbackAdapter

error

public void error(int errorCode)

Specified by:
error in interface javax.media.opengl.glu.GLUtessellatorCallback
Overrides:
error in class javax.media.opengl.glu.GLUtessellatorCallbackAdapter

combine

public void combine(double[] coords,
                    Object[] data,
                    float[] weight,
                    Object[] dataOut)

Specified by:
combine in interface javax.media.opengl.glu.GLUtessellatorCallback
Overrides:
combine in class javax.media.opengl.glu.GLUtessellatorCallbackAdapter

defaultCombine

public static void defaultCombine(double[] coords,
                                  Object[] data,
                                  float[] weight,
                                  Object[] dataOut)
Default implementation of the TesselatorVisitor combine method usable in any implementations.

Parameters:
coords - coordinates to combine
data - associated data to combine
weight - weights on the points
dataOut - where the combined points will be returned

defaultError

public static void defaultError(int errorCode)
Default implementation of the TesselatorVisitor error method usable in any implementations.

Parameters:
errorCode - the GLU error code.

fill

public void fill(javax.media.opengl.GL gl,
                 Shape shape,
                 AffineTransform at,
                 float flatness)
Fills a specified shape.

Parameters:
gl - the GL context
shape - the shape
at - the affine transform
flatness - the flatness

fill

public void fill(javax.media.opengl.GL gl,
                 VertexArray vertexArray,
                 Shape shape,
                 AffineTransform at,
                 float flatness)
Fills a specified shape.

Parameters:
gl - the GL context
vertexArray - a VertexArray
shape - the shape
at - the affine transform
flatness - the flatness

fill

public void fill(javax.media.opengl.GL gl,
                 Shape shape,
                 AffineTransform at)
Fills a specified shape.

Parameters:
gl - the GL context
shape - the shape
at - the affine transform

fill

public void fill(javax.media.opengl.GL gl,
                 Shape shape)
Fills a specified shape.

Parameters:
gl - the GL context
shape - the shape

fill

public VertexArrayList fill(VertexArrayList list,
                            Shape shape,
                            AffineTransform at,
                            float flatness)
Fills a specified shape.

Parameters:
list - a VertexArrayList
shape - the shape
at - the affine transform
flatness - the flatness
Returns:
a VertexArrayList of the tesselated shape


Copyright © 2006 by Jean-Daniel Fekete and INRIA, France All rights reserved.