Class Ruling

All Implemented Interfaces:
Shape, Serializable, Cloneable

public class Ruling extends Line2D.Float
See Also:
  • Field Details

    • PERPENDICULAR_PIXEL_EXPAND_AMOUNT

      public static final int PERPENDICULAR_PIXEL_EXPAND_AMOUNT
      See Also:
    • COLINEAR_OR_PARALLEL_PIXEL_EXPAND_AMOUNT

      public static final int COLINEAR_OR_PARALLEL_PIXEL_EXPAND_AMOUNT
      See Also:
  • Constructor Details

    • Ruling

      public Ruling(float top, float left, float width, float height)
    • Ruling

      public Ruling(Point2D p1, Point2D p2)
  • Method Details

    • normalize

      public void normalize()
      Normalize almost horizontal or almost vertical lines
    • vertical

      public boolean vertical()
    • horizontal

      public boolean horizontal()
    • oblique

      public boolean oblique()
    • getPosition

      public float getPosition()
    • setPosition

      public void setPosition(float v)
    • getStart

      public float getStart()
    • setStart

      public void setStart(float v)
    • getEnd

      public float getEnd()
    • setEnd

      public void setEnd(float v)
    • perpendicularTo

      public boolean perpendicularTo(Ruling other)
    • colinear

      public boolean colinear(Point2D point)
    • nearlyIntersects

      public boolean nearlyIntersects(Ruling another)
    • nearlyIntersects

      public boolean nearlyIntersects(Ruling another, int colinearOrParallelExpandAmount, int perpendicularExpandAmout)
    • length

      public double length()
    • intersect

      public Ruling intersect(Rectangle2D clip)
    • expand

      public Ruling expand(float amount)
    • intersectionPoint

      public Point2D intersectionPoint(Ruling other, int perpendicularExpandAmount)
    • equals

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

      public float getTop()
    • setTop

      public void setTop(float v)
    • getLeft

      public float getLeft()
    • setLeft

      public void setLeft(float v)
    • getBottom

      public float getBottom()
    • setBottom

      public void setBottom(float v)
    • getRight

      public float getRight()
    • setRight

      public void setRight(float v)
    • getWidth

      public float getWidth()
    • getHeight

      public float getHeight()
    • getAngle

      public double getAngle()
    • parallelTo

      public boolean parallelTo(Ruling other)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • cropRulingsToArea

      public static List<Ruling> cropRulingsToArea(List<Ruling> rulings, Rectangle2D area)
    • findIntersections

      public static Map<Point2D,Ruling[]> findIntersections(List<Ruling> horizontals, List<Ruling> verticals)
    • findIntersections

      public static Map<Point2D,Ruling[]> findIntersections(List<Ruling> horizontals, List<Ruling> verticals, int horizontalExpandAmount, int verticalExpandAmount)
    • collapseOrientedRulings

      public static List<Ruling> collapseOrientedRulings(List<Ruling> lines)
    • collapseOrientedRulings

      public static List<Ruling> collapseOrientedRulings(List<Ruling> lines, int colinearExpandAmount)
    • collapseOrientedRulings

      public static List<Ruling> collapseOrientedRulings(List<Ruling> lines, int colinearExpandAmount, int perpendicularExpandAmout)
    • collapseOrientedRulings

      public static List<Ruling> collapseOrientedRulings(List<Ruling> lines, int colinearExpandAmount, int perpendicularExpandAmount, float magnetRadius)