de.grogra.imp3d.objects
Class GRSVertex

java.lang.Object
  extended by de.grogra.graph.impl.Edge
      extended by de.grogra.graph.impl.Node
          extended by de.grogra.imp3d.objects.Null
              extended by de.grogra.imp3d.objects.ColoredNull
                  extended by de.grogra.imp3d.objects.Point
                      extended by de.grogra.imp3d.objects.GRSVertex
All Implemented Interfaces:
Transformation, Pickable, Renderable, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, java.io.Serializable

public class GRSVertex
extends Point

A GRSVertex is used in conjunction with a GRSMesh to define a graph rotation system. It has a cyclic list of neighbors stored in neighbors.

Author:
Ole Kniemeyer
See Also:
GRSMesh, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType
 
Nested classes/interfaces inherited from interface de.grogra.util.Map
Map.Chain
 
Field Summary
static Node.NType $TYPE
           
protected  ObjectList<GRSVertex> neighbors
          Cyclic neighborhood of this vertex.
static Node.NType.Field neighbors$FIELD
           
protected  float u
          u coordinate of vertex
static Node.NType.Field u$FIELD
           
protected  float v
          v coordinate of vertex
static Node.NType.Field v$FIELD
           
 
Fields inherited from class de.grogra.imp3d.objects.ColoredNull
color, color$FIELD
 
Fields inherited from class de.grogra.imp3d.objects.Null
transform, transform$FIELD, TRANSFORMING_MASK, transforming$FIELD, USED_BITS
 
Fields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MIME_TYPE, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD
 
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
 
Constructor Summary
GRSVertex()
          Creates a new GRSVertex whose transformation is set to a TVector3d initialized with (0, 0, 0).
GRSVertex(double x, double y, double z)
          Creates a new GRSVertex at the specifed location.
GRSVertex(Tuple3d p)
          Creates a new GRSVertex whose transformation is set to a TVector3d initialized with p.
 
Method Summary
 GRSVertex first()
          Returns the first neighbor of the cyclic list of neighbors.
 GRSVertex getNeighbor(int i)
          Returns the neighbor having index i.
 int getNeighborIndex(GRSVertex v)
          Returns the index of v in the cyclic list of neighbors.
 ObjectList<GRSVertex> getNeighbors()
           
protected  Node.NType getNTypeImpl()
          This method returns the Node.NType which describes the managed fields of the class of this node.
 float getU()
           
 float getV()
           
 GRSVertex neighbors(ObjectConsumer<? super GRSVertex> cons)
          Yields all neighbors to cons.
protected  Node newInstance()
          This method returns a new instance of the class of this node.
 GRSVertex next(GRSVertex ref)
          Returns the vertex which follows this vertex in the neighbor list of ref.
 GRSVertex next(int j, GRSVertex ref)
          Returns the vertex which is the j-th successor of this vertex in the neighbor list of ref.
 GRSVertex nextTo(GRSVertex n)
          Returns the neighbor which follows n in the cyclic list of neighbors.
 GRSVertex nextTo(int j, GRSVertex n)
          Returns the neighbor which is the j-th successor of n in the cyclic list of neighbors.
 GRSVertex prev(GRSVertex ref)
          Returns the vertex which precedes this vertex in the neighbor list of ref.
 GRSVertex prev(int j, GRSVertex ref)
          Returns the vertex which is the j-th predecessor of this vertex in the neighbor list of ref.
 GRSVertex prevTo(GRSVertex n)
          Returns the neighbor which precedes n in the cyclic list of neighbors.
 GRSVertex prevTo(int j, GRSVertex n)
          Returns the neighbor which is the j-th predecessor of n in the cyclic list of neighbors.
 void setNeighbors(ObjectList<GRSVertex> value)
           
 void setU(float value)
           
 void setV(float value)
           
 int valence()
          Returns the number of neighbors in the cyclic list of neighbors.
 
Methods inherited from class de.grogra.imp3d.objects.Point
draw, pick
 
Methods inherited from class de.grogra.imp3d.objects.ColoredNull
getColor, setColor, setColor, setColor
 
Methods inherited from class de.grogra.imp3d.objects.Null
getLocalTransformation, getTransform, getTranslation, isTransforming, postTransform, preTransform, setRotation, setScale, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransform, setTransforming, setTranslation
 
Methods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getShort, getSource, getStamp, getSuccessor, getSymbol, getSymbolColor, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setLayer, setMark, setName, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplace
 
Methods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBits
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
 

Field Detail

$TYPE

public static final Node.NType $TYPE

neighbors

protected ObjectList<GRSVertex> neighbors
Cyclic neighborhood of this vertex. This contains all neighboring vertices (those that are connected with this vertex by an edge of the polygon mesh). The neighbors are sorted in a cyclic way, namely in counter-clockwise order when seen from above of the mesh.


neighbors$FIELD

public static final Node.NType.Field neighbors$FIELD

u

protected float u
u coordinate of vertex


u$FIELD

public static final Node.NType.Field u$FIELD

v

protected float v
v coordinate of vertex


v$FIELD

public static final Node.NType.Field v$FIELD
Constructor Detail

GRSVertex

public GRSVertex()
Creates a new GRSVertex whose transformation is set to a TVector3d initialized with (0, 0, 0).


GRSVertex

public GRSVertex(double x,
                 double y,
                 double z)
Creates a new GRSVertex at the specifed location. The transformation is set to a TVector3d initialized with (x, y, z).

Parameters:
x - relative x coordinate
y - relative y coordinate
z - relative z coordinate

GRSVertex

public GRSVertex(Tuple3d p)
Creates a new GRSVertex whose transformation is set to a TVector3d initialized with p.

Method Detail

first

public GRSVertex first()
Returns the first neighbor of the cyclic list of neighbors.

Returns:
first neighbor of this vertex, or null if it has no neighbors

getNeighbor

public GRSVertex getNeighbor(int i)
Returns the neighbor having index i.

Parameters:
i - index of neighbor
Returns:
neighbor i in cyclic list

getNeighborIndex

public int getNeighborIndex(GRSVertex v)
Returns the index of v in the cyclic list of neighbors.

Parameters:
v - a vertex
Returns:
index of v in neighbor list, or -1 if v is not contained

getNeighbors

public ObjectList<GRSVertex> getNeighbors()

getNTypeImpl

protected Node.NType getNTypeImpl()
Description copied from class: Node
This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.

Overrides:
getNTypeImpl in class Point
Returns:
type describing the managed fields of the class of this node

getU

public float getU()

getV

public float getV()

neighbors

public GRSVertex neighbors(ObjectConsumer<? super GRSVertex> cons)
Yields all neighbors to cons. This may be used as an XL generator method.

Parameters:
cons - consumer which receives the neighbors
Returns:
null

newInstance

protected Node newInstance()
Description copied from class: Node
This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.

Overrides:
newInstance in class Point
Returns:
new instance of class of this node

next

public GRSVertex next(GRSVertex ref)
Returns the vertex which follows this vertex in the neighbor list of ref. Same as ref.nextTo (this).

Parameters:
ref - vertex of which this is a neighbor
Returns:
successor of this in ref's neighbor list, or null if this is not a neighbor of ref

next

public GRSVertex next(int j,
                      GRSVertex ref)
Returns the vertex which is the j-th successor of this vertex in the neighbor list of ref. Same as ref.nextTo (j, this).

Parameters:
ref - vertex of which this is a neighbor
Returns:
j-th successor of this in ref's neighbor list, or null if this is not a neighbor of ref.

nextTo

public GRSVertex nextTo(GRSVertex n)
Returns the neighbor which follows n in the cyclic list of neighbors.

Parameters:
n - a neighbor
Returns:
successor of n, or null if n is not a neighbor of this vertex

nextTo

public GRSVertex nextTo(int j,
                        GRSVertex n)
Returns the neighbor which is the j-th successor of n in the cyclic list of neighbors.

Parameters:
j - distance from n in cyclic neighbor list
n - a neighbor
Returns:
j-th successor of n, or null if n is not a neighbor of this vertex

prev

public GRSVertex prev(GRSVertex ref)
Returns the vertex which precedes this vertex in the neighbor list of ref. Same as ref.prevTo (this).

Parameters:
ref - vertex of which this is a neighbor
Returns:
predecessor of this in ref's neighbor list, or null if this is not a neighbor of ref

prev

public GRSVertex prev(int j,
                      GRSVertex ref)
Returns the vertex which is the j-th predecessor of this vertex in the neighbor list of ref. Same as ref.prevTo (j, this).

Parameters:
ref - vertex of which this is a neighbor
Returns:
j-th predecessor of this in ref's neighbor list, or null if this is not a neighbor of ref.

prevTo

public GRSVertex prevTo(GRSVertex n)
Returns the neighbor which precedes n in the cyclic list of neighbors.

Parameters:
n - a neighbor
Returns:
predecessor of n, or null if n is not a neighbor of this vertex

prevTo

public GRSVertex prevTo(int j,
                        GRSVertex n)
Returns the neighbor which is the j-th predecessor of n in the cyclic list of neighbors.

Parameters:
j - distance from n in cyclic neighbor list
n - a neighbor
Returns:
j-th predecessor of n, or null if n is not a neighbor of this vertex

setNeighbors

public void setNeighbors(ObjectList<GRSVertex> value)

setU

public void setU(float value)

setV

public void setV(float value)

valence

public int valence()
Returns the number of neighbors in the cyclic list of neighbors.

Returns:
number of neighbors