Class TriangulationDSFace_2<X extends Point_>

java.lang.Object
Jcg.triangulations2D.TriangulationDSFace_2<X>
All Implemented Interfaces:
Comparable<TriangulationDSFace_2<X>>

public class TriangulationDSFace_2<X extends Point_> extends Object implements Comparable<TriangulationDSFace_2<X>>
The class used to encode a face of a triangulation. Each cell stores pointers to its three vertices as well as to its four neighboring faces. The vertices and neighbors are indexed 0, 1, and 2. Neighbor i lies opposite to vertex i. By convention, edge i is the intersection of the face and of neighbor i, therefore it also lies opposite to vertex i.
Author:
Luca Castelli Aleardi and Steve Oudot
  • Field Details

  • Constructor Details

  • Method Details

    • vertex

      public TriangulationDSVertex_2<X> vertex(int i)
      returns a pointer to the i-th vertex of the triangle (0invalid input: '<'=iinvalid input: '<'3).
    • verticesPoints

      public Point_[] verticesPoints()
      returns an array containing the geometric points associated with the vertices of the triangle
    • neighbor

      public TriangulationDSFace_2<X> neighbor(int i)
      returns a pointer to the i-th neighbor of the cell (0invalid input: '<'=iinvalid input: '<'3), which is by definition the one opposite to the i-th vertex of the cell.
    • setVertex

      public void setVertex(int i, TriangulationDSVertex_2<X> v)
      sets the i-th vertex of the cell to be v (0invalid input: '<'=iinvalid input: '<'3).
    • setNeighbor

      public void setNeighbor(int i, TriangulationDSFace_2<X> c)
      sets the i-th neighbor of the cell to be c (0invalid input: '<'=iinvalid input: '<'3).
    • index

      public int index(TriangulationDSVertex_2<X> v)
      returns the index of vertex v in the cell, and throws an Error if v is no vertex of the cell.
    • index

      public int index(TriangulationDSFace_2<X> c)
      returns the index of the neighboring face c, and throws an Error if c is no neighbor of the face.
    • hasVertex

      public boolean hasVertex(TriangulationDSVertex_2<X> v)
      checks whether v is a vertex of the cell.
    • hasVertex

      public boolean hasVertex(X x)
      checks whether x is a point associated with a vertex of the face.
    • index

      public int index(X x)
      returns the index of the vertex of the face associated with x, and throws an Error if x is associated with no vertex of the face.
    • hasNeighbor

      public boolean hasNeighbor(TriangulationDSFace_2<X> c)
      checks whether c is a neighbor of the face.
    • hasGeometricNeighbor

      public boolean hasGeometricNeighbor(TriangulationDSFace_2<X> c)
      checks whether c is geometrically a neighbor of the face, that is, whether the two triangles share a common edge.
    • toString

      public String toString()
      generates a string listing the coordinates of the vertices of the face.
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(TriangulationDSFace_2<X> f)
      compares the face to another face using a clockwise order on their vertices
      Specified by:
      compareTo in interface Comparable<X extends Point_>
    • isMarked

      public boolean isMarked(int index)
      returns the mark of the index-th edge
    • mark

      public void mark(int index)
      sets the mark of the index-th edge
    • unmark

      public void unmark(int index)
      unsets the mark of the index-th edge
    • invertMark

      public void invertMark(int index)
      inverts the mark of the index-th edge