org.critterai.nmgen
Class ContourSet

java.lang.Object
  extended by org.critterai.nmgen.BoundedField
      extended by org.critterai.nmgen.ContourSet

public final class ContourSet
extends BoundedField

Represents a set of related contours (simple polygons) within a bounded field.

The contours may be connected (share edges), but are expected to not intersect.

See Also:
Contour

Method Summary
 void add(Contour contour)
          Add a contour to the set.
 Contour get(int index)
          Gets the contour specified by the index.
 int size()
          The number of contours in the set.
 
Methods inherited from class org.critterai.nmgen.BoundedField
boundsMax, boundsMin, cellHeight, cellSize, depth, getDirOffsetDepth, getDirOffsetWidth, gridIndex, isInBounds, overlaps, resetBounds, resetCellInfo, setBounds, setBounds, setBoundsMax, setBoundsMin, setCellHeight, setCellSize, width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(Contour contour)
Add a contour to the set.

Behavior is undefined if the contour argument is null.

Parameters:
contour - The contour to add to the set.

get

public Contour get(int index)
Gets the contour specified by the index.

Parameters:
index - The index of the contour to retrieve.
Returns:
The contour for the specified index, or null if the index is invalid.

size

public int size()
The number of contours in the set.

Returns:
The number of contours in the set.


Project Home and Source Code

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