public class QuadEdge extends Object implements IQuadEdge
This concept is based on the structure popularized by Guibas, L. and Stolfi, J. (1985) "Primitives for the manipulation of subdivisions and the computation of Voronoi diagrams" ACM Transactions on Graphics, 4(2), 1985, p. 75-123.
| Constructor and Description |
|---|
QuadEdge(int index)
Construct the edge and its dual assigning the pair the specified index.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Sets all vertices and link references to null (the link to a dual
is not affected).
|
boolean |
equals(Object o)
An implementation of the equals method which check for a matching
reference.
|
Vertex |
getA()
Gets the initial vertex for this edge.
|
Vertex |
getB()
Gets the second vertex for this edge.
|
QuadEdge |
getBaseReference()
Gets the reference to the side-zero edge of the pair.
|
int |
getConstraintIndex()
Gets the index of the constraint associated with this edge.
|
QuadEdge |
getDual()
Gets the dual edge to this instance.
|
QuadEdge |
getDualFromReverse()
Gets the dual of the reverse link.
|
QuadEdge |
getForward()
Gets the forward reference of the edge.
|
QuadEdge |
getForwardFromDual()
Gets the forward reference of the dual.
|
int |
getIndex()
Gets the index value for this edge.
|
double |
getLength()
Gets the length of the edge.
|
QuadEdge |
getReverse()
Gets the reverse reference of the edge.
|
QuadEdge |
getReverseFromDual()
Gets the reverse link of the dual.
|
int |
getSide()
Indicates which side of an edge a particular QuadEdge instance is
attached to.
|
int |
hashCode() |
boolean |
isConstrained()
Gets the index of the constrain associated with
|
boolean |
isConstrainedRegionBorder()
Indicates whether an edge represents the border of a constrained
region.
|
boolean |
isConstrainedRegionInterior()
Indicates whether the edge is in the interior of a constrained region.
|
boolean |
isConstrainedRegionMember()
Indicates whether the edge is a member of a constrained region
(is in the interior or serves as the border of a polygon-based constraint).
|
boolean |
isSynthetic()
Indicates whether the synthetic flag is set for the edge.
|
Iterable<IQuadEdge> |
pinwheel()
Gets an instance of an iterable that performs a pinwheel operation.
|
void |
setA(Vertex a)
Sets the initial vertex for this edge.
|
void |
setB(Vertex b)
Sets the second (B) vertex for this edge (also the A reference of
the dual edge).
|
void |
setConstrained(int constraintIndex)
Sets an edge as constrained and sets its constraint index.
|
void |
setConstrainedRegionBorderFlag()
Sets a flag indicating that the edge is an edge of a constrained region.
|
void |
setConstrainedRegionInteriorFlag()
Sets the constrained region membership flag for the edge to true.
|
void |
setConstraintIndex(int constraintIndex)
Sets the constraint index for this edge.
|
void |
setDualForward(QuadEdge e)
Sets the forward link to the dual of this edge.
|
void |
setDualReverse(QuadEdge e)
Sets the reverse link of the dual to this edge.
|
void |
setForward(QuadEdge e)
Sets the forward reference for this edge.
|
protected void |
setIndex(int index)
Sets the index value for this edge.
|
void |
setReverse(QuadEdge e)
Sets the reverse reference for this edge.
|
void |
setSynthetic(boolean status)
Sets the synthetic flag for the edge.
|
void |
setVertices(Vertex a,
Vertex b)
Sets the vertices for this edge (and its dual).
|
String |
toString() |
public QuadEdge(int index)
index - an arbitrary integer value.public void setVertices(Vertex a, Vertex b)
a - the initial vertex, must be a valid reference.b - the second vertex, may be a valid reference or a
null for a ghost edge.public final Vertex getA()
public final void setA(Vertex a)
a - a valid reference.public final Vertex getB()
public final void setB(Vertex b)
b - a valid reference or a null for a ghost edge.public final QuadEdge getForward()
getForward in interface IQuadEdgepublic final QuadEdge getReverse()
getReverse in interface IQuadEdgepublic final QuadEdge getForwardFromDual()
getForwardFromDual in interface IQuadEdgepublic final QuadEdge getReverseFromDual()
getReverseFromDual in interface IQuadEdgepublic final QuadEdge getDualFromReverse()
getDualFromReverse in interface IQuadEdgepublic final void setForward(QuadEdge e)
e - a valid referencepublic final void setReverse(QuadEdge e)
e - a valid referencepublic final void setDualForward(QuadEdge e)
e - a valid referencepublic final void setDualReverse(QuadEdge e)
e - a valid referencepublic final QuadEdge getDual()
public int getIndex()
protected void setIndex(int index)
index - an integer valuepublic QuadEdge getBaseReference()
getBaseReference in interface IQuadEdgepublic int getConstraintIndex()
getConstraintIndex in interface IQuadEdgepublic void setConstraintIndex(int constraintIndex)
IQuadEdgesetConstraintIndex in interface IQuadEdgeconstraintIndex - a positive number indicating which constraint
a particular edge is associated with.public boolean isConstrained()
isConstrained in interface IQuadEdgepublic void setConstrained(int constraintIndex)
IQuadEdgesetConstrained in interface IQuadEdgeconstraintIndex - positive number indicating which constraint
a particular edge is associated with.public void clear()
public double getLength()
public int getSide()
public boolean equals(Object o)
public boolean isConstrainedRegionMember()
IQuadEdgeisConstrainedRegionMember in interface IQuadEdgepublic boolean isConstrainedRegionInterior()
IQuadEdgeisConstrainedRegionInterior in interface IQuadEdgepublic boolean isConstrainedRegionBorder()
IQuadEdgeisConstrainedRegionBorder in interface IQuadEdgepublic void setConstrainedRegionBorderFlag()
IQuadEdgesetConstrainedRegionBorderFlag in interface IQuadEdgepublic void setConstrainedRegionInteriorFlag()
IQuadEdgesetConstrainedRegionInteriorFlag in interface IQuadEdgepublic void setSynthetic(boolean status)
IQuadEdgesetSynthetic in interface IQuadEdgestatus - true if the edge is synthetic; otherwise, false.public boolean isSynthetic()
IQuadEdgeisSynthetic in interface IQuadEdgeCopyright © 2019. All rights reserved.