public class VoronoiFace extends BaseVoronoiFace
Edges, FaceArea, FaceCenter, FaceDistance, FaceNormal, FacePlane, InsideAtom, OutsideAtom, Vertices
Constructor and Description |
---|
VoronoiFace(Atom insideAtom,
AtomImage outsideAtom,
boolean radical)
Create a blank Voronoi face associated with a neighboring atom.
|
Modifier and Type | Method and Description |
---|---|
boolean |
assembleFaceFromEdges(java.util.List<BaseVoronoiEdge> availableEdges)
Given list of edges, assemble face.
|
boolean |
assembleFaceFromFaces(java.util.Collection<VoronoiFace> faces)
Given a list of faces that will intersect this face, construct the edges.
|
VoronoiEdge |
computeIntersection(VoronoiFace newFace)
Compute intersection between this face and a new face.
|
protected void |
computeVertices()
Recompute vertices.
|
boolean |
containsVertex(VoronoiVertex vertex)
Check whether face contains vertex
|
double |
getCutLength(VoronoiFace newFace)
Compute length of new edge created by intersection.
|
boolean |
isClosed()
Test whether the edges form a closed face.
|
boolean |
isCompletelyOutside(VoronoiFace otherFace)
Compute whether this face is completely outside of this one
|
boolean |
isContactedBy(VoronoiFace otherFace)
Check whether this face is contacted by another face.
|
boolean |
isIntersectedBy(VoronoiFace otherFace)
Compute whether another face intersects this one.
|
void |
resetEdges(java.util.List<BaseVoronoiEdge> edges)
Reset edges to a previous state.
|
compareTo, equals, getArea, getCentroid, getCommonVertices, getEdges, getFaceCenter, getFaceDistance, getInsideAtom, getNeighborDistance, getNeighboringFaces, getNormal, getOutsideAtom, getPlane, getPlaneDistance, getVertexIterator, getVertices, hashCode, NEdges, nVertices, positionRelativeToFace, toString
public VoronoiFace(Atom insideAtom, AtomImage outsideAtom, boolean radical) throws java.lang.Exception
insideAtom
- Atom "inside" this faceoutsideAtom;
- Image of atom "outside" this faceradical
- Whether this face is in a radical plane tessellationjava.lang.Exception
public boolean assembleFaceFromFaces(java.util.Collection<VoronoiFace> faces) throws java.lang.Exception
faces
- [in] Other facesjava.lang.Exception
public VoronoiEdge computeIntersection(VoronoiFace newFace) throws java.lang.Exception
Special case: If a current edge of this face is completely on the new face (i.e., both vertices are on the face), that edge will be replaced with a new edge that is the result of the intersection between the new face and this face.
newFace
- Face in considerationjava.lang.Exception
VoronoiEdge.generatePair()
public void resetEdges(java.util.List<BaseVoronoiEdge> edges)
edges
- Previous list of edgesVoronoiCell#computeIntersection(vassal.analysis.voronoi.VoronoiFace)
public boolean assembleFaceFromEdges(java.util.List<BaseVoronoiEdge> availableEdges) throws java.lang.Exception
availableEdges
- List of available edgesjava.lang.Exception
- If face assembly failsprotected void computeVertices() throws java.lang.Exception
java.lang.Exception
public double getCutLength(VoronoiFace newFace)
newFace
- Face intersecting with this onepublic boolean isIntersectedBy(VoronoiFace otherFace)
otherFace
- Face of interestpublic boolean isContactedBy(VoronoiFace otherFace)
otherFace
- Face of interestpublic boolean isCompletelyOutside(VoronoiFace otherFace)
otherFace
- Face of interestpublic boolean containsVertex(VoronoiVertex vertex)
vertex
- Vertex in questionpublic boolean isClosed()
BaseVoronoiFace
isClosed
in class BaseVoronoiFace