IndexedTessellator

A class that extends the functionality of GLUtessellatorImpl to construct tessellated geometric primitives with indexed vertex data.

The IndexedTessellator collects tessellated primitives in the form of IndexedPrimitive instances, where each instance represents a tessellated piece of geometry (such as triangles or polygons) along with the indices of the vertices used to define the geometry.

This class utilizes a customized GLUtessellatorCallback implementation to handle tessellation events. The supported callback methods include:

  • begin: Called at the start of a new geometric primitive definition.

  • vertexData: Processes vertex data during tessellation and stores indices into the current geometric primitive.

  • error: Raises an exception on tessellation errors with a human-readable GLU error message.

  • combine: Handles vertex combination in the tessellation process.

The tessellation callbacks are registered internally during the initialization of this class to handle specific stages of the tessellation process.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun callCombineOrCombineData(coords: DoubleArray?, vertexData: Array<Any?>?, weights: FloatArray?, outData: Array<Any?>?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun gluDeleteTess()

Deletes a previously created GLU tessellation object. This method should be called to free resources associated with the tessellator when it is no longer needed. After calling this, the tessellation object becomes invalid and should not be used.

Link copied to clipboard
open override fun gluEndPolygon()
Link copied to clipboard
open override fun gluGetTessProperty(which: Int, value: DoubleArray, value_offset: Int)

Retrieves the current value of a specified tessellation property. This method is used to query a property of the GLU tessellator.

Link copied to clipboard
open override fun gluNextContour(type: Int)
Link copied to clipboard
open override fun gluTessBeginContour()

Marks the beginning of a new contour within the current polygon being defined for tessellation in the GLU tessellator.

Link copied to clipboard
open override fun gluTessBeginPolygon(data: Any?)

Begins a new polygon definition for tessellation using the GLU tessellator. This method starts the specification of a polygon, which will be defined using vertices and may consist of multiple contours. The data parameter allows attaching custom application-specific data to the polygon, which can be retrieved during callback events.

Link copied to clipboard
open override fun gluTessCallback(which: Int, aCallback: GLUtessellatorCallback?)

Defines a callback function for the GLU tessellation object. The callback is associated with a specific tessellation event identified by the which parameter. This method allows users to specify behavior for various tessellation-related events such as errors, vertex processing, edge flags, and others.

Link copied to clipboard
open override fun gluTessEndContour()

Marks the end of the current contour being defined for tessellation in the GLU tessellator.

Link copied to clipboard
open override fun gluTessEndPolygon()

Completes the definition of the current polygon in the tessellation process.

Link copied to clipboard
open override fun gluTessNormal(x: Double, y: Double, z: Double)

Specifies the normal vector for the tessellation. This method is used to define a normal vector that provides a hint to the tessellator for the orientation of the following vertices. The normal vector can help determine which direction is "up" for planar tessellation.

Link copied to clipboard
open fun gluTessProperty(which: Int, value: Int)

Sets a tessellation property for the GLU tessellator using an integer value. This method internally converts the integer value to a double and delegates to the corresponding method that accepts a double value.

open override fun gluTessProperty(which: Int, value: Double)

Sets a tessellation property for the GLU tessellator. This method allows configuring various properties of the tessellator, such as winding rules, boundary-only settings, and tessellation tolerance.

Link copied to clipboard
open override fun gluTessVertex(coords: DoubleArray, coords_offset: Int, vertexData: Any?)

Defines a vertex for tessellation processing in the GLU tessellator. This method specifies a vertex using its coordinates and associates custom data with the vertex. The vertex will be processed as part of the tessellation operation.