Package snap.geom

Class PointArrayIndex

java.lang.Object
snap.geom.PointArrayIndex
All Implemented Interfaces:
Cloneable

public class PointArrayIndex extends Object implements Cloneable
This class represents an array of indexes into a PointArray assumed to form a polygon, quads or triangles.
  • Constructor Details

    • PointArrayIndex

      public PointArrayIndex(double... theCoords)
      Constructor for given XY coords double array.
  • Method Details

    • getPointArray

      public PointArray getPointArray()
      Returns the PointArray holding actual points.
    • getPointCount

      public int getPointCount()
      Returns the point count.
    • getIndexArray

      public int[] getIndexArray()
      Returns the index array.
    • getIndex

      public int getIndex(int anIndex)
      Returns the PointArray index at given index.
    • getX

      public double getX(int anIndex)
      Returns the x at given point index.
    • getY

      public double getY(int anIndex)
      Returns the y at given point index.
    • clone

      public PointArrayIndex clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • newTrianglePointArrayForShape

      public static PointArrayIndex newTrianglePointArrayForShape(Shape aShape)
      Returns a PointsArray with triangle ordering.
    • newTrianglePointArrayForPolygonPoints

      public static PointArrayIndex newTrianglePointArrayForPolygonPoints(double[] pointsArray)
      Returns a PointsArray with triangle ordering.