Package snap.geom

Class PolygonPath

java.lang.Object
snap.geom.Shape
snap.geom.PolygonPath

public class PolygonPath extends Shape
This Shape subclass represents one or more polygons.
  • Field Details

    • DEFAULT_FLAT_DISTANCE

      public static final double DEFAULT_FLAT_DISTANCE
      See Also:
  • Constructor Details

    • PolygonPath

      public PolygonPath()
      Constructor.
    • PolygonPath

      public PolygonPath(Shape aShape)
      Constructor for given Shape.
    • PolygonPath

      public PolygonPath(Shape aShape, double aFlatDistance)
      Constructor for given Shape.
  • Method Details

    • getPolygons

      public Polygon[] getPolygons()
      Returns the Polygons.
    • getPolygonCount

      public int getPolygonCount()
      Returns the number of polygons.
    • getPolygon

      public Polygon getPolygon(int anIndex)
      Returns the individual polygon at given index.
    • addPoly

      public void addPoly(Polygon aPoly, int anIndex)
      Adds a polygon.
    • getLastPolygon

      public Polygon getLastPolygon()
      Returns the last polygon.
    • getLastPoint

      public Point getLastPoint()
      Returns the last polygon last point.
    • moveTo

      public void moveTo(double aX, double aY)
      Moveto.
    • lineTo

      public void lineTo(double aX, double aY)
      LineTo.
    • close

      public void close()
      Closes the current polygon.
    • quadTo

      public void quadTo(double cpx, double cpy, double x, double y)
      QuadTo by adding lineTos.
    • curveTo

      public void curveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y)
      CubicTo by adding lineTos.
    • getFlatDistance

      public double getFlatDistance()
      Returns the acceptable distance of control points to segment line when flattening curved segments.
    • setFlatDistance

      public void setFlatDistance(double aValue)
      Sets the acceptable distance of control points to segment line when flattening curved segments.
    • appendShape

      public void appendShape(Shape aShape)
      Appends given shape to this polygon path.
    • appendPathIter

      public void appendPathIter(PathIter aPathIter)
      Appends given PathIter to this polygon path.
    • getBoundsImpl

      protected Rect getBoundsImpl()
      Returns the shape bounds.
      Overrides:
      getBoundsImpl in class Shape
    • getPathIter

      public PathIter getPathIter(Transform aTransform)
      Returns the path iterator.
      Specified by:
      getPathIter in class Shape