agile2d.opengl
Class Tesselator

java.lang.Object
  |
  +--agile2d.opengl.Tesselator
All Implemented Interfaces:
gl4java.GLUEnum

public final class Tesselator
extends Object
implements gl4java.GLUEnum

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


Field Summary
 
Fields inherited from interface gl4java.GLUEnum
GLU_AUTO_LOAD_MATRIX, GLU_BEGIN, GLU_CCW, GLU_CULLING, GLU_CW, GLU_DISPLAY_MODE, GLU_DOMAIN_DISTANCE, GLU_EDGE_FLAG, GLU_END, GLU_ERROR, GLU_EXTENSIONS, GLU_EXTERIOR, GLU_FALSE, GLU_FILL, GLU_FLAT, GLU_INSIDE, GLU_INTERIOR, GLU_INVALID_ENUM, GLU_INVALID_OPERATION, GLU_INVALID_VALUE, GLU_LINE, GLU_MAP1_TRIM_2, GLU_MAP1_TRIM_3, GLU_NONE, GLU_NURBS_BEGIN, GLU_NURBS_BEGIN_DATA, GLU_NURBS_BEGIN_DATA_EXT, GLU_NURBS_BEGIN_EXT, GLU_NURBS_COLOR, GLU_NURBS_COLOR_DATA, GLU_NURBS_COLOR_DATA_EXT, GLU_NURBS_COLOR_EXT, GLU_NURBS_END, GLU_NURBS_END_DATA, GLU_NURBS_END_DATA_EXT, GLU_NURBS_END_EXT, GLU_NURBS_ERROR, GLU_NURBS_ERROR1, GLU_NURBS_ERROR10, GLU_NURBS_ERROR11, GLU_NURBS_ERROR12, GLU_NURBS_ERROR13, GLU_NURBS_ERROR14, GLU_NURBS_ERROR15, GLU_NURBS_ERROR16, GLU_NURBS_ERROR17, GLU_NURBS_ERROR18, GLU_NURBS_ERROR19, GLU_NURBS_ERROR2, GLU_NURBS_ERROR20, GLU_NURBS_ERROR21, GLU_NURBS_ERROR22, GLU_NURBS_ERROR23, GLU_NURBS_ERROR24, GLU_NURBS_ERROR25, GLU_NURBS_ERROR26, GLU_NURBS_ERROR27, GLU_NURBS_ERROR28, GLU_NURBS_ERROR29, GLU_NURBS_ERROR3, GLU_NURBS_ERROR30, GLU_NURBS_ERROR31, GLU_NURBS_ERROR32, GLU_NURBS_ERROR33, GLU_NURBS_ERROR34, GLU_NURBS_ERROR35, GLU_NURBS_ERROR36, GLU_NURBS_ERROR37, GLU_NURBS_ERROR4, GLU_NURBS_ERROR5, GLU_NURBS_ERROR6, GLU_NURBS_ERROR7, GLU_NURBS_ERROR8, GLU_NURBS_ERROR9, GLU_NURBS_MODE, GLU_NURBS_MODE_EXT, GLU_NURBS_NORMAL, GLU_NURBS_NORMAL_DATA, GLU_NURBS_NORMAL_DATA_EXT, GLU_NURBS_NORMAL_EXT, GLU_NURBS_RENDERER, GLU_NURBS_RENDERER_EXT, GLU_NURBS_TESSELLATOR, GLU_NURBS_TESSELLATOR_EXT, GLU_NURBS_TEX_COORD_DATA_EXT, GLU_NURBS_TEX_COORD_EXT, GLU_NURBS_TEXTURE_COORD, GLU_NURBS_TEXTURE_COORD_DATA, GLU_NURBS_VERTEX, GLU_NURBS_VERTEX_DATA, GLU_NURBS_VERTEX_DATA_EXT, GLU_NURBS_VERTEX_EXT, GLU_OBJECT_PARAMETRIC_ERROR, GLU_OBJECT_PARAMETRIC_ERROR_EXT, GLU_OBJECT_PATH_LENGTH, GLU_OBJECT_PATH_LENGTH_EXT, GLU_OUT_OF_MEMORY, GLU_OUTLINE_PATCH, GLU_OUTLINE_POLYGON, GLU_OUTSIDE, GLU_PARAMETRIC_ERROR, GLU_PARAMETRIC_TOLERANCE, GLU_PATH_LENGTH, GLU_POINT, GLU_SAMPLING_METHOD, GLU_SAMPLING_TOLERANCE, GLU_SILHOUETTE, GLU_SMOOTH, GLU_TESS_BEGIN, GLU_TESS_BEGIN_DATA, GLU_TESS_BOUNDARY_ONLY, GLU_TESS_COMBINE, GLU_TESS_COMBINE_DATA, GLU_TESS_COORD_TOO_LARGE, GLU_TESS_EDGE_FLAG, GLU_TESS_EDGE_FLAG_DATA, GLU_TESS_END, GLU_TESS_END_DATA, GLU_TESS_ERROR, GLU_TESS_ERROR_DATA, GLU_TESS_ERROR1, GLU_TESS_ERROR2, GLU_TESS_ERROR3, GLU_TESS_ERROR4, GLU_TESS_ERROR5, GLU_TESS_ERROR6, GLU_TESS_ERROR7, GLU_TESS_ERROR8, GLU_TESS_MAX_COORD, GLU_TESS_MISSING_BEGIN_CONTOUR, GLU_TESS_MISSING_BEGIN_POLYGON, GLU_TESS_MISSING_END_CONTOUR, GLU_TESS_MISSING_END_POLYGON, GLU_TESS_NEED_COMBINE_CALLBACK, GLU_TESS_TOLERANCE, GLU_TESS_VERTEX, GLU_TESS_VERTEX_DATA, GLU_TESS_WINDING_ABS_GEQ_TWO, GLU_TESS_WINDING_NEGATIVE, GLU_TESS_WINDING_NONZERO, GLU_TESS_WINDING_ODD, GLU_TESS_WINDING_POSITIVE, GLU_TESS_WINDING_RULE, GLU_U_STEP, GLU_UNKNOWN, GLU_V_STEP, GLU_VERSION, GLU_VERTEX
 
Constructor Summary
Tesselator(gl4java.GLFunc gl, gl4java.GLUFunc glu)
          Create a new Tesselator object.
 
Method Summary
static void defaultCombine(double[] coords, double[] data, float[] weight, double[] 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 tessBegin(int which)
          Implements TessCallback's TESS_BEGIN method.
 void tessCombine(double[] coords, double[] data, float[] weight, double[] dataOut)
          Implements TessCallback's TESS_COMBINE method. combine is used to create a new vertex when edges intersect.
 void tesselate(int[] xPts, int[] yPts, int nPts, TesselatorVisitor visitor)
          Tesselates the interior of a polygon defined by a list of points.
 void tesselate(PathIterator path, TesselatorVisitor visitor)
          Tesselates the interior of a polygon defined by a path.
 void tessEnd()
          Implements TessCallback's TESS_END method.
 void tessError(int errorCode)
          Implements TessCallback's TESS_ERROR method.
 void tessVertex(double[] v)
          Implements TessCallback's TESS_VERTEX method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tesselator

public Tesselator(gl4java.GLFunc gl,
                  gl4java.GLUFunc glu)
Create a new Tesselator object.

Parameters:
gl - DOCUMENT ME!
glu - DOCUMENT ME!
Method Detail

tesselate

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

Parameters:
path - DOCUMENT ME!

tesselate

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

Parameters:
xPts - DOCUMENT ME!
yPts - DOCUMENT ME!
nPts - DOCUMENT ME!

dispose

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


tessVertex

public void tessVertex(double[] v)
Implements TessCallback's TESS_VERTEX method.

Parameters:
v - DOCUMENT ME!

tessBegin

public void tessBegin(int which)
Implements TessCallback's TESS_BEGIN method.

Parameters:
which - DOCUMENT ME!

tessEnd

public void tessEnd()
Implements TessCallback's TESS_END method.


tessError

public void tessError(int errorCode)
Implements TessCallback's TESS_ERROR method.

Parameters:
errorCode - DOCUMENT ME!

tessCombine

public void tessCombine(double[] coords,
                        double[] data,
                        float[] weight,
                        double[] dataOut)
Implements TessCallback's TESS_COMBINE method. combine is used to create a new vertex when edges intersect. coordinate location is trivial to calculate, but weight[4] may be used to average color, normal, or texture coordinate data.

Parameters:
coords - DOCUMENT ME!
data - DOCUMENT ME!
weight - DOCUMENT ME!
dataOut - DOCUMENT ME!

defaultCombine

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

Parameters:
coords - DOCUMENT ME!
data - DOCUMENT ME!
weight - DOCUMENT ME!
dataOut - DOCUMENT ME!

defaultError

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

Parameters:
errorCode - DOCUMENT ME!


Copyright © 2002 by University of Maryland, USA All rights reserved.