Class Vertex

java.lang.Object
com.treemap.swing.voronoi.smoothing.Vertex

public class Vertex extends Object
This class represents a corner (or vertex) of voronoi cells. A corner is defined as contact point of three different cell pixels or to different cell pixels and the domain bounds or a corner in the domain bounds.
  • Constructor Details

    • Vertex

      public Vertex(double x, double y, boolean touchingParentSpline, boolean isRectangleCorner, boolean vertexOfParentSegment)
    • Vertex

      public Vertex(double x, double y, boolean touchingParentSpline)
      Creates a corner (or vertex) with its location in pixels.
      Parameters:
      x - x-coordinate of the location
      y - y-coordinate of the location
      touchingParentSpline -
    • Vertex

      public Vertex(Vertex vertex, boolean vertexOfParentSegment)
  • Method Details

    • addAdjacentCellPixel

      public void addAdjacentCellPixel(VoronoiCell cell, int x, int y)
      Store a cell which has contact to the corner, and with which pixel (x/y) this is.
      Parameters:
      cell - the adjacent cell
      x - x-coordinate of the pixel which contacts
      y - y-coordinate of the pixel which contacts
    • addAdjacentCellPixel

      public void addAdjacentCellPixel(VoronoiCell cell, Point2i postion)
      Store a cell which has contact to the corner, and with which pixel (x/y) this is.
      Parameters:
      cell - the adjacent cell
      postion - x/y-coordinate of the pixel which contacts
    • addAdjacentCellPixel

      public void addAdjacentCellPixel(CellWithLocation cellWithLocation)
    • isPixelNextToCorner

      public boolean isPixelNextToCorner(int x, int y)
      Returns true if a pixel located at x/y is next to this corner. flase otherwise.
      Parameters:
      x - the x-coordinate of the pixel
      y - the y-coordinate of the pixel
      Returns:
      true if a pixel located at x/y is next to this corner. flase otherwise.
    • getLocation

      public Point2d getLocation()
      Returns the loction o f this corner.
      Returns:
      the loction o f this corner
    • getAdjacentCells

      public List<VoronoiCell> getAdjacentCells()
      Returns the list of adjacent cells.
      Returns:
      the list of adjacent cells
    • isTouchingParentSpline

      public boolean isTouchingParentSpline()
    • isRectangleCorner

      public boolean isRectangleCorner()
    • isVertexOfParentSegment

      public boolean isVertexOfParentSegment()
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
    • isPixelNextToCorner

      public boolean isPixelNextToCorner(Point2d point)
    • getId

      public int getId()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object