support.convexhull
Interface ConvexHull

All Known Implementing Classes:
MyHull

public interface ConvexHull

This is the top level interface for an implementation of the "online" convexhull algorithm. This interface defines callbacks that are provided by the GUI.


Method Summary
 Iterator<Entry<Integer,HullPoint>> bottomChain()
          Get an Iterator containing all Entry<Integer, HullPoint> in the bottom chain of the hull.
 void clear()
          When the user clicks on the "Clear" button the HullHelper class will call this method.
 void insert(HullPoint vertex)
          This method will be called by the HullHelper when a user clicks on the screen to add a vertex.
 Iterator<Entry<Integer,HullPoint>> topChain()
          Get an Iterator containing all Entry<Integer, HullPoint> in the top chain of the hull.
 

Method Detail

insert

void insert(HullPoint vertex)
This method will be called by the HullHelper when a user clicks on the screen to add a vertex. When the GUI calls this method, the ConvexHull should decide if the new vertex should be on the hull or not. If the new point is on the hull, the ConvexHull should add it to the hull, and then adjust the hull so that it is now convex. The point is guaranteed to be in the "off" hull state.

DO NOT CALL THIS METHOD EXPLICITLY!

Parameters:
vertex - the newly created vertex resulting from a user click.

clear

void clear()
When the user clicks on the "Clear" button the HullHelper class will call this method. The GUI will hide all of the points and erase all of the lines. The ConvexHull should reset its internal state.

DO NOT CALL THIS METHOD EXPLICITLY!


topChain

Iterator<Entry<Integer,HullPoint>> topChain()
Get an Iterator containing all Entry<Integer, HullPoint> in the top chain of the hull.

Returns:
Iterator of points in upper half

bottomChain

Iterator<Entry<Integer,HullPoint>> bottomChain()
Get an Iterator containing all Entry<Integer, HullPoint> in the bottom chain of the hull.

Returns:
Iterator of points in lower half