View Javadoc
1   package org.newdawn.slick.geom;
2   
3   import java.io.Serializable;
4   
5   /**
6    * A collection of triangles
7    *
8    * @author kevin
9    */
10  public interface Triangulator extends Serializable {
11  
12      /**
13       * Get a count of the number of triangles produced
14       *
15       * @return The number of triangles produced
16       */
17      public int getTriangleCount();
18  
19      /**
20       * Get a point on a specified generated triangle
21       *
22       * @param tri The index of the triangle to interegate
23       * @param i The index of the point within the triangle to retrieve
24       * (0 - 2)
25       * @return The x,y coordinate pair for the point
26       */
27      public float[] getTrianglePoint(int tri, int i);
28  
29      /**
30       * Add a point that forms part of the outer polygon
31       *
32       * @param x The x coordinate of the point
33       * @param y The y coordiante of the point
34       */
35      public void addPolyPoint(float x, float y);
36  
37      /**
38       * Start a hole in the polygon
39       */
40      public void startHole();
41  
42      /**
43       * Run the triangulation
44       *
45       * @return True if successful
46       */
47      public boolean triangulate();
48  }