edu.mines.jtk.mesh
Class TetMesh.Edge

java.lang.Object
  extended by edu.mines.jtk.mesh.TetMesh.Edge
Enclosing class:
TetMesh

public static class TetMesh.Edge
extends java.lang.Object

A directed edge.

An edge is specified by two nodes A and B. The order of these nodes is significant. An edge is directed from A to B.

Every edge has a mate. An edge and its mate reference the same two nodes, but in the opposite order, so they have opposite directions. Therefore, an edge does not equal its mate.

When constructing an edge, a tet that references the two nodes A and B may be specified. If non-null, this tet may used to quickly get any face or tet nabors of the edge.


Constructor Summary
TetMesh.Edge(TetMesh.Node a, TetMesh.Node b)
          Constructs a directed edge that references the specified nodes.
TetMesh.Edge(TetMesh.Node a, TetMesh.Node b, TetMesh.Tet abcd)
          Constructs a directed edge that references the specified nodes.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 int hashCode()
           
 TetMesh.Edge mate()
          Returns the mate of this edge.
 double[] midpoint()
          Returns the midpoint of this face.
 double midpoint(double[] c)
          Computes the midpoint of this edge.
 TetMesh.Node nodeA()
          Returns the node A at which this edge begins.
 TetMesh.Node nodeB()
          Returns the node B at which this edge ends.
 TetMesh.Tet tet()
          Returns the tet that references the nodes in this edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TetMesh.Edge

public TetMesh.Edge(TetMesh.Node a,
                    TetMesh.Node b)
Constructs a directed edge that references the specified nodes.

Parameters:
a - a node of the edge.
b - a node of the edge.

TetMesh.Edge

public TetMesh.Edge(TetMesh.Node a,
                    TetMesh.Node b,
                    TetMesh.Tet abcd)
Constructs a directed edge that references the specified nodes. Optionally, a tet may be specified. If non-null, that tet must reference the specified nodes.

Parameters:
a - a node of the edge.
b - a node of the edge.
abcd - a tet that references nodes A and B; null, if none.
Method Detail

nodeA

public TetMesh.Node nodeA()
Returns the node A at which this edge begins.

Returns:
the node A.

nodeB

public TetMesh.Node nodeB()
Returns the node B at which this edge ends.

Returns:
the node B.

tet

public TetMesh.Tet tet()
Returns the tet that references the nodes in this edge.

Returns:
the tet; null, if none specified when edge was constructed.

mate

public TetMesh.Edge mate()
Returns the mate of this edge.

Returns:
the mate.

midpoint

public double midpoint(double[] c)
Computes the midpoint of this edge.

Parameters:
c - array of midpoint coordinates {xc,yc,zc}.
Returns:
distance-squared from midpoint to nodes.

midpoint

public double[] midpoint()
Returns the midpoint of this face.

Returns:
array of midpoint coordinates {xc,yc,zc}.

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object