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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptioncreates an empty cell, whose vertices and neighbors need to be specified later.TriangulationDSFace_2(TriangulationDSVertex_2<X> v0, TriangulationDSVertex_2<X> v1, TriangulationDSVertex_2<X> v2, TriangulationDSFace_2<X> c0, TriangulationDSFace_2<X> c1, TriangulationDSFace_2<X> c2) creates a face with vertices v0 through v2 and with neighbors c0 through c2. -
Method Summary
Modifier and TypeMethodDescriptionintcompares the face to another face using a clockwise order on their verticesbooleanchecks whether c is geometrically a neighbor of the face, that is, whether the two triangles share a common edge.booleanchecks whether c is a neighbor of the face.booleanchecks whether v is a vertex of the cell.booleanchecks whether x is a point associated with a vertex of the face.intreturns the index of the neighboring face c, and throws an Error if c is no neighbor of the face.intreturns the index of vertex v in the cell, and throws an Error if v is no vertex of the cell.intreturns 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.voidinvertMark(int index) inverts the mark of the index-th edgebooleanisMarked(int index) returns the mark of the index-th edgevoidmark(int index) sets the mark of the index-th edgeneighbor(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.voidsetNeighbor(int i, TriangulationDSFace_2<X> c) sets the i-th neighbor of the cell to be c (0invalid input: '<'=iinvalid input: '<'3).voidsetVertex(int i, TriangulationDSVertex_2<X> v) sets the i-th vertex of the cell to be v (0invalid input: '<'=iinvalid input: '<'3).toString()generates a string listing the coordinates of the vertices of the face.voidunmark(int index) unsets the mark of the index-th edgevertex(int i) returns a pointer to the i-th vertex of the triangle (0invalid input: '<'=iinvalid input: '<'3).Point_[]returns an array containing the geometric points associated with the vertices of the triangle
-
Field Details
-
neighbors
-
vertices
-
cMarks
-
tag
public int tag -
index
public int index
-
-
Constructor Details
-
TriangulationDSFace_2
public TriangulationDSFace_2()creates an empty cell, whose vertices and neighbors need to be specified later. -
TriangulationDSFace_2
public TriangulationDSFace_2(TriangulationDSVertex_2<X> v0, TriangulationDSVertex_2<X> v1, TriangulationDSVertex_2<X> v2, TriangulationDSFace_2<X> c0, TriangulationDSFace_2<X> c1, TriangulationDSFace_2<X> c2) creates a face with vertices v0 through v2 and with neighbors c0 through c2. Each ci is opposite to vi.
-
-
Method Details
-
vertex
returns a pointer to the i-th vertex of the triangle (0invalid input: '<'=iinvalid input: '<'3). -
verticesPoints
returns an array containing the geometric points associated with the vertices of the triangle -
neighbor
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
sets the i-th vertex of the cell to be v (0invalid input: '<'=iinvalid input: '<'3). -
setNeighbor
sets the i-th neighbor of the cell to be c (0invalid input: '<'=iinvalid input: '<'3). -
index
returns the index of vertex v in the cell, and throws an Error if v is no vertex of the cell. -
index
returns the index of the neighboring face c, and throws an Error if c is no neighbor of the face. -
hasVertex
checks whether v is a vertex of the cell. -
hasVertex
checks whether x is a point associated with a vertex of the face. -
index
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
checks whether c is a neighbor of the face. -
hasGeometricNeighbor
checks whether c is geometrically a neighbor of the face, that is, whether the two triangles share a common edge. -
toString
-
compareTo
compares the face to another face using a clockwise order on their vertices- Specified by:
compareToin interfaceComparable<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
-