Package snap.geom

Class Path2DX

All Implemented Interfaces:
Cloneable

public class Path2DX extends Path2D
This extended Path2D provides extra features like ArcLength measurement.
  • Constructor Details

    • Path2DX

      public Path2DX()
      Constructor.
    • Path2DX

      public Path2DX(Shape aShape)
      Constructor with given shape.
  • Method Details

    • getSegment

      public Segment getSegment(int anIndex, Transform aTrans)
      Returns the segment at index.
    • getSegAndSegmentPointsForIndex

      public Seg getSegAndSegmentPointsForIndex(int anIndex, double[] theCoords, Transform aTrans)
      Returns all points (start/control/end) for a given seg index, by copying to given array (should be length of 8).
    • getArcLength

      public double getArcLength()
      Returns the total arc length of path.
      Overrides:
      getArcLength in class Shape
    • getSegArcLength

      public double getSegArcLength(int anIndex)
      Returns the total arc length of path.
    • getArcLengths

      public double[] getArcLengths()
      Returns the lengths array.
    • shapeChanged

      protected void shapeChanged()
      Override to clear ArcLengths.
      Overrides:
      shapeChanged in class Shape