org.gicentre.utils.geom
Class ConvexHull

java.lang.Object
  extended by org.gicentre.utils.geom.ConvexHull

public class ConvexHull
extends java.lang.Object

Class for representing and building a convex hull around a set of point values.

Version:
3.3, 1st August, 2011.
Author:
Jo Wood, giCentre, City University London.

Constructor Summary
ConvexHull(java.util.Collection<processing.core.PVector> points)
          Creates a convex hull from the given collection of point values.
 
Method Summary
 void addPoint(processing.core.PVector point)
          Adds a given point to the collection from which the hull is to be constructed.
 java.util.ArrayList<processing.core.PVector> getHull()
          Provides the convex hull that surrounds the collection of points stored in this object.
static java.util.ArrayList<processing.core.PVector> getHull(java.util.Collection<processing.core.PVector> points)
          Calculates the convex hull from the given collection of point values.
 boolean removePoint(processing.core.PVector point)
          Removes a given point from the collection from which the hull is to be constructed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvexHull

public ConvexHull(java.util.Collection<processing.core.PVector> points)
Creates a convex hull from the given collection of point values.

Parameters:
points - Points around which the convex hull is created.
Method Detail

getHull

public static java.util.ArrayList<processing.core.PVector> getHull(java.util.Collection<processing.core.PVector> points)
Calculates the convex hull from the given collection of point values.

Parameters:
points - Points around which the convex hull is created.
Returns:
Ordered list of points representing the convex hull.

getHull

public java.util.ArrayList<processing.core.PVector> getHull()
Provides the convex hull that surrounds the collection of points stored in this object.

Returns:
Ordered list of points representing the convex hull.

addPoint

public void addPoint(processing.core.PVector point)
Adds a given point to the collection from which the hull is to be constructed.

Parameters:
point - Point to add.

removePoint

public boolean removePoint(processing.core.PVector point)
Removes a given point from the collection from which the hull is to be constructed.

Parameters:
point - Point to remove.
Returns:
True if the point was found and removed.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013