Commit 83263c00 authored by Andre Heydt's avatar Andre Heydt

new Method is Boundary Face

parent b1ac4354
......@@ -536,44 +536,44 @@ public final class HalfEdgeUtils {
/**
* Test if a given vertex is on the boundary.
* For a boundary vertex, the incoming edge with getRightFace() == null
* is returned.
* <p>
* Uses {@link #incomingEdges(Vertex)}, so the preconditions explained there apply.
*
* @param vertex
* @return {@code true} if there is an incoming edge with {@code null} as {@linkplain de.jtem.halfedge.Edge#getLeftFace() left face}, otherwise {@code false}.
* @return The first boundary edge that is found with the given vertex as target,
* null if the vertex is no boundary vertex.
*/
static public <V extends Vertex<V,E,?>,E extends Edge<V,E,?>> boolean isBoundaryVertex(V vertex) {
static public <V extends Vertex<V,E,?>,E extends Edge<V,E,?>> E incomingBoundaryEdge(V vertex) {
List<E> incoming = incomingEdges(vertex);
for (E e : incoming) {
if (e.getLeftFace() == null) {
return true;
if (e.getRightFace() == null) {
return e;
}
}
return false;
return null;
}
/**
* For a boundary vertex, the incoming edge with getRightFace() == null
* is returned.
* Test if a given vertex is on the boundary.
* <p>
* Uses {@link #incomingEdges(Vertex)}, so the preconditions explained there apply.
*
* @param vertex
* @return The first boundary edge that is found with the given vertex as target,
* null if the vertex is no boundary vertex.
* @return {@code true} if there is an incoming edge with {@code null} as {@linkplain de.jtem.halfedge.Edge#getLeftFace() left face}, otherwise {@code false}.
*/
static public <V extends Vertex<V,E,?>,E extends Edge<V,E,?>> E incomingBoundaryEdge(V vertex) {
static public <V extends Vertex<V,E,?>,E extends Edge<V,E,?>> boolean isBoundaryVertex(V vertex) {
List<E> incoming = incomingEdges(vertex);
for (E e : incoming) {
if (e.getRightFace() == null) {
return e;
if (e.getLeftFace() == null) {
return true;
}
}
return null;
return false;
}
/**
* Test if a given edge is on the boundary.
*
......@@ -584,6 +584,16 @@ public final class HalfEdgeUtils {
return e.getLeftFace() == null || e.getRightFace() == null;
}
/**
* Test if a given Face is on the boundary.
*
* @param f
* @return {@code true} if either e.getLeftFace() == null or e.getRightFace() == null.
*/
static public <E extends Edge<?, E, F>, F extends Face<?,E,F>> boolean isBoundaryFace(F f) {
return !isInteriorFace(f);
}
/**
* Test if a given face is an inerior face (that is, not on the boundary).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment