Class HalfedgeHandle<X extends Point_>

java.lang.Object
Jcg.triangulations2D.HalfedgeHandle<X>

public class HalfedgeHandle<X extends Point_> extends Object
A dummy class used to represent a triangulation edge as a pair (TriangulationDSFace_2, int). The integer parameter is the index of the vertex opposite to the edge in the triangle. Note that no edge is explicitly stored in the triangulation data structure, as this information is redundant with the one provided by the faces themselves and their vertices.
Author:
Luca Castelli Aleardi
  • Field Details

  • Constructor Details

  • Method Details

    • getFace

      public TriangulationDSFace_2<X> getFace()
      returns the face containing the half-edge.
    • getVertex

      public TriangulationDSVertex_2<X> getVertex()
      returns the (destination) vertex incident the half-edge.
    • getSource

      public TriangulationDSVertex_2<X> getSource()
      returns the source vertex incident to the half-edge.
    • getNext

      public HalfedgeHandle<X> getNext()
      returns next half-edge in ccw order in the same face.
    • getPrev

      public HalfedgeHandle<X> getPrev()
      returns the previous half-edge in ccw order in the same face.
    • getOpposite

      public HalfedgeHandle<X> getOpposite()
      returns opposite half-edge (lying in the adjacent face).
    • getVertex

      public TriangulationDSVertex_2<X> getVertex(int index)
      returns the vertex of prescribed index in the edge: 0 for origin, 1 for destination
    • index

      public int index()
      returns the index of the vertex opposite of the current edge in the corresponding incident face.
    • hasVertex

      public boolean hasVertex(TriangulationDSVertex_2<X> v)
      returns whether the current edge has v as vertex.
    • index

      public int index(TriangulationDSVertex_2<X> v)
      returns the index of v in the current edge. The pre-requisite is that v must be a vertex of the edge.
    • equals

      public boolean equals(Object o)
      tests equality between EdgeHandles, which is defined by equality of their vertices.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      provides a hashing index for a EdgeHandle, based on the hashing indices of its vertices.
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isMarked

      public boolean isMarked()
      returns the mark of the edge
    • mark

      public void mark()
      sets the mark of the edge (the mark of the opposite edge remains unchanged)
    • unmark

      public void unmark()
      unsets the mark of the edge (the mark of the opposite edge remains unchanged)
    • invertMark

      public void invertMark()
      inverts the mark of the edge (the mark of the opposite edge remains unchanged)
    • setMark

      public void setMark(boolean m)
      sets the mark of the edge (the mark of the opposite edge remains unchanged)