Class SimplePolygon

  • All Implemented Interfaces:
    java.awt.Shape

    public class SimplePolygon
    extends java.lang.Object
    implements java.awt.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 java.util.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
      • getBounds

        public java.awt.Rectangle getBounds()
        Specified by:
        getBounds in interface java.awt.Shape
      • getBounds2D

        public java.awt.geom.Rectangle2D getBounds2D()
        Specified by:
        getBounds2D in interface java.awt.Shape
      • contains

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

        public boolean contains​(java.awt.geom.Point2D p)
        Specified by:
        contains in interface java.awt.Shape
      • intersects

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

        public boolean intersects​(java.awt.geom.Rectangle2D r)
        Specified by:
        intersects in interface java.awt.Shape
      • contains

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

        public boolean contains​(java.awt.geom.Rectangle2D r)
        Specified by:
        contains in interface java.awt.Shape
      • getPathIterator

        public java.awt.geom.PathIterator getPathIterator​(java.awt.geom.AffineTransform at)
        Specified by:
        getPathIterator in interface java.awt.Shape
      • getPathIterator

        public java.awt.geom.PathIterator getPathIterator​(java.awt.geom.AffineTransform at,
                                                          double flatness)
        Specified by:
        getPathIterator in interface java.awt.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)