|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.dillenco.simplegraph01.HalfEdge
public class HalfEdge
A HalfEdge
object represents a half-edge, which consists
of a QEdge (in the sense of the Guibas-Stolfi quadedge structure),
a rotation (0 thru 3), and a flip coefficient (0 or 1)
Constructor Summary | |
---|---|
HalfEdge(HalfEdge h)
Constructs a HalfEdge, taking its QEdge, rotation, and flip coefficients from the input parameter. |
|
HalfEdge(QEdge e,
int rot)
Constructs a HalfEdge from the given QEdge and rotation coefficients. |
|
HalfEdge(QEdge e,
int rot,
int flip)
Constructs a HalfEdge from the given QEdge, rotation, and flip coefficients. |
|
HalfEdge(QEdge e,
int flip,
Node v)
Constructs a HalfEdge from the given QEdge and flip coefficient with prescribed origin Node. |
|
HalfEdge(QEdge e,
int flip,
Node v,
boolean neighbor)
Constructs a HalfEdge from the given QEdge and flip coefficient with prescribed origin or neighbor Node. |
|
HalfEdge(QEdge e,
Node v)
Constructs a HalfEdge from the given QEdge with prescribed origin Node. |
|
HalfEdge(QEdge e,
Node v,
boolean neighbor)
Constructs a HalfEdge from the given QEdge with prescribed origin or neighbor Node. |
Method Summary | |
---|---|
String |
charName(Graph g)
|
void |
flipOp()
Apply the flip operation to this this HalfEdge. |
int |
getFlip()
Get the flip coefficient associated with this HalfEdge. |
Node |
getHead()
Return the head of this HalfEdge, which must be a directed edge. |
Node |
getNeighbor()
Get the neighbor node of this HalfEdge. |
HalfEdge |
getONext()
Return the next HalfEdge with the same origin as this one. |
HalfEdge |
getOPrev()
Return the previous HalfEdge with the same origin as this one. |
Node |
getOrigin()
Get the origin node of this HalfEdge. |
QEdge |
getQEdge()
Get the Qedge associated with this HalfEdge. |
int |
getRot()
Get the rotation coefficient associated with this HalfEdge. |
HalfEdge |
getSym()
Return the HalfEdge symmetric to this halfEdge. |
Node |
getTail()
Return the tail of this HalfEdge, which must be a directed edge. |
boolean |
isDirected()
Return whether this HalfEdge is a directed edge. |
boolean |
isHead()
Return whether the origin of this half edge is the head of the edge to which it belongs (i.e., whether this edge is directed toward the origin of this half-edge). |
boolean |
isTail()
Return whether the origin of this half edge is the tail of the edge to which it belongs (i.e., whether this edge is directed away from the origin of this half-edge). |
void |
rotateOp(int r)
Apply the rotation (rot) operation to this this HalfEdge. |
void |
symOp()
Apply the sym operation to this this HalfEdge. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HalfEdge(QEdge e, int rot, int flip)
e
- the base QEdgerot
- the rotation coefficientflip
- the flip coefficientpublic HalfEdge(QEdge e, int rot)
HalfEdge
(e,rot,0)
The flip coefficient defaults to 0.
e
- the base QEdgerot
- the rotation coefficient.public HalfEdge(HalfEdge h)
h
- the HalfEdge to be cloned.public HalfEdge(QEdge e, int flip, Node v, boolean neighbor)
GraphCheckException
is thrown.
e
- the base QEdge.flip
- the flip coefficient.v
- the node to be either the origin or the neighbor node.neighbor
- true if v is to be the neighbor node, false if v is
to be the origin node.public HalfEdge(QEdge e, Node v, boolean neighbor)
GraphCheckException
is thrown.
The flip coefficient defaults to 0.
Equivalent to
HalfEdge
(e,0,v,neighbor)
e
- the base QEdge.v
- the node to be either the origin or the neighbor node.neighbor
- true if v is to be the neighbor node, false if v is
to be the origin node.public HalfEdge(QEdge e, int flip, Node v)
GraphCheckException
is thrown.
Equivalent to
HalfEdge
(e,flip,v,false)
e
- the base QEdge.flip
- the flip coefficient.v
- the node to be the origin node.public HalfEdge(QEdge e, Node v)
GraphCheckException
is thrown.
The flip coefficient defaults to 0.
Equivalent to
HalfEdge
(e,0,v,false)
e
- the base QEdge.v
- the node to be the origin node.Method Detail |
---|
public String toString()
toString
in class Object
public String charName(Graph g)
public QEdge getQEdge()
public int getRot()
public int getFlip()
public void flipOp()
public void rotateOp(int r)
r
- the rotation to be applied. This should be a number in the
range 0-3, although no check is made.public void symOp()
public Node getOrigin()
public Node getNeighbor()
public boolean isDirected()
public boolean isHead()
public boolean isTail()
public Node getHead()
GraphCheckException
will be thrown.
GraphCheckException
- if the edge is not directedpublic Node getTail()
GraphCheckException
will be thrown.
GraphCheckException
- if the edge is not directedpublic HalfEdge getONext()
public HalfEdge getOPrev()
public HalfEdge getSym()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |