org.jcae.mesh.amibe.patch
Class VirtualHalfEdge2D
java.lang.Object
org.jcae.mesh.amibe.ds.AbstractHalfEdge
org.jcae.mesh.amibe.ds.VirtualHalfEdge
org.jcae.mesh.amibe.patch.VirtualHalfEdge2D
public class VirtualHalfEdge2D
- extends VirtualHalfEdge
A handle to abstract edge objects for initial 2D mesh.
This class implements some features which are only relevant
to the initial 2D mesh. In particular, boundary edges have
not yet been rebuilt, so we cannot check whether the OUTER
attribute is set but need to test if vertices are equal to
the infinite point instead.
Methods inherited from class org.jcae.mesh.amibe.ds.VirtualHalfEdge |
apex, area, bind, bind, canCollapse, checkNewRingNormals, checkSwap3D, checkSwap3D, clearAttributes, collapse, computeNormal3D, computeNormal3DT, copyOTri, destination, fanIterator, getLocalNumber, getTempVector, getTri, glue, hasAttributes, hasSymmetricEdge, isMutable, next, next, nextOrigin, nextOrigin, nextOriginLoop, nextOTri, origin, prev, prev, prevOTri, pullAttributes, pushAttributes, setApex, setAttributes, setDestination, setOrigin, split, swap, sym, sym, symOTri, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
VirtualHalfEdge2D
public VirtualHalfEdge2D()
VirtualHalfEdge2D
public VirtualHalfEdge2D(Triangle t,
int o)
- Create an object to handle data about a triangle.
- Parameters:
t
- geometrical triangle.o
- a number between 0 and 2 determining an edge.
split3
public final int split3(Mesh2D mesh,
Vertex2D v,
java.util.Set<Triangle> modifiedTriangles,
boolean force)
- Splits a triangle into three new triangles by inserting a vertex.
Two new triangles have to be created, the last one is
updated. For efficiency reasons, no checks are performed to
ensure that the vertex being inserted is contained by this
triangle. Once triangles are created, edges are swapped if
they are not Delaunay.
If edges are not swapped after vertex is inserted, the quality of
newly created triangles has decreased, and the vertex is eventually
not inserted unless the
force
argument is set to
true
.
Origin and destination points must not be at infinite, which
is the case when current triangle is returned by
getSurroundingTriangle(). If apex is Mesh.outerVertex, then
getSurroundingTriangle() ensures that v.onLeft(o,d) > 0.
- Parameters:
v
- vertex being inserted.modifiedTriangles
- if not null, this set of triangles is updated by adding all triangles modified during this operation.force
- if false
, the vertex is inserted only if some edges were swapped after its insertion. If true
, the vertex is unconditionnally inserted.
- Returns:
- number of edges swapped during insertion. If it is 0, vertex has not been inserted.
checkSmallerAndSwap
public int checkSmallerAndSwap(Mesh2D mesh)
forceBoundaryEdge
public final int forceBoundaryEdge(Mesh2D mesh,
Vertex2D end)
- Tries to rebuild a boundary edge by swapping edges.
This routine is applied to an oriented triangle, its origin
is an end point of the boundary edge to rebuild. The other end
point is passed as an argument. Current oriented triangle has
been set up by calling routine so that it is the leftmost edge
standing to the right of the boundary edge.
A traversal between end points is performed, and intersected
edges are swapped if possible. At exit, current oriented
triangle has
end
as its origin, and is the
rightmost edge standing to the left of the inverted edge.
This algorithm can then be called iteratively back and forth,
and it is known that it is guaranteed to finish.
- Parameters:
end
- end point of the boundary edge.
- Returns:
- the number of intersected edges.
isDelaunay
public final boolean isDelaunay(Mesh2D mesh,
Vertex2D apex2)
- Checks whether an edge is Delaunay.
- Parameters:
apex2
- apex of the symmetric edge
- Returns:
true
if edge is Delaunay, false
otherwise.