org.critterai.nmgen
Class Contour

java.lang.Object
  extended by org.critterai.nmgen.Contour

public final class Contour
extends Object

Represents the detailed and simplified versions of a contour. A contour is expected to always represent a simple polygon. (Convex or concave.)

See Also:
ContourSetBuilder

Field Summary
 int rawVertCount
          The raw vertex count.
 int[] rawVerts
          The vertices which represent the raw (or detailed) contour.
 int regionID
          The region associated with the contour.
 int vertCount
          The detail vertex count.
 int[] verts
          The vertices which represent the simplified contour.
 
Constructor Summary
Contour(int regionID, ArrayList<Integer> rawList, ArrayList<Integer> vertList)
          Constructor
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regionID

public final int regionID
The region associated with the contour.


rawVerts

public final int[] rawVerts
The vertices which represent the raw (or detailed) contour.

Vertices are clockwise wrapped in the form (x, y, z, regionID), where regionID is the external region the vertex is considered to be connected to.


rawVertCount

public final int rawVertCount
The raw vertex count. (A convenience value.)


verts

public final int[] verts
The vertices which represent the simplified contour.

Vertices are clockwise wrapped in the form (x, y, z, regionID), where regionID is the external region the vertex is considered to be connected to.


vertCount

public final int vertCount
The detail vertex count. (A convenience value.)

Constructor Detail

Contour

public Contour(int regionID,
               ArrayList<Integer> rawList,
               ArrayList<Integer> vertList)
        throws IllegalArgumentException
Constructor

All vertex lists are expected to be clockwise wrapped in the form (x, y, z, regionID), where regionID is the external region the vertex is considered to be connected to.

Parameters:
regionID - The region associated with the contour.
rawList - The vertices which represent the raw (or detailed) contour.
vertList - The vertices which represent the detailed contour.
Throws:
IllegalArgumentException - If either vertex list is null. The size of the vertex lists is not checked.


Project Home and Source Code

Copyright 2010 Stephen Pratt. All rights reserved. Use is subject to license terms.