Class HullVertex

java.lang.Object
jaba.convexHull3d.HullVertex

public class HullVertex extends Object
This class is an abstraction of a vertex.
Author:
Sebastiano Spicuglia
  • Field Details

  • Constructor Details

    • HullVertex

      public HullVertex(int x, int y, int z, int id, String name)
      Creates a new vertex object
      Parameters:
      x - the x-coord
      y - the y-coord
      z - the z-coord
      id - the index of the related station
      name - the name of the related station
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • areCollinear

      public static boolean areCollinear(HullVertex a, HullVertex b, HullVertex c)
      True if @a, @b, @c are collinear, false otherwise.
      Parameters:
      a - the first point
      b - the second point
      c - the third point
      Returns:
      if @a, @b, @c are collinear
    • clone

      public HullVertex clone()
      Clones this object
      Overrides:
      clone in class Object
      Returns:
      a clone of this object
    • isOnHull

      protected boolean isOnHull()
      True if this vertex is on the current hull surface.
      Returns:
    • isProcessed

      protected boolean isProcessed()
      True if this vertex is already processed
      Returns:
    • getDuplicate

      protected HullEdge getDuplicate()
    • getID

      public int getID()
      Returns the object ID related to this vertex, or null if this vertex is a projected one.
      Returns:
      The related object ID.
    • x

      public int x()
      Returns the x-coord
      Returns:
      the x-coord
    • y

      public int y()
      Returns the y-coord
      Returns:
      the y-coord
    • z

      public int z()
      Returns the z-coord
      Returns:
      the z-coord
    • setOnHull

      protected void setOnHull(boolean b)
      Setter for the field onHull
      Parameters:
      b - the value you want to set
    • setDuplicate

      protected void setDuplicate(HullEdge edge)
      Setter for the field duplicate
      Parameters:
      edge - the value you want to set
    • setProcessed

      protected void setProcessed(boolean m)
      Setter for the field mark
      Parameters:
      m - the value you want to set
    • getName

      public String getName()
      Returns the name.
      Returns:
      the name
    • setName

      public void setName(String name)
      Sets the name.
      Parameters:
      name - the name to set
    • toString

      public String toString()
      Overrides:
      toString in class Object