IDLgrTessellator

A tessellator object converts a simple concave polygon (or a simple polygon with "holes") into a number of simple convex polygons (general triangles). A polygon is simple if it includes no duplicate vertices, if the edges intersect only at vertices, and exactly two edges meet at any vertex.

Each polygon can be marked as being either an interior or an exterior (default) polygon. Interior polygons are treated as holes in the exterior polygons. Multiple non-overlapping exterior polygons are allowed as well. All polygons should be specified in the same orientation (either clockwise or counter-clockwise). Once all the polygons have been passed into the tessellator object, the final triangulation is accomplished by the IDLgrTessellator::Tessellate method. A list of vertices and a connectivity array are returned. You may process these by hand, or pass them to an IDLgrPolygon object. The tessellator object will not create any vertices in the process, rather the output vertex list will include only those vertices passed into the object originally.

Superclasses

This class has no superclasses.

Subclasses

This class has no subclasses.

Creation

See IDLgrTessellator::Init

Methods

Intrinsic Methods

This class has the following methods:


IDLgrTessellator::AddPolygon

The IDLgrTessellator:: AddPolygon procedure method adds a polygon to the tessellator object. IDLgrTessellator is described above.

Calling Sequence

Obj -> [IDLgrTessellator::] AddPolygon [, X[, Y[, Z]]

Arguments

X

A 1 x n , 2 x n , or 3 x n array of polygon vertices.

Y

A vector of Y values. If X and Y are both specified, they must be one-dimensional vectors of the same length.

Z

A vector of Z values. If X , Y , and Z are all specified, they must all three be one-dimensional vectors of the same length. If no Z values are specified, the Z value for the polygon is set to 0.

Keywords

POLYGON (Get, Set)

Set this keyword to an array of polygon descriptions. A polygon description is an integer or longword array of the form: [ n , i 0 , i 1 , ..., i n-1 ], where n is the number of vertices that define the polygon, and i 0 ..i n -1 are indices into the X , Y , and Z arguments that represent the polygon vertices. To ignore an entry in the POLYGON array, set the vertex count, n , to 0. To end the drawing list, even if additional array space is available, set n to -1. If this keyword is not specified, a single polygon will be generated.

INTERIOR

Set this keyword to set a polygon to be an interior polygon, which is treated as a hole in the exterior polygons.


IDLgrTessellator::Cleanup

The IDLgrTessellator:: Cleanup procedure method performs all cleanup on the object. IDLgrTessellator is described above.

Calling Sequence

OBJ_DESTROY, Obj

or

Obj -> [IDLgrTessellator::] Cleanup                              ( In a subclass' Cleanup method only .)

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrTessellator::Init

The IDLgrTessellator:: Init function method initializes the tessellator object. IDLgrTessellator is described above.

Calling Sequence

Obj = OBJ_NEW('IDLgrTesselator')

or

Result = Obj -> [IDLgrTessellator::] Init( )         ( In a subclass' Init method only .)

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrTessellator::Reset

The IDLgrTessellator:: Reset procedure method resets the object's internal state. All previously added polygons are removed from memory and the object is prepared for a new tessellation task. IDLgrTessellator is described above.

Calling Sequence

Obj -> [IDLgrTessellator::] Reset

Arguments

There are no arguments for this method.

Keywords

There are no keywords for this method.


IDLgrTessellator::Tessellate

The IDLgrTessellator:: Tessellate function method performs the actual tessellation. IDLgrTessellator is described above.

Calling Sequence

Obj -> [IDLgrTessellator::] Tessellate( Vertices, Poly )

Arguments

If the tessellation succeeds, IDLgrTessellator::Tessellate returns 1 and the contents of Vertices and Poly are set to the results of the tessellation. If the tessellation fails, the function returns 0.

Vertices

A 2 x n array if all the input polygons were 2D. A 3 x n array if all the input polygons were 3D.

Poly

An array of polygon descriptions. A polygon description is an integer or longword array of the form: [ n , i 0 , i 1 , ..., i n-1 ], where n is the number of vertices that define the polygon, and i 0 ..i n -1 are indices into the X , Y , and Z arguments that represent the polygon vertices.

Keywords

There are no keywords for this method.