# NeatTriangulator (Slick - The 2D Library)
Date: 2013-06-03

## org.newdawn.slick.geom
Class NeatTriangulator

    java.lang.Object
      org.newdawn.slick.geom.NeatTriangulator

All Implemented Interfaces:
  java.io.Serializable, Triangulator

    public class NeatTriangulator

extends java.lang.Object
implements Triangulator

A second triangulator that seems slightly more robust

Author:
  Online examples
See Also:
  Serialized Form

Constructor Summary
`NeatTriangulator()` Create a new triangulator

Method Summary
`void` `addPolyPoint(float x, float y)` Add a point to the polygon
`void` `basicTriangulation()` Perform simple triangulation
`void` `clear()` Clear the triangulator status
`int` `getTriangleCount()` Get a count of the number of triangles produced
`float[]` `getTrianglePoint(int tri, int i)` Get a point on a specified generated triangle
`void` `startHole()` Start a hole in the polygon
`boolean` `triangulate()` Upate the triangles

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### NeatTriangulator

    public NeatTriangulator()

  Create a new triangulator

Method Detail

### clear

    public void clear()

  Clear the triangulator status

### basicTriangulation

    public void basicTriangulation()
                            throws org.newdawn.slick.geom.NeatTriangulator.InternalException

  Perform simple triangulation

  Throws:
    `InternalException` - Indicates a polygon that can't be triangulated
    `org.newdawn.slick.geom.NeatTriangulator.InternalException`

### triangulate

    public boolean triangulate()

  Upate the triangles

  Specified by:
    `triangulate` in interface `Triangulator`
  Returns:
    True if successful

### addPolyPoint

    public void addPolyPoint(float x,
                             float y)

  Add a point to the polygon

  Specified by:
    `addPolyPoint` in interface `Triangulator`
  Parameters:
    `x` - The x coordinate of the point
    `y` - The y coordiante of the point

### getTriangleCount

    public int getTriangleCount()

  Description copied from interface: `Triangulator`
  Get a count of the number of triangles produced

  Specified by:
    `getTriangleCount` in interface `Triangulator`
  Returns:
    The number of triangles produced
  See Also:
    `Triangulator.getTriangleCount()`

### getTrianglePoint

    public float[] getTrianglePoint(int tri,
                                    int i)

  Description copied from interface: `Triangulator`
  Get a point on a specified generated triangle

  Specified by:
    `getTrianglePoint` in interface `Triangulator`
  Parameters:
    `tri` - The index of the triangle to interegate
    `i` - The index of the point within the triangle to retrieve (0 - 2)
  Returns:
    The x,y coordinate pair for the point
  See Also:
    `Triangulator.getTrianglePoint(int, int)`

### startHole

    public void startHole()

  Description copied from interface: `Triangulator`
  Start a hole in the polygon

  Specified by:
    `startHole` in interface `Triangulator`
  See Also:
    `Triangulator.startHole()`

Copyright © 2006 New Dawn Software. All Rights Reserved.