Class Triangulation

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

public class Triangulation extends 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

    Constructors
    Constructor
    Description
    Triangulation(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
    True iff the simplex is in this Triangulation.
    Iterator.
    org.openjump.core.graph.delauneySimplexInsert.Simplex
    neighborOpposite(Object vertex, org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
    Report neighbor opposite the given vertex of simplex.
    neighbors(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
    Report neighbors of the given simplex.
    void
    Print stuff about a Triangulation.
    int
    Size (# of Simplices) in Triangulation.
    String representation.
    void
    update(Set oldSet, Set newSet)
    Update by replacing one set of Simplices with another.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Triangulation

      public Triangulation(org.openjump.core.graph.delauneySimplexInsert.Simplex simplex)
      Constructor.
      Parameters:
      simplex - the initial Simplex.
  • Method Details

    • toString

      public String toString()
      String representation. Shows number of simplices currently in the Triangulation.
      Overrides:
      toString in class 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 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(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:
      IllegalArgumentException - if vertex is not in this Simplex
    • neighbors

      public 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(Set oldSet, 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