GLUtessellatorCallback
with empty callback methods. This class can be extended to provide user
defined callback methods.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | begin(final int
Specifics the type of begin/end pair being defined. The following
values are valid: GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP,
GL_TRIANGLES or GL_LINE_LOOP. type)Implements com. glBegin to indicate the start of a
(triangle) primitive.
|
| public void | beginData(final int
Specifics the type of begin/end pair being defined. The following
values are valid: GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP,
GL_TRIANGLES or GL_LINE_LOOP. type, final Object Specifics a reference to user-defined data. polygonData)Implements com. begin callback method except that
it takes an additional reference argument.
|
| public void | combine(final double[]
Specifics the location of the new vertex. coords, final Object[] Specifics the vertices used to create the new vertex. data, final float[] Specifics the weights used to create the new vertex. weight, final Object[] Reference user the put the coodinates of the new vertex. outData)Implements com. |
| public void | combineData(final double[]
Specifics the location of the new vertex. coords, final Object[] Specifics the vertices used to create the new vertex. data, final float[] Specifics the weights used to create the new vertex. weight, final Object[] Reference user the put the coodinates of the new vertex. outData, final Object Specifics a reference to user-defined data. polygonData)Implements com. combine callback method except
that it takes an additional reference argument.
|
| public void | edgeFlag(final boolean
Specifics which edges lie on the polygon boundary. boundaryEdge)Implements com. glEdgeFlag.
|
| public void | edgeFlagData(final boolean
Specifics which edges lie on the polygon boundary. boundaryEdge, final Object Specifics a reference to user-defined data. polygonData)Implements com. edgeFlage callback method
except that it takes an additional reference argument.
|
| public void | end()
Implements com. glEnd.
|
| public void | endData(final Object
Specifics a reference to user-defined data. polygonData)Implements com. end callback method except that it
takes an additional reference argument.
|
| public void | error(final int
Specifics the error number code. errnum)Implements com. |
| public void | errorData(final int
Specifics the error number code. errnum, final Object Specifics a reference to user-defined data. polygonData)Implements com. error callback method except that
it takes an additional reference argument.
|
| public void | vertex(final Object
Specifics a reference to the vertices of the triangles created
by the tessellation process. vertexData)Implements com. begin and end callback methods.
|
| public void | vertexData(final Object
Specifics a reference to the vertices of the triangles created
by the tessellation process. vertexData, final Object Specifics a reference to user-defined data. polygonData)Implements com. vertex callback method except
that it takes an additional reference argument.
|
| GLUtessellatorCallbackAdapter | back to summary |
|---|---|
| public GLUtessellatorCallbackAdapter() | |
| begin | back to summary |
|---|---|
| public void begin(final int type) Implements com. Doc from com. The begin callback method is invoked like
| |
| beginData | back to summary |
|---|---|
| public void beginData(final int type, final Object polygonData) Implements com. Doc from com. The same as the | |
| combine | back to summary |
|---|---|
| public void combine(final double[] coords, final Object[] data, final float[] weight, final Object[] outData) Implements com. Doc from com. The combine callback method is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features. The method takes four arguments: an array of three elements each of type double, an array of four references, an array of four elements each of type float, and a reference to a reference. The vertex is defined as a linear combination of up to four existing vertices, stored in data. The coefficients of the linear combination are given by weight; these weights always add up to 1. All vertex pointers are valid even when some of the weights are 0. coords gives the location of the new vertex.
The user must allocate another vertex, interpolate parameters using
data and weight, and return the new vertex pointer in
outData. This handle is supplied during rendering callbacks. The
user is responsible for freeing the memory some time after
For example, if the polygon lies in an arbitrary plane in 3-space, and a color is associated with each vertex, the GLU_TESS_COMBINE callback might look like this:
void myCombine(double[] coords, Object[] data,
float[] weight, Object[] outData)
{
MyVertex newVertex = new MyVertex();
newVertex.x = coords[0];
newVertex.y = coords[1];
newVertex.z = coords[2];
newVertex.r = weight[0]*data[0].r +
weight[1]*data[1].r +
weight[2]*data[2].r +
weight[3]*data[3].r;
newVertex.g = weight[0]*data[0].g +
weight[1]*data[1].g +
weight[2]*data[2].g +
weight[3]*data[3].g;
newVertex.b = weight[0]*data[0].b +
weight[1]*data[1].b +
weight[2]*data[2].b +
weight[3]*data[3].b;
newVertex.a = weight[0]*data[0].a +
weight[1]*data[1].a +
weight[2]*data[2].a +
weight[3]*data[3].a;
outData = newVertex;
}
| |
| combineData | back to summary |
|---|---|
| public void combineData(final double[] coords, final Object[] data, final float[] weight, final Object[] outData, final Object polygonData) Implements com. Doc from com. The same as the
| |
| edgeFlag | back to summary |
|---|---|
| public void edgeFlag(final boolean boundaryEdge) Implements com. Doc from com. The edgeFlag callback method is similar to
Since triangle fans and triangle strips do not support edge flags, the begin callback is not called with GL_TRIANGLE_FAN or GL_TRIANGLE_STRIP if a non-null edge flag callback is provided. (If the callback is initialized to null, there is no impact on performance). Instead, the fans and strips are converted to independent triangles.
| |
| edgeFlagData | back to summary |
|---|---|
| public void edgeFlagData(final boolean boundaryEdge, final Object polygonData) Implements com. Doc from com. The same as the | |
| end | back to summary |
|---|---|
| public void end() Implements com. Doc from com. The end callback serves the same purpose as
| |
| endData | back to summary |
|---|---|
| public void endData(final Object polygonData) Implements com. Doc from com. The same as the | |
| error | back to summary |
|---|---|
| public void error(final int errnum) Implements com. Doc from com. The error callback method is called when an error is encountered.
The one argument is of type int; it indicates the specific error that
occurred and will be set to one of GLU_TESS_MISSING_BEGIN_POLYGON,
GLU_TESS_MISSING_END_POLYGON, GLU_TESS_MISSING_BEGIN_CONTOUR,
GLU_TESS_MISSING_END_CONTOUR, GLU_TESS_COORD_TOO_LARGE,
GLU_TESS_NEED_COMBINE_CALLBACK or GLU_OUT_OF_MEMORY.
Character strings describing these errors can be retrieved with the
The GLU library will recover from the first four errors by inserting the missing call(s). GLU_TESS_COORD_TOO_LARGE indicates that some vertex coordinate exceeded the predefined constant GLU_TESS_MAX_COORD in absolute value, and that the value has been clamped. (Coordinate values must be small enough so that two can be multiplied together without overflow.) GLU_TESS_NEED_COMBINE_CALLBACK indicates that the tessellation detected an intersection between two edges in the input data, and the GLU_TESS_COMBINE or GLU_TESS_COMBINE_DATA callback was not provided. No output is generated. GLU_OUT_OF_MEMORY indicates that there is not enough memory so no output is generated.
| |
| errorData | back to summary |
|---|---|
| public void errorData(final int errnum, final Object polygonData) Implements com. Doc from com. The same as the | |
| vertex | back to summary |
|---|---|
| public void vertex(final Object vertexData) Implements com. Doc from com. The vertex callback method is invoked between the | |
| vertexData | back to summary |
|---|---|
| public void vertexData(final Object vertexData, final Object polygonData) Implements com. Doc from com. The same as the | |