Class Vertex


  • public class Vertex
    extends java.lang.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 Detail

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

      • 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 java.util.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
      • isPixelNextToCorner

        public boolean isPixelNextToCorner​(Point2d point)
      • getId

        public int getId()
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object