Package snap.geom

Class PointArray

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

public class PointArray extends Object implements Cloneable
This class represents an array of points assumed to form a polygon, quads or triangles.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double[]
     
    protected int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PointArray(double... theCoords)
    Creates a new Polygon from given x y coords.
  • Method Summary

    Modifier and Type
    Method
    Description
    Standard clone implementation.
    double[]
    Returns the raw points XY components array.
    int
    Returns the point count.
    double
    getX(int anIndex)
    Returns the x at given point index.
    double
    getY(int anIndex)
    Returns the y at given point index.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _pointArray

      protected double[] _pointArray
    • _pointArrayLen

      protected int _pointArrayLen
  • Constructor Details

    • PointArray

      public PointArray(double... theCoords)
      Creates a new Polygon from given x y coords.
  • Method Details

    • getPointArray

      public double[] getPointArray()
      Returns the raw points XY components array.
    • getPointCount

      public int getPointCount()
      Returns the point count.
    • 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 PointArray clone()
      Standard clone implementation.
      Overrides:
      clone in class Object