graph
Class Vertex

java.lang.Object
  |
  +--graph.Vertex

public class Vertex
extends java.lang.Object

The attributes of a vertex are its height and the array of faces surrounding that vertex.

There is a crude parallelism between the Vertex and Face classes, corresponding to the duality of planar maps that exchanges vertices and faces.


Inner Class Summary
static class Vertex.Test
           
 
Method Summary
 int faceCount(int minGon, int maxGon)
          Count the number of faces at the vertex that have between minGon and maxGon faces (inclusive).
 Face getAny()
          getAny returns any face of the vertex.
 int getHeight()
          The height is a field that has only minor significance.
 Face next(Face f, int count)
          Find the count'th successor to Face f in the cyclic order around the vertex.
 int nonFinalCount()
          nonFinalCount is the number of Faces around the vertex that are not final.
 int size()
          The size of a vertex is the number of faces with that vertex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

faceCount

public int faceCount(int minGon,
                     int maxGon)
Count the number of faces at the vertex that have between minGon and maxGon faces (inclusive). NonFinal faces are excluded.
Parameters:
minGon - int giving the minimum number of vertices for a face to be included in the count
maxGon - int giving the maximum number of vertices for a face to be included in the count

Example: faceCount(3,3) number of nonFinal triangles around a vertex. faceCount(4,4) number of nonFinal quadrilaterals around a vertex. faceCount(5,Integer.MAX_VALUE) number of nonFinal exceptional faces around a vertex.


nonFinalCount

public int nonFinalCount()
nonFinalCount is the number of Faces around the vertex that are not final.

getHeight

public int getHeight()
The height is a field that has only minor significance. It is used heuristically in the construction of new graphs from a given one. The height is non-negative integer that roughly measures how late in the construction that vertex was added. Higher heights occur in vertices that were constructed later in the game.

The height has no significance for final graphs.


size

public int size()
The size of a vertex is the number of faces with that vertex.

next

public Face next(Face f,
                 int count)
Find the count'th successor to Face f in the cyclic order around the vertex. If the Face f does not appear on the vertex, returns null.

Examples: next(f,0) = f; next(f,size())=f; next(f,1) = successor, ....

Face.next moves clockwise around the face, but Vertex.next moves counterclockwise. This means that if faces R and S share an edge E with terminal vertices x and y, and if y occurs clockwise around R from x, then S=x.next(R,1); R=y.next(S,1); x=S.next(y,1); y=R.next(x,1); See graphDoc.gif

Parameters:
f - the Face used as a base point around the Vertex.
count - this many faces past f to locate the Face returned. The return value only depends on count mod this.size();

getAny

public Face getAny()
getAny returns any face of the vertex. This, together with repeated calls to "next" will give an enumeration of all faces.

In the unlikely event that the vertex has no faces, a null is returned;