de.javagl.simplemesh.utils
Class Adjacency

java.lang.Object
  extended by de.javagl.simplemesh.utils.Adjacency

public class Adjacency
extends java.lang.Object

Utility methods for adjacency tests


Method Summary
static boolean areAdjacent(Edge e0, Edge e1)
          Returns whether the given edges are adjacent
static boolean containAdjacent(java.lang.Iterable<? extends Edge> edges0, java.lang.Iterable<? extends Edge> edges1)
          Returns whether the given sequences of edges contain adjacent edges
static boolean containsAdjacent(java.lang.Iterable<? extends Edge> edges, Edge edge)
          Returns whether the given sequence of edges contains an edge that is adjacent to the given edge
static boolean equal(Vertex v0, Vertex v1, Edge edge)
          Returns whether the given vertices are equal to the ones of the given edge (in any order)
static java.util.List<Edge> findAdjacent(java.lang.Iterable<? extends Edge> edges, Edge edge)
          Find all edges from the given sequence that are adjacent to the given edge
static Vertex getAdjacent(Face face, Edge edge)
          Returns the vertex of the given face that is adjacent (but not incident) to the given edge.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

areAdjacent

public static boolean areAdjacent(Edge e0,
                                  Edge e1)
Returns whether the given edges are adjacent

Parameters:
e0 - The fist edge
e1 - The second edge
Returns:
Whether the edges are adjacent

containAdjacent

public static boolean containAdjacent(java.lang.Iterable<? extends Edge> edges0,
                                      java.lang.Iterable<? extends Edge> edges1)
Returns whether the given sequences of edges contain adjacent edges

Parameters:
edges0 - The first sequence of edges
edges1 - The second sequence of edges
Returns:
Whether there are adjacent edges

containsAdjacent

public static boolean containsAdjacent(java.lang.Iterable<? extends Edge> edges,
                                       Edge edge)
Returns whether the given sequence of edges contains an edge that is adjacent to the given edge

Parameters:
edges - The sequence of edges
edge - The edge
Returns:
Whether there is an edge adjacent to the given edge

findAdjacent

public static java.util.List<Edge> findAdjacent(java.lang.Iterable<? extends Edge> edges,
                                                Edge edge)
Find all edges from the given sequence that are adjacent to the given edge

Parameters:
edges - The sequence of edges
edge - The edge
Returns:
The edges that are adjacent to the given edge

getAdjacent

public static Vertex getAdjacent(Face face,
                                 Edge edge)
Returns the vertex of the given face that is adjacent (but not incident) to the given edge. That is, returns the vertex of the face that is opposite to the edge, or null if no such vertex exists.

Parameters:
face - The face
edge - The edge
Returns:
The adjacent vertex or null

equal

public static boolean equal(Vertex v0,
                            Vertex v1,
                            Edge edge)
Returns whether the given vertices are equal to the ones of the given edge (in any order)

Parameters:
v0 - The first vertex
v1 - The second vertex
edge - The edge
Returns:
Whether the edge consists of the vertices (v0,v1) or (v1,v0)