org.openjump.core.graph.delauneySimplexInsert
Class Triangulation

java.lang.Object
  extended by org.openjump.core.graph.delauneySimplexInsert.Triangulation
Direct Known Subclasses:
DelaunayTriangulation

public class Triangulation
extends java.lang.Object

A Triangulation on vertices (generic type V). A Triangulation is a set of Simplices (see Simplex below). For efficiency, we keep track of the neighbors of each Simplex. Two Simplices are neighbors of they share a facet.

Author:
Paul Chew Created July 2005. Derived from an earlier, messier version.

Constructor Summary
Triangulation(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
          Constructor.
 
Method Summary
 boolean contains(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
          True iff the simplex is in this Triangulation.
 java.util.Iterator iterator()
          Iterator.
 org.openjump.core.graph.delauneySimplexInsert.Simplex neighborOpposite(java.lang.Object vertex, org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
          Report neighbor opposite the given vertex of simplex.
 java.util.Set neighbors(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
          Report neighbors of the given simplex.
 void printStuff()
          Print stuff about a Triangulation.
 int size()
          Size (# of Simplices) in Triangulation.
 java.lang.String toString()
          String representation.
 void update(java.util.Set oldSet, java.util.Set newSet)
          Update by replacing one set of Simplices with another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Triangulation

public Triangulation(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
Constructor.

Parameters:
simplex - the initial Simplex.
Method Detail

toString

public java.lang.String toString()
String representation. Shows number of simplices currently in the Triangulation.

Overrides:
toString in class java.lang.Object
Returns:
a String representing the Triangulation

size

public int size()
Size (# of Simplices) in Triangulation.

Returns:
the number of Simplices in this Triangulation

contains

public boolean contains(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
True iff the simplex is in this Triangulation.

Parameters:
simplex - the simplex to check
Returns:
true iff the simplex is in this Triangulation

iterator

public java.util.Iterator iterator()
Iterator.

Returns:
an iterator for every Simplex in the Triangulation

printStuff

public void printStuff()
Print stuff about a Triangulation. Used for debugging.


neighborOpposite

public org.openjump.core.graph.delauneySimplexInsert.Simplex neighborOpposite(java.lang.Object vertex,
                                                                              org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
Report neighbor opposite the given vertex of simplex.

Parameters:
vertex - a vertex of simplex
simplex - we want the neighbor of this Simplex
Returns:
the neighbor opposite vertex of simplex; null if none
Throws:
java.lang.IllegalArgumentException - if vertex is not in this Simplex

neighbors

public java.util.Set neighbors(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
Report neighbors of the given simplex.

Parameters:
simplex - a Simplex
Returns:
the Set of neighbors of simplex

update

public void update(java.util.Set oldSet,
                   java.util.Set newSet)
Update by replacing one set of Simplices with another. Both sets of simplices must fill the same "hole" in the Triangulation.

Parameters:
oldSet - set of Simplices to be replaced
newSet - set of replacement Simplices