Class SurfaceMaskLine.MaskPointList

java.lang.Object
cz.fidentis.analyst.data.surfacemask.SurfaceMaskLine.MaskPointList
Enclosing interface:
SurfaceMaskLine

public static class SurfaceMaskLine.MaskPointList extends Object
Class representing the mask by a set of points connected by edges. One direction linked list, with added size to make iteration over the points simpler Additionally the last and the first points can be connected, closing the mask.
  • Constructor Details

    • MaskPointList

      public MaskPointList()
  • Method Details

    • isCloseable

      public boolean isCloseable()
      a mask is closeable if there is more than 2 points
      Returns:
      true if closeable, else false
    • isEmpty

      public boolean isEmpty()
      Checks if the mask is empty
      Returns:
      true if empty, else false
    • isClosed

      public boolean isClosed()
      Checks if the mask has been closed. The mask has been closed if its not empty, is closeable and last point is connected to the first.
      Returns:
      true if closed else false
    • getFirst

      public SurfaceMaskLine.MaskPoint getFirst()
      gets the first point
      Returns:
      first point
    • setFirst

      public void setFirst(SurfaceMaskLine.MaskPoint first)
      sets the first point
      Parameters:
      first - point to set
    • getLast

      public SurfaceMaskLine.MaskPoint getLast()
      gets the last point
      Returns:
      the last point
    • setLast

      public void setLast(SurfaceMaskLine.MaskPoint last)
      sets the last point
      Parameters:
      last - point to set
    • getSize

      public int getSize()
    • addPoint

      public void addPoint(Point point)
      adds a new point to the end
      Parameters:
      point - to add
    • insertBehind

      public void insertBehind(SurfaceMaskLine.MaskPoint first, SurfaceMaskLine.MaskPoint middle)
      Inserts a new point behind an existing point with a successor. The inserted point will be the new successor.
      Parameters:
      first - point to insert behind
      middle - point to insert
    • deletePoint

      public void deletePoint(SurfaceMaskLine.MaskPoint previous, SurfaceMaskLine.MaskPoint delete)
      deletes a selected point
      Parameters:
      previous - predecessor of the point to be deleted
      delete - point to delete
    • toString

      public String toString()
      Gets a string representation of the list
      Overrides:
      toString in class Object
      Returns:
      a string representation of the list