|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.amibe.ds.AbstractHalfEdge org.jcae.mesh.amibe.ds.HalfEdge
public class HalfEdge
Half-edge data structure. This is a straightforward implementation of
AbstractHalfEdge
, an half-edge is represented by a local number
(between 0 and 2) and a triangle. It has a link to the next edge in the
same triangle, and to its symmetric edge.
Field Summary |
---|
Fields inherited from class org.jcae.mesh.amibe.ds.AbstractHalfEdge |
---|
BOUNDARY, int3, MARKED, NONMANIFOLD, OUTER, QUAD, SWAPPED, traits, traitsBuilder |
Constructor Summary | |
---|---|
HalfEdge(HalfEdgeTraitsBuilder htb,
TriangleHE tri,
byte localNumber,
byte attributes)
|
Method Summary | |
---|---|
Vertex |
apex()
Returns apex of this edge. |
double |
area()
Returns the area of triangle bound to this edge. |
protected boolean |
canCollapse(Vertex v)
Checks whether an edge can be contracted into a given vertex. |
boolean |
checkNewRingNormals(double[] newpt)
Checks that triangles are not inverted if origin vertex is moved. |
double |
checkSwap3D(double minCos)
Checks the dihedral angle of an edge. |
double |
checkSwap3D(double minCos,
double maxLength)
|
void |
clearAttributes(int attr)
Resets attributes of this edge. |
protected HalfEdge |
collapse(Mesh m,
Vertex v)
Contracts an edge. |
void |
copy(HalfEdge that)
|
Vertex |
destination()
Returns end vertex of this edge. |
java.util.Iterator<AbstractHalfEdge> |
fanIterator()
Returns an iterator over triangle fans connected to this edge. |
int |
getAttributes()
|
int |
getLocalNumber()
Returns edge local number. |
Triangle |
getTri()
Returns triangle tied to this edge. |
void |
glue(AbstractHalfEdge e)
Sets the edge tied to this object. |
boolean |
hasAttributes(int attr)
Checks if some attributes of this edge are set. |
boolean |
hasSymmetricEdge()
Tells whether edge is connected to a symmetric edge. |
HalfEdge |
next()
Moves counterclockwise to following edge. |
AbstractHalfEdge |
next(AbstractHalfEdge that)
Moves counterclockwise to following edge. |
HalfEdge |
nextApexLoop()
Moves counterclockwise to the following edge which has the same apex. |
HalfEdge |
nextOrigin()
Moves counterclockwise to the following edge which has the same origin. |
AbstractHalfEdge |
nextOrigin(AbstractHalfEdge that)
Moves counterclockwise to the following edge which has the same origin. |
HalfEdge |
nextOriginLoop()
Moves counterclockwise to the following edge which has the same origin. |
HalfEdge |
notOriented()
|
Vertex |
origin()
Returns start vertex of this edge. |
HalfEdge |
prev()
Moves counterclockwise to previous edge. |
AbstractHalfEdge |
prev(AbstractHalfEdge that)
Moves counterclockwise to previous edge. |
void |
setApex(Vertex v)
Sets apex of this edge. |
void |
setAttributes(int attr)
Sets attributes of this edge. |
void |
setDestination(Vertex v)
Sets end vertex of this edge. |
void |
setNext(HalfEdge e)
Sets next link. |
void |
setOrigin(Vertex v)
Sets start vertex of this edge. |
protected HalfEdge |
split(Mesh m,
Vertex v)
Splits an edge. |
protected HalfEdge |
swap()
Swaps an edge. |
HalfEdge |
sym()
Moves to symmetric edge. |
AbstractHalfEdge |
sym(AbstractHalfEdge that)
Moves to symmetric edge. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HalfEdge(HalfEdgeTraitsBuilder htb, TriangleHE tri, byte localNumber, byte attributes)
Method Detail |
---|
public final Triangle getTri()
getTri
in class AbstractHalfEdge
public final int getLocalNumber()
getLocalNumber
in class AbstractHalfEdge
public final int getAttributes()
public final void glue(AbstractHalfEdge e)
glue
in class AbstractHalfEdge
e
- the edge tied to this objectpublic final HalfEdge notOriented()
public final boolean hasSymmetricEdge()
hasSymmetricEdge
in class AbstractHalfEdge
true
if edge has a symmetric edge, false
otherwise.public final HalfEdge sym()
sym
in class AbstractHalfEdge
public final AbstractHalfEdge sym(AbstractHalfEdge that)
that
instance be a copy of current
instance, move it to its symmetric edge and return
this instance. Current instance is not modified.
sym
in class AbstractHalfEdge
that
- instance where transformed edge is stored
public final HalfEdge next()
next
in class AbstractHalfEdge
public final AbstractHalfEdge next(AbstractHalfEdge that)
that
instance be a copy of current
instance, move it counterclockwise to next edge and
return this instance. Current instance is not modified.
next
in class AbstractHalfEdge
that
- instance where transformed edge is stored
public final HalfEdge prev()
prev
in class AbstractHalfEdge
public final AbstractHalfEdge prev(AbstractHalfEdge that)
that
instance be a copy of current
instance, move it counterclockwise to previous edge and
return this instance. Current instance is not modified.
prev
in class AbstractHalfEdge
that
- instance where transformed edge is stored
public final HalfEdge nextOrigin()
nextOrigin
in class AbstractHalfEdge
public final AbstractHalfEdge nextOrigin(AbstractHalfEdge that)
that
instance be a copy of current
instance, move it counterclockwise to the following edge which
has the same origin and return this instance. Current instance is
not modified.
nextOrigin
in class AbstractHalfEdge
that
- instance where transformed edge is stored
public final void setOrigin(Vertex v)
v
- start vertex of this edgepublic final void setDestination(Vertex v)
v
- end vertex of this edgepublic final void setApex(Vertex v)
v
- apex of this edgepublic final void setNext(HalfEdge e)
public final boolean hasAttributes(int attr)
hasAttributes
in class AbstractHalfEdge
attr
- attributes to check
true
if this HalfEdge has one of
these attributes set, false
otherwisepublic final void setAttributes(int attr)
setAttributes
in class AbstractHalfEdge
attr
- attributes of this edgepublic final void clearAttributes(int attr)
clearAttributes
in class AbstractHalfEdge
attr
- attributes of this edge to clear outpublic final Vertex origin()
origin
in class AbstractHalfEdge
public final Vertex destination()
destination
in class AbstractHalfEdge
public final Vertex apex()
apex
in class AbstractHalfEdge
public final HalfEdge nextOriginLoop()
nextOriginLoop
in class AbstractHalfEdge
public final HalfEdge nextApexLoop()
public final double checkSwap3D(double minCos)
minCos
- if the dot product of the normals to adjacent
triangles is lower than minCos, then -1.0
is
returned.
public final double checkSwap3D(double minCos, double maxLength)
protected final HalfEdge swap()
swap
in class AbstractHalfEdge
java.lang.IllegalArgumentException
- if edge is on a boundary or belongs
to an outer triangle.Mesh.edgeSwap(org.jcae.mesh.amibe.ds.AbstractHalfEdge)
public double area()
area
in class AbstractHalfEdge
protected final boolean canCollapse(Vertex v)
canCollapse
in class AbstractHalfEdge
v
- the resulting vertex
true
if this edge can be contracted into the single vertex n, false
otherwiseMesh.canCollapseEdge(org.jcae.mesh.amibe.ds.AbstractHalfEdge, org.jcae.mesh.amibe.ds.Vertex)
public final boolean checkNewRingNormals(double[] newpt)
checkNewRingNormals
in class AbstractHalfEdge
newpt
- the new position to be checked
false
if the new position produces
an inverted triangle, true
otherwise.
Warning: this method uses temp[0], temp[1], temp[2] and temp[3] temporary arrays.protected final HalfEdge collapse(Mesh m, Vertex v)
collapse
in class AbstractHalfEdge
m
- meshv
- the resulting vertex
n
and with the same apex
java.lang.IllegalArgumentException
- if edge belongs to an outer triangle,
because there would be no valid return value. User must then run this
method against symmetric edge, this is not done automatically.Mesh.edgeCollapse(org.jcae.mesh.amibe.ds.AbstractHalfEdge, org.jcae.mesh.amibe.ds.Vertex)
protected final HalfEdge split(Mesh m, Vertex v)
collapse(org.jcae.mesh.amibe.ds.Mesh, org.jcae.mesh.amibe.ds.Vertex)
.
split
in class AbstractHalfEdge
m
- meshv
- vertex being inserted
n
Mesh.vertexSplit(org.jcae.mesh.amibe.ds.AbstractHalfEdge, org.jcae.mesh.amibe.ds.Vertex)
public final java.util.Iterator<AbstractHalfEdge> fanIterator()
fanIterator
in class AbstractHalfEdge
public java.lang.String toString()
toString
in class java.lang.Object
public final void copy(HalfEdge that)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |