Package toxi.geom.mesh2d
Class DelaunayTriangle
- All Implemented Interfaces:
- Iterable<DelaunayVertex>,- Collection<DelaunayVertex>,- Set<DelaunayVertex>
A DelaunayTriangle is an immutable Set of exactly three Pnts.
 
 All Set operations are available. Individual vertices can be accessed via
 iterator() and also via triangle.get(index).
 
 Note that, even if two triangles have the same vertex set, they are
 *different* triangles. Methods equals() and hashCode() are consistent with
 this rule.
- Author:
- Paul Chew Created December 2007. Replaced general simplices with geometric triangle.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionDelaunayTriangle(Collection<? extends DelaunayVertex> collection) DelaunayTriangle(DelaunayVertex... vertices) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanadd(DelaunayVertex vertex) booleanfacetOpposite(DelaunayVertex vertex) Report the facet opposite vertex.getVertexButNot(DelaunayVertex... badVertices) Get arbitrary vertex of this triangle, but not any of the bad vertices.inthashCode()booleanisNeighbor(DelaunayTriangle triangle) True iff triangles are neighbors.iterator()toString()Methods inherited from class toxi.util.datatypes.ArraySetcontainsAny, get, sizeMethods inherited from class java.util.AbstractSetremoveAllMethods inherited from class java.util.AbstractCollectionaddAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArrayMethods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
- 
Field Details- 
moreInfopublic static boolean moreInfo
 
- 
- 
Constructor Details- 
DelaunayTriangle- Parameters:
- collection- a Collection holding the Simplex vertices
- Throws:
- IllegalArgumentException- if there are not three distinct vertices
 
- 
DelaunayTriangle- Parameters:
- vertices- the vertices of the DelaunayTriangle.
- Throws:
- IllegalArgumentException- if there are not three distinct vertices
 
 
- 
- 
Method Details- 
add- Specified by:
- addin interface- Collection<DelaunayVertex>
- Specified by:
- addin interface- Set<DelaunayVertex>
- Overrides:
- addin class- ArraySet<DelaunayVertex>
 
- 
equals- Specified by:
- equalsin interface- Collection<DelaunayVertex>
- Specified by:
- equalsin interface- Set<DelaunayVertex>
- Overrides:
- equalsin class- AbstractSet<DelaunayVertex>
 
- 
facetOppositeReport the facet opposite vertex.- Parameters:
- vertex- a vertex of this DelaunayTriangle
- Returns:
- the facet opposite vertex
- Throws:
- IllegalArgumentException- if the vertex is not in triangle
 
- 
getCircumcenter- Returns:
- the triangle's circumcenter
 
- 
getVertexButNotGet arbitrary vertex of this triangle, but not any of the bad vertices.- Parameters:
- badVertices- one or more bad vertices
- Returns:
- a vertex of this triangle, but not one of the bad vertices
- Throws:
- NoSuchElementException- if no vertex found
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein interface- Collection<DelaunayVertex>
- Specified by:
- hashCodein interface- Set<DelaunayVertex>
- Overrides:
- hashCodein class- AbstractSet<DelaunayVertex>
 
- 
isNeighborTrue iff triangles are neighbors. Two triangles are neighbors if they share a facet.- Parameters:
- triangle- the other DelaunayTriangle
- Returns:
- true iff this DelaunayTriangle is a neighbor of triangle
 
- 
iterator- Specified by:
- iteratorin interface- Collection<DelaunayVertex>
- Specified by:
- iteratorin interface- Iterable<DelaunayVertex>
- Specified by:
- iteratorin interface- Set<DelaunayVertex>
- Overrides:
- iteratorin class- ArraySet<DelaunayVertex>
 
- 
toString- Overrides:
- toStringin class- AbstractCollection<DelaunayVertex>
 
 
-