Class SimplePolygon

  • All Implemented Interfaces:
    Shape

    public class SimplePolygon
    extends Object
    implements Shape
    A simple list of vertices that can be append or prepended to
    • Field Detail

      • x

        protected int[] x
      • y

        protected int[] y
      • left

        protected int left
      • right

        protected int right
    • Constructor Detail

      • SimplePolygon

        public SimplePolygon()
      • SimplePolygon

        public SimplePolygon​(int[] x,
                             int[] y,
                             int length)
      • SimplePolygon

        public SimplePolygon​(int[] x,
                             int[] y,
                             int left,
                             int right)
    • Method Detail

      • pushLeft

        public void pushLeft​(int xCoord,
                             int yCoord)
      • popLeft

        public void popLeft()
      • expandLeft

        protected void expandLeft​(int grow)
      • pushRight

        public void pushRight​(int xCoord,
                              int yCoord)
      • popRight

        public void popRight()
      • expandRight

        protected void expandRight​(int grow)
      • getX

        public int getX​(int index)
      • getY

        public int getY​(int index)
      • size

        public int size()
      • toRuneLitePointList

        public List<Point> toRuneLitePointList()
      • copyTo

        public void copyTo​(int[] xDest,
                           int[] yDest,
                           int offset)
      • reverse

        public void reverse()
      • intersectWithConvex

        public void intersectWithConvex​(SimplePolygon convex)
        Clips the polygon with the passed convex polygon
      • contains

        public boolean contains​(double cx,
                                double cy)
        Specified by:
        contains in interface Shape
      • intersects

        public boolean intersects​(double x0,
                                  double y0,
                                  double w,
                                  double h)
        Specified by:
        intersects in interface Shape
      • contains

        public boolean contains​(double x,
                                double y,
                                double w,
                                double h)
        Specified by:
        contains in interface Shape
      • getX

        public int[] getX()
      • getY

        public int[] getY()
      • getLeft

        public int getLeft()
      • getRight

        public int getRight()
      • setX

        public void setX​(int[] x)
      • setY

        public void setY​(int[] y)
      • setLeft

        public void setLeft​(int left)
      • setRight

        public void setRight​(int right)