com.hermetica.magician
Class GLUTesselator

java.lang.Object
  |
  +--com.hermetica.magician.GLUTesselator

public class GLUTesselator
extends java.lang.Object

This class defines the API of a GLU tesselator object. Developers wishing to use GLU tesselators within their Magician applications should implement this interface and write method bodies for each method, eg, the begin, end and error tesselator callback at the very least.

Version:
$Id: GLUTesselator.java,v 1.2 1999/06/03 23:11:48 descarte Exp $
Author:
Alligator Descartes <descarte@arcana.co.uk>
See Also:
GLU

Field Summary
static int BEGIN_CALLBACK
          Tessellator callbacks
static int COMBINE_CALLBACK
           
static int EDGE_FLAG_CALLBACK
           
static int EDGEFLAG_CALLBACK
           
static int END_CALLBACK
           
static int ERROR_CALLBACK
           
 CoreGL gl
          Basic GL and GLU pipelines that can be used in subclassed tesselators
 CoreGLU glu
           
 TraceGL tracegl
          Tracing pipeline to enable us to see what's going on...
 TraceGLU traceglu
           
static java.lang.String VERSION
          Version information
static int VERTEX_CALLBACK
           
 
Constructor Summary
GLUTesselator()
          Creates a new GLUTesselator object
GLUTesselator(int callbacks)
          Creates a new GLUTesselator object registering only the stated callbacks
 
Method Summary
 void begin(int mode)
          Callback that handles the beginning of polygon tesselation.
 void beginPolygon()
          Begins a polygon description that is to be tesselated.
 void combine(double[] coords, double[][] vertex, float[] weight, float[] dataOut)
          Combine callback.
 void deleteTess()
          Destroys the tesselator object
 void destroy()
          Destroys the GLUtesselator object
 void edgeFlag(boolean edgeFlag)
          Callback that handles edge flag setting.
 void end()
          Callback that handles the end of polygon tesselation.
 void endPolygon()
          Ends a polygon description of a polygon that is to be tesselated.
 void error(int error)
          Callback that handles error conditions.
 GLComponent getComponent()
          Returns the component associated with the tesselator
 boolean getTraceStatus()
          Returns the trace status of the GLUTesselator lock
 void nextContour(int type)
          Specifies the beginning of the next part of a polygon to tesselate and how the tesselation can be optimized.
 void release()
          Releases the memory used internally by the tesselator
 void setTraceStatus(boolean mode)
          Specifies the trace mode of the GLUTesselator lock
 void tessBeginContour()
          Handler for tessBeginContour()
 void tessBeginPolygon(float[] userData)
          Begins a polygon description that is to be tesselated.
 void tessEndContour()
          Handler for tessEndContour()
 void tessEndPolygon()
          Ends a polygon description of a polygon that is to be tesselated.
 void tessProperty(int property, double value)
          Specifies tesselator properties
 void tessVertex(double[] vertex, double[] data)
          Vertex tesselation
 void tessVertex(double[] vertex, double[][] data)
          Vertex tesselation helper method
 void tessVertex(double[] vertex, float[] data)
          Specifies vertex data to tesselate
 void tessVertex(double[] vertex, float[][] data)
          Vertex tesselation helper method
 void tessVertex(double[] vertex, int[] data)
          Vertex tesselation
 void tessVertex(double[] vertex, int[][] data)
          Vertex tesselation helper method
 void vertex(float[] vertex)
          Callback that handles vertex data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version information

BEGIN_CALLBACK

public static final int BEGIN_CALLBACK
Tessellator callbacks

END_CALLBACK

public static final int END_CALLBACK

VERTEX_CALLBACK

public static final int VERTEX_CALLBACK

ERROR_CALLBACK

public static final int ERROR_CALLBACK

EDGEFLAG_CALLBACK

public static final int EDGEFLAG_CALLBACK

EDGE_FLAG_CALLBACK

public static final int EDGE_FLAG_CALLBACK

COMBINE_CALLBACK

public static final int COMBINE_CALLBACK

gl

public CoreGL gl
Basic GL and GLU pipelines that can be used in subclassed tesselators

glu

public CoreGLU glu

tracegl

public TraceGL tracegl
Tracing pipeline to enable us to see what's going on...

traceglu

public TraceGLU traceglu
Constructor Detail

GLUTesselator

public GLUTesselator()
Creates a new GLUTesselator object

GLUTesselator

public GLUTesselator(int callbacks)
Creates a new GLUTesselator object registering only the stated callbacks

Parameters:
callbacks - A bitmask of the callbacks to register
Method Detail

destroy

public void destroy()
Destroys the GLUtesselator object

tessBeginContour

public void tessBeginContour()
Handler for tessBeginContour()

tessEndContour

public void tessEndContour()
Handler for tessEndContour()

tessProperty

public void tessProperty(int property,
                         double value)
Specifies tesselator properties

release

public void release()
Releases the memory used internally by the tesselator

deleteTess

public void deleteTess()
Destroys the tesselator object

getComponent

public GLComponent getComponent()
Returns the component associated with the tesselator

setTraceStatus

public void setTraceStatus(boolean mode)
Specifies the trace mode of the GLUTesselator lock

getTraceStatus

public boolean getTraceStatus()
Returns the trace status of the GLUTesselator lock

beginPolygon

public void beginPolygon()
Begins a polygon description that is to be tesselated. This exclusively locks the current tesselator until endPolygon() is called to ensure that multiple tesselators aren't trying to tesselate simultaneously. This causes problems.

tessBeginPolygon

public void tessBeginPolygon(float[] userData)
Begins a polygon description that is to be tesselated. This exclusively locks the current tesselator until endPolygon() is called to ensure that multiple tesselators aren't trying to tesselate simultaneously. This causes problems.

endPolygon

public void endPolygon()
Ends a polygon description of a polygon that is to be tesselated. Also, the tesselator exclusion lock is released.

tessEndPolygon

public void tessEndPolygon()
Ends a polygon description of a polygon that is to be tesselated. Also, the tesselator exclusion lock is released.

tessVertex

public void tessVertex(double[] vertex,
                       float[] data)
Specifies vertex data to tesselate

tessVertex

public void tessVertex(double[] vertex,
                       float[][] data)
Vertex tesselation helper method

tessVertex

public void tessVertex(double[] vertex,
                       int[] data)
Vertex tesselation

tessVertex

public void tessVertex(double[] vertex,
                       int[][] data)
Vertex tesselation helper method

tessVertex

public void tessVertex(double[] vertex,
                       double[] data)
Vertex tesselation

tessVertex

public void tessVertex(double[] vertex,
                       double[][] data)
Vertex tesselation helper method

nextContour

public void nextContour(int type)
Specifies the beginning of the next part of a polygon to tesselate and how the tesselation can be optimized.

Parameters:
type - Type of contour

begin

public void begin(int mode)
Callback that handles the beginning of polygon tesselation. This should be overridden in your own application as it is a no-operation in this class.

Parameters:
mode - The rendering mode for a glBegin() call passed in via the tesselator

end

public void end()
Callback that handles the end of polygon tesselation. This should be overridden in your own application as it is a no-operation in this class.

vertex

public void vertex(float[] vertex)
Callback that handles vertex data. This should be overridden in your own application as it is a no-operation in this class.

Parameters:
vertex - Vertex data passed in from the tesselator.

error

public void error(int error)
Callback that handles error conditions. This should be overridden in your own application.

Parameters:
error - The GLU error number returned by the tesselator.

edgeFlag

public void edgeFlag(boolean edgeFlag)
Callback that handles edge flag setting. This should be overridden in your own application.

Parameters:
edgeFlag - The new edge flag setting

combine

public void combine(double[] coords,
                    double[][] vertex,
                    float[] weight,
                    float[] dataOut)
Combine callback. This should be overridden in your own tesselator