JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter Class Reference

The GLUtessellatorCallbackAdapter provides a default implementation of GLUtessellatorCallback with empty callback methods. More...

Inheritance diagram for com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter:
Collaboration diagram for com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter:

Public Member Functions

void begin (final int type)
 The begin callback method is invoked like glBegin to indicate the start of a (triangle) primitive. More...
 
void edgeFlag (final boolean boundaryEdge)
 The edgeFlag callback method is similar to glEdgeFlag. More...
 
void vertex (final Object vertexData)
 The vertex callback method is invoked between the begin and end callback methods. More...
 
void end ()
 The end callback serves the same purpose as glEnd. More...
 
void error (final int errnum)
 The error callback method is called when an error is encountered. More...
 
void combine (final double[] coords, final Object[] data, final float[] weight, final Object[] outData)
 The combine callback method is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features. More...
 
void beginData (final int type, final Object polygonData)
 The same as the begin callback method except that it takes an additional reference argument. More...
 
void edgeFlagData (final boolean boundaryEdge, final Object polygonData)
 The same as the edgeFlage callback method except that it takes an additional reference argument. More...
 
void vertexData (final Object vertexData, final Object polygonData)
 The same as the vertex callback method except that it takes an additional reference argument. More...
 
void endData (final Object polygonData)
 The same as the end callback method except that it takes an additional reference argument. More...
 
void errorData (final int errnum, final Object polygonData)
 The same as the error callback method except that it takes an additional reference argument. More...
 
void combineData (final double[] coords, final Object[] data, final float[] weight, final Object[] outData, final Object polygonData)
 The same as the combine callback method except that it takes an additional reference argument. More...
 
void begin (int type)
 The begin callback method is invoked like glBegin to indicate the start of a (triangle) primitive. More...
 
void beginData (int type, Object polygonData)
 The same as the begin callback method except that it takes an additional reference argument. More...
 
void edgeFlag (boolean boundaryEdge)
 The edgeFlag callback method is similar to glEdgeFlag. More...
 
void edgeFlagData (boolean boundaryEdge, Object polygonData)
 The same as the edgeFlage callback method except that it takes an additional reference argument. More...
 
void vertex (Object vertexData)
 The vertex callback method is invoked between the begin and end callback methods. More...
 
void vertexData (Object vertexData, Object polygonData)
 The same as the vertex callback method except that it takes an additional reference argument. More...
 
void end ()
 The end callback serves the same purpose as glEnd. More...
 
void endData (Object polygonData)
 The same as the end callback method except that it takes an additional reference argument. More...
 
void combine (double[] coords, Object[] data, float[] weight, Object[] outData)
 The combine callback method is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features. More...
 
void combineData (double[] coords, Object[] data, float[] weight, Object[] outData, Object polygonData)
 The same as the combine callback method except that it takes an additional reference argument. More...
 
void error (int errnum)
 The error callback method is called when an error is encountered. More...
 
void errorData (int errnum, Object polygonData)
 The same as the error callback method except that it takes an additional reference argument. More...
 

Detailed Description

The GLUtessellatorCallbackAdapter provides a default implementation of GLUtessellatorCallback with empty callback methods.

This class can be extended to provide user defined callback methods.

Author
Eric Veach, July 1994
Java Port: Pepijn Van Eechhoudt, July 2003
Java Port: Nathan Parker Burg, August 2003

Definition at line 66 of file GLUtessellatorCallbackAdapter.java.

Member Function Documentation

◆ begin()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.begin ( final int  type)

The begin callback method is invoked like glBegin to indicate the start of a (triangle) primitive.

The method takes a single argument of type int. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_FALSE, then the argument is set to either GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, or GL_TRIANGLES. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_TRUE, then the argument will be set to GL_LINE_LOOP.

Parameters
typeSpecifics 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.
See also
GLU::gluTessCallback gluTessCallback
end end
begin begin

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 68 of file GLUtessellatorCallbackAdapter.java.

◆ beginData()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.beginData ( final int  type,
final Object  polygonData 
)

The same as the begin callback method except that it takes an additional reference argument.

This reference is identical to the opaque reference provided when gluTessBeginPolygon was called.

Parameters
typeSpecifics 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.
polygonDataSpecifics a reference to user-defined data.
See also
GLU::gluTessCallback gluTessCallback
endData endData
begin begin

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 82 of file GLUtessellatorCallbackAdapter.java.

◆ combine()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.combine ( final double[]  coords,
final Object[]  data,
final float[]  weight,
final Object[]  outData 
)

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 gluTessEndPolygon is called.

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;
        }
Parameters
coordsSpecifics the location of the new vertex.
dataSpecifics the vertices used to create the new vertex.
weightSpecifics the weights used to create the new vertex.
outDataReference user the put the coodinates of the new vertex.
See also
GLU::gluTessCallback gluTessCallback
combineData combineData

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 79 of file GLUtessellatorCallbackAdapter.java.

◆ combineData()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.combineData ( final double[]  coords,
final Object[]  data,
final float[]  weight,
final Object[]  outData,
final Object  polygonData 
)

The same as the combine callback method except that it takes an additional reference argument.

This reference is identical to the opaque reference provided when gluTessBeginPolygon was called.

Parameters
coordsSpecifics the location of the new vertex.
dataSpecifics the vertices used to create the new vertex.
weightSpecifics the weights used to create the new vertex.
outDataReference user the put the coodinates of the new vertex.
polygonDataSpecifics a reference to user-defined data.
See also
GLU::gluTessCallback gluTessCallback
combine combine

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 93 of file GLUtessellatorCallbackAdapter.java.

◆ edgeFlag()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.edgeFlag ( final boolean  boundaryEdge)

The edgeFlag callback method is similar to glEdgeFlag.

The method takes a single boolean boundaryEdge that indicates which edges lie on the polygon boundary. If the boundaryEdge is GL_TRUE, then each vertex that follows begins an edge that lies on the polygon boundary, that is, an edge that separates an interior region from an exterior one. If the boundaryEdge is GL_FALSE, then each vertex that follows begins an edge that lies in the polygon interior. The edge flag callback (if defined) is invoked before the first vertex callback.

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.

Parameters
boundaryEdgeSpecifics which edges lie on the polygon boundary.
See also
GLU::gluTessCallback gluTessCallback
edgeFlagData edgeFlagData

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 70 of file GLUtessellatorCallbackAdapter.java.

◆ edgeFlagData()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.edgeFlagData ( final boolean  boundaryEdge,
final Object  polygonData 
)

The same as the edgeFlage callback method except that it takes an additional reference argument.

This reference is identical to the opaque reference provided when gluTessBeginPolygon was called.

Parameters
boundaryEdgeSpecifics which edges lie on the polygon boundary.
polygonDataSpecifics a reference to user-defined data.
See also
GLU::gluTessCallback gluTessCallback
edgeFlag edgeFlag

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 84 of file GLUtessellatorCallbackAdapter.java.

◆ end()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.end ( )

The end callback serves the same purpose as glEnd.

It indicates the end of a primitive and it takes no arguments.

See also
GLU::gluTessCallback gluTessCallback
begin begin
endData endData

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 74 of file GLUtessellatorCallbackAdapter.java.

◆ endData()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.endData ( final Object  polygonData)

The same as the end callback method except that it takes an additional reference argument.

This reference is identical to the opaque reference provided when gluTessBeginPolygon was called.

Parameters
polygonDataSpecifics a reference to user-defined data.
See also
GLU::gluTessCallback gluTessCallback
beginData beginData
end end

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 89 of file GLUtessellatorCallbackAdapter.java.

◆ error()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.error ( final int  errnum)

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 gluErrorString call.

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.

Parameters
errnumSpecifics the error number code.
See also
GLU::gluTessCallback gluTessCallback
errorData errorData

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 77 of file GLUtessellatorCallbackAdapter.java.

◆ errorData()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.errorData ( final int  errnum,
final Object  polygonData 
)

The same as the error callback method except that it takes an additional reference argument.

This reference is identical to the opaque reference provided when gluTessBeginPolygon was called.

Parameters
errnumSpecifics the error number code.
polygonDataSpecifics a reference to user-defined data.
See also
GLU::gluTessCallback gluTessCallback
error error

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 91 of file GLUtessellatorCallbackAdapter.java.

◆ vertex()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.vertex ( final Object  vertexData)

The vertex callback method is invoked between the begin and end callback methods.

It is similar to glVertex3f, and it defines the vertices of the triangles created by the tessellation process. The method takes a reference as its only argument. This reference is identical to the opaque reference provided by the user when the vertex was described (see gluTessVertex).

Parameters
vertexDataSpecifics a reference to the vertices of the triangles created by the tessellation process.
See also
GLU::gluTessCallback gluTessCallback
vertexData vertexData

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 72 of file GLUtessellatorCallbackAdapter.java.

◆ vertexData()

void com.jogamp.opengl.glu.GLUtessellatorCallbackAdapter.vertexData ( final Object  vertexData,
final Object  polygonData 
)

The same as the vertex callback method except that it takes an additional reference argument.

This reference is identical to the opaque reference provided when gluTessBeginPolygon was called.

Parameters
vertexDataSpecifics a reference to the vertices of the triangles created by the tessellation process.
polygonDataSpecifics a reference to user-defined data.
See also
GLU::gluTessCallback gluTessCallback
vertex vertex

Implements com.jogamp.opengl.glu.GLUtessellatorCallback.

Definition at line 87 of file GLUtessellatorCallbackAdapter.java.


The documentation for this class was generated from the following file: