Module imp3d

Class GRSVertex

All Implemented Interfaces:
Transformation, Pickable, Renderable, Manageable, PersistenceCapable, Shareable, UserFields, XObject, Map, 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:
  • Field Details

    • 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.
    • u

      protected float u
      u coordinate of vertex
    • v

      protected float v
      v coordinate of vertex
    • $TYPE

      public static final Node.NType $TYPE
    • neighbors$FIELD

      public static final Node.NType.Field neighbors$FIELD
    • u$FIELD

      public static final Node.NType.Field u$FIELD
    • v$FIELD

      public static final Node.NType.Field v$FIELD
  • Constructor Details

    • GRSVertex

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

      public GRSVertex(Tuple3d p)
      Creates a new GRSVertex whose transformation is set to a TVector3d initialized with p.
    • 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
  • Method Details

    • 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
    • valence

      public int valence()
      Returns the number of neighbors in the cyclic list of neighbors.
      Returns:
      number of neighbors
    • 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
    • getNeighbor

      public GRSVertex getNeighbor(int i)
      Returns the neighbor having index i.
      Parameters:
      i - index of neighbor
      Returns:
      neighbor i in cyclic list
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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.
    • 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.
    • 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
    • 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
    • getU

      public float getU()
    • setU

      public void setU(float value)
    • getV

      public float getV()
    • setV

      public void setV(float value)
    • getNeighbors

      public ObjectList<GRSVertex> getNeighbors()
    • setNeighbors

      public void setNeighbors(ObjectList<GRSVertex> value)