Package snap.geom
Class Path2DX
java.lang.Object
snap.geom.Shape
snap.geom.ShapeBuilder
snap.geom.Path2D
snap.geom.Path2DX
- All Implemented Interfaces:
Cloneable
This extended Path2D provides extra features like ArcLength measurement.
-
Field Summary
Fields inherited from class snap.geom.Path2D
_pointCount, _points, _segCount, _segPointIndexes, _segs
Fields inherited from class snap.geom.Shape
_bounds, WIND_EVEN_ODD, WIND_NON_ZERO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the total arc length of path.double[]
Returns the lengths array.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).double
getSegArcLength
(int anIndex) Returns the total arc length of path.getSegment
(int anIndex, Transform aTrans) Returns the segment at index.protected void
Override to clear ArcLengths.Methods inherited from class snap.geom.Path2D
addPoint, addSeg, clear, clone, close, copyFor, curveTo, equals, fitToCurveFromPointIndex, getLastPoint, getLastPointX, getLastPointY, getLastSeg, getPathIter, getPoint, getPointCount, getSeg, getSegAndPointsForIndex, getSegCount, getSegIndexForPointIndex, getSegPointIndex, getWinding, lineTo, moveTo, quadTo, removeLastSeg, setPoint, setWinding
Methods inherited from class snap.geom.ShapeBuilder
appendPathIter, appendSegment, appendShape, appendSvgString, arcTo, curveToFlat, hlineTo, lineBy, quadToFlat, vlineTo
Methods inherited from class snap.geom.Shape
addShapes, contains, contains, contains, contains, containsSeg, copyFor, copyForBounds, crossesSeg, getBounds, getBoundsImpl, getCrossings, getDistance, getFlattenedShape, getFlattenedShape, getHeight, getNotSelfIntersectingShape, getSvgString, getWidth, getX, getY, intersectShapes, intersectsSeg, intersectsShape, intersectsShape, intersectsXY, isClosed, isFlat, isMultiCycle, isSelfIntersecting, isSingleCycle, subtractShapes, toString
-
Constructor Details
-
Path2DX
public Path2DX()Constructor. -
Path2DX
Constructor with given shape.
-
-
Method Details
-
getSegment
Returns the segment at index. -
getSegAndSegmentPointsForIndex
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 classShape
-
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 classShape
-